Rednukem: dh wip

# Conflicts:
#	source/rr/src/rrdh.h
This commit is contained in:
nukeykt 2020-02-27 21:52:38 +09:00 committed by Christoph Oelckers
parent 882b061ee1
commit bb3009c8a7
8 changed files with 84 additions and 27 deletions

View file

@ -9710,6 +9710,16 @@ void G_MoveWorld(void)
g_moveActorsTime = (1-0.033)*g_moveActorsTime + 0.033*(timerGetHiTicks()-actorsTime);
if (DEER)
{
sub_56EA8();
ghtarget_move();
gharrow_move();
ghdeploy_move();
sub_519E8(ud.level_number);
sub_5524C();
}
// XXX: Has to be before effectors, in particular movers?
// TODO: lights in moving sectors ought to be interpolated
G_DoEffectorLights();

View file

@ -1700,7 +1700,7 @@ int A_Spawn(int spriteNum, int tileNum)
pSprite->picnum = BOLT1;
else if (!RR && pSprite->picnum >= SIDEBOLT1 && pSprite->picnum <= SIDEBOLT1 + 3)
pSprite->picnum = SIDEBOLT1;
if (DEER && pSprite->picnum != APLAYER)
if (DEER && pSprite->picnum != APLAYER && pSprite->picnum != RRTILE7936)
{
goto default_case;
}

View file

@ -1492,7 +1492,8 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop)
continue;
case CON_IFPDISTL:
VM_CONDITIONAL(!(DEER && sub_535EC()) && vm.playerDist < *(++insptr));
insptr++;
VM_CONDITIONAL(!(DEER && sub_535EC()) && vm.playerDist < *(insptr));
if (vm.playerDist > MAXSLEEPDIST && vm.pActor->timetosleep == 0)
vm.pActor->timetosleep = SLEEPTIME;
continue;

View file

@ -1863,6 +1863,29 @@ void P_DisplayWeapon(void)
g_snum = screenpeek;
#endif
if (DEER)
{
switch (pPlayer->dhat61f)
{
case 0:
ghpistol_render(screenpeek);
break;
case 1:
ghrifle_render(screenpeek, 0);
break;
case 2:
ghrifle_render(screenpeek, 1);
break;
case 3:
ghshtgn_render(screenpeek);
break;
case 4:
ghbow_render(screenpeek);
break;
}
return;
}
if (pPlayer->newowner >= 0 || ud.camerasprite >= 0 || (!RR && pPlayer->over_shoulder_on > 0)
|| (sprite[pPlayer->i].pal != 1 && sprite[pPlayer->i].extra <= 0))
return;
@ -4082,6 +4105,9 @@ void P_DHGetInput(int const playerNum)
input.fvel = clamp(input.fvel, -MAXVEL, MAXVEL);
input.svel = clamp(input.svel, -MAXSVEL, MAXSVEL);
if (playerRunning && sub_535EC())
input.fvel <<= 3;
input.q16avel = fix16_clamp(input.q16avel, F16(-MAXANGVEL), F16(MAXANGVEL));
input.q16horz = fix16_clamp(input.q16horz, F16(-MAXHORIZ), F16(MAXHORIZ));

View file

