1#pragma helper_mask_gpr 0x30
2#pragma helper_mask_fpr 0x1000
3#pragma name_counter 338
17#include "battle_globals.hpp"
18#include "battlemenu.hpp"
24#include "debugfont.hpp"
25#include "dngstatusdata.hpp"
27#include "editground.hpp"
28#include "editloop3.hpp"
29#include "editmapscript.hpp"
31#include "effectmacro.hpp"
33#include "framevu1.hpp"
35#include "mainselect.hpp"
39#include "menu_misc.hpp"
40#include "menu_save.hpp"
42#include "npcharacter.hpp"
43#include "objanime.hpp"
53static void DrawBound(
CFrame *frame);
54static void DrawLine(
int *from,
int *to, u_char r, u_char g, u_char b, u_char a);
66void EdSaveFrameImage(
CTexture texture);
71#include "editloop.hpp"
72#include "editmenu.hpp"
79void ItemGetMes(
int item,
int value,
int duration,
int input_key);
88int EdDebugEventEnable = 1;
90int EdDebugParamDrawOff;
91int EdDebugCharaDrawOff;
100void EdDDebug(
int on) {
113 static int count = 0;
115 if (DebugFont == 0) {
119 sprintf(work,
"%d\n", count++);
127 TexManager.ReloadTexture(GetVif1Packet(), 31);
134 if (DebugFont == 0) {
138 if (DebugFont->
length > 500) {
150 if (DebugFont == 0) {
154 fd = sceOpen(
"host0:debug.txt", SCE_WRONLY | SCE_CREAT | SCE_TRUNC);
160 sceWrite(fd, DebugFont->
text, DebugFont->
length);
166static int AddStr(
CDebugFont *font,
char *str) {
177 sceVu0FVECTOR vector;
184 if (DebugFont == 0) {
189 sprintf(work,
"chara\n pos = %7.2f,%7.2f,%7.2f\n", vector[0], vector[1], vector[2]);
190 AddStr(DebugFont, work);
192 sprintf(work,
" rot = %7.2f,%7.2f,%7.2f\n", vector[0], vector[1], vector[2]);
193 AddStr(DebugFont, work);
197 AddStr(DebugFont, work);
203void EdDPrintCamera(
CCamera *camera) {
204 sceVu0FVECTOR vector;
211 if (DebugFont == 0) {
216 sprintf(work,
"camera\n pos = %7.2f,%7.2f,%7.2f\n", vector[0], vector[1], vector[2]);
217 AddStr(DebugFont, work);
219 sprintf(work,
" ref = %7.2f,%7.2f,%7.2f\n", vector[0], vector[1], vector[2]);
220 AddStr(DebugFont, work);
221 sprintf(work,
" projection = %7.1f\n", MGGetProjection());
222 AddStr(DebugFont, work);
225#pragma name_counter 421
228void EdDPrintVector(
char *name,
float *vector) {
235 if (DebugFont == 0) {
239 sprintf(work,
"%s %7.2f,%7.2f,%7.2f\n", name, vector[0], vector[1], vector[2]);
240 AddStr(DebugFont, work);
243void EdDPrint(
char *text) {
248 if (DebugFont == 0) {
252 AddStr(DebugFont, text);
261void EdDMoveCamera(
float *position,
float *reference) {
262 sceVu0FVECTOR offset;
276 sceVu0SubVector(offset, reference, position);
277 distance = sqrtf(offset[0] * offset[0] + offset[2] * offset[2]);
278 angle = atan2f(offset[0], offset[2]);
282 if (GamePad.
On(PAD_R1)) {
283 x = 0.02f * distance;
286 if (GamePad.
On(PAD_L1)) {
287 x = 0.02f * -distance;
293 move[0] = x * cosf(angle) + z * sinf(angle);
295 move[2] = z * cosf(angle) - x * sinf(angle);
297 if (GamePad.
On(PAD_CROSS)) {
298 sceVu0ScaleVector(move, move, 3.0f);
301 sceVu0AddVector(position, position, move);
303 if (GamePad.
On(PAD_SQUARE) && !GamePad.
On(PAD_L1 | PAD_R1)) {
304 sceVu0AddVector(reference, reference, move);
307 projection = MGGetProjection();
309 if (GamePad.
On(PAD_RIGHT)) {
313 if (GamePad.
On(PAD_LEFT)) {
317 if (projection < 100.0f) {
321 if (projection > 2000.0f) {
322 projection = 2000.0f;
325 MGSetProjection(projection);
329 float unit[2] = {-1.0f, 1.0f};
331 for (i = 0; i < 8; i++) {
332 frame.
corner[i][0] = unit[(i & 1) != 0];
333 frame.
corner[i][1] = unit[(i & 2) != 0];
334 frame.
corner[i][2] = unit[(i & 4) != 0];
335 frame.
corner[i][3] = 1.0f;
338 frame.SetPosition(reference);
345void EdDMoveCameraRef(
float *position,
float *reference) {
346 sceVu0FVECTOR offset;
359 sceVu0SubVector(offset, reference, position);
360 distance = sqrtf(offset[0] * offset[0] + offset[2] * offset[2]);
361 angle = atan2f(offset[0], offset[2]);
365 if (GamePad.
On(PAD_R1)) {
366 x = 0.02f * -distance;
369 if (GamePad.
On(PAD_L1)) {
370 x = 0.02f * distance;
376 move[0] = x * cosf(angle) + z * sinf(angle);
378 move[2] = z * cosf(angle) - x * sinf(angle);
380 sceVu0AddVector(reference, reference, move);
382 if (GamePad.
On(PAD_SQUARE) && !GamePad.
On(PAD_L1 | PAD_R1)) {
383 sceVu0AddVector(position, position, move);
388 float unit[2] = {-1.0f, 1.0f};
390 for (i = 0; i < 8; i++) {
391 frame.
corner[i][0] = unit[(i & 1) != 0];
392 frame.
corner[i][1] = unit[(i & 2) != 0];
393 frame.
corner[i][2] = unit[(i & 4) != 0];
394 frame.
corner[i][3] = 1.0f;
397 frame.SetPosition(reference);
410 sceVu0FVECTOR camera_pos;
411 sceVu0FVECTOR camera_ref;
423 if (character == 0) {
429 camera->
GetPos(camera_pos);
430 camera->
GetRef(camera_ref);
432 sceVu0SubVector(view, camera_ref, camera_pos);
433 angle = atan2f(view[0], view[2]);
440 if (GamePad.
On(PAD_R1)) {
444 if (GamePad.
On(PAD_L1)) {
448 if (rot[1] > PI_SHORT) {
449 rot[1] -= TWO_PI_SHORT;
452 if (rot[1] < -PI_SHORT) {
453 rot[1] += TWO_PI_SHORT;
456 move[0] = x * cosf(angle) + z * sinf(angle);
458 move[2] = z * cosf(angle) - x * sinf(angle);
460 if (GamePad.
On(PAD_SQUARE)) {
464 sceVu0ScaleVector(move, move, speed);
465 sceVu0AddVector(pos, pos, move);
469 if (GamePad.
Down(PAD_TRIANGLE)) {
470 sceVu0CopyVector(camera_ref, pos);
472 camera->
SetRef(camera_ref);
477 if (GamePad.
On(PAD_R2)) {
481 if (GamePad.
On(PAD_L2)) {
493 float ground[2] = {-5.0f, 5.0f};
494 float height[2] = {0.0f, 20.0f};
496 for (i = 0; i < 8; i++) {
497 frame.
corner[i][0] = ground[(i & 1) != 0];
498 frame.
corner[i][1] = height[(i & 2) != 0];
499 frame.
corner[i][2] = ground[(i & 4) != 0];
500 frame.
corner[i][3] = 1.0f;
503 frame.SetPosition(pos);
504 frame.SetRotation(rot[0], rot[1], rot[2]);
525 if (GamePad.
Down(PAD_R2)) {
529 if (GamePad.
Down(PAD_L2)) {
541 TexManager.ReloadTexture(GetVif1Packet(), 31);
548 static int select = 0;
549 static int run_event = 150;
550 static int talk_chara = 0;
552 char *on_off[2] = {
"OFF",
"ON"};
553 char *cursor[2] = {
" ",
"->"};
555 AddStr(DebugFont,
" MAIN ->R2\n");
556 sprintf(work,
"%sDEBUG CAMERA %s\n", cursor[select == 0], on_off[EdDebugCameraFlag]);
557 AddStr(DebugFont, work);
558 sprintf(work,
"%sPARAMETER %s\n", cursor[select == 1], on_off[!EdDebugParamDrawOff]);
559 AddStr(DebugFont, work);
560 sprintf(work,
"%sCHARACTER %s\n", cursor[select == 2], on_off[!EdDebugCharaDrawOff]);
561 AddStr(DebugFont, work);
562 sprintf(work,
"%sMESSAGE %s\n", cursor[select == 3], on_off[!MesAbsDrawOff]);
563 AddStr(DebugFont, work);
564 sprintf(work,
"%sDEBUG MOVE %d\n", cursor[select == 4], EdDebugMoveFlag);
565 AddStr(DebugFont, work);
566 sprintf(work,
"%sRUN EVENT %d\n", cursor[select == 5], run_event);
567 AddStr(DebugFont, work);
568 sprintf(work,
"%sTALK EVENT %d\n", cursor[select == 6], talk_chara);
569 AddStr(DebugFont, work);
570 sprintf(work,
"%sEVENT %s\n", cursor[select == 7], on_off[EdDebugEventEnable]);
571 AddStr(DebugFont, work);
572 sprintf(work,
"%sLANGUAGE %d\n", cursor[select == 8], LanguageCode);
573 AddStr(DebugFont, work);
575 EdDebugRunEventNo = -1;
579 if (GamePad.
Down(PAD_RIGHT)) {
580 EdDebugCameraFlag = 1;
583 if (GamePad.
Down(PAD_LEFT)) {
584 EdDebugCameraFlag = 0;
589 if (GamePad.
Down(PAD_RIGHT)) {
590 EdDebugParamDrawOff = 0;
593 if (GamePad.
Down(PAD_LEFT)) {
594 EdDebugParamDrawOff = 1;
599 if (GamePad.
Down(PAD_RIGHT)) {
600 EdDebugCharaDrawOff = 0;
603 if (GamePad.
Down(PAD_LEFT)) {
604 EdDebugCharaDrawOff = 1;
609 if (GamePad.
Down(PAD_RIGHT)) {
613 if (GamePad.
Down(PAD_LEFT)) {
619 if (GamePad.
Down(PAD_RIGHT)) {
623 if (GamePad.
Down(PAD_LEFT)) {
627 if (EdDebugMoveFlag < 0) {
631 if (EdDebugMoveFlag > 2) {
637 if (GamePad.
Down(PAD_RIGHT)) {
641 if (GamePad.
Down(PAD_LEFT)) {
645 if (GamePad.
Down(PAD_L1)) {
649 if (GamePad.
Down(PAD_R1)) {
653 if (GamePad.
On(PAD_CIRCLE)) {
654 EdDebugRunEventNo = run_event;
659 if (GamePad.
Down(PAD_RIGHT)) {
663 if (GamePad.
Down(PAD_LEFT)) {
667 if (GamePad.
Down(PAD_L1)) {
671 if (GamePad.
Down(PAD_R1)) {
675 if (GamePad.
On(PAD_CIRCLE)) {
676 EdTalkModeInit(EdVillager, talk_chara);
677 EdDebugRunEventNo = 256;
682 if (GamePad.
Down(PAD_RIGHT)) {
683 EdDebugEventEnable = 1;
686 if (GamePad.
Down(PAD_LEFT)) {
687 EdDebugEventEnable = 0;
692 if (GamePad.
Down(PAD_RIGHT)) {
696 if (GamePad.
Down(PAD_LEFT)) {
700 if (LanguageCode < LANG_JAPANESE) {
701 LanguageCode = LANG_JAPANESE;
704 if (LanguageCode > LANG_SPANISH) {
705 LanguageCode = LANG_SPANISH;
711 if (GamePad.
Down(PAD_DOWN)) {
715 if (GamePad.
Down(PAD_UP)) {
729 static int select = 0;
730 static int bgm_no = 0;
731 static int se_no = 0;
732 static int set_no = 0;
733 static int bgm_seq = 0;
735 char *on_off[2] = {
"OFF",
"ON"};
736 char *cursor[2] = {
" ",
"->"};
738 AddStr(DebugFont,
"L2<-SOUND ->\n");
739 sprintf(work,
"%sBGM PLAY %d SEQ = %d o:PLAY x:STOP\n", cursor[select == 0], bgm_no, bgm_seq);
740 AddStr(DebugFont, work);
741 sprintf(work,
"%sBGM OFF = %s\n", cursor[select == 1], on_off[SndGetBgmDisableFlag()]);
742 AddStr(DebugFont, work);
743 sprintf(work,
"%sSE PLAY %d O:PLAY X:STOP\n", cursor[select == 2], se_no);
744 AddStr(DebugFont, work);
745 sprintf(work,
"%sSOUND SET %d O:PLAY X:STOP\n", cursor[select == 3], set_no);
746 AddStr(DebugFont, work);
750 if (GamePad.
Down(PAD_RIGHT)) {
754 if (GamePad.
Down(PAD_LEFT)) {
758 if (GamePad.
Down(PAD_L1)) {
762 if (GamePad.
Down(PAD_R1)) {
766 if (GamePad.
Down(PAD_TRIANGLE)) {
770 if (GamePad.
Down(PAD_SQUARE)) {
782 if (GamePad.
Down(PAD_CIRCLE)) {
789 if (GamePad.
Down(PAD_CROSS)) {
796 if (GamePad.
Down(PAD_RIGHT)) {
800 if (GamePad.
Down(PAD_LEFT)) {
806 if (GamePad.
Down(PAD_RIGHT)) {
810 if (GamePad.
Down(PAD_LEFT)) {
814 if (GamePad.
Down(PAD_L1)) {
818 if (GamePad.
Down(PAD_R1)) {
822 if (GamePad.
Down(PAD_CIRCLE)) {
823 SndSePlay(se_no, -1, 0);
826 if (GamePad.
Down(PAD_CROSS)) {
832 if (GamePad.
Down(PAD_RIGHT)) {
836 if (GamePad.
Down(PAD_LEFT)) {
840 if (GamePad.
Down(PAD_L1)) {
844 if (GamePad.
Down(PAD_R1)) {
848 if (GamePad.
Down(PAD_CIRCLE)) {
849 SndSoundLoad(set_no);
855 if (GamePad.
Down(PAD_DOWN)) {
859 if (GamePad.
Down(PAD_UP)) {
875static inline void RaiseFloorReached(
CDngStatusData *status,
int dungeon,
int floor) {
882 static int select = 0;
883 static int game_no = 0;
884 static int map_no = 0;
885 static int comp_no = 0;
886 static int dun_map = MapNo;
887 static int chara = 0;
933 char *on_off[2] = {
"OFF",
"ON"};
934 char *cursor[2] = {
" ",
"->"};
936 AddStr(DebugFont,
"L2<-FALG ->R\n");
938 sprintf(work,
"%sGAMEFLAG %3d = %s\n", cursor[select == 0], game_no, on_off[SaveData->
GetGameFlag(game_no)]);
939 AddStr(DebugFont, work);
940 sprintf(work,
"%sMAPFLAG %3d = %s\n", cursor[select == 1], map_no, on_off[!SaveData->
GetMapFlag(MapNo, map_no)]);
941 AddStr(DebugFont, work);
942 sprintf(work,
"%sCOMPFLAG %3d = %s\n", cursor[select == 2], comp_no, on_off[EditPartsInfo.
GetCompEvent(comp_no)]);
943 AddStr(DebugFont, work);
944 sprintf(work,
"%sGAME INT FALG 0 = %d\n", cursor[select == 3], SaveData->
GetGameIntFlag(0));
945 AddStr(DebugFont, work);
946 sprintf(work,
"%sQUEST DUNGEON = %d\n", cursor[select == 4], SaveData->
QuestDungeon(dun_map, 0));
947 AddStr(DebugFont, work);
949 sprintf(work,
"%sDUNGEON FLOOR = %d\n", cursor[select == 5], floor);
950 AddStr(DebugFont, work);
951 sprintf(work,
"%sPARTY NUM = %d\n", cursor[select == 6], status->
party_size);
952 AddStr(DebugFont, work);
960 sprintf(work,
"%sTALKFLAG %3d = %d\n", cursor[select == 7], chara, talk);
961 AddStr(DebugFont, work);
969 if (GamePad.
Down(PAD_CIRCLE)) {
973 if (GamePad.
Down(PAD_CROSS)) {
981 if (GamePad.
Down(PAD_CIRCLE)) {
985 if (GamePad.
Down(PAD_CROSS)) {
993 if (GamePad.
Down(PAD_CIRCLE)) {
997 if (GamePad.
Down(PAD_CROSS)) {
1001 if (GamePad.
Down(PAD_TRIANGLE)) {
1004 for (i = 0; i < 24; i++) {
1015 if (GamePad.
Down(PAD_SQUARE)) {
1018 for (i = 0; i < 24; i++) {
1033 if (GamePad.
Down(PAD_RIGHT)) {
1037 if (GamePad.
Down(PAD_LEFT)) {
1041 if (GamePad.
Down(PAD_R1)) {
1045 if (GamePad.
Down(PAD_L1)) {
1057 if (GamePad.
Down(PAD_RIGHT)) {
1061 if (GamePad.
Down(PAD_LEFT)) {
1065 if (GamePad.
Down(PAD_R1)) {
1069 if (GamePad.
Down(PAD_L1)) {
1077 if (GamePad.
Down(PAD_RIGHT)) {
1081 if (GamePad.
Down(PAD_LEFT)) {
1085 if (GamePad.
Down(PAD_R1)) {
1089 if (GamePad.
Down(PAD_L1)) {
1093 RaiseFloorReached(status, dun_map, floor);
1097 if (GamePad.
Down(PAD_RIGHT)) {
1101 if (GamePad.
Down(PAD_LEFT)) {
1105 if (GamePad.
Down(PAD_R1)) {
1109 if (GamePad.
Down(PAD_L1)) {
1117 if (GamePad.
Down(PAD_CIRCLE) && npc) {
1121 if (GamePad.
Down(PAD_CROSS) && npc) {
1125 if (GamePad.
Down(PAD_TRIANGLE)) {
1126 for (i = 0; i < 20; i++) {
1135 if (GamePad.
Down(PAD_SQUARE)) {
1136 for (i = 0; i < 20; i++) {
1149 if (GamePad.
Down(PAD_RIGHT)) {
1153 if (GamePad.
Down(PAD_LEFT)) {
1157 if (GamePad.
Down(PAD_R1)) {
1161 if (GamePad.
Down(PAD_L1)) {
1170 if (GamePad.
Down(PAD_DOWN)) {
1174 if (GamePad.
Down(PAD_UP)) {
1191static void DrawBound(
CFrame *frame) {
1193 sceVu0FVECTOR world[8];
1194 sceVu0FMATRIX matrix;
1202 frame->GetLWMatrix(matrix);
1204 ApplyMatrixN(world, matrix, frame->
corner, 8);
1206 for (i = 0; i < 8; i++) {
1207 visible &= MGRotTransPers(screen[i], world[i], 0);
1214 DrawLine(screen[0], screen[1], 128, 64, 64, 80);
1215 DrawLine(screen[1], screen[5], 128, 64, 64, 80);
1216 DrawLine(screen[5], screen[4], 128, 64, 64, 80);
1217 DrawLine(screen[4], screen[0], 128, 64, 64, 80);
1218 DrawLine(screen[2], screen[3], 128, 64, 64, 80);
1219 DrawLine(screen[3], screen[7], 128, 64, 64, 80);
1220 DrawLine(screen[7], screen[6], 128, 64, 64, 80);
1221 DrawLine(screen[6], screen[2], 128, 64, 64, 80);
1222 DrawLine(screen[0], screen[2], 128, 64, 64, 80);
1223 DrawLine(screen[4], screen[6], 128, 64, 64, 80);
1224 DrawLine(screen[5], screen[7], 128, 64, 64, 80);
1225 DrawLine(screen[1], screen[3], 128, 64, 64, 80);
1232static void DrawLine(
int *from,
int *to, u_char r, u_char g, u_char b, u_char a) {
1239 packet = GetVif1Packet();
1244 test.bits.atst = SCE_GS_ALWAYS;
1246 test.bits.ztst = SCE_GS_ALWAYS;
1250 sceVif1PkCnt(packet, 0);
1251 sceVif1PkOpenDirectCode(packet, 0);
1252 sceVif1PkOpenGifTag(packet, *(u_long128 *) &GiftagAD);
1254 sceVif1PkAddGsAD(packet, SCE_GS_TEST_1, *(u_long *) &test);
1255 sceVif1PkAddGsAD(packet, SCE_GS_ZBUF_1, *(u_long *) &zbuf);
1256 sceVif1PkAddGsAD(packet, SCE_GS_PRIM, SCE_GS_SET_PRIM(SCE_GS_PRIM_LINE, 0, 0, 0, 1, 0, 1, 0, 0));
1257 sceVif1PkAddGsAD(packet, SCE_GS_RGBAQ, SCE_GS_SET_RGBAQ(r, g, b, a, *(u_int *) &q));
1258 sceVif1PkAddGsAD(packet, SCE_GS_XYZF2, SCE_GS_SET_XYZF2(from[0], from[1], from[2], 0));
1259 sceVif1PkAddGsAD(packet, SCE_GS_XYZF2, SCE_GS_SET_XYZF2(to[0], to[1], to[2], 0));
1260 sceVif1PkAddGsAD(packet, SCE_GS_TEST_1, *(u_long *) &mgPixelTest);
1261 sceVif1PkAddGsAD(packet, SCE_GS_ZBUF_1, *(u_long *) &mgZBuffer);
1263 sceVif1PkCloseGifTag(packet);
1264 sceVif1PkCloseDirectCode(packet);
1267void EdSetBgmVol(
float time) {
1272 if (EdCheckTime(time, 4.0f, 11.0f) != 0) {
1276 if (!(time < 3.0f) && time < 4.0f) {
1277 level = 4.0f - time;
1280 int volume = (int) (level * (
float) SndGetDefaultBgmVol());
1286 if (SndBgmCheck() == 1) {
1288 SndSetBgmVol(volume);
1292 }
else if (level > 0.0) {
1294 SndSetBgmVol(volume);
1298void EdAmbientPlay(
float time) {
1300 int ambient_no = EdGetTime(time);
1302 if (++ambient_no >= 4) {
1306 SndAmbientPlay(ambient_no);
1309void EdSetAmbientVol(
float volume) {
1310 SndAmbientSetVolf(volume);
1319static int now_play_se[4];
1320static int now_play_se_flag[4];
1322static void init_sound_src() {
1325 for (i = 0; i < 4; i++) {
1326 sound_src[i].
se = -1;
1327 sound_src[i].
num = 0;
1333static SOUND_SRC *get_sound_src(
int se) {
1336 for (i = 0; i < 4; i++) {
1337 if (se == sound_src[i].se) {
1338 return &sound_src[i];
1342 for (i = 0; i < 4; i++) {
1343 if (sound_src[i].se < 0) {
1344 return &sound_src[i];
1355static int check_se_play(
int se) {
1362 for (i = 0; i < 4; i++) {
1363 if (se == now_play_se[i]) {
1364 now_play_se_flag[i] = 1;
1369 for (i = 0; i < 4; i++) {
1370 if (now_play_se[i] < 0) {
1371 now_play_se[i] = se;
1372 now_play_se_flag[i] = 1;
1380void EdInitSoundSrc() {
1383 for (i = 0; i < 4; i++) {
1384 now_play_se[i] = -1;
1385 now_play_se_flag[i] = 0;
1396void EdPlaySoundSrc() {
1404 for (i = 0; i < 4; i++) {
1405 now_play_se_flag[i] = 0;
1408 for (i = 0; i < 4; i++) {
1409 se = sound_src[i].
se;
1415 playing = check_se_play(se);
1422 SndSePlay(se, 0, 0);
1427 for (j = 0; j < sound_src[i].
num; j++) {
1428 volume += sound_src[i].
volume[j];
1433 for (j = 0; j < sound_src[i].
num; j++) {
1434 pan += sound_src[i].
pan[j] * sound_src[i].
volume[j] / volume;
1437 if (volume > 1.0f) {
1441 SndSetSeVolf(se, volume, 0);
1451 SndSetSePanf(se, pan, 0);
1454 for (i = 0; i < 4; i++) {
1455 if (now_play_se_flag[i]) {
1459 if (now_play_se[i] < 0) {
1463 SndSeStop(now_play_se[i], 0);
1464 now_play_se[i] = -1;
1468void EdStopSoundSrc() {
1471 for (i = 0; i < 4; i++) {
1472 if (now_play_se[i] < 0) {
1476 SndSeStop(now_play_se[i], 0);
1477 now_play_se[i] = -1;
1480 SndSeStop(SE_AMBIENT_TOWN_PATTER, 0);
1481 SndSeStop(SE_AMBIENT_TOWN_NOISE, 0);
1487static float GetDistLine(
float *point,
float *from,
float *to,
float *near_point) {
1488 sceVu0FVECTOR offset;
1489 sceVu0FVECTOR to_offset;
1490 sceVu0FVECTOR projection;
1497 sceVu0SubVector(offset, from, point);
1498 sceVu0SubVector(to_offset, to, point);
1499 sceVu0SubVector(line, to_offset, offset);
1500 length = DistVector(line);
1501 length = length * length;
1502 fraction = -sceVu0InnerProduct(offset, line) / length;
1504 if (fraction < 0.0f || fraction > 1.0f) {
1505 from_dist = DistVector(point, from);
1506 to_dist = DistVector(point, to);
1508 if (from_dist < to_dist) {
1509 sceVu0CopyVector(near_point, from);
1513 sceVu0CopyVector(near_point, to);
1517 sceVu0ScaleVector(projection, line, fraction);
1518 sceVu0AddVector(projection, offset, projection);
1519 sceVu0AddVector(near_point, projection, point);
1520 return DistVector(projection);
1527void EdSetSoundSrcVol(
float time,
CMapParts **parts,
int count,
float *camera_pos,
float *camera_dir) {
1538 sceVu0FVECTOR position;
1539 sceVu0FVECTOR rotation;
1548 SndSetCamera(camera_pos, camera_dir);
1551 for (i = 0; i < count; i++) {
1552 if (parts[i] == 0) {
1556 frame = parts[i]->
frame[0];
1563 frame->SetPosition(position);
1565 frame->SetRotation(rotation[0], rotation[1], rotation[2]);
1567 for (j = 0; j < 24; j++) {
1568 effect = parts[i]->
effect[j];
1570 if (parts[i]->effect_on[j] == 0) {
1578 if (effect->
kind != EDIT_EFFECT_SOUND && effect->
kind != EDIT_EFFECT_FIRE_LARGE && effect->
kind != EDIT_EFFECT_FIRE_SMALL) {
1582 if (effect->
frame == 0) {
1586 if (CheckEditEffect(effect, time) == 0) {
1590 effect->
frame->GetWorldPosition(from, effect->
offset);
1592 if (effect->
colour[3] == 1.0f) {
1593 effect->
frame->GetWorldPosition(to, effect->
colour);
1594 sceVu0CopyVector(line, from);
1595 distance = GetDistLine(camera_pos, line, to, from);
1597 distance = DistVector(camera_pos, from);
1605 if (effect->
kind == EDIT_EFFECT_FIRE_LARGE || effect->
kind == EDIT_EFFECT_FIRE_SMALL) {
1611 if (distance > far_dist) {
1615 source = get_sound_src(se);
1621 SndGetVolPan(&volume, &pan, from, near_dist, far_dist);
1624 if (source->
num < 16) {
1626 source->
pan[source->
num] = pan;
1635 if (DistVector(camera_pos, position) >= 300.0f) {
1639 door_source = get_sound_src(52);
1641 if (door_source == 0) {
1645 SndGetVolPan(&door_volume, &door_pan, position, 100.0f, 300.0f);
1646 door_source->
se = 52;
1648 if (door_source->
num < 16) {
1649 door_source->
volume[door_source->
num] = door_volume;
1650 door_source->
pan[door_source->
num] = door_pan;
1665void EdDoorOpenSe(
int door_no,
float *position) {
1666 static int se_open[8] = {0x6C, 0x7E, 0x6E, 0x80, 0x74, 0x82, 0x70, 0x72};
1668 if (door_no < 0 || door_no >= 8) {
1672 SndSePlay(se_open[door_no], -1, 0);
1682void EdDoorCloseSe(
int door_no,
float *position) {
1683 static int se_close[8] = {0x6D, 0x7F, 0x6F, 0x81, 0x75, 0x83, 0x71, 0x73};
1685 if (door_no < 0 || door_no >= 8) {
1689 SndSePlay(se_close[door_no], -1, 0);
1692int EdGetDoorMotion(
int door_no,
int state) {
1693 static int motion[8][2] = {
1704 if (door_no < 0 || door_no >= 8) {
1708 return motion[door_no][state != 0];
1715void EdSetDOFLevel(
int level) {
1719 dof.
start = ConvertTime(0.0f);
1720 dof.
end = ConvertTime(24.0f);
1731 EdSetDOFLevel(info->
level);
1736void EdDrawDOF(
int level) {
1739 drawn_level = dof.
level;
1741 if (drawn_level < 0) {
1745 if (level < drawn_level) {
1746 drawn_level = level;
1755static int thunder_count;
1756static int start_thunder;
1757static int next_thunder_cnt;
1758static sceVu0FMATRIX thd_light;
1759static sceVu0FMATRIX thd_color;
1761void EdInitThunderEffect() {
1763 next_thunder_cnt = 60;
1769 sceVu0FMATRIX color;
1770 sceVu0FMATRIX light;
1776 if (map == 40 || map == 50 || map == 24) {
1780 frame = frame->SearchFrame(
"inazuma");
1789 if (start_thunder == 0) {
1790 MGGetPLight(thd_light, thd_color);
1793 MGGetPLight(light, color);
1795 if (thunder_count > 0) {
1800 if (next_thunder_cnt == 0) {
1803 for (light_no = 0; light_no < 2; light_no++) {
1804 for (channel = 0; channel < 3; channel++) {
1805 thd_color[light_no][channel] = 255.0f;
1809 SndSePlay(rand() % 6 + SE_THUNDER_RUMBLE, -1, 0);
1811 if (start_thunder == 0) {
1812 SndSePlay(SE_THUNDER_CLAP, -1, 0);
1816 next_thunder_cnt = rand() % 200 + 10;
1825 for (i = 0; i < 2; i++) {
1826 for (j = 0; j < 3; j++) {
1827 thd_color[i][j] -= 6.0f;
1829 if (thd_color[i][j] < color[i][j]) {
1830 thd_color[i][j] = color[i][j];
1835 MGSetPLight(light, thd_color);
1850 bool visible =
false;
1869 if (EdDebugCharaDrawOff != 0) {
1870 player_draw_mask = 0;
1873 if (event != NULL) {
1875 player_draw_mask = 3;
1878 player_draw_mask &= ~1;
1882 player_draw_mask &= ~2;
1887 if (npc_draw_masks != NULL) {
1888 for (i = 0; i < npc_count; i++) {
1890 npc_draw_masks[i] = 0;
1894 npc_draw_masks[i] &= ~2;
1902 for (i = 0; i < npc_count && npc_draw_masks != NULL; i++) {
1906 if (IsVisible(&npcs[i])) {
1907 npc_draw_masks[i] = 0;
1908 TexManager.ReloadTexture(Vif1Packet, npcs[i].texture_block);
1917 if (draw_shadows != 0) {
1918 sceVu0FMATRIX light_direction;
1919 sceVu0FMATRIX shadow_direction;
1920 sceVu0FMATRIX light_colour;
1921 sceVu0FMATRIX saved_colour;
1923 MGGetPLight(light_direction, light_colour);
1924 sceVu0CopyMatrix(shadow_direction, light_direction);
1925 sceVu0CopyMatrix(saved_colour, light_colour);
1926 EdLimitShadowLight(shadow_direction, 3.0f);
1927 MGSetPLight(shadow_direction, light_colour);
1928 TexManager.ReloadTexture(Vif1Packet, 22);
1929 MGBeginDrawShadow(*(
sceGsTex0 *) &TexManager.GetTexture(
"shadow_buff", -1)->
tex0);
1931 if (player_draw_mask & 2) {
1935 for (i = 0; i < npc_count && npc_draw_masks != NULL; i++) {
1936 if (npc_draw_masks[i] & 2) {
1937 if (IsShadowVisible(&npcs[i])) {
1944 MGEndDrawShadow(0x34);
1945 MGSetPLight(light_direction, light_colour);
1948 if (player_draw_mask & 1) {
1949 TexManager.ReloadTexture(Vif1Packet, 8);
1954 for (i = 0; i < npc_count && npc_draw_masks != NULL; i++) {
1955 if (npcs[i].CheckDraw() != 0 && (npc_draw_masks[i] & 1) != 0) {
1956 if (IsVisible(&npcs[i])) {
1957 TexManager.ReloadTexture(Vif1Packet, npcs[i].texture_block);
1975 for (i = 1; i <= count; i++, effects++) {
1980 if (effects->
kind <= EDIT_EFFECT_NONE) {
1985 if (InitEditEffect(parts->
frame[0], func_data, effects) == 0) {
1989 for (j = 0; j < 24; j++) {
1992 parts->
effect[j] = effects;
2003static int init_menu_cnt;
2004static int menu_mode;
2007static int name_reg_chara;
2008static int use_item_list[32];
2013static int ConvertItemNo(
int item) {
2014 return TransWepNo(item);
2017static int InvertItemNo(
int item) {
2018 return TransWepNoNewToOld(item);
2021void EdUseItemInit() {
2022 use_item_list[0] = ITEM_ATTACH_PEARL;
2023 use_item_list[1] = -1;
2027void EdSetUseItem(
int *items) {
2030 for (i = 0; i < 32; i++) {
2031 use_item_list[i] = ConvertItemNo(items[i]);
2033 if (use_item_list[i] < 0) {
2040 return InvertItemNo(use_item);
2043void EdSetNameRegChara(
int character) {
2044 name_reg_chara = character;
2047void EdSetShopNo(
int shop) {
2051int EdInitMenu(
int mode) {
2062 SetInteriorOutFlag(0);
2071 if (init_menu_cnt > 3) {
2075 if (init_menu_cnt < 4) {
2080 EdSaveFrameImage(*texture);
2086 int texture_block[6] = {16, 17, 18, 25, 32, 33};
2088 int texture_block[5] = {16, 17, 18, 25, 32};
2091 switch (menu_mode) {
2093 EditMenuInit(texture_block, EditMenuStatus.
mode == EDIT_MENU_MODE_PLACE);
2094 return ED_MODE_GEORAMA_MENU;
2096 BattleMenuInit(texture_block, BATTLE_MENU_MODE_TOWN);
2100 ShopNoInput(texture_block, shop_no, 1);
2109 InitNameRegist(name_reg_chara, 16, 0);
2112 InitMenuMove(MENU_MOVE_WORLD_MAP_DIRECT, 16, (u_long128 *) read_buffer);
2115 InitFishingExchange(0, texture_block, 0);
2118 InitFishRecordView(0, texture_block, 0);
2122 return ED_MODE_MENU;
2136 switch (menu_mode) {
2138 finished = !BattleMenuCursor();
2142 EdClearItemOverFlag();
2148 finished = CommonShopLoop();
2152 finished = EventItemSelectLoop(&use_item);
2155 finished = NameEnterKey();
2159 finished = !MenuMoveKey();
2163 finished = FishingExchangeLoop();
2166 finished = FishRecordViewLoop();
2174void EdGetItem(
int item,
int count,
int attachment) {
2184 item_no = ConvertItemNo(item);
2190 for (i = 0; i < count; i++) {
2191 if (attachment > 0) {
2192 status->
GetItem(item_no, attachment);
2201int EdAddMaxItem(
int amount) {
2207 new_count = pack->
num + amount;
2209 if (new_count < 0) {
2213 if (new_count > 100) {
2217 for (i = pack->
num; i < new_count; i++) {
2221 pack->
num = (char) new_count;
2225int EdCheckItemOver() {
2229void EdClearItemOverFlag() {
2233int EdCheckItem(
int item) {
2238 item_no = ConvertItemNo(item);
2247int EdCheckGetItem(
int item) {
2252 item_no = ConvertItemNo(item);
2261void EdGetItemFile(
int item_no,
char *model_path,
char *texture_path) {
2262 BtGetItemNamePath(model_path, texture_path, item_no);
2274 TexManager.ReloadTexture(GetVif1Packet(), 0x28);
2285static int SystemMesNo = -1;
2286static int HelpMesNo = -1;
2287static int SystemMesCount;
2288static int SystemMesPosition;
2289static int SystemMesW;
2290static int SystemMesH;
2291static int SystemMesX;
2292static int SystemMesY;
2293static int SystemMesWait;
2294static int SystemMesInputKey;
2295static int HelpMesCount;
2299void EdSetSystemMes(
int mes_no,
int count,
int position,
int input_key,
int *args,
int value) {
2302 SystemMesInputKey = input_key;
2303 SystemMesPosition = position;
2306 for (i = 0; i < 4; i++) {
2307 EditSystemMes.
mes_no[i] = -1;
2310 EditSystemMes.
mes_no[i] = *args;
2318 EditSystemMes.
value = value;
2322 SystemMesNo = mes_no;
2323 SystemMesCount = count;
2330void EdSetHelpMes(
int mes_no,
int count,
int position,
int *args,
int value) {
2335 if (mes_no == 120) {
2337 indent = 16 - indent;
2344 x = SystemMesX + ((indent * EditSystemMes.
char_width) >> 1);
2348 x = SystemMesX + 220;
2350 x = SystemMesX + 180;
2361 EditSystemMes.
auto_pos = SystemMesPosition;
2362 EditSystemMes.
text_x = SystemMesX;
2363 EditSystemMes.
text_y = SystemMesY;
2366 EditSystemMes.
auto_pos = SystemMesPosition;
2367 EdSetSystemMes(mes_no, count, position, 0, args, value);
2368 EditSystemMes.
auto_pos = SystemMesPosition;
2369 HelpMesNo = SystemMesNo;
2370 HelpMesCount = SystemMesCount;
2375void EdClearSystemMes() {
2380 SystemMesInputKey = 0;
2390int EdSystemMesCheck() {
2391 return SystemMesCheck();
2397void EdSystemMesStep() {
2398 if (SystemMesWait > 0) {
2405 if (SystemMesCount == 1 || HelpMesCount == 1) {
2409 if (SystemMesNo > 0 || HelpMesCount >= 0) {
2410 EditSystemMes.
Step();
2413 if (SystemMesInputKey == 0 || SystemMesCount != 2 || GamePad.
Down(PAD_CROSS)) {
2414 if (SystemMesCount > 0) {
2418 if (HelpMesCount > 0) {
2426void EdSystemMesDraw() {
2427 if (SystemMesWait > 0) {
2433 if (HelpMesNo <= 0) {
2437 TexManager.ReloadTexture(Vif1Packet, EditSystemMes.
tex_block);
2445void EdEditMainHelpMes(
int building) {
2448 SystemMesX = 320 - ((EditSystemMes.
char_width * 40) >> 1);
2450 EdSetHelpMes(100 + (building != 0), 2, -1, 0, -1);
2453void EdWalkToEditMes(
int wait) {
2458 SystemMesWait = wait;
2459 EdSetHelpMes(110, 120, -1, 0, -1);
2464void EdEditBuildHelpMes(
int part_no) {
2477 int args[4] = {-1, -1, -1, -1};
2479 args[0] = GetAtraMsgNo(MapNo, part_no);
2492 EdSetHelpMes(120, 2, -1, args, -1);
2495void EdEditMoveHelpMes() {
2511 EdSetHelpMes(130, 2, -1, 0, -1);
2516void EdFishingWalkHelpMes(
int bait) {
2522 int args[4] = {-1, -1, -1, -1};
2524 args[0] = bait + 100;
2531 EdSetHelpMes(mes_no, 2, 9, args, -1);
2534void EdFishingAngleHelpMEs(
int bait) {
2537void EdFishingLostEsaMes() {
2540 EdSetHelpMes(210, 180, 8, 0, -1);
2545void EdItemGetMes(
int item,
int kind,
int attachment,
int duration) {
2546 ItemGetMes(item, attachment, duration, 1);
2553static int ibox_open_flag;
2554static int ibox_open_close_flag;
2555static int ibox_open_cnt;
2558static sceVu0FVECTOR ibox_pos;
2559static sceVu0FVECTOR ibox_rot;
2562 ibox_open_close_flag = 0;
2566 ibox_base_frame = base;
2569void EdSetOpenItemBox(
float *position,
float *rotation) {
2572 ibox_open_close_flag = 0;
2574 sceVu0CopyVector(ibox_pos, position);
2575 sceVu0CopyVector(ibox_rot, rotation);
2579void EdStepOpenItemBox() {
2584 if (ibox_open_flag == 0 && ibox_open_close_flag == 0) {
2590 if (ibox_open_cnt < 0) {
2592 ibox_open_close_flag = 0;
2596 if (ibox_frame == 0) {
2600 ibox_frame->SetPosition(ibox_pos);
2601 ibox_frame->SetRotation(ibox_rot[0], ibox_rot[1], ibox_rot[2]);
2602 lid = ibox_frame->SearchFrame(
"top");
2605 if (ibox_open_flag) {
2608 if (ibox_open_cnt <= 20) {
2612 open_angle = -(HALF_PI - HALF_PI * (float) (ibox_open_cnt - 20) / 20.0f);
2613 lid->SetRotation(open_angle, 0.0f, 0.0f);
2615 if (ibox_open_cnt >= 6) {
2616 close_angle = HALF_PI - HALF_PI * (float) (ibox_open_cnt - 5) / 5.0f;
2618 close_angle = HALF_PI * (float) ibox_open_cnt / 5.0f;
2621 lid->SetRotation(0.2f * -close_angle, 0.0f, 0.0f);
2626const char EditCharaFileP47a[] =
"p47a";
2627const char EditCharaFileP12a[] =
"p12a";
2628const char EditCharaFileP07a[] =
"p07a";
2629const char EditCharaFileP01a[] =
"p01a";
2630const char EditCharaFileP13a[] =
"p13a";
2631const char EditCharaFileP06a[] =
"p06a";
2632const char EditCharaFileP09a[] =
"p09a";
2633const char EditCharaFileP08a[] =
"p08a";
2634const char EditCharaFileP05a[] =
"p05a";
2635const char EditCharaFileP03a[] =
"p03a";
2636const char EditCharaFileP04a[] =
"p04a";
2637const char EditCharaFileP02a[] =
"p02a";
2638const char EditCharaFileP10a[] =
"p10a";
2639const char EditCharaFileP14a[] =
"p14a";
2640const char EditCharaFileC04cat[] =
"c04cat";
2641const char EditCharaFileNone[] =
"";
2642const char EditCharaFileP27a[] =
"p27a";
2643const char EditCharaFileP30a[] =
"p30a";
2644const char EditCharaFileP29a[] =
"p29a";
2645const char EditCharaFileP28a[] =
"p28a";
2646const char EditCharaFileP31a[] =
"p31a";
2647const char EditCharaFileP25a[] =
"p25a";
2648const char EditCharaFileP59a[] =
"p59a";
2649const char EditCharaFileP24a[] =
"p24a";
2650const char EditCharaFileP26a[] =
"p26a";
2651const char EditCharaFileP23a[] =
"p23a";
2652const char EditCharaFileP21a[] =
"p21a";
2653const char EditCharaFileP22a[] =
"p22a";
2654const char EditCharaFileP49a[] =
"p49a";
2655const char EditCharaFileP35a[] =
"p35a";
2656const char EditCharaFileP37a[] =
"p37a";
2657const char EditCharaFileP36a[] =
"p36a";
2658const char EditCharaFileP41a[] =
"p41a";
2659const char EditCharaFileP39a[] =
"p39a";
2660const char EditCharaFileP33a[] =
"p33a";
2661const char EditCharaFileP40a[] =
"p40a";
2662const char EditCharaFileP43a[] =
"p43a";
2663const char EditCharaFileP45a[] =
"p45a";
2664const char EditCharaFileP44a[] =
"p44a";
2665const char EditCharaFileP34a[] =
"p34a";
2666const char EditCharaFileP42a[] =
"p42a";
2667const char EditCharaFileP48a[] =
"p48a";
2668const char EditCharaFileP46a[] =
"p46a";
2669const char EditCharaFileP50a[] =
"p50a";
2670const char EditCharaFileP51a[] =
"p51a";
2671const char EditCharaFileP52a[] =
"p52a";
2672const char EditCharaFileP53a[] =
"p53a";
2673const char EditCharaFileP54a[] =
"p54a";
2674const char EditCharaFileP55a[] =
"p55a";
2675const char EditCharaFileP56a[] =
"p56a";
2676const char EditCharaFileP57a[] =
"p57a";
2677const char EditCharaFileP58a[] =
"p58a";
2678const char EditCharaFileP64a[] =
"p64a";
2679const char EditCharaFileP62a[] =
"p62a";
2680const char EditCharaFileP63a[] =
"p63a";
2681const char EditCharaFileP61a[] =
"p61a";
2682const char EditCommandScn[] =
"SCN";
2683const char EditCommandLightNo[] =
"LIGHT_NO";
2684const char EditCommandAmbient[] =
"AMBIENT";
2685const char EditCommandLightC[] =
"LIGHT_C";
2686const char EditCommandFog[] =
"FOG";
2687const char EditCommandBgCol[] =
"BG_COL";
2688const char EditCommandBgCol2[] =
"BG_COL2";
2689const char EditCommandDof[] =
"DOF";
2690const char EditCommandCd[] =
"CD";
2691const char EditCommandGrdImg[] =
"GRD_IMG";
2692const char EditCommandBldImg[] =
"BLD_IMG";
2693const char EditCommandSkyImg[] =
"SKY_IMG";
2694const char EditCommandSunImg[] =
"SUN_IMG";
2695const char EditCommandWaterImg[] =
"WATER_IMG";
2696const char EditCommandFireImg[] =
"FIRE_IMG";
2697const char EditCommandFlerImg[] =
"FLER_IMG";
2698const char EditCommandImg[] =
"IMG";
2699const char EditCommandSky[] =
"SKY";
2700const char EditCommandSun[] =
"SUN";
2701const char EditCommandGround[] =
"GROUND";
2702const char EditCommandBuild[] =
"BUILD";
2703const char EditCommandWater[] =
"WATER";
2704const char EditCommandWaterSurface[] =
"WATER_SURFACE";
2705const char EditCommandWaterShake[] =
"WATER_SHAKE";
2706const char EditCommandEditarea[] =
"EDITAREA";
2707const char EditCommandBldParts[] =
"BLD_PARTS";
2708const char EditCommandGrdParts[] =
"GRD_PARTS";
2709const char EditCommandPartsInfo[] =
"PARTS_INFO";
2710const char EditCommandRoadParts[] =
"ROAD_PARTS";
2711const char EditCommandRoad[] =
"ROAD";
2712const char EditCommandRiverParts[] =
"RIVER_PARTS";
2713const char EditCommandRiver[] =
"RIVER";
2714const char EditCommandBridgeParts[] =
"BRIDGE_PARTS";
2715const char EditCommandLakeParts[] =
"LAKE_PARTS";
2716const char EditCommandOnRiverParts[] =
"ON_RIVER_PARTS";
2717const char EditCommandObjAnime[] =
"OBJ_ANIME";
2718const char EditCommandFire[] =
"FIRE";
2719const char EditCommandFlame[] =
"FLAME";
2720const char EditCommandBright[] =
"BRIGHT";
2721const char EditCommandObjectTimer[] =
"OBJECT_TIMER";
2722const char EditCommandEntrance[] =
"ENTRANCE";
2723const char EditCommandMapjump[] =
"MAPJUMP";
2724const char EditCommandPeople[] =
"PEOPLE";
2725const char EditCommandTimeTableNo[] =
"TIME_TABLE_NO";
2726const char EditCommandTimeTable[] =
"TIME_TABLE";
2727const char EditCommandTimeStop[] =
"TIME_STOP";
2728const char EditCommandSkyFollow[] =
"SKY_FOLLOW";
2729const char EditCommandShadowLevel[] =
"SHADOW_LEVEL";
2730const char EditCommandEditareaRect[] =
"EDITAREA_RECT";
2731const char EditCommandBgmNo[] =
"BGM_NO";
2732const char EditCommandSoundSet[] =
"SOUND_SET";
2733const char EditCommandReverbe[] =
"REVERBE";
2734const char EditCommandMotionParts[] =
"MOTION_PARTS";
2735const char EditCommandPeople2[] =
"PEOPLE2";
2736const char EditCommandSeAmbientOff[] =
"SE_AMBIENT_OFF";
2737const char EditCommandWind[] =
"WIND";
2738const char EditCommandTalkEvent[] =
"TALK_EVENT";
2739const char EditCommandCharaAmbient[] =
"CHARA_AMBIENT";
2740const char EditCommandTalkRot[] =
"TALK_ROT";
2741const char EditCommandTalkDir[] =
"TALK_DIR";
2742const char EditCommandPeopleList[] =
"PEOPLE_LIST";
2743const char EditFuncNameTest[] =
"test";
2745void EdDrawOpenItemBox() {
2746 sceVu0FVECTOR ambient;
2747 sceVu0FVECTOR saved_ambient;
2749 if (ibox_open_flag == 0 && ibox_open_close_flag == 0) {
2754 ibox_frame->SetPosition(ibox_pos);
2755 ibox_frame->SetRotation(ibox_rot[0], ibox_rot[1], ibox_rot[2]);
2758 MGGetAmbient(ambient);
2759 sceVu0CopyVector(saved_ambient, ambient);
2761 if (ibox_open_cnt < 20) {
2762 ambient[3] = 128.0f * (float) ibox_open_cnt / 20.0f;
2765 if (ibox_open_flag) {
2766 MGSetAmbient(ambient);
2770 MGSetAmbient(saved_ambient);
2773int frame_image_flag;
2783void EdSaveFrameImage(
CTexture texture) {
2784 frame_image_flag = 1;
2785 frame_image_tex = texture;
2788void EdSaveFrameImageTask() {
2789 if (frame_image_flag != 0) {
2790 MGMoveFrameBuffImage((
sceGsTex0 *) &frame_image_tex.
tex0, 0, 0, 0);
2791 frame_image_tex.Initialize();
2792 frame_image_flag = 0;
2796void EdSaveFrameImageInit() {
2797 frame_image_tex.Initialize();
2798 frame_image_flag = 0;
2802 if (message == NULL) {
2808 if (GamePad.
Down(PAD_CIRCLE | PAD_CROSS) != 0) {
2811 if (message->
State() == CLSMES_SHOWN) {
2820 message->
fade = 0.0f;
2836 for (
int i = 0; i < 10; i++) {
2840 for (
int i = 0; i < 8; i++) {
2854 for (
int i = 0; i < 10; i++) {
2862 if (message->
State() == CLSMES_PAGE_WAIT) {
2872float ConvertTime(
float hour) {
2883float InvertTime(
float time) {
void SetRef(CFrame *parent, float x, float y, float z)
virtual void GetPosition(float *out_position)
sceVu0FVECTOR ambient_offset
virtual void SetRotation(float x, float y, float z)
void TextureAnime(int step)
virtual void DrawShadow()
virtual void SetPosition(float x, float y, float z)
int GetItem(int item_id, int qty)
int SearchItemIndexNo(int item_id)
int CheckItemGet(int item_id)
CMapParts fixed_parts[64]
int GetCompEvent(int index)
void SetCompEvent(int index, int completed)
void MenuModeOn(int threshold)
void GetPosition(float *out_position)
EDIT_EFFECT_INFO * effect[MAP_PARTS_EFFECT_MAX]
s32 effect_on[MAP_PARTS_EFFECT_MAX]
virtual void GetRotation(float *out_rotation)
SV_GRD_NPC * GetGrdNPCData(int map_no, int npc_no)
CDngStatusData * GetDngStatus()
int QuestDungeon(int dungeon_no, int add)
int GetGameFlag(int flag_no)
int SetMapFlag(int map_no, int flag_no, int value)
int SetGameFlag(int flag_no, int value)
int GetGameIntFlag(int flag_no)
SV_GEORAMA_DATA * GetGrdData(int georama_no)
int GetMapFlag(int map_no, int flag_no)
int SetGameIntFlag(int flag_no, int value)
MES_LINE_POS line_pos[10]
int MakeMesWin(int mes_no)
@ ED_MENU_FISHING_EXCHANGE
@ MAP_PARTS_SUBTYPE_RIVER
CFrameVu1 * item_frame[1]