mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Merge branch 'next' of git.magicalgirl.moe:STJr/SRB2 into next
This commit is contained in:
		
						commit
						59a49d9f3c
					
				
					 7 changed files with 45 additions and 29 deletions
				
			
		| 
						 | 
				
			
			@ -3930,7 +3930,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, gr_vissprite_t *spr, fixed_t scale
 | 
			
		|||
	HWR_GetPatch(gpatch);
 | 
			
		||||
 | 
			
		||||
	scalemul = FixedMul(FRACUNIT - floordiff/640, scale);
 | 
			
		||||
	scalemul = FixedMul(scalemul, (thing->radius*2) / gpatch->height);
 | 
			
		||||
	scalemul = FixedMul(scalemul, (thing->radius*2) / SHORT(gpatch->height));
 | 
			
		||||
 | 
			
		||||
	fscale = FIXED_TO_FLOAT(scalemul);
 | 
			
		||||
	fx = FIXED_TO_FLOAT(thing->x);
 | 
			
		||||
| 
						 | 
				
			
			@ -3942,9 +3942,9 @@ static void HWR_DrawDropShadow(mobj_t *thing, gr_vissprite_t *spr, fixed_t scale
 | 
			
		|||
	//  0--1
 | 
			
		||||
 | 
			
		||||
	if (thing && fabsf(fscale - 1.0f) > 1.0E-36f)
 | 
			
		||||
		offset = (gpatch->height/2) * fscale;
 | 
			
		||||
		offset = (SHORT(gpatch->height)/2) * fscale;
 | 
			
		||||
	else
 | 
			
		||||
		offset = (float)(gpatch->height/2);
 | 
			
		||||
		offset = (float)(SHORT(gpatch->height)/2);
 | 
			
		||||
 | 
			
		||||
	shadowVerts[0].x = shadowVerts[3].x = fx - offset;
 | 
			
		||||
	shadowVerts[2].x = shadowVerts[1].x = fx + offset;
 | 
			
		||||
| 
						 | 
				
			
			@ -5253,10 +5253,10 @@ static void HWR_ProjectSprite(mobj_t *thing)
 | 
			
		|||
		rotsprite = sprframe->rotsprite.patch[rot][rollangle];
 | 
			
		||||
		if (rotsprite != NULL)
 | 
			
		||||
		{
 | 
			
		||||
			spr_width = rotsprite->width << FRACBITS;
 | 
			
		||||
			spr_height = rotsprite->height << FRACBITS;
 | 
			
		||||
			spr_offset = rotsprite->leftoffset << FRACBITS;
 | 
			
		||||
			spr_topoffset = rotsprite->topoffset << FRACBITS;
 | 
			
		||||
			spr_width = SHORT(rotsprite->width) << FRACBITS;
 | 
			
		||||
			spr_height = SHORT(rotsprite->height) << FRACBITS;
 | 
			
		||||
			spr_offset = SHORT(rotsprite->leftoffset) << FRACBITS;
 | 
			
		||||
			spr_topoffset = SHORT(rotsprite->topoffset) << FRACBITS;
 | 
			
		||||
			// flip -> rotate, not rotate -> flip
 | 
			
		||||
			flip = 0;
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1231,9 +1231,9 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp
 | 
			
		|||
		if (!R_CheckIfPatch(lump))
 | 
			
		||||
			return;
 | 
			
		||||
 | 
			
		||||
		width = patch->width;
 | 
			
		||||
		height = patch->height;
 | 
			
		||||
		leftoffset = patch->leftoffset;
 | 
			
		||||
		width = SHORT(patch->width);
 | 
			
		||||
		height = SHORT(patch->height);
 | 
			
		||||
		leftoffset = SHORT(patch->leftoffset);
 | 
			
		||||
 | 
			
		||||
		// rotation pivot
 | 
			
		||||
		px = SPRITE_XCENTER;
 | 
			
		||||
| 
						 | 
				
			
			@ -1348,7 +1348,7 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp
 | 
			
		|||
			newpatch = R_MaskedFlatToPatch(rawdst, newwidth, newheight, 0, 0, &size);
 | 
			
		||||
			{
 | 
			
		||||
				newpatch->leftoffset = (newpatch->width / 2) + (leftoffset - px);
 | 
			
		||||
				newpatch->topoffset = (newpatch->height / 2) + (patch->topoffset - py);
 | 
			
		||||
				newpatch->topoffset = (newpatch->height / 2) + (SHORT(patch->topoffset) - py);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			//BP: we cannot use special tric in hardware mode because feet in ground caused by z-buffer
 | 
			
		||||
| 
						 | 
				
			
			@ -1358,6 +1358,12 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp
 | 
			
		|||
			// P_PrecacheLevel
 | 
			
		||||
			if (devparm) spritememory += size;
 | 
			
		||||
 | 
			
		||||
			// convert everything to little-endian, for big-endian support
 | 
			
		||||
			newpatch->width = SHORT(newpatch->width);
 | 
			
		||||
			newpatch->height = SHORT(newpatch->height);
 | 
			
		||||
			newpatch->leftoffset = SHORT(newpatch->leftoffset);
 | 
			
		||||
			newpatch->topoffset = SHORT(newpatch->topoffset);
 | 
			
		||||
 | 
			
		||||
#ifdef HWRENDER
 | 
			
		||||
			if (rendermode == render_opengl)
 | 
			
		||||
			{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -888,7 +888,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
 | 
			
		|||
		vis->x2 = vid.width-1;
 | 
			
		||||
 | 
			
		||||
	localcolfunc = (vis->cut & SC_VFLIP) ? R_DrawFlippedMaskedColumn : R_DrawMaskedColumn;
 | 
			
		||||
	lengthcol = patch->height;
 | 
			
		||||
	lengthcol = SHORT(patch->height);
 | 
			
		||||
 | 
			
		||||
	// Split drawing loops for paper and non-paper to reduce conditional checks per sprite
 | 
			
		||||
	if (vis->scalestep)
 | 
			
		||||
| 
						 | 
				
			
			@ -1230,8 +1230,8 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
 | 
			
		|||
	yscale = FixedDiv(projectiony, tz);
 | 
			
		||||
	shadowxscale = FixedMul(thing->radius*2, scalemul);
 | 
			
		||||
	shadowyscale = FixedMul(FixedMul(thing->radius*2, scalemul), FixedDiv(abs(floorz - viewz), tz));
 | 
			
		||||
	shadowyscale = min(shadowyscale, shadowxscale) / patch->height;
 | 
			
		||||
	shadowxscale /= patch->width;
 | 
			
		||||
	shadowyscale = min(shadowyscale, shadowxscale) / SHORT(patch->height);
 | 
			
		||||
	shadowxscale /= SHORT(patch->width);
 | 
			
		||||
	shadowskew = 0;
 | 
			
		||||
 | 
			
		||||
	if (floorslope)
 | 
			
		||||
| 
						 | 
				
			
			@ -1246,24 +1246,24 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
 | 
			
		|||
		//CONS_Printf("Shadow is sloped by %d %d\n", xslope, zslope);
 | 
			
		||||
 | 
			
		||||
		if (viewz < floorz)
 | 
			
		||||
			shadowyscale += FixedMul(FixedMul(thing->radius*2 / patch->height, scalemul), zslope);
 | 
			
		||||
			shadowyscale += FixedMul(FixedMul(thing->radius*2 / SHORT(patch->height), scalemul), zslope);
 | 
			
		||||
		else
 | 
			
		||||
			shadowyscale -= FixedMul(FixedMul(thing->radius*2 / patch->height, scalemul), zslope);
 | 
			
		||||
			shadowyscale -= FixedMul(FixedMul(thing->radius*2 / SHORT(patch->height), scalemul), zslope);
 | 
			
		||||
 | 
			
		||||
		shadowyscale = abs(shadowyscale);
 | 
			
		||||
 | 
			
		||||
		shadowskew = xslope;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	tx -= patch->width * shadowxscale/2;
 | 
			
		||||
	tx -= SHORT(patch->width) * shadowxscale/2;
 | 
			
		||||
	x1 = (centerxfrac + FixedMul(tx,xscale))>>FRACBITS;
 | 
			
		||||
	if (x1 >= viewwidth) return;
 | 
			
		||||
 | 
			
		||||
	tx += patch->width * shadowxscale;
 | 
			
		||||
	tx += SHORT(patch->width) * shadowxscale;
 | 
			
		||||
	x2 = ((centerxfrac + FixedMul(tx,xscale))>>FRACBITS); x2--;
 | 
			
		||||
	if (x2 < 0 || x2 <= x1) return;
 | 
			
		||||
 | 
			
		||||
	if (shadowyscale < FRACUNIT/patch->height) return; // fix some crashes?
 | 
			
		||||
	if (shadowyscale < FRACUNIT/SHORT(patch->height)) return; // fix some crashes?
 | 
			
		||||
 | 
			
		||||
	shadow = R_NewVisSprite();
 | 
			
		||||
	shadow->patch = patch;
 | 
			
		||||
| 
						 | 
				
			
			@ -1278,8 +1278,8 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
 | 
			
		|||
	shadow->dispoffset = vis->dispoffset - 5;
 | 
			
		||||
	shadow->gx = thing->x;
 | 
			
		||||
	shadow->gy = thing->y;
 | 
			
		||||
	shadow->gzt = shadow->pz + shadow->patch->height * shadowyscale / 2;
 | 
			
		||||
	shadow->gz = shadow->gzt - shadow->patch->height * shadowyscale;
 | 
			
		||||
	shadow->gzt = shadow->pz + SHORT(patch->height) * shadowyscale / 2;
 | 
			
		||||
	shadow->gz = shadow->gzt - SHORT(patch->height) * shadowyscale;
 | 
			
		||||
	shadow->texturemid = FixedMul(thing->scale, FixedDiv(shadow->gzt - viewz, shadowyscale));
 | 
			
		||||
	if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES)
 | 
			
		||||
		shadow->texturemid = FixedMul(shadow->texturemid, ((skin_t *)thing->skin)->highresscale);
 | 
			
		||||
| 
						 | 
				
			
			@ -1300,7 +1300,7 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
 | 
			
		|||
 | 
			
		||||
	shadow->startfrac = 0;
 | 
			
		||||
	//shadow->xiscale = 0x7ffffff0 / (shadow->xscale/2);
 | 
			
		||||
	shadow->xiscale = (patch->width<<FRACBITS)/(x2-x1+1); // fuck it
 | 
			
		||||
	shadow->xiscale = (SHORT(patch->width)<<FRACBITS)/(x2-x1+1); // fuck it
 | 
			
		||||
 | 
			
		||||
	if (shadow->x1 > x1)
 | 
			
		||||
		shadow->startfrac += shadow->xiscale*(shadow->x1-x1);
 | 
			
		||||
| 
						 | 
				
			
			@ -1527,10 +1527,10 @@ static void R_ProjectSprite(mobj_t *thing)
 | 
			
		|||
		rotsprite = sprframe->rotsprite.patch[rot][rollangle];
 | 
			
		||||
		if (rotsprite != NULL)
 | 
			
		||||
		{
 | 
			
		||||
			spr_width = rotsprite->width << FRACBITS;
 | 
			
		||||
			spr_height = rotsprite->height << FRACBITS;
 | 
			
		||||
			spr_offset = rotsprite->leftoffset << FRACBITS;
 | 
			
		||||
			spr_topoffset = rotsprite->topoffset << FRACBITS;
 | 
			
		||||
			spr_width = SHORT(rotsprite->width) << FRACBITS;
 | 
			
		||||
			spr_height = SHORT(rotsprite->height) << FRACBITS;
 | 
			
		||||
			spr_offset = SHORT(rotsprite->leftoffset) << FRACBITS;
 | 
			
		||||
			spr_topoffset = SHORT(rotsprite->topoffset) << FRACBITS;
 | 
			
		||||
			// flip -> rotate, not rotate -> flip
 | 
			
		||||
			flip = 0;
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1675,7 +1675,7 @@ void S_LoadMusicDefs(UINT16 wadnum)
 | 
			
		|||
	char *lf;
 | 
			
		||||
	char *stoken;
 | 
			
		||||
 | 
			
		||||
	size_t nlf;
 | 
			
		||||
	size_t nlf = 0xFFFFFFFF;
 | 
			
		||||
	size_t ncr;
 | 
			
		||||
 | 
			
		||||
	musicdef_t *def = NULL;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -76,6 +76,10 @@ int	snprintf(char *str, size_t n, const char *fmt, ...);
 | 
			
		|||
//int	vsnprintf(char *str, size_t n, const char *fmt, va_list ap);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef _DEBUG
 | 
			
		||||
#include "console.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef O_BINARY
 | 
			
		||||
#define O_BINARY 0
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3199,7 +3199,7 @@ INT32 I_GetKey(void)
 | 
			
		|||
// -----------------
 | 
			
		||||
#define DI_KEYBOARD_BUFFERSIZE 32 // number of data elements in keyboard buffer
 | 
			
		||||
 | 
			
		||||
void I_StartupKeyboard(void)
 | 
			
		||||
static void I_StartupKeyboard(void)
 | 
			
		||||
{
 | 
			
		||||
	DIPROPDWORD dip;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -3435,6 +3435,8 @@ INT32 I_StartupSystem(void)
 | 
			
		|||
	// some 'more global than globals' things to initialize here ?
 | 
			
		||||
	graphics_started = keyboard_started = sound_started = cdaudio_started = false;
 | 
			
		||||
 | 
			
		||||
	I_StartupKeyboard();
 | 
			
		||||
 | 
			
		||||
#ifdef NDEBUG
 | 
			
		||||
 | 
			
		||||
#ifdef BUGTRAP
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -56,6 +56,7 @@ static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff,
 | 
			
		|||
static consvar_t cv_ontop = {"ontop", "Never", 0, CV_NeverOnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
 | 
			
		||||
 | 
			
		||||
boolean highcolor;
 | 
			
		||||
int vid_opengl_state = 0;
 | 
			
		||||
 | 
			
		||||
static BOOL bDIBMode; // means we are using DIB instead of DirectDraw surfaces
 | 
			
		||||
static LPBITMAPINFO bmiMain = NULL;
 | 
			
		||||
| 
						 | 
				
			
			@ -949,7 +950,10 @@ INT32 VID_SetMode(INT32 modenum)
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void VID_CheckRenderer(void) {}
 | 
			
		||||
void VID_CheckGLLoaded(rendermode_t oldrender) {}
 | 
			
		||||
void VID_CheckGLLoaded(rendermode_t oldrender)
 | 
			
		||||
{
 | 
			
		||||
	(void)oldrender;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ========================================================================
 | 
			
		||||
// Free the video buffer of the last video mode,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue