From bd78c34b99ab2f02fd8e19237646b9083c186ba1 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 23 Jul 2018 23:50:41 +0100 Subject: [PATCH 01/27] Encore mode - a fresh take on mirror mode! * Palette remaps. * Branding. TODO: * Doesn't work in GL. (Mostly.) I have SOME ideas on how to tackle this, but... * Transmaps are broken in Encore for some reason. * I tried to make in-level colormaps shimmy over, but it didn't quite work, so I commented it out and only semi-fixed it. --- src/d_netcmd.c | 14 ++--- src/d_netcmd.h | 2 +- src/doomstat.h | 2 +- src/g_game.c | 8 +-- src/hardware/hw_defs.h | 2 +- src/hardware/hw_main.c | 8 ++- src/info.c | 4 +- src/k_kart.c | 18 +++--- src/m_menu.c | 4 +- src/p_mobj.c | 2 +- src/p_saveg.c | 4 +- src/p_setup.c | 57 +++++++++--------- src/p_user.c | 2 +- src/r_bsp.c | 22 +++++-- src/r_data.c | 130 ++++++++++++++++++++++++++++++++++------- src/r_data.h | 2 +- src/r_draw8.c | 4 ++ src/r_plane.c | 10 +++- src/r_plane.h | 4 +- src/r_segs.c | 20 +++++++ src/r_state.h | 1 + src/r_things.c | 7 +++ src/s_sound.c | 4 +- src/st_stuff.c | 15 ++++- src/y_inter.c | 6 ++ 25 files changed, 256 insertions(+), 96 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index a83f23b2..bb9a9f76 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -112,7 +112,7 @@ static void SoundTest_OnChange(void); static void BaseNumLaps_OnChange(void); static void KartFrantic_OnChange(void); static void KartSpeed_OnChange(void); -static void KartMirror_OnChange(void); +static void KartEncore_OnChange(void); static void KartComeback_OnChange(void); #ifdef NETGAME_DEVMODE @@ -362,7 +362,7 @@ static CV_PossibleValue_t kartbumpers_cons_t[] = {{1, "MIN"}, {12, "MAX"}, {0, N consvar_t cv_kartbumpers = {"kartbumpers", "3", CV_NETVAR|CV_CHEAT, kartbumpers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartfrantic = {"kartfrantic", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartFrantic_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartcomeback = {"kartcomeback", "On", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartComeback_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartmirror = {"kartmirror", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartMirror_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartencore = {"kartencore", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartEncore_OnChange, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartspeedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {0, NULL}}; consvar_t cv_kartspeedometer = {"kartdisplayspeed", "Off", CV_SAVE, kartspeedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display @@ -5231,16 +5231,16 @@ static void KartSpeed_OnChange(void) } } -static void KartMirror_OnChange(void) +static void KartEncore_OnChange(void) { if (G_RaceGametype()) { - if ((boolean)cv_kartmirror.value != mirrormode && gamestate == GS_LEVEL /*&& leveltime > starttime*/) - CONS_Printf(M_GetText("Mirrored tracks will be turned %s next round.\n"), cv_kartmirror.value ? M_GetText("on") : M_GetText("off")); + if ((boolean)cv_kartencore.value != encoremode && gamestate == GS_LEVEL /*&& leveltime > starttime*/) + CONS_Printf(M_GetText("Encore tracks will be turned %s next round.\n"), cv_kartencore.value ? M_GetText("on") : M_GetText("off")); else { - CONS_Printf(M_GetText("Mirrored tracks has been turned %s.\n"), cv_kartmirror.value ? M_GetText("on") : M_GetText("off")); - mirrormode = (boolean)cv_kartmirror.value; + CONS_Printf(M_GetText("Encore tracks has been turned %s.\n"), cv_kartencore.value ? M_GetText("on") : M_GetText("off")); + encoremode = (boolean)cv_kartencore.value; } } } diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 0805a41f..960390ef 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -124,7 +124,7 @@ extern consvar_t cv_kartspeed; extern consvar_t cv_kartbumpers; extern consvar_t cv_kartfrantic; extern consvar_t cv_kartcomeback; -extern consvar_t cv_kartmirror; +extern consvar_t cv_kartencore; extern consvar_t cv_kartspeedometer; extern consvar_t cv_votetime; diff --git a/src/doomstat.h b/src/doomstat.h index 8f1469a3..0f2657b0 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -446,7 +446,7 @@ extern INT32 cheats; // SRB2kart extern UINT8 gamespeed; extern boolean franticitems; -extern boolean mirrormode; +extern boolean encoremode; extern boolean comeback; extern SINT8 battlewanted[4]; diff --git a/src/g_game.c b/src/g_game.c index a652e83f..59042ff2 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -248,7 +248,7 @@ INT32 cheats; //for multiplayer cheat commands // SRB2Kart // Cvars that we don't want changed mid-game UINT8 gamespeed; // Game's current speed (or difficulty, or cc, or etc); 0 for easy, 1 for normal, 2 for hard -boolean mirrormode; // Mirror Mode currently enabled? +boolean encoremode; // Encore Mode currently enabled? boolean franticitems; // Frantic items currently enabled? boolean comeback; // Battle Mode's karma comeback is on/off @@ -1267,7 +1267,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) axis = JoyAxis(AXISTURN, ssplayer); - if (mirrormode) + if (encoremode) { turnright ^= turnleft; // swap these using three XORs turnleft ^= turnright; @@ -1318,8 +1318,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) // Specator mouse turning if (player->spectator) { - cmd->angleturn = (INT16)(cmd->angleturn - (mousex*(mirrormode ? -1 : 1)*8)); - cmd->driftturn = (INT16)(cmd->driftturn - (mousex*(mirrormode ? -1 : 1)*8)); + cmd->angleturn = (INT16)(cmd->angleturn - (mousex*(encoremode ? -1 : 1)*8)); + cmd->driftturn = (INT16)(cmd->driftturn - (mousex*(encoremode ? -1 : 1)*8)); } // Speed bump strafing diff --git a/src/hardware/hw_defs.h b/src/hardware/hw_defs.h index 9a490a96..2d346878 100644 --- a/src/hardware/hw_defs.h +++ b/src/hardware/hw_defs.h @@ -109,7 +109,7 @@ typedef struct FLOAT fovxangle, fovyangle; UINT8 splitscreen; boolean flip; // screenflip - boolean mirror; // SRB2Kart: Mirror Mode + boolean mirror; // SRB2Kart: Encore Mode } FTransform; // Transformed vector, as passed to HWR API diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 4b088dfd..be176f7d 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -3147,7 +3147,6 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, v3d->z = FIXED_TO_FLOAT(polysector->vertices[i]->y); } - if (planecolormap) Surf.FlatColor.rgba = HWR_Lighting(lightlevel, planecolormap->rgba, planecolormap->fadergba, false, true); else @@ -5441,7 +5440,11 @@ static void HWR_ProjectSprite(mobj_t *thing) vis->colormap = R_GetTranslationColormap(TC_DEFAULT, thing->color, GTC_CACHE); } else + { vis->colormap = colormaps; + if (encoremap && (thing->flags & (MF_SCENERY|MF_NOTHINK))) + vis->colormap += (256*32); + } // set top/bottom coords vis->ty = gzt; @@ -5545,6 +5548,8 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing) vis->mobj = (mobj_t *)thing; vis->colormap = colormaps; + if (encoremap) + vis->colormap += (256*32); // set top/bottom coords vis->ty = FIXED_TO_FLOAT(thing->z + spritecachedinfo[lumpoff].topoffset); @@ -6537,6 +6542,7 @@ static void HWR_RenderWall(wallVert3D *wallVerts, FSurfaceInfo *pSurf, FBITFIE alpha = pSurf->FlatColor.s.alpha; // retain the alpha // Lighting is done here instead so that fog isn't drawn incorrectly on transparent walls after sorting + if (wallcolormap) { if (fogwall) diff --git a/src/info.c b/src/info.c index 939efd44..8565702c 100644 --- a/src/info.c +++ b/src/info.c @@ -13240,7 +13240,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY|MF_SLIDEME, // flags S_NULL // raisestate }, @@ -14349,7 +14349,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_SLIDEME, // flags S_NULL // raisestate }, diff --git a/src/k_kart.c b/src/k_kart.c index 8d64af57..e65942a3 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -24,7 +24,7 @@ // SOME IMPORTANT VARIABLES DEFINED IN DOOMDEF.H: // gamespeed is cc (0 for easy, 1 for normal, 2 for hard) // franticitems is Frantic Mode items, bool -// mirrormode is Mirror Mode (duh), bool +// encoremode is Encore Mode (duh), bool // comeback is Battle Mode's karma comeback, also bool // battlewanted is an array of the WANTED player nums, -1 for no player in that slot // indirectitemcooldown is timer before anyone's allowed another Shrink/SPB @@ -401,7 +401,7 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_kartbumpers); CV_RegisterVar(&cv_kartfrantic); CV_RegisterVar(&cv_kartcomeback); - CV_RegisterVar(&cv_kartmirror); + CV_RegisterVar(&cv_kartencore); CV_RegisterVar(&cv_kartspeedometer); CV_RegisterVar(&cv_votetime); @@ -5174,7 +5174,7 @@ fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my else x = (FixedMul(FINETANGENT(((diff+ANGLE_90)>>ANGLETOFINESHIFT) & 4095), 160<>FRACBITS; - if (mirrormode) + if (encoremode) x = 320-x; if (splitscreen > 1) @@ -5383,14 +5383,14 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat amnumxpos = (FixedMul(mo->x, zoom) - FixedMul(xoffset, zoom)); amnumypos = -(FixedMul(mo->y, zoom) - FixedMul(yoffset, zoom)); - if (mirrormode) + if (encoremode) amnumxpos = -amnumxpos; amxpos = amnumxpos + ((x + AutomapPic->width/2 - (iconprefix[skin]->width/2))<height/2 - (iconprefix[skin]->height/2))<width/2 + (iconprefix[skin]->width/2))<width), y, splitflags|V_FLIP, AutomapPic); else V_DrawScaledPatch(x, y, splitflags, AutomapPic); @@ -5462,7 +5462,7 @@ static void K_drawKartMinimap(void) } // let offsets transfer to the heads, too! - if (mirrormode) + if (encoremode) x += SHORT(AutomapPic->leftoffset); else x -= SHORT(AutomapPic->leftoffset); @@ -5730,7 +5730,7 @@ static void K_drawKartFirstPerson(void) else // forward target = 0; - if (mirrormode) + if (encoremode) target = -target; if (pn < target) @@ -5797,7 +5797,7 @@ static void K_drawKartFirstPerson(void) if (stplyr->mo->momz > 0) // TO-DO: Draw more of the kart so we can remove this if! yoffs += stplyr->mo->momz/3; - if (mirrormode) + if (encoremode) x -= xoffs; else x += xoffs; diff --git a/src/m_menu.c b/src/m_menu.c index 48857e20..9cc87453 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1413,7 +1413,7 @@ static menuitem_t OP_GameOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Game Speed", &cv_kartspeed, 30}, {IT_STRING | IT_CVAR, NULL, "Frantic Items", &cv_kartfrantic, 40}, - {IT_STRING | IT_CVAR, NULL, "Mirror Mode", &cv_kartmirror, 50}, + {IT_STRING | IT_CVAR, NULL, "Encore Mode", &cv_kartencore, 50}, {IT_STRING | IT_CVAR, NULL, "Number of Laps", &cv_basenumlaps, 70}, {IT_STRING | IT_CVAR, NULL, "Exit Countdown Timer", &cv_countdowntime, 80}, @@ -1470,7 +1470,7 @@ static menuitem_t OP_ServerOptionsMenu[] = { {IT_HEADER, NULL, "RACE", NULL, 2}, {IT_STRING | IT_CVAR, NULL, "Game Speed", &cv_kartspeed, 10}, - {IT_STRING | IT_CVAR, NULL, "Mirror Mode", &cv_kartmirror, 18}, + {IT_STRING | IT_CVAR, NULL, "Encore Mode", &cv_kartencore, 18}, {IT_STRING | IT_CVAR, NULL, "Number of Laps", &cv_numlaps, 26}, {IT_STRING | IT_CVAR, NULL, "Use Map Lap Counts", &cv_usemapnumlaps, 34}, diff --git a/src/p_mobj.c b/src/p_mobj.c index 9e13db6d..74b9e54c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3643,7 +3643,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled || (thiscam == &camera4 && players[fourthdisplayplayer].mo && (players[fourthdisplayplayer].mo->flags2 & MF2_TWOD))) itsatwodlevel = true; - if (mirrormode) + if (encoremode) postimg = postimg_mirror; else if (player->pflags & PF_FLIPCAM && !(player->pflags & PF_NIGHTSMODE) && player->mo->eflags & MFE_VERTICALFLIP) postimg = postimg_flip; diff --git a/src/p_saveg.c b/src/p_saveg.c index fdbe4033..8f4e12d4 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3256,7 +3256,7 @@ static void P_NetArchiveMisc(void) WRITEINT32(save_p, numgotboxes); WRITEUINT8(save_p, gamespeed); - WRITEUINT8(save_p, mirrormode); + WRITEUINT8(save_p, encoremode); WRITEUINT8(save_p, franticitems); WRITEUINT8(save_p, comeback); @@ -3361,7 +3361,7 @@ static inline boolean P_NetUnArchiveMisc(void) numgotboxes = READINT32(save_p); gamespeed = READUINT8(save_p); - mirrormode = (boolean)READUINT8(save_p); + encoremode = (boolean)READUINT8(save_p); franticitems = (boolean)READUINT8(save_p); comeback = (boolean)READUINT8(save_p); diff --git a/src/p_setup.c b/src/p_setup.c index f4c28663..30e882d5 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2726,7 +2726,35 @@ boolean P_SetupLevel(boolean skipprecip) // internal game map lastloadedmaplumpnum = W_GetNumForName(maplumpname = G_BuildMapName(gamemap)); - R_ReInitColormaps(mapheaderinfo[gamemap-1]->palette); + // SRB2Kart: map load variables + if (modeattacking) // Just play it safe and set everything + { + gamespeed = 2; + encoremode = false; + franticitems = false; + comeback = true; + } + else + { + if (G_BattleGametype()) + { + gamespeed = 0; + encoremode = false; + } + else + { + gamespeed = (UINT8)cv_kartspeed.value; + encoremode = (boolean)cv_kartencore.value; + } + franticitems = (boolean)cv_kartfrantic.value; + comeback = (boolean)cv_kartcomeback.value; + } + + for (i = 0; i < 4; i++) + battlewanted[i] = -1; + + R_ReInitColormaps(mapheaderinfo[gamemap-1]->palette, + (encoremode ? W_CheckNumForName(va("%sE", maplumpname)) : LUMPERROR)); CON_SetupBackColormap(); // SRB2 determines the sky texture to be used depending on the map header. @@ -2986,33 +3014,6 @@ boolean P_SetupLevel(boolean skipprecip) CV_SetValue(&cv_analog, false); }*/ - // SRB2Kart: map load variables - if (modeattacking) // Just play it safe and set everything - { - gamespeed = 2; - mirrormode = false; - franticitems = false; - comeback = true; - } - else - { - if (G_BattleGametype()) - { - gamespeed = 0; - mirrormode = false; - } - else - { - gamespeed = (UINT8)cv_kartspeed.value; - mirrormode = (boolean)cv_kartmirror.value; - } - franticitems = (boolean)cv_kartfrantic.value; - comeback = (boolean)cv_kartcomeback.value; - } - - for (i = 0; i < 4; i++) - battlewanted[i] = -1; - wantedcalcdelay = wantedfrequency*2; indirectitemcooldown = 0; spbincoming = 0; diff --git a/src/p_user.c b/src/p_user.c index f612e81d..0a54696e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9015,7 +9015,7 @@ static void P_CalcPostImg(player_t *player) } #endif - if (mirrormode) // srb2kart + if (encoremode) // srb2kart *type = postimg_mirror; } diff --git a/src/r_bsp.c b/src/r_bsp.c index 56f159c2..48f2f179 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -37,6 +37,16 @@ drawseg_t *ds_p = NULL; // indicates doors closed wrt automap bugfix: INT32 doorclosed; +static boolean R_NoEncore(sector_t *sector) +{ + INT32 val = GETSECSPECIAL(sector->special, 3); + if (val == 1 || val == 3) + return true; + if (GETSECSPECIAL(sector->special, 4) == 6) + return true; + return false; +} + // // R_ClearDrawSegs // @@ -935,7 +945,7 @@ static void R_Subsector(size_t num, UINT8 viewnumber) #ifdef ESLOPE , frontsector->f_slope #endif - ); + , R_NoEncore(frontsector)); } else floorplane = NULL; @@ -957,7 +967,7 @@ static void R_Subsector(size_t num, UINT8 viewnumber) #ifdef ESLOPE , frontsector->c_slope #endif - ); + , R_NoEncore(frontsector)); } else ceilingplane = NULL; @@ -1018,7 +1028,7 @@ static void R_Subsector(size_t num, UINT8 viewnumber) #ifdef ESLOPE , *rover->b_slope #endif - ); + , R_NoEncore(rover->master->frontsector)); #ifdef ESLOPE ffloor[numffloors].slope = *rover->b_slope; @@ -1064,7 +1074,7 @@ static void R_Subsector(size_t num, UINT8 viewnumber) #ifdef ESLOPE , *rover->t_slope #endif - ); + , R_NoEncore(rover->master->frontsector)); #ifdef ESLOPE ffloor[numffloors].slope = *rover->t_slope; @@ -1133,7 +1143,7 @@ static void R_Subsector(size_t num, UINT8 viewnumber) #ifdef ESLOPE , NULL // will ffloors be slopable eventually? #endif - ); + , R_NoEncore(polysec)); ffloor[numffloors].height = polysec->floorheight; ffloor[numffloors].polyobj = po; @@ -1179,7 +1189,7 @@ static void R_Subsector(size_t num, UINT8 viewnumber) #ifdef ESLOPE , NULL // will ffloors be slopable eventually? #endif - ); + , R_NoEncore(polysec)); ffloor[numffloors].polyobj = po; ffloor[numffloors].height = polysec->ceilingheight; diff --git a/src/r_data.c b/src/r_data.c index d19882dd..4719b908 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -112,6 +112,7 @@ INT32 *texturetranslation; sprcache_t *spritecachedinfo; lighttable_t *colormaps; +lighttable_t *encoremap; // for debugging/info purposes static size_t flatmemory, spritememory, texturememory; @@ -932,7 +933,7 @@ static inline lumpnum_t R_CheckNumForNameList(const char *name, lumplist_t *list return LUMPERROR; } -static lumplist_t *colormaplumps = NULL; ///\todo free leak +/*static lumplist_t *colormaplumps = NULL; ///\todo free leak static size_t numcolormaplumps = 0; static void R_InitExtraColormaps(void) @@ -966,7 +967,7 @@ static void R_InitExtraColormaps(void) numcolormaplumps++; } CONS_Printf(M_GetText("Number of Extra Colormaps: %s\n"), sizeu1(numcolormaplumps)); -} +}*/ // 12/14/14 -- only take flats in F_START/F_END lumpnum_t R_GetFlatNumForName(const char *name) @@ -1010,15 +1011,17 @@ static void R_InitColormaps(void) // Load in the light tables lump = W_GetNumForName("COLORMAP"); - colormaps = Z_MallocAlign(W_LumpLength (lump), PU_STATIC, NULL, 8); + //Z_MallocAlign(W_LumpLength (lump), PU_STATIC, NULL, 8); + colormaps = Z_MallocAlign((256 * 64), PU_STATIC, NULL, 8); W_ReadLump(lump, colormaps); + // no need to init encoremap at this stage // Init Boom colormaps. R_ClearColormaps(); - R_InitExtraColormaps(); + //R_InitExtraColormaps(); } -void R_ReInitColormaps(UINT16 num) +void R_ReInitColormaps(UINT16 num, lumpnum_t newencoremap) { char colormap[9] = "COLORMAP"; lumpnum_t lump; @@ -1032,6 +1035,30 @@ void R_ReInitColormaps(UINT16 num) lump = W_GetNumForName("COLORMAP"); W_ReadLump(lump, colormaps); + // Encore mode. + if (newencoremap != LUMPERROR) + { + lighttable_t *colormap_p, *colormap_p2; + size_t p, i; + + encoremap = Z_MallocAlign(256 + 10, PU_LEVEL, NULL, 8); + W_ReadLump(newencoremap, encoremap); + colormap_p = colormap_p2 = colormaps; + colormap_p += (256 * 32); + + for (p = 0; p < 32; p++) + { + for (i = 0; i < 256; i++) + { + *colormap_p = colormap_p2[encoremap[i]]; + colormap_p++; + } + colormap_p2 += 256; + } + } + else + encoremap = NULL; + // Init Boom colormaps. R_ClearColormaps(); } @@ -1060,7 +1087,7 @@ void R_ClearColormaps(void) memset(extra_colormaps, 0, sizeof (extra_colormaps)); } -INT32 R_ColormapNumForName(char *name) +/*INT32 R_ColormapNumForName(char *name) { lumpnum_t lump, i; @@ -1092,7 +1119,7 @@ INT32 R_ColormapNumForName(char *name) num_extra_colormaps++; return (INT32)num_extra_colormaps - 1; -} +}*/ // // R_CreateColormap @@ -1121,10 +1148,20 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3) if (p1[0] == '#') { cr = ((HEX2INT(p1[1]) * 16) + HEX2INT(p1[2])); - cmaskr = cr; cg = ((HEX2INT(p1[3]) * 16) + HEX2INT(p1[4])); - cmaskg = cg; cb = ((HEX2INT(p1[5]) * 16) + HEX2INT(p1[6])); + + // i don't know why this doesn't work... + /*if (encoremap) + { + i = NearestColor(cr, cg, cb); + cr = pLocalPalette[encoremap[i]].s.red; + cg = pLocalPalette[encoremap[i]].s.green; + cb = pLocalPalette[encoremap[i]].s.blue; + }*/ + + cmaskr = cr; + cmaskg = cg; cmaskb = cb; // Create a rough approximation of the color (a 16 bit color) maskcolor = ((cb) >> 3) + (((cg) >> 2) << 5) + (((cr) >> 3) << 11); @@ -1167,9 +1204,22 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3) if (p3[0] == '#') { - cdestr = cr = ((HEX2INT(p3[1]) * 16) + HEX2INT(p3[2])); - cdestg = cg = ((HEX2INT(p3[3]) * 16) + HEX2INT(p3[4])); - cdestb = cb = ((HEX2INT(p3[5]) * 16) + HEX2INT(p3[6])); + cr = ((HEX2INT(p3[1]) * 16) + HEX2INT(p3[2])); + cg = ((HEX2INT(p3[3]) * 16) + HEX2INT(p3[4])); + cb = ((HEX2INT(p3[5]) * 16) + HEX2INT(p3[6])); + + // i don't know why this doesn't work... + /*if (encoremap) + { + i = NearestColor(cr, cg, cb); + cr = pLocalPalette[encoremap[i]].s.red; + cg = pLocalPalette[encoremap[i]].s.green; + cb = pLocalPalette[encoremap[i]].s.blue; + }*/ + + cdestr = cr; + cdestg = cg; + cdestb = cb; fadecolor = (((cb) >> 3) + (((cg) >> 2) << 5) + (((cr) >> 3) << 11)); } else @@ -1257,10 +1307,10 @@ void R_CreateColormap2(char *p1, char *p2, char *p3) double cmaskr, cmaskg, cmaskb, cdestr, cdestg, cdestb; double r, g, b, cbrightness; double maskamt = 0, othermask = 0; - int mask, p, fog = 0; + INT32 mask, p, fog = 0; size_t mapnum = num_extra_colormaps; size_t i; - char *colormap_p; + lighttable_t *colormap_p, *colormap_p2; UINT32 cr, cg, cb, maskcolor, fadecolor; UINT32 fadestart = 0, fadeend = 33, fadedist = 33; @@ -1268,10 +1318,20 @@ void R_CreateColormap2(char *p1, char *p2, char *p3) if (p1[0] == '#') { cr = ((HEX2INT(p1[1]) * 16) + HEX2INT(p1[2])); - cmaskr = cr; cg = ((HEX2INT(p1[3]) * 16) + HEX2INT(p1[4])); - cmaskg = cg; cb = ((HEX2INT(p1[5]) * 16) + HEX2INT(p1[6])); + + // i don't know why this doesn't work... + /*if (encoremap) + { + i = NearestColor(cr, cg, cb); + cr = pLocalPalette[encoremap[i]].s.red; + cg = pLocalPalette[encoremap[i]].s.green; + cb = pLocalPalette[encoremap[i]].s.blue; + }*/ + + cmaskr = cr; + cmaskg = cg; cmaskb = cb; // Create a rough approximation of the color (a 16 bit color) maskcolor = ((cb) >> 3) + (((cg) >> 2) << 5) + (((cr) >> 3) << 11); @@ -1314,9 +1374,22 @@ void R_CreateColormap2(char *p1, char *p2, char *p3) if (p3[0] == '#') { - cdestr = cr = ((HEX2INT(p3[1]) * 16) + HEX2INT(p3[2])); - cdestg = cg = ((HEX2INT(p3[3]) * 16) + HEX2INT(p3[4])); - cdestb = cb = ((HEX2INT(p3[5]) * 16) + HEX2INT(p3[6])); + cr = ((HEX2INT(p3[1]) * 16) + HEX2INT(p3[2])); + cg = ((HEX2INT(p3[3]) * 16) + HEX2INT(p3[4])); + cb = ((HEX2INT(p3[5]) * 16) + HEX2INT(p3[6])); + + // i don't know why this doesn't work... + /*if (encoremap) + { + i = NearestColor(cr, cg, cb); + cr = pLocalPalette[encoremap[i]].s.red; + cg = pLocalPalette[encoremap[i]].s.green; + cb = pLocalPalette[encoremap[i]].s.blue; + }*/ + + cdestr = cr; + cdestg = cg; + cdestb = cb; fadecolor = (((cb) >> 3) + (((cg) >> 2) << 5) + (((cr) >> 3) << 11)); } else @@ -1383,10 +1456,10 @@ void R_CreateColormap2(char *p1, char *p2, char *p3) #define ABS2(x) ((x) < 0 ? -(x) : (x)) if (rendermode == render_soft) { - colormap_p = Z_MallocAlign((256 * 34) + 10, PU_LEVEL, NULL, 8); + colormap_p = Z_MallocAlign((256 * (encoremap ? 64 : 32)) + 10, PU_LEVEL, NULL, 8); extra_colormaps[mapnum].colormap = (UINT8 *)colormap_p; - for (p = 0; p < 34; p++) + for (p = 0; p < 32; p++) { for (i = 0; i < 256; i++) { @@ -1414,6 +1487,21 @@ void R_CreateColormap2(char *p1, char *p2, char *p3) map[i][2] = cdestb; } } + + if (!encoremap) + return; + + colormap_p2 = extra_colormaps[mapnum].colormap; + + for (p = 0; p < 32; p++) + { + for (i = 0; i < 256; i++) + { + *colormap_p = colormap_p2[encoremap[i]]; + colormap_p++; + } + colormap_p2 += 256; + } } #undef ABS2 diff --git a/src/r_data.h b/src/r_data.h index 1e9e0eb5..fb8756df 100644 --- a/src/r_data.h +++ b/src/r_data.h @@ -89,7 +89,7 @@ void R_ClearTextureNumCache(boolean btell); INT32 R_TextureNumForName(const char *name); INT32 R_CheckTextureNumForName(const char *name); -void R_ReInitColormaps(UINT16 num); +void R_ReInitColormaps(UINT16 num, lumpnum_t newencoremap); void R_ClearColormaps(void); INT32 R_ColormapNumForName(char *name); INT32 R_CreateColormap(char *p1, char *p2, char *p3); diff --git a/src/r_draw8.c b/src/r_draw8.c index 39585f58..b6efd6cf 100644 --- a/src/r_draw8.c +++ b/src/r_draw8.c @@ -1379,6 +1379,8 @@ void R_DrawColumnShadowed_8(void) if (height <= dc_yl) { dc_colormap = dc_lightlist[i].rcolormap; + if (encoremap) + dc_colormap += (256*32); if (solid && dc_yl < bheight) dc_yl = bheight; continue; @@ -1395,6 +1397,8 @@ void R_DrawColumnShadowed_8(void) dc_yl = dc_yh + 1; dc_colormap = dc_lightlist[i].rcolormap; + if (encoremap) + dc_colormap += (256*32); } dc_yh = realyh; if (dc_yl <= realyh) diff --git a/src/r_plane.c b/src/r_plane.c index 92e0cacb..22515639 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -335,6 +335,8 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2) else #endif ds_colormap = planezlight[pindex]; + if (encoremap && !currentplane->noencore) + ds_colormap += (256*32); if (currentplane->extra_colormap) ds_colormap = currentplane->extra_colormap->colormap + (ds_colormap - colormaps); @@ -437,7 +439,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, #ifdef ESLOPE , pslope_t *slope #endif - ) + , boolean noencore) { visplane_t *check; unsigned hash; @@ -486,7 +488,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, #ifdef ESLOPE && check->slope == slope #endif - ) + && check->noencore == noencore) { return check; } @@ -514,6 +516,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, #ifdef ESLOPE check->slope = slope; #endif + check->noencore = noencore; memset(check->top, 0xff, sizeof (check->top)); memset(check->bottom, 0x00, sizeof (check->bottom)); @@ -586,6 +589,7 @@ visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop) #ifdef ESLOPE new_pl->slope = pl->slope; #endif + new_pl->noencore = pl->noencore; pl = new_pl; pl->minx = start; pl->maxx = stop; @@ -703,6 +707,8 @@ void R_DrawPlanes(void) // Because of this hack, sky is not affected // by INVUL inverse mapping. dc_colormap = colormaps; + if (encoremap) + dc_colormap += (256*32); dc_texturemid = skytexturemid; dc_texheight = textureheight[skytexture] >>FRACBITS; diff --git a/src/r_plane.h b/src/r_plane.h index dff58669..9b25c65e 100644 --- a/src/r_plane.h +++ b/src/r_plane.h @@ -65,6 +65,8 @@ typedef struct visplane_s #ifdef ESLOPE pslope_t *slope; #endif + + boolean noencore; } visplane_t; extern visplane_t *floorplane; @@ -103,7 +105,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, fixed_t #ifdef ESLOPE , pslope_t *slope #endif - ); + , boolean noencore); visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop); void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop); void R_PlaneBounds(visplane_t *plane); diff --git a/src/r_segs.c b/src/r_segs.c index 025c920c..5c09d34e 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -202,6 +202,8 @@ static void R_DrawWallSplats(void) if (pindex >= MAXLIGHTSCALE) pindex = MAXLIGHTSCALE - 1; dc_colormap = walllights[pindex]; + if (encoremap) + dc_colormap += (256*32); if (frontsector->extra_colormap) dc_colormap = frontsector->extra_colormap->colormap + (dc_colormap - colormaps); @@ -596,6 +598,8 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) if (height <= windowtop) { dc_colormap = rlight->rcolormap; + if (encoremap) + dc_colormap += (256*32); continue; } @@ -615,6 +619,8 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) colfunc_2s(col); windowtop = windowbottom + 1; dc_colormap = rlight->rcolormap; + if (encoremap) + dc_colormap += (256*32); } windowbottom = realbot; if (windowtop < windowbottom) @@ -631,6 +637,8 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) pindex = MAXLIGHTSCALE - 1; dc_colormap = walllights[pindex]; + if (encoremap) + dc_colormap += (256*32); if (frontsector->extra_colormap) dc_colormap = frontsector->extra_colormap->colormap + (dc_colormap - colormaps); @@ -1210,7 +1218,11 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) if (height <= windowtop) { if (lighteffect) + { dc_colormap = rlight->rcolormap; + if (encoremap) + dc_colormap += (256*32); + } if (solid && windowtop < bheight) windowtop = bheight; continue; @@ -1236,7 +1248,11 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else windowtop = windowbottom + 1; if (lighteffect) + { dc_colormap = rlight->rcolormap; + if (encoremap) + dc_colormap += (256*32); + } } windowbottom = sprbotscreen; if (windowtop < windowbottom) @@ -1253,6 +1269,8 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) pindex = MAXLIGHTSCALE - 1; dc_colormap = walllights[pindex]; + if (encoremap) + dc_colormap += (256*32); if (frontsector->extra_colormap) dc_colormap = frontsector->extra_colormap->colormap + (dc_colormap - colormaps); if (pfloor->flags & FF_FOG && pfloor->master->frontsector->extra_colormap) @@ -1483,6 +1501,8 @@ static void R_RenderSegLoop (void) pindex = MAXLIGHTSCALE-1; dc_colormap = walllights[pindex]; + if (encoremap) + dc_colormap += (256*32); dc_x = rw_x; dc_iscale = 0xffffffffu / (unsigned)rw_scale; diff --git a/src/r_state.h b/src/r_state.h index 8436413b..a651bda7 100644 --- a/src/r_state.h +++ b/src/r_state.h @@ -38,6 +38,7 @@ typedef struct extern sprcache_t *spritecachedinfo; extern lighttable_t *colormaps; +extern lighttable_t *encoremap; // Boom colormaps. // Had to put a limit on colormaps :( diff --git a/src/r_things.c b/src/r_things.c index ae935897..d6596913 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -873,6 +873,11 @@ static void R_DrawVisSprite(vissprite_t *vis) if (!dc_colormap) dc_colormap = colormaps; + if (encoremap && !vis->mobj->color + && (vis->mobj->flags & (MF_SCENERY|MF_NOTHINK)) + && !(vis->mobj->flags & ~(MF_SCENERY|MF_NOTHINK|MF_NOCLIP|MF_NOBLOCKMAP|MF_NOGRAVITY))) + dc_colormap += (256*32); + dc_texturemid = vis->texturemid; dc_texheight = 0; @@ -973,6 +978,8 @@ static void R_DrawPrecipitationVisSprite(vissprite_t *vis) } dc_colormap = colormaps; + if (encoremap) + dc_colormap += (256*32); dc_iscale = FixedDiv(FRACUNIT, vis->scale); dc_texturemid = vis->texturemid; diff --git a/src/s_sound.c b/src/s_sound.c index 44e7e7ae..3c7715d0 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -391,7 +391,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) { INT32 sep, pitch, priority, cnum; sfxinfo_t *sfx; - const boolean reverse = (stereoreverse.value ^ mirrormode); + const boolean reverse = (stereoreverse.value ^ encoremode); const mobj_t *origin = (const mobj_t *)origin_p; listener_t listener = {0,0,0,0}; @@ -1198,7 +1198,7 @@ INT32 S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 *v listener_t listensource; - const boolean reverse = (stereoreverse.value ^ mirrormode); + const boolean reverse = (stereoreverse.value ^ encoremode); (void)pitch; if (!listener) diff --git a/src/st_stuff.c b/src/st_stuff.c index 7efbe6d2..5c2c1c03 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -797,15 +797,24 @@ static void ST_drawLevelTitle(void) } { + const char *subttlstr; + dupcalc = (dupcalc - BASEVIDWIDTH)>>1; V_DrawFill(sub - dupcalc, bary+9, ttlnumxpos+dupcalc + 1, 2, 31); V_DrawDiag(sub + ttlnumxpos + 1, bary, 11, 31); V_DrawFill(sub - dupcalc, bary, ttlnumxpos+dupcalc, 10, gtc); V_DrawDiag(sub + ttlnumxpos, bary, 10, gtc); - if (subttl[0]) - V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE, subttl); + + if (encoremode) + subttlstr = "Encore Mode"; + else if (subttl[0]) + subttlstr = subttl; + else if (mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU) + subttlstr = "MAP HELL"; else - V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE, va("%s Mode", gametype_cons_t[gametype].strvalue)); + subttlstr = va("%s Mode", gametype_cons_t[gametype].strvalue); + + V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE, subttlstr); } ttlnumxpos += sub; diff --git a/src/y_inter.c b/src/y_inter.c index 4c5d9e26..18495bf9 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -93,6 +93,7 @@ typedef union UINT32 val[MAXPLAYERS]; //Gametype-specific value UINT8 pos[MAXPLAYERS]; // player positions. used for ties boolean rankingsmode; // rankings mode + boolean encore; // encore mode } match; } y_data; @@ -204,6 +205,8 @@ static void Y_CalculateMatchData(boolean rankingsmode, void (*comparison)(INT32) if ((data.match.rankingsmode = rankingsmode)) sprintf(data.match.levelstring, "* Total Rankings *"); + data.match.encore = (!rankingsmode && encoremode); + for (i = 0; i < MAXPLAYERS; i++) { data.match.val[i] = UINT32_MAX; @@ -379,6 +382,9 @@ void Y_IntermissionDrawer(void) V_DrawCenteredString(-4 + x + BASEVIDWIDTH/2, 20, 0, data.match.levelstring); V_DrawFill(x, 42, 312, 1, 0); + if (data.match.encore) + V_DrawCenteredString(-4 + x + BASEVIDWIDTH/2, 20-8, hilicol, "ENCORE MODE"); + if (data.match.numplayers > 8) { V_DrawFill(160, 32, 1, 152, 0); From 7577d289c378bc6f8184a50f373a3c84dff44eec Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 8 Aug 2018 15:03:02 +0100 Subject: [PATCH 02/27] Encore mode is shippable, if still a tad incomplete! * Turns out the Linedef Type 606 support WAS working and I just had a bad MAP01E lump. * Ruby fade and ambience start track. * Fix bad phrasing. --- src/d_netcmd.c | 2 +- src/p_setup.c | 87 +++++++++++++++++++++++++++----------------------- src/p_user.c | 2 +- src/r_data.c | 53 +++++++++++++++--------------- src/sounds.c | 2 ++ src/sounds.h | 2 ++ 6 files changed, 78 insertions(+), 70 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index e6ff6a42..e1e0a635 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -5252,7 +5252,7 @@ static void KartEncore_OnChange(void) CONS_Printf(M_GetText("Encore tracks will be turned %s next round.\n"), cv_kartencore.value ? M_GetText("on") : M_GetText("off")); else { - CONS_Printf(M_GetText("Encore tracks has been turned %s.\n"), cv_kartencore.value ? M_GetText("on") : M_GetText("off")); + CONS_Printf(M_GetText("Encore tracks have been turned %s.\n"), cv_kartencore.value ? M_GetText("on") : M_GetText("off")); encoremode = (boolean)cv_kartencore.value; } } diff --git a/src/p_setup.c b/src/p_setup.c index 30e882d5..196eb5c7 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2244,6 +2244,33 @@ static void P_LevelInitStuff(void) // and this stupid flag as a result players[i].pflags &= ~PF_TRANSFERTOCLOSEST; } + + // SRB2Kart: map load variables + if (modeattacking) // Just play it safe and set everything + { + gamespeed = 2; + encoremode = false; + franticitems = false; + comeback = true; + } + else + { + if (G_BattleGametype()) + { + gamespeed = 0; + encoremode = false; + } + else + { + gamespeed = (UINT8)cv_kartspeed.value; + encoremode = (boolean)cv_kartencore.value; + } + franticitems = (boolean)cv_kartfrantic.value; + comeback = (boolean)cv_kartcomeback.value; + } + + for (i = 0; i < 4; i++) + battlewanted[i] = -1; } // @@ -2618,23 +2645,31 @@ boolean P_SetupLevel(boolean skipprecip) // will be set by player think. players[consoleplayer].viewz = 1; - // Special stage fade to white + // Encore mode fade to pink to white // This is handled BEFORE sounds are stopped. - /*if (rendermode != render_none && G_IsSpecialStage(gamemap)) + if (rendermode != render_none && encoremode) { - tic_t starttime = I_GetTime(); - tic_t endtime = starttime + (3*TICRATE)/2; - tic_t nowtime; + tic_t starttime, endtime, nowtime; - S_StartSound(NULL, sfx_s3kaf); + S_StopMusic(); // er, about that... + + S_StartSound(NULL, sfx_ruby1); F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 122); F_WipeEndScreen(); F_RunWipe(wipedefs[wipe_speclevel_towhite], false); - nowtime = lastwipetic; + F_WipeStartScreen(); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 120); + + F_WipeEndScreen(); + F_RunWipe(wipedefs[wipe_level_final], false); + + starttime = nowtime = lastwipetic; + endtime = starttime + (3*TICRATE)/2; + // Hold on white for extra effect. while (nowtime < endtime) { @@ -2647,23 +2682,22 @@ boolean P_SetupLevel(boolean skipprecip) } ranspecialwipe = 1; - }*/ + } // Make sure all sounds are stopped before Z_FreeTags. S_StopSounds(); S_ClearSfx(); - // As oddly named as this is, this handles music only. // We should be fine starting it here. S_Start(); // SRB2 Kart - Yes this is weird, but we don't want the music to start until after the countdown is finished // but we do still need the mapmusname to be changed if (leveltime < (starttime + (TICRATE/2))) - S_ChangeMusicInternal("kstart", false); //S_StopMusic(); + S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); //S_StopMusic(); - // Let's fade to black here - // But only if we didn't do the special stage wipe + // Let's fade to white here + // But only if we didn't do the encore wipe if (rendermode != render_none && !ranspecialwipe) { F_WipeStartScreen(); @@ -2726,33 +2760,6 @@ boolean P_SetupLevel(boolean skipprecip) // internal game map lastloadedmaplumpnum = W_GetNumForName(maplumpname = G_BuildMapName(gamemap)); - // SRB2Kart: map load variables - if (modeattacking) // Just play it safe and set everything - { - gamespeed = 2; - encoremode = false; - franticitems = false; - comeback = true; - } - else - { - if (G_BattleGametype()) - { - gamespeed = 0; - encoremode = false; - } - else - { - gamespeed = (UINT8)cv_kartspeed.value; - encoremode = (boolean)cv_kartencore.value; - } - franticitems = (boolean)cv_kartfrantic.value; - comeback = (boolean)cv_kartcomeback.value; - } - - for (i = 0; i < 4; i++) - battlewanted[i] = -1; - R_ReInitColormaps(mapheaderinfo[gamemap-1]->palette, (encoremode ? W_CheckNumForName(va("%sE", maplumpname)) : LUMPERROR)); CON_SetupBackColormap(); diff --git a/src/p_user.c b/src/p_user.c index 8f0f3dec..771161b3 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1221,7 +1221,7 @@ void P_RestoreMusic(player_t *player) // Event - Level Start if (leveltime < (starttime + (TICRATE/2))) - S_ChangeMusicInternal("kstart", false); //S_StopMusic(); + S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); //S_StopMusic(); else // see also where time overs are handled - search for "lives = 2" in this file { // Item - Grow diff --git a/src/r_data.c b/src/r_data.c index 4719b908..1e2bc628 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -1151,14 +1151,14 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3) cg = ((HEX2INT(p1[3]) * 16) + HEX2INT(p1[4])); cb = ((HEX2INT(p1[5]) * 16) + HEX2INT(p1[6])); - // i don't know why this doesn't work... - /*if (encoremap) + if (encoremap) { - i = NearestColor(cr, cg, cb); - cr = pLocalPalette[encoremap[i]].s.red; - cg = pLocalPalette[encoremap[i]].s.green; - cb = pLocalPalette[encoremap[i]].s.blue; - }*/ + i = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)]; + //CONS_Printf("R_CreateColormap: encoremap[%d] = %d\n", i, encoremap[i]); -- moved encoremap upwards for optimisation + cr = pLocalPalette[i].s.red; + cg = pLocalPalette[i].s.green; + cb = pLocalPalette[i].s.blue; + } cmaskr = cr; cmaskg = cg; @@ -1208,14 +1208,13 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3) cg = ((HEX2INT(p3[3]) * 16) + HEX2INT(p3[4])); cb = ((HEX2INT(p3[5]) * 16) + HEX2INT(p3[6])); - // i don't know why this doesn't work... - /*if (encoremap) + if (encoremap) { - i = NearestColor(cr, cg, cb); - cr = pLocalPalette[encoremap[i]].s.red; - cg = pLocalPalette[encoremap[i]].s.green; - cb = pLocalPalette[encoremap[i]].s.blue; - }*/ + i = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)]; + cr = pLocalPalette[i].s.red; + cg = pLocalPalette[i].s.green; + cb = pLocalPalette[i].s.blue; + } cdestr = cr; cdestg = cg; @@ -1321,14 +1320,13 @@ void R_CreateColormap2(char *p1, char *p2, char *p3) cg = ((HEX2INT(p1[3]) * 16) + HEX2INT(p1[4])); cb = ((HEX2INT(p1[5]) * 16) + HEX2INT(p1[6])); - // i don't know why this doesn't work... - /*if (encoremap) + if (encoremap) { - i = NearestColor(cr, cg, cb); - cr = pLocalPalette[encoremap[i]].s.red; - cg = pLocalPalette[encoremap[i]].s.green; - cb = pLocalPalette[encoremap[i]].s.blue; - }*/ + i = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)]; + cr = pLocalPalette[i].s.red; + cg = pLocalPalette[i].s.green; + cb = pLocalPalette[i].s.blue; + } cmaskr = cr; cmaskg = cg; @@ -1378,14 +1376,13 @@ void R_CreateColormap2(char *p1, char *p2, char *p3) cg = ((HEX2INT(p3[3]) * 16) + HEX2INT(p3[4])); cb = ((HEX2INT(p3[5]) * 16) + HEX2INT(p3[6])); - // i don't know why this doesn't work... - /*if (encoremap) + if (encoremap) { - i = NearestColor(cr, cg, cb); - cr = pLocalPalette[encoremap[i]].s.red; - cg = pLocalPalette[encoremap[i]].s.green; - cb = pLocalPalette[encoremap[i]].s.blue; - }*/ + i = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)]; + cr = pLocalPalette[i].s.red; + cg = pLocalPalette[i].s.green; + cb = pLocalPalette[i].s.blue; + } cdestr = cr; cdestg = cg; diff --git a/src/sounds.c b/src/sounds.c index 3b41dfa1..984f5a57 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -809,6 +809,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"yeeeah", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"noooo1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"noooo2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"ruby1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"ruby2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"hogbom", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // SRB2kart - Skin sounds diff --git a/src/sounds.h b/src/sounds.h index 0f8d5a3b..210feba7 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -881,6 +881,8 @@ typedef enum sfx_yeeeah, sfx_noooo1, sfx_noooo2, + sfx_ruby1, + sfx_ruby2, sfx_hogbom, sfx_kwin, From 6f2840fe19b39a45bc961617c3cba262d1a03e45 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 8 Aug 2018 20:48:29 +0100 Subject: [PATCH 03/27] * Make Encore Mode an unlockable, rather than freely available. * Make unlockables have a "showing" conditionset, for when you're able to see them on the Extras screen. * A shorter Encore ruby-pulse fade, for when encore mode is already active! --- src/command.c | 7 +++++++ src/d_netcmd.c | 8 ++++---- src/dehacked.c | 6 ++++-- src/m_cond.c | 16 +++++++++++----- src/m_cond.h | 4 +++- src/m_menu.c | 8 ++++++-- src/p_setup.c | 14 +++++++++----- 7 files changed, 44 insertions(+), 19 deletions(-) diff --git a/src/command.c b/src/command.c index 305a5eee..54406ade 100644 --- a/src/command.c +++ b/src/command.c @@ -28,6 +28,7 @@ #include "byteptr.h" #include "p_saveg.h" #include "g_game.h" // for player_names +#include "m_cond.h" // for encore mode #include "d_netcmd.h" #include "hu_stuff.h" #include "p_setup.h" @@ -1373,6 +1374,12 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth) return; } + if (var == &cv_kartencore && !M_SecretUnlocked(SECRET_ENCORE)) + { + CONS_Printf(M_GetText("You haven't unlocked Encore Mode yet!\n")); + return; + } + // Only add to netcmd buffer if in a netgame, otherwise, just change it. if (netgame || multiplayer) { diff --git a/src/d_netcmd.c b/src/d_netcmd.c index e1e0a635..a504453e 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -352,7 +352,7 @@ static CV_PossibleValue_t kartbumpers_cons_t[] = {{1, "MIN"}, {12, "MAX"}, {0, N consvar_t cv_kartbumpers = {"kartbumpers", "3", CV_NETVAR|CV_CHEAT, kartbumpers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartfrantic = {"kartfrantic", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartFrantic_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartcomeback = {"kartcomeback", "On", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartComeback_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartencore = {"kartencore", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartEncore_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartencore = {"kartencore", "Off", CV_NETVAR|CV_CALL|CV_NOINIT, CV_OnOff, KartEncore_OnChange, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartspeedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {0, NULL}}; consvar_t cv_kartspeedometer = {"kartdisplayspeed", "Off", CV_SAVE, kartspeedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display static CV_PossibleValue_t kartvoices_cons_t[] = {{0, "Never"}, {1, "Tasteful"}, {2, "Meme"}, {0, NULL}}; @@ -5249,11 +5249,11 @@ static void KartEncore_OnChange(void) if (G_RaceGametype()) { if ((boolean)cv_kartencore.value != encoremode && gamestate == GS_LEVEL /*&& leveltime > starttime*/) - CONS_Printf(M_GetText("Encore tracks will be turned %s next round.\n"), cv_kartencore.value ? M_GetText("on") : M_GetText("off")); + CONS_Printf(M_GetText("Encore Mode will be turned %s next round.\n"), cv_kartencore.value ? M_GetText("on") : M_GetText("off")); else { - CONS_Printf(M_GetText("Encore tracks have been turned %s.\n"), cv_kartencore.value ? M_GetText("on") : M_GetText("off")); - encoremode = (boolean)cv_kartencore.value; + CONS_Printf(M_GetText("Encore Mode has been turned %s.\n"), cv_kartencore.value ? M_GetText("on") : M_GetText("off")); + //encoremode = (boolean)cv_kartencore.value; } } } diff --git a/src/dehacked.c b/src/dehacked.c index 8fcf597d..15586934 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2384,8 +2384,8 @@ static void readunlockable(MYFILE *f, INT32 num) else if (fastcmp(word, "OBJECTIVE")) deh_strlcpy(unlockables[num].objective, word2, sizeof (unlockables[num].objective), va("Unlockable %d: objective", num)); - else if (fastcmp(word, "HEIGHT")) - unlockables[num].height = (UINT16)i; + else if (fastcmp(word, "SHOWCONDITIONSET")) + unlockables[num].showconditionset = (UINT8)i; else if (fastcmp(word, "CONDITIONSET")) unlockables[num].conditionset = (UINT8)i; else if (fastcmp(word, "NOCECHO")) @@ -2416,6 +2416,8 @@ static void readunlockable(MYFILE *f, INT32 num) unlockables[num].type = SECRET_WARP; else if (fastcmp(word2, "SOUNDTEST")) unlockables[num].type = SECRET_SOUNDTEST; + else if (fastcmp(word2, "ENCORE")) + unlockables[num].type = SECRET_ENCORE; else unlockables[num].type = (INT16)i; } diff --git a/src/m_cond.c b/src/m_cond.c index 7d07d00a..63f88cb6 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -96,12 +96,14 @@ extraemblem_t extraemblems[MAXEXTRAEMBLEMS] = // Default Unlockables unlockable_t unlockables[MAXUNLOCKABLES] = { - // Name, Objective, Menu Height, ConditionSet, Unlock Type, Variable, NoCecho, NoChecklist - /* 01 */ {"Egg Cup", "", 0, 1, SECRET_NONE, 0, false, false, 0}, - /* 02 */ {"SMK Cup", "", 0, 2, SECRET_NONE, 0, false, false, 0}, - /* 03 */ {"Chao Cup", "", 0, 3, SECRET_NONE, 0, false, false, 0}, + // Name, Objective, Showing Conditionset, ConditionSet, Unlock Type, Variable, NoCecho, NoChecklist + /* 01 */ {"Egg Cup", "", -1, 1, SECRET_NONE, 0, false, false, 0}, + /* 02 */ {"SMK Cup", "", -1, 2, SECRET_NONE, 0, false, false, 0}, + /* 03 */ {"Chao Cup", "", -1, 3, SECRET_NONE, 0, false, false, 0}, - /* 04 */ {"Record Attack", "", 0, -1, SECRET_RECORDATTACK, 0, true, true, 0}, + /* 04 */ {"Encore Mode", "", 3, 4, SECRET_ENCORE, 0, false, false, 0}, + + /* 05 */ {"Record Attack", "", -1, -1, SECRET_RECORDATTACK, 0, true, true, 0}, }; // Default number of emblems and extra emblems @@ -125,6 +127,10 @@ void M_SetupDefaultConditionSets(void) M_AddRawCondition(3, 1, UC_TOTALEMBLEMS, 30, 0, 0); M_AddRawCondition(3, 2, UC_MATCHESPLAYED, 50, 0, 0); + // -- 4: Collect 50 emblems OR play 150 matches + M_AddRawCondition(4, 1, UC_TOTALEMBLEMS, 50, 0, 0); + M_AddRawCondition(4, 2, UC_MATCHESPLAYED, 150, 0, 0); + // -- 10: Play 100 matches M_AddRawCondition(10, 1, UC_MATCHESPLAYED, 100, 0, 0); } diff --git a/src/m_cond.h b/src/m_cond.h index 052c31f2..5c8762ad 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -103,7 +103,7 @@ typedef struct { char name[64]; char objective[64]; - UINT16 height; // menu height + UINT8 showconditionset; UINT8 conditionset; INT16 type; INT16 variable; @@ -112,6 +112,7 @@ typedef struct UINT8 unlocked; } unlockable_t; +// I have NO idea why these are going negative, but whatever. #define SECRET_NONE -6 // Does nil. Use with levels locked by UnlockRequired #define SECRET_ITEMFINDER -5 // Enables Item Finder/Emblem Radar #define SECRET_EMBLEMHINTS -4 // Enables Emblem Hints @@ -123,6 +124,7 @@ typedef struct #define SECRET_WARP 2 // Selectable warp #define SECRET_SOUNDTEST 3 // Sound Test #define SECRET_CREDITS 4 // Enables Credits +#define SECRET_ENCORE 5 // Enables Encore mode cvar // If you have more secrets than these variables allow in your game, // you seriously need to get a life. diff --git a/src/m_menu.c b/src/m_menu.c index 3e12c65d..07a2a9c3 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1444,7 +1444,7 @@ static menuitem_t OP_GameOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Game Speed", &cv_kartspeed, 30}, {IT_STRING | IT_CVAR, NULL, "Frantic Items", &cv_kartfrantic, 40}, - {IT_STRING | IT_CVAR, NULL, "Encore Mode", &cv_kartencore, 50}, + {IT_SECRET, NULL, "Encore Mode", &cv_kartencore, 50}, {IT_STRING | IT_CVAR, NULL, "Number of Laps", &cv_basenumlaps, 70}, {IT_STRING | IT_CVAR, NULL, "Exit Countdown Timer", &cv_countdowntime, 80}, @@ -4311,6 +4311,9 @@ static void M_Options(INT32 choice) OP_MainMenu[7].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_CALL); OP_MainMenu[8].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU); + OP_GameOptionsMenu[3].status = + (M_SecretUnlocked(SECRET_ENCORE)) ? (IT_CVAR|IT_STRING) : IT_SECRET; // cv_kartencore + OP_MainDef.prevMenu = currentMenu; M_SetupNextMenu(&OP_MainDef); } @@ -4463,7 +4466,8 @@ static void M_DrawChecklist(void) for (i = 0; i < MAXUNLOCKABLES; i++) { if (unlockables[i].name[0] == 0 || unlockables[i].nochecklist - || !unlockables[i].conditionset || unlockables[i].conditionset > MAXCONDITIONSETS) + || !unlockables[i].conditionset || unlockables[i].conditionset > MAXCONDITIONSETS + || !M_Achieved(unlockables[i].showconditionset - 1)) continue; ++line; diff --git a/src/p_setup.c b/src/p_setup.c index 196eb5c7..39a26260 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -136,6 +136,8 @@ mapthing_t *playerstarts[MAXPLAYERS]; mapthing_t *bluectfstarts[MAXPLAYERS]; mapthing_t *redctfstarts[MAXPLAYERS]; +boolean prevencoremode = false; + /** Logs an error about a map being corrupt, then terminate. * This allows reporting highly technical errors for usefulness, without * confusing a novice map designer who simply needs to run ZenNode. @@ -2245,6 +2247,8 @@ static void P_LevelInitStuff(void) players[i].pflags &= ~PF_TRANSFERTOCLOSEST; } + prevencoremode = ((wipegamestate == GS_TITLESCREEN) ? false : encoremode); + // SRB2Kart: map load variables if (modeattacking) // Just play it safe and set everything { @@ -2647,7 +2651,7 @@ boolean P_SetupLevel(boolean skipprecip) // Encore mode fade to pink to white // This is handled BEFORE sounds are stopped. - if (rendermode != render_none && encoremode) + if (rendermode != render_none && encoremode && !prevencoremode) { tic_t starttime, endtime, nowtime; @@ -2697,14 +2701,14 @@ boolean P_SetupLevel(boolean skipprecip) S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); //S_StopMusic(); // Let's fade to white here - // But only if we didn't do the encore wipe + // But only if we didn't do the encore startup wipe if (rendermode != render_none && !ranspecialwipe) { F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 120); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (encoremode ? 122 : 120)); F_WipeEndScreen(); - F_RunWipe(wipedefs[wipe_level_toblack], false); + F_RunWipe(wipedefs[(encoremode ? wipe_level_final : wipe_level_toblack)], false); } // Reset the palette now all fades have been done @@ -3045,7 +3049,7 @@ boolean P_SetupLevel(boolean skipprecip) // Remove the loading shit from the screen if (rendermode != render_none) - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 120); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (encoremode && !ranspecialwipe ? 122 : 120)); if (precache || dedicated) R_PrecacheLevel(); From 500b71c0b3730a5fb868982e4eeac14eb6707066 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 10 Aug 2018 19:31:30 +0100 Subject: [PATCH 04/27] More control over what stuff get Encore mapping applied to it, with sensible defaults so you don't have to do much to your map to get it to be supported! * Objects! * Gone is the arcane, difficult-to-remember list of random flags. Say hello to MF_DONTENCOREMAP! * Alternatively, if the object has a skincolour applied to it, it isn't encoremapped either. (Useful for ghosts, for example.) * Sectors! * The autodetecting of sneaker and spring panels is now much more intelligent, and only avoids remapping the plane(s) the effect is availible upon. * Sector special group 2 no. 15 is now "Invert Encore Remap". It inverts the above detection. * Linedefs! * The "Transfer Line" linedef flag can now also be used to deny Encore remappings on linedef textures. * Right now it applies to every pixel drawn specifically belonging to that linedef, but if people decide it needs changing, we CAN make it apply to midtextures only (like linedef types 900-910). --- src/dehacked.c | 1 + src/info.c | 180 ++++++++++++++++++++++++------------------------- src/p_mobj.h | 4 +- src/p_spec.c | 2 + src/r_bsp.c | 31 +++++---- src/r_segs.c | 16 ++--- src/r_things.c | 4 +- 7 files changed, 124 insertions(+), 114 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 5ef770d3..af72719b 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7367,6 +7367,7 @@ static const char *const MOBJFLAG_LIST[] = { "NOCLIPTHING", "GRENADEBOUNCE", "RUNSPAWNFUNC", + "DONTENCOREMAP", NULL }; diff --git a/src/info.c b/src/info.c index b8fc8182..5c3de123 100644 --- a/src/info.c +++ b/src/info.c @@ -3028,7 +3028,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -3055,7 +3055,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -3082,7 +3082,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -3109,7 +3109,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 1000, // mass MT_THOK, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE, // flags + MF_SOLID|MF_SHOOTABLE|MF_DONTENCOREMAP, // flags (statenum_t)MT_THOK // raisestate }, @@ -5135,7 +5135,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags + MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -5162,7 +5162,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags + MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -5189,7 +5189,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags + MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -5216,7 +5216,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_NOBLOCKMAP|MF_NOCLIP, // flags + MF_NOGRAVITY|MF_NOBLOCKMAP|MF_NOCLIP|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -5243,7 +5243,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_SPECIAL, // flags + MF_SPECIAL|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -5270,7 +5270,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_SPECIAL, // flags + MF_SPECIAL|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -5297,7 +5297,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 4, // mass 0, // damage sfx_None, // activesound - MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags + MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -5324,7 +5324,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_SPECIAL, // flags + MF_NOGRAVITY|MF_SPECIAL|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, { // MT_EMERALD2 @@ -5350,7 +5350,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_SPECIAL, // flags + MF_NOGRAVITY|MF_SPECIAL|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, { // MT_EMERALD3 @@ -5376,7 +5376,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_SPECIAL, // flags + MF_NOGRAVITY|MF_SPECIAL|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, { // MT_EMERALD4 @@ -5402,7 +5402,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_SPECIAL, // flags + MF_NOGRAVITY|MF_SPECIAL|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, { // MT_EMERALD5 @@ -5428,7 +5428,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_SPECIAL, // flags + MF_NOGRAVITY|MF_SPECIAL|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, { // MT_EMERALD6 @@ -5454,7 +5454,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_SPECIAL, // flags + MF_NOGRAVITY|MF_SPECIAL|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, { // MT_EMERALD7 @@ -5480,7 +5480,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_SPECIAL, // flags + MF_NOGRAVITY|MF_SPECIAL|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -5507,7 +5507,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 4, // mass 0, // damage sfx_None, // activesound - MF_SPECIAL|MF_NOGRAVITY, // flags + MF_SPECIAL|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -5561,7 +5561,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_SLIDEME|MF_SPECIAL, // flags + MF_SLIDEME|MF_SPECIAL|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -5615,7 +5615,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 20*FRACUNIT, // mass 0, // damage sfx_None, // activesound - MF_SOLID, // flags + MF_SOLID|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -5642,7 +5642,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 14*FRACUNIT, // mass 0, // damage sfx_None, // activesound - MF_SOLID|MF_SPRING, // flags + MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags S_BLUESPRING2 // raisestate }, @@ -5669,7 +5669,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 26*FRACUNIT, // mass 0, // damage sfx_None, // activesound - MF_SOLID|MF_SPRING, // flags + MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags S_YELLOWSPRING2 // raisestate }, @@ -5696,7 +5696,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 40*FRACUNIT, // mass 0, // damage sfx_None, // activesound - MF_SOLID|MF_SPRING, // flags + MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags S_REDSPRING2 // raisestate }, @@ -5723,7 +5723,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 26*FRACUNIT, // mass 26*FRACUNIT, // damage sfx_None, // activesound - MF_SOLID|MF_SPRING, // flags + MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags S_YDIAG2 // raisestate }, @@ -5750,7 +5750,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 40*FRACUNIT, // mass 40*FRACUNIT, // damage sfx_None, // activesound - MF_SOLID|MF_SPRING, // flags + MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags S_RDIAG2 // raisestate }, @@ -5804,7 +5804,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOCLIP|MF_SCENERY, // flags + MF_NOCLIP|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -5912,7 +5912,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 4, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOGRAVITY|MF_SCENERY|MF_NOCLIPHEIGHT, // flags + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_SCENERY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -8022,7 +8022,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_SPECIAL|MF_NOCLIPHEIGHT, // flags + MF_NOGRAVITY|MF_SPECIAL|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -8049,7 +8049,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_SPECIAL|MF_NOCLIPHEIGHT, // flags + MF_NOGRAVITY|MF_SPECIAL|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -8076,7 +8076,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_mswing, // activesound - MF_PAIN|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags + MF_PAIN|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -8103,7 +8103,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_mswing, // activesound - MF_PAIN|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags + MF_PAIN|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -10482,7 +10482,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -10509,7 +10509,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -10753,7 +10753,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -10942,7 +10942,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 4, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_NOCLIP, // flags + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_NOCLIP|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14277,7 +14277,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 6*FRACUNIT, // mass 0, // damage sfx_None, // activesound - MF_SOLID|MF_SPRING, // flags + MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags S_GRAYSPRING2 // raisestate }, @@ -14331,7 +14331,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 14*FRACUNIT, // mass 14*FRACUNIT, // damage sfx_None, // activesound - MF_SOLID|MF_SPRING, // flags + MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags S_BDIAG2 // raisestate }, @@ -14358,7 +14358,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_RANDOMITEMPOP, // damage sfx_None, // activesound - MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags + MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14385,7 +14385,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = MT_EXPLODE, // mass 0, // damage sfx_None, // activesound - MF_NOCLIP, // flags + MF_NOCLIP|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14412,7 +14412,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_SLIDEME, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_SLIDEME|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14439,7 +14439,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14466,7 +14466,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14493,7 +14493,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14520,7 +14520,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14547,7 +14547,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_FLOAT|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_FLOAT|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14574,7 +14574,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY, // flags + MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14601,7 +14601,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_fake, // activesound - MF_BOUNCE|MF_SHOOTABLE, // flags + MF_BOUNCE|MF_SHOOTABLE|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14628,7 +14628,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_peel, // activesound - MF_BOUNCE|MF_SHOOTABLE, // flags + MF_BOUNCE|MF_SHOOTABLE|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14655,7 +14655,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY, // flags + MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14682,7 +14682,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_s3k96, // activesound - MF_SHOOTABLE|MF_BOUNCE, // flags + MF_SHOOTABLE|MF_BOUNCE|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14709,7 +14709,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY, // flags + MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14736,7 +14736,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_s3kc0s, // activesound - MF_SHOOTABLE, // flags + MF_SHOOTABLE|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14763,7 +14763,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_s3kc0s, // activesound - MF_SHOOTABLE, // flags + MF_SHOOTABLE|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14790,7 +14790,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY, // flags + MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14817,7 +14817,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_s3k5c, // activesound - MF_BOUNCE|MF_SHOOTABLE, // flags + MF_BOUNCE|MF_SHOOTABLE|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14844,7 +14844,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY, // flags + MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14871,7 +14871,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_SOLID|MF_NOGRAVITY, // flags + MF_SOLID|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14925,7 +14925,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14952,7 +14952,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOGRAVITY|MF_BOUNCE|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_BOUNCE|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14979,7 +14979,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_BOUNCE|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_BOUNCE|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15006,7 +15006,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_SHOOTABLE|MF_BOUNCE, // flags + MF_SHOOTABLE|MF_BOUNCE|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15033,7 +15033,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOCLIPTHING, // flags + MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOCLIPTHING|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15060,7 +15060,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15087,7 +15087,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_BOUNCE|MF_FLOAT|MF_NOCLIPTHING|MF_MISSILE|MF_SHOOTABLE, // flags + MF_BOUNCE|MF_FLOAT|MF_NOCLIPTHING|MF_MISSILE|MF_SHOOTABLE|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15114,7 +15114,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15141,7 +15141,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15168,7 +15168,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_bomb, // activesound - MF_BOUNCE|MF_SHOOTABLE, // flags + MF_BOUNCE|MF_SHOOTABLE|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15195,7 +15195,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15222,7 +15222,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOCLIPTHING|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOCLIPTHING|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15249,7 +15249,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOCLIPTHING|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOCLIPTHING|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15357,7 +15357,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15384,7 +15384,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 1000, // mass 0, // damage sfx_None, // activesound - 2, // flags + MF_NOTHINK|MF_NOBLOCKMAP|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15411,7 +15411,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 1000, // mass 0, // damage sfx_None, // activesound - 2, // flags + MF_NOTHINK|MF_NOBLOCKMAP|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15438,7 +15438,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 1000, // mass 0, // damage sfx_None, // activesound - 2, // flags + MF_NOTHINK|MF_NOBLOCKMAP|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15465,7 +15465,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 1000, // mass 0, // damage sfx_None, // activesound - 2, // flags + MF_NOTHINK|MF_NOBLOCKMAP|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15492,7 +15492,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 1000, // mass 0, // damage sfx_None, // activesound - 2, // flags + MF_NOTHINK|MF_NOBLOCKMAP|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15519,7 +15519,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 1000, // mass 0, // damage sfx_None, // activesound - 2, // flags + MF_NOTHINK|MF_NOBLOCKMAP|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15546,7 +15546,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 1000, // mass 0, // damage sfx_None, // activesound - 2, // flags + MF_NOTHINK|MF_NOBLOCKMAP|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -15573,7 +15573,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 1000, // mass 0, // damage sfx_None, // activesound - 2, // flags + MF_NOTHINK|MF_NOBLOCKMAP|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -16626,7 +16626,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_SCENERY|MF_NOCLIP|MF_NOCLIPHEIGHT, // flags + MF_NOGRAVITY|MF_SCENERY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -16653,7 +16653,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT, // flags + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -16680,7 +16680,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_clash, // activesound - MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_SCENERY|MF_RUNSPAWNFUNC, // flags + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_SCENERY|MF_RUNSPAWNFUNC|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -16707,7 +16707,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -16734,7 +16734,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT, // flags + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -16761,7 +16761,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT, // flags + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -16788,7 +16788,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -16815,7 +16815,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -16842,7 +16842,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // mass 0, // damage sfx_None, // activesound - MF_SPECIAL|MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags + MF_SPECIAL|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -16869,7 +16869,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // mass 0, // damage sfx_None, // activesound - MF_NOTHINK|MF_NOCLIP|MF_NOCLIPHEIGHT, // flags + MF_NOTHINK|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, diff --git a/src/p_mobj.h b/src/p_mobj.h index 50645e4b..34d1f644 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -160,7 +160,9 @@ typedef enum MF_GRENADEBOUNCE = 1<<28, // Run the action thinker on spawn. MF_RUNSPAWNFUNC = 1<<29, - // free: 1<<30 and 1<<31 + // Don't remap in Encore mode. + MF_DONTENCOREMAP = 1<<30, + // free: 1<<31 } mobjflag_t; typedef enum diff --git a/src/p_spec.c b/src/p_spec.c index 02d94d90..ccb895f1 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3745,6 +3745,8 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers break; case 12: // Lua sector special break; + case 15: // Invert Encore Remap + break; } DoneSection2: diff --git a/src/r_bsp.c b/src/r_bsp.c index 48f2f179..981d0b56 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -37,14 +37,21 @@ drawseg_t *ds_p = NULL; // indicates doors closed wrt automap bugfix: INT32 doorclosed; -static boolean R_NoEncore(sector_t *sector) +static boolean R_NoEncore(sector_t *sector, boolean ceiling) { + boolean invertencore = (GETSECSPECIAL(sector->special, 2) != 15); +#if 0 // perfect implementation INT32 val = GETSECSPECIAL(sector->special, 3); - if (val == 1 || val == 3) - return true; - if (GETSECSPECIAL(sector->special, 4) == 6) - return true; - return false; + if (val != 1 && val != 3 // spring panel +#else // optimised, see #define GETSECSPECIAL(i,j) ((i >> ((j-1)*4))&15) + if ((!(sector->special & (1<<8)) || (sector->special & ((4|8)<<8))) // spring panel +#endif + && GETSECSPECIAL(sector->special, 4) != 6) // sneaker panel + return !invertencore; + + if (ceiling) + return ((boolean)(sector->flags & SF_FLIPSPECIAL_CEILING) == invertencore); + return ((boolean)(sector->flags & SF_FLIPSPECIAL_FLOOR) == invertencore); } // @@ -945,7 +952,7 @@ static void R_Subsector(size_t num, UINT8 viewnumber) #ifdef ESLOPE , frontsector->f_slope #endif - , R_NoEncore(frontsector)); + , R_NoEncore(frontsector, false)); } else floorplane = NULL; @@ -967,7 +974,7 @@ static void R_Subsector(size_t num, UINT8 viewnumber) #ifdef ESLOPE , frontsector->c_slope #endif - , R_NoEncore(frontsector)); + , R_NoEncore(frontsector, true)); } else ceilingplane = NULL; @@ -1028,7 +1035,7 @@ static void R_Subsector(size_t num, UINT8 viewnumber) #ifdef ESLOPE , *rover->b_slope #endif - , R_NoEncore(rover->master->frontsector)); + , R_NoEncore(rover->master->frontsector, true)); #ifdef ESLOPE ffloor[numffloors].slope = *rover->b_slope; @@ -1074,7 +1081,7 @@ static void R_Subsector(size_t num, UINT8 viewnumber) #ifdef ESLOPE , *rover->t_slope #endif - , R_NoEncore(rover->master->frontsector)); + , R_NoEncore(rover->master->frontsector, false)); #ifdef ESLOPE ffloor[numffloors].slope = *rover->t_slope; @@ -1143,7 +1150,7 @@ static void R_Subsector(size_t num, UINT8 viewnumber) #ifdef ESLOPE , NULL // will ffloors be slopable eventually? #endif - , R_NoEncore(polysec)); + , R_NoEncore(polysec, false)); ffloor[numffloors].height = polysec->floorheight; ffloor[numffloors].polyobj = po; @@ -1189,7 +1196,7 @@ static void R_Subsector(size_t num, UINT8 viewnumber) #ifdef ESLOPE , NULL // will ffloors be slopable eventually? #endif - , R_NoEncore(polysec)); + , R_NoEncore(polysec, true)); ffloor[numffloors].polyobj = po; ffloor[numffloors].height = polysec->ceilingheight; diff --git a/src/r_segs.c b/src/r_segs.c index 5c09d34e..11287f16 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -202,7 +202,7 @@ static void R_DrawWallSplats(void) if (pindex >= MAXLIGHTSCALE) pindex = MAXLIGHTSCALE - 1; dc_colormap = walllights[pindex]; - if (encoremap) + if (encoremap && !(seg->linedef->flags & ML_TFERLINE)) dc_colormap += (256*32); if (frontsector->extra_colormap) @@ -598,7 +598,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) if (height <= windowtop) { dc_colormap = rlight->rcolormap; - if (encoremap) + if (encoremap && !(ldef->flags & ML_TFERLINE)) dc_colormap += (256*32); continue; } @@ -619,7 +619,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) colfunc_2s(col); windowtop = windowbottom + 1; dc_colormap = rlight->rcolormap; - if (encoremap) + if (encoremap && !(ldef->flags & ML_TFERLINE)) dc_colormap += (256*32); } windowbottom = realbot; @@ -637,7 +637,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) pindex = MAXLIGHTSCALE - 1; dc_colormap = walllights[pindex]; - if (encoremap) + if (encoremap && !(ldef->flags & ML_TFERLINE)) dc_colormap += (256*32); if (frontsector->extra_colormap) @@ -1220,7 +1220,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) if (lighteffect) { dc_colormap = rlight->rcolormap; - if (encoremap) + if (encoremap && !(curline->linedef->flags & ML_TFERLINE)) dc_colormap += (256*32); } if (solid && windowtop < bheight) @@ -1250,7 +1250,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) if (lighteffect) { dc_colormap = rlight->rcolormap; - if (encoremap) + if (encoremap && !(curline->linedef->flags & ML_TFERLINE)) dc_colormap += (256*32); } } @@ -1269,7 +1269,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) pindex = MAXLIGHTSCALE - 1; dc_colormap = walllights[pindex]; - if (encoremap) + if (encoremap && !(curline->linedef->flags & ML_TFERLINE)) dc_colormap += (256*32); if (frontsector->extra_colormap) dc_colormap = frontsector->extra_colormap->colormap + (dc_colormap - colormaps); @@ -1501,7 +1501,7 @@ static void R_RenderSegLoop (void) pindex = MAXLIGHTSCALE-1; dc_colormap = walllights[pindex]; - if (encoremap) + if (encoremap && !(curline->linedef->flags & ML_TFERLINE)) dc_colormap += (256*32); dc_x = rw_x; dc_iscale = 0xffffffffu / (unsigned)rw_scale; diff --git a/src/r_things.c b/src/r_things.c index d6596913..67b1a5c7 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -873,9 +873,7 @@ static void R_DrawVisSprite(vissprite_t *vis) if (!dc_colormap) dc_colormap = colormaps; - if (encoremap && !vis->mobj->color - && (vis->mobj->flags & (MF_SCENERY|MF_NOTHINK)) - && !(vis->mobj->flags & ~(MF_SCENERY|MF_NOTHINK|MF_NOCLIP|MF_NOBLOCKMAP|MF_NOGRAVITY))) + if (encoremap && !vis->mobj->color && !(vis->mobj->flags & MF_DONTENCOREMAP)) dc_colormap += (256*32); dc_texturemid = vis->texturemid; From 202e98957d1f0d4f36f9edf90d4a593f76be100a Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 10 Aug 2018 21:11:45 +0100 Subject: [PATCH 05/27] * For testing purposes, show Encoremaps on the level select icons. * HOWEVER, we should seriously address this again later, because the antialiasing DOES result in some unfortunate bullshit... * Encoremap maces per Oni's request and Sal's suggestion --- src/info.c | 8 ++++---- src/m_menu.c | 53 ++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 49 insertions(+), 12 deletions(-) diff --git a/src/info.c b/src/info.c index 5c3de123..2109f74b 100644 --- a/src/info.c +++ b/src/info.c @@ -8022,7 +8022,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_SPECIAL|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags + MF_NOGRAVITY|MF_SPECIAL|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -8049,7 +8049,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_SPECIAL|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags + MF_NOGRAVITY|MF_SPECIAL|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -8076,7 +8076,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_mswing, // activesound - MF_PAIN|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags + MF_PAIN|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, @@ -8103,7 +8103,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_mswing, // activesound - MF_PAIN|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags + MF_PAIN|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, diff --git a/src/m_menu.c b/src/m_menu.c index b23f28a5..18bdf09e 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6749,9 +6749,11 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade) lumpnum_t lumpnum; patch_t *PictureOfLevel; INT32 x, y, w, i, oldval, trans, dupadjust = ((vid.width/vid.dupx) - BASEVIDWIDTH)>>1; + const char *mapname = G_BuildMapName(cv_nextmap.value); + boolean doencore = (cv_kartencore.value && cv_newgametype.value == GT_RACE); // A 160x100 image of the level as entry MAPxxP - lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(cv_nextmap.value))); + lumpnum = W_CheckNumForName(va("%sP", mapname)); if (lumpnum != LUMPERROR) PictureOfLevel = W_CachePatchNum(lumpnum, PU_CACHE); @@ -6770,13 +6772,24 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade) V_DrawFill(x-1, y-1, w+2, i+2, trans); // variable reuse... - V_DrawSmallScaledPatch(x, y, 0, PictureOfLevel); + if (!doencore) + V_DrawSmallScaledPatch(x, y, 0, PictureOfLevel); + else + { + UINT8 *mappingforencore = NULL; + if ((lumpnum = W_CheckNumForName(va("%sE", mapname))) != LUMPERROR) + mappingforencore = W_CachePatchNum(lumpnum, PU_CACHE); + + V_DrawFixedPatch((x+w)<width)/4; - V_DrawTinyScaledPatch(x, y, trans, PictureOfLevel); + x -= horizspac + w/2; + + if (!doencore) + V_DrawTinyScaledPatch(x, y, trans, PictureOfLevel); + else + { + UINT8 *mappingforencore = NULL; + if ((lumpnum = W_CheckNumForName(va("%sE", mapname))) != LUMPERROR) + mappingforencore = W_CachePatchNum(lumpnum, PU_CACHE); + + V_DrawFixedPatch((x+(w/2))< horizspac-dupadjust); x = (BASEVIDWIDTH + w)/2 + horizspac; i = cv_nextmap.value - 1; trans = (rightfade ? V_TRANSLUCENT : 0); + if (doencore) + trans |= V_FLIP; while (x < BASEVIDWIDTH+dupadjust-horizspac) { @@ -6830,15 +6856,26 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade) } while (!M_CanShowLevelInList(i, cv_newgametype.value)); // A 160x100 image of the level as entry MAPxxP - lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(i+1))); + mapname = G_BuildMapName(i+1); + lumpnum = W_CheckNumForName(va("%sP", mapname)); if (lumpnum != LUMPERROR) PictureOfLevel = W_CachePatchNum(lumpnum, PU_CACHE); else PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE); - V_DrawTinyScaledPatch(x, y, trans, PictureOfLevel); - x += horizspac + SHORT(PictureOfLevel->width)/4; + if (!doencore) + V_DrawTinyScaledPatch(x, y, trans, PictureOfLevel); + else + { + UINT8 *mappingforencore = NULL; + if ((lumpnum = W_CheckNumForName(va("%sE", mapname))) != LUMPERROR) + mappingforencore = W_CachePatchNum(lumpnum, PU_CACHE); + + V_DrawFixedPatch((x+(w/2))< Date: Sat, 11 Aug 2018 22:23:40 +0100 Subject: [PATCH 06/27] * Encore on the voting screen! Appears randomly once unlocked in the same slot as that which sometimes represents a gametype change (odds inflated for testing purposes). * A better representation of an Encore level, now with inverted graphics (a special remapping we can now use elsewhere whenever if we want!) and a floating Ruby! * Decouple encore's setting from cv_kartencore on mapload. Instead, bake it into D_MapChange and related, which will only some of the time be fed by cv_kartencore's value. * Encore mode now has a special mapheader palette setting, "encorepal", rather than using the same one as non-encore. --- src/d_clisrv.c | 2 +- src/d_main.c | 2 +- src/d_netcmd.c | 40 ++++++++++++------------ src/d_netcmd.h | 2 +- src/dehacked.c | 2 ++ src/doomstat.h | 5 +-- src/f_finale.c | 2 +- src/g_game.c | 26 ++++++++------- src/g_game.h | 4 +-- src/m_menu.c | 51 +++++++++++------------------- src/p_setup.c | 13 ++------ src/p_tick.c | 2 +- src/r_data.c | 12 ++++++- src/r_data.h | 1 + src/r_state.h | 3 +- src/v_video.c | 3 +- src/y_inter.c | 85 ++++++++++++++++++++++++++++++++++++-------------- 17 files changed, 144 insertions(+), 111 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 13650c59..63393690 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4758,7 +4758,7 @@ void TryRunTics(tic_t realtics) { COM_BufExecute(); if (mapchangepending) - D_MapChange(-1, 0, ultimatemode, false, 2, false, fromlevelselect); // finish the map change + D_MapChange(-1, 0, encoremode, false, 2, false, fromlevelselect); // finish the map change } NetUpdate(); diff --git a/src/d_main.c b/src/d_main.c index 0100db38..bf6af7ea 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1489,7 +1489,7 @@ void D_SRB2Main(void) else if (!dedicated && M_MapLocked(pstartmap)) I_Error("You need to unlock this level before you can warp to it!\n"); else - D_MapChange(pstartmap, gametype, ultimatemode, true, 0, false, false); + D_MapChange(pstartmap, gametype, (boolean)cv_kartencore.value, true, 0, false, false); } } else if (M_CheckParm("-skipintro")) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index c157f21c..28d33be9 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -446,6 +446,7 @@ consvar_t cv_sleep = {"cpusleep", "-1", CV_SAVE, sleeping_cons_t, NULL, -1, NULL INT16 gametype = GT_RACE; // SRB2kart boolean forceresetplayers = false; +boolean deferencoremode = false; UINT8 splitscreen = 0; boolean circuitmap = true; // SRB2kart INT32 adminplayers[MAXPLAYERS]; @@ -1872,7 +1873,7 @@ INT32 mapchangepending = 0; * * \param mapnum Map number to change to. * \param gametype Gametype to switch to. - * \param pultmode Is this 'Ultimate Mode'? + * \param pencoremode Is this 'Encore Mode'? * \param resetplayers 1 to reset player scores and lives and such, 0 not to. * \param delay Determines how the function will be executed: 0 to do * it all right now (must not be done from a menu), 1 to @@ -1881,18 +1882,16 @@ INT32 mapchangepending = 0; * \sa D_GameTypeChanged, Command_Map_f * \author Graue */ -void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pultmode, boolean resetplayers, INT32 delay, boolean skipprecutscene, boolean FLS) +void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pencoremode, boolean resetplayers, INT32 delay, boolean skipprecutscene, boolean FLS) { static char buf[2+MAX_WADPATH+1+4]; static char *buf_p = buf; - forceresetplayers = false; - // The supplied data are assumed to be good. I_Assert(delay >= 0 && delay <= 2); - CONS_Debug(DBG_GAMELOGIC, "Map change: mapnum=%d gametype=%d ultmode=%d resetplayers=%d delay=%d skipprecutscene=%d\n", - mapnum, newgametype, pultmode, resetplayers, delay, skipprecutscene); + CONS_Debug(DBG_GAMELOGIC, "Map change: mapnum=%d gametype=%d encoremode=%d resetplayers=%d delay=%d skipprecutscene=%d\n", + mapnum, newgametype, pencoremode, resetplayers, delay, skipprecutscene); if (netgame || multiplayer) FLS = false; @@ -1905,7 +1904,7 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pultmode, boolean rese I_Assert(W_CheckNumForName(mapname) != LUMPERROR); buf_p = buf; - if (pultmode) + if (pencoremode) flags |= 1; if (!resetplayers) flags |= 1<<1; @@ -1973,8 +1972,12 @@ void D_SetupVote(void) INT32 i; UINT8 secondgt = G_SometimesGetDifferentGametype(); - WRITEUINT8(p, gametype); + if (cv_kartencore.value && G_RaceGametype()) + WRITEUINT8(p, (gametype|0x80)); + else + WRITEUINT8(p, gametype); WRITEUINT8(p, secondgt); + secondgt &= ~0x80; for (i = 0; i < 5; i++) { @@ -2109,10 +2112,6 @@ static void Command_Map_f(void) return; } - // Ultimate Mode only in SP via menu - if (netgame || multiplayer) - ultimatemode = false; - // new gametype value // use current one by default i = COM_CheckParm("-gametype"); @@ -2177,7 +2176,7 @@ static void Command_Map_f(void) } fromlevelselect = false; - D_MapChange(newmapnum, newgametype, false, newresetplayers, 0, false, false); + D_MapChange(newmapnum, newgametype, (boolean)cv_kartencore.value, newresetplayers, 0, false, false); } /** Receives a map command and changes the map. @@ -2193,6 +2192,9 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) UINT8 flags; INT32 resetplayer = 1, lastgametype; UINT8 skipprecutscene, FLS; + boolean pencoremode; + + forceresetplayers = deferencoremode = false; if (playernum != serverplayer && !IsPlayerAdmin(playernum)) { @@ -2213,9 +2215,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) flags = READUINT8(*cp); - ultimatemode = ((flags & 1) != 0); - if (netgame || multiplayer) - ultimatemode = false; + pencoremode = ((flags & 1) != 0); resetplayer = ((flags & (1<<1)) == 0); @@ -2225,6 +2225,9 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) if (gametype != lastgametype) D_GameTypeChanged(lastgametype); // emulate consvar_t behavior for gametype + if (!G_RaceGametype()) + pencoremode = false; + skipprecutscene = ((flags & (1<<2)) != 0); FLS = ((flags & (1<<3)) != 0); @@ -2256,7 +2259,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) LUAh_MapChange(); #endif - G_InitNew(ultimatemode, mapname, resetplayer, skipprecutscene); + G_InitNew(pencoremode, mapname, resetplayer, skipprecutscene); if (demoplayback && !timingdemo) precache = true; CON_ToggleOff(); @@ -5250,10 +5253,7 @@ static void KartEncore_OnChange(void) if ((boolean)cv_kartencore.value != encoremode && gamestate == GS_LEVEL /*&& leveltime > starttime*/) CONS_Printf(M_GetText("Encore Mode will be turned %s next round.\n"), cv_kartencore.value ? M_GetText("on") : M_GetText("off")); else - { CONS_Printf(M_GetText("Encore Mode has been turned %s.\n"), cv_kartencore.value ? M_GetText("on") : M_GetText("off")); - //encoremode = (boolean)cv_kartencore.value; - } } } diff --git a/src/d_netcmd.h b/src/d_netcmd.h index b7721b79..5238c44e 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -251,7 +251,7 @@ void D_SendPlayerConfig(void); void Command_ExitGame_f(void); void Command_Retry_f(void); void D_GameTypeChanged(INT32 lastgametype); // not a real _OnChange function anymore -void D_MapChange(INT32 pmapnum, INT32 pgametype, boolean pultmode, boolean presetplayers, INT32 pdelay, boolean pskipprecutscene, boolean pfromlevelselect); +void D_MapChange(INT32 pmapnum, INT32 pgametype, boolean pencoremode, boolean presetplayers, INT32 pdelay, boolean pskipprecutscene, boolean pfromlevelselect); void D_SetupVote(void); void D_ModifyClientVote(SINT8 voted, UINT8 splitplayer); void D_PickVote(void); diff --git a/src/dehacked.c b/src/dehacked.c index af72719b..cd013148 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1221,6 +1221,8 @@ static void readlevelheader(MYFILE *f, INT32 num) mapheaderinfo[num-1]->countdown = (INT16)i; else if (fastcmp(word, "PALETTE")) mapheaderinfo[num-1]->palette = (UINT16)i; + else if (fastcmp(word, "ENCOREPAL")) + mapheaderinfo[num-1]->encorepal = (UINT16)i; else if (fastcmp(word, "NUMLAPS")) mapheaderinfo[num-1]->numlaps = (UINT8)i; else if (fastcmp(word, "UNLOCKABLE")) diff --git a/src/doomstat.h b/src/doomstat.h index dbe9fa34..f54abebc 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -80,7 +80,7 @@ extern INT16 gametype; extern UINT8 splitscreen; extern boolean circuitmap; // Does this level have 'circuit mode'? extern boolean fromlevelselect; -extern boolean forceresetplayers; +extern boolean forceresetplayers, deferencoremode; // ======================================== // Internal parameters for sound rendering. @@ -243,6 +243,7 @@ typedef struct UINT8 cutscenenum; ///< Cutscene number to use, 0 for none. INT16 countdown; ///< Countdown until level end? UINT16 palette; ///< PAL lump to use on this map + UINT16 encorepal; ///< PAL for encore mode UINT8 numlaps; ///< Number of laps in circuit mode, unless overridden. SINT8 unlockrequired; ///< Is an unlockable required to play this level? -1 if no. UINT8 levelselect; ///< Is this map available in the level select? If so, which map list is it available in? @@ -448,7 +449,7 @@ extern INT32 cheats; // SRB2kart extern UINT8 gamespeed; extern boolean franticitems; -extern boolean encoremode; +extern boolean encoremode, prevencoremode; extern boolean comeback; extern SINT8 battlewanted[4]; diff --git a/src/f_finale.c b/src/f_finale.c index ab79fa78..e5d342ad 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1252,7 +1252,7 @@ void F_EndCutScene(void) if (runningprecutscene) { if (server) - D_MapChange(gamemap, gametype, ultimatemode, precutresetplayer, 0, true, false); + D_MapChange(gamemap, gametype, false, precutresetplayer, 0, true, false); } else { diff --git a/src/g_game.c b/src/g_game.c index 48ba8724..cb7f276c 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -248,7 +248,8 @@ INT32 cheats; //for multiplayer cheat commands // SRB2Kart // Cvars that we don't want changed mid-game UINT8 gamespeed; // Game's current speed (or difficulty, or cc, or etc); 0 for easy, 1 for normal, 2 for hard -boolean encoremode; // Encore Mode currently enabled? +boolean encoremode = false; // Encore Mode currently enabled? +boolean prevencoremode; boolean franticitems; // Frantic items currently enabled? boolean comeback; // Battle Mode's karma comeback is on/off @@ -3097,13 +3098,16 @@ boolean G_BattleGametype(void) // // G_SometimesGetDifferentGametype // -// I pity the fool who adds more gametypes later, because it'll require some element of randomisation which needs to be synched... -// Although given this only gets called for the host, you could probably get away with M_Random. +// Oh, yeah, and we sometimes flip encore mode on here too. // INT16 G_SometimesGetDifferentGametype(void) { if (randmapbuffer[NUMMAPS] != -1) + { + if (M_SecretUnlocked(SECRET_ENCORE) && (M_RandomChance(FRACUNIT/2/*56*/) != cv_kartencore.value) && G_RaceGametype()) + return (gametype|0x80); return gametype; + } randmapbuffer[NUMMAPS] = gametype; @@ -3477,6 +3481,7 @@ void G_NextLevel(void) } forceresetplayers = false; + deferencoremode = (boolean)cv_kartencore.value; } gameaction = ga_worlddone; @@ -3489,7 +3494,7 @@ static void G_DoWorldDone(void) // SRB2Kart D_MapChange(nextmap+1, gametype, - ultimatemode, + deferencoremode, forceresetplayers, 0, false, @@ -3561,7 +3566,7 @@ static void G_DoContinued(void) // Reset # of lives pl->lives = (ultimatemode) ? 1 : 3; - D_MapChange(gamemap, gametype, ultimatemode, false, 0, false, false); + D_MapChange(gamemap, gametype, false, false, 0, false, false); gameaction = ga_nothing; } @@ -4075,7 +4080,7 @@ void G_SaveGame(UINT32 savegameslot) // Can be called by the startup code or the menu task, // consoleplayer, displayplayer, playeringame[] should be set. // -void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar, UINT8 ssplayers, boolean FLS) +void G_DeferedInitNew(boolean pencoremode, const char *mapname, INT32 pickedchar, UINT8 ssplayers, boolean FLS) { INT32 i; UINT8 color = 0; @@ -4120,14 +4125,14 @@ void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar, U CV_StealthSetValue(&cv_playercolor, color); if (mapname) - D_MapChange(M_MapNumber(mapname[3], mapname[4]), gametype, pultmode, true, 1, false, FLS); + D_MapChange(M_MapNumber(mapname[3], mapname[4]), gametype, pencoremode, true, 1, false, FLS); } // // This is the map command interpretation something like Command_Map_f // // called at: map cmd execution, doloadgame, doplaydemo -void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean skipprecutscene) +void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, boolean skipprecutscene) { INT32 i; @@ -4137,8 +4142,8 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean S_ResumeAudio(); } - if (netgame || multiplayer) // Nice try, haxor. - ultimatemode = false; + prevencoremode = ((gamestate == GS_TITLESCREEN) ? false : encoremode); + encoremode = pencoremode; legitimateexit = false; // SRB2Kart comebackshowninfo = false; @@ -4227,7 +4232,6 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean // Don't carry over custom music change to another map. mapmusflags |= MUSIC_RELOADRESET; - ultimatemode = pultmode; playerdeadview = false; automapactive = false; imcontinuing = false; diff --git a/src/g_game.h b/src/g_game.h index ad099bf2..10eb4c68 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -107,7 +107,7 @@ extern boolean camspin, camspin2, camspin3, camspin4; // SRB2Kart void G_ChangePlayerReferences(mobj_t *oldmo, mobj_t *newmo); void G_DoReborn(INT32 playernum); void G_PlayerReborn(INT32 player); -void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, +void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, boolean skipprecutscene); char *G_BuildMapTitle(INT32 mapnum); @@ -119,7 +119,7 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost); // Can be called by the startup code or M_Responder. // A normal game starts at map 1, but a warp test can start elsewhere -void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar, +void G_DeferedInitNew(boolean pencoremode, const char *mapname, INT32 pickedchar, UINT8 ssplayers, boolean FLS); void G_DoLoadLevel(boolean resetplayer); diff --git a/src/m_menu.c b/src/m_menu.c index 18bdf09e..5d557f89 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -5420,7 +5420,7 @@ static void M_ChoosePlayer(INT32 choice) { char *skin1,*skin2; INT32 skinnum; - boolean ultmode = (ultimate_selectable && SP_PlayerDef.prevMenu == &SP_LoadDef && saveSlotSelected == NOSAVESLOT); + //boolean ultmode = (ultimate_selectable && SP_PlayerDef.prevMenu == &SP_LoadDef && saveSlotSelected == NOSAVESLOT); // skip this if forcecharacter if (mapheaderinfo[startmap-1] && mapheaderinfo[startmap-1]->forcecharacter[0] == '\0') @@ -5457,7 +5457,7 @@ static void M_ChoosePlayer(INT32 choice) lastmapsaved = 0; gamecomplete = false; - G_DeferedInitNew(ultmode, G_BuildMapName(startmap), (UINT8)skinnum, 0, fromlevelselect); + G_DeferedInitNew(false, G_BuildMapName(startmap), (UINT8)skinnum, 0, fromlevelselect); COM_BufAddText("dummyconsvar 1\n"); // G_DeferedInitNew doesn't do this } @@ -6724,7 +6724,7 @@ static void M_StartServer(INT32 choice) if (ssplayers < 1) { - D_MapChange(cv_nextmap.value, cv_newgametype.value, false, 1, 1, false, false); + D_MapChange(cv_nextmap.value, cv_newgametype.value, (boolean)cv_kartencore.value, 1, 1, false, false); COM_BufAddText("dummyconsvar 1\n"); } else // split screen @@ -6738,7 +6738,7 @@ static void M_StartServer(INT32 choice) SplitScreen_OnChange(); } - D_MapChange(cv_nextmap.value, cv_newgametype.value, false, 1, 1, false, false); + D_MapChange(cv_nextmap.value, cv_newgametype.value, (boolean)cv_kartencore.value, 1, 1, false, false); } M_ClearMenus(true); @@ -6750,7 +6750,7 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade) patch_t *PictureOfLevel; INT32 x, y, w, i, oldval, trans, dupadjust = ((vid.width/vid.dupx) - BASEVIDWIDTH)>>1; const char *mapname = G_BuildMapName(cv_nextmap.value); - boolean doencore = (cv_kartencore.value && cv_newgametype.value == GT_RACE); + //boolean doencore = (cv_kartencore.value && cv_newgametype.value == GT_RACE); // A 160x100 image of the level as entry MAPxxP lumpnum = W_CheckNumForName(va("%sP", mapname)); @@ -6772,15 +6772,22 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade) V_DrawFill(x-1, y-1, w+2, i+2, trans); // variable reuse... - if (!doencore) + if (!cv_kartencore.value || cv_newgametype.value != GT_RACE) V_DrawSmallScaledPatch(x, y, 0, PictureOfLevel); else { - UINT8 *mappingforencore = NULL; + /*UINT8 *mappingforencore = NULL; if ((lumpnum = W_CheckNumForName(va("%sE", mapname))) != LUMPERROR) - mappingforencore = W_CachePatchNum(lumpnum, PU_CACHE); + mappingforencore = W_CachePatchNum(lumpnum, PU_CACHE);*/ - V_DrawFixedPatch((x+w)<>ANGLETOFINESHIFT); + V_DrawFixedPatch((x+w/2)< horizspac-dupadjust); x = (BASEVIDWIDTH + w)/2 + horizspac; i = cv_nextmap.value - 1; trans = (rightfade ? V_TRANSLUCENT : 0); - if (doencore) - trans |= V_FLIP; while (x < BASEVIDWIDTH+dupadjust-horizspac) { @@ -6864,16 +6858,7 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade) else PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE); - if (!doencore) - V_DrawTinyScaledPatch(x, y, trans, PictureOfLevel); - else - { - UINT8 *mappingforencore = NULL; - if ((lumpnum = W_CheckNumForName(va("%sE", mapname))) != LUMPERROR) - mappingforencore = W_CachePatchNum(lumpnum, PU_CACHE); - - V_DrawFixedPatch((x+(w/2))<countdown = 0; DEH_WriteUndoline("PALLETE", va("%u", mapheaderinfo[num]->palette), UNDO_NONE); mapheaderinfo[num]->palette = UINT16_MAX; + DEH_WriteUndoline("ENCOREPAL", va("%u", mapheaderinfo[num]->encorepal), UNDO_NONE); + mapheaderinfo[num]->encorepal = UINT16_MAX; DEH_WriteUndoline("NUMLAPS", va("%u", mapheaderinfo[num]->numlaps), UNDO_NONE); mapheaderinfo[num]->numlaps = NUMLAPS_DEFAULT; DEH_WriteUndoline("UNLOCKABLE", va("%s", mapheaderinfo[num]->unlockrequired), UNDO_NONE); @@ -2247,28 +2247,19 @@ static void P_LevelInitStuff(void) players[i].pflags &= ~PF_TRANSFERTOCLOSEST; } - prevencoremode = ((wipegamestate == GS_TITLESCREEN) ? false : encoremode); - // SRB2Kart: map load variables if (modeattacking) // Just play it safe and set everything { gamespeed = 2; - encoremode = false; franticitems = false; comeback = true; } else { if (G_BattleGametype()) - { gamespeed = 0; - encoremode = false; - } else - { gamespeed = (UINT8)cv_kartspeed.value; - encoremode = (boolean)cv_kartencore.value; - } franticitems = (boolean)cv_kartfrantic.value; comeback = (boolean)cv_kartcomeback.value; } diff --git a/src/p_tick.c b/src/p_tick.c index b9aaccf7..bf0777aa 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -744,7 +744,7 @@ void P_Ticker(boolean run) if (mapreset > 1 && --mapreset <= 1 && server) // Remember: server uses it for mapchange, but EVERYONE ticks down for the animation - D_MapChange(gamemap, gametype, ultimatemode, true, 0, false, false); + D_MapChange(gamemap, gametype, encoremode, true, 0, false, false); } P_MapEnd(); diff --git a/src/r_data.c b/src/r_data.c index 1e2bc628..e3d23dd7 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -112,7 +112,8 @@ INT32 *texturetranslation; sprcache_t *spritecachedinfo; lighttable_t *colormaps; -lighttable_t *encoremap; +UINT8 *encoremap; +UINT8 invertmap[256]; // for debugging/info purposes static size_t flatmemory, spritememory, texturememory; @@ -1019,6 +1020,7 @@ static void R_InitColormaps(void) // Init Boom colormaps. R_ClearColormaps(); //R_InitExtraColormaps(); + R_MakeInvertmap(); // this isn't the BEST place to do it the first time, but whatever } void R_ReInitColormaps(UINT16 num, lumpnum_t newencoremap) @@ -1301,6 +1303,14 @@ void R_MakeColormaps(void) colormapFixingArray[i][2]); } +void R_MakeInvertmap(void) +{ + size_t i; + + for (i = 0; i < 256; i++) + invertmap[i] = NearestColor(256 - pLocalPalette[i].s.red, 256 - pLocalPalette[i].s.green, 256 - pLocalPalette[i].s.blue); +} + void R_CreateColormap2(char *p1, char *p2, char *p3) { double cmaskr, cmaskg, cmaskb, cdestr, cdestg, cdestb; diff --git a/src/r_data.h b/src/r_data.h index fb8756df..4cc6f206 100644 --- a/src/r_data.h +++ b/src/r_data.h @@ -95,6 +95,7 @@ INT32 R_ColormapNumForName(char *name); INT32 R_CreateColormap(char *p1, char *p2, char *p3); void R_CreateColormap2(char *p1, char *p2, char *p3); void R_MakeColormaps(void); +void R_MakeInvertmap(void); const char *R_ColormapNameForNum(INT32 num); extern INT32 numtextures; diff --git a/src/r_state.h b/src/r_state.h index a651bda7..88a38f25 100644 --- a/src/r_state.h +++ b/src/r_state.h @@ -38,7 +38,8 @@ typedef struct extern sprcache_t *spritecachedinfo; extern lighttable_t *colormaps; -extern lighttable_t *encoremap; +extern UINT8 *encoremap; +extern UINT8 invertmap[256]; // Boom colormaps. // Had to put a limit on colormaps :( diff --git a/src/v_video.c b/src/v_video.c index 8013ae82..6f9ff219 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -207,7 +207,7 @@ const char *R_GetPalname(UINT16 num) const char *GetPalette(void) { if (gamestate == GS_LEVEL) - return R_GetPalname(mapheaderinfo[gamemap-1]->palette); + return R_GetPalname((encoremode ? mapheaderinfo[gamemap-1]->encorepal : mapheaderinfo[gamemap-1]->palette)); return "PLAYPAL"; } @@ -248,6 +248,7 @@ void V_SetPaletteLump(const char *pal) #endif if (rendermode != render_none) I_SetPalette(pLocalPalette); + R_MakeInvertmap(); } static void CV_usegamma_OnChange(void) diff --git a/src/y_inter.c b/src/y_inter.c index 14421ad7..d34e5d59 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -126,6 +126,7 @@ typedef struct UINT8 gtc; const char *gts; patch_t *pic; + boolean encore; } y_votelvlinfo; // Clientside & splitscreen player info. @@ -156,6 +157,7 @@ static patch_t *cursor2 = NULL; static patch_t *cursor3 = NULL; static patch_t *cursor4 = NULL; static patch_t *randomlvl = NULL; +static patch_t *rubyicon = NULL; static void Y_UnloadVoteData(void); @@ -930,6 +932,7 @@ void Y_VoteDrawer(void) { INT32 i, x, y = 0, height = 0; UINT8 selected[4]; + fixed_t rubyheight = 0; if (rendermode == render_none) return; @@ -940,6 +943,11 @@ void Y_VoteDrawer(void) if (!voteclient.loaded) return; + { + angle_t rubyfloattime = (ANGLE_MAX/NEWTICRATE)*(votetic % NEWTICRATE); + rubyheight = FINESINE(rubyfloattime>>ANGLETOFINESHIFT); + } + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); if (widebgpatch && rendermode == render_soft && vid.width / vid.dupx > 320) @@ -974,19 +982,18 @@ void Y_VoteDrawer(void) y = (200-height)/2; for (i = 0; i < 4; i++) { - char str[40]; + const char *str; patch_t *pic; UINT8 j, color; if (i == 3) { - snprintf(str, sizeof str, "%.32s", "RANDOM"); - str[sizeof str - 1] = '\0'; + str = "RANDOM"; pic = randomlvl; } else { - strcpy(str, levelinfo[i].str); + str = levelinfo[i].str; pic = levelinfo[i].pic; } @@ -1051,7 +1058,14 @@ void Y_VoteDrawer(void) sizeadd--; } - V_DrawSmallScaledPatch(BASEVIDWIDTH-100, y, V_SNAPTORIGHT, pic); + if (!levelinfo[i].encore) + V_DrawSmallScaledPatch(BASEVIDWIDTH-100, y, V_SNAPTORIGHT, pic); + else + { + V_DrawFixedPatch((BASEVIDWIDTH-20)<zonttl) > 0) + // set up the levelstring + if (mapheaderinfo[votelevels[i][0]]->levelflags & LF_NOZONE || !mapheaderinfo[votelevels[i][0]]->zonttl[0]) { - if (strlen(mapheaderinfo[votelevels[i][0]]->actnum) > 0) + if (mapheaderinfo[votelevels[i][0]]->actnum[0]) snprintf(levelinfo[i].str, sizeof levelinfo[i].str, - "%.32s %.32s %s", + "%s %s", + mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[votelevels[i][0]]->actnum); + else + snprintf(levelinfo[i].str, + sizeof levelinfo[i].str, + "%s", + mapheaderinfo[votelevels[i][0]]->lvlttl); + } + else + { + if (mapheaderinfo[votelevels[i][0]]->actnum[0]) + snprintf(levelinfo[i].str, + sizeof levelinfo[i].str, + "%s %s %s", mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->zonttl, mapheaderinfo[votelevels[i][0]]->actnum); else snprintf(levelinfo[i].str, sizeof levelinfo[i].str, - "%.32s %.32s", + "%s %s", mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->zonttl); } - else - { - if (strlen(mapheaderinfo[votelevels[i][0]]->actnum) > 0) - snprintf(levelinfo[i].str, - sizeof levelinfo[i].str, - "%.32s %s", - mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->actnum); - else - snprintf(levelinfo[i].str, - sizeof levelinfo[i].str, - "%.32s", - mapheaderinfo[votelevels[i][0]]->lvlttl); - } levelinfo[i].str[sizeof levelinfo[i].str - 1] = '\0'; } @@ -1493,6 +1529,7 @@ static void Y_UnloadVoteData(void) UNLOAD(cursor3); UNLOAD(cursor4); UNLOAD(randomlvl); + UNLOAD(rubyicon); UNLOAD(levelinfo[4].pic); UNLOAD(levelinfo[3].pic); From dd6259c44f1884557ea538078470ca753c5e8142 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 11 Aug 2018 22:51:11 +0100 Subject: [PATCH 07/27] Encore mapload linedef executor (number 328), as requested by Oni. --- src/p_spec.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/p_spec.c b/src/p_spec.c index d1ee7e7c..90166104 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1940,6 +1940,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller || specialtype == 318 // Unlockable trigger - Once || specialtype == 320 // Unlockable - Once || specialtype == 321 || specialtype == 322 // Trigger on X calls - Continuous + Each Time + || specialtype == 328 // Encore Load || specialtype == 399) // Level Load triggerline->special = 0; // Clear it out @@ -1975,6 +1976,7 @@ void P_LinedefExecute(INT16 tag, mobj_t *actor, sector_t *caller) // "No More Enemies" and "Level Load" take care of themselves. if (lines[masterline].special == 313 || lines[masterline].special == 399 + || lines[masterline].special == 328 // Each-time executors handle themselves, too || lines[masterline].special == 301 // Each time || lines[masterline].special == 306 // Character ability - Each time @@ -5561,7 +5563,7 @@ static void P_RunLevelLoadExecutors(void) for (i = 0; i < numlines; i++) { - if (lines[i].special == 399) + if (lines[i].special == 399 || lines[i].special == 328) P_RunTriggerLinedef(&lines[i], NULL, NULL); } } @@ -6452,6 +6454,12 @@ void P_SpawnSpecials(INT32 fromnetsave) } break; + case 328: // Encore-only linedef execute on map load + if (!encoremode) + lines[i].special = 0; + // This is handled in P_RunLevelLoadExecutors. + break; + case 399: // Linedef execute on map load // This is handled in P_RunLevelLoadExecutors. break; From 806353c86a142c6b8f479bf6bc853d8bcc19c9c9 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 12 Aug 2018 11:20:53 +0100 Subject: [PATCH 08/27] Fixed Encore remappings not being loaded when joining mid-netgame. --- src/p_saveg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 8f4e12d4..d9f43000 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3207,6 +3207,8 @@ static void P_NetArchiveMisc(void) WRITEUINT32(save_p, tokenlist); + WRITEUINT8(save_p, encoremode); + WRITEUINT32(save_p, leveltime); WRITEUINT32(save_p, totalrings); WRITEINT16(save_p, lastmap); @@ -3256,7 +3258,6 @@ static void P_NetArchiveMisc(void) WRITEINT32(save_p, numgotboxes); WRITEUINT8(save_p, gamespeed); - WRITEUINT8(save_p, encoremode); WRITEUINT8(save_p, franticitems); WRITEUINT8(save_p, comeback); @@ -3308,6 +3309,8 @@ static inline boolean P_NetUnArchiveMisc(void) tokenlist = READUINT32(save_p); + encoremode = (boolean)READUINT8(save_p); + if (!P_SetupLevel(true)) return false; @@ -3361,7 +3364,6 @@ static inline boolean P_NetUnArchiveMisc(void) numgotboxes = READINT32(save_p); gamespeed = READUINT8(save_p); - encoremode = (boolean)READUINT8(save_p); franticitems = (boolean)READUINT8(save_p); comeback = (boolean)READUINT8(save_p); From b7f7da4f6c4dcc6ff1daa2895a59282fa5236c5f Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 12 Aug 2018 15:10:47 +0100 Subject: [PATCH 09/27] Bugfix for "Blue Mountain 0", "Green Hills K". Also, minor tweak. --- src/st_stuff.c | 2 +- src/y_inter.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index ac3391de..72266ba2 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -770,7 +770,7 @@ static void ST_drawLevelTitle(void) lvlw = V_LevelNameWidth(lvlttl); - if (strlen(actnum) > 0) + if (actnum[0]) lvlttlxpos = ((BASEVIDWIDTH/2) - (lvlw/2)) - V_LevelNameWidth(actnum); else lvlttlxpos = ((BASEVIDWIDTH/2) - (lvlw/2)); diff --git a/src/y_inter.c b/src/y_inter.c index d34e5d59..d88f3d34 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1460,7 +1460,7 @@ void Y_StartVote(void) snprintf(levelinfo[i].str, sizeof levelinfo[i].str, "%s %s", - mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[votelevels[i][0]]->actnum); + mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->actnum); else snprintf(levelinfo[i].str, sizeof levelinfo[i].str, From 19b2c20bda92097d909ca5cf127aabb27e2944a5 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 14 Aug 2018 15:32:17 +0100 Subject: [PATCH 10/27] * Disable inverting on encore level select pictures at unanimous request of last night's netgame. * Also, correct their alignment in y_inter.c. --- src/m_menu.c | 2 +- src/r_data.c | 6 ++++++ src/r_data.h | 2 ++ src/r_state.h | 2 ++ src/v_video.c | 2 ++ src/y_inter.c | 12 ++++++------ 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 5d557f89..ae46549c 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6780,7 +6780,7 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade) if ((lumpnum = W_CheckNumForName(va("%sE", mapname))) != LUMPERROR) mappingforencore = W_CachePatchNum(lumpnum, PU_CACHE);*/ - V_DrawFixedPatch((x+w)< Date: Wed, 15 Aug 2018 16:12:36 +0100 Subject: [PATCH 11/27] Added "Random" to the level selection list, for those days when you know you *want* to race but don't have any idea what to do. --- src/command.c | 8 ++---- src/g_game.c | 16 ++++++++++- src/m_menu.c | 79 +++++++++++++++++++++++++++++++++------------------ 3 files changed, 69 insertions(+), 34 deletions(-) diff --git a/src/command.c b/src/command.c index 54406ade..03c8869d 100644 --- a/src/command.c +++ b/src/command.c @@ -1482,14 +1482,12 @@ void CV_AddValue(consvar_t *var, INT32 increment) { if(increment > 0) // Going up! { - newvalue++; - if (newvalue == NUMMAPS) - newvalue = 0; + if (++newvalue == NUMMAPS) + newvalue = -1; } else // Going down! { - newvalue--; - if (newvalue == -1) + if (--newvalue == -2) newvalue = NUMMAPS-1; } diff --git a/src/g_game.c b/src/g_game.c index d60ca57b..6f5c5e69 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -765,9 +765,20 @@ const char *G_BuildMapName(INT32 map) { static char mapname[10] = "MAPXX"; // internal map name (wad resource name) - I_Assert(map > 0); + I_Assert(map >= 0); I_Assert(map <= NUMMAPS); + if (map == 0) // hack??? + { + if (gamestate == GS_TITLESCREEN) + map = -1; + else if (gamestate == GS_LEVEL) + map = gamemap; + else + map = prevmap; + map = G_RandMap(G_TOLFlag(cv_newgametype.value), map, false, false, 0, false); + } + if (map < 100) sprintf(&mapname[3], "%.2d", map); else @@ -4260,6 +4271,9 @@ char *G_BuildMapTitle(INT32 mapnum) { char *title = NULL; + if (mapnum == 0) + return Z_StrDup("Random"); + if (strcmp(mapheaderinfo[mapnum-1]->lvlttl, "")) { size_t len = 1; diff --git a/src/m_menu.c b/src/m_menu.c index ae46549c..910076e5 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -383,7 +383,7 @@ static void Dummystaff_OnChange(void); // ========================================================================== static CV_PossibleValue_t map_cons_t[] = { - {1,"MIN"}, + {0,"MIN"}, {NUMMAPS, "MAX"}, {0, NULL} }; @@ -2147,9 +2147,9 @@ static void Dummystaff_OnChange(void) // Newgametype. Used for gametype changes. static void Newgametype_OnChange(void) { - if (menuactive) + if (cv_nextmap.value && menuactive) { - if(!mapheaderinfo[cv_nextmap.value-1]) + if (!mapheaderinfo[cv_nextmap.value-1]) P_AllocMapHeader((INT16)(cv_nextmap.value-1)); if ((cv_newgametype.value == GT_RACE && !(mapheaderinfo[cv_nextmap.value-1]->typeoflevel & TOL_RACE)) || // SRB2kart @@ -3852,6 +3852,10 @@ static void M_PrepareLevelSelect(void) // boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt) { + // Random map! + if (mapnum == -1) + return (gamestate != GS_TIMEATTACK && !modeattacking); + // Does the map exist? if (!mapheaderinfo[mapnum]) return false; @@ -5874,11 +5878,16 @@ static void M_TimeAttack(INT32 choice) M_PrepareLevelSelect(); M_SetupNextMenu(&SP_TimeAttackDef); - Nextmap_OnChange(); + + G_SetGamestate(GS_TIMEATTACK); + + if (cv_nextmap.value) + Nextmap_OnChange(); + else + CV_AddValue(&cv_nextmap, 1); itemOn = tastart; // "Start" is selected. - G_SetGamestate(GS_TIMEATTACK); S_ChangeMusicInternal("racent", true); } @@ -6689,8 +6698,11 @@ static INT32 M_FindFirstMap(INT32 gtype) for (i = 0; i < NUMMAPS; i++) { - if (mapheaderinfo[i] && (mapheaderinfo[i]->typeoflevel & gtype)) - return i + 1; + if (!mapheaderinfo[i]) + continue; + if (!(mapheaderinfo[i]->typeoflevel & gtype)) + continue; + return i + 1; } return 1; @@ -6722,6 +6734,9 @@ static void M_StartServer(INT32 choice) if (metalrecording) G_StopMetalDemo(); + if (!cv_nextmap.value) + CV_SetValue(&cv_nextmap, G_RandMap(G_TOLFlag(cv_newgametype.value), -1, false, false, 0, false)); + if (ssplayers < 1) { D_MapChange(cv_nextmap.value, cv_newgametype.value, (boolean)cv_kartencore.value, 1, 1, false, false); @@ -6749,16 +6764,18 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade) lumpnum_t lumpnum; patch_t *PictureOfLevel; INT32 x, y, w, i, oldval, trans, dupadjust = ((vid.width/vid.dupx) - BASEVIDWIDTH)>>1; - const char *mapname = G_BuildMapName(cv_nextmap.value); - //boolean doencore = (cv_kartencore.value && cv_newgametype.value == GT_RACE); // A 160x100 image of the level as entry MAPxxP - lumpnum = W_CheckNumForName(va("%sP", mapname)); - - if (lumpnum != LUMPERROR) - PictureOfLevel = W_CachePatchNum(lumpnum, PU_CACHE); + if (cv_nextmap.value) + { + lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(cv_nextmap.value))); + if (lumpnum != LUMPERROR) + PictureOfLevel = W_CachePatchNum(lumpnum, PU_CACHE); + else + PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE); + } else - PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE); + PictureOfLevel = W_CachePatchName("RANDOMLV", PU_CACHE); w = SHORT(PictureOfLevel->width)/2; i = SHORT(PictureOfLevel->height)/2; @@ -6803,7 +6820,7 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade) do { i--; - if (i == -1) + if (i == -2) i = NUMMAPS-1; if (i == oldval) @@ -6815,13 +6832,16 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade) } while (!M_CanShowLevelInList(i, cv_newgametype.value)); // A 160x100 image of the level as entry MAPxxP - mapname = G_BuildMapName(i+1); - lumpnum = W_CheckNumForName(va("%sP", mapname)); - - if (lumpnum != LUMPERROR) - PictureOfLevel = W_CachePatchNum(lumpnum, PU_CACHE); + if (i+1) + { + lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(i+1))); + if (lumpnum != LUMPERROR) + PictureOfLevel = W_CachePatchNum(lumpnum, PU_CACHE); + else + PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE); + } else - PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE); + PictureOfLevel = W_CachePatchName("RANDOMLV", PU_CACHE); x -= horizspac + w/2; @@ -6839,7 +6859,7 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade) { i++; if (i == NUMMAPS) - i = 0; + i = -1; if (i == oldval) return; @@ -6850,13 +6870,16 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade) } while (!M_CanShowLevelInList(i, cv_newgametype.value)); // A 160x100 image of the level as entry MAPxxP - mapname = G_BuildMapName(i+1); - lumpnum = W_CheckNumForName(va("%sP", mapname)); - - if (lumpnum != LUMPERROR) - PictureOfLevel = W_CachePatchNum(lumpnum, PU_CACHE); + if (i+1) + { + lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(i+1))); + if (lumpnum != LUMPERROR) + PictureOfLevel = W_CachePatchNum(lumpnum, PU_CACHE); + else + PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE); + } else - PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE); + PictureOfLevel = W_CachePatchName("RANDOMLV", PU_CACHE); V_DrawTinyScaledPatch(x, y, trans, PictureOfLevel); From 1d894f36c35b2b78508689389a4a163f9c36cfaf Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 15 Aug 2018 16:56:26 +0100 Subject: [PATCH 12/27] Correct minor issue with random map name selection. --- src/g_game.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 6f5c5e69..15c9bab2 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -773,10 +773,10 @@ const char *G_BuildMapName(INT32 map) if (gamestate == GS_TITLESCREEN) map = -1; else if (gamestate == GS_LEVEL) - map = gamemap; + map = gamemap-1; else map = prevmap; - map = G_RandMap(G_TOLFlag(cv_newgametype.value), map, false, false, 0, false); + map = G_RandMap(G_TOLFlag(cv_newgametype.value), map, false, false, 0, false)+1; } if (map < 100) From 77ba3e3c2d40c6dd06592de259daee5d37bd1a82 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 15 Aug 2018 16:59:28 +0100 Subject: [PATCH 13/27] Additional oversight corrected. --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 83e28594..82e6ac2f 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6737,7 +6737,7 @@ static void M_StartServer(INT32 choice) G_StopMetalDemo(); if (!cv_nextmap.value) - CV_SetValue(&cv_nextmap, G_RandMap(G_TOLFlag(cv_newgametype.value), -1, false, false, 0, false)); + CV_SetValue(&cv_nextmap, G_RandMap(G_TOLFlag(cv_newgametype.value), -1, false, false, 0, false)+1); if (ssplayers < 1) { From acba635c902de1663c68bfb00fa741de5a1d47ea Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 16 Aug 2018 15:29:34 +0100 Subject: [PATCH 14/27] Realised I'd forgotten to stop the item explosion from being encoremapped. --- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 66b6bb4b..1652fb88 100644 --- a/src/info.c +++ b/src/info.c @@ -13303,7 +13303,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY|MF_SLIDEME, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, From cdf5874ff5fcb7bd731a3511dd6ac2f06a8ab930 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 26 Aug 2018 15:15:03 +0100 Subject: [PATCH 15/27] * Exempt drop shadows from encore remapping. * Make MT_GHOST's encoremapping depend on whether the source was encoremapped. * Revamp how sector typegroup 2, type 15 inverts the encoremapping (so planes don't get awkwardly desynchronised). --- src/info.c | 4 ++-- src/p_user.c | 3 +++ src/r_bsp.c | 11 +++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/info.c b/src/info.c index 1652fb88..464c4166 100644 --- a/src/info.c +++ b/src/info.c @@ -13114,7 +13114,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 1000, // mass 8, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -16599,7 +16599,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, diff --git a/src/p_user.c b/src/p_user.c index a4d624c1..ba7cb80b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1599,6 +1599,9 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj) if (mobj->flags2 & MF2_OBJECTFLIP) ghost->flags |= MF2_OBJECTFLIP; + if (!(mobj->flags & MF_DONTENCOREMAP)) + mobj->flags &= ~MF_DONTENCOREMAP; + return ghost; } diff --git a/src/r_bsp.c b/src/r_bsp.c index 981d0b56..34b082ca 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -39,7 +39,7 @@ INT32 doorclosed; static boolean R_NoEncore(sector_t *sector, boolean ceiling) { - boolean invertencore = (GETSECSPECIAL(sector->special, 2) != 15); + boolean invertencore = (GETSECSPECIAL(sector->special, 2) == 15); #if 0 // perfect implementation INT32 val = GETSECSPECIAL(sector->special, 3); if (val != 1 && val != 3 // spring panel @@ -47,11 +47,14 @@ static boolean R_NoEncore(sector_t *sector, boolean ceiling) if ((!(sector->special & (1<<8)) || (sector->special & ((4|8)<<8))) // spring panel #endif && GETSECSPECIAL(sector->special, 4) != 6) // sneaker panel - return !invertencore; + return invertencore; + + if (invertencore) + return false; if (ceiling) - return ((boolean)(sector->flags & SF_FLIPSPECIAL_CEILING) == invertencore); - return ((boolean)(sector->flags & SF_FLIPSPECIAL_FLOOR) == invertencore); + return ((boolean)(sector->flags & SF_FLIPSPECIAL_CEILING)); + return ((boolean)(sector->flags & SF_FLIPSPECIAL_FLOOR)); } // From 10380284685aea47bb4a99992d0e95a9ac947eac Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 26 Aug 2018 16:23:50 +0100 Subject: [PATCH 16/27] Real time reordering of intermission rankings as rank counts up! Also features jittering of the intermission elements because I thought it'd be fun, plus some better handling of players leaving (and then new ones joining) mid-intermission. --- src/y_inter.c | 64 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 43bbf6bf..562457e1 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -89,8 +89,9 @@ typedef union INT32 numplayers; // Number of players being displayed char levelstring[64]; // holds levelnames up to 64 characters // SRB2kart - UINT8 increase[MAXPLAYERS]; //how much did the score increase by? - UINT32 val[MAXPLAYERS]; //Gametype-specific value + UINT8 increase[MAXPLAYERS]; // how much did the score increase by? + UINT8 jitter[MAXPLAYERS]; // wiggle + UINT32 val[MAXPLAYERS]; // Gametype-specific value UINT8 pos[MAXPLAYERS]; // player positions. used for ties boolean rankingsmode; // rankings mode boolean encore; // encore mode @@ -191,22 +192,28 @@ static void Y_CompareBattle(INT32 i) static void Y_CompareRank(INT32 i) { - if (!(data.match.val[data.match.numplayers] == UINT32_MAX || players[i].score > data.match.val[data.match.numplayers])) + UINT8 increase = ((data.match.increase[i] == UINT8_MAX) ? 0 : data.match.increase[i]); + if (!(data.match.val[data.match.numplayers] == UINT32_MAX || (players[i].score - increase) > data.match.val[data.match.numplayers])) return; - data.match.val[data.match.numplayers] = players[i].score; + data.match.val[data.match.numplayers] = (players[i].score - increase); data.match.num[data.match.numplayers] = i; } -static void Y_CalculateMatchData(boolean rankingsmode, void (*comparison)(INT32)) +static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32)) { INT32 i, j; boolean completed[MAXPLAYERS]; INT32 numplayersingame = 0; // Initialize variables - if ((data.match.rankingsmode = rankingsmode)) + if (rankingsmode > 1) + ; + else if ((data.match.rankingsmode = (boolean)rankingsmode)) + { sprintf(data.match.levelstring, "* Total Rankings *"); + data.match.encore = false; + } else { // set up the levelstring @@ -239,18 +246,24 @@ static void Y_CalculateMatchData(boolean rankingsmode, void (*comparison)(INT32) } data.match.levelstring[sizeof data.match.levelstring - 1] = '\0'; - } - data.match.encore = (!rankingsmode && encoremode); + data.match.encore = encoremode; + + memset(data.match.jitter, 0, sizeof (data.match.jitter)); + } for (i = 0; i < MAXPLAYERS; i++) { data.match.val[i] = UINT32_MAX; - if (!rankingsmode) - data.match.increase[i] = UINT8_MAX; if (!playeringame[i] || players[i].spectator) + { + data.match.increase[i] = UINT8_MAX; continue; + } + + if (!rankingsmode) + data.match.increase[i] = UINT8_MAX; numplayersingame++; } @@ -432,10 +445,16 @@ void Y_IntermissionDrawer(void) for (i = 0; i < data.match.numplayers; i++) { + boolean dojitter = data.match.jitter[data.match.num[i]]; + data.match.jitter[data.match.num[i]] = 0; + if (data.match.num[i] != MAXPLAYERS && playeringame[data.match.num[i]] && !players[data.match.num[i]].spectator) { char strtime[MAXPLAYERNAME+1]; + if (dojitter) + y--; + V_DrawCenteredString(x+6, y, 0, va("%d", data.match.pos[i])); if (data.match.color[i] == 0) @@ -470,11 +489,9 @@ void Y_IntermissionDrawer(void) V_DrawRightAlignedString(x+120, y, 0, strtime); else V_DrawRightAlignedString(x+120+BASEVIDWIDTH/2, y, 0, strtime); - - snprintf(strtime, sizeof strtime, "%d", data.match.val[i]-data.match.increase[data.match.num[i]]); } - else - snprintf(strtime, sizeof strtime, "%d", data.match.val[i]); + + snprintf(strtime, sizeof strtime, "%d", data.match.val[i]); if (data.match.numplayers > 8) V_DrawRightAlignedString(x+152, y, 0, strtime); @@ -512,12 +529,12 @@ void Y_IntermissionDrawer(void) } } } + + if (dojitter) + y++; } else - { - data.match.increase[data.match.num[i]] = 0; data.match.num[i] = MAXPLAYERS; // this should be the only field setting in this function - } y += 16; @@ -598,7 +615,7 @@ void Y_Ticker(void) else { if (!data.match.rankingsmode && (intertic >= sorttic + 8)) - Y_CalculateMatchData(true, Y_CompareRank); + Y_CalculateMatchData(1, Y_CompareRank); if (data.match.rankingsmode && intertic > sorttic+(2*TICRATE)) { @@ -612,14 +629,17 @@ void Y_Ticker(void) || data.match.increase[data.match.num[q]] == UINT8_MAX) continue; - data.match.increase[data.match.num[q]]--; r++; - if (data.match.increase[data.match.num[q]]) + data.match.jitter[data.match.num[q]] = 1; + if (--data.match.increase[data.match.num[q]]) kaching = false; } if (r) + { S_StartSound(NULL, (kaching ? sfx_chchng : sfx_ptally)); + Y_CalculateMatchData(2, Y_CompareRank); + } else endtic = intertic + 3*TICRATE; // 3 second pause after end of tally } @@ -762,7 +782,7 @@ void Y_StartIntermission(void) case int_match: { // Calculate who won - Y_CalculateMatchData(false, Y_CompareBattle); + Y_CalculateMatchData(0, Y_CompareBattle); if (cv_inttime.value > 0) S_ChangeMusicInternal("racent", true); // loop it break; @@ -785,7 +805,7 @@ void Y_StartIntermission(void) } // Calculate who won - Y_CalculateMatchData(false, Y_CompareRace); + Y_CalculateMatchData(0, Y_CompareRace); break; } From fc6b0b23ec4c9ae0f9c6462db3baeccf5a9409c1 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 26 Aug 2018 17:31:04 +0100 Subject: [PATCH 17/27] Increase the amount of time between the switch to the Rankings half of intermission and ranking is calculated a tad. Turns out it wasn't taking the length of the level-to-rankings switch animation into account! --- src/y_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/y_inter.c b/src/y_inter.c index 562457e1..636b2d23 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -617,7 +617,7 @@ void Y_Ticker(void) if (!data.match.rankingsmode && (intertic >= sorttic + 8)) Y_CalculateMatchData(1, Y_CompareRank); - if (data.match.rankingsmode && intertic > sorttic+(2*TICRATE)) + if (data.match.rankingsmode && intertic > sorttic+16+(2*TICRATE)) { INT32 q=0,r=0; boolean kaching = true; From 22be81ef021531a79cbf5e380c1f6dba050a3df8 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 29 Aug 2018 21:37:47 +0100 Subject: [PATCH 18/27] * Prettier record attack screen! * Uses the in-game timer element to draw its times. * This includes showing them time emblems-to-get! * good night sweet prince * Make the emblem time use the same ' and " as the normal time. --- src/k_kart.c | 97 ++++++++++++++++++++++++++++++---------------------- src/k_kart.h | 1 + src/m_menu.c | 21 ++++++++++-- 3 files changed, 77 insertions(+), 42 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 615b8970..b4c1e6ca 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5160,78 +5160,90 @@ static void K_drawKartItem(void) V_DrawScaledPatch(ITEM_X+17, ITEM_Y+13, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]); } -static void K_drawKartTimestamp(void) +void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, boolean playing) { // TIME_X = BASEVIDWIDTH-124; // 196 // TIME_Y = 6; // 6 - INT32 TIME_XB, splitflags = V_HUDTRANS|K_calcSplitFlags(V_SNAPTOTOP|V_SNAPTORIGHT); - tic_t drawtime = stplyr->realtime; + tic_t worktime; - if (cv_timelimit.value && timelimitintics > 0) + INT32 splitflags = 0; + if (playing) { - if (drawtime >= timelimitintics) - drawtime = 0; - else - drawtime = timelimitintics - drawtime; + splitflags = V_HUDTRANS|K_calcSplitFlags(V_SNAPTOTOP|V_SNAPTORIGHT); + if (cv_timelimit.value && timelimitintics > 0) + { + if (drawtime >= timelimitintics) + drawtime = 0; + else + drawtime = timelimitintics - drawtime; + } } - V_DrawScaledPatch(TIME_X, TIME_Y, splitflags, kp_timestickerwide); + V_DrawScaledPatch(TX, TY, splitflags, kp_timestickerwide); - TIME_XB = TIME_X+33; + TX += 33; - if (drawtime/(60*TICRATE) < 100) // 99:99:99 only + worktime = drawtime/(60*TICRATE); + + if (!playing && !drawtime) + V_DrawKartString(TX, TY+3, splitflags, va("--'--\"--")); + else if (worktime < 100) // 99:99:99 only { // zero minute - if (drawtime/(60*TICRATE) < 10) + if (worktime < 10) { - V_DrawKartString(TIME_XB, TIME_Y+3, splitflags, va("0")); + V_DrawKartString(TX, TY+3, splitflags, va("0")); // minutes time 0 __ __ - V_DrawKartString(TIME_XB+12, TIME_Y+3, splitflags, va("%d", drawtime/(60*TICRATE))); + V_DrawKartString(TX+12, TY+3, splitflags, va("%d", worktime)); } // minutes time 0 __ __ else - V_DrawKartString(TIME_XB, TIME_Y+3, splitflags, va("%d", drawtime/(60*TICRATE))); + V_DrawKartString(TX, TY+3, splitflags, va("%d", worktime)); // apostrophe location _'__ __ - V_DrawKartString(TIME_XB+24, TIME_Y+3, splitflags, va("'")); + V_DrawKartString(TX+24, TY+3, splitflags, va("'")); + + worktime = (drawtime/TICRATE % 60); // zero second _ 0_ __ - if ((drawtime/TICRATE % 60) < 10) + if (worktime < 10) { - V_DrawKartString(TIME_XB+36, TIME_Y+3, splitflags, va("0")); + V_DrawKartString(TX+36, TY+3, splitflags, va("0")); // seconds time _ _0 __ - V_DrawKartString(TIME_XB+48, TIME_Y+3, splitflags, va("%d", drawtime/TICRATE % 60)); + V_DrawKartString(TX+48, TY+3, splitflags, va("%d", worktime)); } // zero second _ 00 __ else - V_DrawKartString(TIME_XB+36, TIME_Y+3, splitflags, va("%d", drawtime/TICRATE % 60)); + V_DrawKartString(TX+36, TY+3, splitflags, va("%d", worktime)); // quotation mark location _ __"__ - V_DrawKartString(TIME_XB+60, TIME_Y+3, splitflags, va("\"")); + V_DrawKartString(TX+60, TY+3, splitflags, va("\"")); + + worktime = G_TicsToCentiseconds(drawtime); // zero tick _ __ 0_ - if (G_TicsToCentiseconds(drawtime) < 10) + if (worktime < 10) { - V_DrawKartString(TIME_XB+72, TIME_Y+3, splitflags, va("0")); + V_DrawKartString(TX+72, TY+3, splitflags, va("0")); // tics _ __ _0 - V_DrawKartString(TIME_XB+84, TIME_Y+3, splitflags, va("%d", G_TicsToCentiseconds(drawtime))); + V_DrawKartString(TX+84, TY+3, splitflags, va("%d", worktime)); } // zero tick _ __ 00 - if (G_TicsToCentiseconds(drawtime) >= 10) - V_DrawKartString(TIME_XB+72, TIME_Y+3, splitflags, va("%d", G_TicsToCentiseconds(drawtime))); + else + V_DrawKartString(TX+72, TY+3, splitflags, va("%d", worktime)); } else if ((drawtime/TICRATE) & 1) - V_DrawKartString(TIME_XB, TIME_Y+3, splitflags, va("99'59\"99")); + V_DrawKartString(TX, TY+3, splitflags, va("99'59\"99")); - if (modeattacking) // emblem time! + if (emblemmap && (modeattacking || !playing)) // emblem time! { - INT32 workx = TIME_XB + 96, worky = TIME_Y+18; + INT32 workx = TX + 96, worky = TY+18; SINT8 curemb = 0; patch_t *emblempic[3] = {NULL, NULL, NULL}; UINT8 *emblemcol[3] = {NULL, NULL, NULL}; - emblem_t *emblem = M_GetLevelEmblems(gamemap); + emblem_t *emblem = M_GetLevelEmblems(emblemmap); while (emblem) { char targettext[9]; @@ -5252,22 +5264,25 @@ static void K_drawKartTimestamp(void) goto bademblem; } - snprintf(targettext, 9, "%i:%02i.%02i", + snprintf(targettext, 9, "%i'%02i\"%02i", G_TicsToMinutes(timetoreach, false), G_TicsToSeconds(timetoreach), G_TicsToCentiseconds(timetoreach)); - if (stplyr->realtime > timetoreach) + if (playing) { - splitflags = (splitflags &~ V_HUDTRANS)|V_HUDTRANSHALF; - if (canplaysound) + if (stplyr->realtime > timetoreach) { - S_StartSound(NULL, sfx_s3k72); //sfx_s26d); -- you STOLE fizzy lifting drinks - canplaysound = false; + splitflags = (splitflags &~ V_HUDTRANS)|V_HUDTRANSHALF; + if (canplaysound) + { + S_StartSound(NULL, sfx_s3k72); //sfx_s26d); -- you STOLE fizzy lifting drinks + canplaysound = false; + } } + else if (!canplaysound) + canplaysound = true; } - else if (!canplaysound) - canplaysound = true; targettext[8] = 0; } @@ -5277,7 +5292,7 @@ static void K_drawKartTimestamp(void) } V_DrawRightAlignedString(workx, worky, splitflags, targettext); - workx -= 69; // i SWEAR i wasn't aiming for this + workx -= 72; //69; -- good night sweet prince V_DrawSmallScaledPatch(workx + 4, worky, splitflags, W_CachePatchName("NEEDIT", PU_CACHE)); break; @@ -5286,6 +5301,8 @@ static void K_drawKartTimestamp(void) emblem = M_GetLevelEmblems(-1); } + if (playing) + splitflags = (splitflags &~ V_HUDTRANSHALF)|V_HUDTRANS; while (curemb--) { workx -= 16; @@ -6469,7 +6486,7 @@ void K_drawKartHUD(void) if (!splitscreen) { // Draw the timestamp - K_drawKartTimestamp(); + K_drawKartTimestamp(stplyr->realtime, TIME_X, TIME_Y, gamemap, true); if (!modeattacking) { diff --git a/src/k_kart.h b/src/k_kart.h index 89f1ea7e..7c7d66fc 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -61,6 +61,7 @@ void K_LoadKartHUDGraphics(void); fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my); void K_drawKartHUD(void); void K_drawKartFreePlay(UINT32 flashtime); +void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, boolean playing); void K_LoadIconGraphics(char *facestr, INT32 skinnum); void K_ReloadSkinIconGraphics(void); diff --git a/src/m_menu.c b/src/m_menu.c index 82e6ac2f..3bdcc964 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -5705,7 +5705,6 @@ void M_DrawTimeAttackMenu(void) INT32 i, x, y, cursory = 0; UINT16 dispstatus; patch_t *PictureOfUrFace; - char beststr[40]; //S_ChangeMusicInternal("racent", true); // Eww, but needed for when user hits escape during demo playback @@ -5786,6 +5785,24 @@ void M_DrawTimeAttackMenu(void) // Level record list if (cv_nextmap.value) { + INT32 dupadjust = (vid.width/vid.dupx); + tic_t lap = 0, time = 0; + if (mainrecords[cv_nextmap.value-1]) + { + lap = mainrecords[cv_nextmap.value-1]->lap; + time = mainrecords[cv_nextmap.value-1]->time; + } + + V_DrawFill((BASEVIDWIDTH - dupadjust)>>1, 78, dupadjust, 36, 239); + + V_DrawRightAlignedString(149, 80, highlightflags, "BEST LAP:"); + K_drawKartTimestamp(lap, 19, 86, 0, false); + + V_DrawRightAlignedString(292, 80, highlightflags, "BEST TIME:"); + K_drawKartTimestamp(time, 162, 86, cv_nextmap.value, false); + } + /*{ + char beststr[40]; emblem_t *em; if (!mainrecords[cv_nextmap.value-1] || !mainrecords[cv_nextmap.value-1]->time) @@ -5828,7 +5845,7 @@ void M_DrawTimeAttackMenu(void) skipThisOne: em = M_GetLevelEmblems(-1); } - } + }*/ // ALWAYS DRAW player name, level name, skin and color even when not on this menu! if (currentMenu != &SP_TimeAttackDef) From 7c7a7bf849594fff67e8fce36ff25174a4a9f140 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 29 Aug 2018 22:02:42 +0100 Subject: [PATCH 19/27] disable encore ruby/flip on record attack menu with kartencore on --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 3bdcc964..8e83f3a6 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6808,7 +6808,7 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade) V_DrawFill(x-1, y-1, w+2, i+2, trans); // variable reuse... - if (!cv_kartencore.value || cv_newgametype.value != GT_RACE) + if (!cv_kartencore.value || gamestate == GS_TIMEATTACK || cv_newgametype.value != GT_RACE) V_DrawSmallScaledPatch(x, y, 0, PictureOfLevel); else { From bd7e0e75f036860ea63166105a9159680ebe9f56 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 30 Aug 2018 13:13:25 +0100 Subject: [PATCH 20/27] Overlays and rings now properly handle encore-ness, in that they are sans encore (most of the time). ... :V --- src/info.c | 4 ++-- src/p_mobj.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/info.c b/src/info.c index 464c4166..0e6d5abd 100644 --- a/src/info.c +++ b/src/info.c @@ -5054,7 +5054,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags + MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -13141,7 +13141,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 1000, // mass 8, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_SCENERY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, diff --git a/src/p_mobj.c b/src/p_mobj.c index 102f99d4..129ea333 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6212,6 +6212,9 @@ void P_RunOverlays(void) mo->scale = mo->destscale = mo->target->scale; mo->angle = mo->target->angle; + if ((mo->flags & MF_DONTENCOREMAP) != (mo->target->flags & MF_DONTENCOREMAP)) + mo->flags ^= MF_DONTENCOREMAP; + if (!(mo->state->frame & FF_ANIMATE)) zoffs = FixedMul(((signed)mo->state->var2)*FRACUNIT, mo->scale); // if you're using FF_ANIMATE on an overlay, From a7bb16ada9dc2ec4832f3d3434739c3c6f2a7f93 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 31 Aug 2018 12:37:15 +0100 Subject: [PATCH 21/27] Improve intermission drawer further. * Change `MM:SS.MS` to `MM'SS"MS' to match all other recorded instances of time in-game. * Add a full stop to NO CONTEST to scrounge up an extra four pixels to match the increased width of above. * Make it such that the number of players per column will never be desynced with future code changes by tying it to a local #define. * Other minor code improvements. --- src/y_inter.c | 41 ++++++++++++----------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 636b2d23..77cea21f 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -413,7 +413,8 @@ void Y_IntermissionDrawer(void) } else*/ if (intertype == int_race || intertype == int_match) { - INT32 y = 48; +#define NUMFORNEWCOLUMN 8 + INT32 y = 48, gutter = ((data.match.numplayers > NUMFORNEWCOLUMN) ? 0 : (BASEVIDWIDTH/2)); const char *timeheader; if (data.match.rankingsmode) @@ -428,7 +429,7 @@ void Y_IntermissionDrawer(void) if (data.match.encore) V_DrawCenteredString(-4 + x + BASEVIDWIDTH/2, 20-8, hilicol, "ENCORE MODE"); - if (data.match.numplayers > 8) + if (!gutter) { V_DrawFill(x+156, 32, 1, 152, 0); @@ -465,7 +466,7 @@ void Y_IntermissionDrawer(void) V_DrawSmallMappedPatch(x+16, y-4, 0,faceprefix[*data.match.character[i]], colormap); } - if (data.match.numplayers > 8) + if (!gutter) strlcpy(strtime, data.match.name[i], 6); else STRBUFCPY(strtime, data.match.name[i]); @@ -485,48 +486,29 @@ void Y_IntermissionDrawer(void) else snprintf(strtime, sizeof strtime, "(+ %d)", data.match.increase[data.match.num[i]]); - if (data.match.numplayers > 8) - V_DrawRightAlignedString(x+120, y, 0, strtime); - else - V_DrawRightAlignedString(x+120+BASEVIDWIDTH/2, y, 0, strtime); + V_DrawRightAlignedString(x+120+gutter, y, 0, strtime); } snprintf(strtime, sizeof strtime, "%d", data.match.val[i]); - if (data.match.numplayers > 8) - V_DrawRightAlignedString(x+152, y, 0, strtime); - else - V_DrawRightAlignedString(x+152+BASEVIDWIDTH/2, y, 0, strtime); + V_DrawRightAlignedString(x+152+gutter, y, 0, strtime); } else { if (data.match.val[i] == (UINT32_MAX-1)) - { - if (data.match.numplayers > 8) - V_DrawRightAlignedThinString(x+152, y-1, 0, "NO CONTEST"); - else - V_DrawRightAlignedThinString(x+152+BASEVIDWIDTH/2, y-1, 0, "NO CONTEST"); - } + V_DrawRightAlignedThinString(x+152+gutter, y-1, 0, "NO CONTEST."); else { if (intertype == int_race) { - snprintf(strtime, sizeof strtime, "%i:%02i.%02i", G_TicsToMinutes(data.match.val[i], true), + snprintf(strtime, sizeof strtime, "%i'%02i\"%02i", G_TicsToMinutes(data.match.val[i], true), G_TicsToSeconds(data.match.val[i]), G_TicsToCentiseconds(data.match.val[i])); strtime[sizeof strtime - 1] = '\0'; - if (data.match.numplayers > 8) - V_DrawRightAlignedString(x+152, y, 0, strtime); - else - V_DrawRightAlignedString(x+152+BASEVIDWIDTH/2, y, 0, strtime); + V_DrawRightAlignedString(x+152+gutter, y, 0, strtime); } else - { - if (data.match.numplayers > 8) - V_DrawRightAlignedString(x+152, y, 0, va("%i", data.match.val[i])); - else - V_DrawRightAlignedString(x+152+BASEVIDWIDTH/2, y, 0, va("%i", data.match.val[i])); - } + V_DrawRightAlignedString(x+152+gutter, y, 0, va("%i", data.match.val[i])); } } @@ -538,11 +520,12 @@ void Y_IntermissionDrawer(void) y += 16; - if (i == 7) + if (i == NUMFORNEWCOLUMN-1) { y = 48; x += BASEVIDWIDTH/2; } +#undef NUMFORNEWCOLUMN } } From e01f2ff096275d9203ad70fdd2a83d20cfcabe4d Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 31 Aug 2018 22:38:56 +0100 Subject: [PATCH 22/27] Update arrow rendering to use simple character function rather than overkill string function. --- src/m_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 8e83f3a6..1c4e9015 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -5519,7 +5519,7 @@ static void M_DrawStatsMaps(int location) boolean dotopname = true, dobottomarrow = (location < statsMax); if (location) - V_DrawString(10, y-(skullAnimCounter/5), highlightflags, "\x1A"); + V_DrawCharacter(10, y-(skullAnimCounter/5), '\x1A' | highlightflags, false); while (statsMapList[++i] != -1) { @@ -5601,7 +5601,7 @@ static void M_DrawStatsMaps(int location) } bottomarrow: if (dobottomarrow) - V_DrawString(10, y-8 + (skullAnimCounter/5), highlightflags, "\x1B"); + V_DrawCharacter(10, y-8 + (skullAnimCounter/5), '\x1B' | highlightflags, false); } static void M_DrawLevelStats(void) From fd7bc1c1ac59ca233e2ccdfa3e38b2ec50ace044 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 11 Sep 2018 15:41:41 +0100 Subject: [PATCH 23/27] Do a bunch of major modifications to the voting system's rule change system! * Add `kartvoterulechanges`, or "Voting Rule Changes" on the menu, to allow some user control over event frequency. * "Never" - does what it says on the tin. * "Sometimes" - 1/8 chance of Encore if host has unlocked it, only gametype change when buffer is full * "Frequent" - 1/2 chance of Encore if host has unlocked it, gametype change every 5 maps * "Always" - If host has unlocked Encore, alternates between Encore and Gametype. Otherwise, always a gametype change * There's probably room for a setting between "Sometimes" and "Frequent", but I didn't want to overload the host with options and these were the ones that made sense. * Better handling of buffer refreshes, to prevent two of the same map appearing next to each other in the voting unless there literally aren't that many maps. * Mostly unrelated: Minor bugfix for Y_SetupVoteFinish, preventing music changes/random sounds playing on the You Will Join Next Race screen. (Branch-appropriate, at least.) --- src/d_netcmd.c | 2 ++ src/d_netcmd.h | 1 + src/g_game.c | 78 +++++++++++++++++++++++++++++++++++++++++++------- src/k_kart.c | 1 + src/m_menu.c | 11 +++---- src/y_inter.c | 17 +++++------ 6 files changed, 85 insertions(+), 25 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 28d33be9..cb2ed49d 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -353,6 +353,8 @@ consvar_t cv_kartbumpers = {"kartbumpers", "3", CV_NETVAR|CV_CHEAT, kartbumpers_ consvar_t cv_kartfrantic = {"kartfrantic", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartFrantic_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartcomeback = {"kartcomeback", "On", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartComeback_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartencore = {"kartencore", "Off", CV_NETVAR|CV_CALL|CV_NOINIT, CV_OnOff, KartEncore_OnChange, 0, NULL, NULL, 0, 0, NULL}; +static CV_PossibleValue_t kartvoterulechanges_cons_t[] = {{0, "Never"}, {1, "Sometimes"}, {2, "Frequent"}, {3, "Always"}, {0, NULL}}; +consvar_t cv_kartvoterulechanges = {"kartvoterulechanges", "Frequent", CV_NETVAR, kartvoterulechanges_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartspeedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {0, NULL}}; consvar_t cv_kartspeedometer = {"kartdisplayspeed", "Off", CV_SAVE, kartspeedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display static CV_PossibleValue_t kartvoices_cons_t[] = {{0, "Never"}, {1, "Tasteful"}, {2, "Meme"}, {0, NULL}}; diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 5238c44e..5814f2ae 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -125,6 +125,7 @@ extern consvar_t cv_kartbumpers; extern consvar_t cv_kartfrantic; extern consvar_t cv_kartcomeback; extern consvar_t cv_kartencore; +extern consvar_t cv_kartvoterulechanges; extern consvar_t cv_kartspeedometer; extern consvar_t cv_kartvoices; diff --git a/src/g_game.c b/src/g_game.c index 15c9bab2..00a2828d 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3113,14 +3113,48 @@ boolean G_BattleGametype(void) // INT16 G_SometimesGetDifferentGametype(void) { - if (randmapbuffer[NUMMAPS] != -1) + boolean encorepossible = (M_SecretUnlocked(SECRET_ENCORE) && G_RaceGametype()); + + if (!cv_kartvoterulechanges.value) // never + return gametype; + + if (randmapbuffer[NUMMAPS] > 0 && (encorepossible || cv_kartvoterulechanges.value != 3)) { - if (M_SecretUnlocked(SECRET_ENCORE) && (M_RandomChance(FRACUNIT/2/*56*/) != cv_kartencore.value) && G_RaceGametype()) - return (gametype|0x80); + if (cv_kartvoterulechanges.value != 1) + randmapbuffer[NUMMAPS]--; + if (encorepossible) + { + switch (cv_kartvoterulechanges.value) + { + case 3: // always + randmapbuffer[NUMMAPS] = 0; // gotta prep this in case it isn't already set + break; + case 2: // frequent + encorepossible = M_RandomChance(FRACUNIT>>1); + break; + case 1: // sometimes + default: + encorepossible = M_RandomChance(FRACUNIT>>3); + break; + } + if (encorepossible != cv_kartencore.value) + return (gametype|0x80); + } return gametype; } - randmapbuffer[NUMMAPS] = gametype; + switch (cv_kartvoterulechanges.value) // okay, we're having a gametype change! when's the next one, luv? + { + case 3: // always + randmapbuffer[NUMMAPS] = 1; // every other vote (or always if !encorepossible) + break; + case 1: // sometimes + default: + // fallthrough - happens when clearing buffer, but needs a reasonable countdown if cvar is modified + case 2: // frequent + randmapbuffer[NUMMAPS] = 5; // per "cup" + break; + } if (gametype == GT_MATCH) return GT_RACE; @@ -3188,6 +3222,7 @@ INT16 G_TOLFlag(INT32 pgametype) return INT16_MAX; } +#ifdef FLUSHMAPBUFFEREARLY static INT32 TOLMaps(INT16 tolflags) { INT32 num = 0; @@ -3205,6 +3240,7 @@ static INT32 TOLMaps(INT16 tolflags) return num; } +#endif /** Select a random map with the given typeoflevel flags. * If no map has those flags, this arbitrarily gives you map 1. @@ -3223,6 +3259,8 @@ INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignoreb if (!okmaps) okmaps = Z_Malloc(NUMMAPS * sizeof(INT16), PU_STATIC, NULL); +tryagain: + // Find all the maps that are ok and and put them in an array. for (ix = 0; ix < NUMMAPS; ix++) { @@ -3256,12 +3294,28 @@ INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignoreb okmaps[numokmaps++] = ix; } - if (numokmaps == 0) + if (numokmaps == 0) // If there's no matches... (Goodbye, incredibly silly function chains :V) { if (!ignorebuffer) - return G_RandMap(tolflags, pprevmap, dontadd, true, maphell, callagainsoon); // If there's no matches, (An incredibly silly function chain, buuut... :V) - if (maphell) - return G_RandMap(tolflags, pprevmap, dontadd, true, maphell-1, callagainsoon); + { + if (randmapbuffer[3] == -1) // Is the buffer basically empty? + { + ignorebuffer = true; // This will probably only help in situations where there's very few maps, but it's folly not to at least try it + goto tryagain; //return G_RandMap(tolflags, pprevmap, dontadd, true, maphell, callagainsoon); + } + + for (bufx = 3; bufx < NUMMAPS; bufx++) // Let's clear all but the three most recent maps... + randmapbuffer[bufx] = -1; + if (cv_kartvoterulechanges.value == 1) // sometimes + randmapbuffer[NUMMAPS] = 0; + goto tryagain; //return G_RandMap(tolflags, pprevmap, dontadd, ignorebuffer, maphell, callagainsoon); + } + + if (maphell) // Any wiggle room to loosen our restrictions here? + { + maphell--; + goto tryagain; //return G_RandMap(tolflags, pprevmap, dontadd, true, maphell-1, callagainsoon); + } ix = 0; // Sorry, none match. You get MAP01. for (bufx = 0; bufx < NUMMAPS+1; bufx++) @@ -3423,11 +3477,15 @@ static void G_DoCompleted(void) automapactive = false; - if (randmapbuffer[TOLMaps(G_TOLFlag(gametype))-4] != -1) // we're getting pretty full, so lets clear it +#ifdef FLUSHMAPBUFFEREARLY + if (randmapbuffer[TOLMaps(G_TOLFlag(gametype))-5] != -1) // We're getting pretty full, so! -- no need for this, handled in G_RandMap { - for (i = 0; i < NUMMAPS+1; i++) + for (i = 3; i < NUMMAPS; i++) // Let's clear all but the three most recent maps... randmapbuffer[i] = -1; + if (cv_kartvoterulechanges.value == 1) // sometimes + randmapbuffer[NUMMAPS] = 0; } +#endif if (gametype != GT_COOP) { diff --git a/src/k_kart.c b/src/k_kart.c index b4c1e6ca..ae09c3ba 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -402,6 +402,7 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_kartfrantic); CV_RegisterVar(&cv_kartcomeback); CV_RegisterVar(&cv_kartencore); + CV_RegisterVar(&cv_kartvoterulechanges); CV_RegisterVar(&cv_kartspeedometer); CV_RegisterVar(&cv_kartvoices); CV_RegisterVar(&cv_karteliminatelast); diff --git a/src/m_menu.c b/src/m_menu.c index 1c4e9015..536edd20 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1474,14 +1474,15 @@ static menuitem_t OP_ServerOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 40}, {IT_STRING | IT_CVAR, NULL, "Map Progression", &cv_advancemap, 50}, {IT_STRING | IT_CVAR, NULL, "Voting Timer", &cv_votetime, 60}, + {IT_STRING | IT_CVAR, NULL, "Voting Rule Changes", &cv_kartvoterulechanges, 70}, #ifndef NONET - {IT_STRING | IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 80}, - {IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 90}, - //{IT_STRING | IT_CVAR, NULL, "Join on Map Change", &cv_joinnextround, 100}, + {IT_STRING | IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 90}, + {IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 100}, + //{IT_STRING | IT_CVAR, NULL, "Join on Map Change", &cv_joinnextround, 110}, - {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 100}, - {IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 110}, + {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 110}, + {IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 120}, #endif }; diff --git a/src/y_inter.c b/src/y_inter.c index 77cea21f..f5e1ba6e 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1548,13 +1548,13 @@ static void Y_UnloadVoteData(void) // void Y_SetupVoteFinish(SINT8 pick, SINT8 level) { + if (!voteclient.loaded) + return; + if (pick == -1) // No other votes? We gotta get out of here, then! { - if (voteclient.loaded) - { - Y_EndVote(); - Y_FollowIntermission(); - } + Y_EndVote(); + Y_FollowIntermission(); return; } @@ -1600,11 +1600,8 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level) } else if (endtype == 0) // Might as well put this here, too. { - if (voteclient.loaded) - { - Y_EndVote(); - Y_FollowIntermission(); - } + Y_EndVote(); + Y_FollowIntermission(); return; } else From 25ae5a5e7f1708fabdabd335f7cd458ca9b11e67 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 21 Sep 2018 12:12:17 +0100 Subject: [PATCH 24/27] Partially address Sal's review last night by switching to a more sensible default. I'm still unconvinced on the need to make encore mode a seperate knob on the grounds of overcomplexity and "you can't turn map hell off", but hopefully this'll be a shippable state we can come back to later. Also, thank you for reminding me, Sryder - disable my very, very limited progress on encore mode in openGL so that stages aren't an unintended hodgepodge of different colourschemes for the objects versus the level environment. --- src/d_netcmd.c | 2 +- src/hardware/hw_main.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index cb2ed49d..5f5e7e30 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -354,7 +354,7 @@ consvar_t cv_kartfrantic = {"kartfrantic", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_ consvar_t cv_kartcomeback = {"kartcomeback", "On", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartComeback_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartencore = {"kartencore", "Off", CV_NETVAR|CV_CALL|CV_NOINIT, CV_OnOff, KartEncore_OnChange, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartvoterulechanges_cons_t[] = {{0, "Never"}, {1, "Sometimes"}, {2, "Frequent"}, {3, "Always"}, {0, NULL}}; -consvar_t cv_kartvoterulechanges = {"kartvoterulechanges", "Frequent", CV_NETVAR, kartvoterulechanges_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartvoterulechanges = {"kartvoterulechanges", "Sometimes", CV_NETVAR, kartvoterulechanges_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartspeedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {0, NULL}}; consvar_t cv_kartspeedometer = {"kartdisplayspeed", "Off", CV_SAVE, kartspeedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display static CV_PossibleValue_t kartvoices_cons_t[] = {{0, "Never"}, {1, "Tasteful"}, {2, "Meme"}, {0, NULL}}; diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 87de473e..4c206337 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5452,8 +5452,10 @@ static void HWR_ProjectSprite(mobj_t *thing) else { vis->colormap = colormaps; +#ifdef GLENCORE if (encoremap && (thing->flags & (MF_SCENERY|MF_NOTHINK))) vis->colormap += (256*32); +#endif } // set top/bottom coords @@ -5558,8 +5560,10 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing) vis->mobj = (mobj_t *)thing; vis->colormap = colormaps; +#ifdef GLENCORE if (encoremap) vis->colormap += (256*32); +#endif // set top/bottom coords vis->ty = FIXED_TO_FLOAT(thing->z + spritecachedinfo[lumpoff].topoffset); From 84c2a8c28f8d561225a57677d374f2dd6568433b Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 22 Sep 2018 11:59:07 +0100 Subject: [PATCH 25/27] Sign compare fix via boolean cast --- src/g_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index 79fb89f1..73d20bfd 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3175,7 +3175,7 @@ INT16 G_SometimesGetDifferentGametype(void) encorepossible = M_RandomChance(FRACUNIT>>3); break; } - if (encorepossible != cv_kartencore.value) + if (encorepossible != (boolean)cv_kartencore.value) return (gametype|0x80); } return gametype; From 4fd4deff8a524eb177bc3f0dcfe922daf0163d98 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 22 Sep 2018 12:43:54 +0100 Subject: [PATCH 26/27] One last thing - make the OpenGL level loading bar screen have the correct background colour. --- src/hardware/hw_bsp.c | 2 +- src/p_setup.c | 7 +++++-- src/p_setup.h | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_bsp.c b/src/hardware/hw_bsp.c index 17eb8761..38a6026f 100644 --- a/src/hardware/hw_bsp.c +++ b/src/hardware/hw_bsp.c @@ -646,7 +646,7 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b sprintf(s, "%d%%", (++ls_percent)<<1); x = BASEVIDWIDTH/2; y = BASEVIDHEIGHT/2; - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); // Black background to match fade in effect + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); // White background to match fade in effect //V_DrawPatchFill(W_CachePatchName("SRB2BACK",PU_CACHE)); // SRB2 background, ehhh too bright. M_DrawTextBox(x-58, y-8, 13, 1); V_DrawString(x-50, y, V_YELLOWMAP, "Loading..."); diff --git a/src/p_setup.c b/src/p_setup.c index a416f991..501c80d9 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -101,6 +101,7 @@ side_t *sides; mapthing_t *mapthings; INT32 numstarposts; boolean levelloading; +UINT8 levelfadecol; // BLOCKMAP // Created from axis aligned bounding box @@ -2691,12 +2692,14 @@ boolean P_SetupLevel(boolean skipprecip) if (leveltime < (starttime + (TICRATE/2))) S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); //S_StopMusic(); + levelfadecol = (encoremode && !ranspecialwipe ? 122 : 120); + // Let's fade to white here // But only if we didn't do the encore startup wipe if (rendermode != render_none && !ranspecialwipe) { F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (encoremode ? 122 : 120)); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); F_WipeEndScreen(); F_RunWipe(wipedefs[(encoremode ? wipe_level_final : wipe_level_toblack)], false); @@ -3040,7 +3043,7 @@ boolean P_SetupLevel(boolean skipprecip) // Remove the loading shit from the screen if (rendermode != render_none) - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (encoremode && !ranspecialwipe ? 122 : 120)); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); if (precache || dedicated) R_PrecacheLevel(); diff --git a/src/p_setup.h b/src/p_setup.h index 3bca1104..c3c206a5 100644 --- a/src/p_setup.h +++ b/src/p_setup.h @@ -27,6 +27,7 @@ extern mapthing_t *deathmatchstarts[MAX_DM_STARTS]; extern INT32 numdmstarts, numcoopstarts, numredctfstarts, numbluectfstarts; extern boolean levelloading; +extern UINT8 levelfadecol; extern lumpnum_t lastloadedmaplumpnum; // for comparative savegame // From f20710fbb470c5be2fc5764ca2921a4536d47ff7 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 22 Sep 2018 21:05:20 +0100 Subject: [PATCH 27/27] Turns out I actually forgot to push this when I did the GL fade colour thing earlier, woops. --- src/hardware/hw_bsp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hardware/hw_bsp.c b/src/hardware/hw_bsp.c index 38a6026f..e0e4abb4 100644 --- a/src/hardware/hw_bsp.c +++ b/src/hardware/hw_bsp.c @@ -29,6 +29,7 @@ #include "../m_argv.h" #include "../i_video.h" #include "../w_wad.h" +#include "../p_setup.h" // levelfadecol // -------------------------------------------------------------------------- // This is global data for planes rendering