Merge remote-tracking branch 'public-new/master'

This commit is contained in:
Sally Coolatta 2024-08-09 21:00:28 -04:00
commit 4ac841add7
10 changed files with 111 additions and 25 deletions

View file

@ -855,8 +855,8 @@ void F_IntroTicker(void)
const boolean disclaimerskippable =
(
intro_scenenum == INTROSCENE_DISCLAIMER
&& dc_state == DISCLAIMER_FINAL
&& dc_tics >= (TICRATE/2) + (5*6) // bottom text needs to fade all the way in
&& (dc_state < DISCLAIMER_SLIDE
|| (dc_state == DISCLAIMER_FINAL && dc_textfade == 0)) // bottom text needs to fade all the way in
);
const boolean doskip =
(
@ -874,7 +874,15 @@ void F_IntroTicker(void)
if (doskip && disclaimerskippable)
{
dc_state = DISCLAIMER_OUT;
if (dc_state == DISCLAIMER_FINAL) {
dc_state = DISCLAIMER_OUT;
I_FadeOutStopSong(MUSICRATE*2/3);
} else {
if (dc_state <= DISCLAIMER_FADE)
Music_Play("lawyer");
dc_state = DISCLAIMER_SLIDE;
dc_segaframe = 23;
}
dc_tics = 0;
}
else if (doskip || timetonext <= 0)

View file

@ -104,7 +104,7 @@ void K_DrawInputDisplay(float x, float y, INT32 flags, char mode, UINT8 pid, boo
(G_PlayerInputAnalog(pid, gc_up, guessinput) - G_PlayerInputAnalog(pid, gc_down, guessinput)) / (float)JOYAXISRANGE,
} :
Vec2<float> {
-cmd.turning / (float)KART_FULLTURN,
-cmd.turning * (encoremode ? -1 : 1) / (float)KART_FULLTURN,
cmd.throwdir / (float)KART_FULLTURN,
};

View file

@ -112,7 +112,7 @@ static boolean K_BRIGHTLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
brightmapStorage_t *bms = K_GetBrightmapStorageByTextureName(tkn);
@ -127,7 +127,7 @@ static boolean K_BRIGHTLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
strncpy(bms->brightmapName, tkn, 8);
bms->brightmapHash = quickncasehash(tkn, 8);

View file

@ -332,6 +332,16 @@ terrain_t *K_GetDefaultTerrain(void)
return K_GetTerrainByIndex(defaultTerrain);
}
/*--------------------------------------------------
size_t K_GetDefaultTerrainID(void)
See header file for description.
--------------------------------------------------*/
size_t K_GetDefaultTerrainID(void)
{
return defaultTerrain;
}
/*--------------------------------------------------
terrain_t *K_GetTerrainForTextureName(const char *checkName)
@ -360,6 +370,34 @@ terrain_t *K_GetTerrainForTextureName(const char *checkName)
return K_GetDefaultTerrain();
}
/*--------------------------------------------------
size_t K_GetTerrainIDForTextureName(const char *checkName)
See header file for description.
--------------------------------------------------*/
size_t K_GetTerrainIDForTextureName(const char *checkName)
{
UINT32 checkHash = quickncasehash(checkName, 8);
size_t i;
if (numTerrainFloorDefs > 0)
{
for (i = 0; i < numTerrainFloorDefs; i++)
{
t_floor_t *f = &terrainFloorDefs[i];
if (checkHash == f->textureHash && !strncasecmp(checkName, f->textureName, 8))
{
return f->terrainID;
}
}
}
// This texture doesn't have a terrain directly applied to it,
// so we fallback to the default terrain.
return K_GetDefaultTerrainID();
}
/*--------------------------------------------------
terrain_t *K_GetTerrainForTextureNum(INT32 textureNum)
@ -370,7 +408,7 @@ terrain_t *K_GetTerrainForTextureNum(INT32 textureNum)
if (textureNum >= 0 && textureNum < numtextures)
{
texture_t *tex = textures[textureNum];
return tex->terrain;
return K_GetTerrainByIndex(tex->terrainID);
}
// This texture doesn't have a terrain directly applied to it,
@ -1823,7 +1861,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
t_splash_t *s = NULL;
@ -1864,7 +1902,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
t_footstep_t *fs = NULL;
@ -1905,7 +1943,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
t_overlay_t *o = NULL;
@ -1946,7 +1984,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
terrain_t *t = NULL;
@ -1986,8 +2024,8 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
Z_Free(tkn);
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
if (stricmp(tkn, "optional") == 0)
{
@ -1998,7 +2036,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
pos = M_GetTokenPos();
}
if (tkn && pos < size)
if (tkn && pos <= size)
{
t_floor_t *f = NULL;
@ -2027,7 +2065,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
terrain_t *t = K_GetTerrainByName(tkn);
@ -2044,7 +2082,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
INT32 tex = R_CheckTextureNumForName(f->textureName);
if (tex != -1)
{
textures[tex]->terrain = t;
textures[tex]->terrainID = f->terrainID;
}
}
}
@ -2072,7 +2110,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
terrain_t *t = NULL;
@ -2111,7 +2149,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
t_footstep_t *fs = NULL;

View file

@ -398,6 +398,19 @@ terrain_t *K_GetTerrainByName(const char *checkName);
terrain_t *K_GetDefaultTerrain(void);
/*--------------------------------------------------
size_t K_GetDefaultTerrainID(void)
Returns the default terrain definition's ID, used
in cases where terrain is not set for a texture.
Input Arguments:-
None
Return:-
The default terrain definition's ID, NULL if it didn't exist.
--------------------------------------------------*/
size_t K_GetDefaultTerrainID(void);
/*--------------------------------------------------
terrain_t *K_GetTerrainForTextureName(const char *checkName);
@ -417,6 +430,22 @@ terrain_t *K_GetDefaultTerrain(void);
terrain_t *K_GetTerrainForTextureName(const char *checkName);
/*--------------------------------------------------
size_t K_GetTerrainIDForTextureName(const char *checkName)
Returns the ID of the terrain definition applied
to the texture name inputted.
Input Arguments:-
checkName - The texture's name.
Return:-
The texture's terrain definition's ID if it exists,
otherwise the default terrain's ID if it exists,
otherwise NULL.
--------------------------------------------------*/
size_t K_GetTerrainIDForTextureName(const char *checkName);
/*--------------------------------------------------
terrain_t *K_GetTerrainForTextureNum(INT32 textureNum);

View file

@ -1045,7 +1045,7 @@ static int libd_getColormap(lua_State *L)
skinnum = i;
}
if (demo.playback)
if (demo.playback && skinnum >= 0)
skinnum = demo.skinlist[skinnum].mapping;
// all was successful above, now we generate the colormap at last!

View file

@ -795,7 +795,7 @@ static int player_set(lua_State *L)
else if (fastcmp(field,"distancetofinishprev"))
return NOSET;
else if (fastcmp(field,"lastpickupdistance"))
plr->airtime = luaL_checkinteger(L, 3);
plr->lastpickupdistance = luaL_checkinteger(L, 3);
else if (fastcmp(field,"airtime"))
plr->airtime = luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastairtime"))

View file

@ -3193,6 +3193,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
sonicloopcamvars_t *loop = &player->loop.camera;
tic_t loop_out = leveltime - loop->enter_tic;
tic_t loop_in = max(leveltime, loop->exit_tic) - loop->exit_tic;
boolean affected_by_loop = (loop_out <=
(loop->zoom_in_speed + loop->zoom_out_speed) && leveltime > introtime);
thiscam->old_x = thiscam->x;
thiscam->old_y = thiscam->y;
@ -3406,8 +3408,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
}
else if (player->exiting) // SRB2Kart: Leave the camera behind while exiting, for dramatic effect!
camstill = true;
else if (lookback || lookbackdelay[num]) // SRB2kart - Camera flipper
else if ((lookback || lookbackdelay[num]) && !affected_by_loop)
{
// SRB2Kart -- Camera flip when looking backwards
#define MAXLOOKBACKDELAY 2
camspeed = FRACUNIT;
if (lookback)
@ -3622,6 +3625,14 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
thiscam->momx = x - thiscam->x;
thiscam->momy = y - thiscam->y;
if (lookback && lookbackdelay[num] && !affected_by_loop) {
// when looking back, camera's momentum
// should inherit the momentum of the player
// plus extra
thiscam->momx += 2*mo->momx;
thiscam->momy += 2*mo->momy;
}
fixed_t z_speed = Easing_Linear(
player->karthud[khud_aircam],
camspeed * 3 / 5,

View file

@ -1197,7 +1197,7 @@ Rloadflats (INT32 i, INT32 w)
texture->patchcount = 1;
texture->holes = false;
texture->flip = 0;
texture->terrain = K_GetTerrainForTextureName(texture->name);
texture->terrainID = K_GetTerrainIDForTextureName(texture->name);
// Allocate information for the texture's patches.
patch = &texture->patches[0];
@ -1335,7 +1335,7 @@ Rloadtextures (INT32 i, INT32 w)
texture->patchcount = 1;
texture->holes = false;
texture->flip = 0;
texture->terrain = K_GetTerrainForTextureName(texture->name);
texture->terrainID = K_GetTerrainIDForTextureName(texture->name);
// Allocate information for the texture's patches.
patch = &texture->patches[0];
@ -1877,7 +1877,7 @@ static texture_t *R_ParseTexture(boolean actuallyLoadTexture)
resultTexture->width = newTextureWidth;
resultTexture->height = newTextureHeight;
resultTexture->type = TEXTURETYPE_COMPOSITE;
resultTexture->terrain = K_GetTerrainForTextureName(newTextureName);
resultTexture->terrainID = K_GetTerrainIDForTextureName(newTextureName);
}
Z_Free(texturesToken);
texturesToken = M_GetToken(NULL);

View file

@ -63,7 +63,7 @@ struct texture_t
boolean holes;
UINT8 flip; // 1 = flipx, 2 = flipy, 3 = both
void *flat; // The texture, as a flat.
terrain_t *terrain;
size_t terrainID;
// All the patches[patchcount] are drawn back to front into the cached texture.
INT16 patchcount;