mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge public master
This commit is contained in:
commit
f8f7ebdc6a
11 changed files with 77 additions and 17 deletions
|
|
@ -225,21 +225,24 @@ void Environment::loadModule(ACSVM::Module *module)
|
||||||
size_t lumpLen = 0;
|
size_t lumpLen = 0;
|
||||||
std::vector<ACSVM::Byte> data;
|
std::vector<ACSVM::Byte> data;
|
||||||
|
|
||||||
if (name->i == (size_t)LUMPERROR)
|
I_Assert(name->i >= 0 && name->i < nummapheaders);
|
||||||
|
const lumpnum_t lumpnum = mapheaderinfo[name->i]->lumpnum;
|
||||||
|
|
||||||
|
if (lumpnum == LUMPERROR)
|
||||||
{
|
{
|
||||||
// No lump given for module.
|
// No lump given for module.
|
||||||
throw ACSVM::ReadError("invalid lump");
|
throw ACSVM::ReadError("invalid lump");
|
||||||
}
|
}
|
||||||
|
|
||||||
lumpLen = W_LumpLength(name->i);
|
lumpLen = W_LumpLength(lumpnum);
|
||||||
|
|
||||||
if (W_IsLumpWad(name->i) == true || lumpLen == 0)
|
if (W_IsLumpWad(lumpnum) == true || lumpLen == 0)
|
||||||
{
|
{
|
||||||
CONS_Debug(DBG_SETUP, "Attempting to load ACS module from the BEHAVIOR lump of map '%s'...\n", name->s->str);
|
CONS_Debug(DBG_SETUP, "Attempting to load ACS module from the BEHAVIOR lump of map '%s'...\n", name->s->str);
|
||||||
|
|
||||||
// The lump given is a virtual resource.
|
// The lump given is a virtual resource.
|
||||||
// Try to grab a BEHAVIOR lump from inside of it.
|
// Try to grab a BEHAVIOR lump from inside of it.
|
||||||
virtres_t *vRes = vres_GetMap(name->i);
|
virtres_t *vRes = vres_GetMap(lumpnum);
|
||||||
auto _ = srb2::finally([vRes]() { vres_Free(vRes); });
|
auto _ = srb2::finally([vRes]() { vres_Free(vRes); });
|
||||||
|
|
||||||
virtlump_t *vLump = vres_Find(vRes, "BEHAVIOR");
|
virtlump_t *vLump = vres_Find(vRes, "BEHAVIOR");
|
||||||
|
|
@ -261,7 +264,7 @@ void Environment::loadModule(ACSVM::Module *module)
|
||||||
ACSVM::Byte *lump = static_cast<ACSVM::Byte *>(Z_Calloc(lumpLen, PU_STATIC, nullptr));
|
ACSVM::Byte *lump = static_cast<ACSVM::Byte *>(Z_Calloc(lumpLen, PU_STATIC, nullptr));
|
||||||
auto _ = srb2::finally([lump]() { Z_Free(lump); });
|
auto _ = srb2::finally([lump]() { Z_Free(lump); });
|
||||||
|
|
||||||
W_ReadLump(name->i, lump);
|
W_ReadLump(lumpnum, lump);
|
||||||
data.insert(data.begin(), lump, lump + lumpLen);
|
data.insert(data.begin(), lump, lump + lumpLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ void ACS_LoadLevelScripts(size_t mapID)
|
||||||
ACSVM::ModuleName name = ACSVM::ModuleName(
|
ACSVM::ModuleName name = ACSVM::ModuleName(
|
||||||
env->getString( mapheaderinfo[mapID]->lumpname ),
|
env->getString( mapheaderinfo[mapID]->lumpname ),
|
||||||
nullptr,
|
nullptr,
|
||||||
mapheaderinfo[mapID]->lumpnum
|
mapID
|
||||||
);
|
);
|
||||||
|
|
||||||
modules.push_back(env->getModule(name));
|
modules.push_back(env->getModule(name));
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
@ -89,8 +90,12 @@ int luaO_rawequalObj (const TValue *t1, const TValue *t2) {
|
||||||
|
|
||||||
int luaO_str2d (const char *s, lua_Number *result) {
|
int luaO_str2d (const char *s, lua_Number *result) {
|
||||||
char *endptr;
|
char *endptr;
|
||||||
double r = lua_str2number(s, &endptr);
|
long r = lua_str2number(s, &endptr);
|
||||||
*result = (lua_Number)r;
|
if (r > INT32_MAX)
|
||||||
|
r = INT32_MAX;
|
||||||
|
else if (r < INT32_MIN)
|
||||||
|
r = INT32_MIN;
|
||||||
|
*result = (lua_Number)r;
|
||||||
if (endptr == s) return 0; /* conversion failed */
|
if (endptr == s) return 0; /* conversion failed */
|
||||||
if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */
|
if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */
|
||||||
*result = cast_num(strtoul(s, &endptr, 16));
|
*result = cast_num(strtoul(s, &endptr, 16));
|
||||||
|
|
|
||||||
|
|
@ -1506,6 +1506,13 @@ void readlevelheader(MYFILE *f, char * name)
|
||||||
|
|
||||||
mapheaderinfo[num]->cameraHeight = camheight;;
|
mapheaderinfo[num]->cameraHeight = camheight;;
|
||||||
}
|
}
|
||||||
|
else if (fastcmp(word, "NOCOMMS") || fastcmp(word, "NOCOMM"))
|
||||||
|
{
|
||||||
|
if (i || word2[0] == 'T' || word2[0] == 'Y')
|
||||||
|
mapheaderinfo[num]->levelflags |= LF_NOCOMMS;
|
||||||
|
else
|
||||||
|
mapheaderinfo[num]->levelflags &= ~LF_NOCOMMS;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
deh_warning("Level header %d: unknown word '%s'", num, word);
|
deh_warning("Level header %d: unknown word '%s'", num, word);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4747,6 +4747,7 @@ struct int_const_s const INT_CONST[] = {
|
||||||
{"LF_NOZONE",LF_NOZONE},
|
{"LF_NOZONE",LF_NOZONE},
|
||||||
{"LF_SECTIONRACE",LF_SECTIONRACE},
|
{"LF_SECTIONRACE",LF_SECTIONRACE},
|
||||||
{"LF_SUBTRACTNUM",LF_SUBTRACTNUM},
|
{"LF_SUBTRACTNUM",LF_SUBTRACTNUM},
|
||||||
|
{"LF_NOCOMMS",LF_NOCOMMS},
|
||||||
// And map flags
|
// And map flags
|
||||||
{"LF2_HIDEINMENU",LF2_HIDEINMENU},
|
{"LF2_HIDEINMENU",LF2_HIDEINMENU},
|
||||||
{"LF2_NOTIMEATTACK",LF2_NOTIMEATTACK},
|
{"LF2_NOTIMEATTACK",LF2_NOTIMEATTACK},
|
||||||
|
|
|
||||||
|
|
@ -605,6 +605,7 @@ struct mapheader_t
|
||||||
#define LF_NOZONE (1<<1) ///< Don't include "ZONE" on level title
|
#define LF_NOZONE (1<<1) ///< Don't include "ZONE" on level title
|
||||||
#define LF_SECTIONRACE (1<<2) ///< Section race level
|
#define LF_SECTIONRACE (1<<2) ///< Section race level
|
||||||
#define LF_SUBTRACTNUM (1<<3) ///< Use subtractive position number (for bright levels)
|
#define LF_SUBTRACTNUM (1<<3) ///< Use subtractive position number (for bright levels)
|
||||||
|
#define LF_NOCOMMS (1<<4) ///< Disable dialogue "communications in progress" graphic
|
||||||
|
|
||||||
#define LF2_HIDEINMENU (1<<0) ///< Hide in the multiplayer menu
|
#define LF2_HIDEINMENU (1<<0) ///< Hide in the multiplayer menu
|
||||||
#define LF2_NOTIMEATTACK (1<<1) ///< Hide this map in Time Attack modes
|
#define LF2_NOTIMEATTACK (1<<1) ///< Hide this map in Time Attack modes
|
||||||
|
|
|
||||||
|
|
@ -3415,6 +3415,11 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
||||||
return; // cap
|
return; // cap
|
||||||
|
|
||||||
blend = HWR_SurfaceBlend(blendmode, trans, &Surf);
|
blend = HWR_SurfaceBlend(blendmode, trans, &Surf);
|
||||||
|
|
||||||
|
// if sprite has PF_ALWAYSONTOP, draw on top of everything.
|
||||||
|
if (cv_debugrender_spriteclip.value || spr->mobj->renderflags & RF_ALWAYSONTOP)
|
||||||
|
blend |= PF_NoDepthTest;
|
||||||
|
|
||||||
if (!trans && !blendmode)
|
if (!trans && !blendmode)
|
||||||
{
|
{
|
||||||
// BP: i agree that is little better in environement but it don't
|
// BP: i agree that is little better in environement but it don't
|
||||||
|
|
@ -3896,6 +3901,11 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
||||||
return; // cap
|
return; // cap
|
||||||
|
|
||||||
blend = HWR_SurfaceBlend(blendmode, trans, &Surf);
|
blend = HWR_SurfaceBlend(blendmode, trans, &Surf);
|
||||||
|
|
||||||
|
// if sprite has PF_ALWAYSONTOP, draw on top of everything.
|
||||||
|
if (cv_debugrender_spriteclip.value || spr->mobj->renderflags & RF_ALWAYSONTOP)
|
||||||
|
blend |= PF_NoDepthTest;
|
||||||
|
|
||||||
if (!trans && !blendmode)
|
if (!trans && !blendmode)
|
||||||
{
|
{
|
||||||
// BP: i agree that is little better in environement but it don't
|
// BP: i agree that is little better in environement but it don't
|
||||||
|
|
@ -3921,7 +3931,10 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
||||||
|
|
||||||
if (HWR_UseShader())
|
if (HWR_UseShader())
|
||||||
{
|
{
|
||||||
shader = (R_ThingIsPaperSprite(spr->mobj) || R_ThingIsFloorSprite(spr->mobj)) ? SHADER_SPRITE : SHADER_SPRITECLIPHACK;;
|
shader = (R_ThingIsPaperSprite(spr->mobj)
|
||||||
|
|| R_ThingIsFloorSprite(spr->mobj)
|
||||||
|
|| (spr->mobj->terrain && spr->mobj->terrain->floorClip)
|
||||||
|
) ? SHADER_SPRITE : SHADER_SPRITECLIPHACK;
|
||||||
blend |= PF_ColorMapped;
|
blend |= PF_ColorMapped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5007,6 +5020,9 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
x1 = tr_x + x1 * rightcos;
|
x1 = tr_x + x1 * rightcos;
|
||||||
x2 = tr_x - x2 * rightcos;
|
x2 = tr_x - x2 * rightcos;
|
||||||
|
|
||||||
|
if (thing->terrain && thing->terrain->floorClip)
|
||||||
|
spr_topoffset -= thing->terrain->floorClip;
|
||||||
|
|
||||||
if (vflip)
|
if (vflip)
|
||||||
{
|
{
|
||||||
gz = FIXED_TO_FLOAT(interp.z + thing->height) - (FIXED_TO_FLOAT(spr_topoffset) * this_yscale);
|
gz = FIXED_TO_FLOAT(interp.z + thing->height) - (FIXED_TO_FLOAT(spr_topoffset) * this_yscale);
|
||||||
|
|
|
||||||
|
|
@ -1723,6 +1723,8 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
||||||
HWD.pfnSetShader(SHADER_MODEL); // model shader
|
HWD.pfnSetShader(SHADER_MODEL); // model shader
|
||||||
{
|
{
|
||||||
float this_scale = FIXED_TO_FLOAT(spr->mobj->scale);
|
float this_scale = FIXED_TO_FLOAT(spr->mobj->scale);
|
||||||
|
fixed_t floorClip = spr->mobj->terrain ? spr->mobj->terrain->floorClip : 0;
|
||||||
|
float finalfloorClip = FIXED_TO_FLOAT(FixedMul(floorClip, mapobjectscale)*P_MobjFlip(spr->mobj));
|
||||||
|
|
||||||
float xs = this_scale * FIXED_TO_FLOAT(spr->mobj->spritexscale);
|
float xs = this_scale * FIXED_TO_FLOAT(spr->mobj->spritexscale);
|
||||||
float ys = this_scale * FIXED_TO_FLOAT(spr->mobj->spriteyscale);
|
float ys = this_scale * FIXED_TO_FLOAT(spr->mobj->spriteyscale);
|
||||||
|
|
@ -1733,7 +1735,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
||||||
// offset perpendicular to the camera angle
|
// offset perpendicular to the camera angle
|
||||||
p.x -= ox * gl_viewsin;
|
p.x -= ox * gl_viewsin;
|
||||||
p.y += ox * gl_viewcos;
|
p.y += ox * gl_viewcos;
|
||||||
p.z += oy;
|
p.z += oy - finalfloorClip;
|
||||||
|
|
||||||
if (R_ThingIsUsingBakedOffsets(spr->mobj))
|
if (R_ThingIsUsingBakedOffsets(spr->mobj))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4320,7 +4320,7 @@ static void K_drawRingCounter(boolean gametypeinfoshown)
|
||||||
if (stplyr->hudrings <= 0 && stplyr->ringvisualwarning > 1)
|
if (stplyr->hudrings <= 0 && stplyr->ringvisualwarning > 1)
|
||||||
{
|
{
|
||||||
colorring = true;
|
colorring = true;
|
||||||
if ((leveltime/2 & 1))
|
if ((leveltime/2 & 1) || (cv_reducevfx.value))
|
||||||
{
|
{
|
||||||
ringmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_CRIMSON, GTC_CACHE);
|
ringmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_CRIMSON, GTC_CACHE);
|
||||||
}
|
}
|
||||||
|
|
@ -4329,7 +4329,7 @@ static void K_drawRingCounter(boolean gametypeinfoshown)
|
||||||
ringmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_WHITE, GTC_CACHE);
|
ringmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_WHITE, GTC_CACHE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (stplyr->hudrings <= 0 && (leveltime/5 & 1)) // In debt
|
else if (stplyr->hudrings <= 0 && ((leveltime/5 & 1) || (cv_reducevfx.value))) // In debt
|
||||||
{
|
{
|
||||||
ringmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_CRIMSON, GTC_CACHE);
|
ringmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_CRIMSON, GTC_CACHE);
|
||||||
colorring = true;
|
colorring = true;
|
||||||
|
|
@ -7793,7 +7793,7 @@ void K_drawKartHUD(void)
|
||||||
|
|
||||||
// Tacitcal Normie Countermeasure
|
// Tacitcal Normie Countermeasure
|
||||||
INT32 dfade = K_GetDialogueFade();
|
INT32 dfade = K_GetDialogueFade();
|
||||||
if (dfade)
|
if (dfade && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOCOMMS))
|
||||||
{
|
{
|
||||||
V_DrawFadeScreen(31, dfade); // Fade out
|
V_DrawFadeScreen(31, dfade); // Fade out
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -290,6 +290,22 @@ private:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cv_reducevfx.value)
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
{ // Near
|
||||||
|
{8, 2, {kp_capsuletarget_near[0]}}, // 1P
|
||||||
|
{{8, 2, {kp_capsuletarget_near[1]}}}, // 4P
|
||||||
|
},
|
||||||
|
{{ // Far
|
||||||
|
{2, 16, foreground ?
|
||||||
|
layers {kp_capsuletarget_far[0], kp_capsuletarget_far_text} :
|
||||||
|
layers {kp_capsuletarget_far[0]}}, // 1P
|
||||||
|
{{2, 16, {kp_capsuletarget_far[1]}}}, // 4P
|
||||||
|
}},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{ // Near
|
{ // Near
|
||||||
{8, 2, {kp_capsuletarget_near[0]}}, // 1P
|
{8, 2, {kp_capsuletarget_near[0]}}, // 1P
|
||||||
|
|
@ -679,13 +695,19 @@ void K_DrawTargetTracking(const TargetTracking& target)
|
||||||
if (target.mobj->type == MT_BATTLECAPSULE
|
if (target.mobj->type == MT_BATTLECAPSULE
|
||||||
|| target.mobj->type == MT_CDUFO)
|
|| target.mobj->type == MT_CDUFO)
|
||||||
{
|
{
|
||||||
targetPatch = kp_capsuletarget_icon[timer & 1];
|
if (cv_reducevfx.value)
|
||||||
|
targetPatch = kp_capsuletarget_icon[(timer/6) & 1];
|
||||||
|
else
|
||||||
|
targetPatch = kp_capsuletarget_icon[timer & 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abs(borderDir.x) > abs(borderDir.y))
|
if (abs(borderDir.x) > abs(borderDir.y))
|
||||||
{
|
{
|
||||||
// Horizontal arrow
|
// Horizontal arrow
|
||||||
arrowPatch = kp_capsuletarget_arrow[1][timer & 1];
|
if (cv_reducevfx.value)
|
||||||
|
arrowPatch = kp_capsuletarget_arrow[1][(timer/6) & 1];
|
||||||
|
else
|
||||||
|
arrowPatch = kp_capsuletarget_arrow[1][timer & 1];
|
||||||
arrowDir.y = 0;
|
arrowDir.y = 0;
|
||||||
|
|
||||||
if (borderDir.x < 0)
|
if (borderDir.x < 0)
|
||||||
|
|
@ -702,7 +724,10 @@ void K_DrawTargetTracking(const TargetTracking& target)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Vertical arrow
|
// Vertical arrow
|
||||||
arrowPatch = kp_capsuletarget_arrow[0][timer & 1];
|
if (cv_reducevfx.value)
|
||||||
|
arrowPatch = kp_capsuletarget_arrow[0][(timer/6) & 1];
|
||||||
|
else
|
||||||
|
arrowPatch = kp_capsuletarget_arrow[0][timer & 1];
|
||||||
arrowDir.x = 0;
|
arrowDir.x = 0;
|
||||||
|
|
||||||
if (borderDir.y < 0)
|
if (borderDir.y < 0)
|
||||||
|
|
|
||||||
|
|
@ -15580,7 +15580,7 @@ mobj_t *P_SPMAngle(mobj_t *source, mobjtype_t type, angle_t angle, UINT8 allowai
|
||||||
//
|
//
|
||||||
void P_FlashPal(player_t *pl, UINT16 type, UINT16 duration)
|
void P_FlashPal(player_t *pl, UINT16 type, UINT16 duration)
|
||||||
{
|
{
|
||||||
if (!pl)
|
if (!pl || cv_reducevfx.value)
|
||||||
return;
|
return;
|
||||||
pl->flashcount = duration;
|
pl->flashcount = duration;
|
||||||
pl->flashpal = type;
|
pl->flashpal = type;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue