Merge branch 'master' into fortnite

This commit is contained in:
TehRealSalt 2019-09-27 06:36:11 -04:00
commit 06d27ae36e
31 changed files with 1179 additions and 525 deletions

View file

@ -17,7 +17,7 @@ set(SRB2_ASSET_HASHED
gfx.pk3;\
textures.pk3;\
chars.pk3;\
maps.wad;\
maps.pk3;\
patch.pk3"
CACHE STRING "Asset filenames to apply MD5 checks. No spaces between entries!"
)

View file

@ -15,7 +15,7 @@
#define ASSET_HASH_GFX_PK3 "${SRB2_ASSET_gfx.pk3_HASH}"
#define ASSET_HASH_TEXTURES_PK3 "${SRB2_ASSET_textures.pk3_HASH}"
#define ASSET_HASH_CHARS_PK3 "${SRB2_ASSET_chars.pk3_HASH}"
#define ASSET_HASH_MAPS_WAD "${SRB2_ASSET_maps.wad_HASH}"
#define ASSET_HASH_MAPS_PK3 "${SRB2_ASSET_maps.pk3_HASH}"
#ifdef USE_PATCH_FILE
#define ASSET_HASH_PATCH_PK3 "${SRB2_ASSET_patch.pk3_HASH}"
#endif
@ -36,7 +36,7 @@
#define ASSET_HASH_GFX_PK3 "00000000000000000000000000000000"
#define ASSET_HASH_TEXTURES_PK3 "00000000000000000000000000000000"
#define ASSET_HASH_CHARS_PK3 "00000000000000000000000000000000"
#define ASSET_HASH_MAPS_WAD "00000000000000000000000000000000"
#define ASSET_HASH_MAPS_PK3 "00000000000000000000000000000000"
#ifdef USE_PATCH_FILE
#define ASSET_HASH_PATCH_PK3 "00000000000000000000000000000000"
#endif

View file

@ -896,11 +896,18 @@ static void IdentifyVersion(void)
D_AddFile(va(pandf,srb2waddir,"gfx.pk3"), startupwadfiles);
D_AddFile(va(pandf,srb2waddir,"textures.pk3"), startupwadfiles);
D_AddFile(va(pandf,srb2waddir,"chars.pk3"), startupwadfiles);
D_AddFile(va(pandf,srb2waddir,"maps.wad"), startupwadfiles); // TODO: make this a pk3 too!
D_AddFile(va(pandf,srb2waddir,"maps.pk3"), startupwadfiles);
#ifdef USE_PATCH_FILE
D_AddFile(va(pandf,srb2waddir,"patch.pk3"), startupwadfiles);
#endif
#if 0
// TODO: pk3 doesn't support music replacement IIRC
// music barely benefits from the compression anyway
// would be nice for the folders, though
D_AddFile(va(pandf,srb2waddir,"sounds.pk3"), startupwadfiles);
D_AddFile(va(pandf,srb2waddir,"music.pk3"), startupwadfiles);
#else
#if !defined (HAVE_SDL) || defined (HAVE_MIXER)
#define MUSICTEST(str) \
{\
@ -915,6 +922,7 @@ static void IdentifyVersion(void)
MUSICTEST("music.wad")
#undef MUSICTEST
#endif
#endif
}
/* ======================================================================== */
@ -1200,7 +1208,7 @@ void D_SRB2Main(void)
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_GFX_PK3); // gfx.pk3
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_TEXTURES_PK3); // textures.pk3
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_CHARS_PK3); // chars.pk3
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_MAPS_WAD); // maps.wad -- 4 - If you touch this, make sure to touch up the majormods stuff below.
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_MAPS_PK3); // maps.pk3 -- 4 - If you touch this, make sure to touch up the majormods stuff below.
#ifdef USE_PATCH_FILE
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_PATCH_PK3); // patch.pk3
#endif
@ -1208,7 +1216,7 @@ void D_SRB2Main(void)
mainwads++; // gfx.pk3
mainwads++; // textures.pk3
mainwads++; // chars.pk3
mainwads++; // maps.wad
mainwads++; // maps.pk3
#ifdef USE_PATCH_FILE
mainwads++; // patch.pk3
#endif

View file

@ -327,6 +327,9 @@ typedef enum
k_jawztargetdelay, // Delay for Jawz target switching, to make it less twitchy
k_spectatewait, // How long have you been waiting as a spectator
k_growcancel, // Hold the item button down to cancel Grow
k_tiregrease, // Reduced friction timer after hitting a horizontal spring
k_springstars, // Spawn stars around a player when they hit a spring
k_springcolor, // Color of spring stars
k_killfield, // How long have you been in the kill field, stay in too long and lose a bumper
NUMKARTSTUFF

View file

