summaryrefslogtreecommitdiff
path: root/src/d/d_map_path.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/d/d_map_path.cpp')
-rw-r--r--src/d/d_map_path.cpp180
1 files changed, 169 insertions, 11 deletions
diff --git a/src/d/d_map_path.cpp b/src/d/d_map_path.cpp
index ab55666b2f..ee4b053240 100644
--- a/src/d/d_map_path.cpp
+++ b/src/d/d_map_path.cpp
@@ -6,6 +6,7 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "JSystem/J2DGraph/J2DGrafContext.h"
+#include "JSystem/JHostIO/JORFile.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "d/d_com_inf_game.h"
#include "d/d_map_path.h"
@@ -16,11 +17,14 @@ void dMpath_n::dTexObjAggregate_c::create() {
79, 80, 77, 78, 76, 81, 82,
};
- for (int i = 0; i < 7; i++) {
- mp_texObj[i] = new GXTexObj();
-
- ResTIMG* image = (ResTIMG*)dComIfG_getObjectRes("Always", data[i]);
- mDoLib_setResTimgObj(image, mp_texObj[i], 0, NULL);
+ for (int lp1 = 0; lp1 < 7; lp1++) {
+ mp_texObj[lp1] = new GXTexObj();
+ JUT_ASSERT(70, mp_texObj[lp1] != NULL);
+ ResTIMG* image = (ResTIMG*)dComIfG_getObjectRes("Always", data[lp1]);
+ JUT_ASSERT(72, image != NULL);
+ JUT_ASSERT(73, image->minFilter == GX_NEAR);
+ JUT_ASSERT(74, image->magFilter == GX_NEAR);
+ mDoLib_setResTimgObj(image, mp_texObj[lp1], 0, NULL);
}
}
@@ -31,6 +35,159 @@ void dMpath_n::dTexObjAggregate_c::remove() {
}
}
+#if DEBUG
+void dMpath_HIO_n::hioList_c::gen(JORMContext* mctx) {
+ static const char* number[] = {
+ "00", "01", "02", "03", "04", "05", "06", "07",
+ "08", "09", "10", "11", "12", "13", "14", "15",
+ "16", "17", "18", "19", "20", "21", "22", "23",
+ "24", "25", "26", "27", "28", "29", "30", "31",
+ "32", "33", "34", "35", "36", "37", "38", "39",
+ "40", "41", "42", "43", "44", "45", "46", "47",
+ "48", "49", "50", "51", "52", "53", "54", "55",
+ "56", "57", "58", "59", "60", "61", "62", "63",
+ };
+ // DEBUG NONMATCHING
+}
+
+void dMpath_HIO_n::hioList_c::update(JORMContext* mctx) {
+ // DEBUG NONMATCHING
+}
+
+u32 dMpath_HIO_n::hioList_c::addString(char* param_1, u32 param_2, u32 param_3) const {
+ // DEBUG NONMATCHING
+}
+
+u32 dMpath_HIO_n::hioList_c::addStringBinary(char* param_1, u32 param_2, u32 param_3) const {
+ // DEBUG NONMATCHING
+}
+
+BOOL dMpath_HIO_file_base_c::writeHostioTextFile(const char* param_1) {
+ JORFile file;
+ BOOL result = 0;
+ const char* r27 = "すべてのファイル(*.*)\0*.*\0";
+ if (param_1) {
+ r27 = param_1;
+ }
+ if (file.open(JORFile::EFlags_WRITE | JORFile::EFlags_UNK_0x4, r27, NULL, NULL, NULL)) {
+ const u32 bufSize = 4000;
+ u32 size = 0;
+ char buffer[bufSize];
+ memset(buffer, 0, bufSize);
+ size = addString(buffer, size, bufSize);
+ JUT_ASSERT(732, size < bufSize);
+ file.writeData(buffer, s16(size));
+ file.close();
+ OSReport("write append success!::%6d\n", size);
+ result = 1;
+ } else {
+ OSReport("write append failure!\n");
+ result = 0;
+ }
+ return result;
+}
+
+BOOL dMpath_HIO_file_base_c::writeBinaryTextFile(const char* param_1) {
+ JORFile file;
+ BOOL result = 0;
+ const char* r27 = "すべてのファイル(*.*)\0*.*\0";
+ if (param_1) {
+ r27 = param_1;
+ }
+ if (file.open(JORFile::EFlags_WRITE | JORFile::EFlags_UNK_0x4, r27, NULL, NULL, NULL)) {
+ const u32 bufSize = 10000;
+ u32 size = 0;
+ char buffer[bufSize];
+ memset(buffer, 0, bufSize);
+ size = addStringBinary(buffer, size, bufSize);
+ JUT_ASSERT(762, size < bufSize);
+ file.writeData(buffer, s16(size));
+ file.close();
+ OSReport("write append success!::%6d\n", size);
+ result = 1;
+ } else {
+ OSReport("write append failure!\n");
+ result = 0;
+ }
+ return result;
+}
+
+BOOL dMpath_HIO_file_base_c::writeBinaryFile(const char* param_1) {
+ JORFile file;
+ BOOL result = 0;
+ const char* r27 = "すべてのファイル(*.*)\0*.*\0";
+ if (param_1) {
+ r27 = param_1;
+ }
+ if (file.open(JORFile::EFlags_WRITE | JORFile::EFlags_UNK_0x4, r27, NULL, NULL, NULL)) {
+ const u32 bufSize = 2000;
+ u32 size = 0;
+ char buffer[bufSize];
+ memset(buffer, 0, bufSize);
+ size = addData(buffer, size, bufSize);
+ JUT_ASSERT(794, size < bufSize);
+ file.writeData(buffer, s16(size));
+ file.close();
+ OSReport("write append success!::%6d\n", size);
+ result = 1;
+ } else {
+ OSReport("write append failure!\n");
+ result = 0;
+ }
+ return result;
+}
+
+void dMpath_HIO_file_base_c::binaryDump(const void* param_1, u32 param_2) {
+ int r26 = 0;
+ u8* r30 = (u8*)param_1;
+ u8* r25 = r30;
+ int r28;
+ for (int i = 0; i < param_2; i++, r30++) {
+ r28 = i % 8;
+ if (r28 == 0) {
+ OSReport("%04x : ",i);
+ }
+ OSReport("%02x", u8(*r30));
+ if (r28 == 3) {
+ OSReport(" - ");
+ } else if (r28 == 7) {
+ OSReport("\n");
+ } else {
+ OSReport(" ");
+ }
+ }
+ if (r28 != 7) {
+ OSReport("\n");
+ }
+ OSReport("startAdr<%08x>dataSize<%d><0x%04x>\n", param_1, param_2, param_2);
+}
+
+bool dMpath_HIO_file_base_c::readBinaryFile(const char* param_1) {
+ JORFile file;
+ bool result = false;
+ const char* r26 = "すべてのファイル(*.*)\0*.*\0";
+ if (param_1) {
+ r26 = param_1;
+ }
+ if (file.open(JORFile::EFlags_READ, r26, NULL, NULL, NULL)) {
+ s32 r28 = file.getFileSize();
+ char* buf = new char[r28];
+ JUT_ASSERT(855, buf != 0);
+ file.readData(buf, r28);
+ copyReadBufToData(buf, r28);
+ OSReport("write read success!::%6d\n", r28);
+ result = true;
+ delete[] buf;
+ buf = NULL;
+ file.close();
+ } else {
+ OSReport("write append failure!\n");
+ result = false;
+ }
+ return result;
+}
+#endif
+
void dDrawPath_c::rendering(dDrawPath_c::line_class const* p_line) {
if (isDrawType(p_line->field_0x0)) {
int width = getLineWidth(p_line->field_0x1);
@@ -94,13 +251,14 @@ void dDrawPath_c::rendering(dDrawPath_c::floor_class const* p_floor) {
}
}
-void dDrawPath_c::rendering(dDrawPath_c::room_class const* p_room) {
- if (p_room != NULL) {
- GXSetArray(GX_VA_POS, p_room->mpFloatData, 8);
- floor_class* floor = p_room->mpFloor;
+void dDrawPath_c::rendering(dDrawPath_c::room_class const* room) {
+ JUT_ASSERT(1043, room != NULL);
+ if (room != NULL) {
+ GXSetArray(GX_VA_POS, room->mpFloatData, 8);
+ floor_class* floor = room->mpFloor;
if (floor != NULL) {
- for (int i = 0; i < p_room->mFloorNum; i++) {
+ for (int i = 0; i < room->mFloorNum; i++) {
if (isRenderingFloor(floor->mFloorNo)) {
rendering(floor);
}
@@ -171,7 +329,7 @@ void dRenderingFDAmap_c::setTevSettingIntensityTextureToCI() const {
GXSetNumTevStages(2);
GXSetNumChans(1);
GXSetNumTexGens(1);
- GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 60, GX_FALSE, 125);
+ GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 60);
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_KONST, GX_CC_TEXC, GX_CC_C1);