diff --git a/demos/1.cdgz b/demos/1.cdgz new file mode 100644 index 00000000..3db56bb2 Binary files /dev/null and b/demos/1.cdgz differ diff --git a/source/src/main.cpp b/source/src/main.cpp index 6f5e86e7..3e072c4e 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -229,9 +229,7 @@ int main(int argc, char **argv) SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, fsaa); } -#if SDL_VERSION_ATLEAST(1, 2, 11) if(vsync>=0) SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, vsync); -#endif int resize = SDL_RESIZABLE; #if defined(WIN32) || defined(__APPLE__) @@ -328,8 +326,6 @@ int main(int argc, char **argv) initlog("docs"); execfile("config/docs.cfg"); - execute("start_game"); - initlog("localconnect"); localconnect(); changemap("maps/ac_complex"); diff --git a/source/src/savegamedemo.cpp b/source/src/savegamedemo.cpp index c5ca6f2a..dee3a5a5 100644 --- a/source/src/savegamedemo.cpp +++ b/source/src/savegamedemo.cpp @@ -167,6 +167,7 @@ void incomingdemodata(int chan, uchar *buf, int len, bool extras) gzput(player1->gunselect); gzput(player1->lastattackgun); gzputi(player1->gunwait); + ASSERT(player1->lastaction == 0 || player1->lastaction-starttime >= 0); gzputi(player1->lastaction-starttime); gzputi(player1->lastanimswitchtime[0]-starttime); gzputi(player1->lastanimswitchtime[1]-starttime); @@ -316,18 +317,19 @@ void demoplaybackstep() target->lastattackgun = gzget(); target->gunwait = gzgeti(); target->lastaction = scaletime(gzgeti()); - target->lastanimswitchtime[0] = scaletime(gzgeti()); // AH,demo - target->lastanimswitchtime[1] = scaletime(gzgeti()); // AH,demo - loopi(NUMGUNS) { target->ammo[i] = gzget(); target->mag[i] = gzget(); } // AH,demo + ASSERT(target->lastaction >= 0); + target->lastanimswitchtime[0] = scaletime(gzgeti()); + target->lastanimswitchtime[1] = scaletime(gzgeti()); + loopi(NUMGUNS) { target->ammo[i] = gzget(); target->mag[i] = gzget(); } uchar flags = gzget(); - target->akimbo = flags&1 ? true : false; // AH, demo - target->reloading = (flags>>1)&1 ? true : false; // AH,demo - target->weaponchanging = (flags>>2)&1 ? true : false; // + target->akimbo = flags&1 ? true : false; + target->reloading = (flags>>1)&1 ? true : false; + target->weaponchanging = (flags>>2)&1 ? true : false; switch(target->gunselect) { case GUN_GRENADE: - target->thrownademillis = scaletime(gzgeti()); // AH,demo - target->inhandnade = gzget() ? (bounceent *)1 : NULL; // AH,demo + target->thrownademillis = scaletime(gzgeti()); + target->inhandnade = gzget() ? (bounceent *)1 : NULL; break; case GUN_PISTOL: if(player1->akimbo) diff --git a/source/src/vertmodel.h b/source/src/vertmodel.h index 5a57a80e..01da25bb 100644 --- a/source/src/vertmodel.h +++ b/source/src/vertmodel.h @@ -14,6 +14,7 @@ struct vertmodel : model int time = lastmillis-as.basetime; fr1 = (int)(time/as.speed); // round to full frames t = (time-fr1*as.speed)/as.speed; // progress of the frame, value from 0.0f to 1.0f + ASSERT(t >= 0.0f); if(as.anim&ANIM_LOOP) { fr1 = fr1%as.range+as.frame;