diff --git a/desmume/src/GPU_osd.cpp b/desmume/src/GPU_osd.cpp index 5044a78d7..f978a45a9 100644 --- a/desmume/src/GPU_osd.cpp +++ b/desmume/src/GPU_osd.cpp @@ -157,4 +157,4 @@ void OSDCLASS::addFixed(u16 x, u16 y, const char *fmt, ...) } old_msg[512]=0; needUpdate = true; -} \ No newline at end of file +} diff --git a/desmume/src/GPU_osd.h b/desmume/src/GPU_osd.h index cc8528ba1..e617cbfe3 100644 --- a/desmume/src/GPU_osd.h +++ b/desmume/src/GPU_osd.h @@ -67,4 +67,4 @@ extern OSDCLASS *osd; extern OSDCLASS *osdA; extern OSDCLASS *osdB; -#endif \ No newline at end of file +#endif diff --git a/desmume/src/gfx3d.h b/desmume/src/gfx3d.h index ed070b804..65cf465e1 100644 --- a/desmume/src/gfx3d.h +++ b/desmume/src/gfx3d.h @@ -90,9 +90,9 @@ struct GFX3D } BOOL enableTexturing, enableAlphaTest, enableAlphaBlending, enableAntialiasing, enableEdgeMarking; - enum : u32 { - TOON, HIGHLIGHT - } shading; + static const u32 TOON = 0; + static const u32 HIGHLIGHT = 0; + u32 shading; POLYLIST* polylist; VERTLIST* vertlist; diff --git a/desmume/src/saves.cpp b/desmume/src/saves.cpp index 5876f00e2..bc78f1764 100644 --- a/desmume/src/saves.cpp +++ b/desmume/src/saves.cpp @@ -314,12 +314,13 @@ static bool ReadStateChunk(std::istream* is, SFORMAT *sf, int size) return false; read32le(&tsize,is); + int count = SS_UNMULT(tsize); + int size = tsize & ~SS_FLAGS; + bool rlsb = (count!=0); if((tmp=CheckS(sf,tsize,toa))) { - int count = SS_UNMULT(tsize); - int size = tsize & ~SS_FLAGS; - bool rlsb = (count!=0); + if(count == 0) count=1; @@ -337,7 +338,7 @@ static bool ReadStateChunk(std::istream* is, SFORMAT *sf, int size) } } else - is->seekg(tsize,std::ios::cur); + is->seekg(size*count,std::ios::cur); } // while(...) return true; } @@ -591,4 +592,4 @@ bool savestate_load(const char *file_name) if(!f) return false; return savestate_load(&f); -} \ No newline at end of file +}