diff --git a/polymer/eduke32/build/include/polymer.h b/polymer/eduke32/build/include/polymer.h index f4bf1d382..daaf58159 100644 --- a/polymer/eduke32/build/include/polymer.h +++ b/polymer/eduke32/build/include/polymer.h @@ -149,7 +149,7 @@ typedef struct s_prprogrambit { } _prprogrambit; // LIGHTS -#define PR_MAXLIGHTS 256 +#define PR_MAXLIGHTS 128 #define SHADOW_DEPTH_OFFSET 30 #define PR_MAXLIGHTPRIORITY 3 diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 0c235bf84..9d0cea64c 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -5733,8 +5733,8 @@ void uninitengine(void) Bfree(tsprite); if (spriteext != NULL) Bfree(spriteext); -// if (spritesmooth != NULL) -// Bfree(spritesmooth); + if (spritesmooth != NULL) + Bfree(spritesmooth); #endif } diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 8d4c7e0a1..70f18d391 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -2701,7 +2701,7 @@ static void G_MoveWeapons(void) G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 1024, 255+(80<<8),0); if (DynamicTileMap[s->picnum] == RPG__STATIC && ActorExtra[i].picnum != BOSS2 && - s->xrepeat >= 10 && sector[s->sectnum].lotag != 2) + s->xrepeat >= 10 && sector[s->sectnum].lotag != 2) { j = A_Spawn(i,SMALLSMOKE); sprite[j].z += (1<<8); @@ -5095,34 +5095,34 @@ static void G_MoveMisc(void) // STATNUM 5 case FORCERIPPLE__STATIC: case TRANSPORTERSTAR__STATIC: case TRANSPORTERBEAM__STATIC: + { + switch (DynamicTileMap[switchpicnum]) { - switch (DynamicTileMap[switchpicnum]) - { - case BURNING__STATIC: - case BURNING2__STATIC: - if (ActorExtra[i].floorz - ActorExtra[i].ceilingz < 128) break; - if (s->z > ActorExtra[i].floorz + 2048) break; - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 64 * s->xrepeat, 255+(80<<8),0); - break; + case BURNING__STATIC: + case BURNING2__STATIC: + if (ActorExtra[i].floorz - ActorExtra[i].ceilingz < 128) break; + if (s->z > ActorExtra[i].floorz + 2048) break; + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 64 * s->xrepeat, 255+(80<<8),0); + break; - case EXPLOSION2__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 4096, 255+(80<<8),0); - break; - case FORCERIPPLE__STATIC: + case EXPLOSION2__STATIC: + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 4096, 255+(80<<8),0); + break; + case FORCERIPPLE__STATIC: // case TRANSPORTERSTAR__STATIC: - case TRANSPORTERBEAM__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 2048, 80+(80<<8)+(255<<16),0); - break; - case SHRINKEREXPLOSION__STATIC: - G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 2048, 128+(255<<8)+(128<<16),0); - break; - } + case TRANSPORTERBEAM__STATIC: + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 2048, 80+(80<<8)+(255<<16),0); + break; + case SHRINKEREXPLOSION__STATIC: + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 2048, 128+(255<<8)+(128<<16),0); + break; + } if (!actorscrptr[sprite[i].picnum]) goto BOLT; p = A_FindPlayer(s,&x); A_Execute(i,p,x); goto BOLT; - } + } case SHELL__STATIC: case SHOTGUNSHELL__STATIC: diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index d94c6a9df..c8ebe64ed 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -630,7 +630,7 @@ const char *MusicAndSFXTagText(int32_t lotag) Bmemset(tempbuf, 0, sizeof(tempbuf)); if (g_numsounds <= 0) - return tempbuf; + return tempbuf; if (lotag>0 && lotag<999 && g_sounds[lotag].definedname) return g_sounds[lotag].definedname; @@ -1613,7 +1613,7 @@ static int32_t compare_sounds_d(int16_t k1, int16_t k2) if (!n1 && !n2) return 0; if (!n1) return -1; if (!n2) return 1; - return Bstrcasecmp(n1, n2); + return Bstrcasecmp(n1, n2); } static int32_t compare_sounds_f(int16_t k1, int16_t k2) { @@ -1623,7 +1623,7 @@ static int32_t compare_sounds_f(int16_t k1, int16_t k2) if (!n1 && !n2) return 0; if (!n1) return -1; if (!n2) return 1; - return Bstrcasecmp(n1, n2); + return Bstrcasecmp(n1, n2); } static int32_t compare_sounds_1(int16_t k1, int16_t k2) { @@ -1631,7 +1631,7 @@ static int32_t compare_sounds_1(int16_t k1, int16_t k2) } static int32_t compare_sounds_2(int16_t k1, int16_t k2) { - return (g_sounds[k2].m&2) - (g_sounds[k1].m&2); + return (g_sounds[k2].m&2) - (g_sounds[k1].m&2); } static int32_t compare_sounds_3(int16_t k1, int16_t k2) { @@ -1720,7 +1720,7 @@ static int32_t sort_sounds(int32_t how) { dst[d++] = src[l++]; continue; - } + } dst[d++] = src[r++]; } } @@ -1759,7 +1759,7 @@ static void SoundDisplay() // SoundToggle = 1; while (keystatus[KEYSC_ESC]==0 && keystatus[KEYSC_Q]==0 && keystatus[KEYSC_F2]==0 - && keystatus[buildkeys[BK_MODE2D_3D]]==0) // quickjump to 3d mode + && keystatus[buildkeys[BK_MODE2D_3D]]==0) // quickjump to 3d mode { if (handleevents()) { @@ -1868,7 +1868,7 @@ static void SoundDisplay() ch = bgetchar(); if (keystatus[1]) bad = 1; - + else if (ch == 's' || ch == 'd' || ch == 'f' || ch == 'g' || ch == '1' || ch == '2' || ch == '3' || ch == '4' || ch == '5') { @@ -1899,7 +1899,7 @@ static void SoundDisplay() sound_t *snd=&g_sounds[k]; char *cp; - Bsprintf(disptext[i], + Bsprintf(disptext[i], "%4d .................... ................ %6d:%-6d %3d %c%c%c%c%c %6d", // 5678901234567890X23456789012345678901234567 k, snd->ps, snd->pe, snd->pr, @@ -1993,7 +1993,7 @@ static void M32_MoveFX(void) ht = s->hitag; if (s->lotag < 999 && (unsigned)sector[s->sectnum].lotag < 9 && - AmbienceToggle && sector[s->sectnum].floorz != sector[s->sectnum].ceilingz) + AmbienceToggle && sector[s->sectnum].floorz != sector[s->sectnum].ceilingz) { if ((g_sounds[s->lotag].m&2)) { @@ -2005,12 +2005,12 @@ static void M32_MoveFX(void) for (j = headspritestat[0]; j >= 0; j = nextspritestat[j]) { if (s->picnum == MUSICANDSFX && j != i && sprite[j].lotag < 999 && - (sprite[j].filler&1) == 1 && dist(&sprite[j],(spritetype*)&pos) > x) + (sprite[j].filler&1) == 1 && dist(&sprite[j],(spritetype*)&pos) > x) { S_StopEnvSound(sprite[j].lotag,j); break; } - + } if (j == -1) continue; } @@ -9163,7 +9163,7 @@ int32_t parseconsounds(scriptfile *script) if (g_sounds[sndnum].filename == NULL) g_sounds[sndnum].filename = Bcalloc(slen+1,sizeof(uint8_t)); - // Hopefully noone does memcpy(..., g_sounds[].filename, BMAX_PATH) + // Hopefully noone does memcpy(..., g_sounds[].filename, BMAX_PATH) if (!g_sounds[sndnum].filename) { Bfree(definedname); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 1955db0f4..c2d093b01 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -4530,7 +4530,8 @@ void G_DrawRooms(int32_t snum,int32_t smoothratio) } #ifdef POLYMER - if (getrendermode() == 4) { + if (getrendermode() == 4) + { polymer_setanimatesprites(G_DoSpriteAnimations, ud.camerax,ud.cameray,ud.cameraang,smoothratio); } #endif @@ -7350,43 +7351,44 @@ PALONLY: } } - switch (DynamicTileMap[s->picnum-1]) - { - case DIPSWITCH__STATIC: - case DIPSWITCH2__STATIC: - case DIPSWITCH3__STATIC: - case PULLSWITCH__STATIC: - case HANDSWITCH__STATIC: - case SLOTDOOR__STATIC: - case LIGHTSWITCH__STATIC: - case SPACELIGHTSWITCH__STATIC: - case SPACEDOORSWITCH__STATIC: - case FRANKENSTINESWITCH__STATIC: - case LIGHTSWITCH2__STATIC: - case POWERSWITCH1__STATIC: - case LOCKSWITCH1__STATIC: - case POWERSWITCH2__STATIC: - case TECHSWITCH__STATIC: - framelights[framelightcount & (PR_MAXLIGHTS-1)].radius = 0; - framelights[framelightcount & (PR_MAXLIGHTS-1)].sector = t->sectnum; + switch (DynamicTileMap[s->picnum-1]) + { + case DIPSWITCH__STATIC: + case DIPSWITCH2__STATIC: + case DIPSWITCH3__STATIC: + case PULLSWITCH__STATIC: + case HANDSWITCH__STATIC: + case SLOTDOOR__STATIC: + case LIGHTSWITCH__STATIC: + case SPACELIGHTSWITCH__STATIC: + case SPACEDOORSWITCH__STATIC: + case FRANKENSTINESWITCH__STATIC: + case POWERSWITCH1__STATIC: + case LOCKSWITCH1__STATIC: + case POWERSWITCH2__STATIC: + case TECHSWITCH__STATIC: + case ACCESSSWITCH__STATIC: + case ACCESSSWITCH2__STATIC: + framelights[framelightcount & (PR_MAXLIGHTS-1)].radius = 0; + framelights[framelightcount & (PR_MAXLIGHTS-1)].sector = t->sectnum; - framelights[framelightcount & (PR_MAXLIGHTS-1)].x = t->x+((sintable[(t->ang+512)&2047])>>7); - framelights[framelightcount & (PR_MAXLIGHTS-1)].y = t->y+((sintable[(t->ang)&2047])>>7); - framelights[framelightcount & (PR_MAXLIGHTS-1)].z = t->z-1024; + framelights[framelightcount & (PR_MAXLIGHTS-1)].x = t->x+((sintable[(t->ang+512)&2047])>>7); + framelights[framelightcount & (PR_MAXLIGHTS-1)].y = t->y+((sintable[(t->ang)&2047])>>7); + framelights[framelightcount & (PR_MAXLIGHTS-1)].z = t->z-1024; - framelights[framelightcount & (PR_MAXLIGHTS-1)].range = 1024; + framelights[framelightcount & (PR_MAXLIGHTS-1)].range = 1024; - framelights[framelightcount & (PR_MAXLIGHTS-1)].color[0] = 48; - framelights[framelightcount & (PR_MAXLIGHTS-1)].color[1] = 255; - framelights[framelightcount & (PR_MAXLIGHTS-1)].color[2] = 48; + framelights[framelightcount & (PR_MAXLIGHTS-1)].color[0] = 48; + framelights[framelightcount & (PR_MAXLIGHTS-1)].color[1] = 255; + framelights[framelightcount & (PR_MAXLIGHTS-1)].color[2] = 48; - framelights[framelightcount & (PR_MAXLIGHTS-1)].priority = 2; + framelights[framelightcount & (PR_MAXLIGHTS-1)].priority = 2; - if (framelightcount < PR_MAXLIGHTS) - framelightcount++; + if (framelightcount < PR_MAXLIGHTS) + framelightcount++; - break; - } + break; + } switch (DynamicTileMap[s->picnum]) { @@ -7400,11 +7402,12 @@ PALONLY: case SPACELIGHTSWITCH__STATIC: case SPACEDOORSWITCH__STATIC: case FRANKENSTINESWITCH__STATIC: - case LIGHTSWITCH2__STATIC: case POWERSWITCH1__STATIC: case LOCKSWITCH1__STATIC: case POWERSWITCH2__STATIC: case TECHSWITCH__STATIC: + case ACCESSSWITCH__STATIC: + case ACCESSSWITCH2__STATIC: framelights[framelightcount & (PR_MAXLIGHTS-1)].radius = 0; framelights[framelightcount & (PR_MAXLIGHTS-1)].sector = t->sectnum; @@ -8186,11 +8189,11 @@ static void G_ShowScores(void) if (playerswhenstarted > 1 && (GametypeFlags[ud.coop]&GAMETYPE_SCORESHEET)) { -/* - rotatesprite(160<<16,34<<16,65536L,0,INGAMEDUKETHREEDEE,0,0,10,0,0,xdim-1,ydim-1); - if (PLUTOPAK) // JBF 20030804 - rotatesprite((260)<<16,36<<16,65536L,0,PLUTOPAKSPRITE+2,0,0,2+8,0,0,xdim-1,ydim-1); -*/ + /* + rotatesprite(160<<16,34<<16,65536L,0,INGAMEDUKETHREEDEE,0,0,10,0,0,xdim-1,ydim-1); + if (PLUTOPAK) // JBF 20030804 + rotatesprite((260)<<16,36<<16,65536L,0,PLUTOPAKSPRITE+2,0,0,2+8,0,0,xdim-1,ydim-1); + */ gametext(160,SCORESHEETOFFSET+58+2,"MULTIPLAYER TOTALS",0,2+8+16); gametext(160,SCORESHEETOFFSET+58+10,MapInfo[(ud.volume_number*MAXLEVELS)+ud.last_level-1].name,0,2+8+16); @@ -10978,25 +10981,25 @@ void app_main(int32_t argc,const char **argv) glusetexcache = glusetexcachecompression = -1; #endif -/* -#ifdef _WIN32 - ud.config.CheckForUpdates = -1; -#endif -*/ + /* + #ifdef _WIN32 + ud.config.CheckForUpdates = -1; + #endif + */ i = CONFIG_ReadSetup(); if (getenv("DUKE3DGRP")) duke3dgrp = getenv("DUKE3DGRP"); #ifdef _WIN32 -/* - if (ud.config.CheckForUpdates == -1) - { - i=wm_ynbox("Automatic Update Notifications", - "Would you like to check for new versions of EDuke32 at startup?"); - ud.config.CheckForUpdates = 0; - if (i) ud.config.CheckForUpdates = 1; - } -*/ + /* + if (ud.config.CheckForUpdates == -1) + { + i=wm_ynbox("Automatic Update Notifications", + "Would you like to check for new versions of EDuke32 at startup?"); + ud.config.CheckForUpdates = 0; + if (i) ud.config.CheckForUpdates = 1; + } + */ // initprintf("build %d\n",(uint8_t)atoi(BUILDDATE)); @@ -11042,8 +11045,8 @@ void app_main(int32_t argc,const char **argv) { #if 0 i=wm_ynbox("Texture Cache", - "Would you like to enable the on-disk texture cache?\n\n" - "You generally want to say 'yes' here, especially if using the HRP."); + "Would you like to enable the on-disk texture cache?\n\n" + "You generally want to say 'yes' here, especially if using the HRP."); #else i = 1; #endif diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 6164a16ce..3fd6f8e6a 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -5825,7 +5825,7 @@ static void C_InitProjectiles(void) int8_t sxrepeat, syrepeat, txrepeat, tyrepeat, shade, xrepeat, yrepeat, pal, velmult; } DefaultProjectile = { - 1, 100, -1, -1, 2048, 0, 0, + 1, 100, -1, -1, 2048, 0, 0, SMALLSMOKE, -1, -1, 600, BULLETHOLE, -1, 0, 0, 32, 448, g_numFreezeBounces, PIPEBOMB_BOUNCE, 1, -1, -1, -1, -1, -96, 18, 18, 0, 1 }; diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index a9f004512..3d7e4e457 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -758,26 +758,26 @@ cvar_t cvars[] = { "r_projectionhack", "r_projectionhack: enable/disable projection hack", (void*)&glprojectionhacks, CVAR_INT, 0, 0, 2 }, # ifdef POLYMER // polymer cvars - { "pr_lighting", "pr_lighting: enable/disable dynamic lights", (void*)&pr_lighting, CVAR_BOOL, 0, 0, 1 }, - { "pr_normalmapping", "pr_normalmapping: enable/disable virtual displacement mapping", (void*)&pr_normalmapping, CVAR_BOOL, 0, 0, 1 }, - { "pr_specularmapping", "pr_specularmapping: enable/disable specular mapping", (void*)&pr_specularmapping, CVAR_BOOL, 0, 0, 1 }, - { "pr_shadows", "pr_shadows: enable/disable dynamic shadows", (void*)&pr_shadows, CVAR_BOOL, 0, 0, 1 }, - { "pr_shadowcount", "pr_shadowcount: maximal amount of shadow emitting lights on screen - you need to restart the renderer for it to take effect", (void*)&pr_shadowcount, CVAR_INT, 0, 0, 64 }, - { "pr_shadowdetail", "pr_shadowdetail: sets the shadow map resolution - you need to restart the renderer for it to take effect", (void*)&pr_shadowdetail, CVAR_INT, 0, 0, 5 }, - { "pr_maxlightpasses", "pr_maxlightpasses: the maximal amount of lights a single object can by affected by", (void*)&pr_maxlightpasses, CVAR_INT, 0, 0, 512 }, - { "pr_maxlightpriority", "pr_maxlightpriority: lowering that value removes less meaningful lights from the scene", (void*)&pr_maxlightpriority, CVAR_INT, 0, 0, PR_MAXLIGHTPRIORITY }, - { "pr_fov", "pr_fov: sets the field of vision in build angle", (void*)&pr_fov, CVAR_INT, 0, 0, 1023}, - { "pr_billboardingmode", "pr_billboardingmode: face sprite display method. 0: classic mode; 1: polymost mode", (void*)&pr_billboardingmode, CVAR_INT, 0, 0, 1 }, - { "pr_verbosity", "pr_verbosity: verbosity level of the polymer renderer", (void*)&pr_verbosity, CVAR_INT, 0, 0, 3 }, - { "pr_wireframe", "pr_wireframe: toggles wireframe mode", (void*)&pr_wireframe, CVAR_INT, 0, 0, 1 }, - { "pr_vbos", "pr_vbos: contols Vertex Buffer Object usage. 0: no VBOs. 1: VBOs for map data. 2: VBOs for model data.", (void*)&pr_vbos, CVAR_INT, 0, 0, 2 }, - { "pr_gpusmoothing", "pr_gpusmoothing: toggles model animation interpolation", (void*)&pr_gpusmoothing, CVAR_INT, 0, 0, 1 }, - { "pr_overrideparallax", "pr_overrideparallax: overrides parallax mapping scale and bias values with values from the pr_parallaxscale and pr_parallaxbias cvars; use it to fine-tune DEF tokens", (void*)&pr_overrideparallax, CVAR_BOOL, 0, 0, 1 }, - { "pr_parallaxscale", "pr_parallaxscale: overriden parallax mapping offset scale", (void*)&pr_parallaxscale, CVAR_FLOAT, 0, -10, 10 }, - { "pr_parallaxbias", "pr_parallaxbias: overriden parallax mapping offset bias", (void*)&pr_parallaxbias, CVAR_FLOAT, 0, -10, 10 }, - { "pr_overridespecular", "pr_overridespecular: overrides specular material power and factor values with values from the pr_specularpower and pr_specularfactor cvars; use it to fine-tune DEF tokens", (void*)&pr_overridespecular, CVAR_BOOL, 0, 0, 1 }, - { "pr_specularpower", "pr_specularpower: overriden specular material power", (void*)&pr_specularpower, CVAR_FLOAT, 0, -10, 1000 }, - { "pr_specularfactor", "pr_specularfactor: overriden specular material factor", (void*)&pr_specularfactor, CVAR_FLOAT, 0, -10, 1000 }, + { "r_pr_lighting", "r_pr_lighting: enable/disable dynamic lights", (void*)&pr_lighting, CVAR_BOOL, 0, 0, 1 }, + { "r_pr_normalmapping", "r_pr_normalmapping: enable/disable virtual displacement mapping", (void*)&pr_normalmapping, CVAR_BOOL, 0, 0, 1 }, + { "r_pr_specularmapping", "r_pr_specularmapping: enable/disable specular mapping", (void*)&pr_specularmapping, CVAR_BOOL, 0, 0, 1 }, + { "r_pr_shadows", "r_pr_shadows: enable/disable dynamic shadows", (void*)&pr_shadows, CVAR_BOOL, 0, 0, 1 }, + { "r_pr_shadowcount", "r_pr_shadowcount: maximal amount of shadow emitting lights on screen - you need to restart the renderer for it to take effect", (void*)&pr_shadowcount, CVAR_INT, 0, 0, 64 }, + { "r_pr_shadowdetail", "r_pr_shadowdetail: sets the shadow map resolution - you need to restart the renderer for it to take effect", (void*)&pr_shadowdetail, CVAR_INT, 0, 0, 5 }, + { "r_pr_maxlightpasses", "r_pr_maxlightpasses: the maximal amount of lights a single object can by affected by", (void*)&pr_maxlightpasses, CVAR_INT, 0, 0, 512 }, + { "r_pr_maxlightpriority", "r_pr_maxlightpriority: lowering that value removes less meaningful lights from the scene", (void*)&pr_maxlightpriority, CVAR_INT, 0, 0, PR_MAXLIGHTPRIORITY }, + { "r_pr_fov", "r_pr_fov: sets the field of vision in build angle", (void*)&pr_fov, CVAR_INT, 0, 0, 1023}, + { "r_pr_billboardingmode", "r_pr_billboardingmode: face sprite display method. 0: classic mode; 1: polymost mode", (void*)&pr_billboardingmode, CVAR_INT, 0, 0, 1 }, + { "r_pr_verbosity", "r_pr_verbosity: verbosity level of the polymer renderer", (void*)&pr_verbosity, CVAR_INT, 0, 0, 3 }, + { "r_pr_wireframe", "r_pr_wireframe: toggles wireframe mode", (void*)&pr_wireframe, CVAR_INT, 0, 0, 1 }, + { "r_pr_vbos", "r_pr_vbos: contols Vertex Buffer Object usage. 0: no VBOs. 1: VBOs for map data. 2: VBOs for model data.", (void*)&pr_vbos, CVAR_INT, 0, 0, 2 }, + { "r_pr_gpusmoothing", "r_pr_gpusmoothing: toggles model animation interpolation", (void*)&pr_gpusmoothing, CVAR_INT, 0, 0, 1 }, + { "r_pr_overrideparallax", "r_pr_overrideparallax: overrides parallax mapping scale and bias values with values from the pr_parallaxscale and pr_parallaxbias cvars; use it to fine-tune DEF tokens", (void*)&pr_overrideparallax, CVAR_BOOL, 0, 0, 1 }, + { "r_pr_parallaxscale", "r_pr_parallaxscale: overriden parallax mapping offset scale", (void*)&pr_parallaxscale, CVAR_FLOAT, 0, -10, 10 }, + { "r_pr_parallaxbias", "r_pr_parallaxbias: overriden parallax mapping offset bias", (void*)&pr_parallaxbias, CVAR_FLOAT, 0, -10, 10 }, + { "r_pr_overridespecular", "r_pr_overridespecular: overrides specular material power and factor values with values from the pr_specularpower and pr_specularfactor cvars; use it to fine-tune DEF tokens", (void*)&pr_overridespecular, CVAR_BOOL, 0, 0, 1 }, + { "r_pr_specularpower", "r_pr_specularpower: overriden specular material power", (void*)&pr_specularpower, CVAR_FLOAT, 0, -10, 1000 }, + { "r_pr_specularfactor", "r_pr_specularfactor: overriden specular material factor", (void*)&pr_specularfactor, CVAR_FLOAT, 0, -10, 1000 }, #endif #endif { "r_drawweapon", "r_drawweapon: enable/disable weapon drawing", (void*)&ud.drawweapon, CVAR_INT, 0, 0, 2 }, diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 2b931fcef..033dad219 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -345,29 +345,39 @@ int32_t A_Shoot(int32_t i,int32_t atwith) } } - G_AddGameLight(0, s->sectnum, s->x+((sintable[(s->ang+512)&2047])>>7), - s->y+((sintable[(s->ang)&2047])>>7), s->z-PHEIGHT, 4096, 255+(80<<8),0); + switch (DynamicTileMap[atwith]) + { + case FIRELASER__STATIC: + case SHOTGUN__STATIC: + case SHOTSPARK1__STATIC: + case CHAINGUN__STATIC: + case RPG__STATIC: + case MORTER__STATIC: + G_AddGameLight(0, s->sectnum, s->x+((sintable[(s->ang+512)&2047])>>7), + s->y+((sintable[(s->ang)&2047])>>7), s->z-PHEIGHT, 4096, 255+(80<<8),0); - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = s->sectnum; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x+((sintable[(s->ang+512)&2047])>>7); - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].y = s->y+((sintable[(s->ang)&2047])>>7); + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = s->sectnum; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x+((sintable[(s->ang+512)&2047])>>7); + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].y = s->y+((sintable[(s->ang)&2047])>>7); - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].z = s->z-PHEIGHT; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].range = 8192; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].z = s->z-PHEIGHT; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].range = 8192; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].angle = (s->ang+1024)&2047; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].horiz = 100; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius = 256; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].faderadius = 200; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].angle = (s->ang+1024)&2047; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].horiz = 100; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius = 256; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].faderadius = 200; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[0] = 255; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[1] = 80; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[2] = 0; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[0] = 255; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[1] = 80; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[2] = 0; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 1; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 1; - if (gamelightcount < PR_MAXLIGHTS) - gamelightcount++; + if (gamelightcount < PR_MAXLIGHTS) + gamelightcount++; + break; + } } if (A_CheckSpriteTileFlags(atwith,SPRITE_PROJECTILE)) @@ -2141,7 +2151,7 @@ void P_FireWeapon(DukePlayer_t *p) p->visibility = 0; G_AddGameLight(0, s->sectnum, s->x+((sintable[(p->ang+512)&2047])>>7), s->y+((sintable[(p->ang)&2047])>>7), - s->z-PHEIGHT, 4096, aplWeaponFlashColor[p->curr_weapon][snum],0); + s->z-PHEIGHT, 4096, aplWeaponFlashColor[p->curr_weapon][snum],0); gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = s->sectnum; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x+((sintable[(p->ang+512)&2047])>>7); diff --git a/polymer/eduke32/source/sounds_mapster32.c b/polymer/eduke32/source/sounds_mapster32.c index 8118dd3ae..35451c06b 100644 --- a/polymer/eduke32/source/sounds_mapster32.c +++ b/polymer/eduke32/source/sounds_mapster32.c @@ -186,12 +186,12 @@ int32_t S_PlaySoundXYZ(int32_t num, int32_t i, const vec3_t *pos) // if(num != 358) return 0; if (num >= MAXSOUNDS || - !SM32_havesound || + !SM32_havesound || // ((g_sounds[num].m&8) && ud.lockout) || - SoundToggle == 0 || - g_sounds[num].num > 3 || - FX_VoiceAvailable(g_sounds[num].pr) == 0) - return -1; + SoundToggle == 0 || + g_sounds[num].num > 3 || + FX_VoiceAvailable(g_sounds[num].pr) == 0) + return -1; if (g_sounds[num].m&128) { @@ -203,8 +203,8 @@ int32_t S_PlaySoundXYZ(int32_t num, int32_t i, const vec3_t *pos) { for (j=0; j 0) && (g_sounds[j].m&4)) - return -1; + if ((g_sounds[j].num > 0) && (g_sounds[j].m&4)) + return -1; } cx = pos->x; @@ -234,23 +234,23 @@ int32_t S_PlaySoundXYZ(int32_t num, int32_t i, const vec3_t *pos) if (sndist < 0) sndist = 0; if (cs > -1 && sndist && PN != MUSICANDSFX && !cansee(cx,cy,cz-(24<<8),cs,SX,SY,SZ-(24<<8),SECT)) sndist += sndist>>5; -/* - switch (num) - { - case PIPEBOMB_EXPLODE: - case LASERTRIP_EXPLODE: - case RPG_EXPLODE: - if (sndist > (6144)) - sndist = 6144; - if (g_player[screenpeek].ps->cursectnum > -1 && sector[g_player[screenpeek].ps->cursectnum].lotag == 2) - pitch -= 1024; - break; - default: -*/ - if (cursectnum > -1 && sector[cursectnum].lotag == 2 && (g_sounds[num].m&4) == 0) - pitch = -768; - if (sndist > 31444 && PN != MUSICANDSFX) - return -1; + /* + switch (num) + { + case PIPEBOMB_EXPLODE: + case LASERTRIP_EXPLODE: + case RPG_EXPLODE: + if (sndist > (6144)) + sndist = 6144; + if (g_player[screenpeek].ps->cursectnum > -1 && sector[g_player[screenpeek].ps->cursectnum].lotag == 2) + pitch -= 1024; + break; + default: + */ + if (cursectnum > -1 && sector[cursectnum].lotag == 2 && (g_sounds[num].m&4) == 0) + pitch = -768; + if (sndist > 31444 && PN != MUSICANDSFX) + return -1; // break; // } @@ -478,21 +478,21 @@ void S_Pan3D(void) if (PN == MUSICANDSFX && SLT < 999) g_numEnvSoundsPlaying++; -/* - switch (j) + /* + switch (j) + { + case PIPEBOMB_EXPLODE: + case LASERTRIP_EXPLODE: + case RPG_EXPLODE: + if (sndist > (6144)) sndist = (6144); + break; + default: + */ + if (sndist > 31444 && PN != MUSICANDSFX) { - case PIPEBOMB_EXPLODE: - case LASERTRIP_EXPLODE: - case RPG_EXPLODE: - if (sndist > (6144)) sndist = (6144); - break; - default: -*/ - if (sndist > 31444 && PN != MUSICANDSFX) - { - S_StopSound(j); - continue; - } + S_StopSound(j); + continue; + } // } if (g_sounds[j].ptr == 0 && S_LoadSound(j) == 0) continue;