forked from Ports/perfect_dark
Merge branch 'port' of https://github.com/Phnod/perfect_dark into zoom-hud-fov
# Conflicts: # port/src/main.c # src/include/data.h
This commit is contained in:
commit
7d96cd8fbd
7 files changed
+32
-3
No files matched your search
@@ -21,6 +21,8 @@ s32 videoGetHeight(void);
|
|||||||
f32 videoGetAspect(void);
|
f32 videoGetAspect(void);
|
||||||
u32 videoGetTextureFilter2D(void);
|
u32 videoGetTextureFilter2D(void);
|
||||||
|
|
||||||
|
void videoSetWindowOffset(s32 x, s32 y);
|
||||||
|
|
||||||
s32 videoCreateFramebuffer(u32 w, u32 h);
|
s32 videoCreateFramebuffer(u32 w, u32 h);
|
||||||
void videoSetFramebuffer(s32 target);
|
void videoSetFramebuffer(s32 target);
|
||||||
void videoResetFramebuffer(void);
|
void videoResetFramebuffer(void);
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ static void gameLoadConfig(void)
|
|||||||
g_PlayerMouseAimMode = configGetIntClamped("Game.MouseAimMode", g_PlayerMouseAimMode, 0, 1);
|
g_PlayerMouseAimMode = configGetIntClamped("Game.MouseAimMode", g_PlayerMouseAimMode, 0, 1);
|
||||||
g_PlayerMouseAimSpeedX = configGetFloatClamped("Game.MouseAimSpeedX", g_PlayerMouseAimSpeedX, 0.f, 10.f);
|
g_PlayerMouseAimSpeedX = configGetFloatClamped("Game.MouseAimSpeedX", g_PlayerMouseAimSpeedX, 0.f, 10.f);
|
||||||
g_PlayerMouseAimSpeedY = configGetFloatClamped("Game.MouseAimSpeedY", g_PlayerMouseAimSpeedY, 0.f, 10.f);
|
g_PlayerMouseAimSpeedY = configGetFloatClamped("Game.MouseAimSpeedY", g_PlayerMouseAimSpeedY, 0.f, 10.f);
|
||||||
|
g_ViShakeIntensityMult = configGetFloatClamped("Game.ScreenShakeIntensity", 1.f, 0.f, 100.f);
|
||||||
g_PlayerFovAffectsZoom = configGetIntClamped("Game.FovAffectsZoom", g_PlayerFovAffectsZoom, 0, 1);
|
g_PlayerFovAffectsZoom = configGetIntClamped("Game.FovAffectsZoom", g_PlayerFovAffectsZoom, 0, 1);
|
||||||
g_PlayerFovZoomMultiplier = g_PlayerFovAffectsZoom ? g_PlayerDefaultFovY / 60.0f : 1.0f;
|
g_PlayerFovZoomMultiplier = g_PlayerFovAffectsZoom ? g_PlayerDefaultFovY / 60.0f : 1.0f;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ bool g_SchedViModesPending[NUM_GFXTASKS] = {false, false};
|
|||||||
s32 g_ViUnblackTimer = NUM_FRAMEBUFFERS + 1;
|
s32 g_ViUnblackTimer = NUM_FRAMEBUFFERS + 1;
|
||||||
s32 g_ViShakeDirection = 1;
|
s32 g_ViShakeDirection = 1;
|
||||||
s32 g_ViShakeIntensity = 0;
|
s32 g_ViShakeIntensity = 0;
|
||||||
|
f32 g_ViShakeIntensityMult = 1.f;
|
||||||
s32 g_ViShakeTimer = 0;
|
s32 g_ViShakeTimer = 0;
|
||||||
u32 var8005cea0 = 0;
|
u32 var8005cea0 = 0;
|
||||||
u32 var8005cea4 = 0;
|
u32 var8005cea4 = 0;
|
||||||
|
|||||||
@@ -142,6 +142,12 @@ u32 videoGetTextureFilter2D(void)
|
|||||||
return texFilter2D;
|
return texFilter2D;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void videoSetWindowOffset(s32 x, s32 y)
|
||||||
|
{
|
||||||
|
gfx_current_game_window_viewport.x = x;
|
||||||
|
gfx_current_game_window_viewport.y = y;
|
||||||
|
}
|
||||||
|
|
||||||
s32 videoCreateFramebuffer(u32 w, u32 h)
|
s32 videoCreateFramebuffer(u32 w, u32 h)
|
||||||
{
|
{
|
||||||
return gfx_create_framebuffer(w, h);
|
return gfx_create_framebuffer(w, h);
|
||||||
|
|||||||
@@ -28,6 +28,12 @@
|
|||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
#ifdef PLATFORM_N64
|
||||||
|
#define SHAKE_TIME 6
|
||||||
|
#else
|
||||||
|
#define SHAKE_TIME 12
|
||||||
|
#endif
|
||||||
|
|
||||||
struct explosion *g_Explosions;
|
struct explosion *g_Explosions;
|
||||||
s32 g_MaxExplosions;
|
s32 g_MaxExplosions;
|
||||||
|
|
||||||
@@ -296,7 +302,7 @@ bool explosionCreate(struct prop *sourceprop, struct coord *exppos, RoomNum *exp
|
|||||||
struct prop *expprop = propAllocate();
|
struct prop *expprop = propAllocate();
|
||||||
|
|
||||||
if (type != EXPLOSIONTYPE_16 && type != EXPLOSIONTYPE_BULLETHOLE) {
|
if (type != EXPLOSIONTYPE_16 && type != EXPLOSIONTYPE_BULLETHOLE) {
|
||||||
g_ExplosionShakeTotalTimer = 6;
|
g_ExplosionShakeTotalTimer = SHAKE_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expprop) {
|
if (expprop) {
|
||||||
@@ -554,8 +560,8 @@ bool explosionCreate(struct prop *sourceprop, struct coord *exppos, RoomNum *exp
|
|||||||
*/
|
*/
|
||||||
void explosionShake(void)
|
void explosionShake(void)
|
||||||
{
|
{
|
||||||
g_ExplosionShakeTotalTimer = 6;
|
g_ExplosionShakeTotalTimer = SHAKE_TIME;
|
||||||
g_ExplosionShakeIntensityTimer = 6;
|
g_ExplosionShakeIntensityTimer = SHAKE_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
void explosionsUpdateShake(struct coord *arg0, struct coord *arg1, struct coord *arg2)
|
void explosionsUpdateShake(struct coord *arg0, struct coord *arg1, struct coord *arg2)
|
||||||
|
|||||||
@@ -536,6 +536,7 @@ extern f32 g_PlayerDefaultFovY;
|
|||||||
extern s32 g_PlayerMouseAimMode;
|
extern s32 g_PlayerMouseAimMode;
|
||||||
extern f32 g_PlayerMouseAimSpeedX;
|
extern f32 g_PlayerMouseAimSpeedX;
|
||||||
extern f32 g_PlayerMouseAimSpeedY;
|
extern f32 g_PlayerMouseAimSpeedY;
|
||||||
|
extern f32 g_ViShakeIntensityMult;
|
||||||
extern s32 g_PlayerFovAffectsZoom;
|
extern s32 g_PlayerFovAffectsZoom;
|
||||||
extern f32 g_PlayerFovZoomMultiplier;
|
extern f32 g_PlayerFovZoomMultiplier;
|
||||||
extern u32 g_TexFilter2D;
|
extern u32 g_TexFilter2D;
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
#include "lib/mtx.h"
|
#include "lib/mtx.h"
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
#ifndef PLATFORM_N64
|
||||||
|
#include "video.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TO_U16_A(x) ((u16)(x))
|
#define TO_U16_A(x) ((u16)(x))
|
||||||
#define TO_U16_B(x) ((x) & 0xffff)
|
#define TO_U16_B(x) ((x) & 0xffff)
|
||||||
@@ -280,6 +283,10 @@ void viHandleRetrace(void)
|
|||||||
osSetIntMask(prevmask);
|
osSetIntMask(prevmask);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef PLATFORM_N64
|
||||||
|
videoSetWindowOffset(0, offset);
|
||||||
|
#endif
|
||||||
|
|
||||||
osViSetMode(var8008dd60[1 - var8005ce74]);
|
osViSetMode(var8008dd60[1 - var8005ce74]);
|
||||||
osViBlack(g_ViUnblackTimer);
|
osViBlack(g_ViUnblackTimer);
|
||||||
osViSetXScale(g_ViXScalesBySlot[1 - var8005ce74]);
|
osViSetXScale(g_ViXScalesBySlot[1 - var8005ce74]);
|
||||||
@@ -460,8 +467,13 @@ void viShake(f32 intensity)
|
|||||||
intensity = 0;
|
intensity = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PLATFORM_N64
|
||||||
g_ViShakeIntensity = intensity;
|
g_ViShakeIntensity = intensity;
|
||||||
g_ViShakeTimer = 10;
|
g_ViShakeTimer = 10;
|
||||||
|
#else
|
||||||
|
g_ViShakeIntensity = intensity * g_ViShakeIntensityMult;
|
||||||
|
g_ViShakeTimer = 20;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void viSetMode(s32 mode)
|
void viSetMode(s32 mode)
|
||||||
|
|||||||
Reference in new issue
Block a user