Match and link MovieApp

This commit is contained in:
SwareJonge 2024-07-05 22:29:20 +02:00
parent 5f46580223
commit bb1f9904d9
15 changed files with 674 additions and 135 deletions

View File

@ -1128,7 +1128,7 @@ config.libs = [
Object(NonMatching, "Kaneshige/GeoSoundGen.cpp"),
Object(NonMatching, "Kaneshige/GeoShine.cpp"),
Object(NonMatching, "Kaneshige/DarkAnmMgr.cpp"),
Object(NonMatching, "Kaneshige/Movie/MovieApp.cpp"),
Object(Matching, "Kaneshige/Movie/MovieApp.cpp"),
Object(Matching, "Kaneshige/Movie/MoviePlayer.cpp"),
Object(Matching, "Kaneshige/Movie/THPDraw.c"),
Object(NonMatching, "Kaneshige/MdlViewer.cpp"),

View File

@ -0,0 +1,51 @@
#ifndef MDLVIEWER_H
#define MDLVIEWER_H
#include <JSystem/JSupport.h>
class MVActor
{
public:
MVActor();
~MVActor() {}
virtual void setCurViewNo(u32) = 0;
virtual void calc() = 0;
virtual void update() = 0;
virtual void viewCalc(u32) = 0;
JSULink<MVActor> mLink;
};
// TODO
class MVCamera;
class MVAmbient;
class MVChaseLight;
class MVDrawBuffer;
class MdlViewer { // Autogenerated
public:
MdlViewer(); // 0x801d98cc
void reset(); // 0x801d99cc
void calc(); // 0x801d9a20
void draw(); // 0x801d9aa0
void append(MVActor *); // 0x801d9b04
void setCurViewNoActor(u32); // 0x801d9b4c
void calcActor(); // 0x801d9ca8
void updateActor(); // 0x801d9d2c
void viewCalcActor(u32); // 0x801d9db0
// Inline/Unused
// void ~MdlViewer();
// void appendHio(HioNode *);
// Inline
void getCamera(); // 0x801d94a0
private:
int _0; //
MVCamera *mCamera; // 04
MVAmbient *mAmbient; // 08
MVChaseLight *mChaseLight; // 0C
MVDrawBuffer *mDrawBuffer; // 10
JSUList<MVActor> mActorList; // 14
}; // class MdlViewer
#endif

View File

@ -1,25 +1,12 @@
#ifndef MOVIEAPP_H
#define MOVIEAPP_H
#include "Kaneshige/MdlViewer.h"
#include "Osako/GameApp.h"
#include "Shiraiwa/JugemHeadItem.h"
#include "Shiraiwa/JugemItem.h"
#include "Shiraiwa/JugemMain.h"
class TJugemVoidRod;
class TJugemHeadHear;
class MVActor
{
public:
MVActor();
~MVActor() {}
virtual void setCurViewNo(u32) = 0;
virtual void calc() = 0;
virtual void update() = 0;
virtual void viewCalc(u32) = 0;
JSULink<MVActor> mLink;
};
class MovieJugemActor : public MVActor
{
public:
@ -44,11 +31,11 @@ private:
class MovieApp : public GameApp
{ // Autogenerated
public:
static void getArchive(const char *); // 0x801d799c
static void *getArchive(const char *); // 0x801d799c
static MovieApp *create(); // 0x801d79c4
static void call(); // 0x801d7a98
MovieApp(void *); // 0x801d7abc
void isEnd(); // 0x801d7d9c
bool isEnd(); // 0x801d7d9c
void loadOpeningData(); // 0x801d7e64
void doRunning(); // 0x801d7e88
void doEnding(); // 0x801d8004
@ -66,7 +53,15 @@ private:
static void *mspHeapBuffer; // 0x80416844
private:
MovieJugemActor *mActor;
MovieJugemActor *mActor; // 0c
int mState; // 10
int mRunningState; // 14
s16 _18; //
s16 _1a; //
MdlViewer *mMdlViewer; // 1c
u8 _20[0x24 - 0x20]; //
int _24; //
int mWaitFrame; // 28
}; // Size: 0x2c
#define MOVIE_GetHeap() \

View File

@ -24,6 +24,13 @@ public:
void audioFadeOut(int); // 0x801d858c
int getFrameNumber(); // 0x801d85bc
static void quitMovie() {
if(getPlayer())
getPlayer()->quit();
}
bool isPlaying() const { return mIsPlaying; }
int getDrawFrame() const { return mDrawFrame; }
static MoviePlayer *getPlayer() { return sPlayer; }
static const char *cMovieFileNameTable; // 0x804147d0

View File

@ -103,7 +103,7 @@ private:
bool mDrawUserTime; // f4;
int mProcTimeType; // f8
u32 mProcTimeFrames; // fc
f32 mCPUTime; //
f32 mCPUTime; // 100
f32 mCPUTimeMax; // 104
f32 mAllTime; // 108
f32 mAllTimeMax; // 10c

View File

@ -25,6 +25,8 @@ public:
virtual void setAnmProc() = 0;
virtual void frameProc() = 0;
u8 getNowAnmNo() const { return mNowAnmNo; }
bool tstFlgAnmStop() const { return mFlags & 1; }
void resetFlag() { mFlags &= ~1; }
@ -158,7 +160,7 @@ public:
JUT_MINMAX_ASSERT(0, AnmNo, mTrans->mMaxAnmNo);
mTrans->changeBlendAnm(AnmNo, p2, p3);
}
u8 getNowTransNo() const { return mTrans->getNowAnmNo(); }
J3DFrameCtrl *getFrameCtrl(u8 AnmNo) { return mTrans->getFrameCtrl(AnmNo); }
void ChangeTransAnm(u8 AnmNo, bool p2) { mTrans->changeAnm(AnmNo, p2); } // fabricated
void RegisterTrans(u8 AnmNo, J3DAnmTransform *transform, J3DMtxCalc *calc) { mTrans->registration(AnmNo, transform, calc); } // fabricated

View File

@ -103,13 +103,18 @@ public:
void clrObjFlagCheckItemHitting() { mGeoObjFlag &= ~2; }
void setObjFlagHidding() { mGeoObjFlag |= 0x20; }
void setAllCheckKartHitFlag() { mKartHitFlags = 0xffffffff; }
bool tstObjFlagSimpleDraw() const { return mObjFlag & 1; }
// Vtable
virtual ~GeographyObj() {} // 8, TODO?
virtual void loadmodel(J3DModelData *modelData); // C, TODO
virtual void loadAnimation() {} // 10 // 0x801b4c74
virtual ShadowModel::ShadowKind getShadowKind() const { return ShadowModel::cShadowKind_Geo; }; // 14
virtual void createModel(JKRSolidHeap *heap, u32) {} // 18, TODO
virtual ShadowModel::ShadowKind getShadowKind() const { return ShadowModel::cShadowKind_Geo; } // 14
virtual void createModel(JKRSolidHeap *heap, u32 p2) // 18
{
if(!tstObjFlagSimpleDraw())
mModel.createModel(heap, p2, 0x60000);
}
virtual void configAnimationMode() {} // 1C
virtual void createShadowModel(JKRSolidHeap *heap, u32); // 20
virtual void initByKind() {} // 24
@ -145,12 +150,13 @@ protected:
CrsData::SObject *mObjData; // E8
u32 mGeoObjFlag; // EC
u32 mKartHitFlags; // F0
u8 _f4[0xfc - 0xf4]; //
u8 _f4[0xfc - 0xf4]; //
JSULink<GeographyObj> mLink; // FC
int mKind; // 10c
int mKind; // 10C
u8 _110[0x114 - 0x110]; //
ItemObj *mColItemObj; // 114
u8 _118[0x120 - 0x118]; //
u8 _118[0x11c - 0x118]; //
u16 mObjFlag; // 11C
AnmController *mAnmCtrl; // 120
ItemColReaction mReaction; // 124
u8 _134[0x14c - 0x134]; //

View File

@ -31,7 +31,9 @@ public:
void isFitBlendFrame(); // 0x802988e4
void isGoArroundLoop(); // 0x80298ab0
int _4;
u8 getCurAnmNumber() const { return mController->getNowTransNo(); }
AnmController *mController;
int _8;
u8 _c;
u8 _d;

View File

@ -0,0 +1,49 @@
#ifndef JUGEMHEADITEM_H
#define JUGEMHEADITEM_H
#include "Sato/GeographyObj.h"
class TJugemHeadItem : public GeographyObj {
public:
TJugemHeadItem(u32 id) : GeographyObj(id) {
_14c = 0;
}
virtual ~TJugemHeadItem() {}
virtual void calc() {}
virtual void setPosition(const JGeometry::TVec3f &pos) { mPos.set(pos); } // 80
virtual void setRMtx(const JGeometry::TPos3f &rMtx) { mRotMtx.set(rMtx); } // 84
virtual void hideModel(u32 p1) { mModel.clipAll(p1, false); } // 88
virtual void show() { mGeoObjFlag &= ~0x20; } // 8c
virtual void hide() { mGeoObjFlag |= 0x20; } // 90
virtual void hideAll() { hide(); } // 94
protected:
int _14c;
};
class TJugemHeadHear : public TJugemHeadItem {
public:
TJugemHeadHear();
virtual ~TJugemHeadHear();
virtual void reset();
virtual void hideModel(u32 p1) { mModel.clipAll(p1, false); }
virtual const char *getBmdFileName();
};
class TJugemHeadLamp : public TJugemHeadItem { // Autogenerated
public:
TJugemHeadLamp(); // 0x802bae5c
virtual ~TJugemHeadLamp(); // 0x802bafa8
virtual void reset(); // 0x802bb078
virtual void loadAnimation(); // 0x802bb110
virtual void createModel(JKRSolidHeap *, u32); // 0x802bb178
virtual const char *getBmdFileName(); // 0x802bb2d0
virtual void calc(); // 0x802bb2f8
virtual void update(); // 0x802bb31c
static J3DAnmTevRegKey *sJugemHeadLampBrkAnm; // 0x80417018
static J3DAnmTransform *sJugemHeadLampBcaAnm; // 0x8041701c
static J3DMtxCalc *sJugemHeadLampBcaMtxCalc; // 0x80417020
};
#endif // JUGEMHEADITEM_H

View File

@ -0,0 +1,75 @@
#ifndef JUGEMITEM_H
#define JUGEMITEM_H
#include "Shiraiwa/JugemRodItem.h"
class TJugemItem : public GeographyObj {
public:
TJugemItem(u32 id) : GeographyObj(id) {
_14c = 0;
}
virtual ~TJugemItem() {}
virtual void calc() {}
virtual void setPosition(const JGeometry::TVec3f &pos) { mPos.set(pos); } // 80
virtual void setRMtx(const JGeometry::TPos3f &rMtx) { mRotMtx.set(rMtx); } // 84
virtual void hideModel(u32 p1) { mModel.clipAll(p1, false); } // 88
virtual void show() { mGeoObjFlag &= ~0x20; } // 8c
virtual void hide() { mGeoObjFlag |= 0x20; } // 90
virtual void hideAll() { hide(); } // 94
virtual void hold(u32) {} // 98
virtual void changeAnimation(u32 typre) // 9C TODO: OK?
{
if(mAnmCtrl == nullptr)
return;
if(mAnmCtrl->IsAvailableTrans())
mAnmCtrl->StopTrans();
}
protected:
int _14c;
};
class TJugemVoidRod : public TJugemItem {
public:
TJugemVoidRod(); // 0x80291404
~TJugemVoidRod(); // 0x80291630
virtual void reset(); // 0x8029175c
virtual void loadAnimation(); // 0x802917e4
virtual const char *getShadowBmdFileName(); // 0x80291890
virtual const char *getBmdFileName(); // 0x80291898
virtual void createModel(JKRSolidHeap *, u32); // 0x802918c0
virtual void calc(); // 0x802919dc
virtual void createColModel(J3DModelData *); // 0x80291a0c
virtual void setPosition(const JGeometry::TVec3f &); // 0x80291a10
virtual void setRMtx(const JGeometry::TPos3f &); // 0x80291a2c
virtual void hideModel(u32); // 0x80291a60
virtual void show(u8); // 0x80291ab4
virtual void update(); // 0x80291b08
virtual void hide(); // 0x80291b58
virtual void hideAll(); // 0x80291b9c
virtual void hold(u32); // 0x80291cb4
virtual void changeAnimation(u32); // 0x80291d74
void setJugemRodItem(TJugemRodItem *, u32); // 0x80291c34
void nodeCallBack(J3DJoint *, int); // 0x80291ecc
TJugemRodSignal *getSignal() const { return mSignal; }
//void sAnmInfos_Rod_Lap; // 0x803a3ac0
//void sAnmInfos_Rod_Start; // 0x803a3b10
//void sAnmInfos_Rod_Reverse; // 0x803a3b74
//void sAnmInfos_Rod_Rescue; // 0x803a3b9c
//void sAnmInfos_Rod_Signal; // 0x803a3bd8
//void sAnmInfos_Rod_PukuS; // 0x803a3c14
//void sAnmInfos_Rod_PukuL; // 0x803a3c50
//void sAnmStateTable; // 0x803a3c8c
//void sDemoAnmStateTable; // 0x803a3cac
// Inline/Unused
//void getPointPos(JGeometry::TVec3f *);
u8 _150[0x190 - 0x150];
TJugemRodSignal *mSignal; // 190
u8 _194[0x1a8 - 0x194]; //
}; // Size: 0x1a8
#endif

View File

@ -3,6 +3,8 @@
#include "Sato/GeographyObj.h"
#include "Sato/StateObserver.h"
#include "Shiraiwa/JugemItem.h"
#include "Shiraiwa/JugemHeadItem.h"
#include "Shiraiwa/JugemRodItem.h"
#include "Shiraiwa/AnmPlayer.h"
@ -11,23 +13,63 @@ class TJugem : public TMapObjHioNode, public StateObserver
public:
TJugem();
void setJugemItem(TJugemItem *, u32);
void setJugemHeadItem(TJugemHeadItem *item, u32 id);
void setCameraNum(u8 cam);
virtual ~TJugem() {}
virtual void loadAnimation();
virtual void createModel(JKRSolidHeap *, u32);
virtual void createShadowModel(JKRSolidHeap *, u32);
virtual void reset();
virtual void calc();
virtual void update();
virtual void viewCalc(u32);
virtual void setCurrentViewNo(u32);
virtual const char *getBmdFileName();
virtual const char *getJ3DModelDataTevStageNum();
virtual void createColModel(J3DModelData *);
virtual void MoveExec();
virtual void InitExec();
bool isDemoMode();
void signalGo()
{
mIsAbleStart = true;
setState(0);
};
bool isAbleStart(); /* { return mIsAbleStart; }*/
bool isCallThree() { return !mJugemRod ? false : mJugemRod->isCallThree(); }
bool isCallThree() { return !mSignal ? false : mSignal->isCallThree(); }
bool isDemoOut() { return isDemoMode() && mAnmPlayer.getCurAnmNumber() == 2; }
const JGeometry::TVec3f &getPosition() const { return mPos; }
void setHearPtr(TJugemHeadHear *hear) { setJugemHeadItem(hear, 0); }
void setSignalPtr(TJugemRodSignal *signal) { mSignal = signal; }
void setVoidRodPtr(TJugemVoidRod *rod) {
setJugemItem(rod, 1);
setSignalPtr(rod->getSignal());
}
void setDemoPattern(u32 pattern) {
mDemoPattern = pattern;
}
void startDemo() { setState(0x12); }
void endDemo() { setState(0x14); }
int getSignalState();
u8 _0x158[0x250 - 0x158]; //
bool mIsAbleStart; // 250
u8 _0x251[0x26c - 0x251]; //
TJugemRodSignal *mJugemRod; // 270
u8 _274[0x27c - 0x274]; //
u8 _158[0x178 - 0x158]; //
TAnmPlayer mAnmPlayer; // 178
u8 _18c[0x244 - 0x18c]; //
u32 mDemoPattern; // 244
u8 _248[0x250 - 0x248]; //
bool mIsAbleStart; // 250
u8 _251[0x26c - 0x251]; //
TJugemRodSignal *mSignal; // 26c
u8 _270[0x27c - 0x270]; //
}; // Size: 0x27c
#endif

