1#pragma helper_mask_gpr 0x30
2#pragma helper_mask_fpr 0x1000
3#pragma name_counter 414
6#pragma argument_flag_ones 118, 119, 120, 243, 245, 256, 263, 265, 275, 277
7#pragma argument_flag_ones 287, 289, 299, 301, 312, 344, 360, 371, 433, 434
8#pragma argument_flag_ones 435, 596, 630, 636, 784, 793, 864, 868, 930, 1014
9#pragma argument_flag_ones 1018, 1038, 1082, 1122, 1223, 1358, 1359, 1360, 1361, 1389
10#pragma argument_flag_ones 1390, 1507, 1512, 1538, 1546, 1547, 1551, 1564, 1632, 1633
11#pragma argument_flag_ones 1634, 1635, 1710, 1722, 1742, 1744, 1792, 1799, 1806, 1813
12#pragma argument_flag_ones 1820, 1827, 1834, 1841, 1848, 1855, 1862, 1869, 1876, 1903
13#pragma argument_flag_ones 1905, 1920, 1922, 1931, 1933, 1953, 2204, 2205, 2206, 2341
14#pragma argument_flag_ones 2342, 2343, 2348, 2405, 2684, 2825, 2879, 2889, 2917, 2932
15#pragma argument_flag_ones 2948, 2950, 2952, 2967, 2977, 3091, 3142, 3144, 3177, 3179
16#pragma argument_flag_ones 3182, 3192, 3377, 3605, 3613, 3621, 3629, 3646, 3652, 3760
17#pragma argument_flag_ones 3790, 3792, 3793, 3795, 3796, 3797, 3800, 3802, 3803, 3805
18#pragma argument_flag_ones 3806, 3807, 3810, 3812, 3813, 3815, 3816, 3817, 3820, 3822
19#pragma argument_flag_ones 3823, 3825, 3826, 3827, 3830, 3832, 3833, 3835, 3836, 3837
20#pragma argument_flag_ones 3840, 3842, 3843, 3845, 3846, 3847
22#pragma argument_flag_ones 0, 207, 208, 215, 626
42#include "collision.hpp"
43#include "dataalloc.hpp"
46#include "debugfont.hpp"
47#include "dngstatusdata.hpp"
51#include "editarea.hpp"
52#include "editground.hpp"
53#include "editloop.hpp"
54#include "editloop3.hpp"
55#include "editmapscript.hpp"
58#include "effectgroup.hpp"
60#include "framevu1.hpp"
61#include "gamemode.hpp"
63#include "mainselect.hpp"
67#include "menu_misc.hpp"
68#include "menuitemstep.hpp"
70#include "npcharacter.hpp"
71#include "objanime.hpp"
74#include "runeffect.hpp"
82void BtSetMapJumpFloor(
int floor);
84#include "battlemenu.hpp"
85#include "editmenu.hpp"
86#include "effectmacro.hpp"
90#include "menu_draw.hpp"
94#include "weaponlevelup.hpp"
99u_long128 *EdNPCReadBuffer;
102int EdInteriorPartsNo;
104int EdInteriorDoorSound;
105int EdInteriorStartEvent;
122char EditDataDir[0x100];
123char EditMapName[0x20];
124char EdInteriorName[0x20];
130static int D_002A2844;
132static int D_002A2848;
134static int D_002A284C;
137char *EdSystemEventData;
140int EdDrawOffMapShadow;
141int EdThunderEffectFlag;
158int goto_cmp_event_level;
159int change_time_event;
163int edit_mode_grd_draw;
165int edit_mode_lighting;
170int start_system_event;
207int DrawPartsNameCount;
226#pragma name_counter 372
237#pragma name_counter 471
243sceVu0FVECTOR fix_chara_pos;
245sceVu0FVECTOR fix_chara_rot;
246sceVu0FVECTOR fix_camera_pos;
247char interior_map_name[0x40];
248float NowPartsCursorPos[4];
251sceVu0FVECTOR NowCursorPos;
252sceVu0FVECTOR NextCursorPos;
268int camera_dist_mode = 1;
269int NowSelectParts = -1;
270CFrame *ECursorFrame = &ecursorframe;
271int PartsNameNum = -1;
278u_int *SearchPTS(u_int *archive,
char *name);
279int LoadEditMapData(
EDIT_MAP_INFO *info,
char *name,
int kind);
280void LoadObjectParts();
281void LoadGroundData();
283int CheckEditToWalk(
float *position);
284int GotoInterior(
char *name,
int entrance,
int direction,
ED_EVENT_PARAM *param,
int start_event);
285void MoveEditCursor();
286void VillagerCollision();
293void EditPartsObjectOnOff();
296void PlayAmbient(
float volume);
309void GetLanguageName(
char *name) {
310 if (LanguageCode > LANG_JAPANESE) {
311 sprintf(name,
"_%d", LanguageCode);
320void GetEditDataDir(
char *name) {
321 strcpy(name, EditDataDir);
328 char common_path[0x40];
334 EdScriptBuffer.
used = 0;
335 EdEventData = (
char *) (EdScriptBuffer.
base + EdScriptBuffer.
used * 16);
336 sprintf(language,
"_%d.mes", LanguageCode);
337 GetEditDataDir(common_path);
338 GetEditDataDir(map_path);
339 strcat(common_path,
"event.stb");
340 strcat(map_path, EditMapName);
341 strcat(map_path, language);
343 if (LoadFile2(common_path, EdEventData, &size, 0) != 0) {
344 EdScriptBuffer.Alloc((size >> 4) + 1);
345 map_script = (
char *) (EdScriptBuffer.
base + EdScriptBuffer.
used * 16);
347 if (LoadFile2(map_path, map_script, &size, 0) != 0) {
348 EdScriptBuffer.Alloc((size >> 4) + 1);
353 EdSetEventScript(EdEventData, map_script, &EdScriptBuffer);
358 EdScriptBuffer.Align64();
359 EdSystemEventData = (
char *) (EdScriptBuffer.
base + EdScriptBuffer.
used * 16);
361 if (LoadFile2(
"gedit/system/event.stb", EdSystemEventData, &size, 0) != 0) {
362 EdScriptBuffer.Alloc((size >> 4) + 1);
366 EdSystemEventData = NULL;
372static int RunEvent(
int event_no,
CCamera *camera) {
373 sceVu0FVECTOR position;
374 sceVu0FVECTOR reference;
376 if (start_event_no > 0 && simple_event == 0) {
380 if (camera != NULL) {
382 camera->
GetRef(reference);
383 EventCamera.
SetPos(position);
384 EventCamera.
SetRef(reference);
389 start_event_no = event_no;
396static void RunSystemEvent(
int event_no,
CCamera *camera) {
397 sceVu0FVECTOR position;
398 sceVu0FVECTOR reference;
402 if (start_system_event <= 0) {
403 if (camera != NULL) {
405 camera->
GetRef(reference);
406 EventCamera.
SetPos(position);
407 EventCamera.
SetRef(reference);
411 start_system_event = event_no;
418int FadeOutToEvent(
int event_no,
int level) {
419 if (EdDebugEventEnable == 0) {
423 if (goto_cmp_event != 0) {
424 if (level > goto_cmp_event_level) {
430 goto_cmp_event = event_no;
431 goto_cmp_event_level = level;
433 EdFadeOut(60, zero, zero, zero);
443 if (map_no < TOWN_COUNT && map_no >= 0) {
444 pEditGround->
Save(NowEditMap, SaveData);
445 EditPartsInfo.
Save(NowEditMap, SaveData);
450 if (info != NULL && info->
time_stop == 0) {
459 if (MapNo < TOWN_COUNT) {
460 EditPartsInfo.
Load(NowEditMap, SaveData, 0);
461 pEditGround->
Load(NowEditMap, SaveData);
464 EditPartsObjectOnOff();
466 NowTime = 0.01f * (float) ((
int) (100.0f * SaveData->
GetNowTime()) % 1200);
476 MGSetBGColor(0.0f, 0.0f, 0.0f, 128.0f);
479 while (ReadBGSync() != 0) {
493 MGScisioringForce(0);
495 EdGetFadeColor(fade);
502void InitWorkBuffer() {
503 int quads = EdNPCBuffer.
used;
504 u_char *free_start = EdNPCBuffer.
base + quads * 16;
505 quads = EdNPCBuffer.
limit - quads;
506 EdVillagerBuffer.
base = free_start;
507 EdVillagerBuffer.
limit = quads;
508 EdVillagerBuffer.
used = 0;
509 free_start = (u_char *) ((((
int) free_start >> 6) + 1) << 6);
510 EdWorkBuffer.
base = free_start;
511 EdWorkBuffer.
limit = quads - 4;
512 EdWorkBuffer.
used = 0;
513 free_start = (u_char *) read_buffer;
514 EdMenuBuffer.
base = free_start - 0x180000;
515 EdMenuBuffer.
limit = 0x3A2E0;
516 EdMenuBuffer.
used = 0;
522int run_event_check() {
523 if (goto_dungeon != 0 || goto_menu != 0 || goto_cmp_event != 0 || debug_menu_mode != 0 || EdSystemMesCheck() != 0 || EdCheckItemOver() != 0) {
534 if (run_event_check() != 0) {
538 if (key_lock != 0 || loop_counter < 2) {
549 if (run_event_check() != 0) {
556 EdSetKeyMode(0xFFFF);
559 draw_npc_cursor =
GameMode == ED_MODE_WALK;
577int EdGetMapFlag(
int flag_no) {
588int EdSetMapFlag(
int flag_no,
int value) {
593 return SaveData->
SetMapFlag(MapNo, flag_no, value);
599void PauseOffCheck() {
600 if (run_event_check() != 0) {
601 goto_return_menu = 0;
609 return exit_loop = 1;
630 return InvertTime(NowTime);
636void EdSetClock(
float time) {
637 if (time < 0.0f || !(time <= 24.0f)) {
641 NowTime = ConvertTime(time);
647void EdInitMesParam() {
662 EditMes1.
style = MES_EDGE_NONE;
665 float fade_speed = 0.1f;
670 EditEventMes1.
rows = 4;
674 EditEventMes1.
style = MES_EDGE_NONE;
680 EditSystemMes.
Preset(MES_PRESET_SYSTEM);
688 EditSystemMes.
rows = 1;
690 EditSystemMes.
style = MES_EDGE_TABLE;
692 EditNameMes.
Preset(MES_PRESET_NAME);
694 EditNameMes.
rows = 4;
697 EditNameMes.
style = MES_EDGE_TABLE;
703int EditInit(
void *param) {
705 char save_path[0x80];
709 oldGameMode = ED_MODE_NONE;
712 PlayTimeCountFlag(1);
714 EdSetKeyMode(0xFFFF);
722 sprintf(EditMapName,
"e0%d", map_no + 1);
728 int interior = map_id - 10;
731 sprintf(EditMapName,
"s0%d", interior);
733 sprintf(EditMapName,
"s%d", interior);
737 if (NowEditMap == 99) {
738 strcpy(EditDataDir,
"");
741 strcpy(EditDataDir,
"gedit/");
742 strcat(EditDataDir, EditMapName);
743 strcat(EditDataDir,
"/");
748 InitializeDataBuffer();
749 SetDataBuffer(&VisualData, 100);
750 SetDataBuffer(&EtcDataBuffer, 40000);
752 SetDataBuffer(&EdScriptBuffer, 20000);
754 SetDataBuffer(&EdScriptBuffer, 16000);
756 SetDataBuffer(&EPartsInfoBuff, 8000);
757 SetDataBuffer(&CharaBuffer, 115000);
758 SetDataBuffer(&TextureData, 10);
759 SetDataBuffer(&MotionData, 7900);
760 SetDataBuffer(&EdMesBuffer, 13000);
761 SetDataBuffer(&DataBuffer__2, 1216000);
762 EdNPCBuffer.
base = DataBuffer__2.
base + DataBuffer__2.
used * 16 + 0xCF8500;
763 EdNPCBuffer.
limit = 326000;
764 EdNPCBuffer.
used = 0;
765 SetPacketReadBuffer(30000, 140000);
766 EPartsInfoBuff.
used = 0;
767 EditArea =
new ((u_long128 *) EtcDataBuffer.Alloc(0x81C))
CEditArea[4];
768 pEditGround =
new ((u_long128 *) EtcDataBuffer.Alloc(0x2097))
CEditGround;
769 ObjParts =
new ((u_long128 *) EtcDataBuffer.Alloc(0x3F1))
CMapParts[24];
770 MotionParts =
new ((u_long128 *) EtcDataBuffer.Alloc(0x470))
CCharacter[4];
771 RiverParts =
new ((u_long128 *) EtcDataBuffer.Alloc(0x2B0))
CMapParts[16];
772 RoadParts =
new ((u_long128 *) EtcDataBuffer.Alloc(0x102))
CMapParts[6];
773 float near_clip = 10.0f;
774 MGSetRenderInfo(800.0f, near_clip, 65535.0f);
775 GetEditDataDir(map_path);
776 strcat(map_path,
"mapinfo.cfb");
780 if (interior_test == 0) {
781 LoadEditMapData(EditMapInfo, map_path, MapNo);
783 LoadEditMapData(EditMapInfo,
"gedit/interior/mapinfo.cfg", MapNo);
784 LoadFile(
"gedit/interior/interior.cfg", read_buffer, &size);
792 text = (u8 *) read_buffer;
798 while (c = text[read_pos++], (count < read_pos) ? 0 : 1) {
799 if (c >=
'a' && c <
'{') {
800 interior_name[row][column] = c;
805 if (c >=
'0' && c <
':') {
806 interior_name[row][column] = c;
811 if (c ==
'/' || c ==
'_') {
812 interior_name[row][column] = c;
818 interior_name[row][column] =
'\0';
828 interior_name[row][0] =
'\0';
831 SndSetReadBuffer(read_buffer);
833 if (StartEventNo < 0) {
834 int bgm = EditMapInfo->
bgm_no;
837 if (old_main_mode == 5) {
856 if (SndGetNowSetNo() < 0) {
860 SndSoundLoad(sound_set);
868 EdEventInfo.
npcs = EdVillager;
870 EdEventInfo.
messages[0] = &EditMes1;
880 EdEventInfo.
messages[0] = &EditMes1;
881 EdEventInfo.
messages[1] = &EditEventMes1;
882 EdEventInfo.
messages[4] = &EditSystemMes;
887 now_fog = EditMapInfo->
fog[0];
899 if (interior_test == 0) {
904 camera_dist_mode = 1;
905 NowCamera = &MainCamera;
906 EditMenuStatus.
mode = EDIT_MENU_MODE_CLOSED;
907 EditMenuStatus.
parts = -1;
911 DebugFont__3.
width = 280;
912 DebugFont__3.
height = SCREEN_HALF_HEIGHT;
913 DebugFont__3.
alpha = 64;
914 EdDSetFont(&DebugFont__3);
916 if (interior_test == 0) {
917 if (old_main_mode != 7 || main_select_padrup != 0) {
920 GetEditDataDir(save_path);
921 strcat(save_path,
"gdata0.edt");
922 int loaded = LoadFile2(save_path, read_buffer, NULL, 0);
924 for (
int i = 0; i < 22; i++) {
928 for (
int j = 0; j < 6; j++) {
933 for (
int i = 0; i < 36; i++) {
938 short element_table[40] = {
939 0, 3, 12, 0, 11, 4, 1, 0, 16, 2, 0, 5, 17, 6, 1, 10, 2, 2, 0, 15,
940 1, 1, 1, 2, 1, 2, 12, 3, 14, 7, 8, 9, 1, 2, 1, 8, 13, 0, 0, -1,
946 pEditGround->
Load((
char *) read_buffer);
951 for (
int i = 0; i < 128; i++) {
957 EditPartsObjectOnOff();
966 int free_start = (int) DataBuffer__2.
base + (
int) (DataBuffer__2.
used * 16);
967 int free_quads = DataBuffer__2.
limit - DataBuffer__2.
used;
969 if (free_quads < 326000) {
970 printf(
"Allocation error!!\n");
973 int misalign = free_start & 0x3F;
975 if (free_start < 0 && misalign != 0) {
980 free_start += ((0x40 - misalign) >> 4) * 16;
983 EdNPCBuffer.
base = (u_char *) free_start;
984 EdNPCBuffer.
limit = free_quads - 4;
985 EdNPCBuffer.
used = 0;
986 EdVillagerBuffer.
base = (u_char *) free_start;
987 EdVillagerBuffer.
limit = free_quads - 4;
988 EdVillagerBuffer.
used = 0;
989 EdNPCReadBuffer = (u_long128 *) (EdNPCBuffer.
base + EdNPCBuffer.
used * 16 + (free_quads >> 1) * 16);
990 int read_misalign = (int) EdNPCReadBuffer & 0x3F;
992 if ((
int) EdNPCReadBuffer < 0 && read_misalign != 0) {
993 read_misalign -= 0x40;
996 if (read_misalign != 0) {
997 EdNPCReadBuffer += (0x40 - read_misalign) >> 4;
1000 EdCreateVillagerTable(EditMapInfo);
1001 EdInitVillagerControl();
1002 EdInitVillagerTable(NowTime, EditMapInfo);
1003 EdLoadMainChara(
"chara/c01d.chr",
"info.cfg", &CharaBuffer);
1004 sceVu0FVECTOR start_position = {0.0f, 0.0f, 0.0f, 1.0f};
1005 sceVu0FVECTOR start_rotation = {0.0f, 0.0f, 0.0f, 0.0f};
1008 EdGetFadeColor(fade);
1009 EdFadeIn(128, (
float) (
int) fade[0], (
float) (
int) fade[1], (
float) (
int) fade[2]);
1012 float yaw = start_rotation[1] - PI_SHORT;
1014 if (yaw < PI_SHORT) {
1019 MainCamera.
SetFollow(start_position[0], 14.0f + start_position[1], start_position[2]);
1020 MainCamera.
Step(-1);
1021 EffectTable__3 = (
CEffect *) EtcDataBuffer.Alloc(0x800);
1022 EdEffectGroup.Initialize(EffectTable__3, 128);
1023 EdEffectGroup.Clear();
1027 EditMes1.
tex_buff = MesWinTexBuff_01;
1028 EditEventMes1.
tex_buff = MesWinTexBuff_02;
1029 short *talk_mes = (
short *) (EdMesBuffer.
base + EdMesBuffer.
used * 16);
1030 char mes_path[0x40];
1031 char sys_path[0x40];
1032 char language[0x10];
1033 GetEditDataDir(sys_path);
1034 GetEditDataDir(mes_path);
1035 strcat(mes_path, EditMapName);
1036 strcat(mes_path,
"talk");
1037 GetLanguageName(language);
1038 strcat(mes_path, language);
1039 strcat(mes_path,
".mes");
1040 strcat(sys_path,
"fconv.bin");
1042 if (LoadFile2(mes_path, talk_mes, &mes_size, 0) == 0 && LoadFile2(sys_path, talk_mes, &mes_size, 0) == 0) {
1043 LoadFile(
"gedit/e01/fconv.bin", talk_mes, &mes_size);
1046 EdMesBuffer.Alloc((mes_size >> 4) + 1);
1048 EdMesBuffer.Align64();
1049 short *system_mes = (
short *) (EdMesBuffer.
base + EdMesBuffer.
used * 16);
1051 sprintf(mes_path,
"gedit/system/editsys%s.mes", language);
1052 LoadFile(mes_path, system_mes, &mes_size);
1054 LoadFile(
"gedit/system/editsys.bin", system_mes, &mes_size);
1056 EdMesBuffer.Alloc((mes_size >> 4) + 1);
1057 EditSystemMes.
tex_buff = MesWinTexBuff_01;
1059 EditSystemMes.
SetBuff(system_mes);
1063 MonsterNameInit(&name_mes, system_mes, MesWinTexBuff_11);
1065 EditNameMes.
tex_buff = MesWinTexBuff_11;
1066 EditNameMes.
SetBuff(system_mes);
1067 EdMesBuffer.Align64();
1068 short *window_mes = (
short *) (EdMesBuffer.
base + EdMesBuffer.
used * 16);
1069 char window_path[0x40] =
"meswin/system14";
1070 int language_no = LanguageCode;
1072 if (language_no > 0) {
1073 sprintf(window_path,
"meswin/system14_%d", language_no);
1076 strcat(window_path,
".mes");
1078 if (LoadFile2(window_path, window_mes, &mes_size, 0) == 0) {
1079 LoadFile(
"meswin/system14e.bin", window_mes, &mes_size);
1082 EdMesBuffer.Alloc((mes_size >> 4) + 1);
1091 EdInitOpenItemBox(TreasureCursorOpen, TreasureCursor);
1100 draw_npc_cursor = 0;
1102 edit_mode_grd_draw = 0;
1104 edit_mode_lighting = 0;
1107 goto_cmp_event_level = -1;
1108 change_time_event = 0;
1109 start_event_no = -1;
1110 start_system_event = -1;
1112 EdBeforeInBgmNo = -1;
1115 EdDrawOffMapShadow = 0;
1116 EdThunderEffectFlag = 1;
1118 debug_menu_mode = 0;
1119 EdSaveFrameImageInit();
1121 BtSetMapJumpFloor(-1);
1123 EdInitThunderEffect();
1126 int event_no = StartEventNo;
1129 RunEvent(128, NULL);
1131 RunEvent(event_no, NULL);
1136 static int debug_flag_set = 0;
1138 if (debug_flag_set == 0) {
1139 EdDebugCameraFlag = 0;
1140 EdDebugMoveFlag = 0;
1154 for (
int category = 0; category < 10; category++) {
1169 goto_return_menu = 0;
1171 if (EdPadDown(0x800, 4) != 0) {
1172 goto_return_menu = 1;
1175 if (MapNo < TOWN_COUNT && loop_counter == 60 &&
GameMode == ED_MODE_WALK) {
1179 static int end_count = -1;
1182 if (EdCheckViewMode() != 0) {
1183 MGSetRenderInfo(800.0f, 4.0f, 0x20000 - 2);
1184 MGScisioringForce(1);
1186 MGSetRenderInfo(800.0f, 5.0f, 0x20000 - 2);
1187 MGScisioringForce(0);
1191 EdExchangeInfo.
player = Chara;
1192 EdExchangeInfo.
ground = pEditGround;
1196 sceVif1PkCall(Vif1Packet, (u_long128 *) Vu_prog0f, 0);
1214 int interior_result = EditInLoop();
1216 if (interior_result != 0) {
1217 if (interior_result == 0x63) {
1229 MGFillBox(
CRect_i_(0, 0, 0x2800, SCREEN_HALF_HEIGHT * 16), 0, 0, 0, 0x80);
1231 TexManager.DeleteTextureBlock(0xF);
1232 EdNPCBuffer.
used = 0;
1233 EdVillagerBuffer.
used = 0;
1235 EdSelectVillager(EdVillagerInfo, NowTime, EditMapInfo);
1236 EdInitVilager(EdVillagerInfo, EdExchangeInfo.
ground, NULL);
1237 EdInitVilagerPosition(EdVillager, EdVillagerInfo, pEditGround, NULL);
1240 MGFillBox(
CRect_i_(0, 0, 0x2800, SCREEN_HALF_HEIGHT * 16), 0, 0, 0, 0x80);
1244 if (EdSearchEvent(&entry, EdInteriorName, EdInteriorJumpID, NowTime) != 0) {
1245 sceVu0CopyVector(fix_chara_pos, entry.
position);
1246 sceVu0CopyVector(fix_chara_rot, entry.
rotation);
1247 sceVu0CopyVector(fix_camera_pos, entry.
camera_pos);
1252 float turn = fix_chara_rot[1];
1256 if (!(turn <= PI_SHORT)) {
1257 turn -= TWO_PI_SHORT;
1260 Chara->
SetRotation(fix_chara_rot[0], turn, fix_chara_rot[2]);
1262 MainCamera.
SetPos(fix_camera_pos);
1263 MainCamera.
SetRef(fix_chara_pos[0], 14.0f + fix_chara_pos[1], fix_chara_pos[2]);
1264 MainCamera.
Step(-1);
1266 sceVu0FVECTOR direction;
1268 MainCamera.
GetDir(direction);
1278 PlayAmbient(NowTime);
1279 EdSetAmbientVol(1.0f);
1281 if (EdBeforeInBgmNo >= 0) {
1282 SndBgmLoad(EdBeforeInBgmNo);
1287 EdFadeIn(0x40, 0.0f, 0.0f, 0.0f);
1290 if (EdInteriorDoorSound >= 0) {
1291 SndSetCamera((
CCamera *) &MainCamera);
1292 EdDoorCloseSe(EdInteriorDoorSound, fix_chara_pos);
1295 if (MapNo < TOWN_COUNT) {
1296 EdWalkToEditMes(60);
1309 if (interior_test != 0) {
1311 static int select = 0;
1313 static char *menu[64];
1315 for (
int i = 0; i < 64; i++) {
1316 menu[i] = interior_name[i];
1321 for (count = 0; menu[count][0] !=
'\0'; count++) {
1326 if (GamePad.
Down(PAD_DOWN) != 0) {
1330 if (GamePad.
Down(PAD_UP) != 0) {
1338 if (select >= count) {
1348 char *mark[2] = {
" ",
">"};
1352 for (
int i = top; i < top + 14; i++) {
1353 DebugFont__3.
length += sprintf(&DebugFont__3.
text[DebugFont__3.
length],
"%s %s\n", mark[i == select], menu[i]);
1356 TexManager.ReloadTexture(GetVif1Packet(), 0x1F);
1357 DebugFont__3.
Draw();
1359 if (GamePad.
Down(PAD_CIRCLE) != 0) {
1360 float period_time = NowTime / 3.0f;
1361 int period = (int) period_time;
1363 EdMapJump((
int) period_time, menu[select]);
1366 while (ReadBGSync() != 0) {
1369 strcpy(interior_map_name, menu[select]);
1370 EditInInit(NowTime, interior_map_name);
1373 if (GamePad.
On(PAD_SELECT) != 0 && GamePad.
On(PAD_START) != 0) {
1381 case ED_MODE_FISHING:
1386 if (EdCheckViewMode() == 0) {
1387 NowCamera = (
CCamera *) &MainCamera;
1389 NowCamera = (
CCamera *) &ViewCamera;
1392 if (EdCheckViewMode() == 0) {
1398 if (loop_counter > 0) {
1404 if (EdCheckViewMode() == 0) {
1405 NowCamera = (
CCamera *) &MainCamera;
1407 NowCamera = (
CCamera *) &ViewCamera;
1410 if (EdCheckViewMode() == 0) {
1414 if (goto_cmp_event != 0) {
1415 goto_return_menu = 0;
1417 if (EdFadeOutCheck() != 0) {
1418 if (goto_cmp_event < 0) {
1421 RunEvent(goto_cmp_event, NULL);
1422 EdFadeIn(60, 0.0f, 0.0f, 0.0f);
1431 NowCamera = (
CCamera *) &EventCamera;
1434 VillagerCollision();
1437 draw_npc_cursor = 0;
1439 goto_return_menu = 0;
1442 NowCamera = (
CCamera *) &TalkCamera;
1446 draw_npc_cursor = 0;
1449 case ED_MODE_GEORAMA:
1451 NowCamera = (
CCamera *) &EditCamera;
1457 if (goto_cmp_event != 0) {
1458 goto_return_menu = 0;
1460 if (EdFadeOutCheck() != 0) {
1461 RunEvent(goto_cmp_event, NULL);
1462 EdFadeIn(60, 0.0f, 0.0f, 0.0f);
1468 case ED_MODE_DOOR_OPEN:
1469 if (door_open_cnt == 0x9C) {
1470 EdMapJump(EdGetTime(NowTime), interior_map_name);
1473 if (door_open_cnt < 0x9C) {
1477 if (door_open != 0) {
1478 NowCamera = (
CCamera *) &MainCamera;
1486 if (door_open_cnt == 100 && EdInteriorDoorSound >= 0) {
1487 sceVu0FVECTOR chara_pos;
1490 EdDoorOpenSe(EdInteriorDoorSound, chara_pos);
1493 if (door_open_cnt < 0x96 && EdFadeOutCheck() != 0) {
1497 if (door_open_cnt < 0) {
1501 EdSetAmbientVol(0.3f);
1503 EdBeforeInBgmNo = SndGetBgmNo();
1505 if (old_main_mode == 5) {
1506 EdBeforeInBgmNo = 0;
1516 SndBgmFadeOutStop();
1521 MGFillBox(
CRect_i_(0, 0, 0x2800, SCREEN_HALF_HEIGHT * 16), 0, 0, 0, 0x80);
1524 for (
int i = 0; i < 10; i++) {
1525 TexManager.DeleteTextureBlock(i + 0x36);
1528 TexManager.CleanUpBuffer();
1530 while (ReadBGSync() != 0) {
1534 EdSelectVillager(EdVillagerInfo, NowTime, EditMapInfo);
1535 EditInInit(NowTime, interior_map_name);
1538 MGFillBox(
CRect_i_(0, 0, 0x2800, SCREEN_HALF_HEIGHT * 16), 0, 0, 0, 0x80);
1544 case ED_MODE_GEORAMA_MENU:
1545 if (EditMenuLoop() != 0) {
1547 NowSelectParts = -1;
1549 switch (EditMenuStatus.
mode) {
1550 case EDIT_MENU_MODE_PLACE:
1551 NowSelectParts = EditMenuStatus.
parts;
1553 case EDIT_MENU_MODE_MOVE:
1554 NowSelectParts = -1;
1556 case EDIT_MENU_MODE_EVENT:
1557 FadeOutToEvent(EditMenuStatus.
event_no + 0xC8, 0);
1567 TexManager.ReloadTexture(GetVif1Packet(), 0x10);
1568 MenuMapJumpMode = -1;
1569 EditPartsObjectOnOff();
1571 if (EdMenuMode() != 0) {
1575 if (MenuMapJumpMode >= 0) {
1576 MapJump(MenuMapJumpMode, -1);
1578 RunSystemEvent(2, NowCamera);
1579 MenuMapJumpMode = -1;
1582 EdInitVillagerOnOff(EdVillager, EdVillagerInfo, pEditGround);
1587 case ED_MODE_TIME_CHANGE:
1588 if (chg_time_cnt < 0x8C) {
1592 for (
int i = 0; i < 10; i++) {
1593 if (EdVillager[i].CheckDraw() != 0) {
1594 EdVillager[i].
Step();
1600 if (chg_time_cnt == 0x8C) {
1601 EdVillagerBuffer.
used = 0;
1603 EdSelectVillager(EdVillagerInfo, NowTime, EditMapInfo);
1604 EdInitVilager(EdVillagerInfo, pEditGround, EdNPCReadBuffer);
1607 NowCamera = (
CCamera *) &MainCamera;
1623 if (chg_time_cnt < 0) {
1624 while (ReadBGSync() != 0) {
1627 for (
int i = 0x36; i < 0x40; i++) {
1628 TexManager.DeleteTextureBlock(i);
1631 TexManager.CleanUpBuffer();
1633 for (
int i = 0; i < 10; i++) {
1637 u_int *pack = (u_int *) file->
buffer;
1639 EdLoadVillager(pack, EdVillager[i].resource_name, &EdVillager[i], &EdVillagerBuffer);
1643 EdInitVilagerPosition(EdVillager, EdVillagerInfo, pEditGround, NULL);
1646 EdFadeIn(0x40, 0.0f, 0.0f, 0.0f);
1650 case ED_MODE_GEORAMA_MENU_INIT:
1651 case ED_MODE_MENU_INIT:
1657 case ED_MODE_RETURN_MENU_WALK:
1658 case ED_MODE_RETURN_MENU_GEORAMA:
1659 case ED_MODE_MAP_JUMP:
1670 MGSetViewMatrix(view, eye);
1672 if (
GameMode != ED_MODE_GEORAMA &&
GameMode != ED_MODE_GEORAMA_MENU_INIT &&
GameMode != ED_MODE_RETURN_MENU_GEORAMA) {
1673 if (move_count > 0) {
1681 case ED_MODE_GEORAMA:
1683 edit_mode_lighting = 1;
1686 edit_mode_grd_draw = 1;
1693 case ED_MODE_FISHING:
1695 edit_mode_lighting = 0;
1699 if (move_count <= 10) {
1700 edit_mode_grd_draw = 0;
1703 case ED_MODE_TIME_CHANGE:
1704 case ED_MODE_GEORAMA_MENU_INIT:
1705 case ED_MODE_MENU_INIT:
1706 case ED_MODE_RETURN_MENU_WALK:
1707 case ED_MODE_RETURN_MENU_GEORAMA:
1708 case ED_MODE_DOOR_OPEN:
1711 case ED_MODE_GEORAMA_MENU:
1720 sceVu0FVECTOR focus_pos;
1725 sceVu0CopyVector(focus_pos, ECursorFrame->
position);
1728 if ((EdDebugMoveFlag > 0 || MapNo < TOWN_COUNT) && EdPadDown(0x100, 2) != 0 && EdCheckViewMode() == 0 && change_time_event == 0) {
1742 NowCursorRotY = 0.0f;
1744 ECursorFrame->SetPosition(at);
1745 sceVu0CopyVector(NowPartsCursorPos, ECursorFrame->
position);
1746 sceVu0CopyVector(NowCursorPos, ECursorFrame->
position);
1747 sceVu0CopyVector(NextCursorPos, ECursorFrame->
position);
1748 NowFocusParts = NULL;
1749 OldFocusParts = NULL;
1751 DrawPartsNameCount = 30;
1752 EditMenuStatus.
mode = EDIT_MENU_MODE_CLOSED;
1753 EditMenuStatus.
parts = -1;
1754 NowSelectParts = -1;
1759 if (CheckEditToWalk(at) != 0) {
1768 int requested_count = 0;
1772 for (
int i = 0; i < 24; i++) {
1773 if (EditPartsInfo.
request[i] != 0) {
1778 if (requested_count == EditPartsInfo.
parts_max) {
1779 FadeOutToEvent(0x83, 9);
1783 if (MapNo == TOWN_MATATAKI && SaveData->
GetGameFlag(0x14) == 0 && EditPartsInfo.
request[16] != 0) {
1784 FadeOutToEvent(0xB, 0xA);
1788 EdInitVilagerPosition(EdVillager, EdVillagerInfo, pEditGround, &at);
1792 if (move_count > 0) {
1798 if (move_count < 0) {
1804 if (
GameMode == ED_MODE_GEORAMA_MENU_INIT ||
GameMode == ED_MODE_MENU_INIT) {
1805 int next_mode = EdInitModeFinish(NowCamera, TexManager.GetTexture(
"frame_image", -1));
1807 if (next_mode != 0) {
1812 EdSaveFrameImageTask();
1817 if ((EdPadDown(0x10, 2) != 0 || EdPadDown(0x20, 2) != 0) && EdInitMenu(
ED_MENU_EDIT) != 0) {
1818 NowSelectParts = -1;
1819 GameMode = ED_MODE_GEORAMA_MENU_INIT;
1820 SndSePlay(MENU_SOUND_CONFIRM, -1, 0);
1824 if (
GameMode == ED_MODE_WALK && (EdPadDown(0x10, 1) != 0 || goto_menu != 0 || (SystemMesCheck() == 0 && EdCheckItemOver() != 0))) {
1827 if (goto_menu != 0) {
1828 menu_no = goto_menu;
1832 if (EdInitMenu(menu_no) != 0) {
1833 if (EdCheckItemOver() != 0) {
1834 if (loop_counter > 10) {
1835 SndSePlay(MENU_SOUND_CONFIRM, -1, 0);
1838 SndSePlay(MENU_SOUND_CONFIRM, -1, 0);
1845 static int debug_flag = 0;
1849 if (DebugMode != 0) {
1850 if (GamePad.
Down(PAD_L3) != 0) {
1851 debug_flag = !debug_flag;
1854 EdDDebug(debug_flag);
1856 if (debug_menu_mode != 0) {
1860 if (GamePad.
Down(PAD_R3) != 0 || EdDebugRunEventNo > 0) {
1861 debug_menu_mode = 0;
1863 RunEvent(EdDebugRunEventNo, NowCamera);
1868 if (
GameMode != ED_MODE_EVENT && GamePad.
Down(PAD_R3) != 0) {
1871 debug_menu_mode = 1;
1876 sceVu0FVECTOR cursor_pos;
1879 sceVu0CopyVector(cursor_pos, ECursorFrame->
position);
1880 EdDPrintVector(
"pos = ", cursor_pos);
1881 int area = pEditGround->
GetAreaCode(cursor_pos[0], cursor_pos[1], cursor_pos[2]);
1882 sprintf(text,
"area = %d\n", area);
1888 pEditGround->
areas[area]->
GetPos(&grid, cursor_pos[0], cursor_pos[1], cursor_pos[2]);
1889 sprintf(text,
"pos(grid) = (%d,%d)\n", grid.
x, grid.
z);
1891 sprintf(text,
"id = %d\n", pEditGround->
areas[area]->
GetPartsID(grid.
x, grid.
z));
1898 EdDPrintCamera(NowCamera);
1904 if (
GameMode != ED_MODE_GEORAMA_MENU &&
GameMode != ED_MODE_GEORAMA && loop_counter > 10) {
1905 sceVu0FVECTOR eye_pos;
1906 sceVu0FVECTOR eye_dir;
1910 NowCamera->
GetPos(eye_pos);
1911 NowCamera->
GetDir(eye_dir);
1915 box.
min[0] = eye_pos[0] - reach;
1916 box.
min[1] = eye_pos[1] - reach;
1917 box.
min[2] = eye_pos[2] - reach;
1919 box.
max[0] = reach + eye_pos[0];
1920 box.
max[1] = reach + eye_pos[1];
1921 box.
max[2] = reach + eye_pos[2];
1924 int near_count = pEditGround->
GetNearParts(nearby, 64, &box, NULL);
1926 for (
int i = 0; i < near_count; i++) {
1932 if (sound_off_cnt <= 0) {
1933 EdSetSoundSrcVol(NowTime, nearby, near_count, eye_pos, eye_dir);
1937 if (change_time_event != 0 && move_count <= 0 && RunEvent(0x84, NowCamera) != 0) {
1938 change_time_event = 0;
1941 static int event_next = 0;
1943 if (GamePad.
Down2(PAD_SQUARE) != 0) {
1951 if (event_next < 0) {
1955 if (event_next == 1) {
1956 start_event_no = 0x96;
1960 if (((
CMainChara *) Chara)->move_info.landed != 0 && loop_counter > 10) {
1961 if (((
CMainChara *) Chara)->move_info.ground_poly.attr.ground_kind > 0) {
1962 RunEvent(((
CMainChara *) Chara)->move_info.ground_poly.attr.ground_kind, NowCamera);
1963 ((
CMainChara *) Chara)->move_info.ground_poly.attr.ground_kind = 0;
1968 if (EdDebugEventEnable != 0 && (start_event_no > 0 || start_system_event > 0)) {
1969 sceVu0FVECTOR camera_pos;
1970 sceVu0FVECTOR camera_ref;
1972 NowCamera->
GetPos(camera_pos);
1973 NowCamera->
GetRef(camera_ref);
1975 EventCamera.
SetPos(camera_pos);
1976 EventCamera.
SetRef(camera_ref);
1977 EventCamera.
Step(-1);
1979 if (start_system_event > 0) {
1980 if (EdEventInit(start_system_event, &EdWorkBuffer, (
char *) EdSystemEventData) != 0) {
1985 if (EdEventInit(start_event_no, &EdWorkBuffer, (
char *) EdEventData) != 0) {
1999 start_event_no = -1;
2000 start_system_event = -1;
2006 static int old_mode;
2008 if ((
unsigned int) (
GameMode - 9) < 2U && EdPadDown(0x800, 0xFFFF) != 0) {
2011 PlayTimeCountFlag(1);
2012 }
else if (goto_return_menu != 0) {
2016 GameMode = ED_MODE_RETURN_MENU_WALK;
2018 PlayTimeCountFlag(0);
2019 }
else if (
GameMode == ED_MODE_GEORAMA) {
2021 GameMode = ED_MODE_RETURN_MENU_GEORAMA;
2023 PlayTimeCountFlag(0);
2027 goto_return_menu = 0;
2028 static int end_code = 0;
2030 if (goto_dungeon != 0 && end_counter == 0) {
2031 main_select_menu_no = NowEditMap;
2032 MapJump(NowEditMap + 0xC8, -1);
2041 if (DebugMode != 0 && GamePad.
On(PAD_SELECT) != 0 && GamePad.
On(PAD_START) != 0 && end_counter == 0) {
2043 EdFadeOut(0x40, 0.0f, 0.0f, 0.0f);
2048 if (exit_loop != 0) {
2053 if (end_counter == 1) {
2060 if (end_counter < 0) {
2069 if (sound_off_cnt < 0) {
2075 if (GamePad.
On(PAD_CIRCLE) != 0) {
2096 if (EdDrawOffFlag == 0) {
2097 if (EdPauseFlag != 0 || (
unsigned int) (
GameMode - 9) < 2U) {
2102 if (EdThunderEffectFlag != 0) {
2103 EdThunderEffect(MapNo, pEditGround);
2110 if (EdDrawOffMap == 0) {
2111 if (draw_sky != 0) {
2112 EdDrawSky(NowTime, SkyFrame, SunFrame, SkyBackFrame, NowCamera, EditMapInfo->
sky_follow);
2115 TexManager.ReloadTexture(Vif1Packet, 1);
2119 float lod[4] = {50.0f, 350.0f, 600.0f, 1000.0f};
2121 float near_lod = 2.0f;
2123 float mid_lod = 0.0f;
2125 if (edit_mode_draw != 0) {
2131 pEditGround->
Draw(NowTime, 1, (
int) far_lod, (
int) near_lod, (
int) mid_lod, (
int) near_lod);
2133 if (edit_mode_draw != 0) {
2135 sceVu0FVECTOR colour = {0.0f, 0.0f, 0.0f, 0.0f};
2137 sceVu0CopyVector(at, ECursorFrame->
position);
2138 colour[1] = NowCursorRotY;
2139 at[1] = pEditGround->
GetAlt(at[0], at[1], at[2]);
2140 pEditGround->
DrawPartsCursor(NowSelectParts, at, NowPartsCursorPos, NowSelectAngle, colour, 1);
2143 TexManager.ReloadTexture(Vif1Packet, 2);
2145 pEditGround->
Draw(NowTime, 2, (
int) far_lod, (
int) near_lod, 0, 3);
2147 if (edit_mode_draw != 0) {
2149 sceVu0FVECTOR colour2 = {0.0f, 0.0f, 0.0f, 0.0f};
2151 sceVu0CopyVector(at2, ECursorFrame->
position);
2152 colour2[1] = NowCursorRotY;
2153 at2[1] = pEditGround->
GetAlt(at2[0], at2[1], at2[2]);
2154 pEditGround->
DrawPartsCursor(NowSelectParts, at2, NowPartsCursorPos, NowSelectAngle, colour2, 2);
2157 if (FishingDrawCheck() != 0) {
2162 TexManager.ReloadTexture(Vif1Packet, 0x15);
2168 case ED_MODE_FISHING:
2169 case ED_MODE_GEORAMA:
2172 case ED_MODE_TIME_CHANGE:
2174 case ED_MODE_RETURN_MENU_WALK:
2175 case ED_MODE_MENU_INIT:
2176 case ED_MODE_GEORAMA_MENU_INIT:
2177 case ED_MODE_RETURN_MENU_GEORAMA: {
2184 MGGetFBuffTex(&frame);
2187 screen.
width = 0x280;
2188 screen.
height = SCREEN_HALF_HEIGHT;
2189 water = *(
sceGsTex0 *) &TexManager.GetTexture(
"water_buff", -1)->
tex0;
2190 MGMoveImage(&frame, screen, &water, 0, 0, 0);
2196 MGSetGsZBUF(&mgZBuffer);
2203 float dof_range[2] = {400.0f, 1000.0f};
2205 if (depth_of_field != 0) {
2212 EdDrawDOF(dof_level);
2216 if (FishingDrawCheck() != 0) {
2221 EdEventBackSpriteDraw();
2231 case ED_MODE_RETURN_MENU_WALK:
2232 case ED_MODE_MENU_INIT:
2237 for (i = 0; i < 10; i++) {
2239 unsigned char drawable = villager->
initialized != 0;
2241 if (drawable != 0) {
2245 if (drawable != 0) {
2258 case ED_MODE_FISHING:
2261 case ED_MODE_TIME_CHANGE:
2262 case ED_MODE_DOOR_OPEN: {
2266 int marks_store[10];
2267 marks = marks_store;
2272 if (
GameMode == ED_MODE_TALK || EdSystemMesCheck() != 0) {
2276 if (EdCheckViewMode() != 0) {
2280 if (
GameMode == ED_MODE_DOOR_OPEN) {
2283 for (i = 0; i < 10; i++) {
2289 event = &EdEventInfo;
2293 chara_pos[1] += 10.0f;
2294 box.
min[0] = chara_pos[0] - 100.0f;
2295 box.
min[1] = chara_pos[1] - 100.0f;
2296 box.
min[2] = chara_pos[2] - 100.0f;
2298 box.
max[0] = 100.0f + chara_pos[0];
2299 box.
max[1] = 100.0f + chara_pos[1];
2300 box.
max[2] = 100.0f + chara_pos[2];
2303 int found = pEditGround->
GetNearParts(near_parts, 0x40, &box, NULL);
2307 for (i = 0; i < found; i++) {
2311 if (frame != NULL) {
2314 parts->GetPosition(transform);
2315 frame->SetPosition(transform);
2317 frame->SetRotation(transform[0], transform[1], transform[2]);
2319 for (
int j = 0; j < 0x18; j++) {
2322 if (near_parts[i]->effect_on[j] != 0 && effect != NULL && (effect->
kind == EDIT_EFFECT_FIRE_LARGE || effect->
kind == EDIT_EFFECT_FIRE_MEDIUM || effect->
kind == EDIT_EFFECT_FIRE_SMALL) && effect->
frame != NULL && CheckEditEffect(effect, NowTime) != 0) {
2325 effect->
frame->GetWorldPosition(light_pos, effect->
offset);
2327 float distance = DistVector(chara_pos, light_pos);
2329 if (distance <= 40.0f) {
2330 float brightness = 80.0f + (float) (rand() % 48);
2332 light_pos[3] = distance;
2333 Chara->
SetPointLight(light_pos, 5.0f, 40.0f, brightness, brightness, brightness, 128.0f);
2340 EdDrawCharacter(Chara, detail, 0xA, EdVillager, marks, shadow_on, event);
2345 if (EdDrawOffMapShadow == 0 && EdDrawOffMap == 0) {
2346 float saved_light[4][4];
2347 float shadow_light[4][4];
2348 float light_colour[4][4];
2350 MGGetPLight(saved_light, light_colour);
2351 sceVu0CopyMatrix(shadow_light, saved_light);
2352 EdLimitShadowLight(shadow_light, 3.0f);
2353 MGSetPLight(shadow_light, light_colour);
2354 TexManager.ReloadTexture(Vif1Packet, 0x16);
2358 if (edit_mode_draw != 0) {
2359 MGBeginDrawShadow(*(
sceGsTex0 *) &TexManager.GetTexture(
"shadow_buff", -1)->
tex0);
2361 MGEndDrawShadow(0x20);
2364 MGBeginDrawShadow(*(
sceGsTex0 *) &TexManager.GetTexture(
"shadow_buff", -1)->
tex0);
2365 pEditGround->
DrawShadow(0, shadow_range[0], shadow_range[1]);
2370 MGBeginDrawShadow(*(
sceGsTex0 *) &TexManager.GetTexture(
"shadow_buff", -1)->
tex0);
2371 pEditGround->
DrawShadow(0, shadow_range[1], shadow_range[2]);
2376 MGSetPLight(saved_light, light_colour);
2379 for (i = 0; i < 4; i++) {
2380 TexManager.ReloadTexture(Vif1Packet, i + 0x1B);
2382 MotionParts[i].
Draw();
2385 if (EdDrawOffMap == 0) {
2386 TexManager.ReloadTexture(Vif1Packet, 0x18);
2394 case ED_MODE_TIME_CHANGE:
2395 case ED_MODE_GEORAMA:
2396 case ED_MODE_GEORAMA_MENU_INIT:
2397 case ED_MODE_MENU_INIT:
2398 case ED_MODE_DOOR_OPEN:
2400 case ED_MODE_FISHING:
2401 if (EdPauseFlag == 0) {
2406 EffectMacroStep(wind);
2408 EdEffectGroup.Step(1);
2410 if (NowEditMap == TOWN_MATATAKI) {
2411 sceVu0FVECTOR spray = {800.0f, -20.0f, 1300.0f, 1.0f};
2412 sceVu0FVECTOR size = {10.0f, 7.0f, 10.0f, 1.0f};
2414 for (
int i = 0; i < 5; i++) {
2415 EffectWaterSpray(&EdEffectGroup, spray, size, 0xA, i);
2421 case ED_MODE_RETURN_MENU_WALK:
2422 case ED_MODE_RETURN_MENU_GEORAMA:
2427 EdEffectGroup.Draw();
2431 if (edit_mode_draw == 0) {
2432 EdDrawLensFlare(NowTime, SunFrame);
2437 EdEventSpriteDraw();
2447 screen.
width = 0x2800;
2448 screen.
height = SCREEN_HALF_HEIGHT * 16;
2449 MGFillBox(screen, (
int) fade[0] & 0xFF, (
int) fade[1] & 0xFF, (
int) fade[2] & 0xFF, (
int) fade[3] & 0xFF);
2459 TexManager.ReloadTexture(Vif1Packet, EditMes1.
tex_block);
2466 if (mes_mode == ED_MODE_TALK || mes_mode == ED_MODE_FISHING || mes_mode == ED_MODE_EVENT || mes_mode == ED_MODE_GEORAMA) {
2467 TexManager.ReloadTexture(Vif1Packet, EditMes1.
tex_block);
2479 MonsterNameMake(-1);
2485 if (
GameMode == ED_MODE_GEORAMA && (EditMenuStatus.
mode == EDIT_MENU_MODE_PLACE || EditMenuStatus.
mode == EDIT_MENU_MODE_REPLACE)) {
2489 int stock = info->
stock;
2490 int percent = (stock - info->
placed) * 100 / stock;
2503 MGFillBox(back, 0x14, 0x14, 0x14, 0x80);
2512 MGFillBox(bar, 0x64, 0x64, 0x64, 0x80);
2519 fill.
width = percent * 0x10;
2521 MGFillBox(fill, 0xB4, 0x64, 0x28, 0x80);
2523 DrawAtraBuildNum(info, 0x1F4, 0x181, 0x80);
2525 DrawAtraBuildNum(info, 0x1CC, 0x181, 0x80);
2532 if (clear_screen != 0) {
2537 screen.
width = 0x2800;
2538 screen.
height = SCREEN_HALF_HEIGHT * 16;
2539 MGFillBox(screen, 0, 0, 0, 0x80);
2550 sceVu0IVECTOR screen;
2552 if (EdDebugParamDrawOff != 0) {
2556 TexManager.ReloadTexture(Vif1Packet, 20);
2558 NowCursorPos[3] = 1.0f;
2559 MGRotTransPers2D(screen, NowCursorPos, 0);
2560 CRect_i_ cursor(screen[0] - 10, screen[1] - 32, 32, 32);
2561 set2DSprite(Vif1Packet, TexManager.GetTexture(
"syst08", -1), cursor, 0, 0);
2563 screen[1] = SCREEN_HALF_HEIGHT;
2565 if (NowFocusParts != NULL && DrawPartsNameCount == 0) {
2566 int name_count = PartsNameNum;
2568 if (name_count > 0) {
2576 if (LanguageCode > LANG_JAPANESE) {
2582 if (name_count < 7) {
2584 step = step + ((step * (few - name_count)) >> 1);
2586 step = step + ((step * (many - name_count)) >> 1);
2592 int plate_y = screen[1];
2593 int text_y = plate_y + 14;
2594 EditNameMes.
line_pos[0].
x = screen[0] + step;
2600 plate.
x = screen[0];
2601 plate.
y = screen[1];
2604 set2DSprite(Vif1Packet, TexManager.GetTexture(
"pnplate", -1), plate, source, 0x60);
2612void EdSetCharaCursor(
int on) {
2613 draw_npc_cursor = on;
2620 if (EdDebugParamDrawOff != 0) {
2624 static float offset = 2.5f;
2627 if (offset < 0.0f) {
2631 SetMonsterNameDrawFlag(0);
2633 for (
int i = 0; i < 10 && draw_npc_cursor != 0; i++) {
2637 sceVu0FVECTOR position;
2638 sceVu0CopyVector(position, EdVillager[i].pos);
2641 if (EdInteriorFlag == 0 && EdVillager[i].CheckDraw() == 0 && EdVillager[i].talk_target == 0) {
2642 if (MapNo != TOWN_MUSKA_LACKA || EdVillager[i].villager_id != 8) {
2643 position[1] += offset;
2644 CharaCursor1->SetPosition(position);
2646 CharaCursor1->SetRotation(0.0f, yaw, 0.0f);
2647 MGDraw(CharaCursor1);
2649 }
else if (EdVillager[i].CheckDraw() != 0 && EdVillager[i].talk_target != 0 && EdCheckViewMode() == 0) {
2650 CharaCursor0->SetPosition(position);
2651 MGDraw(CharaCursor0);
2653 sceVu0IVECTOR screen;
2655 if (MGRotTransPers2D(screen, position, 0) != 0) {
2656 MonsterNameMake(MapNo * 100 - 2000 + EdVillager[i].villager_id);
2657 MonsterNamePosSet(screen[0], screen[1] - 70);
2658 SetMonsterNameDrawFlag(1);
2665 if (CharaCursor2 != NULL) {
2666 sceVu0FVECTOR position;
2668 static float a = 0.0f;
2669 position[1] += 3.0f + Chara->
body_height + 0.5f * sinf(a);
2672 if (!(a <= PI_SHORT)) {
2676 CharaCursor2->SetPosition(position);
2677 CFrame *marker = CharaCursor2;
2679 MGDraw(CharaCursor2);
2685 EdEventPointDraw(points, count, NowTime);
2686 EdDrawOpenItemBox();
2695void EdStartDrawDay() {
2696 draw_day_cnt = 5.0f;
2703void EdInitDrawDay() {
2704 draw_day_cnt = 0.0f;
2727 this->width =
width;
2734 if (draw_day_flag != 0) {
2747 draw_day_cnt -= 0.02f;
2749 if (draw_day_cnt < 0.0f) {
2750 draw_day_cnt = 0.0f;
2754 day = SaveData->
GetDay() + 1;
2755 week = EdGetTime(NowTime);
2764 if (draw_day_cnt > 4.0f) {
2765 alpha = (int) (128.0f * (5.0f - draw_day_cnt));
2766 }
else if (draw_day_cnt > 1.0f) {
2769 alpha = (int) (128.0f * draw_day_cnt);
2773 digit[3] = day / 1000;
2774 digit[2] = day % 1000 / 100;
2775 digit[1] = day % 100 / 10;
2776 digit[0] = day % 10;
2796 texture = TexManager.GetTexture(
"whatsday", -1);
2798 CRect_i_ title(0x30, 0x58, 0x30, 0x18);
2799 CRect_i_ nichi(0x64, 0x40, 0x10, 0x18);
2800 CRect_i_ weekday(0, 0x40, 0x18, 0x18);
2802 CRect_i_ bar_left(0, 0x70, 0x10, 0x10);
2803 CRect_i_ bar_middle(0x10, 0x70, 0x10, 0x10);
2804 CRect_i_ bar_right(0x20, 0x70, 0x10, 0x10);
2805 CRect_i_ word(0x78, 0x62, 0x65, 0x20);
2806 CRect_i_ word_end(0xDD, 0x62, 0x22, 0x20);
2809 switch (LanguageCode) {
2810 case LANG_ENGLISH_US:
2811 case LANG_ENGLISH_UK:
2812 week_name[0].
x = 0x78;
2814 week_name[0].
width = 0x50;
2815 week_name[0].
height = 0x20;
2816 week_name[1].
x = 0x78;
2817 week_name[1].
y = 0x22;
2818 week_name[1].
width = 0x68;
2819 week_name[1].
height = 0x20;
2820 week_name[2].
x = 0x78;
2821 week_name[2].
y = 0x42;
2822 week_name[2].
width = 0x38;
2823 week_name[2].
height = 0x20;
2824 week_name[3].
x = 0xC8;
2825 week_name[3].
y = 0x42;
2826 week_name[3].
width = 0x38;
2827 week_name[3].
height = 0x20;
2837 word_end.height = 0;
2838 week_name[0].
x = 0x78;
2840 week_name[0].
width = 0x50;
2841 week_name[0].
height = 0x20;
2842 week_name[1].
x = 0x78;
2843 week_name[1].
y = 0x22;
2844 week_name[1].
width = 0x76;
2845 week_name[1].
height = 0x20;
2846 week_name[2].
x = 0x78;
2847 week_name[2].
y = 0x42;
2848 week_name[2].
width = 0x46;
2849 week_name[2].
height = 0x20;
2850 week_name[3].
x = 0xC4;
2851 week_name[3].
y = 0x42;
2852 week_name[3].
width = 0x40;
2853 week_name[3].
height = 0x20;
2863 word_end.height = 0;
2864 week_name[0].
x = 0x78;
2866 week_name[0].
width = 0x50;
2867 week_name[0].
height = 0x20;
2868 week_name[1].
x = 0x78;
2869 week_name[1].
y = 0x22;
2870 week_name[1].
width = 0x3E;
2871 week_name[1].
height = 0x20;
2872 week_name[2].
x = 0x78;
2873 week_name[2].
y = 0x42;
2874 week_name[2].
width = 0x46;
2875 week_name[2].
height = 0x20;
2876 week_name[3].
x = 0x78;
2877 week_name[3].
y = 0x42;
2878 week_name[3].
width = 0x46;
2879 week_name[3].
height = 0x20;
2889 word_end.height = 0;
2890 week_name[0].
x = 0x78;
2892 week_name[0].
width = 0x40;
2893 week_name[0].
height = 0x20;
2894 week_name[1].
x = 0x78;
2895 week_name[1].
y = 0x22;
2896 week_name[1].
width = 0x8C;
2897 week_name[1].
height = 0x20;
2898 week_name[2].
x = 0x78;
2899 week_name[2].
y = 0x42;
2900 week_name[2].
width = 0x32;
2901 week_name[2].
height = 0x20;
2902 week_name[3].
x = 0xAA;
2903 week_name[3].
y = 0x42;
2904 week_name[3].
width = 0x34;
2905 week_name[3].
height = 0x20;
2915 word_end.height = 0;
2916 week_name[0].
x = 0x78;
2918 week_name[0].
width = 0x50;
2919 week_name[0].
height = 0x20;
2920 week_name[1].
x = 0x78;
2921 week_name[1].
y = 0x22;
2922 week_name[1].
width = 0x76;
2923 week_name[1].
height = 0x20;
2924 week_name[2].
x = 0x76;
2925 week_name[2].
y = 0x42;
2926 week_name[2].
width = 0x32;
2927 week_name[2].
height = 0x20;
2928 week_name[3].
x = 0xA4;
2929 week_name[3].
y = 0x42;
2930 week_name[3].
width = 0x38;
2931 week_name[3].
height = 0x20;
2936 week_word = week_name[week];
2940 if (texture != NULL) {
2941 switch (LanguageCode) {
2943 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xE4, title.width, title.height), title, alpha);
2946 case LANG_ENGLISH_US:
2947 case LANG_ENGLISH_UK:
2948 width = week_word.
width + (word_end.width + (word.width + ((count - 1) * 32)) + 0x48);
2949 x = 0x140 - (int) (width >> 1);
2950 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xE4, word.width, word.height), word, alpha);
2951 x += word.width + 0xC;
2952 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xE4, word_end.width, word_end.height), word_end, alpha);
2953 x += word_end.width + 0xC;
2959 width = week_word.
width + (word_end.width + (word.width + ((count - 1) * 32)) + 0x38);
2960 x = 0x140 - (int) (width >> 1);
2961 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xE4, word.width, word.height), word, alpha);
2962 x += word.width + 0xC;
2968 for (n = count; n > 0; n--) {
2970 value = digit[n - 1];
2972 number.
x += number.
width * (value % 5);
2973 number.
y += number.
height * (value / 5);
2974 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xE2, number.
width, number.
height), number, alpha);
2978 switch (LanguageCode) {
2980 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xE4, dai.width, dai.height), dai, alpha);
2982 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xE4, nichi.width, nichi.height), nichi, alpha);
2984 weekday.x += week * 0x18;
2985 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xE4, weekday.width, weekday.height), weekday, alpha);
2987 case LANG_ENGLISH_US:
2988 case LANG_ENGLISH_UK:
2993 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xE4, nichi.width, nichi.height), nichi, alpha);
2995 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xE4, week_word.
width, week_word.
height), week_word, alpha);
3000 x = 0x134 - (int) (width >> 1);
3001 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xFC, bar_left.width, bar_left.height), bar_left, alpha);
3002 drawn += bar_left.width;
3003 x += bar_left.width;
3004 remain = width - (bar_right.width >> 2);
3006 while (drawn < width - bar_right.width) {
3007 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xFC, bar_middle.width, bar_middle.height), bar_middle, alpha);
3008 x += bar_middle.width;
3009 remain -= bar_middle.width;
3010 drawn += bar_middle.width;
3013 bar_right.x += bar_right.width - remain;
3014 bar_right.width = remain;
3015 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xFC, bar_right.width, bar_right.height), bar_right, alpha);
3021 if (draw_day_flag != 0) {
3034 draw_day_cnt -= 0.02f;
3036 if (draw_day_cnt < 0.0f) {
3037 draw_day_cnt = 0.0f;
3041 day = SaveData->
GetDay() + 1;
3042 week = EdGetTime(NowTime);
3051 if (draw_day_cnt > 4.0f) {
3052 alpha = (int) (128.0f * (5.0f - draw_day_cnt));
3053 }
else if (draw_day_cnt > 1.0f) {
3056 alpha = (int) (128.0f * draw_day_cnt);
3060 digit[3] = day / 1000;
3061 digit[2] = day % 1000 / 100;
3062 digit[1] = day % 100 / 10;
3063 digit[0] = day % 10;
3083 texture = TexManager.GetTexture(
"whatsday", -1);
3085 CRect_i_ title(0x30, 0x58, 0x30, 0x18);
3086 CRect_i_ nichi(0x64, 0x40, 0x10, 0x18);
3087 CRect_i_ weekday(0, 0x40, 0x18, 0x18);
3089 CRect_i_ bar_left(0, 0x70, 0x10, 0x10);
3090 CRect_i_ bar_middle(0x10, 0x70, 0x10, 0x10);
3091 CRect_i_ bar_right(0x20, 0x70, 0x10, 0x10);
3092 CRect_i_ word(0x78, 0x62, 0x65, 0x20);
3093 CRect_i_ word_end(0xDD, 0x62, 0x22, 0x20);
3095 week_name[0].
x = 0x78;
3097 week_name[0].
width = 0x50;
3098 week_name[0].
height = 0x20;
3099 week_name[1].
x = 0x78;
3100 week_name[1].
y = 0x22;
3101 week_name[1].
width = 0x68;
3102 week_name[1].
height = 0x20;
3103 week_name[2].
x = 0x78;
3104 week_name[2].
y = 0x42;
3105 week_name[2].
width = 0x38;
3106 week_name[2].
height = 0x20;
3107 week_name[3].
x = 0xC8;
3108 week_name[3].
y = 0x42;
3109 week_name[3].
width = 0x38;
3110 week_name[3].
height = 0x20;
3112 week_word = week_name[week];
3116 if (texture != NULL) {
3117 switch (LanguageCode) {
3119 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xD4, title.width, title.height), title, alpha);
3122 case LANG_ENGLISH_US:
3123 width = week_word.
width + (word_end.width + (word.width + ((count - 1) * 32)) + 0x48);
3124 x = 0x140 - (int) (width >> 1);
3125 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xD4, word.width, word.height), word, alpha);
3126 x += word.width + 0xC;
3127 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xD4, word_end.width, word_end.height), word_end, alpha);
3128 x += word_end.width + 0xC;
3136 for (n = count; n > 0; n--) {
3138 value = digit[n - 1];
3140 number.
x += number.
width * (value % 5);
3141 number.
y += number.
height * (value / 5);
3142 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xD2, number.
width, number.
height), number, alpha);
3146 switch (LanguageCode) {
3148 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xD4, dai.width, dai.height), dai, alpha);
3150 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xD4, nichi.width, nichi.height), nichi, alpha);
3152 weekday.x += week * 0x18;
3153 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xD4, weekday.width, weekday.height), weekday, alpha);
3155 case LANG_ENGLISH_US:
3156 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xD4, nichi.width, nichi.height), nichi, alpha);
3158 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xD4, week_word.
width, week_word.
height), week_word, alpha);
3163 x = 0x13C - (int) (width >> 1);
3164 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xEC, bar_left.width, bar_left.height), bar_left, alpha);
3165 drawn += bar_left.width;
3166 x += bar_left.width;
3167 remain = width - bar_right.width;
3169 while (drawn < width - bar_right.width) {
3170 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xEC, bar_middle.width, bar_middle.height), bar_middle, alpha);
3171 x += bar_middle.width;
3172 remain -= bar_middle.width;
3173 drawn += bar_middle.width;
3176 bar_right.x += bar_right.width - remain;
3177 bar_right.width = remain;
3178 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, 0xEC, bar_right.width, bar_right.height), bar_right, alpha);
3188 if (EdDebugParamDrawOff == 0) {
3189 TexManager.ReloadTexture(Vif1Packet, 20);
3190 EdDrawSysCursor(EditMapInfo->
work.events.
points, 256);
3192 if (FishingDrawCheck() == 0) {
3198 char pause_texture[] =
"pause";
3200 if ((
unsigned int) (
GameMode - 9) <= 1 || EdPauseFlag != 0) {
3204 fade.
width = 0x2800;
3205 fade.
height = (SCREEN_HALF_HEIGHT << 4);
3206 MGFillBox(fade, 0, 0, 0, 0x40);
3221 screen.
width = 0x80;
3223 set2DSprite(GetVif1Packet(), TexManager.GetTexture(pause_texture, -1), screen, texel, 0x80);
3231void EdDrawClock(
int x,
int y) {
3232 if (draw_clock != 0 && EditMapInfo->
time_stop == 0) {
3233 TexManager.ReloadTexture(Vif1Packet, 20);
3240 clock_texel.
width = 88;
3242 clock_screen.
x = x + 520;
3243 clock_screen.
y = y + 14;
3244 clock_screen.
width = 88;
3245 clock_screen.
height = 80;
3246 set2DSprite(GetVif1Packet(), TexManager.GetTexture(
"dayclock", -1), clock_screen, clock_texel, 128);
3248 float scale = 2.0f * (NowTime / 12.0f);
3249 float pi = PI_SHORT;
3250 float angle = pi * scale;
3251 angle = SIXTH_PI_SHORT + (pi - angle);
3256 hand_texel.
width = 22;
3258 hand_screen.x = x + 564;
3259 hand_screen.y = y + 54;
3260 hand_screen.width = 22;
3261 hand_screen.height = 40;
3262 set2DSpriteRot(GetVif1Packet(), TexManager.GetTexture(
"dayclock", -1), hand_screen, hand_texel, 12, 40, angle, 128);
3277int FrameOnOff(
CFrame *root,
char *name,
int on) {
3286 CFrame *frame = root->SearchFrame(name);
3288 if (frame == NULL) {
3299void EditPartsObjectOnOff() {
3302 while (parts >= 0) {
3303 EdPartsObjectOnOff(&ObjParts[parts], EditPartsInfo.
GetPartsInfo(parts), 0);
3317 EditPartsObjectOnOff();
3327void MainEditMode() {
3332 EdSetLightParam(NowTime, edit_mode_lighting, EditMapInfo, SkyBackFrame);
3339 sceVu0CopyVector(wind, EditMapInfo->
wind);
3341 if (EdEventInfo.
wind[3] > 0.0f) {
3342 sceVu0CopyVector(wind, EdEventInfo.
wind);
3345 float left_x = GamePad.
GetLXf2();
3346 float left_y = GamePad.
GetLYf2();
3347 float camera_angle = MainCamera.
GetAngle();
3348 sceVu0FVECTOR direction;
3350 direction[0] = wind[0] + (left_x * cosf(camera_angle) + left_y * sinf(camera_angle));
3351 direction[2] = wind[2] + (left_y * cosf(camera_angle) - left_x * sinf(camera_angle));
3352 direction[1] = wind[1];
3353 direction[3] = 0.0f;
3354 EdWind.
SetDir(direction);
3357 Chara->
wind = (int) &EdWind;
3359 for (
int i = 0; i < 4; i++) {
3360 MotionParts[i].
Step();
3367 ObjAnimePlay(anime);
3373 int old_hour = EdGetTime(NowTime);
3380 static int time_flag = 1;
3382 float time_step = 0.0011133334f;
3388 if (change_time_event != 0) {
3392 if (time_flag != 0 &&
GameMode == ED_MODE_WALK) {
3396 if (GamePad.
Down2(PAD_DOWN) != 0) {
3397 time_flag = (u8) !time_flag;
3400 if (!(NowTime < 12.0f)) {
3404 if (GamePad.
On2(PAD_RIGHT) != 0) {
3408 if (GamePad.
On2(PAD_LEFT) != 0) {
3414 if (GamePad.
Down2(PAD_UP) != 0) {
3415 NowTime = 1.0f + (float) (
int) NowTime;
3417 if (!(NowTime < 12.0f)) {
3432 int new_hour = EdGetTime(NowTime);
3434 if (clock_kept != 0 && time_flag != 0 && old_hour != new_hour && hour_set == 0) {
3436 change_time_event = 1;
3445 if (sound_off_cnt <= 0) {
3447 EdSetBgmVol(NowTime);
3452 PlayAmbient(NowTime);
3456 int night = EdGetTime(NowTime) == ED_TIME_NIGHT;
3458 static int parts = 0;
3469 char day_window[10] =
"win1";
3470 char night_window[10] =
"win2";
3472 for (level = 0; level < 4; level++) {
3476 FrameOnOff(frame, day_window, day_on);
3477 FrameOnOff(frame, night_window, night_on);
3482 if (!(parts < 24)) {
3486 static int now_obj = 0;
3490 for (
int i = 0; i < 2; i++, now_obj++) {
3491 if (!(now_obj < EditMapInfo->object_timer_count)) {
3497 if (timer->
name[0] !=
'\0') {
3504 if (timer->
object != NULL) {
3506 }
else if (timer->
frame != NULL) {
3509 if (found != NULL) {
3521void OpenDoorMode() {
3529 Chara->
SetRotation(fix_chara_rot[0], fix_chara_rot[1], fix_chara_rot[2]);
3530 MainCamera.
SetPos(fix_camera_pos);
3531 MainCamera.
SetRef(fix_chara_pos[0], 14.0f + fix_chara_pos[1], fix_chara_pos[2]);
3543 if (talk_villager < 0 || talk_villager >= 10) {
3557 for (i = 0; i < 10; i++) {
3562 int result = EdTalkMode(Chara, &TalkCamera, 0, &event_no);
3573 if (result == 4 && event_no > 0) {
3574 RunEvent(event_no, NowCamera);
3578 NowCamera = &MainCamera;
3580 for (i = 0; i < 10; i++) {
3581 EdVillager[i].
Step();
3595 int result = EdEventMode(&EventCamera, 0);
3630 angle = AngleLimit(angle);
3633 EdInitCameraParam(&MainCamera);
3634 MainCamera.
Step(-1);
3643 MainCamera.
Step(-1);
3647 MainCamera.
SetFollow(ref[0], ref[1], ref[2]);
3648 MainCamera.
SetAngleSoon(atan2(pos[0] - ref[0], pos[2] - ref[2]));
3649 MainCamera.
Step(-1);
3667 return goto_dungeon = 1;
3674void EdDeleteE05RoboParts() {
3677 for (
int i = 0; i < 14; i++) {
3689 if (elements != NULL) {
3690 for (
int i = 0; i < 128; i++) {
3698 for (
int i = 0; i < count; i++, parts++) {
3706int GotoInterior(
char *name,
int entrance,
int direction,
ED_EVENT_PARAM *param,
int start_event) {
3707 char *suffix[5] = {
"m",
"e",
"n",
"m",
""};
3710 sceVu0FVECTOR position;
3711 sceVu0FVECTOR rotation;
3713 int period = EdGetTime(NowTime);
3714 strcpy(EdInteriorName, name);
3715 sprintf(path,
"%sin/%s/%s%s", EditDataDir, name, name, suffix[period]);
3716 sprintf(interior_map_name,
"%s", path);
3717 EdInteriorPartsNo = entrance;
3718 EdNPCBuffer.
used = 0;
3720 if (param == NULL) {
3724 EdInteriorJumpID = 0;
3726 if (param != NULL) {
3730 door_open = direction;
3731 door_open_cnt = 160;
3733 EdInteriorDoorSound = -1;
3735 if (direction != 0) {
3738 int forward = direction > 0;
3740 sceVu0CopyVector(fix_chara_pos, param->
position);
3741 sceVu0CopyVector(fix_chara_rot, param->
rotation);
3743 Chara->
SetRotation(fix_chara_rot[0], fix_chara_rot[1], fix_chara_rot[2]);
3745 sceVu0CopyVector(fix_camera_pos, param->
camera_pos);
3746 MainCamera.
SetPos(fix_camera_pos);
3747 MainCamera.
SetRef(fix_chara_pos[0], 14.0f + fix_chara_pos[1], fix_chara_pos[2]);
3749 MainCamera.
Step(10);
3750 MainCamera.
Step(-1);
3753 sound_off_cnt = 160;
3755 if (EdSearchEvent(&entry, name, 0, NowTime) != 0) {
3756 sceVu0CopyVector(fix_chara_pos, entry.
position);
3757 sceVu0CopyVector(fix_chara_rot, entry.
rotation);
3759 Chara->
SetRotation(fix_chara_rot[0], fix_chara_rot[1], fix_chara_rot[2]);
3760 sceVu0CopyVector(fix_camera_pos, entry.
camera_pos);
3761 MainCamera.
SetPos(fix_camera_pos);
3762 MainCamera.
SetRef(fix_chara_pos[0], 14.0f + fix_chara_pos[1], fix_chara_pos[2]);
3766 sceVu0CopyVector(fix_chara_pos, position);
3767 sceVu0CopyVector(fix_chara_rot, rotation);
3768 MainCamera.
GetPos(position);
3769 MainCamera.
GetRef(rotation);
3770 sceVu0CopyVector(fix_camera_pos, position);
3771 MainCamera.
SetRef(fix_chara_pos[0], 14.0f + fix_chara_pos[1], fix_chara_pos[2]);
3775 EdFadeOut(100, 0.0f, 0.0f, 0.0f);
3777 for (
int i = 0; i < 10; i++) {
3781 EdInteriorStartEvent = start_event;
3783 if (start_event < 0) {
3784 EdInteriorStartEvent = 128;
3794 float horizontal = GamePad.
GetRXf();
3797 if (EdDebugCameraFlag == 0 && !(camera->
GetHeight() <= 30.0f)) {
3801 camera->
AddAngle(0.03f * -horizontal);
3803 if (horizontal == 0.0f) {
3804 if (GamePad.
On(PAD_R1) != 0) {
3808 if (GamePad.
On(PAD_L1) != 0) {
3818 sceVu0FVECTOR centre;
3819 sceVu0AddVector(centre, box->
max, box->
min);
3820 sceVu0ScaleVector(centre, centre, 0.5f);
3821 return pEditGround->
PickUpPoly(poly, centre[0], centre[1], centre[2]);
3829 sceVu0FVECTOR part_rot;
3830 sceVu0FVECTOR part_pos;
3831 sceVu0FMATRIX world;
3832 sceVu0FMATRIX inverse;
3833 sceVu0FVECTOR run_pos;
3834 sceVu0FVECTOR splash_pos;
3836 EdMoveCharaInfo.
time = NowTime;
3837 EdMoveCharaInfo.
camera = &MainCamera;
3840 EdMoveCharaInfo.
key_lock = key_lock;
3841 EdMoveCharaInfo.
chara = Chara;
3843 EdMoveCharaInfo.
ground = pEditGround;
3852 }
else if (EdMoveCharaInfo.
event_no > 0) {
3853 RunEvent(EdMoveCharaInfo.
event_no, &MainCamera);
3857 if (param->
kind == ED_EVENT_POINT_DOOR) {
3859 RunEvent(130, &MainCamera);
3860 }
else if (EdPadDown(0x40, 1) != 0 && EdCheckViewMode() == 0 && key_lock == 0) {
3863 if (point->minimum_progress > 0) {
3864 RunEvent(EdInitGotoInterior(&EdEventInfo, param), NowCamera);
3866 GotoInterior(point->destination, param->
parts_no, point->side, param, -1);
3871 if (loop_counter > 60) {
3875 if (parts != NULL) {
3880 FadeOutToEvent(plot + 200, 0);
3885 if (GamePad.
Down(PAD_CROSS) != 0) {
3889 if (parts != NULL) {
3892 sceVu0UnitMatrix(world);
3893 sceVu0RotMatrixY(world, world, part_rot[1]);
3894 sceVu0CopyVector(world[3], part_pos);
3896 sceVu0InversMatrix(inverse, world);
3898 sceVu0ApplyMatrix(pos, inverse, pos);
3900 pos[1] = pos[1] - part_rot[1];
3902 if (!(pos[1] <= PI_SHORT)) {
3903 pos[1] -= TWO_PI_SHORT;
3906 if (pos[1] < -PI_SHORT) {
3907 pos[1] += TWO_PI_SHORT;
3917 RunEffect.
Set(run_pos);
3922 RunEffect.
Set(splash_pos);
3927 EdMoveVillager(EdVillagerInfo);
3929 EdMoveVillagerSubMap(EdVillagerInfo);
3938void VillagerCollision() {
3941 sceVu0FVECTOR foot_pos;
3944 for (
int i = -1; i < 10; i++) {
3951 villager = &EdVillager[i];
3968 box.
max[0] = 1.0f + pos[0];
3969 box.
min[0] = pos[0] - 1.0f;
3970 box.
max[2] = 1.0f + pos[2];
3971 box.
min[2] = pos[2] - 1.0f;
3972 float height = pos[1];
3973 float top = 1000.0f + height;
3974 box.
max[1] = 10.0f + top;
3975 box.
min[1] = 10.0f + (height - 1000.0f);
3983 if (foot_sound == 1) {
3987 int poly_count = GetCollision(polys, &box);
3989 if (poly_count > 200) {
3990 printf(
"cpoly over!!!! %d\n", poly_count);
3993 if (poly_count > 0) {
3996 if (GetFootPoly(pos, 1000.0f, &poly, foot_pos, polys, poly_count, 0) != 0) {
3997 sceVu0CopyVector(pos, foot_pos);
4000 if (foot_sound == 1) {
4010 case AREA_KIND_FADE_OUT:
4013 case AREA_KIND_AMBIENT_0:
4014 case AREA_KIND_AMBIENT_1:
4025 if (snap_to_ground != 0) {
4039int CheckEditToWalk(
float *position) {
4046 sceVu0CopyVector(pos, ECursorFrame->
position);
4050 box.
max[0] = 100.0f + pos[0];
4051 box.
min[0] = pos[0] - 100.0f;
4053 box.
max[2] = 100.0f + z;
4054 box.
min[2] = z - 100.0f;
4055 box.
max[1] = 20000.0f;
4056 box.
min[1] = -20000.0f;
4058 int poly_count = pEditGround->
PickUpPoly(polys, box, 0);
4061 for (
int i = 0; i < 4; i++) {
4062 sceVu0CopyVector(from, pos);
4065 from[0] += 0.10000000149011612f;
4069 from[2] += 0.597599983215332f;
4073 from[0] -= 0.5809999704360962f;
4077 from[2] -= 0.29760000109672546f;
4081 from[0] += 0.35100001096725464f;
4085 from[2] -= 2.6775999069213867f;
4088 sceVu0CopyVector(to, from);
4091 if (CheckHit(polys, poly_count, from, to, hit, 1, 0) >= 0) {
4092 if (EdDebugMoveFlag <= 0) {
4093 float alt = pEditGround->
GetAlt(from[0], from[1], from[2]);
4094 int area = pEditGround->
GetAreaCode(from[0], from[1], from[2]);
4096 drop = hit[1] - alt;
4097 drop = drop < 0.0f ? -drop : drop;
4099 if (drop < 0.10000000149011612f && area >= 0) {
4100 pos[1] = 1.0f + hit[1];
4108 pos[1] = 1.0f + hit[1];
4112 pos[1] = 1.0f + hit[1];
4120 sceVu0CopyVector(position, pos);
4131void MoveEditCursor() {
4133 float camera_distance[3] = {1000.0f, 2000.0f, 4000.0f};
4134 float camera_height[3] = {1000.0f, 1400.0f, 2000.0f};
4136 static int camera_dist_mode = 0;
4138 float cursor_scale[3] = {1.0f, 1.2f, 1.5f};
4140 if (MapNo == TOWN_YELLOW_DROPS) {
4141 cursor_scale[0] *= 0.6f;
4150 camera_angle = EditCamera.
GetAngle();
4151 right = EdGetLXf(2);
4152 forward = EdGetLYf(2);
4154 sceVu0CopyVector(pos, ECursorFrame->
position);
4156 int area_code = pEditGround->
GetAreaCode(pos[0], pos[1], pos[2]);
4159 if (EdPadDown(0xF000, 2) != 0) {
4160 if (area_code >= 0) {
4161 area = pEditGround->
areas[area_code];
4167 if (EdPadDown(0x1000, 2) != 0) {
4171 if (EdPadDown(0x4000, 2) != 0) {
4175 if (EdPadDown(0x2000, 2) != 0) {
4179 if (EdPadDown(0x8000, 2) != 0) {
4185 step_x = right * cosf(camera_angle) + forward * sinf(camera_angle);
4186 step_z = forward * cosf(camera_angle) - right * sinf(camera_angle);
4188 sceVu0CopyVector(pos, ECursorFrame->
position);
4191 if (pEditGround->
GetAreaCode(pos[0] + step_x, pos[1], pos[2] + step_z) < 0) {
4196 float scale = cursor_scale[camera_dist_mode];
4198 step_x = 10.0f * step_x * scale;
4199 step_z = 10.0f * step_z * scale;
4202 float move[4] = {step_x, 0.0f, step_z, 0.0f};
4204 LimitEditCursorPos(pos, move);
4206 if (move[0] != 0.0f || move[2] != 0.0f) {
4207 DrawPartsNameCount = 0;
4213 area->
GetGrid(&grid, pos[0], pos[1], pos[2]);
4217 pos[0] = grid.
x + half;
4218 pos[2] = grid.
z + half;
4219 ECursorFrame->SetPosition(pos);
4222 MoveCamera(&EditCamera);
4223 EditCamera.
SetDistance(camera_distance[camera_dist_mode]);
4224 EditCamera.
SetHeight(camera_height[camera_dist_mode]);
4226 if (MapNo == TOWN_YELLOW_DROPS) {
4227 EditCamera.
SetDistance(0.2f * camera_distance[camera_dist_mode]);
4228 EditCamera.
SetHeight(0.6f * camera_height[camera_dist_mode]);
4229 cursor_scale[0] *= 0.6f;
4232 float scale = cursor_scale[camera_dist_mode];
4234 ECursorFrame->SetScale(scale, scale, scale);
4236 if (!(camera_dist_mode < 2)) {
4237 camera_dist_mode = 0;
4240 ECursorFrame->SetPosition(pos[0], pos[1], pos[2]);
4243 sceVu0CopyVector(parts_pos, ECursorFrame->
position);
4245 if (PI_SHORT * (
float) NowSelectAngle / 2.0f == NowCursorRotY) {
4246 if (EdPadDown(2, 2) != 0) {
4247 OldSelectAngle = NowSelectAngle;
4248 NowSelectAngle = NowSelectAngle - 1;
4249 }
else if (EdPadDown(1, 2) != 0) {
4250 OldSelectAngle = NowSelectAngle;
4251 NowSelectAngle = NowSelectAngle + 1;
4255 if (NowSelectAngle > 2) {
4256 NowSelectAngle = -1;
4259 if (NowSelectAngle < -1) {
4263 NowCursorRotY = AngleInterpolate(NowCursorRotY, PI_SHORT * (
float) NowSelectAngle / 2.0f, 0.1f,
INTERPOLATE_STEP);
4265 int menu_mode = EditMenuStatus.
mode;
4267 OldFocusParts = NowFocusParts;
4268 NowFocusParts = pEditGround->
GetParts(pos[0], pos[1], pos[2]);
4269 static int parts_no = 0;
4271 if ((u_int) EditMenuStatus.
mode < 2 && EdPadDown(0x40, 2) != 0) {
4274 if (MapNo == TOWN_YELLOW_DROPS) {
4278 int plot = pEditGround->
SetMapParts(NowSelectParts, parts_pos[0], parts_pos[1], parts_pos[2], NowSelectAngle);
4282 SndSePlay(sound_id, -1, 0);
4286 if (EditMenuStatus.
mode == EDIT_MENU_MODE_REPLACE || (info != NULL && info->
stock > 0 && info->
placed == info->
stock)) {
4287 menu_mode = EDIT_MENU_MODE_MOVE;
4288 NowSelectParts = -1;
4295 if (EditMenuStatus.
mode == EDIT_MENU_MODE_MOVE) {
4299 if (EdPadDown(0x80, 2) != 0 && pEditGround->
DeleteMapParts(&deleted_parts, &deleted_angle, parts_pos[0], parts_pos[1], parts_pos[2]) >= 0) {
4303 pEditGround->
SetFocusParts(parts_pos[0], parts_pos[1], parts_pos[2]);
4305 if (EdPadDown(0x40, 2) != 0) {
4309 if (NowFocusParts != NULL) {
4310 int width = NowFocusParts->
GetWidth();
4312 if (width * NowFocusParts->
GetHeight() > 0) {
4315 NowPartsCursorPos[1] = pEditGround->
GetAlt(pos[0], pos[1], pos[2]);
4321 NowCursorPos[1] = alt;
4325 if (pEditGround->
DeleteMapParts(&taken_parts, &taken_angle, parts_pos[0], parts_pos[1], parts_pos[2]) >= 0) {
4326 menu_mode = EDIT_MENU_MODE_REPLACE;
4327 NowSelectParts = taken_parts;
4328 NowSelectAngle = taken_angle;
4329 NowCursorRotY = PI_SHORT * (float) taken_angle / 2.0f;
4330 OldSelectAngle = taken_angle;
4331 EditMenuStatus.
parts = taken_parts;
4336 EditMenuStatus.
mode = menu_mode;
4338 if (GamePad.
Down2(PAD_CROSS) != 0) {
4339 pEditGround->
Clear();
4342 if (GamePad.
Down2(PAD_CIRCLE) != 0) {
4343 pEditGround->
Save(NULL);
4346 if (GamePad.
Down2(PAD_TRIANGLE) != 0) {
4347 pEditGround->
Load(NULL);
4350 if (pEditGround->
GetAreaCode(pos[0], pos[1], pos[2]) >= 0) {
4351 if (pos[1] < pEditGround->
GetAlt(pos[0], pos[1], pos[2])) {
4352 pos[1] = pEditGround->
GetAlt(pos[0], pos[1], pos[2]);
4356 ECursorFrame->SetPosition(pos[0], pos[1], pos[2]);
4357 sceVu0CopyVector(NextCursorPos, pos);
4359 if (NowFocusParts != NULL) {
4360 if (NowFocusParts->
GetWidth() > 1) {
4364 EditNameMes.
mes_no[0] = GetAtraMsgNo(MapNo, NowFocusParts->
parts_no);
4366 if (OldFocusParts != NowFocusParts) {
4370 if (DrawPartsNameCount > 0) {
4381 DrawPartsNameCount--;
4383 if (DrawPartsNameCount < 0) {
4384 DrawPartsNameCount = 0;
4388 EditCamera.
SetFollow(pos[0], pos[1], pos[2]);
4390 if (EditMenuStatus.
mode == EDIT_MENU_MODE_CLOSED) {
4393 EdEditMainHelpMes(CheckEditToWalk(walk));
4396 if ((u_int) EditMenuStatus.
mode < 2) {
4397 EdEditBuildHelpMes(NowSelectParts);
4400 if (EditMenuStatus.
mode == EDIT_MENU_MODE_MOVE) {
4401 EdEditMoveHelpMes();
4406u_int *parts_read_buffer;
4419 u_long128 *buffer = (u_long128 *) (DataBuffer__2.
base + DataBuffer__2.
used * 16);
4421 TexManager.Initialize(0x3FE0);
4422 TexManager.SetBuffer(buffer, 0x4E200);
4425 {
"#mes_frame_buff#640#" SCREEN_HEIGHT_STR
"#4", 0x1A, 0},
4426 {
"#fukidashibase#640#224#4", 0x1A, 0},
4427 {
"#fontbase#512#256#1", 0x1A, 0},
4428 {
"meswin/gaiji.img", 0x1A, 0},
4429 {
"meswin/fuki256.img", 0x1A, 0},
4430 {
"meswin/syst04.img", 0x1A, 0},
4432 char mes_path[64] =
"meswin/mes_tex.pak";
4434 if (LanguageCode > LANG_JAPANESE) {
4435 sprintf(mes_path,
"meswin/mes_tex_%d.pak", LanguageCode);
4438 LoadFile(mes_path, read_buffer, NULL);
4439 wait_now_loading_vsync();
4440 mes_blocks[3].
name = (
char *) GetPackFile(read_buffer,
"gaiji.img", NULL);
4441 mes_blocks[4].
name = (
char *) GetPackFile(read_buffer,
"fuki256.img", NULL);
4442 mes_blocks[5].
name = (
char *) GetPackFile(read_buffer,
"syst04.img", NULL);
4443 TexManager.LoadTextureBlock(-1, mes_blocks);
4447 LoadFile(
"gedit/system/esys_cmn.pak", read_buffer, &common_size);
4448 wait_now_loading_vsync();
4451 u_int *system_image = read_buffer + ((common_size >> 6) + 1) * 64;
4452 char system_path[64] =
"gedit/system/sys.img";
4454 if (LanguageCode > LANG_JAPANESE) {
4455 sprintf(system_path,
"gedit/system/sys_%d.img", LanguageCode);
4458 LoadFile(system_path, system_image, NULL);
4459 wait_now_loading_vsync();
4460 TexManager.EnterIMGFile((u_char *) GetPackFile(read_buffer,
"cursor.img", NULL), -1, 0, 0);
4461 TexManager.EnterIMGFile((u_char *) GetPackFile(read_buffer,
"e01t02.img", NULL), -1, 0, 0);
4464 {
"#water_buff#640#" HALF_BUFFER_HEIGHT_STR
"#4", 0x15, 0},
4465 {
"#shadow_buff#640#" HALF_BUFFER_HEIGHT_STR
"#4", 0x16, 0},
4466 {
"#blender#640#" HALF_BUFFER_HEIGHT_STR
"#4", 0x18, 0},
4467 {
"#font_buff#640#" HALF_BUFFER_HEIGHT_STR
"#4", 0x1F, 0},
4468 {
"img/system.img", 0x14, 0},
4470 {
"s_eff.img", 0x14, 0},
4471 {
"img/ankfont.img", 0x1F, 0},
4472 {
"#frame_image#640#" SCREEN_HEIGHT_STR
"#4", 0x13, 0},
4475 blocks[4].
name = (
char *) GetPackFile(read_buffer,
"sys_cmn.img", NULL);
4476 blocks[5].
name = (
char *) system_image;
4477 blocks[6].
name = (
char *) GetPackFile(read_buffer,
"s_eff.img", NULL);
4478 blocks[7].
name = (
char *) GetPackFile(read_buffer,
"ankfont.img", NULL);
4479 TexManager.LoadTextureBlock(-1, blocks);
4480 wait_now_loading_vsync();
4485 CharaCursor0 = LoadMDSFile(GetPackFile(read_buffer,
"cursor01.mds", NULL), &EtcDataBuffer, 0, NULL, NULL);
4486 CharaCursor0->SetAttr(cursor_attr, 1, 0x200);
4487 CharaCursor1 = LoadMDSFile(GetPackFile(read_buffer,
"cursor02.mds", NULL), &EtcDataBuffer, 0, NULL, NULL);
4488 CharaCursor1->SetAttr(cursor_attr, 1, 0x200);
4490 CharaCursor1->SetScale(2.5f, 2.5f, 2.5f);
4491 CharaCursor2 = LoadMDSFile(GetPackFile(read_buffer,
"bic.mds", NULL), &EtcDataBuffer, 0, NULL, NULL);
4492 CharaCursor2->SetAttr(cursor_attr, 1, 0x200);
4493 TreasureCursor = LoadMDSFile(GetPackFile(read_buffer,
"ibox_0.mds", NULL), &EtcDataBuffer, 0, NULL, NULL);
4494 TreasureCursorOpen = LoadMDSFile(GetPackFile(read_buffer,
"ibox_1.mds", NULL), &EtcDataBuffer, 0, NULL, NULL);
4501 if (TreasureCursor != NULL) {
4502 TreasureCursor->SetAttr(box_attr, 1, 0x44);
4505 if (TreasureCursorOpen != NULL) {
4506 TreasureCursorOpen->SetAttr(box_attr, 1, 0x44);
4509 SystemEffect[0].
texture = TexManager.GetTexture(
"s_ef01", -1);
4511 char stay_path[128];
4517 effect_rect.
width = 0x20;
4518 effect_rect.
height = 0x20;
4519 SystemEffect[0].
texel = effect_rect;
4523 GetEditDataDir(stay_path);
4524 strcat(stay_path,
"img.pak");
4526 u_int *menu_data = (u_int *) (EdNPCBuffer.
base + EdNPCBuffer.
used * 16);
4528 LoadFileMenuData(
"stayframe.img", menu_data);
4529 wait_now_loading_vsync();
4530 TexManager.EnterFixTextureZ((u_char *) menu_data);
4531 StayTexture = TexManager.GetTexture(
"stayframe", -1);
4533 if (LoadFile2(stay_path, menu_data, NULL, 0) != 0) {
4534 wait_now_loading_vsync();
4539 while (EditMapInfo->
images[image].
name[0] !=
'\0') {
4540 blocks[entered].
name = (
char *) GetPackFile(menu_data, EditMapInfo->
images[image].
name, NULL);
4547 blocks[entered].
name = NULL;
4549 blocks[entered].
mipmap =
false;
4550 TexManager.LoadTextureBlock(-1, blocks);
4554 char *anime_cfg = (
char *) GetPackFile(menu_data,
"texanime.cfg", &anime_size);
4556 if (anime_cfg != NULL) {
4557 for (
int i = 0; i < 64; i++) {
4569 while (EditMapInfo->
images[image].
name[0] !=
'\0') {
4580 TexManager.LoadTextureBlock(-1, map_blocks, read_buffer);
4584 DataBuffer__2.Alloc((
int) (TexManager.
buffer + TexManager.
buffer_size - buffer) + 16);
4585 DataBuffer__2.Align64();
4592 u_long128 *buffer = (u_long128 *) (DataBuffer__2.
base + DataBuffer__2.
used * 16);
4594 TexManager.Initialize(0x3FE0);
4595 TexManager.SetBuffer(buffer, 0x4E200);
4598 {
"#mes_frame_buff#640#448#4", 0x1A, 0},
4599 {
"#fukidashibase#640#224#4", 0x1A, 0},
4600 {
"#fontbase#512#256#1", 0x1A, 0},
4601 {
"meswin/gaiji.img", 0x1A, 0},
4602 {
"meswin/fuki256.img", 0x1A, 0},
4603 {
"meswin/syst04.img", 0x1A, 0},
4606 LoadFile(
"meswin/mes_tex.pak", read_buffer, NULL);
4607 wait_now_loading_vsync();
4608 mes_blocks[3].
name = (
char *) GetPackFile(read_buffer,
"gaiji.img", NULL);
4609 mes_blocks[4].
name = (
char *) GetPackFile(read_buffer,
"fuki256.img", NULL);
4610 mes_blocks[5].
name = (
char *) GetPackFile(read_buffer,
"syst04.img", NULL);
4611 TexManager.LoadTextureBlock(-1, mes_blocks);
4613 char system_path[64] =
"gedit/system/esys.pak";
4615 if (LanguageCode > LANG_JAPANESE) {
4616 sprintf(system_path,
"gedit/system/esys_%d.pak", LanguageCode);
4619 LoadFile(system_path, read_buffer, NULL);
4620 wait_now_loading_vsync();
4621 TexManager.EnterIMGFile((u_char *) GetPackFile(read_buffer,
"e01t02.img", NULL), -1, 0, 0);
4622 TexManager.EnterIMGFile((u_char *) GetPackFile(read_buffer,
"cursor.img", NULL), -1, 0, 0);
4625 {
"#water_buff#640#224#4", 0x15, 0},
4626 {
"#shadow_buff#640#224#4", 0x16, 0},
4627 {
"#blender#640#224#4", 0x18, 0},
4628 {
"#font_buff#640#224#4", 0x1F, 0},
4629 {
"img/system.img", 0x14, 0},
4630 {
"img/pause.img", 0x14, 0},
4631 {
"s_eff.img", 0x14, 0},
4632 {
"whatsday.img", 0x14, 0},
4633 {
"img/ankfont.img", 0x1F, 0},
4634 {
"#frame_image#640#448#4", 0x13, 0},
4637 blocks[4].
name = (
char *) GetPackFile(read_buffer,
"system.img", NULL);
4638 blocks[5].
name = (
char *) GetPackFile(read_buffer,
"pause.img", NULL);
4639 blocks[6].
name = (
char *) GetPackFile(read_buffer,
"s_eff.img", NULL);
4640 blocks[7].
name = (
char *) GetPackFile(read_buffer,
"whatsday.img", NULL);
4641 blocks[8].
name = (
char *) GetPackFile(read_buffer,
"ankfont.img", NULL);
4642 TexManager.LoadTextureBlock(-1, blocks);
4643 wait_now_loading_vsync();
4648 CharaCursor0 = LoadMDSFile(GetPackFile(read_buffer,
"cursor01.mds", NULL), &EtcDataBuffer, 0, NULL, NULL);
4649 CharaCursor0->SetAttr(cursor_attr, 1, 0x200);
4650 CharaCursor1 = LoadMDSFile(GetPackFile(read_buffer,
"cursor02.mds", NULL), &EtcDataBuffer, 0, NULL, NULL);
4651 CharaCursor1->SetAttr(cursor_attr, 1, 0x200);
4653 CharaCursor1->SetScale(2.5f, 2.5f, 2.5f);
4654 CharaCursor2 = LoadMDSFile(GetPackFile(read_buffer,
"bic.mds", NULL), &EtcDataBuffer, 0, NULL, NULL);
4655 CharaCursor2->SetAttr(cursor_attr, 1, 0x200);
4656 TreasureCursor = LoadMDSFile(GetPackFile(read_buffer,
"ibox_0.mds", NULL), &EtcDataBuffer, 0, NULL, NULL);
4657 TreasureCursorOpen = LoadMDSFile(GetPackFile(read_buffer,
"ibox_1.mds", NULL), &EtcDataBuffer, 0, NULL, NULL);
4664 if (TreasureCursor != NULL) {
4665 TreasureCursor->SetAttr(box_attr, 1, 0x44);
4668 if (TreasureCursorOpen != NULL) {
4669 TreasureCursorOpen->SetAttr(box_attr, 1, 0x44);
4672 SystemEffect[0].
texture = TexManager.GetTexture(
"s_ef01", -1);
4674 char stay_path[128];
4680 effect_rect.
width = 0x20;
4681 effect_rect.
height = 0x20;
4682 SystemEffect[0].
texel = effect_rect;
4686 GetEditDataDir(stay_path);
4687 strcat(stay_path,
"img.pak");
4689 u_int *menu_data = (u_int *) (EdNPCBuffer.
base + EdNPCBuffer.
used * 16);
4691 LoadFileMenuData(
"stayframe.img", menu_data);
4692 wait_now_loading_vsync();
4693 TexManager.EnterFixTextureZ((u_char *) menu_data);
4694 StayTexture = TexManager.GetTexture(
"stayframe", -1);
4696 if (LoadFile2(stay_path, menu_data, NULL, 0) != 0) {
4697 wait_now_loading_vsync();
4702 while (EditMapInfo->
images[image].
name[0] !=
'\0') {
4703 blocks[entered].
name = (
char *) GetPackFile(menu_data, EditMapInfo->
images[image].
name, NULL);
4710 blocks[entered].
name = NULL;
4712 blocks[entered].
mipmap =
false;
4713 TexManager.LoadTextureBlock(-1, blocks);
4717 char *anime_cfg = (
char *) GetPackFile(menu_data,
"texanime.cfg", &anime_size);
4719 if (anime_cfg != NULL) {
4720 for (
int i = 0; i < 64; i++) {
4732 while (EditMapInfo->
images[image].
name[0] !=
'\0') {
4743 TexManager.LoadTextureBlock(-1, map_blocks, read_buffer);
4747 DataBuffer__2.Alloc((
int) (TexManager.
buffer + TexManager.
buffer_size - buffer) + 16);
4748 DataBuffer__2.Align64();
4757void EdLoadMainChara(
char *pack_path,
char *info_name,
CDataAlloc2<1> *arena) {
4760 if (arena == NULL) {
4761 arena = &CharaBuffer;
4762 CharaBuffer.
used = 0;
4765 LoadFile(pack_path, read_buffer, NULL);
4768 for (i = 0; i < 128; i++) {
4773 MainChara.
LoadPackData2(read_buffer, info_name, arena, 8, arena, 0);
4777 MainChara.
frame->SetAttr(attr, 1, 4);
4781 float origin = 0.0f;
4794void LoadGroundData() {
4795 parts_read_buffer = read_buffer;
4799 GetEditDataDir(pack_path);
4800 strcat(pack_path,
"mds.pak");
4801 LoadPackFile(pack_path, parts_read_buffer, NULL);
4802 wait_now_loading_vsync();
4811 pEditGround->
map_no = NowEditMap;
4813 char *sun_names[4] = {
"sun1",
"sun2",
"sun3",
"moon"};
4815 for (
int i = 0; i < 4; i++) {
4825 SkyFrame[i] = LoadMDSFile(data, &DataBuffer__2, 0, NULL, NULL);
4826 SkyFrame[i]->SetAttr(layer_attr, 1, 0x1000);
4828 for (
int j = 0; j < 8; j++) {
4832 InitObjAnime(SkyFrame[i], &anime[no]);
4842 SunFrame[i] = LoadMDSFile(data, &DataBuffer__2, 0, NULL, NULL);
4843 SunFrame[i]->SetAttr(layer_attr, 1, 0x1000);
4846 if (SunFrame[i] != NULL) {
4847 sceVu0FMATRIX world;
4849 sceVu0UnitMatrix(world);
4850 SunFrame[i]->SetTransMatrix(world);
4851 SunFrame[i]->SetRotation(0.5f, 0.0f, 0.0f);
4852 SunFrame[i] = SunFrame[i]->SearchFrame(sun_names[i]);
4856 SkyBackFrame = NULL;
4865 SkyBackFrame = LoadMDSFile(data, &DataBuffer__2, 6, NULL, NULL);
4866 SkyBackFrame->SetAttr(back_attr, 1, 0x1200);
4869 for (
int i = 0; i < 4; i++) {
4872 pEditGround->
areas[i] = NULL;
4874 if (info->
name[0] !=
'\0') {
4875 data = (u_int *) EdLoadFile(info->
name);
4879 EditArea[i].
SetGridFrame(LoadMDSFile(data, &DataBuffer__2, 6, NULL, NULL));
4884 EditArea[i].
GetGridFrame()->SetAttr(grid_attr, 1, 0x40);
4885 pEditGround->
areas[i] = &EditArea[i];
4890 data = (u_int *) EdLoadFile(
"gedit/e01/mds/e01a03_0.mds");
4892 pEditGround->
cursor.
pieces[0] = LoadMDSFile(data, &DataBuffer__2, 0, NULL, NULL);
4894 data = (u_int *) EdLoadFile(
"gedit/e01/mds/e01a04_0.mds");
4896 pEditGround->
cursor.
pieces[1] = LoadMDSFile(data, &DataBuffer__2, 0, NULL, NULL);
4898 data = (u_int *) EdLoadFile(
"gedit/e01/mds/e01a05_0.mds");
4900 pEditGround->
cursor.
pieces[2] = LoadMDSFile(data, &DataBuffer__2, 0, NULL, NULL);
4908 wait_now_loading_vsync();
4910 for (
int i = 0; i < 4; i++) {
4915 if (info->
name[0] !=
'\0') {
4916 data = (u_int *) EdLoadFile(info->
name);
4918 MotionParts[i].
LoadPackData2(data,
"info.cfg", &DataBuffer__2, i + 0x1B, &DataBuffer__2, 0);
4924 scn_data = (u_int *) (EdNPCBuffer.
base + EdNPCBuffer.
used * 16);
4926 char scene_path[64];
4929 GetEditDataDir(scene_path);
4932 if (LoadFile2(scene_path, (
void *) scn_data, &scene_size, 0) == 0) {
4937 if (scn_data != NULL) {
4938 parts_read_buffer = (u_int *) ((
char *) scn_data + (((scene_size >> 6) + 1) << 6));
4940 parts_read_buffer = read_buffer;
4943 while (check_now_loading() == 0) {
4957 struct LOADED_PARTS {
4964 for (i = 0; i < 64; i++) {
4965 built[i].name[0] =
'\0';
4968 int built_count = 0;
4973 if (info->
name[0][0] ==
'\0' && info->
name[1][0] ==
'\0' && info->
name[2][0] ==
'\0' && info->
name[3][0] ==
'\0') {
4981 u_int *pts = SearchPTS(scn_data, info->
name[0]);
4986 for (
int j = 0; j < built_count; j++) {
4987 if (strcmp(info->
name[0], built[j].name) == 0) {
4988 shared = built[j].parts;
4993 LoadPTS(parts, pts, info, anime, effects, timers, points, shared);
4995 char *c = info->
name[0];
4999 for (; (letter = *c) !=
'\0'; c++) {
5000 if (letter ==
'/') {
5005 if (strcmp(base,
"e02c13") == 0) {
5013 door = door->SearchFrame(
"cube1");
5017 door->SetAttr(door_attr, 1, 0x40);
5027 if (shared == NULL) {
5028 strcpy(built[built_count].name, info->
name[0]);
5029 built[built_count].parts = parts;
5033 LoadPTS(parts, info, anime, effects, timers, points);
5042 int kind = info->
kind;
5048 for (i = 0; i < 4; i++) {
5066 surface->
draw =
true;
5071 for (
int j = 0; j < 3; j++) {
5075 for (
int j = 0; j < 4; j++) {
5079 water->SetVertex(near_left, near_right, far_left, far_right);
5083 water->SetColor(info->
red, info->
green, info->
blue, 0x80);
5092void LoadObjectParts() {
5093 char name_buffer[7][0x40];
5099 struct LOADED_PARTS {
5109 for (
int i = 0; i < 7; i++) {
5110 names[i] = name_buffer[i];
5118 for (i = 0; i < 64; i++) {
5119 loaded[i].name[0] =
'\0';
5122 int loaded_count = 0;
5124 for (i = 0; i < 46; i++) {
5126 int has_archive = 0;
5143 parts = &RiverParts[river];
5148 parts = &RoadParts[road];
5156 parts = &ObjParts[i];
5161 for (
int j = 0; j < loaded_count; j++) {
5162 if (strcmp(info->
name[0], loaded[j].name) == 0) {
5163 shared = loaded[j].parts;
5168 u_int *archive = SearchPTS(scn_data, info->
name[0]);
5170 if (archive != NULL) {
5177 for (
int j = 0; j < 24; j++) {
5178 if (info->
subtype == ObjParts[j].subtype) {
5185 int kind = info->
kind;
5195 if (has_archive != 0) {
5196 header = LoadPTS(parts, archive, info, anime, effects, timers, points, shared);
5203 LoadPTS(parts, info, anime, effects, timers, points);
5212 if (parts->
frame[3] != NULL) {
5214 }
else if (parts->
frame[2] != NULL) {
5216 }
else if (parts->
frame[1] != NULL) {
5218 }
else if (parts->
frame[0] != NULL) {
5222 if (shared == NULL) {
5223 strcpy(loaded[loaded_count].name, info->
name[0]);
5224 loaded[loaded_count].parts = parts;
5260 memcpy(header, source, source->
data_size);
5261 header->
cell = (u8 *) header + (
int) source->
cell;
5263 for (i = 0; i < 6; i++) {
5280 if (shared != NULL) {
5281 CopyCMapParts(parts, shared, &DataBuffer__2);
5283 char *names[9] = {NULL};
5323 LoadMapObject(parts, (u_int **) names, &DataBuffer__2);
5330 for (
int k = 0; k < 9; k++) {
5334 for (
int k = 0; k < 4; k++) {
5344 frames[8] = GetCameraFrame(parts);
5346 if (frames[0] == NULL) {
5350 frames[0]->GetBoundBox(&bound, 1);
5353 if (frame != NULL) {
5354 frame->GetBoundBox(&part_bound, 1);
5355 VectorMaxMin(bound.
max, bound.
min, bound.
max, bound.
min, part_bound.
max, part_bound.
min);
5358 frame = GetCameraFrame(parts);
5360 if (frame != NULL) {
5361 frame->GetBoundBox(&part_bound, 1);
5362 VectorMaxMin(bound.
max, bound.
min, bound.
max, bound.
min, part_bound.
max, part_bound.
min);
5367 for (
int k = 0; k < 8; k++) {
5368 int anime_no = info->
anime[k];
5371 InitObjAnime(frames, &anime[anime_no]);
5381 for (i = 0; i < header->
func_count; i++, func++) {
5387 EnterPartsEffect(parts, func, effects, 0x40);
5393 if (func->
kind == EPARTS_FUNC_OBJ_TIMER) {
5406 if (func->
kind == EPARTS_FUNC_VILLAGER) {
5408 func->
parts = parts;
5412 sceVu0FVECTOR position = {0.0f, 0.0f, 0.0f, 1.0f};
5432 if (info == NULL || info->
name[0][0] ==
'\0') {
5436 for (
int i = 0; i < 9; i++) {
5437 names[i] = info->
name[i];
5440 LoadMapObject(parts, names);
5442 for (
int i = 0; i < 4; i++) {
5447 if (frames[0] != NULL) {
5448 frames[0]->GetBoundBox(&bound, 1);
5451 if (collision != NULL) {
5452 collision->GetBoundBox(&part_bound, 1);
5453 VectorMaxMin(bound.
max, bound.
min, bound.
max, bound.
min, part_bound.
max, part_bound.
min);
5458 if (camera_frame == NULL) {
5459 camera_frame = NULL;
5461 camera_frame->SetPosition(parts->
pos[0], parts->
pos[1], parts->
pos[2]);
5466 if (camera_frame != NULL) {
5467 camera_frame->GetBoundBox(&part_bound, 1);
5468 VectorMaxMin(bound.
max, bound.
min, bound.
max, bound.
min, part_bound.
max, part_bound.
min);
5471 parts->
bound = bound;
5478void LoadMapObject(
CMapParts *map_parts,
char **script) {
5493 sceVif1PkCnt(packet, 0);
5494 sceVif1PkOpenDirectCode(packet, 0);
5495 sceVif1PkOpenGifTag(packet, *(u_long128 *) &GiftagAD);
5496 sceVif1PkAddGsAD(packet, SCE_GS_TEX1_1, 0x41);
5497 sceVif1PkAddGsAD(packet, SCE_GS_PRIM, SCE_GS_SET_PRIM(4, 0, 1, 0, 1, 1, 1, 0, 0));
5501 test.bits.atst = SCE_GS_ALWAYS;
5503 test.bits.ztst = SCE_GS_ALWAYS;
5504 sceVif1PkAddGsAD(packet, SCE_GS_TEST_1, *(u_long *) &test);
5508 x[0] = x[2] = pivot_x * -16;
5509 x[1] = x[3] = ((screen.
width - pivot_x) << 4) - 1;
5510 y[0] = y[1] = pivot_y * -16;
5511 y[2] = y[3] = ((screen.
height - pivot_y) << 4) - 1;
5513 for (i = 0; i < 4; i++) {
5514 float turned_x = y[i] * cosf(angle) + x[i] * sinf(angle);
5515 float turned_y = x[i] * cosf(angle) - y[i] * sinf(angle);
5517 x[i] = (int) turned_x + (screen.
x << 4) + 27648;
5518 y[i] = (int) (0.5f * turned_y) + (screen.
y << 3) + GS_Y_OFFSET;
5521 sceVif1PkAddGsAD(packet, SCE_GS_ZBUF_1, *(u_long *) &zbuf);
5522 sceVif1PkAddGsAD(packet, SCE_GS_RGBAQ, SCE_GS_SET_RGBAQ(0x80, 0x80, 0x80, alpha, *(u_int *) &q));
5523 sceVif1PkAddGsAD(packet, SCE_GS_TEX0_1, texture->
tex0);
5524 sceVif1PkAddGsAD(packet, SCE_GS_UV, SCE_GS_SET_UV(texel.
x << 4, texel.
y << 4));
5525 sceVif1PkAddGsAD(packet, SCE_GS_XYZF2, SCE_GS_SET_XYZF2(x[0], y[0], 0, 0));
5526 sceVif1PkAddGsAD(packet, SCE_GS_UV, SCE_GS_SET_UV((texel.
x + screen.
width) << 4, texel.
y << 4));
5527 sceVif1PkAddGsAD(packet, SCE_GS_XYZF2, SCE_GS_SET_XYZF2(x[1], y[1], 0, 0));
5528 sceVif1PkAddGsAD(packet, SCE_GS_UV, SCE_GS_SET_UV(texel.
x << 4, (texel.
y + texel.
height) << 4));
5529 sceVif1PkAddGsAD(packet, SCE_GS_XYZF2, SCE_GS_SET_XYZF2(x[2], y[2], 0, 0));
5530 sceVif1PkAddGsAD(packet, SCE_GS_UV, SCE_GS_SET_UV((texel.
x + texel.
width) << 4, (texel.
y + texel.
height) << 4));
5531 sceVif1PkAddGsAD(packet, SCE_GS_XYZF2, SCE_GS_SET_XYZF2(x[3], y[3], 0, 0));
5532 sceVif1PkAddGsAD(packet, SCE_GS_TEST_1, *(u_long *) &mgPixelTest);
5533 sceVif1PkAddGsAD(packet, SCE_GS_ZBUF_1, *(u_long *) &mgZBuffer);
5534 sceVif1PkCloseGifTag(packet);
5535 sceVif1PkCloseDirectCode(packet);
5547 for (
int i = 0; i < 4; i++) {
5548 to->SetFrame(CopyFrameVu1(from->
frame[i], arena), i);
5556 if (camera_frame == NULL) {
5557 camera_frame = NULL;
5559 camera_frame->SetPosition(from->
pos[0], from->
pos[1], from->
pos[2]);
5571int GetPosRot(
CMapObject *
object,
float *position,
float *rotation) {
5572 if (
object == NULL) {
5576 CFrame *frame =
object->frame[0];
5578 if (frame == NULL) {
5582 sceVu0FVECTOR local_position;
5583 sceVu0CopyVector(local_position, object->
pos);
5584 frame->SetPosition(local_position);
5586 frame->GetWorldPosition(position, position);
5587 sceVu0FVECTOR frame_rotation;
5588 frame->GetRotation(frame_rotation);
5590 rotation[1] = frame_rotation[1] + rotation[1];
5593 if (!(rotation[1] <= PI_SHORT)) {
5594 rotation[1] -= TWO_PI_SHORT;
5597 if (rotation[1] < -PI_SHORT) {
5598 rotation[1] += TWO_PI_SHORT;
5608 for (
int i = 1; i < count; i++) {
5609 if (points[i].event_type == ED_EVENT_POINT_NONE) {
5621 if (point == NULL) {
5625 if (point->enabled == 0) {
5629 if (point->event_type <= ED_EVENT_POINT_NONE) {
5633 int flag = point->completion_flag;
5635 if (flag > 0 && EdGetMapFlag(flag) != 0) {
5639 CFrame *frame = point->frame;
5641 if (frame != NULL && !(frame->
attr.
draw_on & 1)) {
5645 if (EdCheckTime(time, point->start_time, point->end_time) == 0) {
5649 if (point->event_type == ED_EVENT_POINT_ITEM_BOX) {
5650 int dungeon = MapNo;
5652 if (dungeon == 11) {
5656 if (dungeon == 13) {
5660 if (dungeon == 33) {
5664 if (dungeon == 19) {
5668 if (dungeon == 42) {
5672 if (dungeon == 23) {
5676 if (dungeon == 38) {
5680 if (dungeon == 40) {
5687 int wanted = point->minimum_progress;
5689 if (wanted > 0 && reached < wanted) {
5700#pragma argument_flag 0
5701#pragma argument_flag_ones 1754, 1762, 1770, 1778, 1795, 1801, 1909, 1939, 1941, 1942
5702#pragma argument_flag_ones 1944, 1949, 1951, 1952, 1954, 1959, 1961, 1962, 1964, 1969
5703#pragma argument_flag_ones 1971, 1972, 1974, 1979, 1981, 1982, 1984, 1989, 1991, 1992
5704#pragma argument_flag_ones 1994
5706#pragma argument_flag 0
5707#pragma argument_flag_ones 3504, 3512, 3520, 3528, 3545, 3551, 3659, 3689, 3691, 3692
5708#pragma argument_flag_ones 3694, 3699, 3701, 3702, 3704, 3709, 3711, 3712, 3714, 3719
5709#pragma argument_flag_ones 3721, 3722, 3724, 3729, 3731, 3732, 3734, 3739, 3741, 3742
5710#pragma argument_flag_ones 3744
void SetHeight(float height)
void SetFollow(float x, float y, float z)
void SetAngleSoon(float angle)
void AddAngle(float delta)
void SetDistance(float distance)
virtual void Step(int steps)
void AddHeight(float delta)
virtual void Step(int steps)
void GetCameraMatrix(float(*matrix)[4])
void SetRef(CFrame *parent, float x, float y, float z)
void SetPos(CFrame *parent, float x, float y, float z)
void SetSpeed(float speed)
void SetMotion(int no, int mode, float speed=-1.0f)
virtual void GetPosition(float *out_position)
virtual void LoadPackData2(unsigned int *pack, char *name, CDataAlloc2< 1 > *alloc, int texture_block_no, CDataAlloc2< 1 > *image_alloc, int visual_type)
void InitializeTexAnime(CTexAnimeData *data, int count)
void SetFootSoundID(int id)
sceVu0FVECTOR ground_ambient[2]
virtual void ShadowStep()
static s32 MotionStopFlag
virtual void SetRotation(float x, float y, float z)
void FootSoundEnable(int on)
void TextureAnime(int step)
virtual void Initialize()
virtual void SetPosition(float x, float y, float z)
int SetPointLight(float *pos, float inner_range, float outer_range, float red, float green, float blue, float alpha)
virtual void ClothStep(int step)
void SetMapInfo(int map_no, int area_id)
void SetOffset(float x, float y, float z)
void SetGridFrame(CFrameVu1 *frame)
CFrameVu1 * GetGridFrame()
void SetSize(int width, int height, float unit_size, float unit_alt)
int GetPartsID(int x, int y)
void GetPos(CVector3_i_ *position, float x, float y, float z)
void GetGrid(CVector3_f_ *snapped, float x, float y, float z)
void SetBuildEffect(int parts_id)
void DrawPartsCursor(int plot, float *position, float *model_pos, int rot_y, float *rotation, int area_no)
void DrawRipple(int pass)
int SetMapParts(int parts_no, float x, float y, float z, int rot_y)
void Draw(float time, int pass, int lowest, int highest, int fixed_lowest, int fixed_highest)
float GetAlt(float x, float y, float z)
int GetAreaCode(float x, float y, float z)
CMapParts * GetParts(float x, float y, float z)
void DrawWaterSurface(CCamera *camera)
void EditAreaClip(CCamera *camera, float range)
EPARTS_FUNC_DATA * people[128]
int SetFocusParts(float x, float y, float z)
int PickUpPoly(CCPoly *polygons, float x, float y, float z)
CGroundWater water_surfaces[4]
CEditPartsInfo * parts_info
CMapParts fixed_parts[64]
void DrawEffect(CCameraFollow *camera, float time, CEffectGroup *effects)
void DrawShadow(int pass, float near_distance, float far_distance)
int GetNearParts(CMapParts **out_parts, int limit, CBoxVu0 *box, CBoxVu0 *fixed_box)
int DeleteMapParts(int *out_parts_no, int *out_rot_y, float x, float y, float z)
void Initialize(int georama_no)
void Save(int georama_no, CSaveData *save_data)
int GetNextParts(int index)
int CheckComplete(int index)
EDITPARTS_INFO * GetPartsInfo(int index)
void Load(int georama_no, CSaveData *save_data, int load_requests)
void SetAutoRepeat(int mask, int initial_delay, int repeat_delay)
GROUND_WATER_RIPPLE ripples[4]
virtual void Initialize()
CFrameVu1 * collision_frame
CFrame * GetCollisionFrame()
virtual void FrameObjectOnOff(char *name, int on)
virtual void SetPosition(float *position)
virtual void SetRotation(float x, float y, float z)
void GetPosition(float *out_position)
EDIT_EFFECT_INFO * effect[MAP_PARTS_EFFECT_MAX]
virtual void ShadowStep()
virtual void GetRotation(float *out_rotation)
virtual void SetVelocity(CVector3_f_ velocity)
virtual void GetVelocity(CVector3_f_ *out_velocity)
void Set(float *position)
CDngStatusData * GetDngStatus()
SV_GRD_PART * GetParts(int georama_no, int *out_count)
void SetNowTime(float time)
int GetMapInitFlag(int map_no, int flag_no)
int GetGameFlag(int flag_no)
int SetMapFlag(int map_no, int flag_no, int value)
s16 * GetElemData(int georama_no)
int SetMapInitFlag(int map_no, int flag_no, int value)
int VisitMap(int map_no, int add)
void AddNowTime(float add)
SV_GEORAMA_DATA * GetGrdData(int georama_no)
int GetMapFlag(int map_no, int flag_no)
SV_EDIT_PARTS_INFO * GetEditPartsInfo(int georama_no, int plot_no)
void Initialize(CTexAnimeData *records, int count)
void TexAnime(int texture_block)
void LoadCFGFile(char *script, int script_size)
void SetVelocity(float speed)
void SetDir(float *direction)
void SetBuff(short *buff)
MES_LINE_POS line_pos[10]
int MakeMesWin(int mes_no)
void SetBuff_system(short *buff)
CDataAlloc2< 1 > * WorkBuffer__2
@ ED_EVENT_RETURN_CONTINUE
@ ED_EVENT_RETURN_FISHING
@ ED_EVENT_RETURN_MAP_JUMP
@ ED_EVENT_RETURN_INTERIOR
@ ED_EVENT_RETURN_DUNGEON
@ MAP_PARTS_SUBTYPE_RIVER
@ MAP_PARTS_SUBTYPE_BRIDGE
EDITPARTS_ELEMENT elements[6]
EDIT_MOTION_PARTS_INFO motion_parts[4]
MAP_PARTS_INFO map_objects[64]
float character_ambient[4][4]
EDIT_IMAGE_INFO images[64]
EDIT_MAP_PARTS_WORK parts_work
EDIT_SCENE_LAYER_INFO sun_layers[4]
EDIT_SCENE_LAYER_INFO sky_layers[5]
VILLAGER_INFO villagers[16]
EDIT_WATER_INFO water_surfaces[8]
EDIT_WATER_WAVE_INFO wave[4]
sceVu0FVECTOR ripple_params
sceVu0FMATRIX light_color
s32 main_texture_animation_count
sceVu0FVECTOR screen_filter_color
CTexAnimeData * main_texture_animation
s32 draw_exclamation_mark
CCharacter * main_character
VILLAGER_INFO * villagers
sceVu0FMATRIX light_direction
CEditGround * edit_ground
sceVu0FVECTOR ambient_color
C3DSprite * system_effect
EDIT_AREA_INFO edit_areas[444]
OBJ_ANIME_SEQ obj_anime[128]
EDIT_EFFECT_INFO second[64]
EDIT_EFFECT_INFO first[64]
EDIT_OBJECT_TIMER timers[128]
ED_EVENT_POINT points[256]