From a34a4901a95285f4e92e363641f4ffb86209e9d8 Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 21 Nov 2008 12:14:05 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1144 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/anim.c | 4 +- polymer/eduke32/source/astub.c | 2 +- polymer/eduke32/source/funct.h | 4 +- polymer/eduke32/source/game.c | 144 +++++++++---------- polymer/eduke32/source/gameexec.c | 14 +- polymer/eduke32/source/global.c | 2 +- polymer/eduke32/source/jmact/_control.h | 22 +-- polymer/eduke32/source/jmact/control.c | 17 +-- polymer/eduke32/source/jmact/control.h | 21 +-- polymer/eduke32/source/osdcmds.c | 4 +- polymer/eduke32/source/player.c | 180 ++++++++++++------------ polymer/eduke32/source/premap.c | 18 +-- polymer/eduke32/source/sync.c | 90 ++++++------ 13 files changed, 245 insertions(+), 277 deletions(-) diff --git a/polymer/eduke32/source/anim.c b/polymer/eduke32/source/anim.c index fd00afa9c..ad5ead9ce 100644 --- a/polymer/eduke32/source/anim.c +++ b/polymer/eduke32/source/anim.c @@ -250,7 +250,7 @@ void G_PlayAnim(const char *fn,char t) //setpalette(0L,256L,tempbuf); //setbrightness(ud.brightness>>2,tempbuf,2); - SetGamePalette(g_player[myconnectindex].ps,animpal,10); + P_SetGamePalette(g_player[myconnectindex].ps,animpal,10); #if defined(POLYMOST) && defined(USE_OPENGL) gltexfiltermode = 0; @@ -277,7 +277,7 @@ void G_PlayAnim(const char *fn,char t) getpackets(); if (g_restorePalette == 1) { - SetGamePalette(g_player[myconnectindex].ps,animpal,0); + P_SetGamePalette(g_player[myconnectindex].ps,animpal,0); g_restorePalette = 0; } idle(); diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index eb0c2b85f..3cab3c864 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -44,7 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #endif -#define BUILDDATE " 20081116" +#define BUILDDATE " 20081121" #define VERSION " 1.2.0devel" static int floor_over_floor; diff --git a/polymer/eduke32/source/funct.h b/polymer/eduke32/source/funct.h index eedf7d710..a497ecc22 100644 --- a/polymer/eduke32/source/funct.h +++ b/polymer/eduke32/source/funct.h @@ -97,7 +97,7 @@ extern int A_GetHitscanRange(int i); extern int A_CheckHitSprite(int i,short *hitsp); extern int A_Shoot(int i,int atwith); extern void P_DisplayScubaMask(int snum); -extern void P_DisplayWeapons(int snum); +extern void P_DisplayWeapon(int snum); extern void getinput(int snum); extern void P_DropWeapon(DukePlayer_t *p); extern void P_ProcessInput(int snum); @@ -186,7 +186,7 @@ extern void A_MoveDummyPlayers(void); // game.c extern inline void G_SetStatusBarScale(int sc); -extern void SetGamePalette(DukePlayer_t *player, char *pal, int set); +extern void P_SetGamePalette(DukePlayer_t *player, char *pal, int set); extern void fadepal(int r, int g, int b, int start, int end, int step); extern inline int gametext_z(int small, int starttile, int x,int y,const char *t,int s,int p,int orientation,int x1, int y1, int x2, int y2,int z); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index f26dc32d4..09eb660af 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -215,7 +215,7 @@ int G_GetVersionFromWebsite(char *buffer) // FIXME: this probably belongs in gam initprintf("update: socket() error in G_GetVersionFromWebsite() (%d)\n",errno); return(0); } - initprintf("Connecting to \"http://%s\"\n",host); + initprintf("Connecting to http://%s\n",host); if (connect(mysock, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr)) == SOCKET_ERROR) { initprintf("update: connect() error in G_GetVersionFromWebsite() (%d)\n",errno); @@ -355,7 +355,7 @@ static inline int textsc(int sc) return scale(sc,ud.textscale,100); } -static void patchstatusbar(int x1, int y1, int x2, int y2) +static void G_PatchStatusBar(int x1, int y1, int x2, int y2) { int scl, tx, ty; int clx1,cly1,clx2,cly2,clofx,clofy; @@ -376,7 +376,7 @@ static void patchstatusbar(int x1, int y1, int x2, int y2) // else rotatesprite(tx,ty,scl,0,BOTTOMSTATUSBAR,4,0,10+16+64,clx1,cly1,clx2+clofx-1,cly2+clofy-1); } -void SetGamePalette(DukePlayer_t *player, char *pal, int set) +void P_SetGamePalette(DukePlayer_t *player, char *pal, int set) { if (player != g_player[screenpeek].ps) { @@ -775,7 +775,7 @@ void getpackets(void) { if (i != myconnectindex) { - for (sb = 0; sb < NumSyncBytes; sb++) + for (sb = 0; sb < g_numSyncBytes; sb++) { g_player[i].syncval[g_player[i].syncvalhead & (SYNCFIFOSIZ - 1)][sb] = packbuf[j + sb]; } @@ -784,10 +784,10 @@ void getpackets(void) } } - j += NumSyncBytes; + j += g_numSyncBytes; } */ - GetSyncInfoFromPacket(packbuf, packbufleng, &j, other); + Net_GetSyncInfoFromPacket(packbuf, packbufleng, &j, other); TRAVERSE_CONNECT(i) if (i != myconnectindex) @@ -828,7 +828,7 @@ void getpackets(void) g_player[other].syncval[g_player[other].syncvalhead&(MOVEFIFOSIZ-1)] = packbuf[j++]; g_player[other].syncvalhead++; } */ - GetSyncInfoFromPacket(packbuf, packbufleng, &j, other); + Net_GetSyncInfoFromPacket(packbuf, packbufleng, &j, other); for (i=g_movesPerPacket-1;i>=1;i--) { @@ -888,7 +888,7 @@ void getpackets(void) g_player[other].syncvalhead++; } */ - GetSyncInfoFromPacket(packbuf, packbufleng, &j, other); + Net_GetSyncInfoFromPacket(packbuf, packbufleng, &j, other); if (j > packbufleng) initprintf("INVALID GAME PACKET!!! (packet %d, %d too many bytes (%d %d))\n",packbuf[0],j-packbufleng,packbufleng,k); @@ -1392,7 +1392,7 @@ void faketimerhandler(void) syncvaltail++; } */ - AddSyncInfoToPacket(&j); + Net_AddSyncInfoToPacket(&j); TRAVERSE_CONNECT(i) if (i != myconnectindex) @@ -1477,7 +1477,7 @@ void faketimerhandler(void) packbuf[j++] = g_player[myconnectindex].syncval[syncvaltail&(MOVEFIFOSIZ-1)]; syncvaltail++; } */ - AddSyncInfoToPacket(&j); + Net_AddSyncInfoToPacket(&j); sendpacket(connecthead,packbuf,j); return; @@ -1566,7 +1566,7 @@ void faketimerhandler(void) packbuf[j++] = g_player[myconnectindex].syncval[syncvaltail&(MOVEFIFOSIZ-1)]; syncvaltail++; } */ - AddSyncInfoToPacket(&j); + Net_AddSyncInfoToPacket(&j); for (i=connectpoint2[connecthead];i>=0;i=connectpoint2[i]) if (g_player[i].playerquitflag) @@ -1787,14 +1787,14 @@ static void G_DrawWeapAmounts(DukePlayer_t *p,int x,int y,int u) if (u&4) { - if (u != -1) patchstatusbar(88,178,88+37,178+6); //original code: (96,178,96+12,178+6); + if (u != -1) G_PatchStatusBar(88,178,88+37,178+6); //original code: (96,178,96+12,178+6); G_DrawWeapNum2(PISTOL_WEAPON,x,y, p->ammo_amount[PISTOL_WEAPON],p->max_ammo_amount[PISTOL_WEAPON], 12-20*(cw == PISTOL_WEAPON)); } if (u&8) { - if (u != -1) patchstatusbar(88,184,88+37,184+6); //original code: (96,184,96+12,184+6); + if (u != -1) G_PatchStatusBar(88,184,88+37,184+6); //original code: (96,184,96+12,184+6); G_DrawWeapNum2(SHOTGUN_WEAPON,x,y+6, p->ammo_amount[SHOTGUN_WEAPON],p->max_ammo_amount[SHOTGUN_WEAPON], (!p->gotweapon[SHOTGUN_WEAPON]*9)+12-18* @@ -1802,7 +1802,7 @@ static void G_DrawWeapAmounts(DukePlayer_t *p,int x,int y,int u) } if (u&16) { - if (u != -1) patchstatusbar(88,190,88+37,190+6); //original code: (96,190,96+12,190+6); + if (u != -1) G_PatchStatusBar(88,190,88+37,190+6); //original code: (96,190,96+12,190+6); G_DrawWeapNum2(CHAINGUN_WEAPON,x,y+12, p->ammo_amount[CHAINGUN_WEAPON],p->max_ammo_amount[CHAINGUN_WEAPON], (!p->gotweapon[CHAINGUN_WEAPON]*9)+12-18* @@ -1810,7 +1810,7 @@ static void G_DrawWeapAmounts(DukePlayer_t *p,int x,int y,int u) } if (u&32) { - if (u != -1) patchstatusbar(127,178,127+29,178+6); //original code: (135,178,135+8,178+6); + if (u != -1) G_PatchStatusBar(127,178,127+29,178+6); //original code: (135,178,135+8,178+6); G_DrawWeapNum(RPG_WEAPON,x+39,y, p->ammo_amount[RPG_WEAPON],p->max_ammo_amount[RPG_WEAPON], (!p->gotweapon[RPG_WEAPON]*9)+12-19* @@ -1818,7 +1818,7 @@ static void G_DrawWeapAmounts(DukePlayer_t *p,int x,int y,int u) } if (u&64) { - if (u != -1) patchstatusbar(127,184,127+29,184+6); //original code: (135,184,135+8,184+6); + if (u != -1) G_PatchStatusBar(127,184,127+29,184+6); //original code: (135,184,135+8,184+6); G_DrawWeapNum(HANDBOMB_WEAPON,x+39,y+6, p->ammo_amount[HANDBOMB_WEAPON],p->max_ammo_amount[HANDBOMB_WEAPON], (((!p->ammo_amount[HANDBOMB_WEAPON])|(!p->gotweapon[HANDBOMB_WEAPON]))*9)+12-19* @@ -1826,7 +1826,7 @@ static void G_DrawWeapAmounts(DukePlayer_t *p,int x,int y,int u) } if (u&128) { - if (u != -1) patchstatusbar(127,190,127+29,190+6); //original code: (135,190,135+8,190+6); + if (u != -1) G_PatchStatusBar(127,190,127+29,190+6); //original code: (135,190,135+8,190+6); if (p->subweapon&(1<ammo_amount[DEVISTATOR_WEAPON],p->max_ammo_amount[DEVISTATOR_WEAPON], @@ -1850,7 +1850,7 @@ static void G_DrawWeapAmounts(DukePlayer_t *p,int x,int y,int u) } if (u&512) { - if (u != -1) patchstatusbar(158,184,162+29,184+6); //original code: (166,184,166+8,184+6); + if (u != -1) G_PatchStatusBar(158,184,162+29,184+6); //original code: (166,184,166+8,184+6); G_DrawWeapNum(TRIPBOMB_WEAPON,x+70,y+6, p->ammo_amount[TRIPBOMB_WEAPON],p->max_ammo_amount[TRIPBOMB_WEAPON], @@ -1860,7 +1860,7 @@ static void G_DrawWeapAmounts(DukePlayer_t *p,int x,int y,int u) if (u&65536L) { - if (u != -1) patchstatusbar(158,190,162+29,190+6); //original code: (166,190,166+8,190+6); + if (u != -1) G_PatchStatusBar(158,190,162+29,190+6); //original code: (166,190,166+8,190+6); G_DrawWeapNum(-1,x+70,y+12, p->ammo_amount[FREEZE_WEAPON],p->max_ammo_amount[FREEZE_WEAPON], @@ -2487,7 +2487,7 @@ static void G_DrawStatusBar(int snum) if (u == -1) { - patchstatusbar(0,0,320,200); + G_PatchStatusBar(0,0,320,200); if (ud.multimode > 1 && (GametypeFlags[ud.coop] & GAMETYPE_FRAGBAR)) rotatesprite(sbarx(277+1),sbary(SBY+7-1),sbarsc(65536L),0,KILLSICON,0,0,10+16,0,0,xdim-1,ydim-1); } @@ -2495,7 +2495,7 @@ static void G_DrawStatusBar(int snum) { if (u&32768) { - if (u != -1) patchstatusbar(276,SBY+17,299,SBY+17+10); + if (u != -1) G_PatchStatusBar(276,SBY+17,299,SBY+17+10); G_DrawDigiNum(287,SBY+17,max(p->frag-p->fraggedself,0),-16,10+16); } } @@ -2503,7 +2503,7 @@ static void G_DrawStatusBar(int snum) { if (u&16384) { - if (u != -1) patchstatusbar(275,SBY+18,299,SBY+18+12); + if (u != -1) G_PatchStatusBar(275,SBY+18,299,SBY+18+12); if (p->got_access&4) rotatesprite(sbarx(275),sbary(SBY+16),sbarsc(65536L),0,ACCESS_ICON,0,23,10+16,0,0,xdim-1,ydim-1); if (p->got_access&2) rotatesprite(sbarx(288),sbary(SBY+16),sbarsc(65536L),0,ACCESS_ICON,0,21,10+16,0,0,xdim-1,ydim-1); if (p->got_access&1) rotatesprite(sbarx(281),sbary(SBY+23),sbarsc(65536L),0,ACCESS_ICON,0,0,10+16,0,0,xdim-1,ydim-1); @@ -2513,7 +2513,7 @@ static void G_DrawStatusBar(int snum) if (u&1) { - if (u != -1) patchstatusbar(20,SBY+17,43,SBY+17+11); + if (u != -1) G_PatchStatusBar(20,SBY+17,43,SBY+17+11); if (sprite[p->i].pal == 1 && p->last_extra < 2) G_DrawDigiNum(32,SBY+17,1,-16,10+16); else G_DrawDigiNum(32,SBY+17,p->last_extra,-16,10+16); @@ -2521,7 +2521,7 @@ static void G_DrawStatusBar(int snum) if (u&2) { int lAmount=Gv_GetVarByLabel("PLR_MORALE",-1, p->i, snum); - if (u != -1) patchstatusbar(52,SBY+17,75,SBY+17+11); + if (u != -1) G_PatchStatusBar(52,SBY+17,75,SBY+17+11); if (lAmount == -1) G_DrawDigiNum(64,SBY+17,p->shield_amount,-16,10+16); else @@ -2530,7 +2530,7 @@ static void G_DrawStatusBar(int snum) if (u&1024) { - if (u != -1) patchstatusbar(196,SBY+17,219,SBY+17+11); + if (u != -1) G_PatchStatusBar(196,SBY+17,219,SBY+17+11); if (p->curr_weapon != KNEE_WEAPON) { if (p->curr_weapon == HANDREMOTE_WEAPON) i = HANDBOMB_WEAPON; @@ -2545,11 +2545,11 @@ static void G_DrawStatusBar(int snum) { if (u&(2048+4096)) { - patchstatusbar(231,SBY+13,265,SBY+13+18); + G_PatchStatusBar(231,SBY+13,265,SBY+13+18); } else { - patchstatusbar(250,SBY+24,261,SBY+24+6); + G_PatchStatusBar(250,SBY+24,261,SBY+24+6); } } @@ -2878,7 +2878,7 @@ static void G_DisplayExtraScreens(void) setview(0,0,xdim-1,ydim-1); flushperms(); //g_player[myconnectindex].ps->palette = palette; - SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 fadepal(0,0,0, 0,64,7); KB_FlushKeyboardQueue(); rotatesprite(0,0,65536L,0,3291,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); @@ -2907,7 +2907,7 @@ static void G_DisplayExtraScreens(void) setview(0,0,xdim-1,ydim-1); flushperms(); //g_player[myconnectindex].ps->palette = palette; - SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 fadepal(0,0,0, 0,64,7); KB_FlushKeyboardQueue(); rotatesprite(0,0,65536L,0,TENSCREEN,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); @@ -3537,7 +3537,7 @@ static void G_DrawOverheadMap(int cposx, int cposy, int czoom, short cang) extern int getclosestcol(int r, int g, int b); palette_t CrosshairColors = { 255, 255, 255, 0 }; palette_t DefaultCrosshairColors = { 0, 0, 0, 0 }; -int crosshair_sum; +int g_crosshairSum = 0; void G_GetCrosshairColor(void) { @@ -3582,9 +3582,9 @@ void G_SetCrosshairColor(int r, int g, int b) char *ptr = (char *)waloff[CROSSHAIR]; int i, ii; - if (DefaultCrosshairColors.f == 0 || crosshair_sum == r+(g<<1)+(b<<2)) return; + if (DefaultCrosshairColors.f == 0 || g_crosshairSum == r+(g<<1)+(b<<2)) return; - crosshair_sum = r+(g<<1)+(b<<2); + g_crosshairSum = r+(g<<1)+(b<<2); CrosshairColors.r = r; CrosshairColors.g = g; CrosshairColors.b = b; @@ -3653,9 +3653,9 @@ void G_FadePalette(int r,int g,int b,int e) void G_DisplayRest(int smoothratio) { int a, i, j; - int dotint=0; - palette_t FadeTemp = { 0, 0, 0, 0 }; - palette_t TintTemp = { 0, 0, 0, 0 }; + int applyTint=0; + palette_t tempFade = { 0, 0, 0, 0 }; + palette_t tempTint = { 0, 0, 0, 0 }; DukePlayer_t *pp = g_player[screenpeek].ps; walltype *wal; @@ -3701,36 +3701,36 @@ void G_DisplayRest(int smoothratio) // this does pain tinting etc from the CON if (pp->pals_time >= 0 && pp->loogcnt == 0) // JBF 20040101: pals_time > 0 now >= 0 { - FadeTemp.r = pp->pals[0]; - FadeTemp.g = pp->pals[1]; - FadeTemp.b = pp->pals[2]; - FadeTemp.f = pp->pals_time; + tempFade.r = pp->pals[0]; + tempFade.g = pp->pals[1]; + tempFade.b = pp->pals[2]; + tempFade.f = pp->pals_time; g_restorePalette = 1; // JBF 20040101 - dotint = 1; + applyTint = 1; } // reset a normal palette else if (g_restorePalette) { //setbrightness(ud.brightness>>2,&pp->palette[0],0); - SetGamePalette(pp,pp->palette,2); + P_SetGamePalette(pp,pp->palette,2); g_restorePalette = 0; } // loogies courtesy of being snotted on else if (pp->loogcnt > 0) { //G_FadePalette(0,64,0,(pp->loogcnt>>1)+128); - FadeTemp.r = 0; - FadeTemp.g = 64; - FadeTemp.b = 0; - FadeTemp.f = pp->loogcnt>>1; - dotint = 1; + tempFade.r = 0; + tempFade.g = 64; + tempFade.b = 0; + tempFade.f = pp->loogcnt>>1; + applyTint = 1; } - if (FadeTemp.f > TintTemp.f) + if (tempFade.f > tempTint.f) { - TintTemp.r = FadeTemp.r; - TintTemp.g = FadeTemp.g; - TintTemp.b = FadeTemp.b; - TintTemp.f = FadeTemp.f; + tempTint.r = tempFade.r; + tempTint.g = tempFade.g; + tempTint.b = tempFade.b; + tempTint.f = tempFade.f; } if (ud.show_help) @@ -3757,7 +3757,7 @@ void G_DisplayRest(int smoothratio) } G_UpdateScreenArea(); } - if (TintTemp.f > 0 || dotint) G_FadePalette(TintTemp.r,TintTemp.g,TintTemp.b,TintTemp.f|128); + if (tempTint.f > 0 || applyTint) G_FadePalette(tempTint.r,tempTint.g,tempTint.b,tempTint.f|128); return; } @@ -3786,7 +3786,7 @@ void G_DisplayRest(int smoothratio) G_DrawCameraText(pp->newowner); else { - P_DisplayWeapons(screenpeek); + P_DisplayWeapon(screenpeek); if (pp->over_shoulder_on == 0) P_DisplayScubaMask(screenpeek); } @@ -4012,8 +4012,8 @@ void G_DisplayRest(int smoothratio) else M_DisplayMenus(); - if (TintTemp.f > 0 || dotint) - G_FadePalette(TintTemp.r,TintTemp.g,TintTemp.b,TintTemp.f|128); + if (tempTint.f > 0 || applyTint) + G_FadePalette(tempTint.r,tempTint.g,tempTint.b,tempTint.f|128); } static void G_DoThirdPerson(DukePlayer_t *pp, int *vx, int *vy,int *vz,short *vsectnum, int ang, int horiz) @@ -10035,7 +10035,7 @@ static void G_DisplayLogo(void) //G_FadePalette(0,0,0,63); if (logoflags & LOGO_3DRSCREEN) { - SetGamePalette(g_player[myconnectindex].ps, drealms, 11); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, drealms, 11); // JBF 20040308 rotatesprite(0,0,65536L,0,DREALMS,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); nextpage(); fadepal(0,0,0, 63,0,-7); @@ -10046,7 +10046,7 @@ static void G_DisplayLogo(void) getpackets(); if (g_restorePalette) { - SetGamePalette(g_player[myconnectindex].ps,g_player[myconnectindex].ps->palette,0); + P_SetGamePalette(g_player[myconnectindex].ps,g_player[myconnectindex].ps->palette,0); g_restorePalette = 0; } } @@ -10061,7 +10061,7 @@ static void G_DisplayLogo(void) if (logoflags & LOGO_TITLESCREEN) { //g_player[myconnectindex].ps->palette = titlepal; - SetGamePalette(g_player[myconnectindex].ps, titlepal, 11); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, titlepal, 11); // JBF 20040308 flushperms(); rotatesprite(0,0,65536L,0,BETASCREEN,0,0,2+8+16+64,0,0,xdim-1,ydim-1); KB_FlushKeyboardQueue(); @@ -10130,7 +10130,7 @@ static void G_DisplayLogo(void) getpackets(); if (g_restorePalette) { - SetGamePalette(g_player[myconnectindex].ps,g_player[myconnectindex].ps->palette,0); + P_SetGamePalette(g_player[myconnectindex].ps,g_player[myconnectindex].ps->palette,0); g_restorePalette = 0; } nextpage(); @@ -10147,7 +10147,7 @@ static void G_DisplayLogo(void) nextpage(); //g_player[myconnectindex].ps->palette = palette; - SetGamePalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308 S_PlaySound(NITEVISION_ONOFF); //G_FadePalette(0,0,0,0); @@ -11421,7 +11421,7 @@ void app_main(int argc,const char **argv) clearview(0L); //g_player[myconnectindex].ps->palette = palette; //G_FadePalette(0,0,0,0); - SetGamePalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308 rotatesprite(320<<15,200<<15,65536L,0,LOADSCREEN,0,0,2+8+64,0,0,xdim-1,ydim-1); menutext(160,105,0,0,"LOADING SAVED GAME..."); nextpage(); @@ -11518,7 +11518,7 @@ MAIN_LOOP_RESTART: if (g_player[myconnectindex].ps->gm&MODE_EOL || g_player[myconnectindex].ps->gm&MODE_RESTART) { - SetGamePalette(g_player[myconnectindex].ps, palette, 0); + P_SetGamePalette(g_player[myconnectindex].ps, palette, 0); P_UpdateScreenPal(g_player[myconnectindex].ps); if (g_player[myconnectindex].ps->gm&MODE_EOL) @@ -11613,7 +11613,7 @@ MAIN_LOOP_RESTART: if (debug_on) G_ShowCacheLocks(); // checksync(); - SyncStatMessage(); + Net_DisplaySyncMsg(); if (VOLUMEONE) { @@ -11861,7 +11861,7 @@ RECHECK: goto RECHECK; } fadepal(0,0,0, 0,63,7); - SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 G_DrawBackground(); M_DisplayMenus(); //g_player[myconnectindex].ps->palette = palette; @@ -12703,7 +12703,7 @@ static int G_DoMoveThings(void) } */ - getsyncstat(); + Net_GetSyncStat(); g_moveThingsCount++; @@ -12767,7 +12767,7 @@ static void G_DoOrderScreen(void) fadepal(0,0,0, 0,63,7); //g_player[myconnectindex].ps->palette = palette; - SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 KB_FlushKeyboardQueue(); rotatesprite(0,0,65536L,0,ORDERING,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); fadepal(0,0,0, 63,0,-7); @@ -12867,7 +12867,7 @@ void G_BonusScreen(int bonusonly) case 0: if (ud.lockout == 0) { - SetGamePalette(g_player[myconnectindex].ps, endingpal, 11); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, endingpal, 11); // JBF 20040308 clearview(0L); rotatesprite(0,50<<16,65536L,0,VICTORY1,0,0,2+8+16+64+128,0,0,xdim-1,ydim-1); nextpage(); @@ -12930,7 +12930,7 @@ void G_BonusScreen(int bonusonly) KB_FlushKeyboardQueue(); //g_player[myconnectindex].ps->palette = palette; - SetGamePalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308 rotatesprite(0,0,65536L,0,3292,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); IFISSOFTMODE fadepal(0,0,0, 63,0,-1); @@ -12964,7 +12964,7 @@ void G_BonusScreen(int bonusonly) setview(0,0,xdim-1,ydim-1); KB_FlushKeyboardQueue(); //g_player[myconnectindex].ps->palette = palette; - SetGamePalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308 rotatesprite(0,0,65536L,0,3293,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); IFISSOFTMODE fadepal(0,0,0, 63,0,-1); else nextpage(); @@ -13005,7 +13005,7 @@ void G_BonusScreen(int bonusonly) KB_FlushKeyBoardQueue(); //g_player[myconnectindex].ps->palette = palette; - SetGamePalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308 IFISSOFTMODE G_FadePalette(0,0,0,63); clearview(0L); menutext(160,60,0,0,"THANKS TO ALL OUR"); @@ -13135,7 +13135,7 @@ ENDANM: FRAGBONUS: //g_player[myconnectindex].ps->palette = palette; - SetGamePalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308 IFISSOFTMODE G_FadePalette(0,0,0,63); // JBF 20031228 KB_FlushKeyboardQueue(); totalclock = 0; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 02d98f3ba..6ddcf2a30 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -3810,13 +3810,13 @@ static int X_DoExecute(void) switch (j) { default: - case 0:SetGamePalette(g_player[g_p].ps,palette ,0);break; - case 1:SetGamePalette(g_player[g_p].ps,waterpal ,0);break; - case 2:SetGamePalette(g_player[g_p].ps,slimepal ,0);break; - case 3:SetGamePalette(g_player[g_p].ps,drealms ,0);break; - case 4:SetGamePalette(g_player[g_p].ps,titlepal ,0);break; - case 5:SetGamePalette(g_player[g_p].ps,endingpal,0);break; - case 6:SetGamePalette(g_player[g_p].ps,animpal ,0);break; + case 0:P_SetGamePalette(g_player[g_p].ps,palette ,0);break; + case 1:P_SetGamePalette(g_player[g_p].ps,waterpal ,0);break; + case 2:P_SetGamePalette(g_player[g_p].ps,slimepal ,0);break; + case 3:P_SetGamePalette(g_player[g_p].ps,drealms ,0);break; + case 4:P_SetGamePalette(g_player[g_p].ps,titlepal ,0);break; + case 5:P_SetGamePalette(g_player[g_p].ps,endingpal,0);break; + case 6:P_SetGamePalette(g_player[g_p].ps,animpal ,0);break; } break; diff --git a/polymer/eduke32/source/global.c b/polymer/eduke32/source/global.c index a3e17110f..80ff4be18 100644 --- a/polymer/eduke32/source/global.c +++ b/polymer/eduke32/source/global.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //------------------------------------------------------------------------- #include "duke3d.h" -char *s_builddate = "20081116"; +char *s_builddate = "20081121"; char *MusicPtr = NULL; int Musicsize; diff --git a/polymer/eduke32/source/jmact/_control.h b/polymer/eduke32/source/jmact/_control.h index c7304cd6e..b24813289 100644 --- a/polymer/eduke32/source/jmact/_control.h +++ b/polymer/eduke32/source/jmact/_control.h @@ -108,26 +108,10 @@ extern "C" { #define NORMALAXISSCALE (65536) -#define BUTTONSET(x,value) \ - (\ - ((x)>31) ?\ - (CONTROL_ButtonState2 |= (value<<((x)-32))) :\ - (CONTROL_ButtonState1 |= (value<<((x)&31)))\ - ) +#define BUTTONSET(x,value) (CONTROL_ButtonState |= ((uint64)value<<((uint64)(x)))) +#define BUTTONCLEAR(x) (CONTROL_ButtonState &= ~((uint64)1<<((uint64)(x)))) -#define BUTTONCLEAR(x) \ - (\ - ((x)>31) ?\ - (CONTROL_ButtonState2 &= (~(1<<((x)-32)))) :\ - (CONTROL_ButtonState1 &= (~(1<<((x)&31))))\ - ) - -#define BUTTONHELDSET(x,value)\ - (\ - ((x)>31) ?\ - (CONTROL_ButtonHeldState2 |= value<<((x)-32)) :\ - (CONTROL_ButtonHeldState1 |= value<<((x)&31))\ - ) +#define BUTTONHELDSET(x,value) (CONTROL_ButtonHeldState |= (uint64)(value<<((uint64)(x)))) #define LIMITCONTROL(x)\ {\ diff --git a/polymer/eduke32/source/jmact/control.c b/polymer/eduke32/source/jmact/control.c index 24e6bf03d..a659b2307 100644 --- a/polymer/eduke32/source/jmact/control.c +++ b/polymer/eduke32/source/jmact/control.c @@ -23,10 +23,8 @@ boolean CONTROL_JoyPresent = false; boolean CONTROL_JoystickEnabled = false; boolean CONTROL_MousePresent = false; boolean CONTROL_MouseEnabled = false; -uint32 CONTROL_ButtonState1 = 0; -uint32 CONTROL_ButtonHeldState1 = 0; -uint32 CONTROL_ButtonState2 = 0; -uint32 CONTROL_ButtonHeldState2 = 0; +uint64 CONTROL_ButtonState = 0; +uint64 CONTROL_ButtonHeldState = 0; // static int32 CONTROL_UserInputDelay = -1; static int32 CONTROL_MouseSensitivity = DEFAULTMOUSESENSITIVITY; @@ -898,9 +896,8 @@ void CONTROL_GetInput(ControlInfo *info) CONTROL_ButtonFunctionState(periphs); CONTROL_AxisFunctionState(periphs); - CONTROL_ButtonHeldState1 = CONTROL_ButtonState1; - CONTROL_ButtonHeldState2 = CONTROL_ButtonState2; - CONTROL_ButtonState1 = CONTROL_ButtonState2 = 0; + CONTROL_ButtonHeldState = CONTROL_ButtonState; + CONTROL_ButtonState = 0; CONTROL_ProcessBinds(); @@ -983,10 +980,8 @@ boolean CONTROL_Startup(controltype which, int32(*TimeFunction)(void), int32 tic initprintf("CONTROL_Startup: Joystick Present\n"); */ - CONTROL_ButtonState1 = 0; - CONTROL_ButtonState2 = 0; - CONTROL_ButtonHeldState1 = 0; - CONTROL_ButtonHeldState2 = 0; + CONTROL_ButtonState = 0; + CONTROL_ButtonHeldState = 0; memset(CONTROL_UserInputCleared, 0, sizeof(CONTROL_UserInputCleared)); diff --git a/polymer/eduke32/source/jmact/control.h b/polymer/eduke32/source/jmact/control.h index e0e4a07eb..afb75a048 100644 --- a/polymer/eduke32/source/jmact/control.h +++ b/polymer/eduke32/source/jmact/control.h @@ -46,18 +46,9 @@ extern "C" { #define MAXGAMEBUTTONS 64 -#define BUTTON(x) \ - ( \ - ((x)>31) ? \ - ((CONTROL_ButtonState2>>( (x) - 32) ) & 1) :\ - ((CONTROL_ButtonState1>> ((x) & 31) ) & 1) \ - ) -#define BUTTONHELD(x) \ - ( \ - ((x)>31) ? \ - ((CONTROL_ButtonHeldState2>>((x)-32)) & 1) :\ - ((CONTROL_ButtonHeldState1>>((x) & 31)) & 1)\ - ) +#define BUTTON(x) ((CONTROL_ButtonState>> ((uint64)(x)) ) & 1) +#define BUTTONHELD(x) ((CONTROL_ButtonHeldState>> ((uint64)(x)) ) & 1) + #define BUTTONJUSTPRESSED(x) \ ( BUTTON( x ) && !BUTTONHELD( x ) ) #define BUTTONRELEASED(x) \ @@ -145,10 +136,8 @@ extern boolean CONTROL_MousePresent; extern boolean CONTROL_JoyPresent; extern boolean CONTROL_MouseEnabled; extern boolean CONTROL_JoystickEnabled; -extern uint32 CONTROL_ButtonState1; -extern uint32 CONTROL_ButtonHeldState1; -extern uint32 CONTROL_ButtonState2; -extern uint32 CONTROL_ButtonHeldState2; +extern uint64 CONTROL_ButtonState; +extern uint64 CONTROL_ButtonHeldState; //*************************************************************************** diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index 816497457..ee26896b0 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -933,7 +933,7 @@ static int osdcmd_give(const osdfuncparm_t *parm) void onvideomodechange(int newmode) { char *pal; - extern int crosshair_sum; + extern int g_crosshairSum; if (newmode) { @@ -955,7 +955,7 @@ void onvideomodechange(int newmode) setbrightness(ud.brightness>>2, pal, 0); g_restorePalette = 1; - crosshair_sum = 0; + g_crosshairSum = 0; } static int osdcmd_usemousejoy(const osdfuncparm_t *parm) diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index e548abd52..0988b02c7 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -1876,7 +1876,7 @@ SKIPBULLETHOLE: return -1; } -static void displayloogie(int snum) +static void P_DisplaySpitAnim(int snum) { int i, a, x, y, z; @@ -1895,7 +1895,7 @@ static void displayloogie(int snum) } } -static int animatefist(int gs,int snum) +static int P_DisplayFistAnim(int gs,int snum) { int looking_arc,fisti,fistpal; int fistzoom, fistz; @@ -1929,7 +1929,7 @@ static int animatefist(int gs,int snum) #define weapsc(sc) scale(sc,ud.weaponscale,100) -static void myospalscaled(int x, int y, int tilenum, int shade, int orientation, int p) +static void G_DrawTileScaled(int x, int y, int tilenum, int shade, int orientation, int p) { int a = 0; int xoff = 192; @@ -1959,12 +1959,12 @@ static void myospalscaled(int x, int y, int tilenum, int shade, int orientation, weapsc(65536L),a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2); } -static void myospalw(int x, int y, int tilenum, int shade, int orientation, int p) +static void G_DrawWeaponTile(int x, int y, int tilenum, int shade, int orientation, int p) { if (!ud.drawweapon) return; else if (ud.drawweapon == 1) - myospalscaled(x,y,tilenum,shade,orientation,p); + G_DrawTileScaled(x,y,tilenum,shade,orientation,p); else if (ud.drawweapon == 2) { switch (g_currentweapon) @@ -1986,7 +1986,7 @@ static void myospalw(int x, int y, int tilenum, int shade, int orientation, int } } -static int animateknee(int gs,int snum) +static int P_DisplayKneeAnim(int gs,int snum) { static signed char knee_y[] = {0,-8,-16,-32,-64,-84,-108,-108,-108,-72,-32,-8}; int looking_arc, pal = g_player[snum].ps->palookup; @@ -2006,12 +2006,12 @@ static int animateknee(int gs,int snum) pal = g_player[snum].ps->palookup; } - myospalscaled(105+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1)+(knee_y[g_player[snum].ps->knee_incs]>>2),looking_arc+280-((g_player[snum].ps->horiz-g_player[snum].ps->horizoff)>>4),KNEE,gs,4+262144,pal); + G_DrawTileScaled(105+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1)+(knee_y[g_player[snum].ps->knee_incs]>>2),looking_arc+280-((g_player[snum].ps->horiz-g_player[snum].ps->horizoff)>>4),KNEE,gs,4+262144,pal); return 1; } -static int animateknuckles(int gs,int snum) +static int P_DisplayKnuckleAnim(int gs,int snum) { static char knuckle_frames[] = {0,1,2,2,3,3,3,2,2,1,0}; int looking_arc, pal = 0; @@ -2027,14 +2027,14 @@ static int animateknuckles(int gs,int snum) else if (g_player[snum].ps->cursectnum >= 0) pal = sector[g_player[snum].ps->cursectnum].floorpal; - myospalscaled(160+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1),looking_arc+180-((g_player[snum].ps->horiz-g_player[snum].ps->horizoff)>>4),CRACKKNUCKLES+knuckle_frames[g_player[snum].ps->knuckle_incs>>1],gs,4+262144,pal); + G_DrawTileScaled(160+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1),looking_arc+180-((g_player[snum].ps->horiz-g_player[snum].ps->horizoff)>>4),CRACKKNUCKLES+knuckle_frames[g_player[snum].ps->knuckle_incs>>1],gs,4+262144,pal); return 1; } int lastvisinc; -void DoFire(DukePlayer_t *p) +void P_FireWeapon(DukePlayer_t *p) { int i, snum = sprite[p->i].yvel; @@ -2092,7 +2092,7 @@ void DoFire(DukePlayer_t *p) } } -void DoSpawn(DukePlayer_t *p) +void P_DoWeaponSpawn(DukePlayer_t *p) { int j, snum = sprite[p->i].yvel; @@ -2131,7 +2131,7 @@ void P_DisplayScubaMask(int snum) } } -static int DisplayTipAnimation(int gs,int snum) +static int P_DisplayTipAnim(int gs,int snum) { int p,looking_arc; static short tip_y[] = {0,-8,-16,-32,-64,-84,-108,-108,-108,-108,-108,-108,-108,-108,-108,-108,-96,-72,-64,-32,-16}; @@ -2151,13 +2151,13 @@ static int DisplayTipAnimation(int gs,int snum) else p = wall[g_player[snum].ps->access_wallnum].pal; */ - myospalscaled(170+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1), + G_DrawTileScaled(170+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1), (tip_y[g_player[snum].ps->tipincs]>>1)+looking_arc+240-((g_player[snum].ps->horiz-g_player[snum].ps->horizoff)>>4),TIP+((26-g_player[snum].ps->tipincs)>>4),gs,262144,p); return 1; } -static int DisplayAccessAnimation(int gs,int snum) +static int P_DisplayAccessAnim(int gs,int snum) { static short access_y[] = {0,-8,-16,-32,-64,-84,-108,-108,-108,-108,-108,-108,-108,-108,-108,-108,-96,-72,-64,-32,-16}; int looking_arc; @@ -2175,9 +2175,9 @@ static int DisplayAccessAnimation(int gs,int snum) // p = wall[g_player[snum].ps->access_wallnum].pal; if ((g_player[snum].ps->access_incs-3) > 0 && (g_player[snum].ps->access_incs-3)>>3) - myospalscaled(170+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1)+(access_y[g_player[snum].ps->access_incs]>>2),looking_arc+266-((g_player[snum].ps->horiz-g_player[snum].ps->horizoff)>>4),HANDHOLDINGLASER+(g_player[snum].ps->access_incs>>3),gs,262144,p); + G_DrawTileScaled(170+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1)+(access_y[g_player[snum].ps->access_incs]>>2),looking_arc+266-((g_player[snum].ps->horiz-g_player[snum].ps->horizoff)>>4),HANDHOLDINGLASER+(g_player[snum].ps->access_incs>>3),gs,262144,p); else - myospalscaled(170+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1)+(access_y[g_player[snum].ps->access_incs]>>2),looking_arc+266-((g_player[snum].ps->horiz-g_player[snum].ps->horizoff)>>4),HANDHOLDINGACCESS,gs,4+262144,p); + G_DrawTileScaled(170+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1)+(access_y[g_player[snum].ps->access_incs]>>2),looking_arc+266-((g_player[snum].ps->horiz-g_player[snum].ps->horizoff)>>4),HANDHOLDINGACCESS,gs,4+262144,p); return 1; } @@ -2185,7 +2185,7 @@ static int DisplayAccessAnimation(int gs,int snum) static int fistsign; -void P_DisplayWeapons(int snum) +void P_DisplayWeapon(int snum) { int gun_pos, looking_arc, cw; int weapon_xoffset, i, j; @@ -2199,10 +2199,10 @@ void P_DisplayWeapons(int snum) gs = sprite[p->i].shade; if (gs > 24) gs = 24; - if (p->newowner >= 0 || ud.camerasprite >= 0 || p->over_shoulder_on > 0 || (sprite[p->i].pal != 1 && sprite[p->i].extra <= 0) || animatefist(gs,snum) || animateknuckles(gs,snum) || DisplayTipAnimation(gs,snum) || DisplayAccessAnimation(gs,snum)) + if (p->newowner >= 0 || ud.camerasprite >= 0 || p->over_shoulder_on > 0 || (sprite[p->i].pal != 1 && sprite[p->i].extra <= 0) || P_DisplayFistAnim(gs,snum) || P_DisplayKnuckleAnim(gs,snum) || P_DisplayTipAnim(gs,snum) || P_DisplayAccessAnim(gs,snum)) return; - animateknee(gs,snum); + P_DisplayKneeAnim(gs,snum); gun_pos = 80-(p->weapon_pos*p->weapon_pos); @@ -2254,9 +2254,9 @@ void P_DisplayWeapons(int snum) if (j < 6 || j > 12) - myospalscaled(weapon_xoffset+80-(p->look_ang>>1), + G_DrawTileScaled(weapon_xoffset+80-(p->look_ang>>1), looking_arc+250-gun_pos,KNEE,gs,o|4|262144,pal); - else myospalscaled(weapon_xoffset+160-16-(p->look_ang>>1), + else G_DrawTileScaled(weapon_xoffset+160-16-(p->look_ang>>1), looking_arc+214-gun_pos,KNEE+1,gs,o|4|262144,pal); } @@ -2302,10 +2302,10 @@ void P_DisplayWeapons(int snum) } if ((*kb) < 5 || (*kb) > 9) - myospalscaled(weapon_xoffset+220-(p->look_ang>>1), + G_DrawTileScaled(weapon_xoffset+220-(p->look_ang>>1), looking_arc+250-gun_pos,KNEE,gs,o,pal); else - myospalscaled(weapon_xoffset+160-(p->look_ang>>1), + G_DrawTileScaled(weapon_xoffset+160-(p->look_ang>>1), looking_arc+214-gun_pos,KNEE+1,gs,o,pal); } } @@ -2329,13 +2329,13 @@ void P_DisplayWeapons(int snum) if ((*kb) > 6) looking_arc += ((*kb)<<3); else if ((*kb) < 4) - myospalw(weapon_xoffset+142-(p->look_ang>>1), + G_DrawWeaponTile(weapon_xoffset+142-(p->look_ang>>1), looking_arc+234-gun_pos,HANDHOLDINGLASER+3,gs,o,pal); - myospalw(weapon_xoffset+130-(p->look_ang>>1), + G_DrawWeaponTile(weapon_xoffset+130-(p->look_ang>>1), looking_arc+249-gun_pos, HANDHOLDINGLASER+((*kb)>>2),gs,o,pal); - myospalw(weapon_xoffset+152-(p->look_ang>>1), + G_DrawWeaponTile(weapon_xoffset+152-(p->look_ang>>1), looking_arc+249-gun_pos, HANDHOLDINGLASER+((*kb)>>2),gs,o|4,pal); } @@ -2360,12 +2360,12 @@ void P_DisplayWeapons(int snum) { if (*kb < 8) { - myospalw(weapon_xoffset+164,(looking_arc<<1)+176-gun_pos, + G_DrawWeaponTile(weapon_xoffset+164,(looking_arc<<1)+176-gun_pos, RPGGUN+((*kb)>>1),gs,o,pal); } } - myospalw(weapon_xoffset+164,(looking_arc<<1)+176-gun_pos, + G_DrawWeaponTile(weapon_xoffset+164,(looking_arc<<1)+176-gun_pos, RPGGUN,gs,o,pal); } break; @@ -2389,13 +2389,13 @@ void P_DisplayWeapons(int snum) { case 1: case 2: - myospalw(weapon_xoffset+168-(p->look_ang>>1),looking_arc+201-gun_pos, + G_DrawWeaponTile(weapon_xoffset+168-(p->look_ang>>1),looking_arc+201-gun_pos, SHOTGUN+2,-128,o,pal); case 0: case 6: case 7: case 8: - myospalw(weapon_xoffset+146-(p->look_ang>>1),looking_arc+202-gun_pos, + G_DrawWeaponTile(weapon_xoffset+146-(p->look_ang>>1),looking_arc+202-gun_pos, SHOTGUN,gs,o,pal); break; case 3: @@ -2410,45 +2410,45 @@ void P_DisplayWeapons(int snum) gun_pos -= 40; weapon_xoffset += 20; - myospalw(weapon_xoffset+178-(p->look_ang>>1),looking_arc+194-gun_pos, + G_DrawWeaponTile(weapon_xoffset+178-(p->look_ang>>1),looking_arc+194-gun_pos, SHOTGUN+1+((*(kb)-1)>>1),-128,o,pal); } - myospalw(weapon_xoffset+158-(p->look_ang>>1),looking_arc+220-gun_pos, + G_DrawWeaponTile(weapon_xoffset+158-(p->look_ang>>1),looking_arc+220-gun_pos, SHOTGUN+3,gs,o,pal); break; case 13: case 14: case 15: - myospalw(32+weapon_xoffset+166-(p->look_ang>>1),looking_arc+210-gun_pos, + G_DrawWeaponTile(32+weapon_xoffset+166-(p->look_ang>>1),looking_arc+210-gun_pos, SHOTGUN+4,gs,o,pal); break; case 16: case 17: case 18: case 19: - myospalw(64+weapon_xoffset+170-(p->look_ang>>1),looking_arc+196-gun_pos, + G_DrawWeaponTile(64+weapon_xoffset+170-(p->look_ang>>1),looking_arc+196-gun_pos, SHOTGUN+5,gs,o,pal); break; case 20: case 21: case 22: case 23: - myospalw(64+weapon_xoffset+176-(p->look_ang>>1),looking_arc+196-gun_pos, + G_DrawWeaponTile(64+weapon_xoffset+176-(p->look_ang>>1),looking_arc+196-gun_pos, SHOTGUN+6,gs,o,pal); break; case 24: case 25: case 26: case 27: - myospalw(64+weapon_xoffset+170-(p->look_ang>>1),looking_arc+196-gun_pos, + G_DrawWeaponTile(64+weapon_xoffset+170-(p->look_ang>>1),looking_arc+196-gun_pos, SHOTGUN+5,gs,o,pal); break; case 28: case 29: case 30: - myospalw(32+weapon_xoffset+156-(p->look_ang>>1),looking_arc+206-gun_pos, + G_DrawWeaponTile(32+weapon_xoffset+156-(p->look_ang>>1),looking_arc+206-gun_pos, SHOTGUN+4,gs,o,pal); break; } @@ -2473,12 +2473,12 @@ void P_DisplayWeapons(int snum) if (*kb > 0 && sprite[p->i].pal != 1) weapon_xoffset += 1-(rand()&3); - myospalw(weapon_xoffset+168-(p->look_ang>>1),looking_arc+260-gun_pos, + G_DrawWeaponTile(weapon_xoffset+168-(p->look_ang>>1),looking_arc+260-gun_pos, CHAINGUN,gs,o,pal); switch (*kb) { case 0: - myospalw(weapon_xoffset+178-(p->look_ang>>1),looking_arc+233-gun_pos, + G_DrawWeaponTile(weapon_xoffset+178-(p->look_ang>>1),looking_arc+233-gun_pos, CHAINGUN+1,gs,o,pal); break; default: @@ -2486,21 +2486,21 @@ void P_DisplayWeapons(int snum) { i = 0; if (sprite[p->i].pal != 1) i = rand()&7; - myospalw(i+weapon_xoffset-4+140-(p->look_ang>>1),i+looking_arc-((*kb)>>1)+208-gun_pos, + G_DrawWeaponTile(i+weapon_xoffset-4+140-(p->look_ang>>1),i+looking_arc-((*kb)>>1)+208-gun_pos, CHAINGUN+5+((*kb-4)/5),gs,o,pal); if (sprite[p->i].pal != 1) i = rand()&7; - myospalw(i+weapon_xoffset-4+184-(p->look_ang>>1),i+looking_arc-((*kb)>>1)+208-gun_pos, + G_DrawWeaponTile(i+weapon_xoffset-4+184-(p->look_ang>>1),i+looking_arc-((*kb)>>1)+208-gun_pos, CHAINGUN+5+((*kb-4)/5),gs,o,pal); } if (*kb < *aplWeaponTotalTime[CHAINGUN_WEAPON]-4) { i = rand()&7; - myospalw(i+weapon_xoffset-4+162-(p->look_ang>>1),i+looking_arc-((*kb)>>1)+208-gun_pos, + G_DrawWeaponTile(i+weapon_xoffset-4+162-(p->look_ang>>1),i+looking_arc-((*kb)>>1)+208-gun_pos, CHAINGUN+5+((*kb-2)/5),gs,o,pal); - myospalw(weapon_xoffset+178-(p->look_ang>>1),looking_arc+233-gun_pos, + G_DrawWeaponTile(weapon_xoffset+178-(p->look_ang>>1),looking_arc+233-gun_pos, CHAINGUN+1+((*kb)>>1),gs,o,pal); } - else myospalw(weapon_xoffset+178-(p->look_ang>>1),looking_arc+233-gun_pos, + else G_DrawWeaponTile(weapon_xoffset+178-(p->look_ang>>1),looking_arc+233-gun_pos, CHAINGUN+1,gs,o,pal); break; } @@ -2527,36 +2527,36 @@ void P_DisplayWeapons(int snum) if ((*kb) == *aplWeaponFireDelay[PISTOL_WEAPON]) l -= 3; - myospalw((l-(p->look_ang>>1)),(looking_arc+244-gun_pos),FIRSTGUN+kb_frames[*kb>2?0:*kb],gs,2,pal); + G_DrawWeaponTile((l-(p->look_ang>>1)),(looking_arc+244-gun_pos),FIRSTGUN+kb_frames[*kb>2?0:*kb],gs,2,pal); } else { if ((*kb) < *aplWeaponReload[PISTOL_WEAPON]-17) - myospalw(194-(p->look_ang>>1),looking_arc+230-gun_pos,FIRSTGUN+4,gs,o,pal); + G_DrawWeaponTile(194-(p->look_ang>>1),looking_arc+230-gun_pos,FIRSTGUN+4,gs,o,pal); else if ((*kb) < *aplWeaponReload[PISTOL_WEAPON]-12) { - myospalw(244-((*kb)<<3)-(p->look_ang>>1),looking_arc+130-gun_pos+((*kb)<<4),FIRSTGUN+6,gs,o,pal); - myospalw(224-(p->look_ang>>1),looking_arc+220-gun_pos,FIRSTGUN+5,gs,o,pal); + G_DrawWeaponTile(244-((*kb)<<3)-(p->look_ang>>1),looking_arc+130-gun_pos+((*kb)<<4),FIRSTGUN+6,gs,o,pal); + G_DrawWeaponTile(224-(p->look_ang>>1),looking_arc+220-gun_pos,FIRSTGUN+5,gs,o,pal); } else if ((*kb) < *aplWeaponReload[PISTOL_WEAPON]-7) { - myospalw(124+((*kb)<<1)-(p->look_ang>>1),looking_arc+430-gun_pos-((*kb)<<3),FIRSTGUN+6,gs,o,pal); - myospalw(224-(p->look_ang>>1),looking_arc+220-gun_pos,FIRSTGUN+5,gs,o,pal); + G_DrawWeaponTile(124+((*kb)<<1)-(p->look_ang>>1),looking_arc+430-gun_pos-((*kb)<<3),FIRSTGUN+6,gs,o,pal); + G_DrawWeaponTile(224-(p->look_ang>>1),looking_arc+220-gun_pos,FIRSTGUN+5,gs,o,pal); } else if ((*kb) < *aplWeaponReload[PISTOL_WEAPON]-4) { - myospalw(184-(p->look_ang>>1),looking_arc+235-gun_pos,FIRSTGUN+8,gs,o,pal); - myospalw(224-(p->look_ang>>1),looking_arc+210-gun_pos,FIRSTGUN+5,gs,o,pal); + G_DrawWeaponTile(184-(p->look_ang>>1),looking_arc+235-gun_pos,FIRSTGUN+8,gs,o,pal); + G_DrawWeaponTile(224-(p->look_ang>>1),looking_arc+210-gun_pos,FIRSTGUN+5,gs,o,pal); } else if ((*kb) < *aplWeaponReload[PISTOL_WEAPON]-2) { - myospalw(164-(p->look_ang>>1),looking_arc+245-gun_pos,FIRSTGUN+8,gs,o,pal); - myospalw(224-(p->look_ang>>1),looking_arc+220-gun_pos,FIRSTGUN+5,gs,o,pal); + G_DrawWeaponTile(164-(p->look_ang>>1),looking_arc+245-gun_pos,FIRSTGUN+8,gs,o,pal); + G_DrawWeaponTile(224-(p->look_ang>>1),looking_arc+220-gun_pos,FIRSTGUN+5,gs,o,pal); } else if ((*kb) < *aplWeaponReload[PISTOL_WEAPON]) - myospalw(194-(p->look_ang>>1),looking_arc+235-gun_pos,FIRSTGUN+5,gs,o,pal); + G_DrawWeaponTile(194-(p->look_ang>>1),looking_arc+235-gun_pos,FIRSTGUN+5,gs,o,pal); } } @@ -2589,11 +2589,11 @@ void P_DisplayWeapons(int snum) else if ((*kb) < 20) gun_pos -= 9*((*kb)-14); //D - myospalw(weapon_xoffset+190-(p->look_ang>>1),looking_arc+250-gun_pos,HANDTHROW+throw_frames[(*kb)],gs,o,pal); + G_DrawWeaponTile(weapon_xoffset+190-(p->look_ang>>1),looking_arc+250-gun_pos,HANDTHROW+throw_frames[(*kb)],gs,o,pal); } } else - myospalw(weapon_xoffset+190-(p->look_ang>>1),looking_arc+260-gun_pos,HANDTHROW,gs,o,pal); + G_DrawWeaponTile(weapon_xoffset+190-(p->look_ang>>1),looking_arc+260-gun_pos,HANDTHROW,gs,o,pal); } } break; @@ -2613,9 +2613,9 @@ void P_DisplayWeapons(int snum) weapon_xoffset = -48; if ((*kb)) - myospalw(weapon_xoffset+150-(p->look_ang>>1),looking_arc+258-gun_pos,HANDREMOTE+remote_frames[(*kb)],gs,o,pal); + G_DrawWeaponTile(weapon_xoffset+150-(p->look_ang>>1),looking_arc+258-gun_pos,HANDREMOTE+remote_frames[(*kb)],gs,o,pal); else - myospalw(weapon_xoffset+150-(p->look_ang>>1),looking_arc+258-gun_pos,HANDREMOTE,gs,o,pal); + G_DrawWeaponTile(weapon_xoffset+150-(p->look_ang>>1),looking_arc+258-gun_pos,HANDREMOTE,gs,o,pal); } } break; @@ -2640,19 +2640,19 @@ void P_DisplayWeapons(int snum) if (p->hbomb_hold_delay) { - myospalw((cycloidy[*kb]>>1)+weapon_xoffset+268-(p->look_ang>>1),cycloidy[*kb]+looking_arc+238-gun_pos,DEVISTATOR+i,-32,o,pal); - myospalw(weapon_xoffset+30-(p->look_ang>>1),looking_arc+240-gun_pos,DEVISTATOR,gs,o|4,pal); + G_DrawWeaponTile((cycloidy[*kb]>>1)+weapon_xoffset+268-(p->look_ang>>1),cycloidy[*kb]+looking_arc+238-gun_pos,DEVISTATOR+i,-32,o,pal); + G_DrawWeaponTile(weapon_xoffset+30-(p->look_ang>>1),looking_arc+240-gun_pos,DEVISTATOR,gs,o|4,pal); } else { - myospalw(-(cycloidy[*kb]>>1)+weapon_xoffset+30-(p->look_ang>>1),cycloidy[*kb]+looking_arc+240-gun_pos,DEVISTATOR+i,-32,o|4,pal); - myospalw(weapon_xoffset+268-(p->look_ang>>1),looking_arc+238-gun_pos,DEVISTATOR,gs,o,pal); + G_DrawWeaponTile(-(cycloidy[*kb]>>1)+weapon_xoffset+30-(p->look_ang>>1),cycloidy[*kb]+looking_arc+240-gun_pos,DEVISTATOR+i,-32,o|4,pal); + G_DrawWeaponTile(weapon_xoffset+268-(p->look_ang>>1),looking_arc+238-gun_pos,DEVISTATOR,gs,o,pal); } } else { - myospalw(weapon_xoffset+268-(p->look_ang>>1),looking_arc+238-gun_pos,DEVISTATOR,gs,o,pal); - myospalw(weapon_xoffset+30-(p->look_ang>>1),looking_arc+240-gun_pos,DEVISTATOR,gs,o|4,pal); + G_DrawWeaponTile(weapon_xoffset+268-(p->look_ang>>1),looking_arc+238-gun_pos,DEVISTATOR,gs,o,pal); + G_DrawWeaponTile(weapon_xoffset+30-(p->look_ang>>1),looking_arc+240-gun_pos,DEVISTATOR,gs,o|4,pal); } } break; @@ -2679,10 +2679,10 @@ void P_DisplayWeapons(int snum) looking_arc += rand()&3; } gun_pos -= 16; - myospalw(weapon_xoffset+210-(p->look_ang>>1),looking_arc+261-gun_pos,FREEZE+2,-32,o,pal); - myospalw(weapon_xoffset+210-(p->look_ang>>1),looking_arc+235-gun_pos,FREEZE+3+cat_frames[*kb%6],-32,o,pal); + G_DrawWeaponTile(weapon_xoffset+210-(p->look_ang>>1),looking_arc+261-gun_pos,FREEZE+2,-32,o,pal); + G_DrawWeaponTile(weapon_xoffset+210-(p->look_ang>>1),looking_arc+235-gun_pos,FREEZE+3+cat_frames[*kb%6],-32,o,pal); } - else myospalw(weapon_xoffset+210-(p->look_ang>>1),looking_arc+261-gun_pos,FREEZE,gs,o,pal); + else G_DrawWeaponTile(weapon_xoffset+210-(p->look_ang>>1),looking_arc+261-gun_pos,FREEZE,gs,o,pal); } break; @@ -2708,21 +2708,21 @@ void P_DisplayWeapons(int snum) gun_pos += (rand()&3); } - myospalw(weapon_xoffset+184-(p->look_ang>>1), + G_DrawWeaponTile(weapon_xoffset+184-(p->look_ang>>1), looking_arc+240-gun_pos,SHRINKER+3+((*kb)&3),-32, o,2); - myospalw(weapon_xoffset+188-(p->look_ang>>1), + G_DrawWeaponTile(weapon_xoffset+188-(p->look_ang>>1), looking_arc+240-gun_pos,SHRINKER-1,gs,o,pal); } else { - myospalw(weapon_xoffset+184-(p->look_ang>>1), + G_DrawWeaponTile(weapon_xoffset+184-(p->look_ang>>1), looking_arc+240-gun_pos,SHRINKER+2, 16-(sintable[p->random_club_frame&2047]>>10), o,2); - myospalw(weapon_xoffset+188-(p->look_ang>>1), + G_DrawWeaponTile(weapon_xoffset+188-(p->look_ang>>1), looking_arc+240-gun_pos,SHRINKER-2,gs,o,pal); } } @@ -2750,22 +2750,22 @@ void P_DisplayWeapons(int snum) gun_pos += (rand()&3); } - myospalw(weapon_xoffset+184-(p->look_ang>>1), + G_DrawWeaponTile(weapon_xoffset+184-(p->look_ang>>1), looking_arc+240-gun_pos,SHRINKER+3+((*kb)&3),-32, o,0); - myospalw(weapon_xoffset+188-(p->look_ang>>1), + G_DrawWeaponTile(weapon_xoffset+188-(p->look_ang>>1), looking_arc+240-gun_pos,SHRINKER+1,gs,o,pal); } else { - myospalw(weapon_xoffset+184-(p->look_ang>>1), + G_DrawWeaponTile(weapon_xoffset+184-(p->look_ang>>1), looking_arc+240-gun_pos,SHRINKER+2, 16-(sintable[p->random_club_frame&2047]>>10), o,0); - myospalw(weapon_xoffset+188-(p->look_ang>>1), + G_DrawWeaponTile(weapon_xoffset+188-(p->look_ang>>1), looking_arc+240-gun_pos,SHRINKER,gs,o,pal); } } @@ -2773,7 +2773,7 @@ void P_DisplayWeapons(int snum) } } - displayloogie(snum); + P_DisplaySpitAnim(snum); } @@ -3298,7 +3298,7 @@ short WeaponPickupSprites[MAX_WEAPONS] = { KNEE__STATIC, FIRSTGUNSPRITE__STATIC, CHAINGUNSPRITE__STATIC, RPGSPRITE__STATIC, HEAVYHBOMB__STATIC, SHRINKERSPRITE__STATIC, DEVISTATORSPRITE__STATIC, TRIPBOMBSPRITE__STATIC, FREEZESPRITE__STATIC, HEAVYHBOMB__STATIC, SHRINKERSPRITE__STATIC }; - +// this is used for player deaths void P_DropWeapon(DukePlayer_t *p) { int snum = sprite[p->i].yvel, cw = aplWeaponWorksLike[p->curr_weapon][snum]; @@ -5081,7 +5081,7 @@ SHOOTINCODE: } } if (*kb == aplWeaponSpawnTime[p->curr_weapon][snum]) - DoSpawn(p); + P_DoWeaponSpawn(p); if ((*kb) >= aplWeaponTotalTime[p->curr_weapon][snum]) { @@ -5149,21 +5149,21 @@ SHOOTINCODE: { if (((*(kb))%3) == 0) { - DoFire(p); - DoSpawn(p); + P_FireWeapon(p); + P_DoWeaponSpawn(p); } } else if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FIREEVERYOTHER) { - DoFire(p); - DoSpawn(p); + P_FireWeapon(p); + P_DoWeaponSpawn(p); } else { if (*kb == aplWeaponFireDelay[p->curr_weapon][snum]) { - DoFire(p); -// DoSpawn(p); + P_FireWeapon(p); +// P_DoWeaponSpawn(p); } } if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_RESET && @@ -5178,21 +5178,21 @@ SHOOTINCODE: { if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FIREEVERYOTHER) { - DoFire(p); - DoSpawn(p); + P_FireWeapon(p); + P_DoWeaponSpawn(p); } else { if (*kb == aplWeaponFireDelay[p->curr_weapon][snum]) { - DoFire(p); -// DoSpawn(p); + P_FireWeapon(p); +// P_DoWeaponSpawn(p); } } } } else if (*kb == aplWeaponFireDelay[p->curr_weapon][snum]) - DoFire(p); + P_FireWeapon(p); } } } diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index a3bac8aef..53ecd9333 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -339,7 +339,7 @@ static void G_DoLoadScreen(char *statustext) if (!statustext) { //g_player[myconnectindex].ps->palette = palette; - SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 fadepal(0,0,0, 0,64,7); i = ud.screen_size; ud.screen_size = 0; @@ -388,7 +388,7 @@ static void G_DoLoadScreen(char *statustext) clearview(0L); //g_player[myconnectindex].ps->palette = palette; //G_FadePalette(0,0,0,0); - SetGamePalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308 } Gv_SetVar(g_iReturnVarID,LOADSCREEN, -1, -1); X_OnEvent(EVENT_GETLOADTILE, -1, myconnectindex, -1); @@ -1526,7 +1526,7 @@ void waitforeverybody() if (ud.multimode > 1) { - SetGamePalette(g_player[myconnectindex].ps, titlepal, 11); + P_SetGamePalette(g_player[myconnectindex].ps, titlepal, 11); rotatesprite(0,0,65536L,0,BETASCREEN,0,0,2+8+16+64,0,0,xdim-1,ydim-1); rotatesprite(160<<16,(104)<<16,60<<10,0,DUKENUKEM,0,0,2+8,0,0,xdim-1,ydim-1); @@ -1564,15 +1564,15 @@ void waitforeverybody() if (i != myconnectindex) sendpacket(i,packbuf,1); } - SetGamePalette(g_player[myconnectindex].ps, palette, 11); + P_SetGamePalette(g_player[myconnectindex].ps, palette, 11); return; } } } extern int jump_input; -extern char sync_first[MAXSYNCBYTES][60]; -extern int sync_found; +extern char g_szfirstSyncMsg[MAXSYNCBYTES][60]; +extern int g_foundSyncError; void clearfifo(void) { @@ -1581,8 +1581,8 @@ void clearfifo(void) syncvaltail = 0L; syncvaltottail = 0L; memset(&syncstat, 0, sizeof(syncstat)); - memset(&sync_first, 0, sizeof(sync_first)); - sync_found = 0; + memset(&g_szfirstSyncMsg, 0, sizeof(g_szfirstSyncMsg)); + g_foundSyncError = 0; bufferjitter = 1; mymaxlag = otherminlag = 0; jump_input = 0; @@ -1907,7 +1907,7 @@ int G_EnterLevel(int g) //g_player[myconnectindex].ps->palette = palette; //G_FadePalette(0,0,0,0); - SetGamePalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308 P_UpdateScreenPal(g_player[myconnectindex].ps); flushperms(); diff --git a/polymer/eduke32/source/sync.c b/polymer/eduke32/source/sync.c index e7d8b6847..e8243fb86 100644 --- a/polymer/eduke32/source/sync.c +++ b/polymer/eduke32/source/sync.c @@ -24,9 +24,9 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms */ //------------------------------------------------------------------------- -int NumSyncBytes = 6; -char sync_first[MAXSYNCBYTES][60]; -int sync_found = 0; +int g_numSyncBytes = 1; +char g_szfirstSyncMsg[MAXSYNCBYTES][60]; +int g_foundSyncError = 0; static int crctable[256]; #define updatecrc(dcrc,xz) (dcrc = (crctable[((dcrc)>>8)^((xz)&255)]^((dcrc)<<8))) @@ -50,7 +50,7 @@ void initsynccrc(void) } } -char PlayerSync(void) +char Net_PlayerSync(void) { short i; unsigned short crc = 0; @@ -68,7 +68,7 @@ char PlayerSync(void) return ((char) crc & 255); } -char PlayerSync2(void) +char Net_PlayerSync2(void) { int i; int j, nextj; @@ -97,7 +97,7 @@ char PlayerSync2(void) return ((char) crc & 255); } -char ActorSync(void) +char Net_ActorSync(void) { unsigned short crc = 0; int j, nextj; @@ -128,7 +128,7 @@ char ActorSync(void) return ((char) crc & 255); } -char WeaponSync(void) +char Net_WeaponSync(void) { unsigned short crc = 0; int j, nextj; @@ -146,7 +146,7 @@ char WeaponSync(void) return ((char) crc & 255); } -char MapSync(void) +char Net_MapSync(void) { unsigned short crc = 0; int j, nextj; @@ -182,7 +182,7 @@ char MapSync(void) return ((char) crc & 255); } -char RandomSync(void) +char Net_RandomSync(void) { unsigned short crc = 0; @@ -191,12 +191,12 @@ char RandomSync(void) updatecrc(crc, g_globalRandom & 255); updatecrc(crc, (g_globalRandom >> 8) & 255); - if (NumSyncBytes == 1) + if (g_numSyncBytes == 1) { - updatecrc(crc,PlayerSync() & 255); - updatecrc(crc,PlayerSync2() & 255); - updatecrc(crc,WeaponSync() & 255); - updatecrc(crc,ActorSync() & 255); + updatecrc(crc,Net_PlayerSync() & 255); + updatecrc(crc,Net_PlayerSync2() & 255); + updatecrc(crc,Net_WeaponSync() & 255); + updatecrc(crc,Net_ActorSync() & 255); } return ((char) crc & 255); @@ -215,16 +215,16 @@ char *SyncNames[] = static char(*SyncFunc[MAXSYNCBYTES + 1])(void) = { - RandomSync, - PlayerSync, - PlayerSync2, - WeaponSync, - ActorSync, - MapSync, + Net_RandomSync, + Net_PlayerSync, + Net_PlayerSync2, + Net_WeaponSync, + Net_ActorSync, + Net_MapSync, NULL }; -void getsyncstat(void) +void Net_GetSyncStat(void) { int i; playerdata_t *pp = &g_player[myconnectindex]; @@ -252,59 +252,59 @@ void getsyncstat(void) //////////////////////////////////////////////////////////////////////// -void SyncStatMessage(void) +void Net_DisplaySyncMsg(void) { int i, j; - static unsigned int MoveCount = 0; + static unsigned int moveCount = 0; extern unsigned int g_moveThingsCount; // if (!SyncPrintMode) // return; - if (numplayers <= 1) + if (numplayers < 2) return; - for (i = 0; i < NumSyncBytes; i++) + for (i = 0; i < g_numSyncBytes; i++) { // syncstat is NON 0 - out of sync if (syncstat[i] != 0) { - if (NumSyncBytes > 1) + if (g_numSyncBytes > 1) { sprintf(tempbuf, "Out Of Sync - %s", SyncNames[i]); printext256(4L, 100L + (i * 8), 31, 1, tempbuf, 0); } - if (!sync_found && sync_first[i][0] == '\0') + if (!g_foundSyncError && g_szfirstSyncMsg[i][0] == '\0') { - // sync_found one so test all of them and then never test again - sync_found = TRUE; + // g_foundSyncError one so test all of them and then never test again + g_foundSyncError = TRUE; // save off loop count - MoveCount = g_moveThingsCount; + moveCount = g_moveThingsCount; - for (j = 0; j < NumSyncBytes; j++) + for (j = 0; j < g_numSyncBytes; j++) { - if (syncstat[j] != 0 && sync_first[j][0] == '\0') + if (syncstat[j] != 0 && g_szfirstSyncMsg[j][0] == '\0') { sprintf(tempbuf, "Out Of Sync - %s", SyncNames[j]); - strcpy(sync_first[j], tempbuf); + strcpy(g_szfirstSyncMsg[j], tempbuf); } } } } } - // print out the sync_first message you got - for (i = 0; i < NumSyncBytes; i++) + // print out the g_szfirstSyncMsg message you got + for (i = 0; i < g_numSyncBytes; i++) { - if (sync_first[i][0] != '\0') + if (g_szfirstSyncMsg[i][0] != '\0') { - if (NumSyncBytes > 1) + if (g_numSyncBytes > 1) { - sprintf(tempbuf, "FIRST %s", sync_first[i]); + sprintf(tempbuf, "FIRST %s", g_szfirstSyncMsg[i]); printext256(4L, 44L + (i * 8), 31, 1, tempbuf, 0); - sprintf(tempbuf, "MoveCount %d",MoveCount); + sprintf(tempbuf, "moveCount %d",moveCount); printext256(4L, 52L + (i * 8), 31, 1, tempbuf, 0); } else @@ -319,7 +319,7 @@ void SyncStatMessage(void) } -void AddSyncInfoToPacket(int *j) +void Net_AddSyncInfoToPacket(int *j) { int sb; int count = 0; @@ -327,14 +327,14 @@ void AddSyncInfoToPacket(int *j) // sync testing while (g_player[myconnectindex].syncvalhead != syncvaltail && count++ < 4) { - for (sb = 0; sb < NumSyncBytes; sb++) + for (sb = 0; sb < g_numSyncBytes; sb++) packbuf[(*j)++] = g_player[myconnectindex].syncval[syncvaltail & (SYNCFIFOSIZ - 1)][sb]; syncvaltail++; } } -void GetSyncInfoFromPacket(char *packbuf, int packbufleng, int *j, int otherconnectindex) +void Net_GetSyncInfoFromPacket(char *packbuf, int packbufleng, int *j, int otherconnectindex) { int sb, i; extern int syncvaltail, syncvaltottail; @@ -365,7 +365,7 @@ void GetSyncInfoFromPacket(char *packbuf, int packbufleng, int *j, int otherconn //while ((*j) != packbufleng) // changed this on Kens suggestion while ((*j) < packbufleng) { - for (sb = 0; sb < NumSyncBytes; sb++) + for (sb = 0; sb < g_numSyncBytes; sb++) { ppo->syncval[ppo->syncvalhead & (SYNCFIFOSIZ - 1)][sb] = packbuf[(*j)++]; } @@ -380,14 +380,14 @@ void GetSyncInfoFromPacket(char *packbuf, int packbufleng, int *j, int otherconn return; } - //for (sb = 0; sb < NumSyncBytes; sb++) + //for (sb = 0; sb < g_numSyncBytes; sb++) // syncstat[sb] = 0; while (1) { for (i = connectpoint2[connecthead]; i >= 0; i = connectpoint2[i]) { - for (sb = 0; sb < NumSyncBytes; sb++) + for (sb = 0; sb < g_numSyncBytes; sb++) { if (g_player[i].syncval[syncvaltottail & (SYNCFIFOSIZ - 1)][sb] != g_player[connecthead].syncval[syncvaltottail & (SYNCFIFOSIZ - 1)][sb]) {