Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
  • Jisk/srb-2-beef-jerky
117 results
Select Git revision
Show changes
Commits on Source (4)
...@@ -640,4 +640,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; ...@@ -640,4 +640,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// Render flats on walls /// Render flats on walls
#define WALLFLATS #define WALLFLATS
/* THE CODE IN ST_STUFF SUCKS WTF */
/// Show dimensions of drawing in batched mode
//#define BATCHTEST
#endif // __DOOMDEF__ #endif // __DOOMDEF__
...@@ -484,6 +484,244 @@ void VID_BlitLinearScreen(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT3 ...@@ -484,6 +484,244 @@ void VID_BlitLinearScreen(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT3
#endif #endif
} }
/*
Blend Locking
This is a fancy name for something really simple; Use a secondary buffer for
blending translucent pixels. This is for overlapping translucent drawing.
*/
static UINT8 *v_blendscreen;
#ifdef BATCHTEST
static int v_batchtest;
static int v_batchx1;
static int v_batchx2;
static int v_batchy1;
static int v_batchy2;
void
V_TestBatch (void)
{
v_batchx1 = 0;
v_batchx2 = 0;
v_batchy1 = 0;
v_batchy2 = 0;
v_batchtest = 1;
}
static void
Vstatbatch (int x, int y, int w, int h)
{
switch (v_batchtest)
{
case 1:
v_batchx1 = x;
v_batchx2 = x + w;
v_batchy1 = y;
v_batchy2 = y + h;
v_batchtest = 2;
break;
case 2:
if (x < v_batchx1)
v_batchx1 = x;
if (y < v_batchy1)
v_batchy1 = y;
x = x + w;
if (x > v_batchx2)
v_batchx2 = x;
y = y + h;
if (y > v_batchy2)
v_batchy2 = y;
break;
}
}
#endif/*BATCHTEST*/
void
V_LockBlend (
int x,
int y,
int w,
int h,
int flags
){
UINT8 perplayershuffle = 0;
int dupx;
int dupy;
/* Now I too can say I picked on OpenGL at school today... */
if (rendermode == render_soft)
{
/* I see this copy pasted everywhere holy shit */
if (splitscreen && (flags & V_PERPLAYER))
{
fixed_t adjusty = ((flags & V_NOSCALESTART) ? vid.height : BASEVIDHEIGHT)>>1;
h >>= 1;
y >>= 1;
#ifdef QUADS
if (splitscreen > 1) // 3 or 4 players
{
fixed_t adjustx = ((flags & V_NOSCALESTART) ? vid.height : BASEVIDHEIGHT)>>1;
w >>= 1;
x >>= 1;
if (stplyr == &players[displayplayer])
{
if (!(flags & (V_SNAPTOTOP|V_SNAPTOBOTTOM)))
perplayershuffle |= 1;
if (!(flags & (V_SNAPTOLEFT|V_SNAPTORIGHT)))
perplayershuffle |= 4;
flags &= ~V_SNAPTOBOTTOM|V_SNAPTORIGHT;
}
else if (stplyr == &players[secondarydisplayplayer])
{
if (!(flags & (V_SNAPTOTOP|V_SNAPTOBOTTOM)))
perplayershuffle |= 1;
if (!(flags & (V_SNAPTOLEFT|V_SNAPTORIGHT)))
perplayershuffle |= 8;
x += adjustx;
flags &= ~V_SNAPTOBOTTOM|V_SNAPTOLEFT;
}
else if (stplyr == &players[thirddisplayplayer])
{
if (!(flags & (V_SNAPTOTOP|V_SNAPTOBOTTOM)))
perplayershuffle |= 2;
if (!(flags & (V_SNAPTOLEFT|V_SNAPTORIGHT)))
perplayershuffle |= 4;
y += adjusty;
flags &= ~V_SNAPTOTOP|V_SNAPTORIGHT;
}
else //if (stplyr == &players[fourthdisplayplayer])
{
if (!(flags & (V_SNAPTOTOP|V_SNAPTOBOTTOM)))
perplayershuffle |= 2;
if (!(flags & (V_SNAPTOLEFT|V_SNAPTORIGHT)))
perplayershuffle |= 8;
x += adjustx;
y += adjusty;
flags &= ~V_SNAPTOTOP|V_SNAPTOLEFT;
}
}
else
#endif
// 2 players
{
if (stplyr == &players[displayplayer])
{
if (!(flags & (V_SNAPTOTOP|V_SNAPTOBOTTOM)))
perplayershuffle |= 1;
flags &= ~V_SNAPTOBOTTOM;
}
else //if (stplyr == &players[secondarydisplayplayer])
{
if (!(flags & (V_SNAPTOTOP|V_SNAPTOBOTTOM)))
perplayershuffle |= 2;
y += adjusty;
flags &= ~V_SNAPTOTOP;
}
}
}
/*
This used to be a bunch of fucking shit until
I realized screens[1] can probably be used.
*/
if (!( flags & V_NOSCALESTART ))
{
x *= vid.dupx;
w *= vid.dupx;
y *= vid.dupy;
h *= vid.dupy;
dupx = vid.dupx;
dupy = vid.dupy;
}
else
{
dupx = 1;
dupy = 1;
}
// Center it if necessary
if (vid.width != BASEVIDWIDTH * dupx)
{
// dupx adjustments pretend that screen width is BASEVIDWIDTH * dupx,
// so center this imaginary screen
if (flags & V_SNAPTORIGHT)
x += (vid.width - (BASEVIDWIDTH * dupx));
else if (!(flags & V_SNAPTOLEFT))
x += (vid.width - (BASEVIDWIDTH * dupx)) / 2;
if (perplayershuffle & 4)
x -= (vid.width - (BASEVIDWIDTH * dupx)) / 4;
else if (perplayershuffle & 8)
x += (vid.width - (BASEVIDWIDTH * dupx)) / 4;
}
if (vid.height != BASEVIDHEIGHT * dupy)
{
// same thing here
if (flags & V_SNAPTOBOTTOM)
y += (vid.height - (BASEVIDHEIGHT * dupy));
else if (!(flags & V_SNAPTOTOP))
y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2;
if (perplayershuffle & 1)
y -= (vid.height - (BASEVIDHEIGHT * dupy)) / 4;
else if (perplayershuffle & 2)
y += (vid.height - (BASEVIDHEIGHT * dupy)) / 4;
}
x = y * vid.width + x;
VID_BlitLinearScreen(
screens[0] + x,
screens[1] + x,
w,
h,
vid.width,
vid.width
);
v_blendscreen = screens[1];
}
}
void
V_UnlockBlend (void)
{
#ifdef BATCHTEST
int w;
int h;
if (v_batchtest)
{
w = ( v_batchx2 - v_batchx1 );
h = ( v_batchy2 - v_batchy1 );
if (!(
v_batchx1 % vid.dupx ||
w % vid.dupx ||
v_batchy1 % vid.dupy ||
h % vid.dupy )
){
CONS_Printf(
"%dx%d+%d+%d(u)\n",
w / vid.dupx,
h / vid.dupy,
v_batchx1 / vid.dupx,
v_batchy1 / vid.dupy
);
}
else
{
CONS_Printf(
"%dx%d+%d+%d\n",
w,
h,
v_batchx1,
v_batchy1
);
}
}
#endif/*BATCHTEST*/
v_blendscreen = screens[0];
}
static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0}; static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0};
static UINT8 hudminusalpha[11] = { 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5}; static UINT8 hudminusalpha[11] = { 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5};
...@@ -3292,6 +3530,8 @@ void V_Init(void) ...@@ -3292,6 +3530,8 @@ void V_Init(void)
if (vid.direct) if (vid.direct)
screens[0] = vid.direct; screens[0] = vid.direct;
v_blendscreen = screens[0];
#ifdef DEBUG #ifdef DEBUG
CONS_Debug(DBG_RENDER, "V_Init done:\n"); CONS_Debug(DBG_RENDER, "V_Init done:\n");
for (i = 0; i < NUMSCREENS+1; i++) for (i = 0; i < NUMSCREENS+1; i++)
......
...@@ -244,4 +244,10 @@ void V_DrawPatchFill(patch_t *pat); ...@@ -244,4 +244,10 @@ void V_DrawPatchFill(patch_t *pat);
void VID_BlitLinearScreen(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT32 height, size_t srcrowbytes, void VID_BlitLinearScreen(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT32 height, size_t srcrowbytes,
size_t destrowbytes); size_t destrowbytes);
void V_LockBlend (int x, int y, int w, int h, int flags);
void V_UnlockBlend (void);
#ifdef BATCHTEST
void V_TestBatch (void);
#endif
#endif #endif