/* Copyright (C) 2005, 2010 - Cryptic Sea This file is part of Gish. Gish is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ void saveinputs(void) { if (numofreplayframes>=65535) return; replayframe[numofreplayframes].button=object[0].button; if (object[0].axis[0]==-1.0f) replayframe[numofreplayframes].button|=16; if (object[0].axis[0]==1.0f) replayframe[numofreplayframes].button|=32; if (object[0].axis[1]==-1.0f) replayframe[numofreplayframes].button|=64; if (object[0].axis[1]==1.0f) replayframe[numofreplayframes].button|=128; numofreplayframes++; } void loadinputs(void) { if (numofreplayframes>=65535) return; object[0].axis[0]=0.0f; object[0].axis[1]=0.0f; if ((replayframe[numofreplayframes].button&16)==16) object[0].axis[0]=-1.0f; if ((replayframe[numofreplayframes].button&32)==32) object[0].axis[0]=1.0f; if ((replayframe[numofreplayframes].button&64)==64) object[0].axis[1]=-1.0f; if ((replayframe[numofreplayframes].button&128)==128) object[0].axis[1]=1.0f; object[0].button=replayframe[numofreplayframes].button&15; numofreplayframes++; } void savereplay(int levelnum) { int count; int version; int changeddir; char filename[32]; count=0; while (count<12 && player[playernum].name[count]!=0) { filename[count]=player[playernum].name[count]; count++; } filename[count]='-'; count++; if (levelnum<100) { filename[count]='C'; count++; filename[count]=48+levelnum/10; count++; filename[count]=48+levelnum%10; count++; } else { filename[count]=48+(levelnum-100)/10; count++; filename[count]=48+(levelnum-100)%10; count++; } filename[count]='.'; count++; filename[count]='g'; count++; filename[count]='r'; count++; filename[count]='e'; count++; filename[count]=0; count++; changeddir=chdir("replay"); if ((fp=fopen(filename,"wb"))!=NULL) { version=1; fwrite2(&version,4,1,fp); fwrite2(&levelnum,4,1,fp); fwrite2(&numofreplayframes,4,1,fp); if (numofreplayframes<65536) for (count=0;count=numoffiles) setmenuitem(MO_HIGHLIGHT,0); checksystemmessages(); checkkeyboard(); checkmouse(); checkjoystick(); checkmenuitems(); setuptextdisplay(); glColor4f(1.0f,1.0f,1.0f,1.0f); displaybackground(620); drawtext(TXT_REPLAY_MODE,(320|TEXT_CENTER),304,16,1.0f,1.0f,1.0f,1.0f); drawmenuitems(); drawmousecursor(768+font.cursornum,mouse.x,mouse.y,16,1.0f,1.0f,1.0f,1.0f); SDL_GL_SwapBuffers(); for (count=1;count<=24;count++) if (pagenum+count-1