Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e13ba89f1a | ||
|
|
d8b2134aef | ||
|
|
c168832f8e | ||
|
|
448a603a56 | ||
|
|
2a95201c6d | ||
|
|
a73de55f96 | ||
|
|
e4a4496be6 | ||
|
|
a8f3a8dfb0 | ||
|
|
e19b9d1c60 | ||
|
|
e28ec4e7cb | ||
|
|
d0f09b467b |
No files matched your search
+2
-2
@@ -1812,7 +1812,7 @@ void D_SRB2Main(void)
|
|||||||
{
|
{
|
||||||
name = lumpinfo->name;
|
name = lumpinfo->name;
|
||||||
|
|
||||||
if (name[0] == 'M' && name[1] == 'A' && name[2] == 'P') // Ignore the headers
|
if (memcmp(name, "MAP", 3) == 0) // Ignore the headers
|
||||||
{
|
{
|
||||||
INT16 num;
|
INT16 num;
|
||||||
if (name[5] != '\0')
|
if (name[5] != '\0')
|
||||||
@@ -1842,7 +1842,7 @@ void D_SRB2Main(void)
|
|||||||
{
|
{
|
||||||
name = lumpinfo->name;
|
name = lumpinfo->name;
|
||||||
|
|
||||||
if (name[0] == 'M' && name[1] == 'A' && name[2] == 'P') // Ignore the headers
|
if (memcmp(name, "MAP", 3) == 0) // Ignore the headers
|
||||||
{
|
{
|
||||||
INT16 num;
|
INT16 num;
|
||||||
if (name[5] != '\0')
|
if (name[5] != '\0')
|
||||||
|
|||||||
@@ -259,8 +259,6 @@ INT32 HU_FallBackFrSpecialLetter(INT32 key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static char cechotext[1024];
|
static char cechotext[1024];
|
||||||
static tic_t cechotimer = 0;
|
static tic_t cechotimer = 0;
|
||||||
static tic_t cechoduration = 5*TICRATE;
|
static tic_t cechoduration = 5*TICRATE;
|
||||||
|
|||||||
+4
-16
@@ -1260,15 +1260,10 @@ extern int lib_hudadd(lua_State *L);
|
|||||||
|
|
||||||
static int lib_hudsetvotebackground(lua_State *L)
|
static int lib_hudsetvotebackground(lua_State *L)
|
||||||
{
|
{
|
||||||
|
memset(VoteScreen.luaPrefix, 0, sizeof(VoteScreen.luaPrefix));
|
||||||
|
|
||||||
if (lua_isnoneornil(L, 1))
|
if (lua_isnoneornil(L, 1))
|
||||||
{
|
{
|
||||||
if (luaVoteScreen)
|
|
||||||
{
|
|
||||||
free(luaVoteScreen);
|
|
||||||
}
|
|
||||||
|
|
||||||
luaVoteScreen = NULL;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1279,15 +1274,8 @@ static int lib_hudsetvotebackground(lua_State *L)
|
|||||||
return luaL_argerror(L, 1, "prefix should 4 characters wide");
|
return luaL_argerror(L, 1, "prefix should 4 characters wide");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!luaVoteScreen)
|
strncpy(VoteScreen.luaPrefix, prefix, 4);
|
||||||
{
|
strupr(VoteScreen.luaPrefix);
|
||||||
luaVoteScreen = (char*)malloc(5);
|
|
||||||
luaVoteScreen[4] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
strncpy(luaVoteScreen, prefix, 4);
|
|
||||||
|
|
||||||
strupr(luaVoteScreen);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
+140
-108
@@ -67,6 +67,8 @@
|
|||||||
#include "lua_script.h"
|
#include "lua_script.h"
|
||||||
#include "lua_hook.h"
|
#include "lua_hook.h"
|
||||||
|
|
||||||
|
#include "y_inter.h"
|
||||||
|
|
||||||
#if !defined (UNDER_CE)
|
#if !defined (UNDER_CE)
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -3106,11 +3108,128 @@ boolean P_AddWadFile(const char *wadfilename, boolean local)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for replacement votescreen backgrounds
|
static size_t sreplaces = 0, mreplaces = 0, digmreplaces = 0;
|
||||||
boolean wideracereplaced = false;
|
|
||||||
boolean racereplaced = false;
|
//
|
||||||
boolean widebattlereplaced = false;
|
// search for sound replacements
|
||||||
boolean battlereplaced = false;
|
//
|
||||||
|
static boolean P_CheckSoundReplacements(UINT16 wadnum, char *name, size_t i)
|
||||||
|
{
|
||||||
|
size_t j;
|
||||||
|
lumpnum_t lumpnum = (i|(wadnum<<16));
|
||||||
|
|
||||||
|
if (name[0] == 'D')
|
||||||
|
{
|
||||||
|
if (name[1] == 'S')
|
||||||
|
{
|
||||||
|
for (j = 1; j < NUMSFX; j++)
|
||||||
|
{
|
||||||
|
if (S_sfx[j].name && !strnicmp(S_sfx[j].name, name + 2, 6)
|
||||||
|
&& (S_sfx[j].lumpnum != lumpnum) && (S_sfx[j].lumpnum != LUMPERROR))
|
||||||
|
{
|
||||||
|
// the sound will be reloaded when needed,
|
||||||
|
// since sfx->data will be NULL
|
||||||
|
CONS_Debug(DBG_SETUP, "Sound %.8s replaced\n", name);
|
||||||
|
|
||||||
|
I_FreeSfx(&S_sfx[j]);
|
||||||
|
|
||||||
|
// Re-cache it
|
||||||
|
if (S_PrecacheSound())
|
||||||
|
S_sfx[j].data = I_GetSfx(&S_sfx[j]);
|
||||||
|
|
||||||
|
sreplaces++;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (name[1] == '_')
|
||||||
|
{
|
||||||
|
CONS_Debug(DBG_SETUP, "Music %.8s ignored\n", name);
|
||||||
|
mreplaces++;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (name[0] == 'O' && name[1] == '_')
|
||||||
|
{
|
||||||
|
CONS_Debug(DBG_SETUP, "Music %.8s replaced\n", name);
|
||||||
|
digmreplaces++;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// search for maps
|
||||||
|
//
|
||||||
|
static boolean P_CheckMapReplacements(char *name)
|
||||||
|
{
|
||||||
|
if (memcmp(name, "MAP", 3) == 0) // Ignore the headers
|
||||||
|
{
|
||||||
|
INT16 num;
|
||||||
|
|
||||||
|
if (name[5] != '\0')
|
||||||
|
return false;
|
||||||
|
|
||||||
|
num = (INT16)M_MapNumber(name[3], name[4]);
|
||||||
|
|
||||||
|
// we want to record whether this map exists. if it doesn't have a header, we can assume it's not relephant
|
||||||
|
if (num <= NUMMAPS && mapheaderinfo[num-1])
|
||||||
|
{
|
||||||
|
if (mapheaderinfo[num-1]->menuflags & LF2_EXISTSHACK)
|
||||||
|
G_SetGameModified(multiplayer, true); // oops, double-defined - no record attack privileges for you
|
||||||
|
mapheaderinfo[num-1]->menuflags |= LF2_EXISTSHACK;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (num == gamemap)
|
||||||
|
partadd_replacescurrentmap = true;
|
||||||
|
|
||||||
|
CONS_Printf("%s\n", name);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// check for non Lua votescreen replacements
|
||||||
|
//
|
||||||
|
static boolean P_CheckVoteReplacements(char *name)
|
||||||
|
{
|
||||||
|
// widescreen patch Race
|
||||||
|
if (!VoteScreen.replaced.widerace && !memcmp(name, "INTERSCW", 8))
|
||||||
|
{
|
||||||
|
VoteScreen.replaced.widerace = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!VoteScreen.replaced.race && !memcmp(name, "INTERSCR", 8))
|
||||||
|
{
|
||||||
|
VoteScreen.replaced.race = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// widescreen patch Battle
|
||||||
|
if (!VoteScreen.replaced.widebattle && !memcmp(name, "BATTLSCW", 8))
|
||||||
|
{
|
||||||
|
VoteScreen.replaced.widebattle = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!VoteScreen.replaced.battle && !memcmp(name, "BATTLSCR", 8))
|
||||||
|
{
|
||||||
|
VoteScreen.replaced.battle = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (VoteScreen.replaced.widerace && VoteScreen.replaced.race
|
||||||
|
&& VoteScreen.replaced.widebattle && VoteScreen.replaced.battle)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add a WAD file and do the per-WAD setup stages.
|
// Add a WAD file and do the per-WAD setup stages.
|
||||||
@@ -3118,12 +3237,15 @@ boolean battlereplaced = false;
|
|||||||
//
|
//
|
||||||
UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
||||||
{
|
{
|
||||||
size_t i, j, sreplaces = 0, mreplaces = 0, digmreplaces = 0;
|
size_t i;
|
||||||
UINT16 numlumps, wadnum;
|
UINT16 numlumps, wadnum;
|
||||||
char *name;
|
char *name;
|
||||||
boolean mapsadded = false;
|
boolean mapsadded = false;
|
||||||
|
static boolean allvotereplaced = false;
|
||||||
lumpinfo_t *lumpinfo;
|
lumpinfo_t *lumpinfo;
|
||||||
|
|
||||||
|
sreplaces = mreplaces = digmreplaces = 0;
|
||||||
|
|
||||||
if ((numlumps = W_InitFile(wadfilename, local)) == INT16_MAX)
|
if ((numlumps = W_InitFile(wadfilename, local)) == INT16_MAX)
|
||||||
{
|
{
|
||||||
refreshdirmenu |= REFRESHDIR_NOTLOADED;
|
refreshdirmenu |= REFRESHDIR_NOTLOADED;
|
||||||
@@ -3138,46 +3260,24 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
|||||||
|
|
||||||
wadfiles[wadnum]->localfile = local;
|
wadfiles[wadnum]->localfile = local;
|
||||||
|
|
||||||
//
|
|
||||||
// search for sound replacements
|
|
||||||
//
|
|
||||||
lumpinfo = wadfiles[wadnum]->lumpinfo;
|
lumpinfo = wadfiles[wadnum]->lumpinfo;
|
||||||
for (i = 0; i < numlumps; i++, lumpinfo++)
|
for (i = 0; i < numlumps; i++, lumpinfo++)
|
||||||
{
|
{
|
||||||
name = lumpinfo->name;
|
name = lumpinfo->name;
|
||||||
lumpnum_t lumpnum = i|(wadnum<<16);
|
|
||||||
|
|
||||||
if (name[0] == 'D')
|
if (P_CheckSoundReplacements(wadnum, name, i))
|
||||||
{
|
continue;
|
||||||
if (name[1] == 'S') for (j = 1; j < NUMSFX; j++)
|
|
||||||
{
|
|
||||||
if (S_sfx[j].name && !strnicmp(S_sfx[j].name, name + 2, 6) && S_sfx[j].lumpnum != lumpnum && S_sfx[j].lumpnum != LUMPERROR)
|
|
||||||
{
|
|
||||||
// the sound will be reloaded when needed,
|
|
||||||
// since sfx->data will be NULL
|
|
||||||
CONS_Debug(DBG_SETUP, "Sound %.8s replaced\n", name);
|
|
||||||
|
|
||||||
I_FreeSfx(&S_sfx[j]);
|
if (P_CheckMapReplacements(name))
|
||||||
|
|
||||||
// Re-cache it
|
|
||||||
if (S_PrecacheSound())
|
|
||||||
S_sfx[j].data = I_GetSfx(&S_sfx[j]);
|
|
||||||
|
|
||||||
sreplaces++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (name[1] == '_')
|
|
||||||
{
|
{
|
||||||
CONS_Debug(DBG_SETUP, "Music %.8s ignored\n", name);
|
mapsadded = true;
|
||||||
mreplaces++;
|
continue;
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (name[0] == 'O' && name[1] == '_')
|
|
||||||
{
|
|
||||||
CONS_Debug(DBG_SETUP, "Music %.8s replaced\n", name);
|
|
||||||
digmreplaces++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!allvotereplaced && P_CheckVoteReplacements(name))
|
||||||
|
allvotereplaced = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!devparm && sreplaces)
|
if (!devparm && sreplaces)
|
||||||
CONS_Printf(M_GetText("%s sounds replaced\n"), sizeu1(sreplaces));
|
CONS_Printf(M_GetText("%s sounds replaced\n"), sizeu1(sreplaces));
|
||||||
if (!devparm && mreplaces)
|
if (!devparm && mreplaces)
|
||||||
@@ -3185,6 +3285,9 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
|||||||
if (!devparm && digmreplaces)
|
if (!devparm && digmreplaces)
|
||||||
CONS_Printf(M_GetText("%s digital musics replaced\n"), sizeu1(digmreplaces));
|
CONS_Printf(M_GetText("%s digital musics replaced\n"), sizeu1(digmreplaces));
|
||||||
|
|
||||||
|
if (!mapsadded)
|
||||||
|
CONS_Printf(M_GetText("No maps added\n"));
|
||||||
|
|
||||||
//
|
//
|
||||||
// search for sprite replacements
|
// search for sprite replacements
|
||||||
//
|
//
|
||||||
@@ -3209,80 +3312,9 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
|||||||
//
|
//
|
||||||
S_LoadMusicDefs(wadnum);
|
S_LoadMusicDefs(wadnum);
|
||||||
|
|
||||||
//
|
|
||||||
// search for maps
|
|
||||||
//
|
|
||||||
lumpinfo = wadfiles[wadnum]->lumpinfo;
|
|
||||||
for (i = 0; i < numlumps; i++, lumpinfo++)
|
|
||||||
{
|
|
||||||
name = lumpinfo->name;
|
|
||||||
|
|
||||||
if (name[0] == 'M' && name[1] == 'A' && name[2] == 'P') // Ignore the headers
|
|
||||||
{
|
|
||||||
INT16 num;
|
|
||||||
if (name[5]!='\0')
|
|
||||||
continue;
|
|
||||||
num = (INT16)M_MapNumber(name[3], name[4]);
|
|
||||||
|
|
||||||
// we want to record whether this map exists. if it doesn't have a header, we can assume it's not relephant
|
|
||||||
if (num <= NUMMAPS && mapheaderinfo[num-1])
|
|
||||||
{
|
|
||||||
if (mapheaderinfo[num-1]->menuflags & LF2_EXISTSHACK)
|
|
||||||
G_SetGameModified(multiplayer, true); // oops, double-defined - no record attack privileges for you
|
|
||||||
mapheaderinfo[num-1]->menuflags |= LF2_EXISTSHACK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (num == gamemap)
|
|
||||||
partadd_replacescurrentmap = true;
|
|
||||||
|
|
||||||
CONS_Printf("%s\n", name);
|
|
||||||
mapsadded = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!mapsadded)
|
|
||||||
CONS_Printf(M_GetText("No maps added\n"));
|
|
||||||
|
|
||||||
// TODO: Experimental SPRTINFO support, test first
|
// TODO: Experimental SPRTINFO support, test first
|
||||||
R_LoadSpriteInfoLumps(wadnum, wadfiles[wadnum]->numlumps);
|
R_LoadSpriteInfoLumps(wadnum, wadfiles[wadnum]->numlumps);
|
||||||
|
|
||||||
//
|
|
||||||
// check for votescreen replacements
|
|
||||||
//
|
|
||||||
if (!wideracereplaced && !racereplaced && !widebattlereplaced && !battlereplaced)
|
|
||||||
{
|
|
||||||
lumpinfo = wadfiles[wadnum]->lumpinfo;
|
|
||||||
for (i = 0; i < numlumps; i++, lumpinfo++)
|
|
||||||
{
|
|
||||||
name = lumpinfo->name;
|
|
||||||
|
|
||||||
// widescreen patch Race
|
|
||||||
if (!wideracereplaced && !strncmp(name, "INTERSCW", 8))
|
|
||||||
{
|
|
||||||
wideracereplaced = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!racereplaced && !strncmp(name, "INTERSCR", 8))
|
|
||||||
{
|
|
||||||
racereplaced = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// widescreen patch Battle
|
|
||||||
if (!widebattlereplaced && !strncmp(name, "BATTLSCW", 8))
|
|
||||||
{
|
|
||||||
widebattlereplaced = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!battlereplaced && !strncmp(name, "BATTLSCR", 8))
|
|
||||||
{
|
|
||||||
battlereplaced = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
refreshdirmenu &= ~REFRESHDIR_GAMEDATA; // Under usual circumstances we'd wait for REFRESHDIR_GAMEDATA to disappear the next frame, but it's a bit too dangerous for that...
|
refreshdirmenu &= ~REFRESHDIR_GAMEDATA; // Under usual circumstances we'd wait for REFRESHDIR_GAMEDATA to disappear the next frame, but it's a bit too dangerous for that...
|
||||||
partadd_stage = 0;
|
partadd_stage = 0;
|
||||||
return wadnum;
|
return wadnum;
|
||||||
|
|||||||
@@ -68,11 +68,6 @@ void HWR_LoadLevel(boolean reloadinggamestate);
|
|||||||
|
|
||||||
boolean P_AddWadFile(const char *wadfilename, boolean local);
|
boolean P_AddWadFile(const char *wadfilename, boolean local);
|
||||||
|
|
||||||
extern boolean wideracereplaced;
|
|
||||||
extern boolean racereplaced;
|
|
||||||
extern boolean widebattlereplaced;
|
|
||||||
extern boolean battlereplaced;
|
|
||||||
|
|
||||||
// WARNING: The following functions should be grouped as follows:
|
// WARNING: The following functions should be grouped as follows:
|
||||||
// any amount of PartialAdds followed by MultiSetups until returned true,
|
// any amount of PartialAdds followed by MultiSetups until returned true,
|
||||||
// as soon as possible.
|
// as soon as possible.
|
||||||
|
|||||||
+145
-133
@@ -57,30 +57,15 @@ typedef struct
|
|||||||
|
|
||||||
static y_data_t data;
|
static y_data_t data;
|
||||||
|
|
||||||
|
|
||||||
// graphics
|
// graphics
|
||||||
static patch_t *bgpatch = NULL; // INTERSCR
|
|
||||||
static patch_t *widebgpatch = NULL; // INTERSCW
|
|
||||||
static patch_t *bgtile = NULL; // SPECTILE/SRB2BACK
|
static patch_t *bgtile = NULL; // SPECTILE/SRB2BACK
|
||||||
|
|
||||||
static INT32 timer;
|
static INT32 timer;
|
||||||
|
|
||||||
static INT32 intertic;
|
static INT32 intertic;
|
||||||
static INT32 endtic = -1;
|
static INT32 endtic = -1;
|
||||||
static INT32 sorttic = -1;
|
static INT32 sorttic = -1;
|
||||||
|
|
||||||
patch_t *animVoteFramesPatches = NULL;
|
|
||||||
// VEXTRN - Vote (V) Extra (EXT) Race (R) Normal (N - Normal sized patch)
|
|
||||||
// VEXTBN - Vote (V) Extra (EXT) Battle (B) Normal (N - Normal sized patch)
|
|
||||||
// VEXTBW - Vote (V) Extra (EXT) Battle (B) Normal (W - Wide patch used in software)
|
|
||||||
// VEXTRW - Vote (V) Extra (EXT) Race (R) Normal (W - Wide patch used in software)
|
|
||||||
char animPrefix[] = "INTSC";
|
|
||||||
char animWidePrefix[] = "INTSW";
|
|
||||||
char *luaVoteScreen = NULL;
|
|
||||||
|
|
||||||
INT32 currentAnimFrame = 0;
|
|
||||||
static INT32 foundAnimVoteFrames = 0;
|
|
||||||
static INT32 foundAnimVoteWideFrames = 0;
|
|
||||||
|
|
||||||
intertype_t intertype = int_none;
|
intertype_t intertype = int_none;
|
||||||
|
|
||||||
static huddrawlist_h luahuddrawlist_intermission = NULL;
|
static huddrawlist_h luahuddrawlist_intermission = NULL;
|
||||||
@@ -118,17 +103,13 @@ typedef struct
|
|||||||
boolean loaded;
|
boolean loaded;
|
||||||
} y_voteclient;
|
} y_voteclient;
|
||||||
|
|
||||||
|
// votescreen stuff
|
||||||
|
votescreen_t VoteScreen = {0};
|
||||||
|
|
||||||
static y_votelvlinfo levelinfo[5];
|
static y_votelvlinfo levelinfo[5];
|
||||||
static y_voteclient voteclient;
|
static y_voteclient voteclient;
|
||||||
static INT32 votetic;
|
static INT32 votetic;
|
||||||
static INT32 voteendtic = -1;
|
static INT32 voteendtic = -1;
|
||||||
static patch_t *cursor = NULL;
|
|
||||||
static patch_t *cursor1 = NULL;
|
|
||||||
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);
|
static void Y_UnloadVoteData(void);
|
||||||
|
|
||||||
@@ -287,49 +268,6 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Y_AnimatedVoteScreenCheck
|
|
||||||
//
|
|
||||||
// Check if the lumps exist (checking for VEXTR(N|W)xx for race and VEXTRB(N|W)xx for battle)
|
|
||||||
static void Y_AnimatedVoteScreenCheck(void)
|
|
||||||
{
|
|
||||||
char tmpPrefix[] = "INTS";
|
|
||||||
|
|
||||||
if (luaVoteScreen)
|
|
||||||
strncpy(tmpPrefix, luaVoteScreen, 4);
|
|
||||||
else if (G_BattleGametype())
|
|
||||||
strcpy(tmpPrefix, "BTLS");
|
|
||||||
|
|
||||||
strncpy(animPrefix, tmpPrefix, 4);
|
|
||||||
animPrefix[4] = 'C';
|
|
||||||
strncpy(animWidePrefix, tmpPrefix, 4);
|
|
||||||
animWidePrefix[4] = 'W';
|
|
||||||
|
|
||||||
foundAnimVoteFrames = foundAnimVoteWideFrames = 0;
|
|
||||||
currentAnimFrame = 0;
|
|
||||||
|
|
||||||
INT32 i = 1;
|
|
||||||
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
boolean normalLumpExists = W_LumpExists(va("%sC%d", tmpPrefix, i));
|
|
||||||
boolean wideLumpExists = W_LumpExists(va("%sW%d", tmpPrefix, i));
|
|
||||||
|
|
||||||
if (normalLumpExists || wideLumpExists)
|
|
||||||
{
|
|
||||||
if (normalLumpExists)
|
|
||||||
foundAnimVoteFrames++;
|
|
||||||
|
|
||||||
if (wideLumpExists)
|
|
||||||
foundAnimVoteWideFrames++;
|
|
||||||
}
|
|
||||||
else // If we don't find at least frame 1 (e.g VEXTRN1), let's just stop looking
|
|
||||||
break;
|
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Y_PlayerStandingsDrawer
|
// Y_PlayerStandingsDrawer
|
||||||
//
|
//
|
||||||
// Handles drawing the center-of-screen player standings.
|
// Handles drawing the center-of-screen player standings.
|
||||||
@@ -863,6 +801,7 @@ void Y_StartIntermission(void)
|
|||||||
//
|
//
|
||||||
void Y_EndIntermission(void)
|
void Y_EndIntermission(void)
|
||||||
{
|
{
|
||||||
|
if (!dedicated)
|
||||||
Y_UnloadData();
|
Y_UnloadData();
|
||||||
|
|
||||||
endtic = -1;
|
endtic = -1;
|
||||||
@@ -881,28 +820,72 @@ static void Y_FollowIntermission(void)
|
|||||||
G_AfterIntermission();
|
G_AfterIntermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define UNLOAD(x) if (x) {Patch_Free(x);} x = NULL;
|
#define UNLOAD(x) {if ((x) != NULL) {Patch_Free(x);} x = NULL;}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Y_UnloadData
|
// Y_UnloadData
|
||||||
//
|
//
|
||||||
static void Y_UnloadData(void)
|
static void Y_UnloadData(void)
|
||||||
{
|
{
|
||||||
// In hardware mode, don't Z_ChangeTag a pointer returned by W_CachePatchName().
|
|
||||||
// It doesn't work and is unnecessary.
|
|
||||||
if (rendermode != render_soft)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// unload the background patches
|
// unload the background patches
|
||||||
UNLOAD(bgpatch);
|
UNLOAD(VoteScreen.bgpatch);
|
||||||
UNLOAD(widebgpatch);
|
UNLOAD(VoteScreen.widebgpatch);
|
||||||
UNLOAD(bgtile);
|
UNLOAD(bgtile);
|
||||||
//UNLOAD(interpic);
|
//UNLOAD(interpic);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SRB2Kart: Voting!
|
// SRB2Kart: Voting!
|
||||||
|
|
||||||
static void Y_DrawVoteBackground(patch_t *patch)
|
//
|
||||||
|
// Y_VoteScreenCheck
|
||||||
|
//
|
||||||
|
static void Y_VoteScreenCheck(void)
|
||||||
|
{
|
||||||
|
strcpy(VoteScreen.Prefix, "INTS");
|
||||||
|
|
||||||
|
if (VoteScreen.luaPrefix[0] != 0)
|
||||||
|
strlcpy(VoteScreen.Prefix, VoteScreen.luaPrefix, sizeof(VoteScreen.Prefix));
|
||||||
|
else if (G_BattleGametype())
|
||||||
|
strcpy(VoteScreen.Prefix, "BTLS");
|
||||||
|
|
||||||
|
VoteScreen.foundLuaVoteFrames = VoteScreen.foundLuaVoteWideFrames = 0;
|
||||||
|
VoteScreen.currentAnimFrame = 0;
|
||||||
|
|
||||||
|
INT32 i = 1;
|
||||||
|
|
||||||
|
// check for lua vote background replacements
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
// Check if the lumps exist (checking for VEXTR(N|W)xx for race and VEXTRB(N|W)xx for battle)
|
||||||
|
boolean normalLumpExists = W_LumpExists(va("%sC%d", VoteScreen.Prefix, i));
|
||||||
|
boolean wideLumpExists = W_LumpExists(va("%sW%d", VoteScreen.Prefix, i));
|
||||||
|
|
||||||
|
if (normalLumpExists || wideLumpExists)
|
||||||
|
{
|
||||||
|
if (normalLumpExists)
|
||||||
|
VoteScreen.foundLuaVoteFrames++;
|
||||||
|
|
||||||
|
if (wideLumpExists)
|
||||||
|
VoteScreen.foundLuaVoteWideFrames++;
|
||||||
|
}
|
||||||
|
else // If we don't find at least frame 1 (e.g VEXTRN1), let's just stop looking
|
||||||
|
break;
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// non lua vote background handling
|
||||||
|
boolean prefbattletype = ((votelevels[0][1] & ~0x80) == GT_MATCH);
|
||||||
|
VoteScreen.widebgpatch = W_CachePatchName((prefbattletype ? "BATTLSCW" : "INTERSCW"), PU_PATCH);
|
||||||
|
VoteScreen.bgpatch = W_CachePatchName((prefbattletype ? "BATTLSCR" : "INTERSCR"), PU_PATCH);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Y_VoteBackgroundDrawer
|
||||||
|
//
|
||||||
|
// Determines which patch drawer to use for scaling
|
||||||
|
//
|
||||||
|
static void Y_VoteBackgroundDrawer(patch_t *patch)
|
||||||
{
|
{
|
||||||
switch (cv_votebgscaling.value)
|
switch (cv_votebgscaling.value)
|
||||||
{
|
{
|
||||||
@@ -924,57 +907,74 @@ static void Y_DrawVoteBackground(patch_t *patch)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Y_DrawAnimatedVoteScreenPatch
|
|
||||||
//
|
//
|
||||||
// Draw animated patch based on frame counter on vote screen
|
// Y_DrawLuaVoteScreenPatch
|
||||||
//
|
//
|
||||||
static void Y_DrawAnimatedVoteScreenPatch(boolean widePatch)
|
// Handles votebackgrounds set by "setVoteBackground"
|
||||||
|
// Aswell as animated patches
|
||||||
|
//
|
||||||
|
static void Y_DrawLuaVoteScreenPatch(boolean widePatch)
|
||||||
{
|
{
|
||||||
INT32 nextframe = 0;
|
INT32 nextframe = 0;
|
||||||
patch_t *votebg = NULL;
|
patch_t *votebg = NULL;
|
||||||
char tempAnimPrefix[7];
|
char tempPrefix[6];
|
||||||
const INT32 tempFoundAnimVoteFrames = ((widePatch ? foundAnimVoteWideFrames : foundAnimVoteFrames) - 1);
|
const INT32 tempfoundAnimLuaVoteFrames = ((widePatch ? VoteScreen.foundLuaVoteWideFrames : VoteScreen.foundLuaVoteFrames) - 1);
|
||||||
|
|
||||||
strcpy(tempAnimPrefix, (widePatch ? animWidePrefix : animPrefix));
|
strcpy(tempPrefix, va("%s%s", VoteScreen.Prefix, (widePatch ? "W" : "C")));
|
||||||
|
|
||||||
// Just in case someone provides LESS widescreen frames than normal frames or vice versa, reset the frame counter to 0
|
// Draw non animated patch
|
||||||
if (currentAnimFrame > tempFoundAnimVoteFrames)
|
if (!tempfoundAnimLuaVoteFrames)
|
||||||
currentAnimFrame = 0;
|
{
|
||||||
|
votebg = W_CachePatchName(va("%s1", tempPrefix), PU_PATCH);
|
||||||
nextframe = (currentAnimFrame + 1);
|
Y_VoteBackgroundDrawer(votebg);
|
||||||
|
return;
|
||||||
votebg = W_CachePatchName(va("%s%d", (widePatch ? animWidePrefix : animPrefix), nextframe), PU_PATCH);
|
|
||||||
|
|
||||||
Y_DrawVoteBackground(votebg);
|
|
||||||
|
|
||||||
if (renderisnewtic && (votetic % 2 == 0) && !paused)
|
|
||||||
currentAnimFrame = (nextframe > tempFoundAnimVoteFrames) ? 0 : nextframe;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Draw animated patch based on frame counter on vote screen
|
||||||
|
|
||||||
|
// Just in case someone provides LESS widescreen frames than normal frames or vice versa, reset the frame counter to 0
|
||||||
|
if (VoteScreen.currentAnimFrame > tempfoundAnimLuaVoteFrames)
|
||||||
|
VoteScreen.currentAnimFrame = 0;
|
||||||
|
|
||||||
|
nextframe = (VoteScreen.currentAnimFrame + 1);
|
||||||
|
|
||||||
|
votebg = W_CachePatchName(va("%s%d", tempPrefix, nextframe), PU_PATCH);
|
||||||
|
|
||||||
|
Y_VoteBackgroundDrawer(votebg);
|
||||||
|
|
||||||
|
if (renderisnewtic && (votetic % 2 == 0) && !paused)
|
||||||
|
VoteScreen.currentAnimFrame = (nextframe > tempfoundAnimLuaVoteFrames) ? 0 : nextframe;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Y_DrawVoteScreenPatch
|
||||||
|
//
|
||||||
static void Y_DrawVoteScreenPatch(void)
|
static void Y_DrawVoteScreenPatch(void)
|
||||||
{
|
{
|
||||||
patch_t *votebg = NULL;
|
patch_t *votebg = NULL;
|
||||||
const boolean widescreen = (vid.width / vid.dupx > 320);
|
const boolean widescreen = (vid.width / vid.dupx > 320);
|
||||||
|
|
||||||
if (foundAnimVoteWideFrames || foundAnimVoteFrames)
|
if (VoteScreen.foundLuaVoteWideFrames || VoteScreen.foundLuaVoteFrames)
|
||||||
{
|
{
|
||||||
Y_DrawAnimatedVoteScreenPatch((foundAnimVoteWideFrames && widescreen));
|
Y_DrawLuaVoteScreenPatch(((widescreen && VoteScreen.foundLuaVoteWideFrames) || !VoteScreen.foundLuaVoteFrames));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
votebg = bgpatch; // non widescreen patch
|
// non widescreen patch
|
||||||
|
votebg = VoteScreen.bgpatch;
|
||||||
|
|
||||||
UINT8 prefgametype = (votelevels[0][1] & ~0x80);
|
UINT8 prefgametype = (votelevels[0][1] & ~0x80);
|
||||||
const boolean widebgreplaced = (prefgametype == GT_MATCH) ? widebattlereplaced : wideracereplaced;
|
const boolean widebgreplaced = (prefgametype == GT_MATCH) ? VoteScreen.replaced.widebattle : VoteScreen.replaced.widerace;
|
||||||
const boolean bgreplaced = (prefgametype == GT_MATCH) ? battlereplaced : racereplaced;
|
const boolean bgreplaced = (prefgametype == GT_MATCH) ? VoteScreen.replaced.battle : VoteScreen.replaced.race;
|
||||||
|
|
||||||
|
// we check a bunch of stuff to always have a "valid" fallback
|
||||||
if ((widescreen && (widebgreplaced || !bgreplaced))
|
if ((widescreen && (widebgreplaced || !bgreplaced))
|
||||||
|| (!widescreen && (widebgreplaced && !bgreplaced)))
|
|| (!widescreen && (widebgreplaced && !bgreplaced)))
|
||||||
{
|
{
|
||||||
votebg = widebgpatch;
|
votebg = VoteScreen.widebgpatch; // widescreen patch
|
||||||
}
|
}
|
||||||
|
|
||||||
Y_DrawVoteBackground(votebg);
|
Y_VoteBackgroundDrawer(votebg);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1037,7 +1037,7 @@ void Y_VoteDrawer(void)
|
|||||||
if (i == 3)
|
if (i == 3)
|
||||||
{
|
{
|
||||||
str = "RANDOM";
|
str = "RANDOM";
|
||||||
pic = randomlvl;
|
pic = VoteScreen.randomlvl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1061,7 +1061,7 @@ void Y_VoteDrawer(void)
|
|||||||
|
|
||||||
if (!splitscreen)
|
if (!splitscreen)
|
||||||
{
|
{
|
||||||
thiscurs = cursor;
|
thiscurs = VoteScreen.cursor[0];
|
||||||
p = consoleplayer;
|
p = consoleplayer;
|
||||||
color = levelinfo[i].gtc;
|
color = levelinfo[i].gtc;
|
||||||
colormap = NULL;
|
colormap = NULL;
|
||||||
@@ -1071,19 +1071,19 @@ void Y_VoteDrawer(void)
|
|||||||
switch (j)
|
switch (j)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
thiscurs = cursor2;
|
thiscurs = VoteScreen.cursor[2];
|
||||||
p = displayplayers[1];
|
p = displayplayers[1];
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
thiscurs = cursor3;
|
thiscurs = VoteScreen.cursor[3];
|
||||||
p = displayplayers[2];
|
p = displayplayers[2];
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
thiscurs = cursor4;
|
thiscurs = VoteScreen.cursor[4];
|
||||||
p = displayplayers[3];
|
p = displayplayers[3];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
thiscurs = cursor1;
|
thiscurs = VoteScreen.cursor[1];
|
||||||
p = displayplayers[0];
|
p = displayplayers[0];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1111,7 +1111,7 @@ void Y_VoteDrawer(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
V_DrawFixedPatch((BASEVIDWIDTH-20)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/2, V_FLIP|V_SNAPTORIGHT, pic, 0);
|
V_DrawFixedPatch((BASEVIDWIDTH-20)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/2, V_FLIP|V_SNAPTORIGHT, pic, 0);
|
||||||
V_DrawFixedPatch((BASEVIDWIDTH-60)<<FRACBITS, ((y+25)<<FRACBITS) - (rubyheight<<1), FRACUNIT, V_SNAPTORIGHT, rubyicon, NULL);
|
V_DrawFixedPatch((BASEVIDWIDTH-60)<<FRACBITS, ((y+25)<<FRACBITS) - (rubyheight<<1), FRACUNIT, V_SNAPTORIGHT, VoteScreen.rubyicon, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
V_DrawRightAlignedThinString(BASEVIDWIDTH-21, 40+y, V_SNAPTORIGHT|V_6WIDTHSPACE, str);
|
V_DrawRightAlignedThinString(BASEVIDWIDTH-21, 40+y, V_SNAPTORIGHT|V_6WIDTHSPACE, str);
|
||||||
@@ -1135,7 +1135,7 @@ void Y_VoteDrawer(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
V_DrawFixedPatch((BASEVIDWIDTH-20)<<FRACBITS, y<<FRACBITS, FRACUNIT/4, V_FLIP|V_SNAPTORIGHT, pic, 0);
|
V_DrawFixedPatch((BASEVIDWIDTH-20)<<FRACBITS, y<<FRACBITS, FRACUNIT/4, V_FLIP|V_SNAPTORIGHT, pic, 0);
|
||||||
V_DrawFixedPatch((BASEVIDWIDTH-40)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTORIGHT, rubyicon, NULL);
|
V_DrawFixedPatch((BASEVIDWIDTH-40)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTORIGHT, VoteScreen.rubyicon, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (levelinfo[i].gts)
|
if (levelinfo[i].gts)
|
||||||
@@ -1164,13 +1164,13 @@ void Y_VoteDrawer(void)
|
|||||||
patch_t *pic;
|
patch_t *pic;
|
||||||
|
|
||||||
if (votes[i] >= 3 && (i != pickedvote || voteendtic == -1))
|
if (votes[i] >= 3 && (i != pickedvote || voteendtic == -1))
|
||||||
pic = randomlvl;
|
pic = VoteScreen.randomlvl;
|
||||||
else
|
else
|
||||||
pic = levelinfo[votes[i]].pic;
|
pic = levelinfo[votes[i]].pic;
|
||||||
|
|
||||||
if (!timer && i == voteclient.ranim)
|
if (!timer && i == voteclient.ranim)
|
||||||
{
|
{
|
||||||
V_DrawScaledPatch(x-18, y+9, V_SNAPTOLEFT, cursor);
|
V_DrawScaledPatch(x-18, y+9, V_SNAPTOLEFT, VoteScreen.cursor[0]);
|
||||||
if (voteendtic != -1 && !(votetic % 4))
|
if (voteendtic != -1 && !(votetic % 4))
|
||||||
V_DrawFill(x-1, y-1, 42, 27, 120|V_SNAPTOLEFT);
|
V_DrawFill(x-1, y-1, 42, 27, 120|V_SNAPTOLEFT);
|
||||||
else
|
else
|
||||||
@@ -1182,7 +1182,7 @@ void Y_VoteDrawer(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
V_DrawFixedPatch((x+40)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/4, V_SNAPTOLEFT|V_FLIP, pic, 0);
|
V_DrawFixedPatch((x+40)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/4, V_SNAPTOLEFT|V_FLIP, pic, 0);
|
||||||
V_DrawFixedPatch((x+20)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTOLEFT, rubyicon, NULL);
|
V_DrawFixedPatch((x+20)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTOLEFT, VoteScreen.rubyicon, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (levelinfo[votes[i]].gts)
|
if (levelinfo[votes[i]].gts)
|
||||||
@@ -1471,10 +1471,28 @@ void Y_VoteTicker(void)
|
|||||||
//
|
//
|
||||||
// MK online style voting screen, appears after intermission
|
// MK online style voting screen, appears after intermission
|
||||||
//
|
//
|
||||||
|
|
||||||
|
static void Y_InitVoteDrawing(void)
|
||||||
|
{
|
||||||
|
if (dedicated)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// setup the background patches
|
||||||
|
Y_VoteScreenCheck();
|
||||||
|
|
||||||
|
VoteScreen.cursor[0] = W_CachePatchName("M_CURSOR", PU_PATCH);
|
||||||
|
VoteScreen.cursor[1] = W_CachePatchName("P1CURSOR", PU_PATCH);
|
||||||
|
VoteScreen.cursor[2] = W_CachePatchName("P2CURSOR", PU_PATCH);
|
||||||
|
VoteScreen.cursor[3] = W_CachePatchName("P3CURSOR", PU_PATCH);
|
||||||
|
VoteScreen.cursor[4] = W_CachePatchName("P4CURSOR", PU_PATCH);
|
||||||
|
|
||||||
|
VoteScreen.randomlvl = W_CachePatchName("RANDOMLV", PU_PATCH);
|
||||||
|
VoteScreen.rubyicon = W_CachePatchName("RUBYICON", PU_PATCH);
|
||||||
|
}
|
||||||
|
|
||||||
void Y_StartVote(void)
|
void Y_StartVote(void)
|
||||||
{
|
{
|
||||||
INT32 i = 0;
|
INT32 i = 0;
|
||||||
UINT8 prefgametype = (votelevels[0][1] & ~0x80);
|
|
||||||
|
|
||||||
votetic = -1;
|
votetic = -1;
|
||||||
|
|
||||||
@@ -1483,17 +1501,8 @@ void Y_StartVote(void)
|
|||||||
I_Error("voteendtic is dirty");
|
I_Error("voteendtic is dirty");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Y_AnimatedVoteScreenCheck();
|
// cache vote patches
|
||||||
|
Y_InitVoteDrawing();
|
||||||
widebgpatch = W_CachePatchName(((prefgametype == GT_MATCH) ? "BATTLSCW" : "INTERSCW"), PU_PATCH);
|
|
||||||
bgpatch = W_CachePatchName(((prefgametype == GT_MATCH) ? "BATTLSCR" : "INTERSCR"), PU_PATCH);
|
|
||||||
cursor = W_CachePatchName("M_CURSOR", PU_PATCH);
|
|
||||||
cursor1 = W_CachePatchName("P1CURSOR", PU_PATCH);
|
|
||||||
cursor2 = W_CachePatchName("P2CURSOR", PU_PATCH);
|
|
||||||
cursor3 = W_CachePatchName("P3CURSOR", PU_PATCH);
|
|
||||||
cursor4 = W_CachePatchName("P4CURSOR", PU_PATCH);
|
|
||||||
randomlvl = W_CachePatchName("RANDOMLV", PU_PATCH);
|
|
||||||
rubyicon = W_CachePatchName("RUBYICON", PU_PATCH);
|
|
||||||
|
|
||||||
timer = cv_votetime.value*TICRATE;
|
timer = cv_votetime.value*TICRATE;
|
||||||
pickedvote = -1;
|
pickedvote = -1;
|
||||||
@@ -1559,12 +1568,15 @@ void Y_StartVote(void)
|
|||||||
levelinfo[i].gts = NULL;
|
levelinfo[i].gts = NULL;
|
||||||
|
|
||||||
// set up the pic
|
// set up the pic
|
||||||
|
if (!dedicated)
|
||||||
|
{
|
||||||
lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(votelevels[i][0]+1)));
|
lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(votelevels[i][0]+1)));
|
||||||
if (lumpnum != LUMPERROR)
|
if (lumpnum != LUMPERROR)
|
||||||
levelinfo[i].pic = W_CachePatchName(va("%sP", G_BuildMapName(votelevels[i][0]+1)), PU_PATCH);
|
levelinfo[i].pic = W_CachePatchName(va("%sP", G_BuildMapName(votelevels[i][0]+1)), PU_PATCH);
|
||||||
else
|
else
|
||||||
levelinfo[i].pic = W_CachePatchName("BLANKLVL", PU_PATCH);
|
levelinfo[i].pic = W_CachePatchName("BLANKLVL", PU_PATCH);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
voteclient.loaded = true;
|
voteclient.loaded = true;
|
||||||
|
|
||||||
@@ -1588,18 +1600,18 @@ static void Y_UnloadVoteData(void)
|
|||||||
{
|
{
|
||||||
voteclient.loaded = false;
|
voteclient.loaded = false;
|
||||||
|
|
||||||
if (rendermode != render_soft)
|
if (dedicated)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UNLOAD(widebgpatch);
|
UNLOAD(VoteScreen.widebgpatch);
|
||||||
UNLOAD(bgpatch);
|
UNLOAD(VoteScreen.bgpatch);
|
||||||
UNLOAD(cursor);
|
UNLOAD(VoteScreen.cursor[0]);
|
||||||
UNLOAD(cursor1);
|
UNLOAD(VoteScreen.cursor[1]);
|
||||||
UNLOAD(cursor2);
|
UNLOAD(VoteScreen.cursor[2]);
|
||||||
UNLOAD(cursor3);
|
UNLOAD(VoteScreen.cursor[3]);
|
||||||
UNLOAD(cursor4);
|
UNLOAD(VoteScreen.cursor[4]);
|
||||||
UNLOAD(randomlvl);
|
UNLOAD(VoteScreen.randomlvl);
|
||||||
UNLOAD(rubyicon);
|
UNLOAD(VoteScreen.rubyicon);
|
||||||
|
|
||||||
UNLOAD(levelinfo[3].pic);
|
UNLOAD(levelinfo[3].pic);
|
||||||
UNLOAD(levelinfo[2].pic);
|
UNLOAD(levelinfo[2].pic);
|
||||||
|
|||||||
+34
-1
@@ -10,7 +10,6 @@
|
|||||||
/// \brief Tally screens, or "Intermissions" as they were formally called in Doom
|
/// \brief Tally screens, or "Intermissions" as they were formally called in Doom
|
||||||
|
|
||||||
extern boolean usebuffer;
|
extern boolean usebuffer;
|
||||||
extern char *luaVoteScreen;
|
|
||||||
|
|
||||||
void Y_IntermissionDrawer(void);
|
void Y_IntermissionDrawer(void);
|
||||||
void Y_Ticker(void);
|
void Y_Ticker(void);
|
||||||
@@ -55,3 +54,37 @@ typedef enum
|
|||||||
int_classicrace, // Competition
|
int_classicrace, // Competition
|
||||||
} intertype_t;
|
} intertype_t;
|
||||||
extern intertype_t intertype;
|
extern intertype_t intertype;
|
||||||
|
|
||||||
|
// Votescreen stuff
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
boolean race; // non lua race patch replaced
|
||||||
|
boolean widerace; // non lua widescreen race patch replaced
|
||||||
|
boolean battle; // non lua battle patch replaced
|
||||||
|
boolean widebattle; // non lua widescreen battle patch replaced
|
||||||
|
} votereplace_t;
|
||||||
|
|
||||||
|
// VEXTRN - Vote (V) Extra (EXT) Race (R) Normal (N - Normal sized patch)
|
||||||
|
// VEXTRW - Vote (V) Extra (EXT) Race (R) Normal (W - Wide patch)
|
||||||
|
// VEXTBN - Vote (V) Extra (EXT) Battle (B) Normal (N - Normal sized patch)
|
||||||
|
// VEXTBW - Vote (V) Extra (EXT) Battle (B) Normal (W - Wide patch)
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
char Prefix[5]; // Race = INTSX, Battle = BTLSX
|
||||||
|
char luaPrefix[5]; // prefix for lua votescreens
|
||||||
|
|
||||||
|
INT32 currentAnimFrame; // current animated background frame
|
||||||
|
|
||||||
|
INT32 foundLuaVoteFrames; // normal lua patch frames
|
||||||
|
INT32 foundLuaVoteWideFrames; // widescreen lua patch frames
|
||||||
|
|
||||||
|
votereplace_t replaced; // checks which non lua patch has been replaced
|
||||||
|
|
||||||
|
patch_t *bgpatch; // votebackground patch
|
||||||
|
patch_t *widebgpatch; // wide votebackground patch
|
||||||
|
|
||||||
|
patch_t *cursor[5]; // cursor patches
|
||||||
|
patch_t *randomlvl; // randomlevel patch
|
||||||
|
patch_t *rubyicon; // encore ruby patch
|
||||||
|
} votescreen_t;
|
||||||
|
extern votescreen_t VoteScreen;
|
||||||
Reference in new issue
Block a user