View File

@ -10,6 +10,7 @@
#include "Shiraiwa/AnmPlayer.h"
// probably inherited from TJugemMain
// TODO: virtual function overrides
class TJugemRodItem : public GeographyObj
{
@ -24,7 +25,7 @@ public:
virtual void changeAnimation(int) {} // 94
};
class TJugemRodSignal
class TJugemRodSignal : public TJugemRodItem
{ // Autogenerated
public:
// Global
@ -32,8 +33,8 @@ public:
~TJugemRodSignal(); // 0x80293630
void reset(); // 0x80293710
void loadAnimation(); // 0x802937e4
void getShadowBmdFileName(); // 0x80293864
void getBmdFileName(); // 0x8029386c
virtual const char * getShadowBmdFileName(); // 0x80293864
virtual const char *getBmdFileName(); // 0x8029386c
void createModel(JKRSolidHeap *, u32); // 0x80293894
void createColModel(J3DModelData *); // 0x802939ec
void calc(); // 0x802939f0
@ -60,11 +61,12 @@ public:
static const u8 scSignalInterval; // 0x8041c7d8
static const u8 scRandomLength; // UNUSED
u8 _00[0x188];
u8 _14c[0x188 - 0x14c];
u32 _188;
}; // class JugemRodSignal
u8 _18c[0x19c - 0x18c];
}; // Size: 0x19c
class TJugemRodPukuPuku
class TJugemRodPukuPuku : public TJugemRodItem
{
public:
TJugemRodPukuPuku();
@ -85,5 +87,8 @@ public:
// void sAnmInfos_Puku_Demo2;
// void sAnmInfos_Puku_Demo3;
// void sDemoAnmStateTable;
};
private:
u8 _14c[0x174 - 0x14c];
}; // Size: 0x174
#endif

