From bf4c5e8069038623be4967de481a7907fb8fceb3 Mon Sep 17 00:00:00 2001 From: danij Date: Sat, 18 Jun 2011 17:27:48 +0100 Subject: [PATCH] Added cvar "inlude-patch-replacement" to control patch replacement in the intermission. Usage is analogous to "menu-patch-replacement" except scoped to patches drawn in the intermission. --- doomsday/plugins/common/src/hu_lib.c | 6 +- doomsday/plugins/common/src/hu_menu.c | 16 ++--- doomsday/plugins/common/src/hu_stuff.c | 17 +++-- doomsday/plugins/jdoom/data/conhelp.txt | 3 + doomsday/plugins/jdoom/include/d_config.h | 3 +- doomsday/plugins/jdoom/src/d_main.c | 5 +- doomsday/plugins/jdoom/src/st_stuff.c | 19 ++---- doomsday/plugins/jdoom/src/wi_stuff.c | 66 ++++++++++---------- doomsday/plugins/jdoom64/data/conhelp.txt | 3 + doomsday/plugins/jdoom64/include/d_config.h | 3 +- doomsday/plugins/jdoom64/src/d_main.c | 5 +- doomsday/plugins/jdoom64/src/st_stuff.c | 4 +- doomsday/plugins/jdoom64/src/wi_stuff.c | 54 ++++++++-------- doomsday/plugins/jheretic/data/conhelp.txt | 3 + doomsday/plugins/jheretic/include/h_config.h | 3 +- doomsday/plugins/jheretic/src/h_main.c | 5 +- doomsday/plugins/jheretic/src/in_lude.c | 14 ++--- doomsday/plugins/jheretic/src/st_stuff.c | 8 +-- doomsday/plugins/jhexen/data/conhelp.txt | 3 + doomsday/plugins/jhexen/include/x_config.h | 3 +- doomsday/plugins/jhexen/src/h2_main.c | 5 +- doomsday/plugins/jhexen/src/in_lude.c | 14 ++--- doomsday/plugins/jhexen/src/st_stuff.c | 24 ++----- 23 files changed, 144 insertions(+), 142 deletions(-) diff --git a/doomsday/plugins/common/src/hu_lib.c b/doomsday/plugins/common/src/hu_lib.c index a0c0d4c8fd..9b0e481a41 100644 --- a/doomsday/plugins/common/src/hu_lib.c +++ b/doomsday/plugins/common/src/hu_lib.c @@ -1087,7 +1087,7 @@ void MNText_Drawer(mn_object_t* obj, int x, int y) const char* replacement = NULL; if(!(obj->_flags & MNF_NO_ALTTEXT)) { - replacement = Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, *txt->patch, txt->text, true); + replacement = Hu_ChoosePatchReplacement2(cfg.menuPatchReplaceMode, *txt->patch, txt->text, true); } DGL_Enable(DGL_TEXTURE_2D); WI_DrawPatch3(*txt->patch, replacement, x, y, ALIGN_TOPLEFT, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); @@ -1700,7 +1700,7 @@ void MNButton_Drawer(mn_object_t* obj, int x, int y) const char* replacement = NULL; if(!(obj->_flags & MNF_NO_ALTTEXT)) { - replacement = Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, *btn->patch, btn->text, true); + replacement = Hu_ChoosePatchReplacement2(cfg.menuPatchReplaceMode, *btn->patch, btn->text, true); } DGL_Enable(DGL_TEXTURE_2D); WI_DrawPatch3(*btn->patch, replacement, x, y, ALIGN_TOPLEFT, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); @@ -1796,7 +1796,7 @@ void MNButton_UpdateDimensions(mn_object_t* obj, mn_page_t* page) if(!(obj->_flags & MNF_NO_ALTTEXT)) { // Use the replacement string? - text = Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, *btn->patch, btn->text, true); + text = Hu_ChoosePatchReplacement2(cfg.menuPatchReplaceMode, *btn->patch, btn->text, true); } if(NULL == text || text[0]) diff --git a/doomsday/plugins/common/src/hu_menu.c b/doomsday/plugins/common/src/hu_menu.c index 65c404270d..f683cf641f 100644 --- a/doomsday/plugins/common/src/hu_menu.c +++ b/doomsday/plugins/common/src/hu_menu.c @@ -1593,7 +1593,7 @@ cvartemplate_t menuCVars[] = { { "menu-glitter", 0, CVT_FLOAT, &cfg.menuTextGlitter, 0, 1 }, { "menu-fog", 0, CVT_INT, &cfg.hudFog, 0, 5 }, { "menu-shadow", 0, CVT_FLOAT, &cfg.menuShadow, 0, 1 }, - { "menu-patch-replacement", 0, CVT_INT, &cfg.usePatchReplacement, PRM_FIRST, PRM_LAST }, + { "menu-patch-replacement", 0, CVT_INT, &cfg.menuPatchReplaceMode, PRM_FIRST, PRM_LAST }, { "menu-slam", 0, CVT_BYTE, &cfg.menuSlam, 0, 1 }, { "menu-quick-ask", 0, CVT_BYTE, &cfg.confirmQuickGameSave, 0, 1 }, { "menu-hotkeys", 0, CVT_BYTE, &cfg.menuShortcutsEnabled, 0, 1 }, @@ -2837,7 +2837,7 @@ void Hu_MenuDrawMainPage(mn_page_t* page, int x, int y) FR_SetFont(FID(GF_FONTB)); FR_SetColorAndAlpha(1, 1, 1, mnRendState->pageAlpha); - WI_DrawPatch3(pMainTitle, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pMainTitle), x + TITLEOFFSET_X, y + TITLEOFFSET_Y, ALIGN_TOPLEFT, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); + WI_DrawPatch3(pMainTitle, Hu_ChoosePatchReplacement(cfg.menuPatchReplaceMode, pMainTitle), x + TITLEOFFSET_X, y + TITLEOFFSET_Y, ALIGN_TOPLEFT, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); #if __JHEXEN__ GL_DrawPatch(pBullWithFire[(frame + 2) % 7], x - 73, y + 24); GL_DrawPatch(pBullWithFire[frame], x + 168, y + 24); @@ -2962,7 +2962,7 @@ void Hu_MenuDrawEpisodePage(mn_page_t* page, int x, int y) FR_SetFont(FID(GF_FONTB)); FR_SetColorAndAlpha(cfg.menuTextColors[0][CR], cfg.menuTextColors[0][CG], cfg.menuTextColors[0][CB], mnRendState->pageAlpha); - WI_DrawPatch3(pEpisode, Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, pEpisode, "{case}Which Episode{scaley=1.25,y=-3}?", true), x + 7, y - 25, ALIGN_TOPLEFT, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); + WI_DrawPatch3(pEpisode, Hu_ChoosePatchReplacement2(cfg.menuPatchReplaceMode, pEpisode, "{case}Which Episode{scaley=1.25,y=-3}?", true), x + 7, y - 25, ALIGN_TOPLEFT, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); #endif DGL_Disable(DGL_TEXTURE_2D); @@ -2977,8 +2977,8 @@ void Hu_MenuDrawSkillPage(mn_page_t* page, int x, int y) FR_SetColorAndAlpha(cfg.menuTextColors[0][CR], cfg.menuTextColors[0][CG], cfg.menuTextColors[0][CB], mnRendState->pageAlpha); #if __JDOOM__ || __JDOOM64__ - WI_DrawPatch3(pNewGame, Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, pNewGame, "{case}NEW GAME", true), x + 48, y - 49, ALIGN_TOPLEFT, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); - WI_DrawPatch3(pSkill, Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, pSkill, "{case}Choose Skill Level:", true), x + 6, y - 25, ALIGN_TOPLEFT, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); + WI_DrawPatch3(pNewGame, Hu_ChoosePatchReplacement2(cfg.menuPatchReplaceMode, pNewGame, "{case}NEW GAME", true), x + 48, y - 49, ALIGN_TOPLEFT, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); + WI_DrawPatch3(pSkill, Hu_ChoosePatchReplacement2(cfg.menuPatchReplaceMode, pSkill, "{case}Choose Skill Level:", true), x + 6, y - 25, ALIGN_TOPLEFT, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); #elif __JHEXEN__ FR_DrawText3("Choose Skill Level:", x - 46, y - 28, ALIGN_TOPLEFT, MN_MergeMenuEffectWithDrawTextFlags(0)); #endif @@ -3249,7 +3249,7 @@ void Hu_MenuDrawLoadGamePage(mn_page_t* page, int x, int y) #if __JHERETIC__ || __JHEXEN__ FR_DrawText3("Load Game", SCREENWIDTH/2, y-20, ALIGN_TOP, MN_MergeMenuEffectWithDrawTextFlags(0)); #else - WI_DrawPatch3(pLoadGame, Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, pLoadGame, "{case}Load game", true), x - 8, y - 26, ALIGN_TOPLEFT, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); + WI_DrawPatch3(pLoadGame, Hu_ChoosePatchReplacement2(cfg.menuPatchReplaceMode, pLoadGame, "{case}Load game", true), x - 8, y - 26, ALIGN_TOPLEFT, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); #endif DGL_Disable(DGL_TEXTURE_2D); @@ -3265,7 +3265,7 @@ void Hu_MenuDrawSaveGamePage(mn_page_t* page, int x, int y) #if __JHERETIC__ || __JHEXEN__ FR_DrawText3("Save Game", SCREENWIDTH/2, y-20, ALIGN_TOP, MN_MergeMenuEffectWithDrawTextFlags(0)); #else - WI_DrawPatch3(pSaveGame, Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, pSaveGame, "{case}Save game", true), x - 8, y - 26, ALIGN_TOPLEFT, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); + WI_DrawPatch3(pSaveGame, Hu_ChoosePatchReplacement2(cfg.menuPatchReplaceMode, pSaveGame, "{case}Save game", true), x - 8, y - 26, ALIGN_TOPLEFT, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); #endif DGL_Disable(DGL_TEXTURE_2D); @@ -3290,7 +3290,7 @@ void Hu_MenuDrawOptionsPage(mn_page_t* page, int x, int y) #if __JHERETIC__ || __JHEXEN__ FR_DrawText3("OPTIONS", x + 42, y - 38, ALIGN_TOP, MN_MergeMenuEffectWithDrawTextFlags(0)); #else - WI_DrawPatch3(pOptionsTitle, Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, pOptionsTitle, "{case}OPTIONS", true), x + 42, y - 20, ALIGN_TOP, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); + WI_DrawPatch3(pOptionsTitle, Hu_ChoosePatchReplacement2(cfg.menuPatchReplaceMode, pOptionsTitle, "{case}OPTIONS", true), x + 42, y - 20, ALIGN_TOP, 0, MN_MergeMenuEffectWithDrawTextFlags(0)); #endif DGL_Disable(DGL_TEXTURE_2D); diff --git a/doomsday/plugins/common/src/hu_stuff.c b/doomsday/plugins/common/src/hu_stuff.c index d968573ecb..5e44e29661 100644 --- a/doomsday/plugins/common/src/hu_stuff.c +++ b/doomsday/plugins/common/src/hu_stuff.c @@ -1163,14 +1163,19 @@ const char* Hu_ChoosePatchReplacement2(patchreplacemode_t mode, patchid_t patchI const char* replacement = NULL; // No replacement possible/wanted. boolean isCustom = false; patchinfo_t info; - - if(patchId != 0 && R_GetPatchInfo(patchId, &info)) + + if(mode == PRM_NONE) { - isCustom = info.isCustom; + return NULL; } if(patchId != 0) { + if(R_GetPatchInfo(patchId, &info)) + { + isCustom = info.isCustom; + } + if(altString && altString[0] && !builtin) { // We have already determined a string to replace this with. if(!isCustom) @@ -1178,7 +1183,7 @@ const char* Hu_ChoosePatchReplacement2(patchreplacemode_t mode, patchid_t patchI replacement = altString; } } - else if(mode != PRM_NONE) + else { // We might be able to replace the patch with a string replacement. // A user replacement? replacement = Hu_FindPatchReplacementString(patchId, PRF_NO_PWAD); @@ -1498,7 +1503,7 @@ void Hu_Drawer(void) FR_SetFont(FID(GF_FONTB)); FR_LoadDefaultAttrib(); - WI_DrawPatch3(m_pause, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, m_pause), 0, 0, ALIGN_TOP, DPF_NO_OFFSET, 0); + WI_DrawPatch3(m_pause, Hu_ChoosePatchReplacement(PRM_ONLY_CUSTOM, m_pause), 0, 0, ALIGN_TOP, DPF_NO_OFFSET, 0); DGL_Disable(DGL_TEXTURE_2D); @@ -1567,7 +1572,7 @@ static void drawMapTitle(void) # else // __JDOOM64__ mapnum = gameMap; # endif - WI_DrawPatch3(pMapNames[mapnum], Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, pMapNames[mapnum], lname, false), 0, 0, ALIGN_TOP, 0, DTF_ONLY_SHADOW); + WI_DrawPatch3(pMapNames[mapnum], Hu_ChoosePatchReplacement2(PRM_CUSTOM_OR_BUILTIN, pMapNames[mapnum], lname, false), 0, 0, ALIGN_TOP, 0, DTF_ONLY_SHADOW); y += 14; #elif __JHERETIC__ || __JHEXEN__ diff --git a/doomsday/plugins/jdoom/data/conhelp.txt b/doomsday/plugins/jdoom/data/conhelp.txt index b5a70968dc..daeee81746 100644 --- a/doomsday/plugins/jdoom/data/conhelp.txt +++ b/doomsday/plugins/jdoom/data/conhelp.txt @@ -901,3 +901,6 @@ desc = 1=Stop updating the automap rendering lists. [inlude-stretch] desc = Intermission stretch-scaling strategy 0=Smart, 1=Never, 2=Always. + +[inlude-patch-replacement] +desc = Intermission Patch Replacement strings. 1=Enable external, 2=Enable built-in. diff --git a/doomsday/plugins/jdoom/include/d_config.h b/doomsday/plugins/jdoom/include/d_config.h index 58094447ab..14b010c4c4 100644 --- a/doomsday/plugins/jdoom/include/d_config.h +++ b/doomsday/plugins/jdoom/include/d_config.h @@ -102,6 +102,7 @@ typedef struct jdoom_config_s { byte menuSlam; byte menuShortcutsEnabled; byte menuScaleMode; + int menuPatchReplaceMode; byte menuGameSaveSuggestName; byte menuCursorRotate; float menuTextColors[MENU_COLOR_COUNT][3]; @@ -110,6 +111,7 @@ typedef struct jdoom_config_s { float menuTextGlitter; byte inludeScaleMode; + int inludePatchReplaceMode; byte confirmQuickGameSave; byte hudShown[NUMHUDDISPLAYS]; // HUD data visibility. @@ -120,7 +122,6 @@ typedef struct jdoom_config_s { float hudIconAlpha; float hudTimer; // Number of seconds until the hud/statusbar auto-hides. byte hudUnHide[NUMHUDUNHIDEEVENTS]; // when the hud/statusbar unhides. - int usePatchReplacement; byte moveCheckZ; // if true, mobjs can move over/under each other. byte weaponAutoSwitch; byte noWeaponAutoSwitchIfFiring; diff --git a/doomsday/plugins/jdoom/src/d_main.c b/doomsday/plugins/jdoom/src/d_main.c index 36d5ccddb0..9c1e7aa8de 100644 --- a/doomsday/plugins/jdoom/src/d_main.c +++ b/doomsday/plugins/jdoom/src/d_main.c @@ -177,7 +177,7 @@ void D_PreInit(void) cfg.echoMsg = true; cfg.lookSpeed = 3; cfg.turnSpeed = 1; - cfg.usePatchReplacement = 2; // Use built-in replacements if available. + cfg.menuPatchReplaceMode = PRM_CUSTOM_OR_BUILTIN; cfg.menuScale = .9f; cfg.menuTextGlitter = .5f; cfg.menuShadow = 0.33f; @@ -188,6 +188,9 @@ void D_PreInit(void) cfg.menuTextFlashColor[2] = 1; cfg.menuTextFlashSpeed = 4; cfg.menuCursorRotate = true; + + cfg.inludePatchReplaceMode = PRM_CUSTOM_OR_BUILTIN; + cfg.hudKeysCombine = false; cfg.hudShown[HUD_HEALTH] = true; cfg.hudShown[HUD_ARMOR] = true; diff --git a/doomsday/plugins/jdoom/src/st_stuff.c b/doomsday/plugins/jdoom/src/st_stuff.c index 26216585aa..f4a2ffea74 100644 --- a/doomsday/plugins/jdoom/src/st_stuff.c +++ b/doomsday/plugins/jdoom/src/st_stuff.c @@ -1481,10 +1481,7 @@ void SBarFace_Drawer(uiwidget_t* obj, int x, int y) DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, iconAlpha); - FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, iconAlpha); - - WI_DrawPatch2(patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId), ORIGINX+ST_FACESX, ORIGINY+ST_FACESY, ALIGN_TOPLEFT); + GL_DrawPatch2(patchId, ORIGINX+ST_FACESX, ORIGINY+ST_FACESY, ALIGN_TOPLEFT); DGL_Disable(DGL_TEXTURE_2D); DGL_MatrixMode(DGL_MODELVIEW); @@ -1582,13 +1579,11 @@ void KeySlot_Drawer(uiwidget_t* obj, int x, int y) DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, iconAlpha); - FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, iconAlpha); - WI_DrawPatch(kslt->patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, kslt->patchId), loc->x + offset, loc->y + offset); + GL_DrawPatch(kslt->patchId, loc->x + offset, loc->y + offset); if(kslt->patchId2 != 0) { - WI_DrawPatch(kslt->patchId2, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, kslt->patchId2), loc->x - offset, loc->y - offset); + GL_DrawPatch(kslt->patchId2, loc->x - offset, loc->y - offset); } DGL_Disable(DGL_TEXTURE_2D); @@ -1722,10 +1717,8 @@ void WeaponSlot_Drawer(uiwidget_t* obj, int x, int y) DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, textAlpha); - FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, textAlpha); - WI_DrawPatch(wpns->patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, wpns->patchId), element->x, element->y); + GL_DrawPatch(wpns->patchId, element->x, element->y); DGL_Disable(DGL_TEXTURE_2D); DGL_MatrixMode(DGL_MODELVIEW); @@ -2842,7 +2835,7 @@ void MapName_Drawer(uiwidget_t* obj, int x, int y) const float scale = .75f; const float textAlpha = uiRendState->pageAlpha; const patchid_t patch = P_FindMapTitlePatch(gameEpisode, gameMap); - const char* text = Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, patch, P_GetMapNiceName(), false); + const char* text = Hu_ChoosePatchReplacement2(PRM_CUSTOM_OR_BUILTIN, patch, P_GetMapNiceName(), false); if(NULL == text && 0 == patch) return; @@ -2870,7 +2863,7 @@ void MapName_UpdateDimensions(uiwidget_t* obj) assert(NULL != obj && obj->type == GUI_MAPNAME); { const patchid_t patch = P_FindMapTitlePatch(gameEpisode, gameMap); - const char* text = Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, patch, P_GetMapNiceName(), false); + const char* text = Hu_ChoosePatchReplacement2(PRM_CUSTOM_OR_BUILTIN, patch, P_GetMapNiceName(), false); const float scale = .75f; patchinfo_t info; diff --git a/doomsday/plugins/jdoom/src/wi_stuff.c b/doomsday/plugins/jdoom/src/wi_stuff.c index 110b1f98ff..ca9bc66503 100644 --- a/doomsday/plugins/jdoom/src/wi_stuff.c +++ b/doomsday/plugins/jdoom/src/wi_stuff.c @@ -221,16 +221,14 @@ static patchid_t pFaceDead; static patchid_t pTeamBackgrounds[NUMTEAMS]; static patchid_t pTeamIcons[NUMTEAMS]; -static cvartemplate_t cvars[] = { - { "inlude-stretch", 0, CVT_BYTE, &cfg.inludeScaleMode, SCALEMODE_FIRST, SCALEMODE_LAST }, - { NULL } -}; - void WI_Register(void) { - int i; - for(i = 0; cvars[i].name; ++i) - Con_AddVariable(cvars + i); + cvartemplate_t cvars[] = { + { "inlude-stretch", 0, CVT_BYTE, &cfg.inludeScaleMode, SCALEMODE_FIRST, SCALEMODE_LAST }, + { "inlude-patch-replacement", 0, CVT_INT, &cfg.inludePatchReplaceMode, PRM_FIRST, PRM_LAST }, + { NULL } + }; + Con_AddVariableList(cvars); } static void drawBackground(void) @@ -256,7 +254,7 @@ static void drawBackground(void) def = &animDefs[wbs->episode][i]; patchId = state->patches[state->ctr]; - WI_DrawPatch3(patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId), def->offset.x, def->offset.y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(patchId, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, patchId), def->offset.x, def->offset.y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); } } DGL_Disable(DGL_TEXTURE_2D); @@ -294,12 +292,12 @@ static void drawFinishedTitle(void) // Draw patchId = pMapNames[mapNum]; - WI_DrawPatch3(patchId, Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, patchId, mapName, false), x, y, ALIGN_TOP, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(patchId, Hu_ChoosePatchReplacement2(cfg.inludePatchReplaceMode, patchId, mapName, false), x, y, ALIGN_TOP, 0, DTF_NO_TYPEIN); // Draw "Finished!" if(R_GetPatchInfo(patchId, &info)) y += (5 * info.height) / 4; - WI_DrawPatch3(pFinished, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pFinished), x, y, ALIGN_TOP, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pFinished, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pFinished), x, y, ALIGN_TOP, 0, DTF_NO_TYPEIN); DGL_Disable(DGL_TEXTURE_2D); } @@ -342,13 +340,13 @@ static void drawEnteringTitle(void) FR_LoadDefaultAttrib(); // Draw "Entering" - WI_DrawPatch3(pEntering, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pEntering), x, y, ALIGN_TOP, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pEntering, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pEntering), x, y, ALIGN_TOP, 0, DTF_NO_TYPEIN); // Draw map. if(R_GetPatchInfo(pMapNames[wbs->nextMap], &info)) y += (5 * info.height) / 4; patchId = pMapNames[(wbs->episode * 8) + wbs->nextMap]; - WI_DrawPatch3(patchId, Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, patchId, mapName, false), x, y, ALIGN_TOP, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(patchId, Hu_ChoosePatchReplacement2(cfg.inludePatchReplaceMode, patchId, mapName, false), x, y, ALIGN_TOP, 0, DTF_NO_TYPEIN); DGL_Disable(DGL_TEXTURE_2D); } @@ -380,7 +378,7 @@ static void drawPatchIfFits(patchid_t patchId, const point_t* node) assert(NULL != node); if(patchFits(patchId, node->x, node->y)) { - WI_DrawPatch3(patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId), node->x, node->y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(patchId, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, patchId), node->x, node->y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); } } @@ -489,7 +487,7 @@ static void drawTime(int x, int y, int t) patchinfo_t info; if(!R_GetPatchInfo(pSucks, &info)) return; - WI_DrawPatch3(pSucks, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pSucks), x - info.width, y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pSucks, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pSucks), x - info.width, y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); } } @@ -568,7 +566,7 @@ static void drawLocationMarks(void) patchid_t patchId = chooseYouAreHerePatch(node); if(0 != patchId) { - WI_DrawPatch3(patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId), node->x, node->y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(patchId, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, patchId), node->x, node->y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); } } @@ -689,10 +687,10 @@ static void drawDeathmatchStats(void) // Draw stat titles (top line). { patchinfo_t info; if(R_GetPatchInfo(pTotal, &info)) - WI_DrawPatch3(pTotal, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pTotal), DM_TOTALSX - info.width / 2, DM_MATRIXY - WI_SPACINGY + 10, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); } + WI_DrawPatch3(pTotal, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pTotal), DM_TOTALSX - info.width / 2, DM_MATRIXY - WI_SPACINGY + 10, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); } - WI_DrawPatch3(pKillers, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pKillers), DM_KILLERSX, DM_KILLERSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); - WI_DrawPatch3(pVictims, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pVictims), DM_VICTIMSX, DM_VICTIMSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pKillers, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pKillers), DM_KILLERSX, DM_KILLERSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pVictims, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pVictims), DM_VICTIMSX, DM_VICTIMSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); x = DM_MATRIXX + DM_SPACINGX; y = DM_MATRIXY; @@ -706,14 +704,14 @@ static void drawDeathmatchStats(void) patchinfo_t info; R_GetPatchInfo(patchId, &info); - replacement = Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId); + replacement = Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, patchId); WI_DrawPatch3(patchId, replacement, x - info.width / 2, DM_MATRIXY - WI_SPACINGY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); WI_DrawPatch3(patchId, replacement, DM_MATRIXX - info.width / 2, y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); if(i == inPlayerTeam) { - WI_DrawPatch3(pFaceDead, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pFaceDead), x - info.width / 2, DM_MATRIXY - WI_SPACINGY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); - WI_DrawPatch3(pFaceAlive, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pFaceAlive), DM_MATRIXX - info.width / 2, y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pFaceDead, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pFaceDead), x - info.width / 2, DM_MATRIXY - WI_SPACINGY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pFaceAlive, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pFaceAlive), DM_MATRIXX - info.width / 2, y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); } // If more than 1 member, show the member count. @@ -730,7 +728,7 @@ static void drawDeathmatchStats(void) else { patchid_t patchId = pTeamIcons[i]; - const char* replacement = Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId); + const char* replacement = Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, patchId); patchinfo_t info; R_GetPatchInfo(patchId, &info); WI_DrawPatch3(patchId, replacement, x - info.width / 2, DM_MATRIXY - WI_SPACINGY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); @@ -945,19 +943,19 @@ static void drawNetgameStats(void) // Draw stat titles (top line). R_GetPatchInfo(pKills, &info); - WI_DrawPatch3(pKills, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pKills), ORIGINX + NG_SPACINGX - info.width, NG_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pKills, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pKills), ORIGINX + NG_SPACINGX - info.width, NG_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); y = NG_STATSY + info.height; R_GetPatchInfo(pItems, &info); - WI_DrawPatch3(pItems, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pItems), ORIGINX + 2 * NG_SPACINGX - info.width, NG_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pItems, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pItems), ORIGINX + 2 * NG_SPACINGX - info.width, NG_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); R_GetPatchInfo(pSecret, &info); - WI_DrawPatch3(pSecret, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pSecret), ORIGINX + 3 * NG_SPACINGX - info.width, NG_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pSecret, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pSecret), ORIGINX + 3 * NG_SPACINGX - info.width, NG_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); if(doFrags) { R_GetPatchInfo(pFrags, &info); - WI_DrawPatch3(pFrags, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pFrags), ORIGINX + 4 * NG_SPACINGX - info.width, NG_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pFrags, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pFrags), ORIGINX + 4 * NG_SPACINGX - info.width, NG_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); } // Draw stats. @@ -970,7 +968,7 @@ static void drawNetgameStats(void) x = ORIGINX; R_GetPatchInfo(pTeamBackgrounds[i], &info); - WI_DrawPatch3(pTeamBackgrounds[i], Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pTeamBackgrounds[i]), x - info.width, y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pTeamBackgrounds[i], Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pTeamBackgrounds[i]), x - info.width, y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); // If more than 1 member, show the member count. if(1 != teamInfo[i].playerCount) @@ -985,7 +983,7 @@ static void drawNetgameStats(void) } if(i == inPlayerTeam) - WI_DrawPatch3(pFaceAlive, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pFaceAlive), x - info.width, y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pFaceAlive, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pFaceAlive), x - info.width, y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); x += NG_SPACINGX; FR_SetFont(FID(GF_SMALL)); @@ -1024,16 +1022,16 @@ static void drawSinglePlayerStats(void) FR_LoadDefaultAttrib(); FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], 1); - WI_DrawPatch3(pKills, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pKills), SP_STATSX, SP_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pKills, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pKills), SP_STATSX, SP_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY, cntKills[0]); - WI_DrawPatch3(pItems, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pItems), SP_STATSX, SP_STATSY + lh, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pItems, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pItems), SP_STATSX, SP_STATSY + lh, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY + lh, cntItems[0]); - WI_DrawPatch3(pSecretSP, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pSecretSP), SP_STATSX, SP_STATSY + 2 * lh, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pSecretSP, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pSecretSP), SP_STATSX, SP_STATSY + 2 * lh, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY + 2 * lh, cntSecret[0]); - WI_DrawPatch3(pTime, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pTime), SP_TIMEX, SP_TIMEY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pTime, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pTime), SP_TIMEX, SP_TIMEY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); if(cntTime >= 0) { @@ -1042,7 +1040,7 @@ static void drawSinglePlayerStats(void) if(wbs->parTime != -1) { - WI_DrawPatch3(pPar, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pPar), SCREENWIDTH / 2 + SP_TIMEX, SP_TIMEY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); + WI_DrawPatch3(pPar, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pPar), SCREENWIDTH / 2 + SP_TIMEX, SP_TIMEY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN); if(cntPar >= 0) { drawTime(SCREENWIDTH - SP_TIMEX, SP_TIMEY, cntPar / TICRATE); diff --git a/doomsday/plugins/jdoom64/data/conhelp.txt b/doomsday/plugins/jdoom64/data/conhelp.txt index dca8880536..75c620615e 100644 --- a/doomsday/plugins/jdoom64/data/conhelp.txt +++ b/doomsday/plugins/jdoom64/data/conhelp.txt @@ -888,3 +888,6 @@ desc = 1=Stop updating the automap rendering lists. [inlude-stretch] desc = Intermission stretch-scaling strategy 0=Smart, 1=Never, 2=Always. + +[inlude-patch-replacement] +desc = Intermission Patch Replacement strings. 1=Enable external, 2=Enable built-in. diff --git a/doomsday/plugins/jdoom64/include/d_config.h b/doomsday/plugins/jdoom64/include/d_config.h index 65fcd24998..cf26f325e3 100644 --- a/doomsday/plugins/jdoom64/include/d_config.h +++ b/doomsday/plugins/jdoom64/include/d_config.h @@ -104,6 +104,7 @@ typedef struct jdoom64_config_s { byte menuSlam; byte menuShortcutsEnabled; byte menuScaleMode; + int menuPatchReplaceMode; byte menuGameSaveSuggestName; byte menuCursorRotate; float menuTextColors[MENU_COLOR_COUNT][3]; @@ -112,6 +113,7 @@ typedef struct jdoom64_config_s { float menuTextGlitter; byte inludeScaleMode; + int inludePatchReplaceMode; byte confirmQuickGameSave; byte hudShown[NUMHUDDISPLAYS]; // HUD data visibility. @@ -121,7 +123,6 @@ typedef struct jdoom64_config_s { float hudIconAlpha; float hudTimer; // Number of seconds until the hud auto-hides. byte hudUnHide[NUMHUDUNHIDEEVENTS]; // When the hud unhides. - int usePatchReplacement; byte moveCheckZ; // If true, mobjs can move over/under each other. byte weaponAutoSwitch; byte noWeaponAutoSwitchIfFiring; diff --git a/doomsday/plugins/jdoom64/src/d_main.c b/doomsday/plugins/jdoom64/src/d_main.c index 39d5fe6a5e..0818415bd0 100644 --- a/doomsday/plugins/jdoom64/src/d_main.c +++ b/doomsday/plugins/jdoom64/src/d_main.c @@ -180,7 +180,7 @@ void D_PreInit(void) cfg.echoMsg = true; cfg.lookSpeed = 3; cfg.turnSpeed = 1; - cfg.usePatchReplacement = 2; // Use built-in replacements if available. + cfg.menuPatchReplaceMode = PRM_CUSTOM_OR_BUILTIN; cfg.menuScale = .9f; cfg.menuTextGlitter = .5f; cfg.menuShadow = 0.33f; @@ -191,6 +191,9 @@ void D_PreInit(void) cfg.menuTextFlashColor[2] = 1; cfg.menuTextFlashSpeed = 4; cfg.menuCursorRotate = false; + + cfg.inludePatchReplaceMode = PRM_CUSTOM_OR_BUILTIN; + cfg.hudShown[HUD_HEALTH] = true; cfg.hudShown[HUD_ARMOR] = true; cfg.hudShown[HUD_AMMO] = true; diff --git a/doomsday/plugins/jdoom64/src/st_stuff.c b/doomsday/plugins/jdoom64/src/st_stuff.c index 1abc481f53..c7dd28f630 100644 --- a/doomsday/plugins/jdoom64/src/st_stuff.c +++ b/doomsday/plugins/jdoom64/src/st_stuff.c @@ -620,7 +620,7 @@ void MapName_Drawer(uiwidget_t* obj, int x, int y) const float scale = .75f; const float textAlpha = uiRendState->pageAlpha; const patchid_t patch = P_FindMapTitlePatch(gameEpisode, gameMap); - const char* text = Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, patch, P_GetMapNiceName(), false); + const char* text = Hu_ChoosePatchReplacement2(PRM_CUSTOM_OR_BUILTIN, patch, P_GetMapNiceName(), false); if(NULL == text && 0 == patch) return; @@ -648,7 +648,7 @@ void MapName_Dimensions(uiwidget_t* obj, int* width, int* height) assert(NULL != obj && obj->type == GUI_MAPNAME); { const patchid_t patch = P_FindMapTitlePatch(gameEpisode, gameMap); - const char* text = Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, patch, P_GetMapNiceName(), false); + const char* text = Hu_ChoosePatchReplacement2(PRM_CUSTOM_OR_BUILTIN, patch, P_GetMapNiceName(), false); const float scale = .75f; patchinfo_t info; diff --git a/doomsday/plugins/jdoom64/src/wi_stuff.c b/doomsday/plugins/jdoom64/src/wi_stuff.c index 487ead0802..497f9de63f 100644 --- a/doomsday/plugins/jdoom64/src/wi_stuff.c +++ b/doomsday/plugins/jdoom64/src/wi_stuff.c @@ -99,16 +99,14 @@ static patchid_t pTotal; static patchid_t pTeamBackgrounds[NUMTEAMS]; static patchid_t pTeamIcons[NUMTEAMS]; -static cvartemplate_t cvars[] = { - { "inlude-stretch", 0, CVT_BYTE, &cfg.inludeScaleMode, SCALEMODE_FIRST, SCALEMODE_LAST }, - { NULL } -}; - void WI_Register(void) { - int i; - for(i = 0; cvars[i].name; ++i) - Con_AddVariable(cvars + i); + cvartemplate_t cvars[] = { + { "inlude-stretch", 0, CVT_BYTE, &cfg.inludeScaleMode, SCALEMODE_FIRST, SCALEMODE_LAST }, + { "inlude-patch-replacement", 0, CVT_INT, &cfg.inludePatchReplaceMode, PRM_FIRST, PRM_LAST }, + { NULL } + }; + Con_AddVariableList(cvars); } static void drawBackground(void) @@ -144,11 +142,11 @@ static void drawFinishedTitle(void) // Draw patchId = pMapNames[mapNum]; - WI_DrawPatch2(patchId, Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, patchId, mapName, false), x, y, ALIGN_TOP); + WI_DrawPatch2(patchId, Hu_ChoosePatchReplacement2(cfg.inludePatchReplaceMode, patchId, mapName, false), x, y, ALIGN_TOP); if(R_GetPatchInfo(patchId, &info)) y += (5 * info.height) / 4; // Draw "Finished!" - WI_DrawPatch2(pFinished, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pFinished), x, y, ALIGN_TOP); + WI_DrawPatch2(pFinished, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pFinished), x, y, ALIGN_TOP); DGL_Disable(DGL_TEXTURE_2D); } @@ -186,13 +184,13 @@ static void drawEnteringTitle(void) FR_LoadDefaultAttrib(); // Draw "Entering" - WI_DrawPatch2(pEntering, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pEntering), x, y, ALIGN_TOP); + WI_DrawPatch2(pEntering, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pEntering), x, y, ALIGN_TOP); // Draw map. if(R_GetPatchInfo(pMapNames[wbs->nextMap], &info)) y += (5 * info.height) / 4; patchId = pMapNames[(wbs->episode * 8) + wbs->nextMap]; - WI_DrawPatch2(patchId, Hu_ChoosePatchReplacement2(cfg.usePatchReplacement, patchId, mapName, false), x, y, ALIGN_TOP); + WI_DrawPatch2(patchId, Hu_ChoosePatchReplacement2(cfg.inludePatchReplaceMode, patchId, mapName, false), x, y, ALIGN_TOP); DGL_Disable(DGL_TEXTURE_2D); } @@ -238,7 +236,7 @@ static void drawTime(int x, int y, int t) patchinfo_t info; if(!R_GetPatchInfo(pSucks, &info)) return; - WI_DrawPatch3(pSucks, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pSucks), x - info.width, y, ALIGN_TOPLEFT, 0, DTF_NO_EFFECTS); + WI_DrawPatch3(pSucks, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pSucks), x - info.width, y, ALIGN_TOPLEFT, 0, DTF_NO_EFFECTS); } } @@ -379,10 +377,10 @@ static void drawDeathmatchStats(void) // Draw stat titles (top line). { patchinfo_t info; if(R_GetPatchInfo(pTotal, &info)) - WI_DrawPatch(pTotal, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pTotal), DM_TOTALSX - info.width / 2, DM_MATRIXY - WI_SPACINGY + 10); } + WI_DrawPatch(pTotal, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pTotal), DM_TOTALSX - info.width / 2, DM_MATRIXY - WI_SPACINGY + 10); } - WI_DrawPatch(pKillers, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pKillers), DM_KILLERSX, DM_KILLERSY); - WI_DrawPatch(pVictims, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pVictims), DM_VICTIMSX, DM_VICTIMSY); + WI_DrawPatch(pKillers, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pKillers), DM_KILLERSX, DM_KILLERSY); + WI_DrawPatch(pVictims, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pVictims), DM_VICTIMSX, DM_VICTIMSY); x = DM_MATRIXX + DM_SPACINGX; y = DM_MATRIXY; @@ -392,7 +390,7 @@ static void drawDeathmatchStats(void) if(teamInfo[i].playerCount > 0) { patchid_t patchId = pTeamBackgrounds[i]; - const char* replacement = Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId); + const char* replacement = Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, patchId); patchinfo_t info; R_GetPatchInfo(patchId, &info); @@ -421,7 +419,7 @@ static void drawDeathmatchStats(void) else { patchid_t patchId = pTeamIcons[i]; - const char* replacement = Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId); + const char* replacement = Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, patchId); patchinfo_t info; R_GetPatchInfo(patchId, &info); WI_DrawPatch(patchId, replacement, x - info.width / 2, DM_MATRIXY - WI_SPACINGY); @@ -631,19 +629,19 @@ static void drawNetgameStats(void) // Draw stat titles (top line). R_GetPatchInfo(pKills, &info); - WI_DrawPatch(pKills, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pKills), ORIGINX + NG_SPACINGX - info.width, NG_STATSY); + WI_DrawPatch(pKills, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pKills), ORIGINX + NG_SPACINGX - info.width, NG_STATSY); y = NG_STATSY + info.height; R_GetPatchInfo(pItems, &info); - WI_DrawPatch(pItems, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pItems), ORIGINX + 2 * NG_SPACINGX - info.width, NG_STATSY); + WI_DrawPatch(pItems, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pItems), ORIGINX + 2 * NG_SPACINGX - info.width, NG_STATSY); R_GetPatchInfo(pSecret, &info); - WI_DrawPatch(pSecret, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pSecret), ORIGINX + 3 * NG_SPACINGX - info.width, NG_STATSY); + WI_DrawPatch(pSecret, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pSecret), ORIGINX + 3 * NG_SPACINGX - info.width, NG_STATSY); if(doFrags) { R_GetPatchInfo(pFrags, &info); - WI_DrawPatch(pFrags, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pFrags), ORIGINX + 4 * NG_SPACINGX - info.width, NG_STATSY); + WI_DrawPatch(pFrags, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pFrags), ORIGINX + 4 * NG_SPACINGX - info.width, NG_STATSY); } // Draw stats. @@ -658,7 +656,7 @@ static void drawNetgameStats(void) x = ORIGINX; patchId = pTeamBackgrounds[i]; R_GetPatchInfo(patchId, &info); - WI_DrawPatch(patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId), x - info.width, y); + WI_DrawPatch(patchId, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, patchId), x - info.width, y); // If more than 1 member, show the member count. if(1 != teamInfo[i].playerCount) @@ -713,16 +711,16 @@ static void drawSinglePlayerStats(void) lh = (3 * FR_CharHeight('0')) / 2; // Line height. - WI_DrawPatch(pKills, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pKills), SP_STATSX, SP_STATSY); + WI_DrawPatch(pKills, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pKills), SP_STATSX, SP_STATSY); drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY, cntKills[0]); - WI_DrawPatch(pItems, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pItems), SP_STATSX, SP_STATSY + lh); + WI_DrawPatch(pItems, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pItems), SP_STATSX, SP_STATSY + lh); drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY + lh, cntItems[0]); - WI_DrawPatch(pSecretSP, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pSecretSP), SP_STATSX, SP_STATSY + 2 * lh); + WI_DrawPatch(pSecretSP, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pSecretSP), SP_STATSX, SP_STATSY + 2 * lh); drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY + 2 * lh, cntSecret[0]); - WI_DrawPatch(pTime, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pTime), SP_TIMEX, SP_TIMEY); + WI_DrawPatch(pTime, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pTime), SP_TIMEX, SP_TIMEY); if(cntTime >= 0) { drawTime(SCREENWIDTH / 2 - SP_TIMEX, SP_TIMEY, cntTime / TICRATE); @@ -730,7 +728,7 @@ static void drawSinglePlayerStats(void) if(wbs->parTime != -1) { - WI_DrawPatch(pPar, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, pPar), SCREENWIDTH / 2 + SP_TIMEX, SP_TIMEY); + WI_DrawPatch(pPar, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pPar), SCREENWIDTH / 2 + SP_TIMEX, SP_TIMEY); if(cntPar >= 0) { drawTime(SCREENWIDTH - SP_TIMEX, SP_TIMEY, cntPar / TICRATE); diff --git a/doomsday/plugins/jheretic/data/conhelp.txt b/doomsday/plugins/jheretic/data/conhelp.txt index a01adbe35f..65b9feef9e 100644 --- a/doomsday/plugins/jheretic/data/conhelp.txt +++ b/doomsday/plugins/jheretic/data/conhelp.txt @@ -907,3 +907,6 @@ desc = 1=Stop updating the automap rendering lists. [inlude-stretch] desc = Intermission stretch-scaling strategy 0=Smart, 1=Never, 2=Always. + +[inlude-patch-replacement] +desc = Intermission Patch Replacement strings. 1=Enable external, 2=Enable built-in. diff --git a/doomsday/plugins/jheretic/include/h_config.h b/doomsday/plugins/jheretic/include/h_config.h index 50dab62a93..fdbf062a3f 100644 --- a/doomsday/plugins/jheretic/include/h_config.h +++ b/doomsday/plugins/jheretic/include/h_config.h @@ -103,6 +103,7 @@ typedef struct jheretic_config_s { byte menuSlam; byte menuShortcutsEnabled; byte menuScaleMode; + int menuPatchReplaceMode; byte menuGameSaveSuggestName; byte menuCursorRotate; float menuTextColors[MENU_COLOR_COUNT][3]; @@ -111,6 +112,7 @@ typedef struct jheretic_config_s { float menuTextGlitter; byte inludeScaleMode; + int inludePatchReplaceMode; byte confirmQuickGameSave; byte hudShown[6]; // HUD data visibility. @@ -120,7 +122,6 @@ typedef struct jheretic_config_s { float hudIconAlpha; float hudTimer; // Number of seconds until the hud/statusbar auto-hides. byte hudUnHide[NUMHUDUNHIDEEVENTS]; // when the hud/statusbar unhides. - int usePatchReplacement; byte moveCheckZ; // if true, mobjs can move over/under each other. byte weaponAutoSwitch; byte noWeaponAutoSwitchIfFiring; diff --git a/doomsday/plugins/jheretic/src/h_main.c b/doomsday/plugins/jheretic/src/h_main.c index f1c879b44a..a2a3111a49 100644 --- a/doomsday/plugins/jheretic/src/h_main.c +++ b/doomsday/plugins/jheretic/src/h_main.c @@ -183,7 +183,7 @@ void H_PreInit(void) cfg.echoMsg = true; cfg.lookSpeed = 3; cfg.turnSpeed = 1; - cfg.usePatchReplacement = 2; // Use built-in replacements if available. + cfg.menuPatchReplaceMode = PRM_CUSTOM_OR_BUILTIN; cfg.menuScale = .9f; cfg.menuTextGlitter = 0; cfg.menuShadow = 0; @@ -193,6 +193,9 @@ void H_PreInit(void) cfg.menuTextFlashColor[2] = 1; cfg.menuTextFlashSpeed = 4; cfg.menuCursorRotate = false; + + cfg.inludePatchReplaceMode = PRM_CUSTOM_OR_BUILTIN; + cfg.hudShown[HUD_AMMO] = true; cfg.hudShown[HUD_ARMOR] = true; cfg.hudShown[HUD_KEYS] = true; diff --git a/doomsday/plugins/jheretic/src/in_lude.c b/doomsday/plugins/jheretic/src/in_lude.c index 4c91d806ac..04961bc2c1 100644 --- a/doomsday/plugins/jheretic/src/in_lude.c +++ b/doomsday/plugins/jheretic/src/in_lude.c @@ -156,18 +156,16 @@ static yahpt_t YAHspot[3][9] = { } }; -static cvartemplate_t cvars[] = { - { "inlude-stretch", 0, CVT_BYTE, &cfg.inludeScaleMode, SCALEMODE_FIRST, SCALEMODE_LAST }, - { NULL } -}; - // CODE -------------------------------------------------------------------- void WI_Register(void) { - int i; - for(i = 0; cvars[i].name; ++i) - Con_AddVariable(cvars + i); + cvartemplate_t cvars[] = { + { "inlude-stretch", 0, CVT_BYTE, &cfg.inludeScaleMode, SCALEMODE_FIRST, SCALEMODE_LAST }, + { "inlude-patch-replacement", 0, CVT_INT, &cfg.inludePatchReplaceMode, PRM_FIRST, PRM_LAST }, + { NULL } + }; + Con_AddVariableList(cvars); } void IN_DrawTime(int x, int y, int h, int m, int s, float r, float g, float b, float a) diff --git a/doomsday/plugins/jheretic/src/st_stuff.c b/doomsday/plugins/jheretic/src/st_stuff.c index cfcd029b7c..216fc12c82 100644 --- a/doomsday/plugins/jheretic/src/st_stuff.c +++ b/doomsday/plugins/jheretic/src/st_stuff.c @@ -1131,10 +1131,8 @@ void KeySlot_Drawer(uiwidget_t* obj, int x, int y) DGL_Translatef(0, yOffset, 0); DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, iconAlpha); - FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, iconAlpha); - WI_DrawPatch(kslt->patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, kslt->patchId), loc->x, loc->y); + GL_DrawPatch(kslt->patchId, loc->x, loc->y); DGL_Disable(DGL_TEXTURE_2D); DGL_MatrixMode(DGL_MODELVIEW); @@ -1331,10 +1329,8 @@ void SBarReadyAmmoIcon_Drawer(uiwidget_t* obj, int x, int y) DGL_Translatef(0, yOffset, 0); DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, iconAlpha); - FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, iconAlpha); - WI_DrawPatch(icon->patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, icon->patchId), X, Y); + GL_DrawPatch(icon->patchId, X, Y); DGL_Disable(DGL_TEXTURE_2D); DGL_MatrixMode(DGL_MODELVIEW); diff --git a/doomsday/plugins/jhexen/data/conhelp.txt b/doomsday/plugins/jhexen/data/conhelp.txt index 146f9221db..31c8f3d2ab 100644 --- a/doomsday/plugins/jhexen/data/conhelp.txt +++ b/doomsday/plugins/jhexen/data/conhelp.txt @@ -922,3 +922,6 @@ desc = 1=Stop updating the automap rendering lists. [inlude-stretch] desc = Intermission stretch-scaling strategy 0=Smart, 1=Never, 2=Always. + +[inlude-patch-replacement] +desc = Intermission Patch Replacement strings. 1=Enable external, 2=Enable built-in. diff --git a/doomsday/plugins/jhexen/include/x_config.h b/doomsday/plugins/jhexen/include/x_config.h index eef4cd04fb..aedda11c55 100644 --- a/doomsday/plugins/jhexen/include/x_config.h +++ b/doomsday/plugins/jhexen/include/x_config.h @@ -76,7 +76,6 @@ typedef struct { float hudIconAlpha; float hudTimer; // Number of seconds until the hud/statusbar auto-hides. byte hudUnHide[NUMHUDUNHIDEEVENTS]; // when the hud/statusbar unhides. - int usePatchReplacement; int showFPS, lookSpring; int mlookInverseY; int echoMsg; @@ -160,6 +159,7 @@ typedef struct { byte menuSlam; byte menuShortcutsEnabled; byte menuScaleMode; + int menuPatchReplaceMode; byte menuGameSaveSuggestName; byte menuCursorRotate; float menuTextColors[MENU_COLOR_COUNT][3]; @@ -168,6 +168,7 @@ typedef struct { float menuTextGlitter; byte inludeScaleMode; + int inludePatchReplaceMode; byte netMap, netClass, netColor, netSkill; byte netEpisode; // Unused in Hexen. diff --git a/doomsday/plugins/jhexen/src/h2_main.c b/doomsday/plugins/jhexen/src/h2_main.c index 9d5d197ccc..69c00accd1 100644 --- a/doomsday/plugins/jhexen/src/h2_main.c +++ b/doomsday/plugins/jhexen/src/h2_main.c @@ -217,6 +217,7 @@ void X_PreInit(void) cfg.plrViewHeight = DEFAULT_PLAYER_VIEWHEIGHT; cfg.mapTitle = true; cfg.hideIWADAuthor = true; + cfg.menuPatchReplaceMode = PRM_CUSTOM_OR_BUILTIN; cfg.menuScale = .75f; cfg.menuTextColors[0][0] = defFontRGB[0]; cfg.menuTextColors[0][1] = defFontRGB[1]; @@ -232,6 +233,9 @@ void X_PreInit(void) cfg.menuTextColors[3][2] = defFontRGB3[2]; cfg.menuEffectFlags = MEF_TEXT_SHADOW; cfg.menuShortcutsEnabled = true; + + cfg.inludePatchReplaceMode = PRM_CUSTOM_OR_BUILTIN; + cfg.confirmQuickGameSave = true; cfg.hudFog = 5; cfg.menuSlam = true; @@ -248,7 +252,6 @@ void X_PreInit(void) cfg.hudColor[2] = defFontRGB[2]; cfg.hudColor[3] = 1; cfg.hudIconAlpha = 1; - cfg.usePatchReplacement = 2; // Use built-in replacements if available. cfg.cameraNoClip = true; cfg.bobView = cfg.bobWeapon = 1; diff --git a/doomsday/plugins/jhexen/src/in_lude.c b/doomsday/plugins/jhexen/src/in_lude.c index 502c81093f..e3af99f854 100644 --- a/doomsday/plugins/jhexen/src/in_lude.c +++ b/doomsday/plugins/jhexen/src/in_lude.c @@ -108,18 +108,16 @@ static int hubCount; static patchinfo_t dpTallyTop; static patchinfo_t dpTallyLeft; -static cvartemplate_t cvars[] = { - { "inlude-stretch", 0, CVT_BYTE, &cfg.inludeScaleMode, SCALEMODE_FIRST, SCALEMODE_LAST }, - { NULL } -}; - // CODE -------------------------------------------------------------------- void WI_Register(void) { - int i; - for(i = 0; cvars[i].name; ++i) - Con_AddVariable(cvars + i); + cvartemplate_t cvars[] = { + { "inlude-stretch", 0, CVT_BYTE, &cfg.inludeScaleMode, SCALEMODE_FIRST, SCALEMODE_LAST }, + { "inlude-patch-replacement", 0, CVT_INT, &cfg.inludePatchReplaceMode, PRM_FIRST, PRM_LAST }, + { NULL } + }; + Con_AddVariableList(cvars); } void WI_initVariables(void /* wbstartstruct_t* wbstartstruct */) diff --git a/doomsday/plugins/jhexen/src/st_stuff.c b/doomsday/plugins/jhexen/src/st_stuff.c index 235a1853a5..4739494517 100644 --- a/doomsday/plugins/jhexen/src/st_stuff.c +++ b/doomsday/plugins/jhexen/src/st_stuff.c @@ -2056,10 +2056,8 @@ void SBarBlueManaIcon_Drawer(uiwidget_t* obj, int x, int y) DGL_Translatef(0, yOffset, 0); DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, iconAlpha); - FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, iconAlpha); - WI_DrawPatch(patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId), X, Y); + GL_DrawPatch(patchId, X, Y); DGL_Disable(DGL_TEXTURE_2D); DGL_MatrixMode(DGL_MODELVIEW); @@ -2165,10 +2163,8 @@ void SBarGreenManaIcon_Drawer(uiwidget_t* obj, int x, int y) DGL_Translatef(0, yOffset, 0); DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, iconAlpha); - FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, iconAlpha); - WI_DrawPatch(patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId), X, Y); + GL_DrawPatch(patchId, X, Y); DGL_Disable(DGL_TEXTURE_2D); DGL_MatrixMode(DGL_MODELVIEW); @@ -2266,9 +2262,7 @@ void SBarBlueManaVial_Drawer(uiwidget_t* obj, int x, int y) patchid_t patchId = pManaAVials[vial->iconIdx].id; DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, iconAlpha); - FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, iconAlpha); - WI_DrawPatch(patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId), X, Y); + GL_DrawPatch(patchId, X, Y); DGL_Disable(DGL_TEXTURE_2D); } @@ -2370,9 +2364,7 @@ void SBarGreenManaVial_Drawer(uiwidget_t* obj, int x, int y) patchid_t patchId = pManaBVials[vial->iconIdx].id; DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, iconAlpha); - FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, iconAlpha); - WI_DrawPatch(patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId), X, Y); + GL_DrawPatch(patchId, X, Y); DGL_Disable(DGL_TEXTURE_2D); } @@ -2531,10 +2523,8 @@ void BlueManaIcon_Drawer(uiwidget_t* obj, int x, int y) DGL_Scalef(cfg.hudScale, cfg.hudScale, 1); DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, iconAlpha); - FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, iconAlpha); - WI_DrawPatch(patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId), 0, 0); + GL_DrawPatch(patchId, 0, 0); DGL_Disable(DGL_TEXTURE_2D); DGL_MatrixMode(DGL_MODELVIEW); @@ -2659,10 +2649,8 @@ void GreenManaIcon_Drawer(uiwidget_t* obj, int x, int y) DGL_Scalef(cfg.hudScale, cfg.hudScale, 1); DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, iconAlpha); - FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, iconAlpha); - WI_DrawPatch(patchId, Hu_ChoosePatchReplacement(cfg.usePatchReplacement, patchId), 0, 0); + GL_DrawPatch(patchId, 0, 0); DGL_Disable(DGL_TEXTURE_2D); DGL_MatrixMode(DGL_MODELVIEW);