@ -493,7 +493,7 @@ static void G_DoLoadScreen(const char *statustext, int32_t percent)
videoClearScreen(0);
int const loadScreenTile = VM_OnEventWithReturn(EVENT_GETLOADTILE, g_player[screenpeek].ps->i, screenpeek, LOADSCREEN);
int const loadScreenTile = VM_OnEventWithReturn(EVENT_GETLOADTILE, g_player[screenpeek].ps->i, screenpeek, DEER ? 7040 : LOADSCREEN);
rotatesprite_fs(320<<15,200<<15,65536L,0,loadScreenTile,0,0,2+8+64+BGSTRETCH);
@ -1279,6 +1279,8 @@ static void prelevel(char g)
g_mamaSpawnCnt = 15;
g_banjoSong = 0;
g_RAendLevel = 0;
if (!DEER)
{
for (bssize_t TRAVERSE_CONNECT(playerNum))
{
DukePlayer_t *ps = g_player[playerNum].ps;
@ -1293,6 +1295,7 @@ static void prelevel(char g)
else if (ud.level_number == 6 && ud.volume_number == 1)
g_mamaSpawnCnt = 15;
}
}
Bmemset(g_spriteExtra, 0, sizeof(g_spriteExtra));
Bmemset(g_sectorExtra, 0, sizeof(g_sectorExtra));
@ -1575,7 +1578,7 @@ static void prelevel(char g)
// break;
}
}
if (RR)
if (RR && !DEER)
{
for (bssize_t i = 0; i < MAXSPRITES; i++)
{

View file

@ -837,7 +837,7 @@ void sub_52BA8(void)
{
sprite[i].cstat = 0;
sprite[i].pal = 0;
sprite[i].statnum = 0;
changespritestat(i, 0);
sect = sprite[i].sectnum;
if (sub_52AF0(i))
{
@ -1024,8 +1024,8 @@ void sub_53194(void)
void sub_53304(void)
{
ControlInfo info;
CONTROL_GetInput(&info);
//ControlInfo info;
//CONTROL_GetInput(&info);
if (KB_KeyPressed(sc_RightAlt) || KB_KeyPressed(sc_LeftAlt) || KB_KeyPressed(sc_RightShift) || KB_KeyPressed(sc_LeftShift))
return;
@ -1860,6 +1860,7 @@ void sub_54FA4(int a1, int a2)
ptr1 = (char*)waloff[7050];
if (!ptr1)
return;
videoBeginDrawing();
ptr2 = (char*)frameplace;
if (!ptr2)
return;
@ -1874,6 +1875,7 @@ void sub_54FA4(int a1, int a2)
ptr1++;
}
}
videoEndDrawing();
rotatesprite(a1<<16, a2<<16, 57344, 512, 7050, 0, 0, 4+2, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y);
rotatesprite(a1<<16, a2<<16, 57344, 512, 7050, -8, 0, 4+2+1, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y);
rotatesprite(a1<<16, a2<<16, 32768, 0, 7063, -24, 0, 32+2+1, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y);
@ -2254,8 +2256,8 @@ void ghshtgn_render(short snum)
}
sub_54D90();
rotatesprite_win((fAA3D0[dword_AA3BC].f_8+dword_AA4FC[dword_AA540])<<16,
(fAA3D0[dword_AA3BC].f_c+dword_AA51C[dword_AA540])<<16, 40960,
0, fAA3D0[dword_AA3BC].f_4, 0, 0, 10);
(fAA3D0[dword_AA3BC].f_c+dword_AA51C[dword_AA540]+17)<<16, 40960,
0, fAA3D0[dword_AA3BC].f_4, 0, 0, 2);
if (dword_AA3BC == 5 && p->dhat617)
ghshtgn_setmode(3);
else
@ -2504,13 +2506,13 @@ void ghrifle_render(short snum, int a2)
if (a2 == 1)
{
x = fAA558[dword_AA544].f_8 + dword_AA800[dword_AA844];
y = fAA558[dword_AA544].f_c + dword_AA820[dword_AA844];
y = fAA558[dword_AA544].f_c + dword_AA820[dword_AA844] + 17;
tile = fAA558[dword_AA544].f_4;
}
else
{
x = fAA6AC[dword_AA544].f_8 + dword_AA800[dword_AA844];
y = fAA6AC[dword_AA544].f_c + dword_AA820[dword_AA844];
y = fAA6AC[dword_AA544].f_c + dword_AA820[dword_AA844] + 17;
tile = fAA6AC[dword_AA544].f_4;
}
@ -2519,7 +2521,7 @@ void ghrifle_render(short snum, int a2)
else
sub_54D90();
rotatesprite_win(x<<16, y<<16, 32768, 0, tile, 0, 0, 10);
rotatesprite_win(x<<16, y<<16, 32768, 0, tile, 0, 0, 2);
if (a2 == 1 && dword_AA544 == 5 && (p->dhat613 || p->dhat617))
{
@ -2750,8 +2752,8 @@ void ghpistol_render(short snum)
}
sub_54D90();
rotatesprite_win((fAA858[dword_AA848].f_8+dword_AA984[dword_AA9C8])<<16,
(fAA858[dword_AA848].f_c+dword_AA9A4[dword_AA9C8])<<16, 40960,
0, fAA858[dword_AA848].f_4, 0, 0, 10);
(fAA858[dword_AA848].f_c+dword_AA9A4[dword_AA9C8]+17)<<16, 40960,
0, fAA858[dword_AA848].f_4, 0, 0, 2);
ghpistol_setmode(fAA858[dword_AA848].f_10);
}
@ -2904,8 +2906,8 @@ void ghbow_render(short snum)
}
sub_54D90();
rotatesprite_win((fAA9DC[dword_AA9CC].f_8+dword_AAA68[dword_AAAAC])<<16,
(fAA9DC[dword_AA9CC].f_c+dword_AAA88[dword_AAAAC])<<16, 40960,
0, fAA9DC[dword_AA9CC].f_4, 0, 0, 10);
(fAA9DC[dword_AA9CC].f_c+dword_AAA88[dword_AAAAC]+17)<<16, 40960,
0, fAA9DC[dword_AA9CC].f_4, 0, 0, 2);
ghbow_setmode(fAA9DC[dword_AA9CC].f_10);
}

View file

@ -94,5 +94,17 @@ void sub_58A30(int a1);
int sub_59B44(void);
void ghtarget_setanimal(short a1);
void ghpistol_render(short);
void ghrifle_render(short, int);
void ghshtgn_render(short);
void ghbow_render(short);
void sub_56EA8(void);
void ghtarget_move(void);
void gharrow_move(void);
void ghdeploy_move(void);
void sub_5524C(void);
void sub_519E8(int a1);
void sub_57B38(long cposx, long cposy, long czoom, short cang);
END_RR_NS

View file

@ -804,6 +804,9 @@ void G_DisplayRest(int32_t smoothratio)
G_MoveClouds();
}
if (DEER)
sub_57B38(pp->opos.x, pp->opos.y, 20, 1536);
if (ud.overhead_on > 0)
{
// smoothratio = min(max(smoothratio,0),65536);