View File

@ -0,0 +1,314 @@
#include <JSystem/J3D/J3DModelLoader.h>
#include "Kaneshige/Movie/MovieApp.h"
#include "Kaneshige/Movie/MoviePlayer.h"
#include "Osako/AppMgr.h"
#include "Osako/kartPad.h"
#include "Osako/SequenceApp.h"
#include "Osako/system.h"
#include "JSystem/JAudio/JASFakeMatch2.h"
MovieApp *MovieApp::sMovieApp;
void *MovieApp::mspHeapBuffer;
void MovieJugemActor::loadModelData(GeographyObj *obj) {
void *bmd = MovieApp::getArchive(obj->getBmdFileName());
J3DModelData *model = J3DModelLoaderDataBase::load(bmd, obj->getJ3DModelDataTevStageNum() | 0x19000010);
obj->loadmodel(model);
model->newSharedDisplayList(0x40000);
}
MovieJugemActor::MovieJugemActor() {
mJugem = new TJugem();
mVoidRod = new TJugemVoidRod();
u32 pattern;
u32 rnd = (u32)OSGetTime() % 10u;
if (rnd <= 6) {
pattern = 0;
}
else if (rnd <= 8) {
pattern = 1;
}
else {
pattern = 2;
}
#ifdef DEBUG
if (gGamePad1P.testButton(JUTGamePad::DPAD_LEFT))
pattern = 0;
else if (gGamePad1P.testButton(JUTGamePad::DPAD_UP))
pattern = 1;
else if (gGamePad1P.testButton(JUTGamePad::DPAD_RIGHT))
pattern = 2;
#endif
u32 id;
switch(pattern) {
case 0:
id = 2;
mRodItem = new TJugemRodSignal();
break;
case 1:
case 2:
id = 5;
mRodItem = new TJugemRodPukuPuku();
break;
default:
id = 0;
mRodItem = nullptr;
break;
}
mHear = new TJugemHeadHear();
loadModelData(mJugem);
loadModelData(mVoidRod);
loadModelData(mRodItem);
loadModelData(mHear);
mJugem->loadAnimation();
mVoidRod->loadAnimation();
mRodItem->loadAnimation();
mHear->loadAnimation();
mJugem->reset();
mJugem->setDemoPattern(pattern);
mVoidRod->reset();
mRodItem->reset();
mHear->reset();
Mtx m;
PSMTXIdentity(m);
j3dSys.setViewMtx(m);
u32 size = (int)JKRGetCurrentHeap()->getFreeSize();
JKRSolidHeap *modelHeap = JKRCreateSolidHeap(size, JKRGetCurrentHeap(), false);
JKRHeap *bak = modelHeap->becomeCurrentHeap();
mJugem->createModel(modelHeap, 1);
mVoidRod->createModel(modelHeap, 1);
mRodItem->createModel(modelHeap, 1);
mHear->createModel(modelHeap, 1);
modelHeap->adjustSize();
bak->becomeCurrentHeap();
mVoidRod->setJugemRodItem(mRodItem, id);
mJugem->setVoidRodPtr(mVoidRod);
mJugem->setHearPtr(mHear);
mJugem->setCameraNum(0);
mJugem->startDemo();
}
void MovieJugemActor::setCurViewNo(u32 viewNo) {
mJugem->setCurrentViewNo(viewNo);
mVoidRod->setCurrentViewNo(viewNo);
mRodItem->setCurrentViewNo(viewNo);
mHear->setCurrentViewNo(viewNo);
}
void MovieJugemActor::calc() {
mCalcCnt++;
mJugem->calc();
mVoidRod->calc();
mRodItem->calc();
mHear->calc();
}
void MovieJugemActor::update() {
mJugem->update_norm();
mVoidRod->update_norm();
mRodItem->update_norm();
mHear->update_norm();
}
void MovieJugemActor::viewCalc(u32 viewNo) {
mJugem->viewCalc(viewNo);
mVoidRod->viewCalc(viewNo);
mRodItem->viewCalc(viewNo);
mHear->viewCalc(viewNo);
}
void MovieJugemActor::endDemo() { mJugem->endDemo(); }
bool MovieJugemActor::isDemoEnd() { return mJugem->isDemoOut(); }
void *MovieApp::getArchive(const char *name) { return ResMgr::getPtr(ResMgr::mcArcOpening, name); }
MovieApp *MovieApp::create() {
if(sMovieApp == nullptr) {
if(SequenceApp::ptr()) {
JKRHeap *heap =SequenceApp::ptr()->getHeap();
void *mem = heap->alloc(0x200000, -4);
sMovieApp = new (heap, -4) MovieApp(mem);
}
else {
mspHeapBuffer = nullptr;
sMovieApp = NEW_APP MovieApp(nullptr);
}
}
return sMovieApp;
}
void MovieApp::call() { AppMgr::setNextApp(AppMgr::mcMovie); }
MovieApp::MovieApp(void *mem) : GameApp(0x200000, "Movie", mem) {
mActor = nullptr;
mState = 0;
mRunningState = 0;
_18 = 0;
_1a = 0;
mMdlViewer = new MdlViewer();
_24 = 0;
mWaitFrame = 0;
}
MovieApp::~MovieApp() { sMovieApp = nullptr; }
void MovieApp::draw() {
if(MoviePlayer::getPlayer()) {
MoviePlayer::getPlayer()->draw();
}
j3dSys.drawInit();
mMdlViewer->draw();
j3dSys.reinitGX();
}
void MovieApp::calc() {
if (MoviePlayer::getPlayer()) {
switch (_24)
{
case 1:
_24 = 2;
mWaitFrame = 0;
break;
case 2:
{
mWaitFrame++;
if(mWaitFrame >= 60) {
MoviePlayer::getPlayer()->replay();
_24 = 0;
mWaitFrame = 0;
}
break;
}
}
MoviePlayer::getPlayer()->calc();
}
mMdlViewer->calc();
switch(mState)
{
case 0:
{
if(MoviePlayer::getPlayer()) {
mState = 1;
_18 = 0;
mRunningState = 0;
_1a = 0;
System::changeMovieRenderMode();
}
break;
}
case 1:
{
if(ResMgr::isFinishLoadingArc(ResMgr::mcArcOpening)) {
System::getDisplay()->startFadeIn(15);
mActor = new MovieJugemActor();
mMdlViewer->append(mActor);
mState = 2;
}
break;
}
case 2:
doRunning();
break;
case 3:
doEnding();
break;
default:
#line 647
JUT_ASSERT_MSG(0, "UNKNOWN STATE");
}
}
bool MovieApp::isEnd() {
bool ret = false;
if(MoviePlayer::getPlayer()) {
int endFrame = MoviePlayer::getPlayer()->getFrameNumber() - 170;
if (MoviePlayer::getPlayer()->getDrawFrame() >= endFrame)
ret = true;
if(gGamePad1P.testTrigger(JUTGamePad::A | JUTGamePad::START)) {
ret = true;
}
}
return ret;
}
void MovieApp::reset() {
if (AppMgr::getPrevApp() == AppMgr::mcErrorView) {
_24 = 1;
mWaitFrame = 0;
}
}
void MovieApp::loadOpeningData() {
ResMgr::loadOpeningData(getHeap());
}
void MovieApp::doRunning() {
switch(mRunningState) {
case 0:
{
bool arcLoaded = ResMgr::isFinishLoadingArc(ResMgr::mcArcARAM);
if(++_1a >= 180 && arcLoaded) {
mRunningState = 1;
_1a = 0;
if(mActor)
mActor->endDemo();
}
break;
}
case 1:
{
bool demoEnd = true;
if(mActor)
demoEnd = mActor->isDemoEnd();
if(demoEnd) {
_1a = 0;
mRunningState = 2;
}
break;
}
default:
{
if(MoviePlayer::getPlayer()) {
if(!MoviePlayer::getPlayer()->isPlaying()) {
++_1a;
if(_1a >= 25)
MoviePlayer::getPlayer()->play();
}
}
if(isEnd()) {
JUTColor color(0xff, 0xff, 0xff, 0xff);
SYSTEM_GetFader()->setColor(color);
System::getDisplay()->startFadeOut(90);
mState = 3;
_18 = 0;
if(MoviePlayer::getPlayer()) {
MoviePlayer::getPlayer()->audioFadeOut(90);
}
}
break;
}
}
}
void MovieApp::doEnding() {
if(++_18 >= 120) {
System::changeNormalRenderMode();
MoviePlayer::quitMovie();
AppMgr::deleteCurrentApp();
SequenceApp::call(Scene::SCENE_TITLE);
}
}

