random shit i had stashed and too lazy since its for testing only anyways
This commit is contained in:
1 parent
88dc60648e
commit
f02bd5513e
7 files changed
+35
-20
No files matched your search
+3
-3
@@ -824,7 +824,7 @@ void D_SRB2Loop(void)
|
||||
|
||||
if (interp)
|
||||
{
|
||||
renderdeltatics = FLOAT_TO_FIXED(deltatics);
|
||||
renderdeltatics = DoubleToFixed(deltatics);
|
||||
|
||||
if (!(paused || P_AutoPause()) && deltatics < 1.0 && !hu_stopped)
|
||||
{
|
||||
@@ -877,7 +877,7 @@ void D_SRB2Loop(void)
|
||||
|
||||
// Use the time before sleep for frameskip calculations:
|
||||
// post-sleep time is literally being intentionally wasted
|
||||
deltasecs = (double)((INT64)(finishprecise - enterprecise)) / I_GetPrecisePrecision();
|
||||
deltasecs = (double)(finishprecise - enterprecise) / I_GetPrecisePrecision();
|
||||
deltatics = deltasecs * NEWTICRATE;
|
||||
|
||||
// If time spent this game loop exceeds a single tic,
|
||||
@@ -911,7 +911,7 @@ void D_SRB2Loop(void)
|
||||
}
|
||||
// Capture the time once more to get the real delta time.
|
||||
finishprecise = I_GetPreciseTime();
|
||||
deltasecs = (double)((INT64)(finishprecise - enterprecise)) / I_GetPrecisePrecision();
|
||||
deltasecs = (double)(finishprecise - enterprecise) / I_GetPrecisePrecision();
|
||||
deltatics = deltasecs * NEWTICRATE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -638,7 +638,11 @@ void HWR_DrawConsoleBack(UINT32 color, INT32 height)
|
||||
Surf.PolyColor.rgba = UINT2RGBA(color);
|
||||
Surf.PolyColor.s.alpha = 0x80;
|
||||
|
||||
GL_DrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
||||
int flags = PF_NoTexture|PF_Modulated|PF_NoDepthTest;
|
||||
|
||||
flags |= HWR_GetBlendModeFlag(((B_MODULATE & V_BLENDMASK) >> V_BLENDSHIFT)+1);
|
||||
|
||||
GL_DrawPolygon(&Surf, v, 4, flags);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -58,7 +58,7 @@ void I_UpdateTime(fixed_t timescale)
|
||||
tic_t realtics;
|
||||
|
||||
// get real tics
|
||||
ticratescaled = (double)TICRATE * FIXED_TO_FLOAT(timescale);
|
||||
ticratescaled = (double)TICRATE * FixedToDouble(timescale);
|
||||
|
||||
enterprecise = I_GetPreciseTime();
|
||||
elapsedseconds = (double)(enterprecise - oldenterprecise) / I_GetPrecisePrecision();
|
||||
@@ -77,6 +77,6 @@ void I_UpdateTime(fixed_t timescale)
|
||||
{
|
||||
double fractional, integral;
|
||||
fractional = modf(tictimer * ticratescaled, &integral);
|
||||
g_time.timefrac = FLOAT_TO_FIXED(fractional);
|
||||
g_time.timefrac = DoubleToFixed(fractional);
|
||||
}
|
||||
}
|
||||
+10
-10
@@ -1713,8 +1713,8 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
||||
fx->eflags |= MFE_VERTICALFLIP;
|
||||
else
|
||||
fx->eflags &= ~MFE_VERTICALFLIP;
|
||||
fx->lightlevel = M_RandomRange(200, 255);
|
||||
fx->frame |= FF_ABSOLUTELIGHTLEVEL;
|
||||
//fx->lightlevel = M_RandomRange(200, 255);
|
||||
//fx->frame |= FF_ABSOLUTELIGHTLEVEL;
|
||||
fx->blendmode = AST_ADD;
|
||||
P_SetScale(fx, mobj1->scale);
|
||||
|
||||
@@ -3725,8 +3725,8 @@ void K_SpawnSparkleTrail(mobj_t *mo)
|
||||
|
||||
sparkle->color = mo->color;
|
||||
|
||||
sparkle->lightlevel = M_RandomRange(200, 255);
|
||||
sparkle->frame |= FF_ABSOLUTELIGHTLEVEL;
|
||||
//sparkle->lightlevel = M_RandomRange(200, 255);
|
||||
//sparkle->frame |= FF_ABSOLUTELIGHTLEVEL;
|
||||
sparkle->blendmode = AST_ADD;
|
||||
}
|
||||
|
||||
@@ -3867,8 +3867,8 @@ void K_DriftDustHandling(mobj_t *spawner)
|
||||
else
|
||||
dust->color = SKINCOLOR_SILVER; // fallback
|
||||
|
||||
dust->lightlevel = M_RandomRange(200, 255);
|
||||
dust->frame |= FF_ABSOLUTELIGHTLEVEL;
|
||||
//dust->lightlevel = M_RandomRange(200, 255);
|
||||
//dust->frame |= FF_ABSOLUTELIGHTLEVEL;
|
||||
dust->blendmode = AST_ADD;
|
||||
}
|
||||
else
|
||||
@@ -5568,8 +5568,8 @@ static inline void K_SpawnNormalSpeedLines(player_t *player, boolean synched)
|
||||
}
|
||||
}
|
||||
|
||||
fast->lightlevel = M_RandomRange(200, 255);
|
||||
fast->frame |= FF_ABSOLUTELIGHTLEVEL;
|
||||
//fast->lightlevel = M_RandomRange(200, 255);
|
||||
//fast->frame |= FF_ABSOLUTELIGHTLEVEL;
|
||||
fast->blendmode = AST_ADD;
|
||||
}
|
||||
|
||||
@@ -9058,7 +9058,7 @@ static void K_DrawKartPositionNum(INT32 num)
|
||||
INT32 W = SHORT(kp_positionnum[0][0]->width);
|
||||
fixed_t scale = FRACUNIT;
|
||||
patch_t *localpatch = kp_positionnum[0][0];
|
||||
INT32 addOrSub = B_ADD;
|
||||
INT32 addOrSub = B_SUBTRACT;
|
||||
//INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTORIGHT);
|
||||
INT32 fx = 0, fy = 0, fflags = 0;
|
||||
INT32 xoffs = wheeloffs ? -48 : 0;
|
||||
@@ -9068,7 +9068,7 @@ static void K_DrawKartPositionNum(INT32 num)
|
||||
|
||||
if ((mapheaderinfo[gamemap - 1]->levelflags & LF_SUBTRACTNUM) == LF_SUBTRACTNUM)
|
||||
{
|
||||
addOrSub = B_SUBTRACT;
|
||||
addOrSub = B_ADD;
|
||||
}
|
||||
|
||||
if ((cv_posanim.value && stplyr->kartstuff[k_positiondelay]) || stplyr->exiting)
|
||||
|
||||
@@ -49,6 +49,16 @@ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FloatToFixed(float f)
|
||||
return (fixed_t)(f * FRACUNIT);
|
||||
}
|
||||
|
||||
FUNCMATH FUNCINLINE static ATTRINLINE float FixedToDouble(fixed_t x)
|
||||
{
|
||||
return x / (double)FRACUNIT;
|
||||
}
|
||||
|
||||
FUNCMATH FUNCINLINE static ATTRINLINE fixed_t DoubleToFixed(double f)
|
||||
{
|
||||
return (fixed_t)(f * FRACUNIT);
|
||||
}
|
||||
|
||||
// for backwards compat
|
||||
#define FIXED_TO_FLOAT(x) FixedToFloat(x) // (((float)(x)) / ((float)FRACUNIT))
|
||||
#define FLOAT_TO_FIXED(f) FloatToFixed(f) // (fixed_t)((f) * ((float)FRACUNIT))
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#define FF_BLENDMASK 0x7000
|
||||
/// \brief shift for FF_BLENDMASK
|
||||
#define FF_BLENDSHIFT 12
|
||||
|
||||
/// \brief preshifted blend flags minus 1 as effects don't distinguish between AST_COPY and AST_TRANSLUCENT
|
||||
#define FF_ADD ((AST_ADD-1)<<FF_BLENDSHIFT)
|
||||
#define FF_SUBTRACT ((AST_SUBTRACT-1)<<FF_BLENDSHIFT)
|
||||
|
||||
+4
-4
@@ -315,7 +315,7 @@ static void BlendTab_Modulative(UINT8 *table)
|
||||
|
||||
static INT32 BlendTab_Count[NUMBLENDMAPS] =
|
||||
{
|
||||
NUMTRANSTABLES, // blendtab_add
|
||||
NUMTRANSTABLES+1, // blendtab_add
|
||||
NUMTRANSTABLES+1, // blendtab_subtract
|
||||
NUMTRANSTABLES+1, // blendtab_reversesubtract
|
||||
1 // blendtab_modulate
|
||||
@@ -335,7 +335,7 @@ static INT32 BlendTab_FromStyle[] =
|
||||
static void BlendTab_GenerateMaps(INT32 tab, INT32 style, void (*genfunc)(UINT8 *, int, UINT8))
|
||||
{
|
||||
INT32 i = 0, num = BlendTab_Count[tab];
|
||||
const float amtmul = (256.0f / (float)(NUMTRANSTABLES));
|
||||
const float amtmul = (256.0f / (float)(NUMTRANSTABLES + 1));
|
||||
for (; i < num; i++)
|
||||
{
|
||||
const size_t offs = (0x10000 * i);
|
||||
@@ -382,7 +382,7 @@ UINT8 *R_GetBlendTable(int style, INT32 alphalevel)
|
||||
{
|
||||
size_t offs;
|
||||
|
||||
if (style == AST_COPY || style == AST_OVERLAY)
|
||||
if (style <= AST_COPY || style >= AST_OVERLAY)
|
||||
return NULL;
|
||||
|
||||
offs = (ClipBlendLevel(style, alphalevel) << FF_TRANSSHIFT);
|
||||
@@ -412,7 +412,7 @@ UINT8 *R_GetBlendTable(int style, INT32 alphalevel)
|
||||
|
||||
boolean R_BlendLevelVisible(INT32 blendmode, INT32 alphalevel)
|
||||
{
|
||||
if (blendmode == AST_COPY || blendmode == AST_SUBTRACT || blendmode == AST_MODULATE || blendmode == AST_OVERLAY)
|
||||
if (blendmode <= AST_COPY || blendmode == AST_SUBTRACT || blendmode == AST_MODULATE || blendmode >= AST_OVERLAY)
|
||||
return true;
|
||||
|
||||
return (alphalevel < BlendTab_Count[BlendTab_FromStyle[blendmode]]);
|
||||
|
||||
Reference in new issue
Block a user