mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-25 00:25:45 +02:00
port: implement screen shake
This commit is contained in:
1 parent
07c3a513ef
commit
840a2e73a5
7 files changed
+32
-3
No files matched your search
@@ -28,6 +28,12 @@
|
||||
#include "data.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef PLATFORM_N64
|
||||
#define SHAKE_TIME 6
|
||||
#else
|
||||
#define SHAKE_TIME 12
|
||||
#endif
|
||||
|
||||
struct explosion *g_Explosions;
|
||||
s32 g_MaxExplosions;
|
||||
|
||||
@@ -296,7 +302,7 @@ bool explosionCreate(struct prop *sourceprop, struct coord *exppos, RoomNum *exp
|
||||
struct prop *expprop = propAllocate();
|
||||
|
||||
if (type != EXPLOSIONTYPE_16 && type != EXPLOSIONTYPE_BULLETHOLE) {
|
||||
g_ExplosionShakeTotalTimer = 6;
|
||||
g_ExplosionShakeTotalTimer = SHAKE_TIME;
|
||||
}
|
||||
|
||||
if (expprop) {
|
||||
@@ -554,8 +560,8 @@ bool explosionCreate(struct prop *sourceprop, struct coord *exppos, RoomNum *exp
|
||||
*/
|
||||
void explosionShake(void)
|
||||
{
|
||||
g_ExplosionShakeTotalTimer = 6;
|
||||
g_ExplosionShakeIntensityTimer = 6;
|
||||
g_ExplosionShakeTotalTimer = SHAKE_TIME;
|
||||
g_ExplosionShakeIntensityTimer = SHAKE_TIME;
|
||||
}
|
||||
|
||||
void explosionsUpdateShake(struct coord *arg0, struct coord *arg1, struct coord *arg2)
|
||||
|
||||
@@ -536,6 +536,7 @@ extern f32 g_PlayerDefaultFovY;
|
||||
extern s32 g_PlayerMouseAimMode;
|
||||
extern f32 g_PlayerMouseAimSpeedX;
|
||||
extern f32 g_PlayerMouseAimSpeedY;
|
||||
extern f32 g_ViShakeIntensityMult;
|
||||
extern u32 g_TexFilter2D;
|
||||
|
||||
#define TEX_FILTER_2D g_TexFilter2D
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
#include "lib/mtx.h"
|
||||
#include "data.h"
|
||||
#include "types.h"
|
||||
#ifndef PLATFORM_N64
|
||||
#include "video.h"
|
||||
#endif
|
||||
|
||||
#define TO_U16_A(x) ((u16)(x))
|
||||
#define TO_U16_B(x) ((x) & 0xffff)
|
||||
@@ -280,6 +283,10 @@ void viHandleRetrace(void)
|
||||
osSetIntMask(prevmask);
|
||||
#endif
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
videoSetWindowOffset(0, offset);
|
||||
#endif
|
||||
|
||||
osViSetMode(var8008dd60[1 - var8005ce74]);
|
||||
osViBlack(g_ViUnblackTimer);
|
||||
osViSetXScale(g_ViXScalesBySlot[1 - var8005ce74]);
|
||||
@@ -460,8 +467,13 @@ void viShake(f32 intensity)
|
||||
intensity = 0;
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_N64
|
||||
g_ViShakeIntensity = intensity;
|
||||
g_ViShakeTimer = 10;
|
||||
#else
|
||||
g_ViShakeIntensity = intensity * g_ViShakeIntensityMult;
|
||||
g_ViShakeTimer = 20;
|
||||
#endif
|
||||
}
|
||||
|
||||
void viSetMode(s32 mode)
|
||||
|
||||
Reference in new issue
Block a user