View File

@ -69,54 +69,54 @@ s16 RaceMgr::sMyStartPointID = -1;
#include "mathHelper.h"
const RaceMgr::EventInfo RaceMgr::sEventTable[] = {
{0, "", " SKY"},
{1, "コース", " CRS"},
{2, "地形OBJ", " GEOOBJ"},
{3, "カート影", " KART SHADOW"},
{4, "タイヤ跡", " WHEEL TRACKS"},
{5, "カート", " KART"},
{6, "アイテム影", " ITEM SHADOW"},
{7, "アイテム", " ITEM"},
{8, "エフェクト", " EFFECT"},
{9, "パーティクル", " PARTICLE"},
{0xa, "シャドウスクリーン", " SHADOW SCR"},
{0xb, "スクリーンエフェクト", " SCR EFFECT"},
{0xc, "", " 2D"},
{0xd, "Zキャプチャ", " ZCAPTURE"},
{0x100, "", " 2D"},
{0x101, "カートダイナミクス1", " KART DYN1"},
{0x102, "カートダイナミクス2", " KART DYN2"},
{0x103, "コース", " CRS"},
{0x104, "エフェクト", " EFFECT"},
{0x105, "地形OBJ", "\tGEOOBJ"},
{0x106, "アイテム", " ITEM"},
{0x107, "パーティクル", " PARTICLE"},
{0x108, "スクリーンエフェクト", " SCR EFFECT"},
{0x109, "周回チェック", " LOOP CHECK"},
{0x10a, "実験", " FOR TEST"},
{0x110, "デバッグ1", " DEBUG1"},
{0x111, "デバッグ2", " DEBUG2"},
{0x112, "デバッグ3", " DEBUG3"},
{0x113, "デバッグ4", " DEBUG4"},
{0x114, "デバッグ5", " DEBUG5"},
{0x115, "デバッグ6", " DEBUG6"},
{0x116, "デバッグ7", " DEBUG7"},
{0x117, "デバッグ8", " DEBUG8"},
{0x118, "デバッグ9", " DEBUG9"},
{0x119, "デバッグ10", " DEBUG10"},
{0x200, "", " SKY"},
{0x201, "コースとOBJ", " CRS&OBJ"},
{0x202, "アイテム", " ITEM"},
{0x203, "ドライバー", " DRIVER"},
{0x204, "", " SHADOW"},
{0x205, "エフェクト", " EFFECT"},
{0x300, "", " SKY"},
{0x301, "コース", " CRS"},
{0x302, "アイテム", " ITEM"},
{0x303, "カート", " KART"},
{0x304, "", " SHADOW"},
{0x305, "エフェクト", " EFFECT"},
{-1, "なし", nullptr}};
{0, "", " SKY"},
{1, "コース", " CRS"},
{2, "地形OBJ", " GEOOBJ"},
{3, "カート影", " KART SHADOW"},
{4, "タイヤ跡", " WHEEL TRACKS"},
{5, "カート", " KART"},
{6, "アイテム影", " ITEM SHADOW"},
{7, "アイテム", " ITEM"},
{8, "エフェクト", " EFFECT"},
{9, "パーティクル", " PARTICLE"},
{0xa, "シャドウスクリーン", " SHADOW SCR"},
{0xb, "スクリーンエフェクト", " SCR EFFECT"},
{0xc, "", " 2D"},
{0xd, "Zキャプチャ", " ZCAPTURE"},
{0x100, "", " 2D"},
{0x101, "カートダイナミクス1", " KART DYN1"},
{0x102, "カートダイナミクス2", " KART DYN2"},
{0x103, "コース", " CRS"},
{0x104, "エフェクト", " EFFECT"},
{0x105, "地形OBJ", "\tGEOOBJ"},
{0x106, "アイテム", " ITEM"},
{0x107, "パーティクル", " PARTICLE"},
{0x108, "スクリーンエフェクト", " SCR EFFECT"},
{0x109, "周回チェック", " LOOP CHECK"},
{0x10a, "実験", " FOR TEST"},
{0x110, "デバッグ1", " DEBUG1"},
{0x111, "デバッグ2", " DEBUG2"},
{0x112, "デバッグ3", " DEBUG3"},
{0x113, "デバッグ4", " DEBUG4"},
{0x114, "デバッグ5", " DEBUG5"},
{0x115, "デバッグ6", " DEBUG6"},
{0x116, "デバッグ7", " DEBUG7"},
{0x117, "デバッグ8", " DEBUG8"},
{0x118, "デバッグ9", " DEBUG9"},
{0x119, "デバッグ10", " DEBUG10"},
{0x200, "", " SKY"},
{0x201, "コースとOBJ", " CRS&OBJ"},
{0x202, "アイテム", " ITEM"},
{0x203, "ドライバー", " DRIVER"},
{0x204, "", " SHADOW"},
{0x205, "エフェクト", " EFFECT"},
{0x300, "", " SKY"},
{0x301, "コース", " CRS"},
{0x302, "アイテム", " ITEM"},
{0x303, "カート", " KART"},
{0x304, "", " SHADOW"},
{0x305, "エフェクト", " EFFECT"},
{-1, "なし", nullptr}};
// half fabircated to generate certain data first
// Note: Kartcam might be part of KartCtrl.h?
@ -559,7 +559,7 @@ void RaceMgr::createLight()
JUtility::TColor ambientColor;
mCourse->getAmbientColor(&ambientColor);
LtObjAmbient *lightObjAmb = new LtObjAmbient("シーンアンビエント", ambientColor); // scene ambient?
LtObjAmbient *lightObjAmb = new LtObjAmbient("シーンアンビエント", ambientColor); // scene ambient?
lightObjAmb->setTagName('AMBI');
LightMgr::getManager()->appendLight(lightObjAmb);
@ -571,7 +571,7 @@ void RaceMgr::createLight()
for (u32 i = 0; i < getCameraNumber(); i++)
{
RaceSceneLight *sceneLight = new RaceSceneLight("シーンライト", i, lightColor, lightPos);
RaceSceneLight *sceneLight = new RaceSceneLight("シーンライト", i, lightColor, lightPos);
LightMgr::getManager()->appendLight(sceneLight);
for (int j = 0; j < getKartNumber(); j++)
{

View File

@ -6,7 +6,6 @@
#include "Kaneshige/SysDebug.h"
const GXColor SysDebug::cUserBarColorTable[8] = {
{ 255, 255, 255, 255},
{ 255, 0, 0, 255},
@ -119,40 +118,40 @@ void SysDebug::ctrlDebugMode() {
mDrawUserTime = true;
}
switch(mProcTimeType) {
case 0:
{
if (mGamePad.testTrigger(JUTGamePad::CSTICK_DOWN))
mProcTimeType = 1;
break;
}
case 1:
{
mProcTimeFrames++;
case 0:
{
if (mGamePad.testTrigger(JUTGamePad::CSTICK_DOWN))
mProcTimeType = 1;
break;
}
case 1:
{
mProcTimeFrames++;
if(cpuFrameTime > mCPUTimeMax)
mCPUTimeMax = cpuFrameTime;
mCPUTime += cpuFrameTime;
if(cpuFrameTime > mCPUTimeMax)
mCPUTimeMax = cpuFrameTime;
mCPUTime += cpuFrameTime;
if(gpuFrameTime > mAllTimeMax)
mAllTimeMax = gpuFrameTime;
mAllTime += gpuFrameTime;
if(gpuFrameTime > mAllTimeMax)
mAllTimeMax = gpuFrameTime;
mAllTime += gpuFrameTime;
if (mGamePad.testTrigger(JUTGamePad::CSTICK_DOWN))
mProcTimeType = 2;
break;
}
case 2:
{
if (mGamePad.testTrigger(JUTGamePad::CSTICK_DOWN)) {
mProcTimeType = 0;
mProcTimeFrames = 0;
mCPUTime = 0.0f;
mCPUTimeMax = 0.0f;
mAllTime = 0.0f;
mAllTimeMax = 0.0f;
}
break;
}
if (mGamePad.testTrigger(JUTGamePad::CSTICK_DOWN))
mProcTimeType = 2;
break;
}
case 2:
{
if (mGamePad.testTrigger(JUTGamePad::CSTICK_DOWN)) {
mProcTimeType = 0;
mProcTimeFrames = 0;
mCPUTime = 0.0f;
mCPUTimeMax = 0.0f;
mAllTime = 0.0f;
mAllTimeMax = 0.0f;
}
break;
}
}
break;
}
@ -273,8 +272,6 @@ void SysDebug::endUserTime(int idx) {
if(idx >= 0 && idx < 8)
JUTProcBar::getManager()->userEnd(idx);
//JUTProcBar::userEnd(int) {}
//JUTProcBar::CTime::end() {}
}
void SysDebug::draw() {
@ -359,7 +356,7 @@ void SysDebug::drawProcTime() {
cpuTimeAvg = mCPUTime / mProcTimeFrames;
allTimeAvg = mAllTime / mProcTimeFrames;
}
//JUTProcBar::getUserCost(int) {}
JUTReport(mDrawPosX, mDrawPosY + mCharHeight * 17, " AVG MAX");
JUTReport(mDrawPosX, mDrawPosY + mCharHeight * 18, "CPU: %6.3f %6.3f", cpuTimeAvg, mCPUTimeMax);
JUTReport(mDrawPosX, mDrawPosY + mCharHeight * 19, "ALL: %6.3f %6.3f", allTimeAvg, mAllTimeMax);
@ -385,7 +382,6 @@ char *SysDebug::getHeapLabel(JKRHeap *pHeap) {
}
return label;
}
char *SysDebug::getHeapTypeName(JKRHeap *pHeap) {
@ -485,14 +481,12 @@ void SysDebug::drawHeapSpec()
name = "UNUSED";
JUTReport(mDrawPosX, mDrawPosY + mCharHeight * (i + 12), "%2d:%08XH(%5dKB):%s",groupID, usedSize, sizeKByte(usedSize), name);
}
}
else {
JUTReport(mDrawPosX, mDrawPosY + mCharHeight * 10, "NO HEAP INFO");
}
}
}
}
bool SysDebug::beginDebugHeap() {
@ -549,7 +543,6 @@ SysDebug::HeapInfo::HeapInfo(JKRHeap *pHeap, char *label) : mLink(this) {
mHeap = pHeap;
clrGroup();
for(int i = 0; i < 8; i++)
mHeapLabel[i] = label[i];
mTerminator = '\0';
@ -567,9 +560,8 @@ SysDebug::HeapInfo::~HeapInfo() {
void SysDebug::HeapInfo::clrGroup() {
mGroupID = 0;
for(s16 i = 0; i < 30; i++) {
for(s16 i = 0; i < 30; i++)
mGroupName[i] = nullptr;
}
}
void SysDebug::HeapInfo::setGroup(const char *name) {
@ -580,9 +572,8 @@ void SysDebug::HeapInfo::setGroup(const char *name) {
mGroupID++;
}
if(newId >= 0) {
if(newId >= 0)
mHeap->changeGroupID(newId);
}
}
int SysDebug::HeapInfo::searchSameName(const char *name) {