@ -1230,8 +1230,9 @@ static void readlevelheader(MYFILE *f, INT32 num)
}
else if (fastcmp(word, "WEATHER"))
mapheaderinfo[num-1]->weather = (UINT8)get_number(word2);
else if (fastcmp(word, "SKYNUM"))
mapheaderinfo[num-1]->skynum = (INT16)i;
else if (fastcmp(word, "SKYTEXTURE"))
deh_strlcpy(mapheaderinfo[num-1]->skytexture, word2,
sizeof(mapheaderinfo[num-1]->skytexture), va("Level header %d: sky texture", num));
else if (fastcmp(word, "INTERSCREEN"))
strncpy(mapheaderinfo[num-1]->interscreen, word2, 8);
else if (fastcmp(word, "PRECUTSCENENUM"))
@ -5609,44 +5610,77 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_RBIRD2",
"S_RBIRD3",
"S_YELLOWSPRING",
// Yellow Spring
"S_YELLOWSPRING1",
"S_YELLOWSPRING2",
"S_YELLOWSPRING3",
"S_YELLOWSPRING4",
"S_YELLOWSPRING5",
"S_REDSPRING",
// Red Spring
"S_REDSPRING1",
"S_REDSPRING2",
"S_REDSPRING3",
"S_REDSPRING4",
"S_REDSPRING5",
// Blue Springs
"S_BLUESPRING",
// Blue Spring
"S_BLUESPRING1",
"S_BLUESPRING2",
"S_BLUESPRING3",
"S_BLUESPRING4",
"S_BLUESPRING5",
// Grey Spring
"S_GREYSPRING1",
"S_GREYSPRING2",
"S_GREYSPRING3",
"S_GREYSPRING4",
// Yellow Diagonal Spring
"S_YDIAG1",
"S_YDIAG2",
"S_YDIAG3",
"S_YDIAG4",
"S_YDIAG5",
"S_YDIAG6",
"S_YDIAG7",
"S_YDIAG8",
// Red Diagonal Spring
"S_RDIAG1",
"S_RDIAG2",
"S_RDIAG3",
"S_RDIAG4",
"S_RDIAG5",
"S_RDIAG6",
"S_RDIAG7",
"S_RDIAG8",
// Blue Diagonal Spring
"S_BDIAG1",
"S_BDIAG2",
"S_BDIAG3",
"S_BDIAG4",
// Grey Diagonal Spring
"S_GDIAG1",
"S_GDIAG2",
"S_GDIAG3",
"S_GDIAG4",
// Yellow Horizontal Spring
"S_YHORIZ1",
"S_YHORIZ2",
"S_YHORIZ3",
"S_YHORIZ4",
// Red Horizontal Spring
"S_RHORIZ1",
"S_RHORIZ2",
"S_RHORIZ3",
"S_RHORIZ4",
// Blue Horizontal Spring
"S_BHORIZ1",
"S_BHORIZ2",
"S_BHORIZ3",
"S_BHORIZ4",
// Grey Horizontal Spring
"S_GHORIZ1",
"S_GHORIZ2",
"S_GHORIZ3",
"S_GHORIZ4",
// Rain
"S_RAIN1",
@ -6271,26 +6305,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_SRB1_GENREX1",
"S_SRB1_GENREX2",
// Gray Springs
"S_GRAYSPRING",
"S_GRAYSPRING2",
"S_GRAYSPRING3",
"S_GRAYSPRING4",
"S_GRAYSPRING5",
// Invis-spring - this is used just for the sproing sound.
"S_INVISSPRING",
// Blue Diagonal Spring
"S_BDIAG1",
"S_BDIAG2",
"S_BDIAG3",
"S_BDIAG4",
"S_BDIAG5",
"S_BDIAG6",
"S_BDIAG7",
"S_BDIAG8",
//{ Random Item Box
"S_RANDOMITEM1",
"S_RANDOMITEM2",
@ -7199,6 +7213,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_DRAFTDUST4",
"S_DRAFTDUST5",
"S_TIREGREASE",
"S_OVERTIMEFOG",
"S_OVERTIMEORB",
"S_OVERTIMEBEAM",
@ -7332,11 +7348,18 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
// Springs and others
"MT_FAN",
"MT_STEAM", // Steam riser
"MT_BLUESPRING",
"MT_YELLOWSPRING",
"MT_REDSPRING",
"MT_BLUESPRING",
"MT_GREYSPRING",
"MT_YELLOWDIAG", // Yellow Diagonal Spring
"MT_REDDIAG", // Red Diagonal Spring
"MT_BLUEDIAG", // Blue Diagonal Spring
"MT_GREYDIAG", // Grey Diagonal Spring
"MT_YELLOWHORIZ", // Yellow Horizontal Spring
"MT_REDHORIZ", // Red Horizontal Spring
"MT_BLUEHORIZ", // Blue Horizontal Spring
"MT_GREYHORIZ", // Grey Horizontal Spring
// Interactive Objects
"MT_BUBBLES", // Bubble source
@ -7718,9 +7741,6 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_SRB1_GENREX",
// SRB2kart
"MT_GRAYSPRING",
"MT_INVISSPRING",
"MT_BLUEDIAG",
"MT_RANDOMITEM",
"MT_RANDOMITEMPOP",
"MT_FLOATINGITEM",
@ -7991,6 +8011,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_KARMAFIREWORK",
"MT_RINGSPARKS",
"MT_DRAFTDUST",
"MT_TIREGREASE",
"MT_OVERTIMEFOG",
"MT_OVERTIMEORB",
@ -8482,6 +8503,9 @@ static const char *const KARTSTUFF_LIST[] = {
"JAWZTARGETDELAY",
"SPECTATEWAIT",
"GROWCANCEL",
"TIREGREASE",
"SPRINGSTARS",
"SPRINGCOLOR",
"KILLFIELD"
};
#endif
@ -9912,11 +9936,11 @@ static inline int lib_getenum(lua_State *L)
} else if (fastcmp(word,"globalweather")) {
lua_pushinteger(L, globalweather);
return 1;
} else if (fastcmp(word,"levelskynum")) {
lua_pushinteger(L, levelskynum);
} else if (fastcmp(word,"levelskytexture")) {
lua_pushstring(L, levelskytexture);
return 1;
} else if (fastcmp(word,"globallevelskynum")) {
lua_pushinteger(L, globallevelskynum);
} else if (fastcmp(word,"globallevelskytexture")) {
lua_pushstring(L, globallevelskytexture);
return 1;
} else if (fastcmp(word,"mapmusname")) {
lua_pushstring(L, mapmusname);

View file

@ -227,7 +227,7 @@ typedef struct
UINT32 muspos; ///< Music position to jump to.
char forcecharacter[17]; ///< (SKINNAMESIZE+1) Skin to switch to or "" to disable.
UINT8 weather; ///< 0 = sunny day, 1 = storm, 2 = snow, 3 = rain, 4 = blank, 5 = thunder w/o rain, 6 = rain w/o lightning, 7 = heat wave.
INT16 skynum; ///< Sky number to use.
char skytexture[9]; ///< Sky texture to use.
INT16 skybox_scalex; ///< Skybox X axis scale. (0 = no movement, 1 = 1:1 movement, 16 = 16:1 slow movement, -4 = 1:4 fast movement, etc.)
INT16 skybox_scaley; ///< Skybox Y axis scale.
INT16 skybox_scalez; ///< Skybox Z axis scale.
@ -435,6 +435,7 @@ extern INT32 sneakertime;
extern INT32 itemtime;
extern INT32 comebacktime;
extern INT32 bumptime;
extern INT32 greasetics;
extern INT32 wipeoutslowtime;
extern INT32 wantedreduce;
extern INT32 wantedfrequency;

View file

@ -216,6 +216,7 @@ INT32 sneakertime = TICRATE + (TICRATE/3);
INT32 itemtime = 8*TICRATE;
INT32 comebacktime = 10*TICRATE;
INT32 bumptime = 6;
INT32 greasetics = 3*TICRATE;
INT32 wipeoutslowtime = 20;
INT32 wantedreduce = 5*TICRATE;
INT32 wantedfrequency = 10*TICRATE;
@ -3645,7 +3646,7 @@ tryagain:
void G_AddMapToBuffer(INT16 map)
{
INT16 bufx, refreshnum = (TOLMaps(G_TOLFlag(gametype)) / 2) + 1;
INT16 bufx, refreshnum = max(0, TOLMaps(G_TOLFlag(gametype))-3);
// Add the map to the buffer.
for (bufx = NUMMAPS-1; bufx > 0; bufx--)

View file

@ -5922,13 +5922,15 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
static void HWR_DrawSkyBackground(void)
{
FOutVector v[4];
texture_t *tex;
angle_t angle;
float dimensionmultiply;
float aspectratio;
float angleturn;
tex = textures[texturetranslation[skytexture]];
HWR_GetTexture(texturetranslation[skytexture]);
aspectratio = (float)vid.width/(float)vid.height;
aspectratio = (float)vid.width / (float)vid.height;
//Hurdler: the sky is the only texture who need 4.0f instead of 1.0
// because it's called just after clearing the screen
@ -5952,22 +5954,22 @@ static void HWR_DrawSkyBackground(void)
// software doesn't draw any further than 1024 for skies anyway, but this doesn't overlap properly
// The only time this will probably be an issue is when a sky wider than 1024 is used as a sky AND a regular wall texture
angle = (dup_viewangle + gr_xtoviewangle[0]);
dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->width/256.0f);
angle = -(dup_viewangle + gr_xtoviewangle[0]);
dimensionmultiply = ((float)tex->width/256.0f);
if (atransform.mirror)
{
angle = InvAngle(angle);
dimensionmultiply *= -1;
dimensionmultiply = -dimensionmultiply;
}
v[0].sow = v[3].sow = ((float) angle / ((ANGLE_90-1)*dimensionmultiply));
v[2].sow = v[1].sow = (-1.0f/dimensionmultiply)+((float) angle / ((ANGLE_90-1)*dimensionmultiply));
v[2].sow = v[1].sow = (1.0f/dimensionmultiply)+((float) angle / ((ANGLE_90-1)*dimensionmultiply));
// Y
angle = aimingangle;
dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->height/(128.0f*aspectratio));
dimensionmultiply = ((float)tex->height/(128.0f*aspectratio));
if (splitscreen == 1)
{

View file

@ -653,13 +653,12 @@ spritemd2found:
// 0.2126 to red
// 0.7152 to green
// 0.0722 to blue
// (See this same define in k_kart.c!)
// (See this same define in hw_md2.c!)
#define SETBRIGHTNESS(brightness,r,g,b) \
brightness = (UINT8)(((1063*((UINT16)r)/5000) + (3576*((UINT16)g)/5000) + (361*((UINT16)b)/5000)) / 3)
brightness = (UINT8)(((1063*(UINT16)(r))/5000) + ((3576*(UINT16)(g))/5000) + ((361*(UINT16)(b))/5000))
static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, GLMipmap_t *grmip, INT32 skinnum, skincolors_t color)
{
UINT8 i;
UINT16 w = gpatch->width, h = gpatch->height;
UINT32 size = w*h;
RGBA_t *image, *blendimage, *cur, blendcolor;
@ -684,102 +683,188 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
image = gpatch->mipmap.grInfo.data;
blendimage = blendgpatch->mipmap.grInfo.data;
blendcolor = V_GetColor(0); // initialize
// Average all of the translation's colors
while (size--)
{
const UINT8 div = 6;
const UINT8 start = 4;
UINT32 r, g, b;
UINT16 brightness;
blendcolor = V_GetColor(colortranslations[color][start]);
r = (UINT32)(blendcolor.s.red*blendcolor.s.red);
g = (UINT32)(blendcolor.s.green*blendcolor.s.green);
b = (UINT32)(blendcolor.s.blue*blendcolor.s.blue);
for (i = 1; i < div; i++)
{
RGBA_t nextcolor = V_GetColor(colortranslations[color][start+i]);
r += (UINT32)(nextcolor.s.red*nextcolor.s.red);
g += (UINT32)(nextcolor.s.green*nextcolor.s.green);
b += (UINT32)(nextcolor.s.blue*nextcolor.s.blue);
}
blendcolor.s.red = (UINT8)(FixedSqrt((r/div)<<FRACBITS)>>FRACBITS);
blendcolor.s.green = (UINT8)(FixedSqrt((g/div)<<FRACBITS)>>FRACBITS);
blendcolor.s.blue = (UINT8)(FixedSqrt((b/div)<<FRACBITS)>>FRACBITS);
}
// rainbow support, could theoretically support boss ones too
if (skinnum == TC_RAINBOW)
{
while (size--)
// Don't bother with blending the pixel if the alpha of the blend pixel is 0
if (skinnum == TC_RAINBOW)
{
if (image->s.alpha == 0 && blendimage->s.alpha == 0)
{
// Don't bother with blending the pixel if the alpha of the blend pixel is 0
cur->rgba = image->rgba;
cur++; image++; blendimage++;
continue;
}
else
{
UINT32 tempcolor;
UINT16 imagebright, blendbright, finalbright, colorbright;
UINT16 imagebright, blendbright;
SETBRIGHTNESS(imagebright,image->s.red,image->s.green,image->s.blue);
SETBRIGHTNESS(blendbright,blendimage->s.red,blendimage->s.green,blendimage->s.blue);
// slightly dumb average between the blend image color and base image colour, usually one or the other will be fully opaque anyway
finalbright = (imagebright*(255-blendimage->s.alpha))/255 + (blendbright*blendimage->s.alpha)/255;
SETBRIGHTNESS(colorbright,blendcolor.s.red,blendcolor.s.green,blendcolor.s.blue);
tempcolor = (finalbright*blendcolor.s.red)/colorbright;
tempcolor = min(255, tempcolor);
cur->s.red = (UINT8)tempcolor;
tempcolor = (finalbright*blendcolor.s.green)/colorbright;
tempcolor = min(255, tempcolor);
cur->s.green = (UINT8)tempcolor;
tempcolor = (finalbright*blendcolor.s.blue)/colorbright;
tempcolor = min(255, tempcolor);
cur->s.blue = (UINT8)tempcolor;
cur->s.alpha = image->s.alpha;
brightness = (imagebright*(255-blendimage->s.alpha))/255 + (blendbright*blendimage->s.alpha)/255;
}
cur++; image++; blendimage++;
}
}
else
{
while (size--)
else
{
if (blendimage->s.alpha == 0)
{
// Don't bother with blending the pixel if the alpha of the blend pixel is 0
cur->rgba = image->rgba;
cur++; image++; blendimage++;
continue;
}
else
{
INT32 tempcolor;
INT16 tempmult, tempalpha;
tempalpha = -(abs(blendimage->s.red-127)-127)*2;
if (tempalpha > 255)
tempalpha = 255;
else if (tempalpha < 0)
tempalpha = 0;
SETBRIGHTNESS(brightness,blendimage->s.red,blendimage->s.green,blendimage->s.blue);
}
}
tempmult = (blendimage->s.red-127)*2;
if (tempmult > 255)
tempmult = 255;
else if (tempmult < 0)
tempmult = 0;
// Calculate a sort of "gradient" for the skincolor
// (Me splitting this into a function didn't work, so I had to ruin this entire function's groove...)
{
RGBA_t nextcolor;
UINT8 firsti, secondi, mul;
UINT32 r, g, b;
tempcolor = (image->s.red*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.red)/255)) * blendimage->s.alpha)/255;
cur->s.red = (UINT8)tempcolor;
tempcolor = (image->s.green*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.green)/255)) * blendimage->s.alpha)/255;
cur->s.green = (UINT8)tempcolor;
tempcolor = (image->s.blue*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.blue)/255)) * blendimage->s.alpha)/255;
cur->s.blue = (UINT8)tempcolor;
cur->s.alpha = image->s.alpha;
// Rainbow needs to find the closest match to the textures themselves, instead of matching brightnesses to other colors.
// Ensue horrible mess.
if (skinnum == TC_RAINBOW)
{
UINT16 brightdif = 256;
UINT8 colorbrightnesses[16];
INT32 compare, m, d;
UINT8 i;
// Ignore pure white & pitch black
if (brightness > 253 || brightness < 2)
{
cur->rgba = image->rgba;
cur++; image++; blendimage++;
continue;
}
firsti = 0;
mul = 0;
for (i = 0; i < 16; i++)
{
RGBA_t tempc = V_GetColor(colortranslations[color][i]);
SETBRIGHTNESS(colorbrightnesses[i], tempc.s.red, tempc.s.green, tempc.s.blue); // store brightnesses for comparison
}
for (i = 0; i < 16; i++)
{
if (brightness > colorbrightnesses[i]) // don't allow greater matches (because calculating a makeshift gradient for this is already a huge mess as is)
continue;
compare = abs((INT16)(colorbrightnesses[i]) - (INT16)(brightness));
if (compare < brightdif)
{
brightdif = (UINT16)compare;
firsti = i; // best matching color that's equal brightness or darker
}
}
secondi = firsti+1; // next color in line
if (secondi == 16)
{
m = (INT16)brightness; // - 0;
d = (INT16)colorbrightnesses[firsti]; // - 0;
}
else
{
m = (INT16)brightness - (INT16)colorbrightnesses[secondi];
d = (INT16)colorbrightnesses[firsti] - (INT16)colorbrightnesses[secondi];
}
if (m >= d)
m = d-1;
// calculate the "gradient" multiplier based on how close this color is to the one next in line
if (m <= 0 || d <= 0)
mul = 0;
else
mul = 15 - ((m * 16) / d);
}
else
{
// Thankfully, it's normally way more simple.
// Just convert brightness to a skincolor value, use remainder to find the gradient multipler
firsti = ((UINT8)(255-brightness) / 16);
secondi = firsti+1;
mul = ((UINT8)(255-brightness) % 16);
}
cur++; image++; blendimage++;
blendcolor = V_GetColor(colortranslations[color][firsti]);
if (mul > 0 // If it's 0, then we only need the first color.
&& colortranslations[color][firsti] != colortranslations[color][secondi]) // Some colors have duplicate colors in a row, so let's just save the process
{
if (secondi == 16) // blend to black
nextcolor = V_GetColor(31);
else
nextcolor = V_GetColor(colortranslations[color][secondi]);
// Find difference between points
r = (UINT32)(nextcolor.s.red - blendcolor.s.red);
g = (UINT32)(nextcolor.s.green - blendcolor.s.green);
b = (UINT32)(nextcolor.s.blue - blendcolor.s.blue);
// Find the gradient of the two points
r = ((mul * r) / 16);
g = ((mul * g) / 16);
b = ((mul * b) / 16);
// Add gradient value to color
blendcolor.s.red += r;
blendcolor.s.green += g;
blendcolor.s.blue += b;
}
}
if (skinnum == TC_RAINBOW)
{
UINT32 tempcolor;
UINT16 colorbright;
SETBRIGHTNESS(colorbright,blendcolor.s.red,blendcolor.s.green,blendcolor.s.blue);
if (colorbright == 0)
colorbright = 1; // no dividing by 0 please
tempcolor = (brightness * blendcolor.s.red) / colorbright;
tempcolor = min(255, tempcolor);
cur->s.red = (UINT8)tempcolor;
tempcolor = (brightness * blendcolor.s.green) / colorbright;
tempcolor = min(255, tempcolor);
cur->s.green = (UINT8)tempcolor;
tempcolor = (brightness * blendcolor.s.blue) / colorbright;
tempcolor = min(255, tempcolor);
cur->s.blue = (UINT8)tempcolor;
cur->s.alpha = image->s.alpha;
}
else
{
// Color strength depends on image alpha
INT32 tempcolor;
tempcolor = ((image->s.red * (255-blendimage->s.alpha)) / 255) + ((blendcolor.s.red * blendimage->s.alpha) / 255);
tempcolor = min(255, tempcolor);
cur->s.red = (UINT8)tempcolor;
tempcolor = ((image->s.green * (255-blendimage->s.alpha)) / 255) + ((blendcolor.s.green * blendimage->s.alpha) / 255);
tempcolor = min(255, tempcolor);
cur->s.green = (UINT8)tempcolor;
tempcolor = ((image->s.blue * (255-blendimage->s.alpha)) / 255) + ((blendcolor.s.blue * blendimage->s.alpha) / 255);
tempcolor = min(255, tempcolor);
cur->s.blue = (UINT8)tempcolor;
cur->s.alpha = image->s.alpha;
}
cur++; image++; blendimage++;
}
return;
@ -1091,11 +1176,11 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
#ifdef USE_FTRANSFORM_ANGLEZ
// Slope rotation from Kart
p.anglez = 0.0f;
if (spr->mobj->standingslope)
if (spr->mobj->modeltilt)
{
fixed_t tempz = spr->mobj->standingslope->normal.z;
fixed_t tempy = spr->mobj->standingslope->normal.y;
fixed_t tempx = spr->mobj->standingslope->normal.x;
fixed_t tempz = spr->mobj->modeltilt->normal.z;
fixed_t tempy = spr->mobj->modeltilt->normal.y;
fixed_t tempx = spr->mobj->modeltilt->normal.x;
fixed_t tempangle = AngleFixed(R_PointToAngle2(0, 0, FixedSqrt(FixedMul(tempy, tempy) + FixedMul(tempz, tempz)), tempx));
p.anglez = FIXED_TO_FLOAT(tempangle);
tempangle = -AngleFixed(R_PointToAngle2(0, 0, tempz, tempy));

View file

@ -43,33 +43,34 @@ char sprnames[NUMSPRITES + 1][5] =
"DFLM","XMS1","XMS2","XMS3","BSZ1","BSZ2","BSZ3","BSZ4","BSZ5","BSZ6",
"BSZ7","BSZ8","STLG","DBAL","RCRY","ARMA","ARMF","ARMB","WIND","MAGN",
"ELEM","FORC","PITY","IVSP","SSPK","GOAL","BIRD","BUNY","MOUS","CHIC",
"COWZ","RBRD","SPRY","SPRR","SPRB","YSPR","RSPR","RAIN","SNO1","SPLH",
"SPLA","SMOK","BUBP","BUBO","BUBN","BUBM","POPP","TFOG","SEED","PRTL",
"SCOR","DRWN","TTAG","GFLG","RRNG","RNGB","RNGR","RNGI","RNGA","RNGE",
"RNGS","RNGG","PIKB","PIKR","PIKA","PIKE","PIKS","PIKG","TAUT","TGRE",
"TSCR","COIN","CPRK","GOOM","BGOM","FFWR","FBLL","SHLL","PUMA","HAMM",
"KOOP","BFLM","MAXE","MUS1","MUS2","TOAD","NDRN","SUPE","SUPZ","NDRL",
"NSPK","NBMP","HOOP","NSCR","NPRU","CAPS","SUPT","SPRK","BOM1","BOM2",
"BOM3","BOM4","ROIA","ROIB","ROIC","ROID","ROIE","ROIF","ROIG","ROIH",
"ROII","ROIJ","ROIK","ROIL","ROIM","ROIN","ROIO","ROIP","BBAL","GWLG",
"GWLR","SRBA","SRBB","SRBC","SRBD","SRBE","SRBF","SRBG","SRBH","SRBI",
"SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO",
"COWZ","RBRD","SPVY","SPVR","SPVB","SPVG","SPDY","SPDR","SPDB","SPDG",
"SPHY","SPHR","SPHB","SPHG","RAIN","SNO1","SPLH","SPLA","SMOK","BUBP",
"BUBO","BUBN","BUBM","POPP","TFOG","SEED","PRTL","SCOR","DRWN","TTAG",
"GFLG","RRNG","RNGB","RNGR","RNGI","RNGA","RNGE","RNGS","RNGG","PIKB",
"PIKR","PIKA","PIKE","PIKS","PIKG","TAUT","TGRE","TSCR","COIN","CPRK",
"GOOM","BGOM","FFWR","FBLL","SHLL","PUMA","HAMM","KOOP","BFLM","MAXE",
"MUS1","MUS2","TOAD","NDRN","SUPE","SUPZ","NDRL","NSPK","NBMP","HOOP",
"NSCR","NPRU","CAPS","SUPT","SPRK","BOM1","BOM2","BOM3","BOM4","ROIA",
"ROIB","ROIC","ROID","ROIE","ROIF","ROIG","ROIH","ROII","ROIJ","ROIK",
"ROIL","ROIM","ROIN","ROIO","ROIP","BBAL","GWLG","GWLR","SRBA","SRBB",
"SRBC","SRBD","SRBE","SRBF","SRBG","SRBH","SRBI","SRBJ","SRBK","SRBL",
"SRBM","SRBN","SRBO",
//SRB2kart Sprites
"SPRG","BSPR","RNDM","RPOP","SGNS","FAST","DSHR","BOST","BOSM","KFRE",
"KINV","KINF","WIPD","DRIF","BDRF","DUST","RSHE","FITM","BANA","ORBN",
"JAWZ","SSMN","KRBM","BHOG","BHBM","SPBM","THNS","SINK","SITR","KBLN",
"DEZL","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM",
"SACO","CRAB","SHAD","BRNG","BUMP","FLEN","CLAS","PSHW","ISTA","ISTB",
"ARRO","ITEM","ITMO","ITMI","ITMN","WANT","PBOM","HIT1","HIT2","HIT3",
"RETI","AIDU","KSPK","LZI1","LZI2","KLIT","FZSM","FZBM","FPRT","SBUS",
"MARB","FUFO","RUST","BLON","VAPE","HTZA","HTZB","SGVA","SGVB","SGVC",
"PGTR","PGF1","PGF2","PGF3","PGBH","DPLR","SPTL","ENM1","GARU","MARR",
"REAP","JITB","CDMO","CDBU","PINE","PPLR","DPPT","AATR","COCO","BDST",
"FROG","CBRA","HOLE","BBRA","EGFG","SMKP","MTYM","THWP","SNOB","ICEB",
"CNDL","DOCH","DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS","ZTCH",
"MKMA","MKMP","RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH","BFRT",
"OFRT","RFRT","PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN","FWRK",
"MXCL","RGSP","DRAF","OTFG","XMS4","XMS5","VIEW"
"RNDM","RPOP","SGNS","FAST","DSHR","BOST","BOSM","KFRE","KINV","KINF",
"WIPD","DRIF","BDRF","DUST","RSHE","FITM","BANA","ORBN","JAWZ","SSMN",
"KRBM","BHOG","BHBM","SPBM","THNS","SINK","SITR","KBLN","DEZL","POKE",
"AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM","SACO","CRAB",
"SHAD","BRNG","BUMP","FLEN","CLAS","PSHW","ISTA","ISTB","ARRO","ITEM",
"ITMO","ITMI","ITMN","WANT","PBOM","HIT1","HIT2","HIT3","RETI","AIDU",
"KSPK","LZI1","LZI2","KLIT","FZSM","FZBM","FPRT","SBUS","MARB","FUFO",
"RUST","BLON","VAPE","HTZA","HTZB","SGVA","SGVB","SGVC","PGTR","PGF1",
"PGF2","PGF3","PGBH","DPLR","SPTL","ENM1","GARU","MARR","REAP","JITB",
"CDMO","CDBU","PINE","PPLR","DPPT","AATR","COCO","BDST","FROG","CBRA",
"HOLE","BBRA","EGFG","SMKP","MTYM","THWP","SNOB","ICEB","CNDL","DOCH",
"DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS","ZTCH","MKMA","MKMP",
"RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH","BFRT","OFRT","RFRT",
"PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN","FWRK","MXCL","RGSP",
"DRAF","GRES","OTFG","XMS4","XMS5","VIEW"
};
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
@ -1795,45 +1796,76 @@ state_t states[NUMSTATES] =
{SPR_RBRD, 1, 4, {A_Chase}, 0, 0, S_RBIRD2}, // S_RBIRD3
// Yellow Spring
{SPR_SPRY, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YELLOWSPRING
{SPR_SPRY, 4, 4, {A_Pain}, 0, 0, S_YELLOWSPRING3}, // S_YELLOWSPRING2
{SPR_SPRY, 3, 1, {NULL}, 0, 0, S_YELLOWSPRING4}, // S_YELLOWSPRING3
{SPR_SPRY, 2, 1, {NULL}, 0, 0, S_YELLOWSPRING5}, // S_YELLOWSPRING4
{SPR_SPRY, 1, 1, {NULL}, 0, 0, S_YELLOWSPRING}, // S_YELLOWSPRING5
{SPR_SPVY, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YELLOWSPRING1
{SPR_SPVY, 1, 1, {A_Pain}, 0, 0, S_YELLOWSPRING3}, // S_YELLOWSPRING2
{SPR_SPVY, 0, 1, {NULL}, 0, 0, S_YELLOWSPRING4}, // S_YELLOWSPRING3
{SPR_SPVY, 2, 4, {NULL}, 0, 0, S_YELLOWSPRING1}, // S_YELLOWSPRING4
// Red Spring
{SPR_SPRR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_REDSPRING
{SPR_SPRR, 4, 4, {A_Pain}, 0, 0, S_REDSPRING3}, // S_REDSPRING2
{SPR_SPRR, 3, 1, {NULL}, 0, 0, S_REDSPRING4}, // S_REDSPRING3
{SPR_SPRR, 2, 1, {NULL}, 0, 0, S_REDSPRING5}, // S_REDSPRING4
{SPR_SPRR, 1, 1, {NULL}, 0, 0, S_REDSPRING}, // S_REDSPRING5
{SPR_SPVR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_REDSPRING1
{SPR_SPVR, 1, 1, {A_Pain}, 0, 0, S_REDSPRING3}, // S_REDSPRING2
{SPR_SPVR, 0, 1, {NULL}, 0, 0, S_REDSPRING4}, // S_REDSPRING3
{SPR_SPVR, 2, 4, {NULL}, 0, 0, S_REDSPRING1}, // S_REDSPRING4
// Blue Spring
{SPR_SPRB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BLUESPRING
{SPR_SPRB, 4, 4, {A_Pain}, 0, 0, S_BLUESPRING3}, // S_BLUESPRING2
{SPR_SPRB, 3, 1, {NULL}, 0, 0, S_BLUESPRING4}, // S_BLUESPRING3
{SPR_SPRB, 2, 1, {NULL}, 0, 0, S_BLUESPRING5}, // S_BLUESPRING4
{SPR_SPRB, 1, 1, {NULL}, 0, 0, S_BLUESPRING}, // S_BLUESPRING5
{SPR_SPVB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BLUESPRING1
{SPR_SPVB, 1, 1, {A_Pain}, 0, 0, S_BLUESPRING3}, // S_BLUESPRING2
{SPR_SPVB, 0, 1, {NULL}, 0, 0, S_BLUESPRING4}, // S_BLUESPRING3
{SPR_SPVB, 2, 4, {NULL}, 0, 0, S_BLUESPRING1}, // S_BLUESPRING4
// Grey Spring
{SPR_SPVG, 0, -1, {NULL}, 0, 0, S_NULL}, // S_GREYSPRING1
{SPR_SPVG, 1, 1, {A_Pain}, 0, 0, S_GREYSPRING3}, // S_GREYSPRING2
{SPR_SPVG, 0, 1, {NULL}, 0, 0, S_GREYSPRING4}, // S_GREYSPRING3
{SPR_SPVG, 2, 4, {NULL}, 0, 0, S_GREYSPRING1}, // S_GREYSPRING4
// Yellow Diagonal Spring
{SPR_YSPR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YDIAG1
{SPR_YSPR, 1, 1, {A_Pain}, 0, 0, S_YDIAG3}, // S_YDIAG2
{SPR_YSPR, 2, 1, {NULL}, 0, 0, S_YDIAG4}, // S_YDIAG3
{SPR_YSPR, 3, 1, {NULL}, 0, 0, S_YDIAG5}, // S_YDIAG4
{SPR_YSPR, 4, 1, {NULL}, 0, 0, S_YDIAG6}, // S_YDIAG5
{SPR_YSPR, 3, 1, {NULL}, 0, 0, S_YDIAG7}, // S_YDIAG6
{SPR_YSPR, 2, 1, {NULL}, 0, 0, S_YDIAG8}, // S_YDIAG7
{SPR_YSPR, 1, 1, {NULL}, 0, 0, S_YDIAG1}, // S_YDIAG8
{SPR_SPDY, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YDIAG1
{SPR_SPDY, 1, 1, {A_Pain}, 0, 0, S_YDIAG3}, // S_YDIAG2
{SPR_SPDY, 0, 1, {NULL}, 0, 0, S_YDIAG4}, // S_YDIAG3
{SPR_SPDY, 2, 4, {NULL}, 0, 0, S_YDIAG1}, // S_YDIAG4
// Red Diagonal Spring
{SPR_RSPR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_RDIAG1
{SPR_RSPR, 1, 1, {A_Pain}, 0, 0, S_RDIAG3}, // S_RDIAG2
{SPR_RSPR, 2, 1, {NULL}, 0, 0, S_RDIAG4}, // S_RDIAG3
{SPR_RSPR, 3, 1, {NULL}, 0, 0, S_RDIAG5}, // S_RDIAG4
{SPR_RSPR, 4, 1, {NULL}, 0, 0, S_RDIAG6}, // S_RDIAG5
{SPR_RSPR, 3, 1, {NULL}, 0, 0, S_RDIAG7}, // S_RDIAG6
{SPR_RSPR, 2, 1, {NULL}, 0, 0, S_RDIAG8}, // S_RDIAG7
{SPR_RSPR, 1, 1, {NULL}, 0, 0, S_RDIAG1}, // S_RDIAG8
{SPR_SPDR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_RDIAG1
{SPR_SPDR, 1, 1, {A_Pain}, 0, 0, S_RDIAG3}, // S_RDIAG2
{SPR_SPDR, 0, 1, {NULL}, 0, 0, S_RDIAG4}, // S_RDIAG3
{SPR_SPDR, 2, 4, {NULL}, 0, 0, S_RDIAG1}, // S_RDIAG4
// Blue Diagonal Spring
{SPR_SPDB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BDIAG1
{SPR_SPDB, 1, 1, {A_Pain}, 0, 0, S_BDIAG3}, // S_BDIAG2
{SPR_SPDB, 0, 1, {NULL}, 0, 0, S_BDIAG4}, // S_BDIAG3
{SPR_SPDB, 2, 4, {NULL}, 0, 0, S_BDIAG1}, // S_BDIAG4
// Grey Diagonal Spring
{SPR_SPDG, 0, -1, {NULL}, 0, 0, S_NULL}, // S_GDIAG1
{SPR_SPDG, 1, 1, {A_Pain}, 0, 0, S_GDIAG3}, // S_GDIAG2
{SPR_SPDG, 0, 1, {NULL}, 0, 0, S_GDIAG4}, // S_GDIAG3
{SPR_SPDG, 2, 4, {NULL}, 0, 0, S_GDIAG1}, // S_GDIAG4
// Yellow Horizontal Spring
{SPR_SPHY, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YHORIZ1
{SPR_SPHY, 1, 1, {A_Pain}, 0, 0, S_YHORIZ3}, // S_YHORIZ2
{SPR_SPHY, 0, 1, {NULL}, 0, 0, S_YHORIZ4}, // S_YHORIZ3
{SPR_SPHY, 2, 4, {NULL}, 0, 0, S_YHORIZ1}, // S_YHORIZ4
// Red Horizontal Spring
{SPR_SPHR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_RHORIZ1
{SPR_SPHR, 1, 1, {A_Pain}, 0, 0, S_RHORIZ3}, // S_RHORIZ2
{SPR_SPHR, 0, 1, {NULL}, 0, 0, S_RHORIZ4}, // S_RHORIZ3
{SPR_SPHR, 2, 4, {NULL}, 0, 0, S_RHORIZ1}, // S_RHORIZ4
// Blue Horizontal Spring
{SPR_SPHB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BHORIZ1
{SPR_SPHB, 1, 1, {A_Pain}, 0, 0, S_BHORIZ3}, // S_BHORIZ2
{SPR_SPHB, 0, 1, {NULL}, 0, 0, S_BHORIZ4}, // S_BHORIZ3
{SPR_SPHB, 2, 4, {NULL}, 0, 0, S_BHORIZ1}, // S_BHORIZ4
// Grey Horizontal Spring
{SPR_SPHG, 0, -1, {NULL}, 0, 0, S_NULL}, // S_GHORIZ1
{SPR_SPHG, 1, 1, {A_Pain}, 0, 0, S_GHORIZ3}, // S_GHORIZ2
{SPR_SPHG, 0, 1, {NULL}, 0, 0, S_GHORIZ4}, // S_GHORIZ3
{SPR_SPHG, 2, 4, {NULL}, 0, 0, S_GHORIZ1}, // S_GHORIZ4
// Rain
{SPR_RAIN, FF_TRANS50, -1, {NULL}, 0, 0, S_NULL}, // S_RAIN1
@ -2512,23 +2544,6 @@ state_t states[NUMSTATES] =
{SPR_SRBO, 0, 2, {A_BuzzFly}, 0, 0, S_SRB1_GENREX2}, // S_SRB1_GENREX2
// SRB2kart
{SPR_SPRG, 0, -1, {NULL}, 0, 0, S_NULL}, // S_GRAYSPRING
{SPR_SPRG, 4, 4, {A_Pain}, 0, 0, S_GRAYSPRING3}, // S_GRAYSPRING2
{SPR_SPRG, 3, 1, {NULL}, 0, 0, S_GRAYSPRING4}, // S_GRAYSPRING3
{SPR_SPRG, 2, 1, {NULL}, 0, 0, S_GRAYSPRING5}, // S_GRAYSPRING4
{SPR_SPRG, 1, 1, {NULL}, 0, 0, S_GRAYSPRING}, // S_GRAYSPRING5
{SPR_NULL, 0, 1, {A_Pain}, 0, 0, S_INVISIBLE}, // S_INVISSPRING
{SPR_BSPR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BDIAG1
{SPR_BSPR, 1, 1, {A_Pain}, 0, 0, S_BDIAG3}, // S_BDIAG2
{SPR_BSPR, 2, 1, {NULL}, 0, 0, S_BDIAG4}, // S_BDIAG3
{SPR_BSPR, 3, 1, {NULL}, 0, 0, S_BDIAG5}, // S_BDIAG4
{SPR_BSPR, 4, 1, {NULL}, 0, 0, S_BDIAG6}, // S_BDIAG5
{SPR_BSPR, 3, 1, {NULL}, 0, 0, S_BDIAG7}, // S_BDIAG6
{SPR_BSPR, 2, 1, {NULL}, 0, 0, S_BDIAG8}, // S_BDIAG7
{SPR_BSPR, 1, 1, {NULL}, 0, 0, S_BDIAG1}, // S_BDIAG8
{SPR_RNDM, 0|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_RANDOMITEM2}, // S_RANDOMITEM1
{SPR_RNDM, 1|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_RANDOMITEM3}, // S_RANDOMITEM2
{SPR_RNDM, 2|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_RANDOMITEM4}, // S_RANDOMITEM3
@ -3437,6 +3452,8 @@ state_t states[NUMSTATES] =
{SPR_DRAF, 3, 1, {NULL}, 0, 0, S_DRAFTDUST5}, // S_DRAFTDUST4
{SPR_DRAF, 4, 1, {NULL}, 0, 0, S_NULL}, // S_DRAFTDUST5
{SPR_GRES, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 2, 4, S_NULL}, // S_TIREGREASE
{SPR_OTFG, FF_FULLBRIGHT|FF_TRANS50, TICRATE, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEFOG
{SPR_OTFG, 2|FF_FULLBRIGHT|FF_PAPERSPRITE, 1, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEORB
{SPR_OTFG, 1|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEBEAM
@ -4240,8 +4257,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
32, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_spring, // painsound
SKINCOLOR_TEA, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_XPLD1, // deathstate
@ -4251,7 +4268,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
13*FRACUNIT, // mass
15*FRACUNIT, // mass
0, // damage
sfx_None, // activesound
MF_ENEMY|MF_SPECIAL|MF_SHOOTABLE, // flags
@ -4267,8 +4284,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
32, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_spring, // painsound
SKINCOLOR_YELLOW, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_XPLD1, // deathstate
@ -4278,7 +4295,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
26*FRACUNIT, // mass
25*FRACUNIT, // mass
0, // damage
sfx_None, // activesound
MF_ENEMY|MF_SPECIAL|MF_SHOOTABLE, // flags
@ -4685,7 +4702,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // display offset
0, // mass
0, // damage
sfx_spring, // activesound
sfx_s3kb1, // activesound
MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOCLIPTHING, // flags
S_EGGMOBILE2_POGO5 // raisestate
},
@ -6062,54 +6079,27 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_BLUESPRING
552, // doomednum
S_BLUESPRING, // spawnstate
1000, // spawnhealth
S_BLUESPRING2, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_spring, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
20*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
14*FRACUNIT, // mass
0, // damage
sfx_None, // activesound
MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags
S_BLUESPRING2 // raisestate
},
{ // MT_YELLOWSPRING
550, // doomednum
S_YELLOWSPRING, // spawnstate
S_YELLOWSPRING1,// spawnstate
1000, // spawnhealth
S_YELLOWSPRING2,// seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_spring, // painsound
SKINCOLOR_YELLOW, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
20*FRACUNIT, // radius
16*FRACUNIT, // height
48*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset
26*FRACUNIT, // mass
25*FRACUNIT, // mass
0, // damage
sfx_None, // activesound
MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags
@ -6118,23 +6108,23 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
{ // MT_REDSPRING
551, // doomednum
S_REDSPRING, // spawnstate
S_REDSPRING1, // spawnstate
1000, // spawnhealth
S_REDSPRING2, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_spring, // painsound
SKINCOLOR_SALMON, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
20*FRACUNIT, // radius
16*FRACUNIT, // height
48*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset
40*FRACUNIT, // mass
0, // damage
@ -6143,8 +6133,62 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_REDSPRING2 // raisestate
},
{ // MT_BLUESPRING
552, // doomednum
S_BLUESPRING1, // spawnstate
1000, // spawnhealth
S_BLUESPRING2, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
SKINCOLOR_PASTEL, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
48*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset
64*FRACUNIT, // mass
0, // damage
sfx_None, // activesound
MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags
S_BLUESPRING2 // raisestate
},
{ // MT_GREYSPRING
553, // doomednum
S_GREYSPRING1, // spawnstate
1000, // spawnhealth
S_GREYSPRING2, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
SKINCOLOR_POPCORN, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
48*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset
15*FRACUNIT, // mass
0, // damage
sfx_None, // activesound
MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags
S_GREYSPRING2 // raisestate
},
{ // MT_YELLOWDIAG
555, // doomednum
554, // doomednum
S_YDIAG1, // spawnstate
1, // spawnhealth
S_YDIAG2, // seestate
@ -6152,26 +6196,26 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_spring, // painsound
SKINCOLOR_YELLOW, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
48*FRACUNIT, // radius
56*FRACUNIT, // height
0, // display offset
26*FRACUNIT, // mass
26*FRACUNIT, // damage
25*FRACUNIT, // mass
25*FRACUNIT, // damage
sfx_None, // activesound
MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags
S_YDIAG2 // raisestate
},
{ // MT_REDDIAG
556, // doomednum
555, // doomednum
S_RDIAG1, // spawnstate
1, // spawnhealth
S_RDIAG2, // seestate
@ -6179,16 +6223,16 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_spring, // painsound
SKINCOLOR_SALMON, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
48*FRACUNIT, // radius
56*FRACUNIT, // height
0, // display offset
40*FRACUNIT, // mass
40*FRACUNIT, // damage
@ -6197,6 +6241,168 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_RDIAG2 // raisestate
},
{ // MT_BLUEDIAG
556, // doomednum
S_BDIAG1, // spawnstate
1, // spawnhealth
S_BDIAG2, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
SKINCOLOR_PASTEL, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
48*FRACUNIT, // radius
56*FRACUNIT, // height
0, // display offset
64*FRACUNIT, // mass
64*FRACUNIT, // damage
sfx_None, // activesound
MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags
S_BDIAG2 // raisestate
},
{ // MT_GREYDIAG
557, // doomednum
S_GDIAG1, // spawnstate
1, // spawnhealth
S_GDIAG2, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
SKINCOLOR_POPCORN, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
48*FRACUNIT, // radius
56*FRACUNIT, // height
0, // display offset
15*FRACUNIT, // mass
15*FRACUNIT, // damage
sfx_None, // activesound
MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags
S_GDIAG2 // raisestate
},
{ // MT_YELLOWHORIZ
558, // doomednum
S_YHORIZ1, // spawnstate
1, // spawnhealth
S_YHORIZ2, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
SKINCOLOR_YELLOW, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
48*FRACUNIT, // radius
56*FRACUNIT, // height
0, // display offset
0, // mass
45*FRACUNIT, // damage
sfx_None, // activesound
MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
S_YHORIZ2 // raisestate
},
{ // MT_REDHORIZ
559, // doomednum
S_RHORIZ1, // spawnstate
1, // spawnhealth
S_RHORIZ2, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
SKINCOLOR_SALMON, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
48*FRACUNIT, // radius
56*FRACUNIT, // height
0, // display offset
0, // mass
72*FRACUNIT, // damage
sfx_None, // activesound
MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
S_RHORIZ2 // raisestate
},
{ // MT_BLUEHORIZ
560, // doomednum
S_BHORIZ1, // spawnstate
1, // spawnhealth
S_BHORIZ2, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
SKINCOLOR_PASTEL, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
48*FRACUNIT, // radius
56*FRACUNIT, // height
0, // display offset
0, // mass
115*FRACUNIT, // damage
sfx_None, // activesound
MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
S_BHORIZ2 // raisestate
},
{ // MT_GREYHORIZ
561, // doomednum
S_GHORIZ1, // spawnstate
1, // spawnhealth
S_GHORIZ2, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
SKINCOLOR_POPCORN, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
48*FRACUNIT, // radius
56*FRACUNIT, // height
0, // display offset
0, // mass
27*FRACUNIT, // damage
sfx_None, // activesound
MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
S_GHORIZ2 // raisestate
},
{ // MT_BUBBLES
500, // doomednum
S_BUBBLES1, // spawnstate
@ -14804,88 +15010,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
},
// SRB2kart MT's
{ // MT_GRAYSPRING
553, // doomednum
S_GRAYSPRING, // spawnstate
100, // spawnhealth
S_GRAYSPRING2, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_spring, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
20*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
6*FRACUNIT, // mass
0, // damage
sfx_None, // activesound
MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags
S_GRAYSPRING2 // raisestate
},
{ // MT_INVISSPRING
554, // doomednum
S_INVISIBLE, // spawnstate
100, // spawnhealth
S_INVISSPRING, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_spring, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
20*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
6*FRACUNIT, // mass
0, // damage
sfx_None, // activesound
MF_SOLID|MF_SPRING, // flags
S_INVISSPRING // raisestate
},
{ // MT_BLUEDIAG
557, // doomednum
S_BDIAG1, // spawnstate
1, // spawnhealth
S_BDIAG2, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_spring, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
14*FRACUNIT, // mass
14*FRACUNIT, // damage
sfx_None, // activesound
MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags
S_BDIAG2 // raisestate
},
{ // MT_RANDOMITEM
2000, // doomednum
S_RANDOMITEM1, // spawnstate
@ -20153,6 +20277,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_TIREGREASE
-1, // doomednum
S_TIREGREASE, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
8<<FRACBITS, // radius
16<<FRACBITS, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_OVERTIMEFOG
-1, // doomednum
S_OVERTIMEFOG, // spawnstate
@ -20231,6 +20382,13 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
8<<FRACBITS, // radius
16<<FRACBITS, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},

View file

@ -459,11 +459,18 @@ typedef enum sprite
SPR_RBRD, // Red Birdie in Bubble
// Springs
SPR_SPRY, // yellow spring
SPR_SPRR, // red spring
SPR_SPRB, // Blue springs
SPR_YSPR, // Yellow Diagonal Spring
SPR_RSPR, // Red Diagonal Spring
SPR_SPVY, // Yellow Vertical Spring
SPR_SPVR, // Red Vertical Spring
SPR_SPVB, // Blue Vertical Spring
SPR_SPVG, // Grey Vertical Spring
SPR_SPDY, // Yellow Diagonal Spring
SPR_SPDR, // Red Diagonal Spring
SPR_SPDB, // Blue Diagonal Spring
SPR_SPDG, // Grey Diagonal Spring
SPR_SPHY, // Yellow Horizontal Spring
SPR_SPHR, // Red Horizontal Spring
SPR_SPHB, // Blue Horizontal Spring
SPR_SPHG, // Grey Horizontal Spring
// Environmental Effects
SPR_RAIN, // Rain
@ -587,9 +594,6 @@ typedef enum sprite
SPR_SRBO,
// Springs
SPR_SPRG, // Gray Spring
SPR_BSPR, // Blue Diagonal Spring
SPR_RNDM, // Random Item Box
SPR_RPOP, // Random Item Box Pop
SPR_SGNS, // Signpost sparkle
@ -778,6 +782,7 @@ typedef enum sprite
SPR_MXCL,
SPR_RGSP,
SPR_DRAF,
SPR_GRES,
SPR_OTFG,
@ -2493,44 +2498,77 @@ typedef enum state
S_RBIRD2,
S_RBIRD3,
S_YELLOWSPRING,
// Yellow Spring
S_YELLOWSPRING1,
S_YELLOWSPRING2,
S_YELLOWSPRING3,
S_YELLOWSPRING4,
S_YELLOWSPRING5,
S_REDSPRING,
// Red Spring
S_REDSPRING1,
S_REDSPRING2,
S_REDSPRING3,
S_REDSPRING4,
S_REDSPRING5,
// Blue Springs
S_BLUESPRING,
// Blue Spring
S_BLUESPRING1,
S_BLUESPRING2,
S_BLUESPRING3,
S_BLUESPRING4,
S_BLUESPRING5,
// Grey Spring
S_GREYSPRING1,
S_GREYSPRING2,
S_GREYSPRING3,
S_GREYSPRING4,
// Yellow Diagonal Spring
S_YDIAG1,
S_YDIAG2,
S_YDIAG3,
S_YDIAG4,
S_YDIAG5,
S_YDIAG6,
S_YDIAG7,
S_YDIAG8,
// Red Diagonal Spring
S_RDIAG1,
S_RDIAG2,
S_RDIAG3,
S_RDIAG4,
S_RDIAG5,
S_RDIAG6,
S_RDIAG7,
S_RDIAG8,
// Blue Diagonal Spring
S_BDIAG1,
S_BDIAG2,
S_BDIAG3,
S_BDIAG4,
// Grey Diagonal Spring
S_GDIAG1,
S_GDIAG2,
S_GDIAG3,
S_GDIAG4,
// Yellow Horizontal Spring
S_YHORIZ1,
S_YHORIZ2,
S_YHORIZ3,
S_YHORIZ4,
// Red Horizontal Spring
S_RHORIZ1,
S_RHORIZ2,
S_RHORIZ3,
S_RHORIZ4,
// Blue Horizontal Spring
S_BHORIZ1,
S_BHORIZ2,
S_BHORIZ3,
S_BHORIZ4,
// Grey Horizontal Spring
S_GHORIZ1,
S_GHORIZ2,
S_GHORIZ3,
S_GHORIZ4,
// Rain
S_RAIN1,
@ -3155,26 +3193,6 @@ typedef enum state
S_SRB1_GENREX1,
S_SRB1_GENREX2,
// Gray Springs
S_GRAYSPRING,
S_GRAYSPRING2,
S_GRAYSPRING3,
S_GRAYSPRING4,
S_GRAYSPRING5,
// Invis-spring - this is used just for the sproing sound.
S_INVISSPRING,
// Blue Diagonal Spring
S_BDIAG1,
S_BDIAG2,
S_BDIAG3,
S_BDIAG4,
S_BDIAG5,
S_BDIAG6,
S_BDIAG7,
S_BDIAG8,
//{ Random Item Box
S_RANDOMITEM1,
S_RANDOMITEM2,
@ -4098,6 +4116,8 @@ typedef enum state
S_DRAFTDUST4,
S_DRAFTDUST5,
S_TIREGREASE,
S_OVERTIMEFOG,
S_OVERTIMEORB,
S_OVERTIMEBEAM,
@ -4248,11 +4268,18 @@ typedef enum mobj_type
// Springs and others
MT_FAN,
MT_STEAM, // Steam riser
MT_BLUESPRING,
MT_YELLOWSPRING,
MT_REDSPRING,
MT_BLUESPRING,
MT_GREYSPRING,
MT_YELLOWDIAG, // Yellow Diagonal Spring
MT_REDDIAG, // Red Diagonal Spring
MT_BLUEDIAG, // Blue Diagonal Spring
MT_GREYDIAG, // Grey Diagonal Spring
MT_YELLOWHORIZ, // Yellow Horizontal Spring
MT_REDHORIZ, // Red Horizontal Spring
MT_BLUEHORIZ, // Blue Horizontal Spring
MT_GREYHORIZ, // Grey Horizontal Spring
// Interactive Objects
MT_BUBBLES, // Bubble source
@ -4634,9 +4661,6 @@ typedef enum mobj_type
MT_SRB1_GENREX,
// SRB2kart
MT_GRAYSPRING,
MT_INVISSPRING,
MT_BLUEDIAG,
MT_RANDOMITEM,
MT_RANDOMITEMPOP,
MT_FLOATINGITEM,
@ -4907,6 +4931,7 @@ typedef enum mobj_type
MT_KARMAFIREWORK,
MT_RINGSPARKS,
MT_DRAFTDUST,
MT_TIREGREASE,
MT_OVERTIMEFOG,
MT_OVERTIMEORB,

View file

@ -410,7 +410,7 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = {
// 0.0722 to blue
// (See this same define in hw_md2.c!)
#define SETBRIGHTNESS(brightness,r,g,b) \
brightness = (UINT8)(((1063*((UINT16)r)/5000) + (3576*((UINT16)g)/5000) + (361*((UINT16)b)/5000)) / 3)
brightness = (UINT8)(((1063*(UINT16)(r))/5000) + ((3576*(UINT16)(g))/5000) + ((361*(UINT16)(b))/5000))
/** \brief Generates the rainbow colourmaps that are used when a player has the invincibility power
@ -1623,7 +1623,7 @@ static void K_DrawDraftCombiring(player_t *player, player_t *victim, fixed_t cur
cury + (P_RandomRange(-12,12)*mapobjectscale),
curz + (P_RandomRange(24,48)*mapobjectscale),
MT_SIGNSPARKLE);
P_SetMobjState(band, S_SIGNSPARK1 + (abs(leveltime+offset) % 11));
P_SetMobjState(band, S_SIGNSPARK1 + (leveltime % 11));
P_SetScale(band, (band->destscale = (3*player->mo->scale)/2));
band->color = colors[c];
band->colorized = true;
@ -4529,6 +4529,15 @@ static void K_MoveHeldObjects(player_t *player)
if (R_PointToDist2(cur->x, cur->y, targx, targy) > 768*FRACUNIT)
P_TeleportMove(cur, targx, targy, cur->z);
#ifdef ESLOPE
if (P_IsObjectOnGround(cur))
{
// Slope values are set in the function, but we DON'T want to use its return value.
P_CalculateShadowFloor(cur, cur->x, cur->y, cur->z,
cur->radius, cur->height, (cur->eflags & MFE_VERTICALFLIP), false);
}
#endif
cur = cur->hnext;
}
}
@ -4618,6 +4627,9 @@ static void K_MoveHeldObjects(player_t *player)
P_TeleportMove(cur, targx, targy, targz);
K_FlipFromObject(cur, player->mo); // Update graviflip in real time thanks.
#ifdef HWRENDER
cur->modeltilt = player->mo->modeltilt;
#endif
num = (num+1) % 2;
cur = cur->hnext;
}
@ -5061,6 +5073,29 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (P_IsDisplayPlayer(player))
debtflag->flags2 |= MF2_DONTDRAW;
}
if (player->kartstuff[k_springstars] && (leveltime & 1))
{
fixed_t randx = P_RandomRange(-40, 40) * player->mo->scale;
fixed_t randy = P_RandomRange(-40, 40) * player->mo->scale;
fixed_t randz = P_RandomRange(0, player->mo->height >> FRACBITS) << FRACBITS;
mobj_t *star = P_SpawnMobj(
player->mo->x + randx,
player->mo->y + randy,
player->mo->z + randz,
MT_KARMAFIREWORK);
star->color = player->kartstuff[k_springcolor];
star->flags |= MF_NOGRAVITY;
star->momx = player->mo->momx / 2;
star->momy = player->mo->momy / 2;
star->momz = player->mo->momz / 2;
star->fuse = 12;
star->scale = player->mo->scale;
star->destscale = star->scale / 2;
player->kartstuff[k_springstars]--;
}
}
if (player->playerstate == PST_DEAD || player->kartstuff[k_respawn] > 1) // Ensure these are set correctly here
@ -5282,6 +5317,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (player->kartstuff[k_justbumped])
player->kartstuff[k_justbumped]--;
if (player->kartstuff[k_tiregrease])
player->kartstuff[k_tiregrease]--;
// This doesn't go in HUD update because it has potential gameplay ramifications
if (player->karthud[khud_itemblink] && player->karthud[khud_itemblink]-- <= 0)
{
@ -5342,17 +5380,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
}
}
// ???
/*
if (player->kartstuff[k_jmp] > 1 && onground)
{
S_StartSound(player->mo, sfx_spring);
P_DoJump(player, false);
player->mo->momz *= player->kartstuff[k_jmp];
player->kartstuff[k_jmp] = 0;
}
*/
if (player->kartstuff[k_comebacktimer])
player->kartstuff[k_comebackmode] = 0;
@ -5482,15 +5509,16 @@ static INT16 K_GetKartDriftValue(player_t *player, fixed_t countersteer)
return 0;
if (player->kartstuff[k_driftend] != 0)
{
return -266*player->kartstuff[k_drift]; // Drift has ended and we are tweaking their angle back a bit
}
//basedrift = 90*player->kartstuff[k_drift]; // 450
//basedrift = 93*player->kartstuff[k_drift] - driftweight*3*player->kartstuff[k_drift]/10; // 447 - 303
basedrift = 83*player->kartstuff[k_drift] - (driftweight - 14)*player->kartstuff[k_drift]/5; // 415 - 303
driftangle = abs((252 - driftweight)*player->kartstuff[k_drift]/5);
if (player->kartstuff[k_tiregrease] > 0) // Buff drift-steering while in greasemode
basedrift += (basedrift / greasetics) * player->kartstuff[k_tiregrease];
return basedrift + FixedMul(driftangle, countersteer);
}
@ -6532,6 +6560,12 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (onground)
{
fixed_t prevfriction = player->mo->friction;
// Reduce friction after hitting a horizontal spring
if (player->kartstuff[k_tiregrease])
player->mo->friction += ((FRACUNIT - prevfriction) / greasetics) * player->kartstuff[k_tiregrease];
// Friction
if (!player->kartstuff[k_offroad])
{
@ -6544,9 +6578,20 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
// Karma ice physics
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
{
player->mo->friction += 1228;
// Wipeout slowdown
if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow])
{
if (player->kartstuff[k_offroad])
player->mo->friction -= 4912;
if (player->kartstuff[k_wipeoutslow] == 1)
player->mo->friction -= 9824;
}
// Friction was changed, so we must recalculate a bunch of stuff
if (player->mo->friction != prevfriction)
{
if (player->mo->friction > FRACUNIT)
player->mo->friction = FRACUNIT;
if (player->mo->friction < 0)
@ -6557,20 +6602,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (player->mo->movefactor < FRACUNIT)
player->mo->movefactor = 19*player->mo->movefactor - 18*FRACUNIT;
else
player->mo->movefactor = FRACUNIT; //player->mo->movefactor = ((player->mo->friction - 0xDB34)*(0xA))/0x80;
player->mo->movefactor = FRACUNIT;
if (player->mo->movefactor < 32)
player->mo->movefactor = 32;
}
// Wipeout slowdown
if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow])
{
if (player->kartstuff[k_offroad])
player->mo->friction -= 4912;
if (player->kartstuff[k_wipeoutslow] == 1)
player->mo->friction -= 9824;
}
}
K_KartDrift(player, onground);
@ -9649,7 +9685,7 @@ void K_drawKartFreePlay(UINT32 flashtime)
return;
V_DrawKartString((BASEVIDWIDTH - (LAPS_X+1)) - (12*9), // mirror the laps thingy
LAPS_Y+3, V_SNAPTOBOTTOM|V_SNAPTORIGHT, "FREE PLAY");
LAPS_Y+3, V_HUDTRANS|V_SNAPTOBOTTOM|V_SNAPTORIGHT, "FREE PLAY");
}
static void K_drawDistributionDebugger(void)

View file

@ -1405,15 +1405,15 @@ static int lib_pIsFlagAtBase(lua_State *L)
static int lib_pSetupLevelSky(lua_State *L)
{
INT32 skynum = (INT32)luaL_checkinteger(L, 1);
const char *skytexname = luaL_checkstring(L, 1);
player_t *user = NULL;
NOHUD
if (!lua_isnone(L, 2) && lua_isuserdata(L, 2)) // if a player, setup sky for only the player, otherwise setup sky for all players
user = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
if (!user) // global
P_SetupLevelSky(skynum, true);
P_SetupLevelSky(skytexname, true);
else if (P_IsLocalPlayer(user))
P_SetupLevelSky(skynum, false);
P_SetupLevelSky(skytexname, false);
return 0;
}

View file

@ -1487,8 +1487,8 @@ static int mapheaderinfo_get(lua_State *L)
lua_pushstring(L, header->forcecharacter);
else if (fastcmp(field,"weather"))
lua_pushinteger(L, header->weather);
else if (fastcmp(field,"skynum"))
lua_pushinteger(L, header->skynum);
else if (fastcmp(field,"skytexture"))
lua_pushstring(L, header->skytexture);
else if (fastcmp(field,"skybox_scalex"))
lua_pushinteger(L, header->skybox_scalex);
else if (fastcmp(field,"skybox_scaley"))

View file

@ -577,14 +577,14 @@ void Command_Skynum_f(void)
if (COM_Argc() != 2)
{
CONS_Printf(M_GetText("skynum <sky#>: change the sky\n"));
CONS_Printf(M_GetText("Current sky is %d\n"), levelskynum);
CONS_Printf(M_GetText("skynum <texture name>: change the sky\n"));
CONS_Printf(M_GetText("Current sky is %s\n"), levelskytexture);
return;
}
CONS_Printf(M_GetText("Previewing sky %s...\n"), COM_Argv(1));
P_SetupLevelSky(atoi(COM_Argv(1)), false);
P_SetupLevelSky(COM_Argv(1), false);
}
void Command_Weather_f(void)

View file

@ -228,6 +228,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state);
boolean P_SetMobjState(mobj_t *mobj, statenum_t state);
//void P_RunShields(void);
void P_RunOverlays(void);
fixed_t P_CalculateShadowFloor(mobj_t *mobj, fixed_t x, fixed_t y, fixed_t z, fixed_t radius, fixed_t height, boolean flip, boolean player);
void P_RunShadows(void);
void P_RunBattleOvertime(void);
void P_MobjThinker(mobj_t *mobj);

View file

@ -113,14 +113,18 @@ boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z)
// MOVEMENT ITERATOR FUNCTIONS
// =========================================================================
//#define TELEPORTJANK
boolean P_DoSpring(mobj_t *spring, mobj_t *object)
{
//INT32 pflags;
const fixed_t hscale = mapobjectscale + (mapobjectscale - object->scale);
const fixed_t vscale = mapobjectscale + (object->scale - mapobjectscale);
fixed_t offx, offy;
fixed_t vertispeed = spring->info->mass;
fixed_t horizspeed = spring->info->damage;
UINT8 starcolor = (spring->info->painchance % MAXTRANSLATIONS);
fixed_t savemomx = 0;
fixed_t savemomy = 0;
if (object->eflags & MFE_SPRUNG) // Object was already sprung this tic
return false;
@ -142,29 +146,36 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
object->eflags |= MFE_SPRUNG; // apply this flag asap!
spring->flags &= ~(MF_SOLID|MF_SPECIAL); // De-solidify
#ifdef TELEPORTJANK
if (horizspeed && vertispeed) // Mimic SA
{
object->momx = object->momy = 0;
P_TryMove(object, spring->x, spring->y, true);
}
#endif
if (spring->eflags & MFE_VERTICALFLIP)
vertispeed *= -1;
// Vertical springs teleport you on TOP of them.
if (vertispeed > 0)
object->z = spring->z + spring->height + 1;
else if (vertispeed < 0)
object->z = spring->z - object->height - 1;
else
{
fixed_t offx, offy;
// Horizontal springs teleport you in FRONT of them.
savemomx = object->momx;
savemomy = object->momy;
object->momx = object->momy = 0;
// Overestimate the distance to position you at
offx = P_ReturnThrustX(spring, spring->angle, (spring->radius + object->radius + 1) * 2);
offy = P_ReturnThrustY(spring, spring->angle, (spring->radius + object->radius + 1) * 2);
// Make it square by clipping
// Then clip it down to a square, so it matches the hitbox size.
if (offx > (spring->radius + object->radius + 1))
offx = spring->radius + object->radius + 1;
else if (offx < -(spring->radius + object->radius + 1))
@ -175,27 +186,94 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
else if (offy < -(spring->radius + object->radius + 1))
offy = -(spring->radius + object->radius + 1);
// Set position!
P_TryMove(object, spring->x + offx, spring->y + offy, true);
}
if (vertispeed)
object->momz = FixedMul(vertispeed,FixedSqrt(FixedMul(vscale, spring->scale)));
object->momz = FixedMul(vertispeed, FixedSqrt(FixedMul(vscale, spring->scale)));
if (horizspeed)
{
if (!object->player)
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(hscale, spring->scale))));
angle_t finalAngle = spring->angle;
fixed_t finalSpeed = horizspeed;
fixed_t objectSpeed;
if (object->player)
objectSpeed = object->player->speed;
else
objectSpeed = R_PointToDist2(0, 0, savemomx, savemomy);
if (!vertispeed)
{
fixed_t finalSpeed = FixedDiv(horizspeed, hscale);
fixed_t pSpeed = object->player->speed;
// Scale to gamespeed
finalSpeed = FixedMul(finalSpeed, K_GetKartGameSpeedScalar(gamespeed));
if (pSpeed > finalSpeed)
finalSpeed = pSpeed;
// Reflect your momentum angle against the surface of horizontal springs.
// This makes it a bit more interesting & unique than just being a speed boost in a pre-defined direction
if (savemomx || savemomy)
{
angle_t momang;
INT32 angoffset;
boolean subtract = false;
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed,FixedSqrt(FixedMul(hscale, spring->scale))));
momang = R_PointToAngle2(0, 0, savemomx, savemomy);
angoffset = momang;
angoffset -= spring->angle; // Subtract
// Flip on wrong side
if ((angle_t)angoffset > ANGLE_180)
{
angoffset = InvAngle((angle_t)angoffset);
subtract = !subtract;
}
// Fix going directly against the spring's angle sending you the wrong way
if ((spring->angle - momang) > ANGLE_90)
angoffset = ANGLE_180 - angoffset;
// Offset is reduced to cap it (90 / 2 = max of 45 degrees)
angoffset /= 2;
// Reduce further based on how slow your speed is compared to the spring's speed
if (finalSpeed > objectSpeed)
angoffset = FixedDiv(angoffset, FixedDiv(finalSpeed, objectSpeed));
if (subtract)
angoffset = (signed)(spring->angle) - angoffset;
else
angoffset = (signed)(spring->angle) + angoffset;
finalAngle = angoffset;
}
}
if (object->player)
{
// Less friction when hitting horizontal springs
if (!vertispeed)
{
if (!object->player->kartstuff[k_tiregrease])
{
UINT8 i;
for (i = 0; i < 2; i++)
{
mobj_t *grease;
grease = P_SpawnMobj(object->x, object->y, object->z, MT_TIREGREASE);
P_SetTarget(&grease->target, object);
grease->angle = R_PointToAngle2(0, 0, object->momx, object->momy);
grease->extravalue1 = i;
}
}
object->player->kartstuff[k_tiregrease] = greasetics; //FixedMul(greasetics << FRACBITS, finalSpeed/72) >> FRACBITS
}
}
// Horizontal speed is used as a minimum thrust, not a direct replacement
finalSpeed = max(objectSpeed, finalSpeed);
P_InstaThrustEvenIn2D(object, finalAngle, FixedMul(finalSpeed, FixedSqrt(FixedMul(hscale, spring->scale))));
}
// Re-solidify
@ -208,46 +286,12 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
if (spring->flags & MF_ENEMY) // Spring shells
P_SetTarget(&spring->target, object);
if (horizspeed && object->player->cmd.forwardmove == 0 && object->player->cmd.sidemove == 0)
{
object->angle = spring->angle;
if (!demo.playback || P_AnalogMove(object->player))
{
if (object->player == &players[consoleplayer])
localangle[0] = spring->angle;
else if (object->player == &players[displayplayers[1]])
localangle[1] = spring->angle;
else if (object->player == &players[displayplayers[2]])
localangle[2] = spring->angle;
else if (object->player == &players[displayplayers[3]])
localangle[3] = spring->angle;
}
}
//pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED); // I still need these.
P_ResetPlayer(object->player);
/* // SRB2kart - Springs don't need to change player state in kart.
if (P_MobjFlip(object)*vertispeed > 0)
P_SetPlayerMobjState(object, S_PLAY_SPRING);
else if (P_MobjFlip(object)*vertispeed < 0)
P_SetPlayerMobjState(object, S_PLAY_FALL1);
else // horizontal spring
{
if (pflags & (PF_JUMPED|PF_SPINNING) && object->player->panim == PA_ROLL)
object->player->pflags = pflags;
else
P_SetPlayerMobjState(object, S_PLAY_RUN1);
}
if (spring->info->painchance)
{
object->player->pflags |= PF_JUMPED;
P_SetPlayerMobjState(object, S_PLAY_ATK1);
}
*/
object->player->kartstuff[k_springstars] = max(vertispeed, horizspeed) / FRACUNIT / 2;
object->player->kartstuff[k_springcolor] = starcolor;
}
return true;
}
@ -1163,6 +1207,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
//else if (tmz > thzh - sprarea && tmz < thzh) // Don't damage people springing up / down
return true;
}
// missiles can hit other things
if (tmthing->flags & MF_MISSILE || tmthing->type == MT_SHELL)
{
@ -2892,14 +2937,24 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
P_HandleSlopeLanding(thing, tmfloorslope);
if (thing->momz <= 0)
{
thing->standingslope = tmfloorslope;
#ifdef HWRENDER
thing->modeltilt = thing->standingslope;
#endif
}
}
else if (thing->z+thing->height >= tmceilingz && (thing->eflags & MFE_VERTICALFLIP)) {
if (!startingonground && tmceilingslope)
P_HandleSlopeLanding(thing, tmceilingslope);
if (thing->momz >= 0)
{
thing->standingslope = tmceilingslope;
#ifdef HWRENDER
thing->modeltilt = thing->standingslope;
#endif
}
}
}
else // don't set standingslope if you're not going to clip against it
@ -4702,7 +4757,7 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
if (!(rover->flags & FF_EXISTS))
continue;
if ((!(rover->flags & FF_SOLID || rover->flags & FF_QUICKSAND) || (rover->flags & FF_SWIMMABLE)))
if (!((rover->flags & FF_SOLID) || (rover->flags & FF_QUICKSAND)) || (rover->flags & FF_SWIMMABLE))
continue;
topheight = *rover->topheight;

View file

@ -1848,6 +1848,9 @@ void P_XYMovement(mobj_t *mo)
// Now compare the Zs of the different quantizations
if (oldangle-newangle > ANG30 && oldangle-newangle < ANGLE_180) { // Allow for a bit of sticking - this value can be adjusted later
mo->standingslope = oldslope;
#ifdef HWRENDER
mo->modeltilt = mo->standingslope;
#endif
P_SlopeLaunch(mo);
//CONS_Printf("launched off of slope - ");
@ -2421,6 +2424,9 @@ static boolean P_ZMovement(mobj_t *mo)
if (((mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope) && (mo->type != MT_STEAM))
{
mo->standingslope = (mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope;
#ifdef HWRENDER
mo->modeltilt = mo->standingslope;
#endif
P_ReverseQuantizeMomentumToSlope(&mom, mo->standingslope);
}
#endif
@ -6199,13 +6205,178 @@ static void P_RemoveOverlay(mobj_t *thing)
}
}
// Simplified version of a code bit in P_MobjFloorZ
static fixed_t P_ShadowSlopeZ(pslope_t *slope, fixed_t x, fixed_t y, fixed_t radius, boolean ceiling)
{
fixed_t testx, testy;
if (slope->d.x < 0)
testx = radius;
else
testx = -radius;
if (slope->d.y < 0)
testy = radius;
else
testy = -radius;
if ((slope->zdelta > 0) ^ !!(ceiling))
{
testx = -testx;
testy = -testy;
}
testx += x;
testy += y;
return P_GetZAt(slope, testx, testy);
}
// Sets standingslope/modeltilt, returns z position for shadows; used also for stuff like bananas
// (I would've preferred to be able to return both the slope & z, but I'll take what I can get...)
fixed_t P_CalculateShadowFloor(mobj_t *mobj, fixed_t x, fixed_t y, fixed_t z, fixed_t radius, fixed_t height, boolean flip, boolean player)
{
fixed_t newz;
sector_t *sec;
#ifdef ESLOPE
pslope_t *slope = NULL;
#endif
sec = R_PointInSubsector(x, y)->sector;
if (flip)
{
#ifdef ESLOPE
if (sec->c_slope)
{
slope = sec->c_slope;
newz = P_ShadowSlopeZ(slope, x, y, radius, true);
}
else
#endif
newz = sec->ceilingheight;
}
else
{
#ifdef ESLOPE
if (sec->f_slope)
{
slope = sec->f_slope;
newz = P_ShadowSlopeZ(slope, x, y, radius, false);
}
else
#endif
newz = sec->floorheight;
}
// Check FOFs for a better suited slope
if (sec->ffloors)
{
ffloor_t *rover;
for (rover = sec->ffloors; rover; rover = rover->next)
{
fixed_t top, bottom;
fixed_t d1, d2;
if (!(rover->flags & FF_EXISTS))
continue;
if ((!(((rover->flags & FF_BLOCKPLAYER && player)
|| (rover->flags & FF_BLOCKOTHERS && !player))
|| (rover->flags & FF_QUICKSAND))
|| (rover->flags & FF_SWIMMABLE)))
continue;
#ifdef ESLOPE
if (*rover->t_slope)
top = P_ShadowSlopeZ(*rover->t_slope, x, y, radius, false);
else
#endif
top = *rover->topheight;
#ifdef ESLOPE
if (*rover->b_slope)
bottom = P_ShadowSlopeZ(*rover->b_slope, x, y, radius, true);
else
#endif
bottom = *rover->bottomheight;
if (flip)
{
if (rover->flags & FF_QUICKSAND)
{
if (z < top && (z + height) > bottom)
{
if (newz > (z + height))
{
newz = (z + height);
slope = NULL;
}
}
continue;
}
d1 = (z + height) - (top + ((bottom - top)/2));
d2 = z - (top + ((bottom - top)/2));
if (bottom < newz && abs(d1) < abs(d2))
{
newz = bottom;
#ifdef ESLOPE
if (*rover->b_slope)
slope = *rover->b_slope;
#endif
}
}
else
{
if (rover->flags & FF_QUICKSAND)
{
if (z < top && (z + height) > bottom)
{
if (newz < z)
{
newz = z;
slope = NULL;
}
}
continue;
}
d1 = z - (bottom + ((top - bottom)/2));
d2 = (z + height) - (bottom + ((top - bottom)/2));
if (top > newz && abs(d1) < abs(d2))
{
newz = top;
#ifdef ESLOPE
if (*rover->t_slope)
slope = *rover->t_slope;
#endif
}
}
}
}
#if 0
mobj->standingslope = slope;
#endif
#ifdef HWRENDER
mobj->modeltilt = slope;
#endif
return newz;
}
void P_RunShadows(void)
{
mobj_t *mobj, *next, *dest;
for (mobj = shadowcap; mobj; mobj = next)
{
fixed_t floorz;
boolean flip;
fixed_t newz;
next = mobj->hnext;
P_SetTarget(&mobj->hnext, NULL);
@ -6216,16 +6387,22 @@ void P_RunShadows(void)
continue; // shouldn't you already be dead?
}
if (mobj->target->player)
floorz = mobj->target->floorz;
else // FOR SOME REASON, plain floorz is not reliable for normal objects, only players?!
floorz = P_FloorzAtPos(mobj->target->x, mobj->target->y, mobj->target->z, mobj->target->height);
K_MatchGenericExtraFlags(mobj, mobj->target);
flip = (mobj->eflags & MFE_VERTICALFLIP);
if (((mobj->target->eflags & MFE_VERTICALFLIP) && mobj->target->z+mobj->target->height > mobj->target->ceilingz)
|| (!(mobj->target->eflags & MFE_VERTICALFLIP) && mobj->target->z < floorz))
mobj->flags2 |= MF2_DONTDRAW;
newz = P_CalculateShadowFloor(mobj, mobj->target->x, mobj->target->y, mobj->target->z,
mobj->target->radius, mobj->target->height, flip, (mobj->target->player != NULL));
if (flip)
{
if ((mobj->target->z + mobj->target->height) > newz)
mobj->flags2 |= MF2_DONTDRAW;
}
else
{
if (mobj->target->z < newz)
mobj->flags2 |= MF2_DONTDRAW;
}
// First scale to the same radius
P_SetScale(mobj, FixedDiv(mobj->target->radius, mobj->info->radius));
@ -6237,13 +6414,12 @@ void P_RunShadows(void)
P_TeleportMove(mobj, dest->x, dest->y, mobj->target->z);
if (((mobj->eflags & MFE_VERTICALFLIP) && (mobj->ceilingz > mobj->z+mobj->height))
|| (!(mobj->eflags & MFE_VERTICALFLIP) && (floorz < mobj->z)))
if ((flip && newz > (mobj->z + mobj->height)) || (!flip && newz < mobj->z))
{
INT32 i;
fixed_t prevz;
mobj->z = (mobj->eflags & MFE_VERTICALFLIP ? mobj->ceilingz : floorz);
mobj->z = newz;
for (i = 0; i < MAXFFLOORS; i++)
{
@ -6255,7 +6431,7 @@ void P_RunShadows(void)
// Check new position to see if you should still be on that ledge
P_TeleportMove(mobj, dest->x, dest->y, mobj->z);
mobj->z = (mobj->eflags & MFE_VERTICALFLIP ? mobj->ceilingz : floorz);
mobj->z = newz;
if (mobj->z == prevz)
break;
@ -8426,6 +8602,9 @@ void P_MobjThinker(mobj_t *mobj)
P_TeleportMove(mobj, mobj->target->x + P_ReturnThrustX(mobj, mobj->angle+ANGLE_180, mobj->target->radius),
mobj->target->y + P_ReturnThrustY(mobj, mobj->angle+ANGLE_180, mobj->target->radius), mobj->target->z);
P_SetScale(mobj, mobj->target->scale);
#ifdef HWRENDER
mobj->modeltilt = mobj->target->modeltilt;
#endif
{
player_t *p = NULL;
@ -8578,6 +8757,56 @@ void P_MobjThinker(mobj_t *mobj)
z);
}
break;
case MT_TIREGREASE:
if (!mobj->target || P_MobjWasRemoved(mobj->target) || !mobj->target->player
|| !mobj->target->player->kartstuff[k_tiregrease])
{
P_RemoveMobj(mobj);
return;
}
K_MatchGenericExtraFlags(mobj, mobj->target);
{
const angle_t off = FixedAngle(40*FRACUNIT);
angle_t ang = mobj->target->angle;
fixed_t z;
UINT8 trans = (mobj->target->player->kartstuff[k_tiregrease] * (NUMTRANSMAPS+1)) / greasetics;
if (trans > NUMTRANSMAPS)
trans = NUMTRANSMAPS;
trans = NUMTRANSMAPS - trans;
z = mobj->target->z;
if (mobj->eflags & MFE_VERTICALFLIP)
z += mobj->target->height;
if (mobj->target->momx || mobj->target->momy)
ang = R_PointToAngle2(0, 0, mobj->target->momx, mobj->target->momy);
if (mobj->extravalue1)
ang = (signed)(ang - off);
else
ang = (signed)(ang + off);
P_TeleportMove(mobj,
mobj->target->x - FixedMul(mobj->target->radius, FINECOSINE(ang >> ANGLETOFINESHIFT)),
mobj->target->y - FixedMul(mobj->target->radius, FINESINE(ang >> ANGLETOFINESHIFT)),
z);
mobj->angle = ang;
if (leveltime & 1)
mobj->flags2 |= MF2_DONTDRAW;
if (trans >= NUMTRANSMAPS)
mobj->flags2 |= MF2_DONTDRAW;
else if (trans == 0)
mobj->frame = (mobj->frame & ~FF_TRANSMASK);
else
mobj->frame = (mobj->frame & ~FF_TRANSMASK)|(trans << FF_TRANSSHIFT);
}
break;
case MT_THUNDERSHIELD:
{
fixed_t destx, desty;
@ -9280,6 +9509,9 @@ void P_MobjThinker(mobj_t *mobj)
}
break;
case MT_KARMAFIREWORK:
if (mobj->flags & MF_NOGRAVITY)
break;
if (mobj->momz == 0)
{
P_RemoveMobj(mobj);
@ -12264,7 +12496,7 @@ ML_NOCLIMB : Direction not controllable
{
if (mthing->options & MTF_AMBUSH)
{
if (i == MT_YELLOWDIAG || i == MT_REDDIAG)
if (mobj->flags & MF_SPRING && mobj->info->damage)
mobj->angle += ANGLE_22h;
if (mobj->flags & MF_NIGHTSITEM)

View file

@ -370,6 +370,9 @@ typedef struct mobj_s
#ifdef ESLOPE
struct pslope_s *standingslope; // The slope that the object is standing on (shouldn't need synced in savegames, right?)
#ifdef HWRENDER
struct pslope_s *modeltilt; // Slope used for model tilting. Also is not synched, this is totally visual.
#endif
#endif
boolean colorized; // Whether the mobj uses the rainbow colormap

View file

@ -2144,7 +2144,12 @@ static void LoadMobjThinker(actionf_p1 thinker)
mobj->hprev = (mobj_t *)(size_t)READUINT32(save_p);
#ifdef ESLOPE
if (diff2 & MD2_SLOPE)
{
mobj->standingslope = P_SlopeById(READUINT16(save_p));
#ifdef HWRENDER
mobj->modeltilt = mobj->standingslope;
#endif
}
#endif
if (diff2 & MD2_COLORIZED)
mobj->colorized = READUINT8(save_p);
@ -3091,7 +3096,7 @@ static inline void P_NetArchiveSpecials(void)
WRITEUINT32(save_p, 0xffffffff);
// Sky number
WRITEINT32(save_p, globallevelskynum);
WRITESTRINGN(save_p, globallevelskytexture, 9);
// Current global weather type
WRITEUINT8(save_p, globalweather);
@ -3110,8 +3115,8 @@ static inline void P_NetArchiveSpecials(void)
//
static void P_NetUnArchiveSpecials(void)
{
char skytex[9];
size_t i;
INT32 j;
if (READUINT32(save_p) != ARCHIVEBLOCK_SPECIALS)
I_Error("Bad $$$.sav at archive block Specials");
@ -3124,9 +3129,9 @@ static void P_NetUnArchiveSpecials(void)
itemrespawntime[iquehead++] = READINT32(save_p);
}
j = READINT32(save_p);
if (j != globallevelskynum)
P_SetupLevelSky(j, true);
READSTRINGN(save_p, skytex, sizeof(skytex));
if (strcmp(skytex, globallevelskytexture))
P_SetupLevelSky(skytex, true);
globalweather = READUINT8(save_p);

View file

@ -207,8 +207,9 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
mapheaderinfo[num]->forcecharacter[0] = '\0';
DEH_WriteUndoline("WEATHER", va("%d", mapheaderinfo[num]->weather), UNDO_NONE);
mapheaderinfo[num]->weather = 0;
DEH_WriteUndoline("SKYNUM", va("%d", mapheaderinfo[num]->skynum), UNDO_NONE);
mapheaderinfo[num]->skynum = 1;
DEH_WriteUndoline("SKYTEXTURE", va("%d", mapheaderinfo[num]->skytexture), UNDO_NONE);
snprintf(mapheaderinfo[num]->skytexture, 9, "SKY1");
mapheaderinfo[num]->skytexture[8] = 0;
DEH_WriteUndoline("SKYBOXSCALEX", va("%d", mapheaderinfo[num]->skybox_scalex), UNDO_NONE);
mapheaderinfo[num]->skybox_scalex = 16;
DEH_WriteUndoline("SKYBOXSCALEY", va("%d", mapheaderinfo[num]->skybox_scaley), UNDO_NONE);
@ -2255,17 +2256,18 @@ static inline boolean P_CheckLevel(lumpnum_t lumpnum)
/** Sets up a sky texture to use for the level.
* The sky texture is used instead of F_SKY1.
*/
void P_SetupLevelSky(INT32 skynum, boolean global)
void P_SetupLevelSky(const char *skytexname, boolean global)
{
char skytexname[12];
char tex[9];
strncpy(tex, skytexname, 9);
tex[8] = 0;
sprintf(skytexname, "SKY%d", skynum);
skytexture = R_TextureNumForName(skytexname);
levelskynum = skynum;
skytexture = R_TextureNumForName(tex);
strncpy(levelskytexture, tex, 9);
// Global change
if (global)
globallevelskynum = levelskynum;
strncpy(globallevelskytexture, tex, 9);
// Don't go beyond for dedicated servers
if (dedicated)
@ -2975,7 +2977,7 @@ boolean P_SetupLevel(boolean skipprecip)
CON_SetupBackColormap();
// SRB2 determines the sky texture to be used depending on the map header.
P_SetupLevelSky(mapheaderinfo[gamemap-1]->skynum, true);
P_SetupLevelSky(mapheaderinfo[gamemap-1]->skytexture, true);
P_MakeMapMD5(lastloadedmaplumpnum, &mapmd5);

View file

@ -54,7 +54,7 @@ INT32 P_CheckLevelFlat(const char *flatname);
extern size_t nummapthings;
extern mapthing_t *mapthings;
void P_SetupLevelSky(INT32 skynum, boolean global);
void P_SetupLevelSky(const char *skytexname, boolean global);
#ifdef SCANTHINGS
void P_ScanThings(INT16 mapnum, INT16 wadnum, INT16 lumpnum);
#endif

View file

@ -836,6 +836,9 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope)
if (P_MobjFlip(thing)*(thing->momz) < 0) { // falling, land on slope
thing->momz = -P_MobjFlip(thing);
thing->standingslope = slope;
#ifdef HWRENDER
thing->modeltilt = thing->standingslope;
#endif
}
return;
}
@ -852,6 +855,9 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope)
thing->momz = -P_MobjFlip(thing);
thing->standingslope = slope;
#ifdef HWRENDER
thing->modeltilt = thing->standingslope;
#endif
}
}

View file

@ -2802,7 +2802,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
case 423: // Change Sky
if ((mo && mo->player && P_IsLocalPlayer(mo->player)) || (line->flags & ML_NOCLIMB))
P_SetupLevelSky(sides[line->sidenum[0]].textureoffset>>FRACBITS, (line->flags & ML_NOCLIMB));
P_SetupLevelSky(sides[line->sidenum[0]].text, (line->flags & ML_NOCLIMB));
break;
case 424: // Change Weather

View file

@ -1645,12 +1645,16 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj)
ghost->frame |= tr_trans50<<FF_TRANSSHIFT;
ghost->fuse = ghost->info->damage;
ghost->skin = mobj->skin;
ghost->standingslope = mobj->standingslope;
#ifdef HWRENDER
ghost->modeltilt = mobj->modeltilt;
#endif
if (mobj->flags2 & MF2_OBJECTFLIP)
ghost->flags |= MF2_OBJECTFLIP;
if (!(mobj->flags & MF_DONTENCOREMAP))
mobj->flags &= ~MF_DONTENCOREMAP;
ghost->flags &= ~MF_DONTENCOREMAP;
return ghost;
}

View file

@ -1631,7 +1631,7 @@ void R_PrecacheLevel(void)
// Sky texture is always present.
// Note that F_SKY1 is the name used to indicate a sky floor/ceiling as a flat,
// while the sky texture is stored like a wall texture, with a skynum dependent name.
// while the sky texture is stored like a wall texture, with a texture name set by the map.
texturepresent[skytexture] = 1;
texturememory = 0;

View file

@ -734,7 +734,7 @@ void R_DrawPlanes(void)
dc_x = x;
dc_source =
R_GetColumn(texturetranslation[skytexture],
angle);
-angle); // Negative because skies were being drawn horizontally flipped
wallcolfunc();
}
}

