summaryrefslogtreecommitdiff
path: root/src/d/d_simple_model.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/d/d_simple_model.cpp')
-rw-r--r--src/d/d_simple_model.cpp85
1 files changed, 63 insertions, 22 deletions
diff --git a/src/d/d_simple_model.cpp b/src/d/d_simple_model.cpp
index 44d237e176..0085c29974 100644
--- a/src/d/d_simple_model.cpp
+++ b/src/d/d_simple_model.cpp
@@ -17,6 +17,12 @@
/* 80048C54-80048CB4 043594 0060+00 1/1 0/0 0/0 .text dSmplMdl_modelUpdateDL__FP8J3DModel
*/
static void dSmplMdl_modelUpdateDL(J3DModel* i_model) {
+ JUT_ASSERT(61, i_model != 0);
+ J3DModelData* modelData = i_model->getModelData();
+ if (modelData->getMaterialNodePointer(0)->getMaterialAnm() != NULL) {
+ OS_REPORT(
+ "\x1b[43;30mシンプルモデル描画:モデルは\'bmdg\'フォルダに置いていますか?\n\x1b[m");
+ }
i_model->calc();
i_model->entry();
i_model->viewCalc();
@@ -48,6 +54,8 @@ diff_model_c::diff_model_c() {
dSmplMdl_draw_c::~dSmplMdl_draw_c() {
for (int i = 0; i < 8; i++) {
if (mModel[i].getModel() != NULL) {
+ OS_REPORT("\x1b[43;30m差分DL用ダミーモデル削除忘れがあります!!\n");
+ OS_REPORT("差分DLモデル領域を強制的に削除します。\n", "\x1b[m");
mModel[i].remove(1);
}
}
@@ -82,24 +90,41 @@ void dSmplMdl_draw_c::entry(J3DModel* i_model, int roomNo) {
}
}
mListCount++;
+ } else {
+ OS_REPORT("\x1b[43;30mシンプルモデル描画エントリ数オーバー!!(%s, %d)\n\x1b[m",
+ __FILE__, 278);
}
}
/* 80048F70-80049058 0438B0 00E8+00 0/0 1/1 0/0 .text
* addModel__15dSmplMdl_draw_cFP12J3DModelDataiUc */
BOOL dSmplMdl_draw_c::addModel(J3DModelData* i_modelData, int roomNo, u8 drawBG) {
+ JUT_ASSERT(307, i_modelData != 0);
+ if (roomNo == -1) {
+ OS_REPORT("\x1b[43;30mシンプルモデル描画差分DLモデル登録:部屋番号指定がありません!!!\n\x1b[m");
+ }
for (int i = 0; i < 8; i++) {
if (mModel[i].isSame(i_modelData, roomNo)) {
- return mModel[i].create(i_modelData, roomNo, drawBG) ? TRUE : FALSE;
+ if (mModel[i].create(i_modelData, roomNo, drawBG)) {
+ return TRUE;
+ }
+ return FALSE;
}
}
for (int i = 0; i < 8; i++) {
if (mModel[i].getModelData() == NULL) {
- return mModel[i].create(i_modelData, roomNo, drawBG) ? TRUE : FALSE;
+ if (mModel[i].create(i_modelData, roomNo, drawBG)) {
+ return TRUE;
+ }
+ return FALSE;
}
}
+ OS_REPORT(
+ "\x1b[43;30m差分DL用ダミーモデル空きエントリが見つかりませんでした!(%s, %d)\n\x1b[m",
+ __FILE__, 349);
+
return 0;
}
@@ -116,12 +141,14 @@ int dSmplMdl_draw_c::removeModel(J3DModelData* i_modelData, int roomNo) {
return 0;
}
}
-
+
+ OS_REPORT_ERROR("シンプルモデルを登録してないのに削除に!\n");
return 0;
}
/* 800490EC-800491F4 043A2C 0108+00 1/1 0/0 0/0 .text create__12diff_model_cFP12J3DModelDataiUc */
BOOL diff_model_c::create(J3DModelData* i_modelData, int roomNo, u8 drawBG) {
+ JUT_ASSERT(397, i_modelData != 0);
if (mpHeap == NULL) {
mpHeap = mDoExt_createSolidHeapFromGameToCurrent(0x2000, 0x20);
@@ -129,15 +156,20 @@ BOOL diff_model_c::create(J3DModelData* i_modelData, int roomNo, u8 drawBG) {
mpModel = mDoExt_J3DModel__create(i_modelData, 0x80000, 0x11000084);
if (mpModel == NULL) {
+ OS_REPORT("差分DL用モデル モデル生成失敗!(%s, %d)\n", __FILE__, 413);
remove(1);
mDoExt_restoreCurrentHeap();
} else {
- mpModel->setBaseScale(cXyz(0.0f, 0.0f, 0.0f));
- mpModel->setBaseTRMtx(g_mDoMtx_identity);
+ cXyz scale(0.0f, 0.0f, 0.0f);
+ mpModel->setBaseScale(scale);
+ mpModel->setBaseTRMtx(mDoMtx_getIdentity());
mCreateNum++;
- mDoExt_adjustSolidHeapToSystem(mpHeap);
+ int result = mDoExt_adjustSolidHeapToSystem(mpHeap);
mRoomNo = roomNo;
mDrawBG = drawBG;
+ #if VERSION == VERSION_SHIELD_DEBUG
+ field_0x12 = 0;
+ #endif
return 1;
}
}
@@ -162,9 +194,14 @@ void diff_model_c::remove(int param_0) {
mCreateNum--;
if (mCreateNum == 0 || param_0 != 0) {
- JKRSolidHeap* heap = mpHeap;
- if (heap != NULL) {
- mDoExt_destroySolidHeap(heap);
+ if (mpHeap != NULL) {
+ #if VERSION == VERSION_SHIELD_DEBUG
+ if (field_0x12 != 0) {
+ JUT_WARN(510, "%s", "Simple Model Denger Remove !!\n");
+ }
+ #endif
+
+ mDoExt_destroySolidHeap(mpHeap);
init();
}
}
@@ -173,21 +210,25 @@ void diff_model_c::remove(int param_0) {
/* 80049270-80049368 043BB0 00F8+00 1/1 0/0 0/0 .text draw__12diff_model_cFv */
void diff_model_c::draw() {
modelList_c* list = mpList;
- if (list != NULL) {
- if (dComIfGp_roomControl_checkStatusFlag(getRoomNo(), 0x10)) {
- dKy_tevstr_c* tevstr = dComIfGp_roomControl_getTevStr(getRoomNo());
- g_env_light.setLightTevColorType_MAJI(mpModel, tevstr);
+ if (list != NULL && dComIfGp_roomControl_checkStatusFlag(getRoomNo(), 0x10)) {
+ g_env_light.setLightTevColorType_MAJI(mpModel, dComIfGp_roomControl_getTevStr(getRoomNo()));
- if (mDrawBG == 1) {
- dComIfGd_setListBG();
- }
+ if (mDrawBG == 1) {
+ dComIfGd_setListBG();
+ }
- for (; list != NULL; list = list->field_0x4) {
- dSmplMdl_modelUpdateDL(list->mpModel);
- }
- mDoExt_modelUpdateDL(mpModel);
- dComIfGd_setList();
+ for (; list != NULL; list = list->field_0x4) {
+ dSmplMdl_modelUpdateDL(list->mpModel);
}
+ mDoExt_modelUpdateDL(mpModel);
+ dComIfGd_setList();
+ #if VERSION == VERSION_SHIELD_DEBUG
+ field_0x12 = 1;
+ #endif
+ } else {
+ #if VERSION == VERSION_SHIELD_DEBUG
+ field_0x12 = 0;
+ #endif
}
}
@@ -224,4 +265,4 @@ void diff_model_c::insert(modelList_c* list) {
}
list->field_0x4 = prev;
-} \ No newline at end of file
+}