From 8f0b228f1ac71d5b2376778d82b51a325f2c7ef3 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 31 Jan 2009 00:02:14 +0000 Subject: [PATCH] clean out tree git-svn-id: https://svn.eduke32.com/eduke32@1220 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile.msvc | 2 +- polymer/eduke32/build/src/polymost.c | 19 +++---- polymer/eduke32/source/anim.c | 2 +- polymer/eduke32/source/astub.c | 2 +- polymer/eduke32/source/config.c | 8 +-- polymer/eduke32/source/game.c | 2 +- polymer/eduke32/source/gameexec.c | 3 +- polymer/eduke32/source/global.c | 2 +- polymer/eduke32/source/jmact/animlib.c | 4 +- polymer/eduke32/source/player.c | 72 ++++++-------------------- 10 files changed, 39 insertions(+), 77 deletions(-) diff --git a/polymer/eduke32/Makefile.msvc b/polymer/eduke32/Makefile.msvc index dead29a92..beae31991 100644 --- a/polymer/eduke32/Makefile.msvc +++ b/polymer/eduke32/Makefile.msvc @@ -139,7 +139,7 @@ EDITOROBJS=$(OBJ)\astub.$o \ # TARGETS -all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) duke3d_w32$(EXESUFFIX); +all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) # duke3d_w32$(EXESUFFIX); eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)\$(ENGINELIB) $(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index f298bf16b..7c64eb100 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -208,7 +208,7 @@ static inline void fogcalc(const int32_t shade, const int32_t vis, const int32_t fogresult = clamp(f, 0.01f, 10.f); - Bmemcpy(fogcol,&fogtable[pal<<2],sizeof(float)*4); + Bmemcpy(fogcol,&fogtable[pal<<2],sizeof(fogcol)); } #endif @@ -646,6 +646,15 @@ void polymost_glreset() { int32_t i; pthtyp *pth, *next; + + for(i=MAXPALOOKUPS-1;i>=0;i--) + { + fogtable[i<<2] = palookupfog[i].r / 63.f; + fogtable[(i<<2)+1] = palookupfog[i].g / 63.f; + fogtable[(i<<2)+2] = palookupfog[i].b / 63.f; + fogtable[(i<<2)+3] = 0; + } + //Reset if this is -1 (meaning 1st texture call ever), or > 0 (textures in memory) if (gltexcacnum < 0) { @@ -886,14 +895,6 @@ void polymost_glinit() bglEnableClientState(GL_VERTEX_ARRAY); bglEnableClientState(GL_TEXTURE_COORD_ARRAY); - for(i=MAXPALOOKUPS-1;i>=0;i--) - { - fogtable[i<<2] = palookupfog[i].r / 63.f; - fogcol[(i<<2)+1] = palookupfog[i].g / 63.f; - fogcol[(i<<2)+2] = palookupfog[i].b / 63.f; - fogcol[(i<<2)+3] = 0; - } - if (cachefilehandle > -1) { Bclose(cachefilehandle); diff --git a/polymer/eduke32/source/anim.c b/polymer/eduke32/source/anim.c index 1d4827359..dbbc98dea 100644 --- a/polymer/eduke32/source/anim.c +++ b/polymer/eduke32/source/anim.c @@ -263,7 +263,7 @@ void G_PlayAnim(const char *fn,char t) for (i=1;i frametime + 45) + if ((i > 4) && (totalclock > frametime + 45)) { OSD_Printf("WARNING: slowdown in %s, skipping playback\n",fn); goto ENDOFANIMLOOP; diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index e0e1896c0..4d2d031e0 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 " 20090118" +#define BUILDDATE " 20090123" #define VERSION " 1.2.0devel" static int32_t floor_over_floor; diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index c773aefca..ff4de411c 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -773,14 +773,14 @@ int32 CONFIG_ReadSetup(void) #if defined(POLYMOST) && defined(USE_OPENGL) SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLAnimationSmoothing", &r_animsmoothing); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLAnisotropy", &glanisotropy); - SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLDepthPeeling", &r_depthpeeling); + /*SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLDepthPeeling", &r_depthpeeling);*/ SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLDetailMapping", &r_detailmapping); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLFullbrights", &r_fullbrights); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLGlowMapping", &r_glowmapping); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLOcclusionChecking", &r_modelocclusionchecking); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyClamping", &r_parallaxskyclamping); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyPanning", &r_parallaxskypanning); - SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount", &r_peelscount); + /*SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount", &r_peelscount);*/ SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLProjectionFix", &glprojectionhacks); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLTextureMode", &gltexfiltermode); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLTextureQuality", &r_downsize); @@ -1074,14 +1074,14 @@ void CONFIG_WriteSetup(void) #if defined(POLYMOST) && defined(USE_OPENGL) SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLAnimationSmoothing",r_animsmoothing,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLAnisotropy",glanisotropy,false,false); - SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDepthPeeling",r_depthpeeling,false,false); + /*SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDepthPeeling",r_depthpeeling,false,false);*/ SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDetailMapping", r_detailmapping,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLFullbrights", r_fullbrights,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLGlowMapping", r_glowmapping,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLOcclusionChecking", r_modelocclusionchecking,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyClamping",r_parallaxskyclamping,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyPanning",r_parallaxskypanning,false,false); - SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount",r_peelscount,false,false); + /*SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount",r_peelscount,false,false);*/ SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLProjectionFix",glprojectionhacks,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLTextureMode",gltexfiltermode,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLTextureQuality", r_downsize,false,false); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index ca0bd03c3..192837775 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -3857,7 +3857,7 @@ void G_DisplayRest(int32_t smoothratio) } } - if (apScriptGameEvent[EVENT_DISPLAYSBAR]) + if (apScriptGameEvent[EVENT_DISPLAYREST]) X_OnEvent(EVENT_DISPLAYREST, g_player[screenpeek].ps->i, screenpeek, -1); if (g_player[myconnectindex].ps->newowner == -1 && ud.overhead_on == 0 && ud.crosshair && ud.camerasprite == -1) diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index b9df7a283..d67f5e66a 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -1172,7 +1172,8 @@ static int32_t X_DoExecute(void) P_AddAmmo(*insptr, g_player[vm.g_p].ps, *(insptr+1)); if (g_player[vm.g_p].ps->curr_weapon == KNEE_WEAPON && g_player[vm.g_p].ps->gotweapon[*insptr]) { - if (!(g_player[vm.g_p].ps->weaponswitch & 1)) P_AddWeaponNoSwitch(g_player[vm.g_p].ps, *insptr); + if (!(g_player[vm.g_p].ps->weaponswitch & 1)) + P_AddWeaponNoSwitch(g_player[vm.g_p].ps, *insptr); else P_AddWeapon(g_player[vm.g_p].ps, *insptr); } insptr += 2; diff --git a/polymer/eduke32/source/global.c b/polymer/eduke32/source/global.c index 5b14edc23..26e48d826 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" -const char *s_buildDate = "20090118"; +const char *s_buildDate = "20090123"; char *MusicPtr = NULL; int32_t g_musicSize; diff --git a/polymer/eduke32/source/jmact/animlib.c b/polymer/eduke32/source/jmact/animlib.c index 66a3e3bcf..09f086cb6 100644 --- a/polymer/eduke32/source/jmact/animlib.c +++ b/polymer/eduke32/source/jmact/animlib.c @@ -122,7 +122,7 @@ void loadpage(uint16 pagenumber, uint16 *pagepointer) // //**************************************************************************** -void CPlayRunSkipDump(char *srcP, char *dstP) +void CPlayRunSkipDump(uint8_t *srcP, uint8_t *dstP) { int8_t cnt; uint16 wordCnt; @@ -232,7 +232,7 @@ void renderframe(uint16 framenumber, uint16 *pagepointer) ppointer+=4; } - CPlayRunSkipDump((char *)ppointer, (char *)anim->imagebuffer); + CPlayRunSkipDump((uint8_t *)ppointer, (uint8_t *)anim->imagebuffer); } diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index bb346073c..b0ea60c88 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -42,6 +42,9 @@ int32 lastcontroltime; //MED extern int32_t g_levelTextTime; +int32_t g_numObituaries = 0; +int32_t g_numSelfObituaries = 0; + void P_UpdateScreenPal(DukePlayer_t *p) { if (p->heat_on) p->palette = slimepal; @@ -107,7 +110,8 @@ void P_QuickKill(DukePlayer_t *p) sprite[p->i].extra = 0; sprite[p->i].cstat |= 32768; - if (ud.god == 0) A_DoGuts(p->i,JIBS6,8); + if (ud.god == 0) + A_DoGuts(p->i,JIBS6,8); return; } @@ -416,8 +420,8 @@ int32_t A_Shoot(int32_t i,int32_t atwith) { if (ProjectileData[atwith].decal >= 0) { - k = A_Spawn(i,ProjectileData[atwith].decal); /* + k = A_Spawn(i,ProjectileData[atwith].decal); sprite[k].xvel = -12; sprite[k].ang = getangle(wall[hitinfo.hitwall].x-wall[wall[hitinfo.hitwall].point2].x, wall[hitinfo.hitwall].y-wall[wall[hitinfo.hitwall].point2].y)+512; @@ -1036,7 +1040,7 @@ DOSKIPBULLETHOLE: sintable[sa&2047],zvel<<6, &hitinfo,CLIPMASK1); - if (atwith == BLOODSPLAT1 || atwith == BLOODSPLAT2 || atwith == BLOODSPLAT3 || atwith == BLOODSPLAT4) + if (atwith >= BLOODSPLAT1 && atwith <= BLOODSPLAT4) { if (FindDistance2D(srcvect.x-hitinfo.pos.x,srcvect.y-hitinfo.pos.y) < 1024) if (hitinfo.hitwall >= 0 && wall[hitinfo.hitwall].overpicnum != BIGFORCE) @@ -3418,23 +3422,17 @@ void P_DropWeapon(DukePlayer_t *p) if (cw < 1 || cw >= MAX_WEAPONS) return; - if (cw) + if (krand()&1) + A_Spawn(p->i,WeaponPickupSprites[cw]); + else switch (cw) { - if (krand()&1) - A_Spawn(p->i,WeaponPickupSprites[cw]); - else switch (cw) - { - case RPG_WEAPON: - case HANDBOMB_WEAPON: - A_Spawn(p->i,EXPLOSION2); - break; - } + case RPG_WEAPON: + case HANDBOMB_WEAPON: + A_Spawn(p->i,EXPLOSION2); + break; } } -int32_t g_numObituaries = 0; -int32_t g_numSelfObituaries = 0; - void P_AddAmmo(int32_t weapon,DukePlayer_t *p,int32_t amount) { p->ammo_amount[weapon] += amount; @@ -3454,47 +3452,10 @@ void P_AddWeaponNoSwitch(DukePlayer_t *p, int32_t weapon) p->gotweapon[GROW_WEAPON] = 1; } -#if 1 if (aplWeaponSelectSound[p->curr_weapon][snum]) A_StopSound(aplWeaponSelectSound[p->curr_weapon][snum],p->i); if (aplWeaponSelectSound[weapon][snum]) A_PlaySound(aplWeaponSelectSound[weapon][snum],p->i); -#else - switch (p->curr_weapon) - { - case KNEE_WEAPON: - case TRIPBOMB_WEAPON: - case HANDREMOTE_WEAPON: - case HANDBOMB_WEAPON: - break; - case SHOTGUN_WEAPON: - A_StopSound(SHOTGUN_COCK,p->i); - break; - case PISTOL_WEAPON: - A_StopSound(INSERT_CLIP,p->i); - break; - default: - A_StopSound(SELECT_WEAPON,p->i); - break; - } - switch (weapon) - { - case KNEE_WEAPON: - case TRIPBOMB_WEAPON: - case HANDREMOTE_WEAPON: - case HANDBOMB_WEAPON: - break; - case SHOTGUN_WEAPON: - A_PlaySound(SHOTGUN_COCK,p->i); - break; - case PISTOL_WEAPON: - A_PlaySound(INSERT_CLIP,p->i); - break; - default: - A_PlaySound(SELECT_WEAPON,p->i); - break; - } -#endif } void P_AddWeapon(DukePlayer_t *p,int32_t weapon) @@ -3560,8 +3521,7 @@ void P_SelectNextInvItem(DukePlayer_t *p) void P_CheckWeapon(DukePlayer_t *p) { - int16_t i,snum; - int32 weap; + int32_t i, snum, weap; if (p->reloading) return; @@ -3571,7 +3531,7 @@ void P_CheckWeapon(DukePlayer_t *p) p->wantweaponfire = -1; if (weap == p->curr_weapon) return; - else if (p->gotweapon[weap] && p->ammo_amount[weap] > 0) + if (p->gotweapon[weap] && p->ammo_amount[weap] > 0) { P_AddWeapon(p,weap); return;