fake multi: draw weapons for both players.

git-svn-id: https://svn.eduke32.com/eduke32@2905 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-08-16 21:48:33 +00:00
parent 9d3d7bfe2f
commit ad88878328
2 changed files with 33 additions and 3 deletions

View file

@ -2640,6 +2640,10 @@ void G_DisplayRest(int32_t smoothratio)
else
{
P_DisplayWeapon(screenpeek);
if (g_fakeMultiMode && ud.multimode==2) // HACK
P_DisplayWeapon(1);
if (pp->over_shoulder_on == 0)
P_DisplayScuba(screenpeek);
}

View file

@ -36,6 +36,7 @@ int32_t g_gs;
int32_t g_kb;
int32_t g_looking_angSR1;
int32_t g_weapon_xoffset;
static int32_t g_snum;
extern int32_t g_levelTextTime, ticrandomseed;
@ -2013,6 +2014,9 @@ static void G_DrawTileScaled(int32_t x, int32_t y, int32_t tilenum, int32_t shad
int32_t a = 0;
int32_t xoff = 192;
int32_t xadd = 0;
int32_t wx1=windowx1, wx2=windowx2;
switch (g_currentweapon)
{
case DEVISTATOR_WEAPON:
@ -2031,13 +2035,33 @@ static void G_DrawTileScaled(int32_t x, int32_t y, int32_t tilenum, int32_t shad
if (orientation&4)
a = 1024;
if (g_fakeMultiMode && ud.multimode==2)
{
// splitscreen HACK
xadd = (-80 + g_snum*160)*65536;
if ((orientation&1024)==0)
{
x*=65536;
y*=65536;
orientation |= 1024;
}
if (g_snum==0)
wx2 = (wx2+wx1)/2+1;
else
wx1 = (wx2+wx1)/2+1;
orientation |= 8;
}
#ifdef USE_OPENGL
if (getrendermode() >= 3 && usemodels && md_tilehasmodel(tilenum,p) > 0)
y += (224-weapsc(224));
#endif
rotatesprite_win(weapsc((orientation&1024)?x:(x<<16))+((xoff-weapsc(xoff))<<16),
rotatesprite(xadd+weapsc((orientation&1024)?x:(x<<16))+((xoff-weapsc(xoff))<<16),
weapsc((orientation&1024)?y:(y<<16))+((200-weapsc(200))<<16),
weapsc(65536L),a,tilenum,shade,p,(2|orientation));
weapsc(65536L),a,tilenum,shade,p,(2|orientation),
wx1,windowy1,wx2,windowy2);
}
static void G_DrawWeaponTile(int32_t x, int32_t y, int32_t tilenum, int32_t shade, int32_t orientation, int32_t p, uint8_t slot)
@ -2312,6 +2336,8 @@ void P_DisplayWeapon(int32_t snum)
uint8_t *kb = &p->kickback_pic;
int32_t gs;
g_snum = snum;
looking_arc = klabs(p->look_ang)/9;
gs = sprite[p->i].shade;