View file

@ -47,8 +47,8 @@ fixed_t skyscale;
/** \brief used for keeping track of the current sky
*/
INT32 levelskynum;
INT32 globallevelskynum;
char levelskytexture[9];
char globallevelskytexture[9];
/** \brief The R_SetupSkyDraw function

View file

@ -30,8 +30,8 @@ extern INT32 skytexture, skytexturemid;
extern fixed_t skyscale;
extern INT32 skyflatnum;
extern INT32 levelskynum;
extern INT32 globallevelskynum;
extern char levelskytexture[9];
extern char globallevelskytexture[9];
// call after skytexture is set to adapt for old/new skies
void R_SetupSkyDraw(void);

View file

@ -427,13 +427,13 @@ void SCR_DisplayTicRate(void)
ticcntcolor|V_NOSCALESTART, va("%02d/%02u", totaltics, TICRATE));*/
// draw "FPS"
V_DrawFixedPatch(306<<FRACBITS, 183<<FRACBITS, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTORIGHT, framecounter, R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_YELLOW, GTC_CACHE));
V_DrawFixedPatch(306<<FRACBITS, 183<<FRACBITS, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, framecounter, R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_YELLOW, GTC_CACHE));
// draw total frame:
V_DrawPingNum(318, 190, V_SNAPTOBOTTOM|V_SNAPTORIGHT, TICRATE, ticcntcolor);
V_DrawPingNum(318, 190, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, TICRATE, ticcntcolor);
// draw "/"
V_DrawFixedPatch(306<<FRACBITS, 190<<FRACBITS, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTORIGHT, frameslash, ticcntcolor);
V_DrawFixedPatch(306<<FRACBITS, 190<<FRACBITS, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, frameslash, ticcntcolor);
// draw our actual framerate
V_DrawPingNum(306, 190, V_SNAPTOBOTTOM|V_SNAPTORIGHT, totaltics, ticcntcolor);
V_DrawPingNum(306, 190, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, totaltics, ticcntcolor);
lasttic = ontic;
@ -448,6 +448,6 @@ void SCR_DisplayLocalPing(void)
if (cv_showping.value == 1 || (cv_showping.value == 2 && ping > servermaxping)) // only show 2 (warning) if our ping is at a bad level
{
INT32 dispy = cv_ticrate.value ? 160 : 181;
HU_drawPing(307, dispy, ping, V_SNAPTORIGHT | V_SNAPTOBOTTOM);
HU_drawPing(307, dispy, ping, V_SNAPTORIGHT | V_SNAPTOBOTTOM | V_HUDTRANS);
}
}

View file

@ -1377,11 +1377,14 @@ void I_FinishUpdate(void)
if (I_SkipFrame())
return;
if (cv_ticrate.value)
SCR_DisplayTicRate();
if (st_overlay)
{
if (cv_ticrate.value)
SCR_DisplayTicRate();
if (cv_showping.value && netgame && consoleplayer != serverplayer)
SCR_DisplayLocalPing();
if (cv_showping.value && netgame && consoleplayer != serverplayer)
SCR_DisplayLocalPing();
}
if (rendermode == render_soft && screens[0])
{