Use kart titlecard, redo fade and fix grow canceling
This commit is contained in:
parent
da89e60929
commit
64b36b90ae
14 changed files with 177 additions and 252 deletions
|
|
@ -943,31 +943,47 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
|
|||
// set up the levelstring
|
||||
if (netbuffer->u.serverinfo.iszone || (mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
|
||||
{
|
||||
if (snprintf(netbuffer->u.serverinfo.maptitle,
|
||||
sizeof netbuffer->u.serverinfo.maptitle,
|
||||
"%s",
|
||||
mapheaderinfo[gamemap-1]->lvlttl) < 0)
|
||||
{
|
||||
// If there's an encoding error, send "Unknown", we accept that the above may be truncated
|
||||
strncpy(netbuffer->u.serverinfo.maptitle, "Unknown", sizeof netbuffer->u.serverinfo.maptitle);
|
||||
}
|
||||
if (mapheaderinfo[gamemap-1]->actnum[0])
|
||||
snprintf(netbuffer->u.serverinfo.maptitle,
|
||||
33,
|
||||
"%s %s",
|
||||
mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->actnum);
|
||||
else
|
||||
snprintf(netbuffer->u.serverinfo.maptitle,
|
||||
33,
|
||||
"%s",
|
||||
mapheaderinfo[gamemap-1]->lvlttl);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (snprintf(netbuffer->u.serverinfo.maptitle,
|
||||
sizeof netbuffer->u.serverinfo.maptitle,
|
||||
"%s %s",
|
||||
mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl) < 0)
|
||||
if (mapheaderinfo[gamemap-1]->actnum[0])
|
||||
{
|
||||
// If there's an encoding error, send "Unknown", we accept that the above may be truncated
|
||||
strncpy(netbuffer->u.serverinfo.maptitle, "Unknown", sizeof netbuffer->u.serverinfo.maptitle);
|
||||
if (snprintf(netbuffer->u.serverinfo.maptitle,
|
||||
sizeof netbuffer->u.serverinfo.maptitle,
|
||||
"%s %s %s",
|
||||
mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl, mapheaderinfo[gamemap-1]->actnum) < 0)
|
||||
{
|
||||
// If there's an encoding error, send UNKNOWN, we accept that the above may be truncated
|
||||
strncpy(netbuffer->u.serverinfo.maptitle, "Unknown", sizeof netbuffer->u.serverinfo.maptitle);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (snprintf(netbuffer->u.serverinfo.maptitle,
|
||||
sizeof netbuffer->u.serverinfo.maptitle,
|
||||
"%s %s",
|
||||
mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl) < 0)
|
||||
{
|
||||
// If there's an encoding error, send "Unknown", we accept that the above may be truncated
|
||||
strncpy(netbuffer->u.serverinfo.maptitle, "Unknown", sizeof netbuffer->u.serverinfo.maptitle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
strncpy(netbuffer->u.serverinfo.maptitle, "Unknown", sizeof netbuffer->u.serverinfo.maptitle);
|
||||
|
||||
netbuffer->u.serverinfo.actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||
netbuffer->u.serverinfo.actnum = 0; //mapheaderinfo[gamemap-1]->actnum
|
||||
|
||||
memset(netbuffer->u.serverinfo.httpsource, 0, MAX_MIRROR_LENGTH);
|
||||
|
||||
|
|
@ -1286,8 +1302,8 @@ static void CL_LoadReceivedSavegame(boolean reloading)
|
|||
CON_LogMessage(va(" %s", mapheaderinfo[gamemap-1]->zonttl));
|
||||
else if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
|
||||
CON_LogMessage(M_GetText(" Zone"));
|
||||
if (mapheaderinfo[gamemap-1]->actnum > 0)
|
||||
CON_LogMessage(va(" %d", mapheaderinfo[gamemap-1]->actnum));
|
||||
if (mapheaderinfo[gamemap-1]->actnum[0])
|
||||
CON_LogMessage(va(" %s", mapheaderinfo[gamemap-1]->actnum));
|
||||
}
|
||||
|
||||
CON_LogMessage("\"\n");
|
||||
|
|
|
|||
|
|
@ -4806,15 +4806,15 @@ static void Command_Showmap_f(void)
|
|||
{
|
||||
if (mapheaderinfo[gamemap-1]->zonttl[0] && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
|
||||
{
|
||||
if (mapheaderinfo[gamemap-1]->actnum > 0)
|
||||
CONS_Printf("%s (%d): %s %s %d\n", G_BuildMapName(gamemap), gamemap, mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl, mapheaderinfo[gamemap-1]->actnum);
|
||||
if (mapheaderinfo[gamemap-1]->actnum[0])
|
||||
CONS_Printf("%s (%d): %s %s %s\n", G_BuildMapName(gamemap), gamemap, mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl, mapheaderinfo[gamemap-1]->actnum);
|
||||
else
|
||||
CONS_Printf("%s (%d): %s %s\n", G_BuildMapName(gamemap), gamemap, mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mapheaderinfo[gamemap-1]->actnum > 0)
|
||||
CONS_Printf("%s (%d): %s %d\n", G_BuildMapName(gamemap), gamemap, mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->actnum);
|
||||
if (mapheaderinfo[gamemap-1]->actnum[0])
|
||||
CONS_Printf("%s (%d): %s %s\n", G_BuildMapName(gamemap), gamemap, mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->actnum);
|
||||
else
|
||||
CONS_Printf("%s (%d): %s\n", G_BuildMapName(gamemap), gamemap, mapheaderinfo[gamemap-1]->lvlttl);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1464,10 +1464,12 @@ void readlevelheader(MYFILE *f, INT32 num)
|
|||
}
|
||||
else if (fastcmp(word, "ACT"))
|
||||
{
|
||||
if (i >= 0 && i <= 99) // 0 for no act number
|
||||
/*if (i >= 0 && i < 20) // 0 for no act number, TTL1 through TTL19
|
||||
mapheaderinfo[num-1]->actnum = (UINT8)i;
|
||||
else
|
||||
deh_warning("Level header %d: invalid act number %d", num, i);
|
||||
deh_warning("Level header %d: invalid act number %d", num, i);*/
|
||||
deh_strlcpy(mapheaderinfo[num-1]->actnum, word2,
|
||||
sizeof(mapheaderinfo[num-1]->actnum), va("Level header %d: actnum", num));
|
||||
}
|
||||
else if (fastcmp(word, "NEXTLEVEL"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ typedef struct
|
|||
char lvlttl[22]; ///< Level name without "Zone". (21 character limit instead of 32, 21 characters can display on screen max anyway)
|
||||
char subttl[33]; ///< Subtitle for level
|
||||
char zonttl[22]; ///< "ZONE" replacement name
|
||||
UINT8 actnum; ///< Act number or 0 for none.
|
||||
char actnum[3]; ///< SRB2Kart: Now a 2 character long string.
|
||||
UINT32 typeoflevel; ///< Combination of typeoflevel flags.
|
||||
INT16 nextlevel; ///< Map number of next level, or 1100-1102 to end.
|
||||
INT16 marathonnext; ///< See nextlevel, but for Marathon mode. Necessary to support hub worlds ala SUGOI.
|
||||
|
|
|
|||
|
|
@ -422,8 +422,8 @@ void F_WipeStageTitle(void)
|
|||
// draw level title
|
||||
if ((WipeStageTitle) && G_IsTitleCardAvailable())
|
||||
{
|
||||
ST_runTitleCard();
|
||||
ST_drawTitleCard();
|
||||
//ST_runTitleCard();
|
||||
//ST_drawTitleCard();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4641,7 +4641,7 @@ char *G_BuildMapTitle(INT32 mapnum)
|
|||
{
|
||||
size_t len = 1;
|
||||
const char *zonetext = NULL;
|
||||
const UINT8 actnum = mapheaderinfo[mapnum-1]->actnum;
|
||||
const char *actnum = NULL;
|
||||
|
||||
len += strlen(mapheaderinfo[mapnum-1]->lvlttl);
|
||||
if (strlen(mapheaderinfo[mapnum-1]->zonttl) > 0)
|
||||
|
|
@ -4655,14 +4655,14 @@ char *G_BuildMapTitle(INT32 mapnum)
|
|||
len += strlen(zonetext) + 1; // ' ' + zonetext
|
||||
}
|
||||
|
||||
if (actnum > 0)
|
||||
if (actnum)
|
||||
len += 1 + 11; // ' ' + INT32
|
||||
|
||||
title = Z_Malloc(len, PU_STATIC, NULL);
|
||||
|
||||
sprintf(title, "%s", mapheaderinfo[mapnum-1]->lvlttl);
|
||||
if (zonetext) sprintf(title + strlen(title), " %s", zonetext);
|
||||
if (actnum > 0) sprintf(title + strlen(title), " %d", actnum);
|
||||
if (actnum) sprintf(title + strlen(title), " %s", actnum);
|
||||
}
|
||||
|
||||
return title;
|
||||
|
|
|
|||
|
|
@ -267,6 +267,10 @@ void K_RegisterKartStuff(void)
|
|||
CV_RegisterVar(&cv_kartdebugnodes);
|
||||
CV_RegisterVar(&cv_kartdebugcolorize);
|
||||
CV_RegisterVar(&cv_kartdebugdirector);
|
||||
|
||||
CV_RegisterVar(&cv_stagetitle);
|
||||
|
||||
CV_RegisterVar(&cv_lessflicker);
|
||||
}
|
||||
|
||||
//}
|
||||
|
|
@ -9347,7 +9351,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
|| player->itemamount
|
||||
|| player->itemroulette
|
||||
|| player->rocketsneakertimer
|
||||
|| player->eggmanexplode))
|
||||
|| player->eggmanexplode
|
||||
|| (player->growshrinktimer > 0)))
|
||||
player->pflags |= PF_USERINGS;
|
||||
else
|
||||
player->pflags &= ~PF_USERINGS;
|
||||
|
|
|
|||
|
|
@ -2124,7 +2124,7 @@ static int mapheaderinfo_get(lua_State *L)
|
|||
else if (fastcmp(field,"zonttl"))
|
||||
lua_pushstring(L, header->zonttl);
|
||||
else if (fastcmp(field,"actnum"))
|
||||
lua_pushinteger(L, header->actnum);
|
||||
lua_pushstring(L, header->actnum);
|
||||
else if (fastcmp(field,"typeoflevel"))
|
||||
lua_pushinteger(L, header->typeoflevel);
|
||||
else if (fastcmp(field,"nextlevel"))
|
||||
|
|
|
|||
|
|
@ -4001,15 +4001,15 @@ static void M_DrawPauseMenu(void)
|
|||
|
||||
if (strlen(mapheaderinfo[gamemap-1]->zonttl) > 0)
|
||||
{
|
||||
if (mapheaderinfo[gamemap-1]->actnum > 0)
|
||||
V_DrawString(40, 28, highlightflags, va("%s %s %d", mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl, mapheaderinfo[gamemap-1]->actnum));
|
||||
if (mapheaderinfo[gamemap-1]->actnum[0])
|
||||
V_DrawString(40, 28, highlightflags, va("%s %s %s", mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl, mapheaderinfo[gamemap-1]->actnum));
|
||||
else
|
||||
V_DrawString(40, 28, highlightflags, va("%s %s", mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mapheaderinfo[gamemap-1]->actnum > 0)
|
||||
V_DrawString(40, 28, highlightflags, va("%s %d", mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->actnum));
|
||||
if (mapheaderinfo[gamemap-1]->actnum[0])
|
||||
V_DrawString(40, 28, highlightflags, va("%s %s", mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->actnum));
|
||||
else
|
||||
V_DrawString(40, 28, highlightflags, mapheaderinfo[gamemap-1]->lvlttl);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -848,7 +848,7 @@ static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png
|
|||
mapheaderinfo[gamemap-1]->lvlttl,
|
||||
(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" :
|
||||
(mapheaderinfo[gamemap-1]->zonttl[0] != '\0') ? va(" %s",mapheaderinfo[gamemap-1]->zonttl) : " Zone",
|
||||
(mapheaderinfo[gamemap-1]->actnum > 0) ? va(" %d",mapheaderinfo[gamemap-1]->actnum) : "");
|
||||
(mapheaderinfo[gamemap-1]->actnum[0]) ? va(" %s",mapheaderinfo[gamemap-1]->actnum) : "");
|
||||
else
|
||||
snprintf(lvlttltext, 48, "Unknown");
|
||||
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
|
|||
mapheaderinfo[num]->ltzzpatch[0] = '\0';
|
||||
mapheaderinfo[num]->ltzztext[0] = '\0';
|
||||
mapheaderinfo[num]->ltactdiamond[0] = '\0';
|
||||
mapheaderinfo[num]->actnum = 0;
|
||||
mapheaderinfo[num]->actnum[0] = '\0';
|
||||
mapheaderinfo[num]->typeoflevel = 0;
|
||||
mapheaderinfo[num]->nextlevel = (INT16)(i + 1);
|
||||
mapheaderinfo[num]->marathonnext = 0;
|
||||
|
|
@ -3637,7 +3637,7 @@ lumpnum_t lastloadedmaplumpnum; // for comparative savegame
|
|||
//
|
||||
// Some player initialization for map start.
|
||||
//
|
||||
static void P_InitLevelSettings(void)
|
||||
static void P_InitLevelSettings(boolean reloadinggamestate)
|
||||
{
|
||||
INT32 i;
|
||||
UINT8 p = 0;
|
||||
|
|
@ -3674,7 +3674,9 @@ static void P_InitLevelSettings(void)
|
|||
// circuit, race and competition stuff
|
||||
circuitmap = false;
|
||||
numstarposts = 0;
|
||||
ssspheres = timeinmap = 0;
|
||||
ssspheres = 0;
|
||||
if (!reloadinggamestate)
|
||||
timeinmap = 0;
|
||||
|
||||
// special stage
|
||||
stagefailed = true; // assume failed unless proven otherwise - P_GiveEmerald or emerald touchspecial
|
||||
|
|
@ -3778,7 +3780,7 @@ void P_RespawnThings(void)
|
|||
P_RemoveMobj((mobj_t *)think);
|
||||
}
|
||||
|
||||
P_InitLevelSettings();
|
||||
P_InitLevelSettings(false);
|
||||
|
||||
memset(localaiming, 0, sizeof(localaiming));
|
||||
|
||||
|
|
@ -4119,7 +4121,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
|
|||
if (cv_runscripts.value && mapheaderinfo[gamemap-1]->scriptname[0] != '#')
|
||||
P_RunLevelScript(mapheaderinfo[gamemap-1]->scriptname);
|
||||
|
||||
P_InitLevelSettings();
|
||||
P_InitLevelSettings(reloadinggamestate);
|
||||
|
||||
for (i = 0; i <= r_splitscreen; i++)
|
||||
postimgtype[i] = postimg_none;
|
||||
|
|
@ -4252,18 +4254,26 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
|
|||
// Don't do this during titlemap, because the menu code handles music by itself.
|
||||
S_Start();
|
||||
}
|
||||
}
|
||||
|
||||
levelfadecol = (encoremode ? 0 : 31);
|
||||
levelfadecol = (encoremode && !ranspecialwipe ? 122 : 120);
|
||||
|
||||
if (rendermode != render_none)
|
||||
{
|
||||
F_WipeStartScreen();
|
||||
// Let's fade to white here
|
||||
// But only if we didn't do the encore startup wipe
|
||||
if (!ranspecialwipe && !demo.rewinding && !reloadinggamestate)
|
||||
{
|
||||
if(rendermode != render_none)
|
||||
{
|
||||
F_WipeStartScreen();
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
|
||||
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
|
||||
F_WipeEndScreen();
|
||||
}
|
||||
|
||||
F_RunWipe(wipedefs[wipe_level_toblack], false, ((levelfadecol == 0) ? "FADEMAP1" : "FADEMAP0"), false, false);
|
||||
F_WipeEndScreen();
|
||||
F_RunWipe(wipedefs[(encoremode ? wipe_level_final : wipe_level_toblack)], false, "FADEMAP0", false, false);
|
||||
}
|
||||
else //dedicated servers
|
||||
{
|
||||
F_RunWipe(wipedefs[(encoremode ? wipe_level_final : wipe_level_toblack)], false, "FADEMAP0", false, false);
|
||||
}
|
||||
}
|
||||
/*if (!titlemapinaction)
|
||||
wipegamestate = GS_LEVEL;*/
|
||||
|
|
|
|||
276
src/st_stuff.c
276
src/st_stuff.c
|
|
@ -55,6 +55,11 @@
|
|||
|
||||
#include "r_fps.h"
|
||||
|
||||
// variable to stop mayonaka static from flickering
|
||||
consvar_t cv_lessflicker = CVAR_INIT ("lessflicker", "Off", CV_SAVE, CV_OnOff, NULL);
|
||||
|
||||
consvar_t cv_stagetitle = CVAR_INIT ("maptitle", "On", CV_SAVE, CV_OnOff, NULL);
|
||||
|
||||
UINT16 objectsdrawn = 0;
|
||||
|
||||
//
|
||||
|
|
@ -757,209 +762,83 @@ void ST_runTitleCard(void)
|
|||
void ST_drawTitleCard(void)
|
||||
{
|
||||
char *lvlttl = mapheaderinfo[gamemap-1]->lvlttl;
|
||||
char *subttl = mapheaderinfo[gamemap-1]->subttl;
|
||||
char *zonttl = mapheaderinfo[gamemap-1]->zonttl; // SRB2kart
|
||||
UINT8 actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||
boolean gp = (grandprixinfo.gp && grandprixinfo.roundnum);
|
||||
|
||||
INT32 acttimer;
|
||||
fixed_t actscale;
|
||||
angle_t fakeangle;
|
||||
|
||||
INT32 pad = ((vid.width/vid.dupx) - BASEVIDWIDTH)/2;
|
||||
INT32 bx = bannerx; // We need to make a copy of that otherwise pausing will cause problems.
|
||||
|
||||
if (!G_IsTitleCardAvailable())
|
||||
char *actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||
INT32 lvlttlxpos;
|
||||
INT32 ttlnumxpos;
|
||||
INT32 zonexpos;
|
||||
INT32 dupcalc = (vid.width/vid.dupx);
|
||||
UINT8 gtc = G_GetGametypeColor(gametype);
|
||||
INT32 sub = 0;
|
||||
INT32 bary = (splitscreen)
|
||||
? BASEVIDHEIGHT/2
|
||||
: 163;
|
||||
INT32 lvlw;
|
||||
|
||||
if (!cv_stagetitle.value)
|
||||
return;
|
||||
|
||||
|
||||
if (!LUA_HudEnabled(hud_stagetitle))
|
||||
goto luahook;
|
||||
|
||||
if (lt_ticker >= (lt_endtime + TICRATE))
|
||||
if (timeinmap > 113)
|
||||
goto luahook;
|
||||
|
||||
if ((lt_ticker-lt_lasttic) > 1)
|
||||
lt_ticker = lt_lasttic+1;
|
||||
lvlw = V_LevelNameWidth(lvlttl);
|
||||
|
||||
// Avoid HOMs while drawing the start of the titlecard
|
||||
if (lt_ticker < TTANIMSTART)
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
|
||||
|
||||
if (bossinfo.boss == true)
|
||||
{
|
||||
// WARNING!
|
||||
// https://twitter.com/matthewseiji/status/1485003284196716544
|
||||
// the above tweet is directly responsible for the existence of bosses in this game at all
|
||||
{
|
||||
#define LOTIME 5
|
||||
#define HITIME 15
|
||||
patch_t *localwarn = (encoremode ? twarn2 : twarn);
|
||||
INT32 transp = (lt_ticker+HITIME) % (LOTIME+HITIME);
|
||||
boolean encorehack = (encoremode && lt_ticker <= PRELEVELTIME+4);
|
||||
|
||||
if ((localwarn->width > 0) && (lt_ticker + (HITIME-transp) <= lt_endtime))
|
||||
{
|
||||
if (transp > HITIME-1)
|
||||
{
|
||||
transp = HITIME-1;
|
||||
}
|
||||
|
||||
transp = (((10*transp)/HITIME)<<V_ALPHASHIFT) | (encorehack ? V_SUBTRACT : V_ADD);
|
||||
|
||||
while (bx > -pad)
|
||||
bx -= localwarn->width;
|
||||
while (bx < BASEVIDWIDTH+pad)
|
||||
{
|
||||
V_DrawFixedPatch(bx*FRACUNIT, 55*FRACUNIT, FRACUNIT, V_SNAPTOLEFT|transp, localwarn, NULL);
|
||||
bx += localwarn->width;
|
||||
}
|
||||
}
|
||||
#undef LOTIME
|
||||
#undef HITIME
|
||||
}
|
||||
|
||||
// Everything else...
|
||||
if (bossinfo.enemyname)
|
||||
{
|
||||
bx = V_TitleCardStringWidth(bossinfo.enemyname);
|
||||
|
||||
// Name.
|
||||
V_DrawTitleCardString((BASEVIDWIDTH - bx)/2, 75, bossinfo.enemyname, 0, true, bossinfo.titleshow, lt_exitticker);
|
||||
|
||||
// Under-bar.
|
||||
{
|
||||
angle_t fakeang = 0;
|
||||
fixed_t scalex = FRACUNIT;
|
||||
|
||||
// Handle scaling.
|
||||
if (lt_ticker <= 3)
|
||||
{
|
||||
fakeang = (lt_ticker*ANGLE_45)/2;
|
||||
scalex = FINESINE(fakeang>>ANGLETOFINESHIFT);
|
||||
}
|
||||
else if (lt_exitticker > 1)
|
||||
{
|
||||
if (lt_exitticker <= 4)
|
||||
{
|
||||
fakeang = ((lt_exitticker-1)*ANGLE_45)/2;
|
||||
scalex = FINECOSINE(fakeang>>ANGLETOFINESHIFT);
|
||||
}
|
||||
else
|
||||
{
|
||||
scalex = 0;
|
||||
}
|
||||
}
|
||||
// Handle subtitle.
|
||||
else if (bossinfo.subtitle && lt_ticker >= TICRATE/2)
|
||||
{
|
||||
INT32 by = 75+32;
|
||||
if (lt_ticker == TICRATE/2 || lt_exitticker == 1)
|
||||
{
|
||||
;
|
||||
}
|
||||
else if (lt_ticker == (TICRATE/2)+1 || lt_ticker == lt_endtime)
|
||||
{
|
||||
by += 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
by += 5;
|
||||
}
|
||||
|
||||
V_DrawRightAlignedThinString((BASEVIDWIDTH+bx)/2, by, V_6WIDTHSPACE, bossinfo.subtitle);
|
||||
}
|
||||
|
||||
// Now draw the under-bar itself.
|
||||
if (scalex > 0)
|
||||
{
|
||||
bx = FixedMul(bx, scalex);
|
||||
V_DrawFill((BASEVIDWIDTH-(bx+2))/2, 75+32, bx+2, 3, 31);
|
||||
V_DrawFill((BASEVIDWIDTH-(bx))/2, 75+32+1, bx, 1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
lt_lasttic = lt_ticker;
|
||||
goto luahook;
|
||||
}
|
||||
|
||||
// Background zig-zags
|
||||
V_DrawFixedPatch((chev1x)*FRACUNIT, (chev1y)*FRACUNIT, FRACUNIT, chevtflag, tcchev1, NULL);
|
||||
V_DrawFixedPatch((chev2x)*FRACUNIT, (chev2y)*FRACUNIT, FRACUNIT, chevtflag, tcchev2, NULL);
|
||||
|
||||
|
||||
// Draw ROUND bar, scroll it downwards.
|
||||
V_DrawFixedPatch(roundx*FRACUNIT, ((-32) + (lt_ticker%32))*FRACUNIT, FRACUNIT, V_SNAPTOTOP|V_SNAPTOLEFT, tcroundbar, NULL);
|
||||
// Draw ROUND text
|
||||
if (gp)
|
||||
V_DrawFixedPatch((roundx+10)*FRACUNIT, roundy*FRACUNIT, FRACUNIT, V_SNAPTOTOP|V_SNAPTOLEFT, tcround, NULL);
|
||||
|
||||
// round num background
|
||||
V_DrawFixedPatch(roundnumx*FRACUNIT, roundnumy*FRACUNIT, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTOLEFT, tccirclebg, NULL);
|
||||
|
||||
// Scrolling banner
|
||||
if (tcbanner->width > 0)
|
||||
{
|
||||
while (bx > -pad)
|
||||
bx -= tcbanner->width;
|
||||
while (bx < BASEVIDWIDTH+pad)
|
||||
{
|
||||
V_DrawFixedPatch(bx*FRACUNIT, (bannery)*FRACUNIT, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTOLEFT, tcbanner, NULL);
|
||||
bx += tcbanner->width;
|
||||
}
|
||||
}
|
||||
|
||||
// If possible, draw round number
|
||||
if (gp && grandprixinfo.roundnum > 0 && grandprixinfo.roundnum < 11) // Check boundaries JUST IN CASE.
|
||||
V_DrawFixedPatch(roundnumx*FRACUNIT, roundnumy*FRACUNIT, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTOLEFT, tcroundnum[grandprixinfo.roundnum-1], NULL);
|
||||
|
||||
// Draw both halves of the egg
|
||||
V_DrawFixedPatch(eggx1*FRACUNIT, eggy1*FRACUNIT, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTOLEFT, tccircletop, NULL);
|
||||
V_DrawFixedPatch(eggx2*FRACUNIT, eggy2*FRACUNIT, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTOLEFT, tccirclebottom, NULL);
|
||||
|
||||
// Now the level name.
|
||||
V_DrawTitleCardString((actnum) ? 265 : 280, 60, lvlttl, V_SNAPTORIGHT, false, lt_ticker, TTANIMENDTHRESHOLD);
|
||||
if (actnum[0])
|
||||
lvlttlxpos = ((BASEVIDWIDTH/2) - (lvlw/2)) - V_LevelNameWidth(actnum);
|
||||
else
|
||||
lvlttlxpos = ((BASEVIDWIDTH/2) - (lvlw/2));
|
||||
|
||||
zonexpos = ttlnumxpos = lvlttlxpos + lvlw;
|
||||
if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
|
||||
V_DrawTitleCardString((actnum) ? 265 : 280, 60+32, strlen(zonttl) ? zonttl : "ZONE", V_SNAPTORIGHT, false, lt_ticker - strlen(lvlttl), TTANIMENDTHRESHOLD);
|
||||
|
||||
// the act has a similar graphic animation, but we'll handle it here since it's only like 2 graphics lmfao.
|
||||
if (actnum && actnum < 10)
|
||||
{
|
||||
|
||||
// compute delay before the act should appear.
|
||||
acttimer = lt_ticker - strlen(lvlttl);
|
||||
if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
|
||||
acttimer -= strlen((strlen(zonttl)) ? (zonttl) : ("ZONE"));
|
||||
|
||||
actscale = 0;
|
||||
fakeangle = 0;
|
||||
|
||||
if (acttimer >= 0)
|
||||
{
|
||||
|
||||
if (acttimer < TTANIMENDTHRESHOLD) // spin in
|
||||
{
|
||||
fakeangle = min(360 + 90, acttimer*41) * ANG1;
|
||||
actscale = FINESINE(fakeangle>>ANGLETOFINESHIFT);
|
||||
}
|
||||
else // spin out
|
||||
{
|
||||
// Make letters disappear...
|
||||
acttimer -= TTANIMENDTHRESHOLD;
|
||||
|
||||
fakeangle = max(0, (360+90) - acttimer*41)*ANG1;
|
||||
actscale = FINESINE(fakeangle>>ANGLETOFINESHIFT);
|
||||
}
|
||||
|
||||
if (actscale)
|
||||
{
|
||||
// draw the top:
|
||||
V_DrawStretchyFixedPatch(286*FRACUNIT, 76*FRACUNIT, abs(actscale), FRACUNIT, V_SNAPTORIGHT|(actscale < 0 ? V_FLIP : 0), tcact, NULL);
|
||||
V_DrawStretchyFixedPatch(286*FRACUNIT, 123*FRACUNIT, abs(actscale), FRACUNIT, V_SNAPTORIGHT|(actscale < 0 ? V_FLIP : 0), tcactnum[actnum], NULL);
|
||||
}
|
||||
}
|
||||
if (zonttl[0])
|
||||
zonexpos -= V_LevelNameWidth(zonttl); // SRB2kart
|
||||
else
|
||||
zonexpos -= V_LevelNameWidth(M_GetText("Zone"));
|
||||
}
|
||||
|
||||
lt_lasttic = lt_ticker;
|
||||
if (lvlttlxpos < 0)
|
||||
lvlttlxpos = 0;
|
||||
|
||||
if (timeinmap > 105)
|
||||
{
|
||||
INT32 count = (113 - (INT32)(timeinmap));
|
||||
sub = dupcalc;
|
||||
while (count-- > 0)
|
||||
sub >>= 1;
|
||||
sub = -sub;
|
||||
}
|
||||
|
||||
{
|
||||
dupcalc = (dupcalc - BASEVIDWIDTH)>>1;
|
||||
V_DrawFill(sub - dupcalc, bary+9, ttlnumxpos+dupcalc + 1, 2, 31|V_SNAPTOBOTTOM);
|
||||
V_DrawDiag(sub + ttlnumxpos + 1, bary, 11, 31|V_SNAPTOBOTTOM);
|
||||
V_DrawFill(sub - dupcalc, bary, ttlnumxpos+dupcalc, 10, gtc|V_SNAPTOBOTTOM);
|
||||
V_DrawDiag(sub + ttlnumxpos, bary, 10, gtc|V_SNAPTOBOTTOM);
|
||||
|
||||
if (subttl[0])
|
||||
V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, subttl);
|
||||
//else
|
||||
//V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE, va("%s Mode", gametype_cons_t[gametype].strvalue));
|
||||
}
|
||||
|
||||
ttlnumxpos += sub;
|
||||
lvlttlxpos += sub;
|
||||
zonexpos += sub;
|
||||
|
||||
V_DrawLevelTitle(lvlttlxpos, bary-18, V_SNAPTOBOTTOM, lvlttl);
|
||||
|
||||
if (strlen(zonttl) > 0)
|
||||
V_DrawLevelTitle(zonexpos, bary+6, V_SNAPTOBOTTOM, zonttl);
|
||||
else if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
|
||||
V_DrawLevelTitle(zonexpos, bary+6, V_SNAPTOBOTTOM, M_GetText("Zone"));
|
||||
|
||||
if (actnum[0])
|
||||
V_DrawLevelTitle(ttlnumxpos+12, bary+6, V_SNAPTOBOTTOM, actnum);
|
||||
|
||||
luahook:
|
||||
if (renderisnewtic)
|
||||
|
|
@ -1119,7 +998,11 @@ void ST_DrawDemoTitleEntry(void)
|
|||
// MayonakaStatic: draw Midnight Channel's TV-like borders
|
||||
static void ST_MayonakaStatic(void)
|
||||
{
|
||||
INT32 flag = (leveltime%2) ? V_90TRANS : V_70TRANS;
|
||||
INT32 flag;
|
||||
if (cv_lessflicker.value)
|
||||
flag = V_70TRANS;
|
||||
else
|
||||
flag = (leveltime%2) ? V_90TRANS : V_70TRANS;
|
||||
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, V_SNAPTOTOP|V_SNAPTOLEFT|flag, hud_tv1, NULL);
|
||||
V_DrawFixedPatch(320<<FRACBITS, 0, FRACUNIT, V_SNAPTOTOP|V_SNAPTORIGHT|V_FLIP|flag, hud_tv1, NULL);
|
||||
|
|
@ -1204,9 +1087,14 @@ void ST_Drawer(void)
|
|||
ST_MayonakaStatic();
|
||||
}
|
||||
|
||||
// Draw a fade on level opening
|
||||
if (timeinmap < 16)
|
||||
V_DrawCustomFadeScreen(((levelfadecol == 0) ? "FADEMAP1" : "FADEMAP0"), 31-(timeinmap*2)); // Then gradually fade out from there
|
||||
// Draw a white fade on level opening
|
||||
if (timeinmap < 15)
|
||||
{
|
||||
if (timeinmap <= 5)
|
||||
V_DrawFill(0,0,BASEVIDWIDTH,BASEVIDHEIGHT,120); // Pure white on first few frames, to hide SRB2's awful level load artifacts
|
||||
else
|
||||
V_DrawFadeScreen(120, 15-timeinmap); // Then gradually fade out from there
|
||||
}
|
||||
|
||||
if (stagetitle)
|
||||
ST_drawTitleCard();
|
||||
|
|
|
|||
|
|
@ -85,4 +85,8 @@ extern patch_t *faceprefix[MAXSKINS][NUMFACES];
|
|||
|
||||
extern UINT16 objectsdrawn;
|
||||
|
||||
// variable to stop mayonaka static from flickering
|
||||
extern consvar_t cv_lessflicker;
|
||||
extern consvar_t cv_stagetitle;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -236,10 +236,10 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32))
|
|||
}
|
||||
else if (mapheaderinfo[prevmap]->levelflags & LF_NOZONE)
|
||||
{
|
||||
if (mapheaderinfo[prevmap]->actnum > 0)
|
||||
if (mapheaderinfo[prevmap]->actnum[0])
|
||||
snprintf(data.levelstring,
|
||||
sizeof data.levelstring,
|
||||
"* %s %d *",
|
||||
"* %s %s *",
|
||||
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->actnum);
|
||||
else
|
||||
snprintf(data.levelstring,
|
||||
|
|
@ -250,10 +250,10 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32))
|
|||
else
|
||||
{
|
||||
const char *zonttl = (mapheaderinfo[prevmap]->zonttl[0] ? mapheaderinfo[prevmap]->zonttl : "ZONE");
|
||||
if (mapheaderinfo[prevmap]->actnum > 0)
|
||||
if (mapheaderinfo[prevmap]->actnum[0])
|
||||
snprintf(data.levelstring,
|
||||
sizeof data.levelstring,
|
||||
"* %s %s %d *",
|
||||
"* %s %s %s *",
|
||||
mapheaderinfo[prevmap]->lvlttl, zonttl, mapheaderinfo[prevmap]->actnum);
|
||||
else
|
||||
snprintf(data.levelstring,
|
||||
|
|
@ -1637,10 +1637,10 @@ void Y_StartVote(void)
|
|||
// set up the levelstring
|
||||
if (mapheaderinfo[votelevels[i][0]]->levelflags & LF_NOZONE || !mapheaderinfo[votelevels[i][0]]->zonttl[0])
|
||||
{
|
||||
if (mapheaderinfo[votelevels[i][0]]->actnum > 0)
|
||||
if (mapheaderinfo[votelevels[i][0]]->actnum[0])
|
||||
snprintf(levelinfo[i].str,
|
||||
sizeof levelinfo[i].str,
|
||||
"%s %d",
|
||||
"%s %s",
|
||||
mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->actnum);
|
||||
else
|
||||
snprintf(levelinfo[i].str,
|
||||
|
|
@ -1650,10 +1650,10 @@ void Y_StartVote(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (mapheaderinfo[votelevels[i][0]]->actnum > 0)
|
||||
if (mapheaderinfo[votelevels[i][0]]->actnum[0])
|
||||
snprintf(levelinfo[i].str,
|
||||
sizeof levelinfo[i].str,
|
||||
"%s %s %d",
|
||||
"%s %s %s",
|
||||
mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->zonttl, mapheaderinfo[votelevels[i][0]]->actnum);
|
||||
else
|
||||
snprintf(levelinfo[i].str,
|
||||
|
|
|
|||
Loading…
Reference in a new issue