Compile fixes; enable PK3 support in addons menu

* Add missing vars highlightflags, recommendedflags, warningflags from Kart
* V_GetStringColormap() use vanilla behavior because Kart behavior glitches for us
* V_GetStringColormap() made non-static
This commit is contained in:
mazmazz 2018-12-15 21:44:39 -05:00
parent 37950341ec
commit f0967520ed
7 changed files with 24 additions and 21 deletions

View file

@ -853,11 +853,6 @@ static void IdentifyVersion(void)
#if !defined (HAVE_SDL) || defined (HAVE_MIXER) #if !defined (HAVE_SDL) || defined (HAVE_MIXER)
{ {
#if defined (DC) && 0
const char *musicfile = "music_dc.dta";
#else
const char *musicfile = "music.dta";
#endif
#define MUSICTEST(str) \ #define MUSICTEST(str) \
{\ {\
const char *musicpath = va(pandf,srb2waddir,str);\ const char *musicpath = va(pandf,srb2waddir,str);\
@ -868,7 +863,11 @@ static void IdentifyVersion(void)
I_Error("File "str" has been modified with non-music/sound lumps"); \ I_Error("File "str" has been modified with non-music/sound lumps"); \
} }
#if defined (DC) && 0
MUSICTEST("music_dc.dta")
#else
MUSICTEST("music.dta") MUSICTEST("music.dta")
#endif
} }
#endif #endif
} }

View file

@ -3243,7 +3243,6 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
boolean kick = false; boolean kick = false;
boolean toomany = false; boolean toomany = false;
INT32 i,j; INT32 i,j;
size_t packetsize = 0;
serverinfo_pak *dummycheck = NULL; serverinfo_pak *dummycheck = NULL;
// Shut the compiler up. // Shut the compiler up.

View file

@ -56,7 +56,7 @@ typedef enum
EXT_LOADSTART, EXT_LOADSTART,
EXT_WAD = EXT_LOADSTART, EXT_WAD = EXT_LOADSTART,
EXT_KART, EXT_KART,
//EXT_PK3, EXT_PK3,
EXT_SOC, EXT_SOC,
EXT_LUA, // allowed even if not HAVE_BLUA so that we can yell on load attempt EXT_LUA, // allowed even if not HAVE_BLUA so that we can yell on load attempt
NUM_EXT, NUM_EXT,

View file

