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 (15)
...@@ -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__
...@@ -977,9 +977,25 @@ static void ST_drawInput(void) ...@@ -977,9 +977,25 @@ static void ST_drawInput(void)
const INT32 accent = V_SNAPTOLEFT|V_SNAPTOBOTTOM|(stplyr->skincolor ? Color_Index[stplyr->skincolor-1][4] : 0); const INT32 accent = V_SNAPTOLEFT|V_SNAPTOBOTTOM|(stplyr->skincolor ? Color_Index[stplyr->skincolor-1][4] : 0);
INT32 col; INT32 col;
UINT8 offs; UINT8 offs;
int translucency;
INT32 flags = 0;
INT32 x = hudinfo[HUD_LIVES].x, y = hudinfo[HUD_LIVES].y; INT32 x = hudinfo[HUD_LIVES].x, y = hudinfo[HUD_LIVES].y;
if (modeattacking)/* no translucency in time attack */
translucency = 10;
else
{
if (!( translucency = st_translucency ))/* nothing to see here */
return;
flags |= V_HUDTRANS|V_PERPLAYER;
///V_TestBatch();
/* I'm a lazy shit so these stay magic. haha... */
V_LockBlend(14, 148, 43, 22, flags);
}
if (stplyr->powers[pw_carry] == CR_NIGHTSMODE) if (stplyr->powers[pw_carry] == CR_NIGHTSMODE)
y -= 16; y -= 16;
...@@ -987,34 +1003,34 @@ static void ST_drawInput(void) ...@@ -987,34 +1003,34 @@ static void ST_drawInput(void)
return; return;
// O backing // O backing
V_DrawFill(x, y-1, 16, 16, hudinfo[HUD_LIVES].f|20); V_DrawFillMaybeFade(x, y-1, 16, 16, hudinfo[HUD_LIVES].f|flags|20, translucency);
V_DrawFill(x, y+15, 16, 1, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x, y+15, 16, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);
if (cv_showinputjoy.value) // joystick render! if (cv_showinputjoy.value) // joystick render!
{ {
/*V_DrawFill(x , y , 16, 1, hudinfo[HUD_LIVES].f|16); /*V_DrawFillMaybeFade(x , y , 16, 1, hudinfo[HUD_LIVES].f|flags|16, translucency);
V_DrawFill(x , y+15, 16, 1, hudinfo[HUD_LIVES].f|16); V_DrawFillMaybeFade(x , y+15, 16, 1, hudinfo[HUD_LIVES].f|flags|16, translucency);
V_DrawFill(x , y+ 1, 1, 14, hudinfo[HUD_LIVES].f|16); V_DrawFillMaybeFade(x , y+ 1, 1, 14, hudinfo[HUD_LIVES].f|flags|16, translucency);
V_DrawFill(x+15, y+ 1, 1, 14, hudinfo[HUD_LIVES].f|16); -- red's outline*/ V_DrawFillMaybeFade(x+15, y+ 1, 1, 14, hudinfo[HUD_LIVES].f|flags|16, translucency); -- red's outline*/
if (stplyr->cmd.sidemove || stplyr->cmd.forwardmove) if (stplyr->cmd.sidemove || stplyr->cmd.forwardmove)
{ {
// joystick hole // joystick hole
V_DrawFill(x+5, y+4, 6, 6, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x+5, y+4, 6, 6, hudinfo[HUD_LIVES].f|flags|29, translucency);
// joystick top // joystick top
V_DrawFill(x+3+stplyr->cmd.sidemove/12, V_DrawFillMaybeFade(x+3+stplyr->cmd.sidemove/12,
y+2-stplyr->cmd.forwardmove/12, y+2-stplyr->cmd.forwardmove/12,
10, 10, hudinfo[HUD_LIVES].f|29); 10, 10, hudinfo[HUD_LIVES].f|flags|29, translucency);
V_DrawFill(x+3+stplyr->cmd.sidemove/9, V_DrawFillMaybeFade(x+3+stplyr->cmd.sidemove/9,
y+1-stplyr->cmd.forwardmove/9, y+1-stplyr->cmd.forwardmove/9,
10, 10, accent); 10, 10, flags|accent, translucency);
} }
else else
{ {
// just a limited, greyed out joystick top // just a limited, greyed out joystick top
V_DrawFill(x+3, y+11, 10, 1, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x+3, y+11, 10, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);
V_DrawFill(x+3, V_DrawFillMaybeFade(x+3,
y+1, y+1,
10, 10, hudinfo[HUD_LIVES].f|16); 10, 10, hudinfo[HUD_LIVES].f|flags|16, translucency);
} }
} }
else // arrows! else // arrows!
...@@ -1023,94 +1039,94 @@ static void ST_drawInput(void) ...@@ -1023,94 +1039,94 @@ static void ST_drawInput(void)
if (stplyr->cmd.sidemove < 0) if (stplyr->cmd.sidemove < 0)
{ {
offs = 0; offs = 0;
col = accent; col = flags|accent;
} }
else else
{ {
offs = 1; offs = 1;
col = hudinfo[HUD_LIVES].f|16; col = hudinfo[HUD_LIVES].f|flags|16;
V_DrawFill(x- 2, y+10, 6, 1, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x- 2, y+10, 6, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);
V_DrawFill(x+ 4, y+ 9, 1, 1, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x+ 4, y+ 9, 1, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);
V_DrawFill(x+ 5, y+ 8, 1, 1, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x+ 5, y+ 8, 1, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);
} }
V_DrawFill(x- 2, y+ 5-offs, 6, 6, col); V_DrawFillMaybeFade(x- 2, y+ 5-offs, 6, 6, col, translucency);
V_DrawFill(x+ 4, y+ 6-offs, 1, 4, col); V_DrawFillMaybeFade(x+ 4, y+ 6-offs, 1, 4, col, translucency);
V_DrawFill(x+ 5, y+ 7-offs, 1, 2, col); V_DrawFillMaybeFade(x+ 5, y+ 7-offs, 1, 2, col, translucency);
// ^ // ^
if (stplyr->cmd.forwardmove > 0) if (stplyr->cmd.forwardmove > 0)
{ {
offs = 0; offs = 0;
col = accent; col = flags|accent;
} }
else else
{ {
offs = 1; offs = 1;
col = hudinfo[HUD_LIVES].f|16; col = hudinfo[HUD_LIVES].f|flags|16;
V_DrawFill(x+ 5, y+ 3, 1, 1, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x+ 5, y+ 3, 1, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);
V_DrawFill(x+ 6, y+ 4, 1, 1, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x+ 6, y+ 4, 1, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);
V_DrawFill(x+ 7, y+ 5, 2, 1, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x+ 7, y+ 5, 2, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);
V_DrawFill(x+ 9, y+ 4, 1, 1, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x+ 9, y+ 4, 1, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);
V_DrawFill(x+10, y+ 3, 1, 1, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x+10, y+ 3, 1, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);
} }
V_DrawFill(x+ 5, y- 2-offs, 6, 6, col); V_DrawFillMaybeFade(x+ 5, y- 2-offs, 6, 6, col, translucency);
V_DrawFill(x+ 6, y+ 4-offs, 4, 1, col); V_DrawFillMaybeFade(x+ 6, y+ 4-offs, 4, 1, col, translucency);
V_DrawFill(x+ 7, y+ 5-offs, 2, 1, col); V_DrawFillMaybeFade(x+ 7, y+ 5-offs, 2, 1, col, translucency);
// > // >
if (stplyr->cmd.sidemove > 0) if (stplyr->cmd.sidemove > 0)
{ {
offs = 0; offs = 0;
col = accent; col = flags|accent;
} }
else else
{ {
offs = 1; offs = 1;
col = hudinfo[HUD_LIVES].f|16; col = hudinfo[HUD_LIVES].f|flags|16;
V_DrawFill(x+12, y+10, 6, 1, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x+12, y+10, 6, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);
V_DrawFill(x+11, y+ 9, 1, 1, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x+11, y+ 9, 1, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);
V_DrawFill(x+10, y+ 8, 1, 1, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x+10, y+ 8, 1, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);
} }
V_DrawFill(x+12, y+ 5-offs, 6, 6, col); V_DrawFillMaybeFade(x+12, y+ 5-offs, 6, 6, col, translucency);
V_DrawFill(x+11, y+ 6-offs, 1, 4, col); V_DrawFillMaybeFade(x+11, y+ 6-offs, 1, 4, col, translucency);
V_DrawFill(x+10, y+ 7-offs, 1, 2, col); V_DrawFillMaybeFade(x+10, y+ 7-offs, 1, 2, col, translucency);
// v // v
if (stplyr->cmd.forwardmove < 0) if (stplyr->cmd.forwardmove < 0)
{ {
offs = 0; offs = 0;
col = accent; col = flags|accent;
} }
else else
{ {
offs = 1; offs = 1;
col = hudinfo[HUD_LIVES].f|16; col = hudinfo[HUD_LIVES].f|flags|16;
V_DrawFill(x+ 5, y+17, 6, 1, hudinfo[HUD_LIVES].f|29); V_DrawFillMaybeFade(x+ 5, y+17, 6, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);
} }
V_DrawFill(x+ 5, y+12-offs, 6, 6, col); V_DrawFillMaybeFade(x+ 5, y+12-offs, 6, 6, col, translucency);
V_DrawFill(x+ 6, y+11-offs, 4, 1, col); V_DrawFillMaybeFade(x+ 6, y+11-offs, 4, 1, col, translucency);
V_DrawFill(x+ 7, y+10-offs, 2, 1, col); V_DrawFillMaybeFade(x+ 7, y+10-offs, 2, 1, col, translucency);
} }
#define drawbutt(xoffs, yoffs, butt, symb)\ #define drawbutt(xoffs, yoffs, butt, symb)\
if (stplyr->cmd.buttons & butt)\ if (stplyr->cmd.buttons & butt)\
{\ {\
offs = 0;\ offs = 0;\
col = accent;\ col = flags|accent;\
}\ }\
else\ else\
{\ {\
offs = 1;\ offs = 1;\
col = hudinfo[HUD_LIVES].f|16;\ col = hudinfo[HUD_LIVES].f|flags|16;\
V_DrawFill(x+16+(xoffs), y+9+(yoffs), 10, 1, hudinfo[HUD_LIVES].f|29);\ V_DrawFillMaybeFade(x+16+(xoffs), y+9+(yoffs), 10, 1, hudinfo[HUD_LIVES].f|flags|29, translucency);\
}\ }\
V_DrawFill(x+16+(xoffs), y+(yoffs)-offs, 10, 10, col);\ V_DrawFillMaybeFade(x+16+(xoffs), y+(yoffs)-offs, 10, 10, col, translucency);\
V_DrawCharacter(x+16+1+(xoffs), y+1+(yoffs)-offs, hudinfo[HUD_LIVES].f|symb, false) V_DrawCharacter(x+16+1+(xoffs), y+1+(yoffs)-offs, hudinfo[HUD_LIVES].f|flags|symb, false)
drawbutt( 4,-3, BT_JUMP, 'J'); drawbutt( 4,-3, BT_JUMP, 'J');
drawbutt(15,-3, BT_USE, 'S'); drawbutt(15,-3, BT_USE, 'S');
V_DrawFill(x+16+4, y+8, 21, 10, hudinfo[HUD_LIVES].f|20); // sundial backing V_DrawFillMaybeFade(x+16+4, y+8, 21, 10, hudinfo[HUD_LIVES].f|flags|20, translucency); // sundial backing
if (stplyr->mo) if (stplyr->mo)
{ {
UINT8 i, precision; UINT8 i, precision;
...@@ -1123,18 +1139,18 @@ static void ST_drawInput(void) ...@@ -1123,18 +1139,18 @@ static void ST_drawInput(void)
ycomp = 3; ycomp = 3;
if (ycomp > 0) if (ycomp > 0)
V_DrawFill(x+16+13-xcomp, y+11-ycomp, 3, 3, accent); // point (behind) V_DrawFillMaybeFade(x+16+13-xcomp, y+11-ycomp, 3, 3, flags|accent, translucency); // point (behind)
precision = max(3, abs(xcomp)); precision = max(3, abs(xcomp));
for (i = 0; i < precision; i++) // line for (i = 0; i < precision; i++) // line
{ {
V_DrawFill(x+16+14-(i*xcomp)/precision, V_DrawFillMaybeFade(x+16+14-(i*xcomp)/precision,
y+12-(i*ycomp)/precision, y+12-(i*ycomp)/precision,
1, 1, hudinfo[HUD_LIVES].f|16); 1, 1, hudinfo[HUD_LIVES].f|flags|16, translucency);
} }
if (ycomp <= 0) if (ycomp <= 0)
V_DrawFill(x+16+13-xcomp, y+11-ycomp, 3, 3, accent); // point (in front) V_DrawFillMaybeFade(x+16+13-xcomp, y+11-ycomp, 3, 3, flags|accent, translucency); // point (in front)
} }
#undef drawbutt #undef drawbutt
...@@ -1147,7 +1163,7 @@ static void ST_drawInput(void) ...@@ -1147,7 +1163,7 @@ static void ST_drawInput(void)
if (stplyr->pflags & PF_AUTOBRAKE) if (stplyr->pflags & PF_AUTOBRAKE)
{ {
V_DrawThinString(x, y, V_DrawThinString(x, y,
hudinfo[HUD_LIVES].f| hudinfo[HUD_LIVES].f|flags|
((!stplyr->powers[pw_carry] ((!stplyr->powers[pw_carry]
&& (stplyr->pflags & PF_APPLYAUTOBRAKE) && (stplyr->pflags & PF_APPLYAUTOBRAKE)
&& !(stplyr->cmd.sidemove || stplyr->cmd.forwardmove) && !(stplyr->cmd.sidemove || stplyr->cmd.forwardmove)
...@@ -1159,12 +1175,14 @@ static void ST_drawInput(void) ...@@ -1159,12 +1175,14 @@ static void ST_drawInput(void)
} }
if (stplyr->pflags & PF_ANALOGMODE) if (stplyr->pflags & PF_ANALOGMODE)
{ {
V_DrawThinString(x, y, hudinfo[HUD_LIVES].f, "ANALOG"); V_DrawThinString(x, y, hudinfo[HUD_LIVES].f|flags, "ANALOG");
y -= 8; y -= 8;
} }
} }
if (!demosynced) // should always be last, so it doesn't push anything else around if (!demosynced) // should always be last, so it doesn't push anything else around
V_DrawThinString(x, y, hudinfo[HUD_LIVES].f|((leveltime & 4) ? V_YELLOWMAP : V_REDMAP), "BAD DEMO!!"); V_DrawThinString(x, y, hudinfo[HUD_LIVES].f|flags|((leveltime & 4) ? V_YELLOWMAP : V_REDMAP), "BAD DEMO!!");
V_UnlockBlend();
} }
static patch_t *lt_patches[3]; static patch_t *lt_patches[3];
......
...@@ -484,6 +484,253 @@ void VID_BlitLinearScreen(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT3 ...@@ -484,6 +484,253 @@ 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 = 0;
}
static UINT8 *
Vblendscreen (int n)
{
if (v_blendscreen && n == 0)
return v_blendscreen;
else
return screens[n];
}
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};
...@@ -517,6 +764,7 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca ...@@ -517,6 +764,7 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
INT32 dupx, dupy; INT32 dupx, dupy;
const column_t *column; const column_t *column;
UINT8 *desttop, *dest, *deststart, *destend; UINT8 *desttop, *dest, *deststart, *destend;
UINT8 *sauctop, *sauc, *saucstart, *saucend;
const UINT8 *source, *deststop; const UINT8 *source, *deststop;
fixed_t pwidth; // patch width fixed_t pwidth; // patch width
fixed_t offx = 0; // x offset fixed_t offx = 0; // x offset
...@@ -763,9 +1011,17 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca ...@@ -763,9 +1011,17 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
else else
pwidth = SHORT(patch->width) * dupx; pwidth = SHORT(patch->width) * dupx;
#ifdef BATCHTEST
Vstatbatch(x, y, pwidth, dupy * (( pscale * SHORT (patch->height) )>>FRACBITS ));
#endif
deststart = desttop; deststart = desttop;
destend = desttop + pwidth; destend = desttop + pwidth;
sauctop = Vblendscreen(scrn&V_PARAMMASK) + y * vid.width + x;
saucstart = sauctop;
saucend = sauctop + pwidth;
for (col = 0; (col>>FRACBITS) < SHORT(patch->width); col += colfrac, ++offx, desttop++) for (col = 0; (col>>FRACBITS) < SHORT(patch->width); col += colfrac, ++offx, desttop++)
{ {
INT32 topdelta, prevdelta = -1; INT32 topdelta, prevdelta = -1;
...@@ -793,18 +1049,26 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca ...@@ -793,18 +1049,26 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
prevdelta = topdelta; prevdelta = topdelta;
source = (const UINT8 *)(column) + 3; source = (const UINT8 *)(column) + 3;
dest = desttop; dest = desttop;
sauc = sauctop;
if (scrn & V_FLIP) if (scrn & V_FLIP)
{
dest = deststart + (destend - desttop); dest = deststart + (destend - desttop);
sauc = saucstart + (saucend - sauctop);
}
dest += FixedInt(FixedMul(topdelta<<FRACBITS,vdup))*vid.width; dest += FixedInt(FixedMul(topdelta<<FRACBITS,vdup))*vid.width;
sauc += FixedInt(FixedMul(topdelta<<FRACBITS,vdup))*vid.width;
for (ofs = 0; dest < deststop && (ofs>>FRACBITS) < column->length; ofs += rowfrac) for (ofs = 0; dest < deststop && (ofs>>FRACBITS) < column->length; ofs += rowfrac)
{ {
if (dest >= screens[scrn&V_PARAMMASK]) // don't draw off the top of the screen (CRASH PREVENTION) if (dest >= screens[scrn&V_PARAMMASK]) // don't draw off the top of the screen (CRASH PREVENTION)
*dest = patchdrawfunc(dest, source, ofs); *dest = patchdrawfunc(sauc, source, ofs);
dest += vid.width; dest += vid.width;
sauc += vid.width;
} }
column = (const column_t *)((const UINT8 *)column + column->length + 4); column = (const column_t *)((const UINT8 *)column + column->length + 4);
} }
sauctop++;
} }
} }
...@@ -1290,6 +1554,10 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) ...@@ -1290,6 +1554,10 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
if (y + h > vid.height) if (y + h > vid.height)
h = vid.height - y; h = vid.height - y;
#ifdef BATCHTEST
Vstatbatch(x, y, w, h);
#endif
dest = screens[0] + y*vid.width + x; dest = screens[0] + y*vid.width + x;
deststop = screens[0] + vid.rowbytes * vid.height; deststop = screens[0] + vid.rowbytes * vid.height;
...@@ -1526,6 +1794,14 @@ void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) ...@@ -1526,6 +1794,14 @@ void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
} }
} }
void V_DrawFillMaybeFade (INT32 x, INT32 y, INT32 w, INT32 h, INT32 c, UINT8 strength)
{
if (strength > 9)
V_DrawFill(x, y, w, h, c);
else
V_DrawFadeFill(x, y, w, h, c, ( c & 255 ), strength);
}
// //
// If color is 0x00 to 0xFF, draw transtable (strength range 0-9). // If color is 0x00 to 0xFF, draw transtable (strength range 0-9).
// Else, use COLORMAP lump (strength range 0-31). // Else, use COLORMAP lump (strength range 0-31).
...@@ -1538,6 +1814,7 @@ void V_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c, UINT16 color, U ...@@ -1538,6 +1814,7 @@ void V_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c, UINT16 color, U
{ {
UINT8 *dest; UINT8 *dest;
const UINT8 *deststop; const UINT8 *deststop;
UINT8 *sauc;
INT32 u; INT32 u;
UINT8 *fadetable; UINT8 *fadetable;
UINT8 perplayershuffle = 0; UINT8 perplayershuffle = 0;
...@@ -1677,9 +1954,17 @@ void V_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c, UINT16 color, U ...@@ -1677,9 +1954,17 @@ void V_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c, UINT16 color, U
if (y + h > vid.height) if (y + h > vid.height)
h = vid.height-y; h = vid.height-y;
dest = screens[0] + y*vid.width + x; #ifdef BATCHTEST
Vstatbatch(x, y, w, h);
#endif
x = y * vid.width + x;
dest = screens[0] + x;
deststop = screens[0] + vid.rowbytes * vid.height; deststop = screens[0] + vid.rowbytes * vid.height;
sauc = Vblendscreen(0) + x;
c &= 255; c &= 255;
fadetable = ((color & 0xFF00) // Color is not palette index? fadetable = ((color & 0xFF00) // Color is not palette index?
...@@ -1690,9 +1975,10 @@ void V_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c, UINT16 color, U ...@@ -1690,9 +1975,10 @@ void V_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c, UINT16 color, U
u = 0; u = 0;
while (u < w) while (u < w)
{ {
dest[u] = fadetable[dest[u]]; dest[u] = fadetable[sauc[u]];
u++; u++;
} }
sauc += vid.width;
} }
} }
......
...@@ -180,6 +180,8 @@ void V_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatnum); ...@@ -180,6 +180,8 @@ void V_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatnum);
void V_DrawFadeScreen(UINT16 color, UINT8 strength); void V_DrawFadeScreen(UINT16 color, UINT8 strength);
// available to lua over my dead body, which will probably happen in this heat // available to lua over my dead body, which will probably happen in this heat
void V_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c, UINT16 color, UINT8 strength); void V_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c, UINT16 color, UINT8 strength);
/* Do you ever hate life? */
void V_DrawFillMaybeFade(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c, UINT8 strength);
void V_DrawFadeConsBack(INT32 plines); void V_DrawFadeConsBack(INT32 plines);
void V_DrawPromptBack(INT32 boxheight, INT32 color); void V_DrawPromptBack(INT32 boxheight, INT32 color);
...@@ -244,4 +246,10 @@ void V_DrawPatchFill(patch_t *pat); ...@@ -244,4 +246,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