Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27581/src Modified Files: data.c mswindow.c playback.c socket.c Log Message: Fix bug with custom color palette (forcedisplay = 2) and double buffer init. Fix bug with playback - not responding to keyboard (default keymap was improperly set). Fix bug with playback - crashes. Culprit was not recording login packet so wrong packet types were being used (login packet tells client if server is paradise or bronco and uses packet types accordingly). Fix bug with playback - don't record generic32 if server is paradise, as this is the MOTD pic packet. Added some support to reverse playback for new packet types - still work to be done for paradise packets. Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -r1.91 -r1.92 --- mswindow.c 9 Jan 2009 03:34:07 -0000 1.91 +++ mswindow.c 12 Feb 2009 03:48:25 -0000 1.92 @@ -6106,6 +6106,11 @@ sdb->old_bmp = (HBITMAP) SelectObject (sdb->mem_dc, sdb->mem_bmp); + if (NetrekPalette) + { + SelectPalette (sdb->mem_dc, NetrekPalette, FALSE); + RealizePalette (sdb->mem_dc); + } FillRect (sdb->mem_dc, &sdb->wr, colortable[W_Black].brush); return 1; Index: playback.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/playback.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- playback.c 19 Apr 2008 16:23:00 -0000 1.26 +++ playback.c 12 Feb 2009 03:48:25 -0000 1.27 @@ -197,6 +197,20 @@ if ((stringDefault ("indshipHRbmpfile")) != NULL) ind_ship_bmp_HR = stringDefault ("indshipHRbmpfile"); + for (i = 0; i < 95; i++) + { + default_keymap[i] = (unsigned char) (i + 32); + default_keymap[i + 96] = (unsigned char) (i + 32 + 96); + +#ifdef MOUSE_AS_SHIFT + default_keymap[i + 192] = (unsigned char) (i + 32); + default_keymap[i + 288] = (unsigned char) (i + 32); + default_keymap[i + 384] = (unsigned char) (i + 32); + default_keymap[i + 480] = (unsigned char) (i + 32); + default_keymap[i + 576] = (unsigned char) (i + 32); +#endif + } + default_keymap[95] = 0; resetdefaults (); build_default_configuration(); @@ -240,20 +254,7 @@ MZERO (mystats, sizeof (struct stats)); mystats->st_tticks = 1; - for (i = 0; i < 95; i++) - { - default_keymap[i] = (unsigned char) (i + 32); - default_keymap[i + 96] = (unsigned char) (i + 32 + 96); -#ifdef MOUSE_AS_SHIFT - default_keymap[i + 192] = (unsigned char) (i + 32); - default_keymap[i + 288] = (unsigned char) (i + 32); - default_keymap[i + 384] = (unsigned char) (i + 32); - default_keymap[i + 480] = (unsigned char) (i + 32); - default_keymap[i + 576] = (unsigned char) (i + 32); -#endif - } - default_keymap[95] = 0; mystats->st_flags = ST_MAPMODE + ST_NAMEMODE + ST_SHOWSHIELDS + ST_KEEPPEACE + ST_SHOWLOCAL * 2 + ST_SHOWGLOBAL * 2; @@ -491,6 +492,7 @@ case SP_YOU: case SP_STATUS: case SP_PLANET: + case SP_LOGIN: case SP_FLAGS: case SP_MASK: case SP_PSTATUS: @@ -506,7 +508,6 @@ case SP_S_YOU_SS: case SP_S_PLAYER: case SP_SHIP_CAP: - case SP_GENERIC_32: case SP_S_TORP: case SP_S_TORP_INFO: case SP_S_8_TORP: @@ -527,6 +528,10 @@ case SP_TERRAIN2: case SP_TERRAIN_INFO2: return 1; + case SP_GENERIC_32: + if (!paradise) /* MOTD pic */ + return 1; + break; } return 0; } @@ -729,7 +734,10 @@ */ #define RPB_NORMAL_SEQUENCE 0 #define RPB_NORMAL_STATUS 1 -#define RPB_NORMAL_MAX 2 +#define RPB_NORMAL_SHIPCAP 2 +#define RPB_NORMAL_GENERIC32 3 +#define RPB_NORMAL_FEATURE 4 +#define RPB_NORMAL_MAX 5 #define RPB_PLAYER_OFFSET (RPB_NORMAL_MAX) #define RPB_PLAYER_INFO 0 @@ -745,6 +753,19 @@ #define RPB_PLAYER_PHASER 10 #define RPB_PLAYER_MAX 11 +/* TODO: add to rpb +SP_SCAN: +SP_STATS2: +SP_STATUS2: +SP_PLANET2: +SP_THINGY: +SP_THINGY_INFO: +SP_GPARAM: +SP_PARADISE_EXT1: +SP_TERRAIN2: +SP_TERRAIN_INFO2: +*/ + #define RPB_PLASMA_OFFSET (RPB_PLAYER_OFFSET + RPB_PLAYER_MAX*MAXPLAYER) #define RPB_PLASMA_POSITION 0 #define RPB_PLASMA_INFO 1 @@ -823,6 +844,15 @@ case SP_SC_SEQUENCE: rpb_insert (diskpos, RPB_NORMAL_SEQUENCE); break; + case SP_SHIP_CAP: + rpb_insert (diskpos, RPB_NORMAL_SHIPCAP); + break; + case SP_GENERIC_32: + rpb_insert (diskpos, RPB_NORMAL_GENERIC32); + break; + case SP_FEATURE: + rpb_insert (diskpos, RPB_NORMAL_FEATURE); + break; case SP_PLAYER_INFO: id = ((struct plyr_info_spacket *) packet)->pnum; Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- socket.c 16 Jul 2008 00:16:11 -0000 1.52 +++ socket.c 12 Feb 2009 03:48:25 -0000 1.53 @@ -88,7 +88,6 @@ static int vtsize[9] = { 4, 8, 8, 12, 12, 16, 20, 20, 24 }; /* How big is the torppacket */ static int vtdata[9] = { 0, 3, 5, 7, 9, 12, 14, 16, 18 }; /* How big is Torpdata */ int vtisize[9] = { 4, 7, 9, 11, 13, 16, 18, 20, 22 }; /* 4 byte Header + torpdata */ -static int login_received = 0; /* S_P2 */ int shortversion = SHORTVERSION; /* Which version do we use? */ Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.115 retrieving revision 1.116 diff -u -d -r1.115 -r1.116 --- data.c 9 Jan 2009 03:34:07 -0000 1.115 +++ data.c 12 Feb 2009 03:48:25 -0000 1.116 @@ -291,6 +291,7 @@ extern double Sin[], Cos[]; int paradise = 0; /* is the server a paradise server */ +int login_received = 0; int received_terrain_info = 0; int terrain_x; int terrain_y;