@ -1364,6 +1364,7 @@ static menuitem_t OP_ServerOptionsMenu[] =
#ifndef NONET #ifndef NONET
{IT_STRING | IT_CVAR | IT_CV_STRING, {IT_STRING | IT_CVAR | IT_CV_STRING,
NULL, "Server name", &cv_servername, 50}, NULL, "Server name", &cv_servername, 50},
#endif
{IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 80}, {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 80},
{IT_STRING | IT_CVAR, NULL, "Advance to next map", &cv_advancemap, 90}, {IT_STRING | IT_CVAR, NULL, "Advance to next map", &cv_advancemap, 90},
@ -1468,6 +1469,9 @@ menu_t MISC_ChangeTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ChangeTeamMenu, &MPauseD
menu_t MISC_ChangeLevelDef = MAPICONMENUSTYLE(NULL, MISC_ChangeLevelMenu, &MPauseDef); menu_t MISC_ChangeLevelDef = MAPICONMENUSTYLE(NULL, MISC_ChangeLevelMenu, &MPauseDef);
menu_t MISC_HelpDef = IMAGEDEF(MISC_HelpMenu); menu_t MISC_HelpDef = IMAGEDEF(MISC_HelpMenu);
static INT32 highlightflags, recommendedflags, warningflags;
// Sky Room // Sky Room
menu_t SR_PandoraDef = menu_t SR_PandoraDef =
{ {
@ -3925,7 +3929,7 @@ static void M_AddonsOptions(INT32 choice)
} }
#define LOCATIONSTRING1 "Visit \x83SRB2.ORG/MODS\x80 to get & make add-ons!" #define LOCATIONSTRING1 "Visit \x83SRB2.ORG/MODS\x80 to get & make add-ons!"
#define LOCATIONSTRING2 "Visit \x88SRB2.ORG/MODS\x80 to get & make add-ons!" //#define LOCATIONSTRING2 "Visit \x88SRB2.ORG/MODS\x80 to get & make add-ons!"
static void M_Addons(INT32 choice) static void M_Addons(INT32 choice)
{ {
@ -3933,6 +3937,11 @@ static void M_Addons(INT32 choice)
(void)choice; (void)choice;
// If M_GetGameypeColor() is ever ported from Kart, then remove this.
highlightflags = V_YELLOWMAP;
recommendedflags = V_GREENMAP;
warningflags = V_REDMAP;
#if 1 #if 1
if (cv_addons_option.value == 0) if (cv_addons_option.value == 0)
pathname = usehome ? srb2home : srb2path; pathname = usehome ? srb2home : srb2path;
@ -3958,7 +3967,8 @@ static void M_Addons(INT32 choice)
if (!preparefilemenu(false)) if (!preparefilemenu(false))
{ {
M_StartMessage(va("No files/folders found.\n\n%s\n\n(Press a key)\n", (recommendedflags == V_SKYMAP ? LOCATIONSTRING2 : LOCATIONSTRING1)),NULL,MM_NOTHING); M_StartMessage(va("No files/folders found.\n\n%s\n\n(Press a key)\n",LOCATIONSTRING1),NULL,MM_NOTHING);
// (recommendedflags == V_SKYMAP ? LOCATIONSTRING2 : LOCATIONSTRING1))
return; return;
} }
else else
@ -3978,7 +3988,7 @@ static void M_Addons(INT32 choice)
addonsp[EXT_CFG] = W_CachePatchName("M_FCFG", PU_STATIC); addonsp[EXT_CFG] = W_CachePatchName("M_FCFG", PU_STATIC);
addonsp[EXT_WAD] = W_CachePatchName("M_FWAD", PU_STATIC); addonsp[EXT_WAD] = W_CachePatchName("M_FWAD", PU_STATIC);
addonsp[EXT_KART] = W_CachePatchName("M_FKART", PU_STATIC); addonsp[EXT_KART] = W_CachePatchName("M_FKART", PU_STATIC);
//addonsp[EXT_PK3] = W_CachePatchName("M_FPK3", PU_STATIC); addonsp[EXT_PK3] = W_CachePatchName("M_FPK3", PU_STATIC);
addonsp[EXT_SOC] = W_CachePatchName("M_FSOC", PU_STATIC); addonsp[EXT_SOC] = W_CachePatchName("M_FSOC", PU_STATIC);
addonsp[EXT_LUA] = W_CachePatchName("M_FLUA", PU_STATIC); addonsp[EXT_LUA] = W_CachePatchName("M_FLUA", PU_STATIC);
addonsp[NUM_EXT] = W_CachePatchName("M_FUNKN", PU_STATIC); addonsp[NUM_EXT] = W_CachePatchName("M_FUNKN", PU_STATIC);
@ -4131,7 +4141,8 @@ static void M_DrawAddons(void)
if (Playing()) if (Playing())
V_DrawCenteredString(BASEVIDWIDTH/2, 5, warningflags, "Adding files mid-game may cause problems."); V_DrawCenteredString(BASEVIDWIDTH/2, 5, warningflags, "Adding files mid-game may cause problems.");
else else
V_DrawCenteredString(BASEVIDWIDTH/2, 5, 0, (recommendedflags == V_SKYMAP ? LOCATIONSTRING2 : LOCATIONSTRING1)); V_DrawCenteredString(BASEVIDWIDTH/2, 5, 0, LOCATIONSTRING1);
// (recommendedflags == V_SKYMAP ? LOCATIONSTRING2 : LOCATIONSTRING1)
if (numwadfiles <= mainwads+1) if (numwadfiles <= mainwads+1)
y = 0; y = 0;
@ -4424,7 +4435,7 @@ static void M_HandleAddons(INT32 choice)
case EXT_SOC: case EXT_SOC:
case EXT_WAD: case EXT_WAD:
case EXT_KART: case EXT_KART:
//case EXT_PK3: case EXT_PK3:
COM_BufAddText(va("addfile \"%s%s\"", menupath, dirmenu[dir_on[menudepthleft]]+DIR_STRING)); COM_BufAddText(va("addfile \"%s%s\"", menupath, dirmenu[dir_on[menudepthleft]]+DIR_STRING));
break; break;
default: default:

View file

@ -1012,9 +1012,8 @@ void V_DrawFadeConsBack(INT32 plines)
// Gets string colormap, used for 0x80 color codes // Gets string colormap, used for 0x80 color codes
// //
static const UINT8 *V_GetStringColormap(INT32 colorflags) UINT8 *V_GetStringColormap(INT32 colorflags)
{ {
#if 0 // perfect
switch ((colorflags & V_CHARCOLORMASK) >> V_CHARCOLORSHIFT) switch ((colorflags & V_CHARCOLORMASK) >> V_CHARCOLORSHIFT)
{ {
case 1: // 0x81, purple case 1: // 0x81, purple
@ -1034,12 +1033,6 @@ static const UINT8 *V_GetStringColormap(INT32 colorflags)
default: // reset default: // reset
return NULL; return NULL;
} }
#else // optimised
colorflags = ((colorflags & V_CHARCOLORMASK) >> V_CHARCOLORSHIFT);
if (!colorflags || colorflags > 15) // INT32 is signed, but V_CHARCOLORMASK is a very restrictive mask.
return NULL;
return (purplemap+((colorflags-1)<<8));
#endif
} }
// Writes a single character (draw WHITE if bit 7 set) // Writes a single character (draw WHITE if bit 7 set)

View file

@ -150,6 +150,8 @@ void V_DrawFadeConsBack(INT32 plines);
// draw a single character // draw a single character
void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed); void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed);
UINT8 *V_GetStringColormap(INT32 colorflags);
void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string); void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string);
// wordwrap a string using the hu_font // wordwrap a string using the hu_font

View file

@ -649,7 +649,6 @@ UINT16 W_InitFile(const char *filename)
restype_t type; restype_t type;
UINT16 numlumps = 0; UINT16 numlumps = 0;
size_t i; size_t i;
INT32 compressed = 0;
size_t packetsize; size_t packetsize;
UINT8 md5sum[16]; UINT8 md5sum[16];
boolean important; boolean important;