mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
charstyle format depending on vernum
This commit is contained in:
parent
1b93ecd5a3
commit
ba91bea71c
37
config.cpp
37
config.cpp
@ -38,30 +38,25 @@ struct charstyle_old {
|
||||
};
|
||||
|
||||
void hread(hstream& hs, charstyle& cs) {
|
||||
charstyle_old cso;
|
||||
hread_raw(hs, cso);
|
||||
cs.charid = cso.charid;
|
||||
cs.skincolor = cso.skincolor;
|
||||
cs.haircolor = cso.haircolor;
|
||||
cs.dresscolor = cso.dresscolor;
|
||||
cs.swordcolor = cs.eyecolor = cso.swordcolor;
|
||||
if(cs.charid < 4) cs.eyecolor = 0;
|
||||
cs.dresscolor2 = cso.dresscolor2;
|
||||
cs.uicolor = cso.uicolor;
|
||||
cs.lefthanded = cso.lefthanded;
|
||||
// before 0xA61A there was no eyecolor
|
||||
if(hs.vernum < 0xA61A) {
|
||||
charstyle_old cso;
|
||||
hread_raw(hs, cso);
|
||||
cs.charid = cso.charid;
|
||||
cs.skincolor = cso.skincolor;
|
||||
cs.haircolor = cso.haircolor;
|
||||
cs.dresscolor = cso.dresscolor;
|
||||
cs.swordcolor = cs.eyecolor = cso.swordcolor;
|
||||
if(cs.charid < 4) cs.eyecolor = 0;
|
||||
cs.dresscolor2 = cso.dresscolor2;
|
||||
cs.uicolor = cso.uicolor;
|
||||
cs.lefthanded = cso.lefthanded;
|
||||
}
|
||||
else hread_raw(hs, cs);
|
||||
}
|
||||
|
||||
void hwrite(hstream& hs, const charstyle& cs) {
|
||||
charstyle_old cso;
|
||||
cso.charid = cs.charid;
|
||||
cso.skincolor = cs.skincolor;
|
||||
cso.haircolor = cs.haircolor;
|
||||
cso.dresscolor = cs.dresscolor;
|
||||
cso.swordcolor = cs.charid >= 4 ? cs.eyecolor : cs.swordcolor;
|
||||
cso.dresscolor2 = cs.dresscolor2;
|
||||
cso.uicolor = cs.uicolor;
|
||||
cso.lefthanded = cs.lefthanded;
|
||||
hwrite_raw(hs, cso);
|
||||
hwrite_raw(hs, cs);
|
||||
}
|
||||
|
||||
// void hread(hstream& hs, charstyle& cs) { hread_raw(hs, cs); }
|
||||
|
Loading…
Reference in New Issue
Block a user