Remove horizon scanner
This commit is contained in:
parent
34e8322022
commit
b64530e1a6
|
|
@ -2938,23 +2938,6 @@ s32 bgunTickIncChangeGun(struct handweaponinfo *info, s32 handnum, struct hand *
|
|||
#endif
|
||||
|
||||
switch (info->weaponnum) {
|
||||
case WEAPON_HORIZONSCANNER:
|
||||
speed1 = 3.5f;
|
||||
|
||||
#if VERSION >= VERSION_NTSC_1_0
|
||||
prevpri1 = osGetThreadPri(0);
|
||||
osSetThreadPri(0, osGetThreadPri(&g_AudioManager.thread) + 1);
|
||||
#endif
|
||||
handle1 = sndStart(var80095200, SFX_EQUIP_HORIZONSCANNER, 0, -1, -1, -1, -1, -1);
|
||||
|
||||
if (handle1) {
|
||||
audioPostEvent(handle1, 16, *(s32 *)&speed1);
|
||||
}
|
||||
|
||||
#if VERSION >= VERSION_NTSC_1_0
|
||||
osSetThreadPri(0, prevpri1);
|
||||
#endif
|
||||
break;
|
||||
case WEAPON_LASER:
|
||||
sndStart(var80095200, SFX_PICKUP_LASER, 0, -1, -1, -1, -1, -1);
|
||||
break;
|
||||
|
|
@ -5349,10 +5332,6 @@ void bgunTickSwitch2(void)
|
|||
bgunFreeWeapon(HAND_LEFT);
|
||||
bgunFreeWeapon(HAND_RIGHT);
|
||||
|
||||
if (weaponnum == WEAPON_HORIZONSCANNER) {
|
||||
g_Vars.currentplayer->insightaimmode = false;
|
||||
}
|
||||
|
||||
if (weaponnum == WEAPON_RCP120) {
|
||||
s32 amount = player->hands[HAND_RIGHT].matmot1;
|
||||
|
||||
|
|
@ -5363,13 +5342,6 @@ void bgunTickSwitch2(void)
|
|||
player->ammoheldarr[ctrl->ammotypes[0]] -= amount;
|
||||
}
|
||||
|
||||
if (weaponnum == WEAPON_HORIZONSCANNER) {
|
||||
g_Vars.currentplayer->zoomintimemax = 0;
|
||||
g_Vars.currentplayer->zoomintime = g_Vars.currentplayer->zoomintimemax;
|
||||
g_Vars.currentplayer->zoominfovynew = 60;
|
||||
g_Vars.currentplayer->zoominfovy = g_Vars.currentplayer->zoominfovynew;
|
||||
}
|
||||
|
||||
lefthand = &player->hands[HAND_LEFT];
|
||||
righthand = &player->hands[HAND_RIGHT];
|
||||
|
||||
|
|
|
|||
|
|
@ -816,10 +816,6 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
|
|||
}
|
||||
}
|
||||
|
||||
if (bgunGetWeaponNum(HAND_RIGHT) == WEAPON_HORIZONSCANNER) {
|
||||
g_Vars.currentplayer->insightaimmode = true;
|
||||
}
|
||||
|
||||
movedata.canswivelgun = !g_Vars.currentplayer->insightaimmode;
|
||||
movedata.canmanualaim = g_Vars.currentplayer->insightaimmode;
|
||||
movedata.canautoaim = !g_Vars.currentplayer->insightaimmode;
|
||||
|
|
@ -1119,10 +1115,6 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
|
|||
}
|
||||
}
|
||||
|
||||
if (bgunGetWeaponNum(HAND_RIGHT) == WEAPON_HORIZONSCANNER) {
|
||||
g_Vars.currentplayer->insightaimmode = true;
|
||||
}
|
||||
|
||||
movedata.canswivelgun = !g_Vars.currentplayer->insightaimmode;
|
||||
movedata.canmanualaim = g_Vars.currentplayer->insightaimmode;
|
||||
movedata.canautoaim = !g_Vars.currentplayer->insightaimmode;
|
||||
|
|
|
|||
|
|
@ -547,221 +547,6 @@ Gfx *bviewDrawIntroText(Gfx *gdl)
|
|||
return gdl;
|
||||
}
|
||||
|
||||
Gfx *bviewDrawHorizonScanner(Gfx *gdl)
|
||||
{
|
||||
u16 *fb = viGetBackBuffer();
|
||||
s32 viewtop = viGetViewTop();
|
||||
s32 viewheight = viGetViewHeight();
|
||||
s32 viewwidth = viGetViewWidth();
|
||||
s32 viewleft = viGetViewLeft();
|
||||
char directiontext[32];
|
||||
char hertztext[24];
|
||||
char zoomtext[24];
|
||||
#if VERSION >= VERSION_NTSC_1_0
|
||||
char nametext[52];
|
||||
#endif
|
||||
f32 lookx = g_Vars.currentplayer->cam_look.x;
|
||||
f32 lookz = g_Vars.currentplayer->cam_look.z;
|
||||
s32 x;
|
||||
s32 y;
|
||||
|
||||
char directions[][3] = {
|
||||
{'n', '\0', '\0'},
|
||||
{'n', 'e', '\0'},
|
||||
{'e', '\0', '\0'},
|
||||
{'s', 'e', '\0'},
|
||||
{'s', '\0', '\0'},
|
||||
{'s', 'w', '\0'},
|
||||
{'w', '\0', '\0'},
|
||||
{'n', 'w', '\0'},
|
||||
{'n', '\0', '\0'},
|
||||
};
|
||||
|
||||
s32 turnangle = atan2f(-lookx, lookz) * 180.0f / M_PI;
|
||||
f32 fovy;
|
||||
char arrows[12];
|
||||
s32 tmplensheight = 130;
|
||||
s32 lenstop;
|
||||
s32 lensheight;
|
||||
s32 liney;
|
||||
s32 scale = 1;
|
||||
s32 vsplit = false;
|
||||
u32 colour;
|
||||
f32 range;
|
||||
|
||||
var8007f840++;
|
||||
|
||||
if (var8007f840 >= 2) {
|
||||
return gdl;
|
||||
}
|
||||
|
||||
strcpy(var800a41c0, "BinocularViewGfx");
|
||||
|
||||
if (!PAL && g_ViRes == VIRES_HI) {
|
||||
scale = 2;
|
||||
}
|
||||
|
||||
if (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL && PLAYERCOUNT() >= 2) {
|
||||
vsplit = true;
|
||||
}
|
||||
|
||||
if (tmplensheight > viewheight - 30) {
|
||||
tmplensheight = viewheight - 30;
|
||||
}
|
||||
|
||||
if (((s32)(g_20SecIntervalFrac * 30.0f) & 1) == 1) {
|
||||
sprintf(arrows, ">> ");
|
||||
} else {
|
||||
sprintf(arrows, " >>");
|
||||
}
|
||||
|
||||
lensheight = tmplensheight;
|
||||
lenstop = viewtop + (viewheight / 2) - (lensheight / 2);
|
||||
|
||||
// Black out areas above and below lens
|
||||
gdl = textSetPrimColour(gdl, 0x000000ff);
|
||||
|
||||
gDPFillRectangle(gdl++, viewleft, viewtop, viewleft + viewwidth, lenstop);
|
||||
gDPFillRectangle(gdl++, viewleft, lenstop + lensheight, viewleft + viewwidth, viewtop + viewheight);
|
||||
|
||||
gdl = text0f153838(gdl);
|
||||
|
||||
// Prepare text buffers
|
||||
sprintf(directiontext, "%s %s:%03d", arrows, &directions[(turnangle + 22) / 45], turnangle);
|
||||
sprintf(hertztext, "%s %s%s%4.2fh", arrows, "", "", menuGetCosOscFrac(4) * 4.6f + 917.4f);
|
||||
|
||||
fovy = viGetFovY();
|
||||
|
||||
if (fovy == 0 || fovy == 60.0f) {
|
||||
fovy = 1;
|
||||
} else {
|
||||
fovy = 60.0f / fovy + 1;
|
||||
}
|
||||
|
||||
sprintf(zoomtext, "%s %s%s%4.2fX", arrows, "", "", fovy);
|
||||
|
||||
gdl = text0f153628(gdl);
|
||||
|
||||
// Arrows left of product name
|
||||
if (vsplit) {
|
||||
x = viewleft + 15 * scale;
|
||||
} else {
|
||||
x = viewleft + 25 * scale;
|
||||
}
|
||||
|
||||
y = lenstop - 7;
|
||||
gdl = textRenderProjected(gdl, &x, &y, arrows,
|
||||
g_CharsHandelGothicXs, g_FontHandelGothicXs, 0xffffff7f, viGetWidth(), viGetHeight(), 0, 0);
|
||||
|
||||
// Product name
|
||||
#if VERSION >= VERSION_NTSC_1_0
|
||||
strcpy(nametext, " JMBC");
|
||||
|
||||
if (!vsplit) {
|
||||
strcat(nametext, " WIDE BAND");
|
||||
}
|
||||
|
||||
strcat(nametext, " SCANNER\n");
|
||||
|
||||
gdl = textRenderProjected(gdl, &x, &y, nametext,
|
||||
g_CharsHandelGothicXs, g_FontHandelGothicXs, 0xffffff7f, viGetWidth(), viGetHeight(), 0, 0);
|
||||
#else
|
||||
gdl = textRenderProjected(gdl, &x, &y, " JMBC WIDE BAND SCANNER\n",
|
||||
g_CharsHandelGothicXs, g_FontHandelGothicXs, 0xffffff7f, viGetWidth(), viGetHeight(), 0, 0);
|
||||
#endif
|
||||
|
||||
// Hertz
|
||||
x = viewleft + 75 * scale;
|
||||
y = lenstop + lensheight + 1;
|
||||
gdl = textRenderProjected(gdl, &x, &y, hertztext,
|
||||
g_CharsHandelGothicXs, g_FontHandelGothicXs, 0xffffff7f, viGetWidth(), viGetHeight(), 0, 0);
|
||||
|
||||
// Zoom level
|
||||
if (vsplit) {
|
||||
x = viewleft + 75 * scale;
|
||||
y = lenstop + lensheight + 8;
|
||||
} else {
|
||||
x = viewleft + 150 * scale;
|
||||
y = lenstop + lensheight + 1;
|
||||
}
|
||||
|
||||
gdl = textRenderProjected(gdl, &x, &y, zoomtext,
|
||||
g_CharsHandelGothicXs, g_FontHandelGothicXs, 0xffffff7f, viGetWidth(), viGetHeight(), 0, 0);
|
||||
|
||||
// Direction
|
||||
if (vsplit) {
|
||||
x = viewleft + 75 * scale;
|
||||
y = lenstop + lensheight + 15;
|
||||
} else {
|
||||
x = viewleft + 225 * scale;
|
||||
y = lenstop + lensheight + 1;
|
||||
}
|
||||
|
||||
gdl = textRenderProjected(gdl, &x, &y, directiontext,
|
||||
g_CharsHandelGothicXs, g_FontHandelGothicXs, 0xffffff7f, viGetWidth(), viGetHeight(), 0, 0);
|
||||
gdl = text0f153780(gdl);
|
||||
|
||||
gDPPipeSync(gdl++);
|
||||
|
||||
gdl = bviewPrepareStaticRgba16(gdl, 0xffffffff, 255);
|
||||
|
||||
if (vsplit) {
|
||||
vsplit = 14;
|
||||
}
|
||||
|
||||
// Iterate horizontal lines down the lens with a bit extra on top and bottom
|
||||
for (liney = lenstop - 9; liney < lenstop + lensheight + vsplit + 9; liney++) {
|
||||
if (liney < lenstop + lensheight && liney >= lenstop) {
|
||||
// Inside the lens
|
||||
if ((liney % 2) == 0) {
|
||||
colour = 0x00ffffff;
|
||||
} else {
|
||||
colour = 0x7fffffff;
|
||||
}
|
||||
|
||||
range = (liney - lenstop - lensheight * 0.5f) / (lensheight * 0.5f);
|
||||
|
||||
if (range < 0) {
|
||||
range = -range;
|
||||
}
|
||||
|
||||
if (range > 1) {
|
||||
range = 0;
|
||||
}
|
||||
|
||||
range = (range - 0.75f) * 4.0f;
|
||||
|
||||
if (range < 0) {
|
||||
range = 0;
|
||||
}
|
||||
|
||||
if (range > 0) {
|
||||
colour = colourBlend(0x000000ff, colour, range * 255.0f);
|
||||
}
|
||||
} else {
|
||||
// Outside of the lens
|
||||
if ((liney % 2) == 0) {
|
||||
colour = 0x007f7fff;
|
||||
} else {
|
||||
colour = 0x7fffffff;
|
||||
}
|
||||
|
||||
range = 0;
|
||||
}
|
||||
|
||||
// Different coloured lines at 1/4 and 3/4 marks in the lens
|
||||
if (liney == lenstop + lensheight / 4 || liney == lenstop + lensheight - lensheight / 4) {
|
||||
colour = 0xffffffff;
|
||||
}
|
||||
|
||||
gDPSetColor(gdl++, G_SETENVCOLOR, colour);
|
||||
|
||||
gdl = bviewCopyPixels(gdl, fb, liney, 5, liney, RANDOMFRAC() * range + 1, viewleft, viewwidth);
|
||||
}
|
||||
|
||||
return gdl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the black part of the IR scanner, which obscures the edges of the
|
||||
* screen and creates the binocular effect.
|
||||
|
|
|
|||
|
|
@ -195,9 +195,6 @@ f32 currentPlayerGetGunZoomFov(void)
|
|||
case WEAPON_FARSIGHT:
|
||||
index = 1;
|
||||
break;
|
||||
case WEAPON_HORIZONSCANNER:
|
||||
index = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
if (index >= 0) {
|
||||
|
|
@ -221,7 +218,6 @@ void currentPlayerZoomOut(f32 fovpersec)
|
|||
switch (bgunGetWeaponNum2(0)) {
|
||||
case WEAPON_SNIPERRIFLE: index = 0; break;
|
||||
case WEAPON_FARSIGHT: index = 1; break;
|
||||
case WEAPON_HORIZONSCANNER: index = 2; break;
|
||||
}
|
||||
|
||||
if (index >= 0) {
|
||||
|
|
@ -246,7 +242,6 @@ void currentPlayerZoomIn(f32 fovpersec)
|
|||
switch (bgunGetWeaponNum2(0)) {
|
||||
case WEAPON_SNIPERRIFLE: index = 0; break;
|
||||
case WEAPON_FARSIGHT: index = 1; break;
|
||||
case WEAPON_HORIZONSCANNER: index = 2; break;
|
||||
}
|
||||
|
||||
if (index >= 0) {
|
||||
|
|
@ -577,8 +572,6 @@ u32 currentPlayerGetSight(void)
|
|||
}
|
||||
|
||||
switch (g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponnum) {
|
||||
case WEAPON_HORIZONSCANNER:
|
||||
return SIGHT_NONE;
|
||||
case WEAPON_NONE:
|
||||
case WEAPON_UNARMED:
|
||||
case WEAPON_FALCON2:
|
||||
|
|
|
|||
|
|
@ -1313,12 +1313,6 @@ Gfx *lvRender(Gfx *gdl)
|
|||
if (g_Vars.tickmode == TICKMODE_CUTSCENE) {
|
||||
// Handle visual effects in cutscenes
|
||||
switch (g_CutsceneAnimNum) {
|
||||
case ANIM_CUT_CAVE_INTRO_CAM:
|
||||
// Horizon scanner in Air Base intro
|
||||
if (g_CutsceneCurAnimFrame60 > 839 && g_CutsceneCurAnimFrame60 < 1411) {
|
||||
gdl = bviewDrawHorizonScanner(gdl);
|
||||
}
|
||||
break;
|
||||
case ANIM_CUT_LUE_INTRO_CAM_01:
|
||||
case ANIM_CUT_LUE_INTRO_CAM_02:
|
||||
case ANIM_CUT_LUE_INTRO_CAM_03:
|
||||
|
|
|
|||
|
|
@ -4633,10 +4633,6 @@ Gfx *playerRenderHud(Gfx *gdl)
|
|||
{
|
||||
gdl = bgunDrawSight(gdl);
|
||||
|
||||
if (bgunGetWeaponNum(HAND_RIGHT) == WEAPON_HORIZONSCANNER) {
|
||||
gdl = bviewDrawHorizonScanner(gdl);
|
||||
}
|
||||
|
||||
if (optionsGetAmmoOnScreen(g_Vars.currentplayerstats->mpindex)) {
|
||||
gdl = bgunDrawHud(gdl);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue