A few overlord fixes (#1273)

* Fix RPC Player buffer size

* Fix calculateFallofVolume

* Fix CalculateAngle
This commit is contained in:
Ziemas
2022-04-02 16:46:42 +02:00
committed by GitHub
parent f8b00ea358
commit 4310bb1419
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ using namespace iop;
MusicTweaks gMusicTweakInfo;
constexpr int SRPC_MESSAGE_SIZE = 0x50;
static uint8_t gLoaderBuf[SRPC_MESSAGE_SIZE];
static uint8_t gPlayerBuf[SRPC_MESSAGE_SIZE * 127];
static uint8_t gPlayerBuf[SRPC_MESSAGE_SIZE * 128];
int32_t gSoundEnable = 1;
static u32 gInfoEE = 0; // EE address where we should send info on each frame.
s16 gFlava;
+3 -3
View File
@@ -252,7 +252,7 @@ s32 CalculateFallofVolume(Vec3w* pos, s32 volume, s32 fo_curve, s32 fo_min, s32
s32 distance = xdiff * xdiff + ydiff * ydiff + zdiff * zdiff;
if (distance != 0) {
s32 steps = 0;
while ((steps & 0xc0000000) == 0) {
while ((distance & 0xc0000000) == 0) {
distance <<= 2;
steps++;
}
@@ -292,7 +292,7 @@ s32 CalculateFallofVolume(Vec3w* pos, s32 volume, s32 fo_curve, s32 fo_min, s32
factor = 0x10000;
}
return factor; // TODO
return (factor * volume) >> 16;
}
s32 CalculateAngle(Vec3w* trans) {
@@ -303,7 +303,7 @@ s32 CalculateAngle(Vec3w* trans) {
s32 lookupZ = diffZ;
if (diffX < 0) {
lookupZ = trans->x - gCamTrans.x;
lookupX = trans->x - gCamTrans.x;
}
if (diffZ < 0) {