Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion include/Pack/RPGraphics/RPGrpModelScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@
class RPGrpCamera;
class RPGrpScreen;

namespace EGG {
class ScnRenderer;
}

/**
* @brief Model rendering scene
*/
class RPGrpModelScene {
private:
char unk00[0xA4];
char unk00[0x2];
u8 mCameraIndex; // at 0x2
char unk03[0x9C - 0x3];
EGG::ScnRenderer* mpScnRenderer; // at 0x9C
char unkA0[0xA4 - 0xA0];

public:
virtual ~RPGrpModelScene(); // at 0x8
Expand Down
5 changes: 1 addition & 4 deletions include/Pack/RPUtility/RPUtlRandom.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ class RPUtlRandom {
// Limited to u16 bounds
u16 iRnd = static_cast<u16>(RANDF_MAX & (getU32() >> RANDF_SHIFT));

// Convert to float
f32 fRnd = static_cast<f32>(iRnd);

// Convert to percentage (+1 makes the upper bound exclusive!)
return fRnd / static_cast<f32>(RANDF_MAX + 1);
return static_cast<f32>(iRnd) / static_cast<f32>(RANDF_MAX + 1);
}

private:
Expand Down
10 changes: 10 additions & 0 deletions src/Pack/RPGraphics/RPGrpModelScene.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <Pack/RPGraphics.h>

#include <egg/gfxe/eggScnRenderer.h>

void RPGrpModelScene::DrawPrepare(const RPGrpCamera* pCamera,
const RPGrpScreen* pScreen) {
mpScnRenderer->SetCurrentCamera(mCameraIndex++,
pCamera->GetSavedCameraMatrix(), *pScreen);
mpScnRenderer->CalcView();
}
Loading