1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-24 05:17:17 +00:00

charstyle format depending on vernum

This commit is contained in:
Zeno Rogue 2019-05-22 00:21:22 +02:00
parent 1b93ecd5a3
commit ba91bea71c
2 changed files with 18 additions and 23 deletions

View File

@ -38,6 +38,8 @@ struct charstyle_old {
}; };
void hread(hstream& hs, charstyle& cs) { void hread(hstream& hs, charstyle& cs) {
// before 0xA61A there was no eyecolor
if(hs.vernum < 0xA61A) {
charstyle_old cso; charstyle_old cso;
hread_raw(hs, cso); hread_raw(hs, cso);
cs.charid = cso.charid; cs.charid = cso.charid;
@ -50,18 +52,11 @@ void hread(hstream& hs, charstyle& cs) {
cs.uicolor = cso.uicolor; cs.uicolor = cso.uicolor;
cs.lefthanded = cso.lefthanded; cs.lefthanded = cso.lefthanded;
} }
else hread_raw(hs, cs);
}
void hwrite(hstream& hs, const charstyle& cs) { void hwrite(hstream& hs, const charstyle& cs) {
charstyle_old cso; hwrite_raw(hs, cs);
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);
} }
// void hread(hstream& hs, charstyle& cs) { hread_raw(hs, cs); } // void hread(hstream& hs, charstyle& cs) { hread_raw(hs, cs); }

View File

@ -2,8 +2,8 @@
// It is quite chaotic. // It is quite chaotic.
// version numbers // version numbers
#define VER "11.0y" #define VER "11.0z"
#define VERNUM_HEX 0xA619 #define VERNUM_HEX 0xA61A
#include <stdarg.h> #include <stdarg.h>
#include "hyper_function.h" #include "hyper_function.h"