10#include "battlemenu.hpp"
16#include "collision.hpp"
17#include "dataalloc.hpp"
20#include "dispctrl.hpp"
24#include "editground.hpp"
25#include "editloop.hpp"
26#include "editloop3.hpp"
28#include "effectgroup.hpp"
29#include "effectmacro.hpp"
30#include "fireomni.hpp"
32#include "framevu1.hpp"
33#include "gamemode.hpp"
35#include "mainselect.hpp"
39#include "menu_misc.hpp"
41#include "npcharacter.hpp"
42#include "objanime.hpp"
45#include "scriptinterpreter.hpp"
57 ED_IN_MODE_DOOR_OPEN = 1,
62 ED_IN_MODE_MENU_INIT = 6,
78static void LoadInfo(
char *script,
int size);
79static void setTexAnim();
80static void StepWater();
81static void MainDraw();
82static void MoveCharacter();
84static int GetDoorPos(
int door_no,
float *position,
float *rotation,
int *door_sound,
int *motion);
85static void VillagerCollision();
86static int LoadTexture();
87static void LoadChara();
90int LoadPTS(
CMapParts *parts, u_int *archive);
100void DrawWaterSurface(
CCamera *camera);
109static int fix_camera = 1;
112static int camera_dist_mode = 1;
124static int camera_change_count;
127static int camera_num;
130static int door_open_cnt;
142static int obj_anime_num;
145static int effect_num;
157static int start_event_no;
160static int start_system_event;
166static int goto_return_menu;
169static int key_counter;
172static int loop_counter;
184static sceVu0FVECTOR fix_chara_pos;
187static sceVu0FVECTOR fix_chara_rot;
208static CCamera ViewCamera__2(4.0f);
211static CCamera ExitCamera(4.0f);
228void GetElementObjName(
EDITPARTS_INFO *info,
char **names,
int element,
int mode) {
235 if (element < 0 || element >= 6) {
239 if (mode < 0 || mode >= 4) {
253 while ((c = *text) !=
'\0') {
255 names[word][length] =
'\0';
259 names[word][length] = c;
266 names[word][length] =
'\0';
268 names[word][0] =
'\0';
282 LoadMDSFileLOD(frames, data, alloc, 1);
288 for (i = 1; i < 4; i++) {
289 if (frames[i] != NULL) {
290 frames[i]->SetAttr(attr, 1, 0x44);
291 SetFrameAttr(frames[i], 1);
297 frames[0]->SetAttr(attr, 1, 0);
298 SetFrameAttr(frames[0], 1);
300 for (i = 0; i < 4; i++) {
301 parts->SetFrame(frames[i], i);
304 if (data[4] != NULL) {
305 parts->
shadow_frame = LoadMDSFile(data[4], alloc, 14, NULL, NULL);
308 if (data[5] != NULL) {
314 if (data[6] != NULL) {
315 parts->
shade_frame = LoadMDSFile(data[6], alloc, 0, NULL, NULL);
318 if (data[7] != NULL) {
319 parts->
ripple_frame = LoadMDSFile(data[7], alloc, 0, NULL, NULL);
322 if (data[8] != NULL) {
323 parts->
camera_frame = LoadCollisionFile(data[8], alloc);
335static void LoadScript() {
336 char event_path[0x80];
337 char directory[0x40];
338 char message_path[0x40];
343 EdScriptBuffer.
used = 0;
344 EdEventData = (
char *) (EdScriptBuffer.
base + EdScriptBuffer.
used * 16);
345 sprintf(language,
"_%d.mes", LanguageCode);
346 strcpy(message_path, EdInInfo->
name);
347 int length = strlen(message_path);
350 char last = message_path[length - 1];
352 if (last ==
'm' || last ==
'n' || last ==
'e') {
353 message_path[length - 1] =
'\0';
357 strcat(message_path, language);
358 printf(
"mes = %s\n", message_path);
359 strcpy(directory, EdInInfo->
name);
360 char *cursor = directory;
361 char *slash = cursor;
364 while ((c = *cursor) !=
'\0') {
373 sprintf(event_path,
"%s/event.stb", directory);
375 if (LoadFile2(event_path, EdEventData, &size, 0) != 0) {
376 EdScriptBuffer.Alloc((size >> 4) + 1);
377 message_data = (
char *) (EdScriptBuffer.
base + EdScriptBuffer.
used * 16);
379 if (LoadFile2(message_path, message_data, &size, 0) != 0) {
380 EdScriptBuffer.Alloc((size >> 4) + 1);
385 EdSetEventScript(EdEventData, message_data, &EdScriptBuffer);
388 EdSetEventScript(NULL, NULL, &EdScriptBuffer);
392 EdScriptBuffer.Align64();
393 EdSystemEventData = (
char *) (EdScriptBuffer.
base + EdScriptBuffer.
used * 16);
395 if (LoadFile2(
"gedit/system/event.stb", EdSystemEventData, &size, 0) != 0) {
396 EdScriptBuffer.Alloc((size >> 4) + 1);
400 EdSystemEventData = NULL;
411static void RunEvent(
int event_no,
CCamera *camera) {
412 sceVu0FVECTOR position;
413 sceVu0FVECTOR reference;
415 if (start_event_no <= 0) {
416 if (camera != NULL) {
418 camera->
GetRef(reference);
419 EventCamera.
SetPos(position);
420 EventCamera.
SetRef(reference);
425 start_event_no = event_no;
437static void RunSystemEvent(
int event_no,
CCamera *camera) {
438 sceVu0FVECTOR position;
439 sceVu0FVECTOR reference;
441 if (start_system_event <= 0) {
442 if (camera != NULL) {
444 camera->
GetRef(reference);
445 EventCamera.
SetPos(position);
446 EventCamera.
SetRef(reference);
450 start_system_event = event_no;
462static void InitWorkBuffer() {
463 u_char *free_start = EdNPCBuffer.
base + EdNPCBuffer.
used * 16;
464 int free_quads = EdNPCBuffer.
limit - EdNPCBuffer.
used;
465 free_start = (u_char *) ((((
int) free_start >> 6) + 1) << 6);
466 EdWorkBuffer.
base = free_start;
467 EdWorkBuffer.
limit = free_quads - 4;
468 EdWorkBuffer.
used = 0;
469 int villagers_loaded;
471 if (EdVillagerBuffer.
used > 0) {
472 villagers_loaded = 1;
475 free_start = (u_char *) read_buffer;
476 EdMenuBuffer.
base = free_start - 0x180000;
477 EdMenuBuffer.
limit = 0x3A2E0;
478 EdMenuBuffer.
used = 0;
488int EditInInit(
float time,
char *name) {
489 MGSetFogParm(10000.0f, 50000.0f, 0, 0, 0, 255.0f, 255.0f);
492 strcpy(EdInInfo->
name, name);
493 PlayTimeCountFlag(1);
497 int hour = (int) (time / 3.0f);
498 EdNPCBuffer.
used = 0;
500 for (
int i = 0; i < 10; i++) {
508 if (bg_file != NULL) {
509 char *script_text = (
char *) EdNPCBuffer.Alloc((bg_file->
size >> 4) + 1);
510 memcpy(script_text, bg_file->
buffer, bg_file->
size);
511 LoadInfo(script_text, bg_file->
size);
515 int used = EdNPCBuffer.
used;
516 u_char *start = EdNPCBuffer.
base + used * 16;
517 int remaining = EdNPCBuffer.
limit - used;
518 EdVillagerBuffer.
base = start;
519 EdVillagerBuffer.
limit = remaining;
520 EdVillagerBuffer.
used = 0;
521 printf(
"buffer %d\n", remaining);
523 MGSetRenderInfo(EdInInfo->
projection, 5.0f, 65535.0f);
525 MGSetAmbient(EdInInfo->
ambient);
527 Chara = EdExchangeInfo.
player;
528 camera_dist_mode = 1;
534 EdFadeIn(0x40, 0.0f, 0.0f, 0.0f);
540 GetMapJumpPos(Chara);
543 if (EdInteriorDoorSound >= 0) {
544 sceVu0FVECTOR position;
545 sceVu0FVECTOR reference = {0.0f, 0.0f, 10.0f, 0.0f};
547 position[2] -= 10.0f;
548 SndSetCamera(position, reference);
550 EdDoorCloseSe(EdInteriorDoorSound, position);
554 active_camera = NULL;
555 camera_change_count = 0;
557 NowCamera = &MainCamera;
558 start_event_no = EdInteriorStartEvent;
559 start_system_event = -1;
561 goto_return_menu = 0;
568 printf(
"buffer %d\n", EdWorkBuffer.
limit - EdWorkBuffer.
used);
569 EdSaveFrameImageInit();
584 sceVu0FVECTOR position;
586 if (EdSystemMesCheck() || EdCheckItemOver()) {
589 EdSetKeyMode(0xFFFF);
592 if (EdPadDown(0x800, 4)) {
593 goto_return_menu = 1;
596 int hour = (int) (NowTime / 3.0f);
599 if (!EdCheckViewMode()) {
600 MGSetRenderInfo(EdInInfo->
projection, 5.0f, 65535.0f);
602 MGSetRenderInfo(600.0f, 4.0f, 65535.0f);
609 case ED_IN_MODE_MENU_INIT:
610 case ED_IN_MODE_MENU:
611 case ED_IN_MODE_PAUSE:
617 for (i = 0; i < obj_anime_num; i++, anime++) {
620 if (completion_flag <= 0 || EdGetMapFlag(completion_flag) == 0) {
629 if (fix_camera != 0 && camera_num > 0 &&
GameMode == ED_IN_MODE_WALK) {
630 SetCameraPos((
CFrame *) InteriorParts[0].frame[0], &MainCamera, Chara);
636 case ED_IN_MODE_WALK:
637 if (loop_counter > 0) {
643 for (
int i = 0; i < 10; i++) {
644 EdVillager[i].
Step();
649 NowCamera = &MainCamera;
651 if (EdCheckViewMode() != 0) {
652 NowCamera = &ViewCamera__2;
656 case ED_IN_MODE_EVENT: {
657 NowCamera = &EventCamera;
660 int result = EdEventMode(&EventCamera, 0);
664 NowCamera = &MainCamera;
667 if (MapNo == TOWN_MUSKA_LACKA && strcmp(EdInteriorName,
"i04h04") == 0) {
668 EdInteriorDoorSound = -1;
683 sceVu0FVECTOR event_pos;
684 sceVu0FVECTOR event_ref;
685 EventCamera.
GetPos(event_pos);
686 EventCamera.
GetRef(event_ref);
687 MainCamera.
SetPos(event_pos);
688 MainCamera.
SetRef(event_ref);
691 camera_change_count = 0;
696 goto_return_menu = 0;
699 case ED_IN_MODE_DOOR_OPEN: {
700 NowCamera = &MainCamera;
706 Chara->
SetRotation(fix_chara_rot[0], fix_chara_rot[1], fix_chara_rot[2]);
709 for (
int i = 0; i < 10; i++) {
710 EdVillager[i].
Step();
717 if (door_open_cnt == 100 && EdInteriorDoorSound >= 0) {
718 sceVu0FVECTOR chara_pos;
720 EdDoorOpenSe(EdInteriorDoorSound, chara_pos);
723 if (door_open_cnt < 0) {
730 case ED_IN_MODE_LEAVE:
731 NowCamera = &MainCamera;
737 EdBeforeInBgmNo = -1;
741 case ED_IN_MODE_TALK: {
742 sceVu0FVECTOR direction;
743 NowCamera = &MainCamera;
745 if (EdCheckViewMode() != 0) {
746 NowCamera = &ViewCamera__2;
755 for (
int i = 0; i < 10; i++) {
756 EdVillager[i].
Step();
763 Chara->
GetDir(*talker, direction);
765 float yaw = atan2f(direction[0], direction[2]);
766 float view_h = EdAGetViewAngleH();
767 float view_v = EdAGetViewAngleV();
770 EdASetViewAngle(view_h, view_v);
771 EdEyeCamera(&ViewCamera__2, Chara);
773 if (EdCheckViewMode() == 0 || ((view_h - yaw < 0.0f ? -(view_h - yaw) : view_h - yaw) < 0.001f && (view_v - pitch < 0.0f ? -(view_v - pitch) : view_v - pitch) < 0.001f)) {
775 EdASetViewAngle(yaw, pitch);
777 int result = EdTalkMode(Chara, NULL, EdCheckViewMode(), &event_no);
788 if (result == 4 && event_no > 0) {
789 RunEvent(event_no, NowCamera);
798 case ED_IN_MODE_MENU_INIT:
803 for (
int i = 0; i < 10; i++) {
804 EdVillager[i].
SetMotion(EdVillager[i].motion_no, 1);
805 EdVillager[i].
Step();
810 case ED_IN_MODE_MENU:
811 MenuMapJumpMode = -1;
813 if (EdMenuMode() != 0) {
817 if (GetInteriorOutFlag() != 0) {
822 for (
int i = 0; i < 10; i++) {
823 EdVillager[i].
SetMotion(EdVillager[i].motion_no, 0);
824 EdVillager[i].
Step();
846 MGSetViewMatrix(view, eye);
848 for (
int i = 0; i < parts_num; i++) {
849 parts[i] = &InteriorParts[i];
852 EdSetSoundSrcVol(NowTime, parts, parts_num, eye, dir);
860 if (
GameMode == ED_IN_MODE_MENU_INIT && EdInitModeFinish(NowCamera, TexManager.GetTexture(
"frame_image", -1)) != 0) {
864 EdSaveFrameImageTask();
866 if (
GameMode == ED_IN_MODE_WALK && ((EdPadDown(0x10, 1) != 0 && loop_counter >= 2) || goto_menu != 0 || (SystemMesCheck() == 0 && EdCheckItemOver() != 0))) {
869 if (goto_menu != 0) {
872 printf(
"%d\n", menu);
875 if (EdInitMenu(menu) != 0) {
876 SndSePlay(MENU_SOUND_CONFIRM, -1, 0);
881 static int event_text = 0;
883 if (GamePad.
Down2(PAD_SQUARE) != 0) {
891 if (event_text < 0) {
895 if (event_text == 1) {
896 start_event_no = 150;
900 int ground_event = ((
CMainChara *) Chara)->move_info.ground_poly.attr.ground_kind;
902 if (ground_event > 0) {
903 start_event_no = ground_event;
907 if (EdDebugEventEnable != 0 && (start_event_no > 0 || start_system_event > 0)) {
908 if (start_system_event > 0) {
909 if (EdEventInit(start_system_event, &EdNPCBuffer, (
char *) EdSystemEventData) != 0) {
913 }
else if (EdEventInit(start_event_no, &EdNPCBuffer, (
char *) EdEventData) != 0) {
923 start_system_event = -1;
930 if (
GameMode == ED_IN_MODE_PAUSE && GamePad.
Down(PAD_START) != 0) {
933 PlayTimeCountFlag(1);
934 }
else if (
GameMode != ED_IN_MODE_EVENT && goto_return_menu != 0 && loop_counter > 1 &&
GameMode == ED_IN_MODE_WALK) {
938 PlayTimeCountFlag(0);
941 goto_return_menu = 0;
942 static int end_count = 0;
945 if (GamePad.
AllOn() != 0 || DebugMode) {
949 if (DebugMode && GamePad.
On(PAD_SELECT) && GamePad.
On(PAD_START) && end_count == 0) {
953 EdFadeOut(64, zero, zero, zero);
957 if (GamePad.
AllOn() != 0) {
962 if (end_count == 1) {
988static void MainDraw() {
989 sceVu0FVECTOR position;
992 if (EdDrawOffFlag != 0) {
1005 int hour = (int) (NowTime / 3.0f);
1007 if (EdDrawOffMap == 0) {
1008 TexManager.ReloadTexture(GetVif1Packet(), 15);
1011 sceVu0FVECTOR lod_distance = {0.0f, 1000.0f, 10000.0f, 1000000.0f};
1013 for (i = 0; i < parts_num; i++) {
1014 InteriorParts[i].
DrawParts(NowTime, lod_distance, 0, 0, NULL);
1021 MGGetFBuffTex(&frame_tex);
1024 screen.
width = 0x280;
1025 screen.
height = SCREEN_HALF_HEIGHT;
1026 water_tex = *(
sceGsTex0 *) &TexManager.GetTexture(
"water_buff", -1)->
tex0;
1027 MGMoveImage(&frame_tex, screen, &water_tex, 0, 0, 0);
1033 DrawWaterSurface(NowCamera);
1034 MGSetGsZBUF(&mgZBuffer);
1036 if (
GameMode == ED_IN_MODE_EVENT) {
1037 EdEventBackSpriteDraw();
1040 if (
GameMode == ED_IN_MODE_EVENT) {
1046 int marks_store[10];
1047 int *marks = marks_store;
1049 if (EdCheckViewMode() != 0) {
1053 if (
GameMode == ED_IN_MODE_LEAVE) {
1056 for (i = 0; i < 10; i++) {
1061 if (
GameMode == ED_IN_MODE_EVENT) {
1062 event = &EdEventInfo;
1066 EdDrawCharacter(Chara, detail, 10, EdVillager, marks, 1, event);
1067 TexManager.ReloadTexture(GetVif1Packet(), 0x18);
1068 sceVu0FVECTOR wind = {0.0f, 0.0f, 0.0f, 0.0f};
1070 if (
GameMode != ED_IN_MODE_PAUSE || EdPauseFlag == 0) {
1072 EffectMacroStep(wind);
1073 EdEffectGroup.Step(1);
1075 for (i = 0; i < 4; i++) {
1076 MotionParts__2[i].
Step();
1082 if (EdDrawOffMap == 0) {
1085 for (i = 0; i < effect_num; i++, effect++) {
1086 if (CheckEditEffect(effect, NowTime) != 0) {
1087 DrawEditEffect(effect, NowCamera, &EdEffectGroup);
1092 EdEffectGroup.Draw();
1094 for (i = 0; i < 4; i++) {
1095 TexManager.ReloadTexture(GetVif1Packet(), i + 0x32);
1096 MotionParts__2[i].
Draw();
1099 TexManager.ReloadTexture(Vif1Packet, 0x14);
1102 if (
GameMode == ED_IN_MODE_EVENT) {
1103 EdEventSpriteDraw();
1106 if ((
unsigned int) (
GameMode - 3) < 2U) {
1107 TexManager.ReloadTexture(Vif1Packet, EditMes1.
tex_block);
1110 if (
GameMode == ED_IN_MODE_EVENT) {
1119 MonsterNameMake(-1);
1124 static int debug_flag = 0;
1125 static int debug_menu_mode = 0;
1129 if (GamePad.
Down(PAD_L3)) {
1130 debug_flag = !debug_flag;
1133 if (debug_menu_mode) {
1137 if (GamePad.
Down(PAD_R3) || EdDebugRunEventNo > 0) {
1138 debug_menu_mode = 0;
1140 RunEvent(EdDebugRunEventNo, NowCamera);
1145 if (
GameMode != ED_IN_MODE_EVENT && GamePad.
Down(PAD_R3)) {
1148 debug_menu_mode = 1;
1152 EdDDebug(debug_flag);
1154 EdDPrintCamera(NowCamera);
1160 if (EdDebugParamDrawOff == 0) {
1161 char pause_texture[] =
"pause";
1163 if (
GameMode == ED_IN_MODE_PAUSE || EdPauseFlag != 0) {
1164 TexManager.ReloadTexture(GetVif1Packet(), 0x14);
1168 fade.
width = 0x2800;
1169 fade.
height = SCREEN_HALF_HEIGHT * 16;
1170 MGFillBox(fade, 0, 0, 0, 0x40);
1179 place.
y = SCREEN_HALF_HEIGHT - 20;
1183 set2DSprite(packet, TexManager.GetTexture(pause_texture, -1), place, texel, 0x80);
1197void DrawWaterSurface(
CCamera *camera) {
1199 sceVu0FVECTOR position;
1207 sceVu0Normalize(dir, dir);
1209 for (i = 0; i < 1; i++, surface++) {
1210 if (surface->
draw == 0) {
1215 sceVu0CopyVector(position, surface->
offset);
1217 if (surface->
follow[0]) {
1218 position[0] = eye[0] + 50.0f * dir[0];
1221 if (surface->
follow[1]) {
1222 position[1] = eye[1];
1225 if (surface->
follow[2]) {
1226 position[2] = eye[2] + 50.0f * dir[2];
1230 rotation.
x = rotation.
y = rotation.
z = 0.0f;
1231 water->
frame.SetRotation(rotation.
x, rotation.
y, rotation.
z);
1232 water->
frame.SetPosition(position);
1233 DrawVu1__6CWaterFP10RenderInfoP13sceVif1PacketP1(water, &mgRenderInfo, GetVif1Packet(), NULL);
1244static void StepWater() {
1249 for (i = 0; i < 1; i++, surface++) {
1250 if (surface->
draw == 0) {
1258 for (j = 0; j < 4; j++) {
1268 row = rows * (float) rand() / 2.1474836e9f;
1273 column = rows * (float) rand() / 2.1474836e9f;
1279 surface->
water.Hamon();
1290static void MoveCharacter() {
1291 sceVu0FVECTOR follow;
1292 static sceVu0FVECTOR fix_pos;
1294 EdMoveCharaInfo.
time = NowTime;
1295 EdMoveCharaInfo.
camera = &MainCamera;
1298 EdMoveCharaInfo.
chara = Chara;
1300 EdMoveCharaInfo.
parts = InteriorParts;
1304 EdMoveCharaInfo.
acted =
false;
1307 if (EdDebugCameraFlag != 0 && GamePad.
Down(PAD_CIRCLE) != 0) {
1308 fix_camera = !fix_camera;
1309 MainCamera.
GetPos(fix_pos);
1312 if (fix_camera != 0) {
1317 MainCamera.
SetFollow(follow[0], 14.0f + follow[1], follow[2]);
1318 MoveCamera(&MainCamera);
1326 if (EdMoveCharaInfo.
event_no > 0) {
1327 RunEvent(EdMoveCharaInfo.
event_no, &MainCamera);
1331 if (EdMoveCharaInfo.
acted == 0 && EdPadDown(0x40, 1) != 0) {
1332 sceVu0FVECTOR position;
1333 sceVu0FVECTOR start = {-40.5f, 0.0f, -12.55f, 1.0f};
1334 sceVu0FVECTOR rotation = {0.0f, 0.0f, 0.0f, 0.0f};
1342 if ((DebugMode && GamePad.
Down(PAD_SELECT)) || (jump = SearchMapJump(position, rotation))) {
1344 if (jump = SearchMapJump(position, rotation)) {
1350 door_open_cnt = 140;
1353 GetDoorPos(jump->
link_id, position, rotation, &EdInteriorDoorSound, &motion);
1357 sceVu0CopyVector(fix_chara_pos, position);
1358 sceVu0CopyVector(fix_chara_rot, rotation);
1360 Chara->
SetRotation(fix_chara_rot[0], fix_chara_rot[1], fix_chara_rot[2]);
1364 EdFadeOut(100, 0.0f, 0.0f, 0.0f);
1379 static float camera_distance[3] = {20.0f, 60.0f, 100.0f};
1381 float horizontal = GamePad.
GetRXf();
1388 camera->
AddAngle(0.04f * -horizontal);
1390 if (GamePad.
On(PAD_R1) != 0) {
1394 if (GamePad.
On(PAD_L1) != 0) {
1398 camera->
SetDistance(camera_distance[camera_dist_mode]);
1400 if (GamePad.
Down(PAD_TRIANGLE) != 0) {
1404 if (camera_dist_mode >= 3) {
1405 camera_dist_mode = 0;
1417 sceVu0FVECTOR world;
1421 for (i = 0; i < func_num; i++, point++) {
1422 if (point->kind == EPARTS_FUNC_DOOR) {
1424 point->position[3] = 1.0f;
1425 frame->GetWorldPosition(world, point->position);
1426 EdInteriorJumpID = point->link_id;
1428 if (DistVector(position, world) < 10.0f && AngleCmp(rotation[1], point->rotation[1], 0.87f) == 0) {
1447 for (
int i = 0; i < func_num; i++, point++) {
1448 if (point->kind == EPARTS_FUNC_DOOR && point->link_id == EdInteriorJumpID) {
1449 chara->
SetPosition(point->position[0], point->position[1], point->position[2]);
1450 printf(
"%f %f %f\n", point->position[0], point->position[1], point->position[2]);
1451 chara->
SetRotation(0.0f, AngleLimit(PI_SHORT + point->rotation[1]), 0.0f);
1464static int GetDoorPos(
int door_no,
float *position,
float *rotation,
int *door_sound,
int *motion) {
1467 for (
int i = 0; i < func_num; i++, point++) {
1468 if ((point->kind == EPARTS_FUNC_DOOR_SIDE_A || point->kind == EPARTS_FUNC_DOOR_SIDE_B) && point->link_id == door_no) {
1469 sceVu0CopyVector(position, point->position);
1470 sceVu0CopyVector(rotation, point->rotation);
1471 *door_sound = point->values[0];
1472 *motion = EdGetDoorMotion(*door_sound, point->kind == EPARTS_FUNC_DOOR_SIDE_A);
1473 return point->kind == EPARTS_FUNC_DOOR_SIDE_B;
1488 sceVu0FVECTOR position;
1489 sceVu0FVECTOR local;
1497 sceVu0FMATRIX matrix;
1500 for (i = 0; i < func_num; i++, point++) {
1501 if (point->kind == EPARTS_FUNC_CAMERA) {
1502 entry = &cameras[count];
1503 entry->
link_id = point->link_id;
1505 sceVu0CopyVector(entry->
min, point->parameters);
1506 sceVu0CopyVector(entry->
max, point->values);
1507 sceVu0UnitMatrix(matrix);
1509 if (owner != NULL) {
1510 CFrame *found = owner->SearchFrame((
char *) point->frame_name);
1512 if (found != NULL) {
1513 found->GetLWMatrix(matrix);
1517 sceVu0MulMatrix(matrix, matrix, point->matrix);
1518 entry->
frame.SetTransMatrix(matrix);
1534 for (i = 0; i < count; i++) {
1535 entry = &cameras[i];
1542 float (*inverse)[4] = entry->
frame.GetInverseMatrix();
1544 sceVu0ApplyMatrix(local, inverse, position);
1546 if (!(local[0] < entry->
min[0]) && !(local[1] < entry->
min[1]) && !(local[2] < entry->
min[2]) && local[0] <= entry->
max[0] && local[1] <= entry->
max[1] && local[2] <= entry->
max[2]) {
1558 if (active_camera == NULL) {
1559 active_camera = inside;
1562 if (inside == NULL) {
1566 if (camera_change_count <= 0) {
1567 active_camera = inside;
1568 camera_change_count = 0;
1571 if (inside == active_camera) {
1572 camera_change_count = 20;
1574 camera_change_count--;
1577 if (active_camera != NULL) {
1578 sceVu0FVECTOR eye = {0.0f, 0.0f, 0.0f, 1.0f};
1579 active_camera->
frame.GetWorldPosition(eye, eye);
1580 position[1] += 17.0f;
1582 camera->
SetRef(position);
1583 camera->
SetNextPos(NULL, eye[0], eye[1], eye[2]);
1584 camera->
SetNextRef(NULL, position[0], position[1], position[2]);
1599 for (
int i = 0; i < parts_num; i++) {
1602 if (frame != NULL) {
1603 count += frame->PickUpNearPoly(&poly[count], *box);
1618static void VillagerCollision() {
1619 sceVu0FVECTOR position;
1621 sceVu0FVECTOR ground;
1624 for (
int i = -1; i < 10; i++) {
1631 villager = &EdVillager[i];
1648 box.
max[0] = 1.0f + position[0];
1649 box.
min[0] = position[0] - 1.0f;
1650 box.
max[2] = 1.0f + position[2];
1651 box.
min[2] = position[2] - 1.0f;
1652 box.
max[1] = 1000.0f;
1653 box.
min[1] = -1000.0f;
1662 int count = GetCollision(polys, &box);
1665 printf(
"cpoly over!!!! %d\n", count);
1669 position[1] += 20.0f;
1671 if (GetFootPoly(position, 1000.0f, &poly, ground, polys, count, 0) != 0) {
1672 sceVu0CopyVector(position, ground);
1675 if (foot_sound == 1) {
1703static int LoadTexture() {
1714 char *ext = file->
name;
1717 while ((c = *ext) !=
'\0') {
1726 u_int *cfg_data = NULL;
1730 if (strcmp(ext,
"img") == 0) {
1736 if (GetPackFileExt((u_int *) file->
buffer,
"img", &found, 1, NULL, NULL) > 0) {
1737 texdata[0].
name = (
char *) found;
1740 if (GetPackFileExt((u_int *) file->
buffer,
"cfg", &found, 1, &cfg_size, NULL) > 0) {
1745 for (
int i = 0; i < 64; i++) {
1751 TexManager.LoadTextureBlockEX(15, texdata);
1753 if (cfg_data != NULL) {
1757 EdNPCBuffer.Alloc((file->
size >> 4) + 1);
1764static void LoadChara() {
1776 EdNPCBuffer.Alloc(0x600);
1778 for (
int i = 0; i < 128; i++) {
1779 func_point[i].
kind = 0;
1784 u_int *archive = NULL;
1787 archive = (u_int *) file->
buffer;
1792 for (count = 0;; count++) {
1793 u_int *part_archive = SearchPTS(archive, count);
1795 if (part_archive == NULL) {
1799 CMapParts *parts = &InteriorParts[count];
1800 LoadPTS(parts, part_archive);
1803 int first_point = func_num;
1804 func_num += GetFuncPoint(count, part_archive, &func_point[first_point]);
1806 if (EdInteriorPartsNo >= 0) {
1811 EdPartsObjectOnOff(parts, info, EdInteriorJumpID + 1);
1817 for (
int i = 0; i < 9; i++) {
1821 for (
int i = 0; i < 4; i++) {
1833 extra_collision = NULL;
1840 frames[8] = extra_collision;
1844 for (
int i = 0; i < 24; i++) {
1849 for (; first_point < func_num; first_point++, point++) {
1850 EnterPartsEffect(parts, point, EdInInfo->
effects, 32);
1852 if (obj_anime_num < 32) {
1855 if (InitObjAnime(frames, 9, point, seq) != 0) {
1861 EdInitEventPoint(parts, NULL, func_point, func_num, EdInInfo->
event_points, 32);
1866 for (
int i = 0; i < func_num; i++) {
1869 if (func_point[i].completion_flag > 0 && SaveData->
GetMapInitFlag(MapNo, func_point[i].completion_flag) == 0) {
1870 SaveData->
SetMapInitFlag(MapNo, func_point[i].completion_flag, 1);
1871 SaveData->
SetMapFlag(MapNo, func_point[i].completion_flag, !(s8) func_point[i].unk_28[0]);
1878 for (
int i = 0; i < func_num; i++, point++) {
1879 if (point->kind == EPARTS_FUNC_CAMERA) {
1884 for (
int i = 0; i < 4; i++) {
1888 if (motion->
name[0] !=
'\0') {
1889 LoadFile(motion->
name, read_buffer, NULL);
1890 MotionParts__2[i].
LoadPackData2((u_int *) read_buffer,
"info.cfg", &EdNPCBuffer, i + 0x32, &EdNPCBuffer, 0);
1897 for (
int i = 0; i < 1; i++) {
1898 Water[i].
draw =
false;
1901 for (
int i = 0; i < 1; i++) {
1911 water = &surface->
water;
1917 surface->
draw =
true;
1922 for (
int j = 0; j < 3; j++) {
1926 for (j = 0; j < 4; j++) {
1930 water->SetVertex(near_left, near_right, far_left, far_right);
1934 water->SetColor(info->
red, info->
green, info->
blue, 0x80);
1945int LoadPTS(
CMapParts *parts, u_int *archive) {
1947 u_int *files[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
1951 files[0] = (u_int *) ((
char *) archive + pack->
lod0_offset);
1957 files[1] = (u_int *) ((
char *) archive + pack->
lod1_offset);
1961 files[2] = (u_int *) ((
char *) archive + pack->
lod2_offset);
1965 files[3] = (u_int *) ((
char *) archive + pack->
lod3_offset);
1969 files[4] = (u_int *) ((
char *) archive + pack->
shadow_offset);
1977 files[6] = (u_int *) ((
char *) archive + pack->
shade_offset);
1981 files[7] = (u_int *) ((
char *) archive + pack->
extra_offset);
1985 files[8] = (u_int *) ((
char *) archive + pack->
camera_offset);
1988 parts->SetFrame(LoadMDSFile(files[0], &EdNPCBuffer, 0, NULL, NULL), 0);
1990 if (files[5] != NULL) {
1994 if (files[8] != NULL) {
1995 parts->
camera_frame = LoadCollisionFile(files[8], &EdNPCBuffer);
2000 sceVu0FVECTOR position = {0.0f, 0.0f, 0.0f, 1.0f};
2021 for (i = 0; i < header->
func_count; points++) {
2032static int setTexAnimCnt;
2035static float setTexAnimCntf;
2044static void setTexAnim() {
2045 sceVif1PkCnt(Vif1Packet, 0);
2046 sceVif1PkOpenDirectCode(Vif1Packet, 0);
2047 sceVif1PkOpenGifTag(Vif1Packet, *(u_long128 *) &GiftagAD);
2048 sceVif1PkAddGsAD(Vif1Packet, SCE_GS_TEXFLUSH, 0);
2049 sceVif1PkCloseGifTag(Vif1Packet);
2050 sceVif1PkCloseDirectCode(Vif1Packet);
2052 if (setTexAnimCntf >= 7.0f) {
2053 setTexAnimCntf = 0.0f;
2055 setTexAnimCntf += 0.2f;
2058 setTexAnimCnt = (int) setTexAnimCntf;
2060 CTexture *strip = TexManager.GetTexture(
"i01e01_a", -1);
2061 CTexture *plate = TexManager.GetTexture(
"i01e01", -1);
2063 if (strip == 0 || plate == 0) {
2068 sceVif1PkCnt(Vif1Packet, 0);
2069 sceVif1PkOpenDirectCode(Vif1Packet, 0);
2070 sceVif1PkOpenGifTag(Vif1Packet, *(u_long128 *) &GiftagAD);
2071 sceVif1PkAddGsAD(Vif1Packet, SCE_GS_TEXFLUSH, 0);
2072 sceVif1PkCloseGifTag(Vif1Packet);
2073 sceVif1PkCloseDirectCode(Vif1Packet);
2077static int npc_count;
2080static int objanime_list;
2083static int effect_list;
2089static int motion_parts_list;
2092static int water_list;
2098static char CurrentDir[0x80];
2100static void CommandAMBIENT(
void **arguments);
2101static void CommandLIGHT_C(
void **arguments);
2102static void CommandFOG(
void **arguments);
2103static void CommandBG_COL(
void **arguments);
2104static void CommandPROJECTION(
void **arguments);
2105static void CommandPEOPLE(
void **arguments);
2106static void CommandCD(
void **arguments);
2107static void CommandOBJ_ANIME(
void **arguments);
2108static void CommandFIRE(
void **arguments);
2109static void CommandFLAME(
void **arguments);
2110static void CommandBRIGHT(
void **arguments);
2111static void CommandDEBUG(
void **arguments);
2112static void CommandMOTION_PARTS(
void **arguments);
2113static void CommandWATER_SURFACE(
void **arguments);
2114static void CommandWATER_SHAKE(
void **arguments);
2118 {
"AMBIENT", {SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, -1} },
2119 {
"LIGHT_C", {SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_INTEGER, -1} },
2120 {
"FOG", {SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, -1} },
2121 {
"BG_COL", {SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, -1} },
2122 {
"PROJECTION", {SCRIPT_ARGUMENT_FLOAT, -1} },
2123 {
"PEOPLE", {SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, -1} },
2124 {
"CD", {SCRIPT_ARGUMENT_STRING, -1} },
2125 {
"OBJ_ANIME", {SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_STRING, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, -1} },
2126 {
"FIRE", {SCRIPT_ARGUMENT_STRING, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, -1} },
2127 {
"FLAME", {SCRIPT_ARGUMENT_STRING, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, -1} },
2128 {
"BRIGHT", {SCRIPT_ARGUMENT_STRING, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, -1} },
2130 {
"MOTION_PARTS", {SCRIPT_ARGUMENT_STRING, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, -1} },
2131 {
"WATER_SURFACE", {SCRIPT_ARGUMENT_STRING, SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_INTEGER, -1}},
2132 {
"WATER_SHAKE", {SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_INTEGER, SCRIPT_ARGUMENT_FLOAT, SCRIPT_ARGUMENT_FLOAT, -1} },
2136static void (*CommandExe[15])(
void **) = {
2149 CommandMOTION_PARTS,
2150 CommandWATER_SURFACE,
2161static void LoadInfo(
char *script,
int size) {
2166 interpreter.
SetTAG(Command, 15);
2167 CurrentDir[0] =
'\0';
2171 motion_parts_list = 0;
2183 CommandExe[command](interpreter.
arguments);
2186 obj_anime_num = objanime_list;
2187 effect_num = effect_list;
2198static void CommandAMBIENT(
void **arguments) {
2199 EdInInfo->
ambient[0] = *(
float *) arguments[0];
2200 EdInInfo->
ambient[1] = *(
float *) arguments[1];
2201 EdInInfo->
ambient[2] = *(
float *) arguments[2];
2202 EdInInfo->
ambient[3] = 128.0f;
2213static void CommandLIGHT_C(
void **arguments) {
2214 sceVu0FVECTOR direction;
2215 int light = *(
int *) arguments[6];
2217 direction[0] = *(
float *) arguments[0];
2218 direction[1] = *(
float *) arguments[1];
2219 direction[2] = *(
float *) arguments[2];
2220 direction[3] = 0.0f;
2221 sceVu0Normalize(direction, direction);
2227 EdInInfo->
light_colour[light][0] = *(
float *) arguments[3];
2228 EdInInfo->
light_colour[light][1] = *(
float *) arguments[4];
2229 EdInInfo->
light_colour[light][2] = *(
float *) arguments[5];
2241static void CommandFOG(
void **arguments) {
2244 EdInInfo->
fog.
red = *(
int *) arguments[2];
2245 EdInInfo->
fog.
green = *(
int *) arguments[3];
2246 EdInInfo->
fog.
blue = *(
int *) arguments[4];
2259static void CommandBG_COL(
void **arguments) {
2273static void CommandPROJECTION(
void **arguments) {
2274 EdInInfo->
projection = *(
float *) arguments[0];
2285static void CommandPEOPLE(
void **arguments) {
2296static void CommandCD(
void **arguments) {
2297 GetEditDataDir(CurrentDir);
2298 strcat(CurrentDir,
"in/");
2299 strcat(CurrentDir, (
char *) arguments[0]);
2310static void CommandOBJ_ANIME(
void **arguments) {
2316static void SetEffect(EFFECT_TYPE type,
char *name,
float *position,
float *scale,
float *rotation) {
2327static void CommandFIRE(
void **arguments) {
2328 sceVu0FVECTOR position;
2329 sceVu0FVECTOR scale;
2330 sceVu0FVECTOR rotation = {0.0f, 0.0f, 0.0f, 0.0f};
2332 position[0] = *(
float *) arguments[1];
2333 position[1] = *(
float *) arguments[2];
2334 position[2] = *(
float *) arguments[3];
2336 scale[0] = *(
float *) arguments[4];
2337 scale[1] = *(
float *) arguments[4];
2338 scale[2] = *(
float *) arguments[4];
2339 SetEffect(EFFECT_FIRE, (
char *) arguments[0], position, scale, rotation);
2350static void CommandFLAME(
void **arguments) {
2351 sceVu0FVECTOR position;
2352 sceVu0FVECTOR scale;
2353 sceVu0FVECTOR rotation = {0.0f, 0.0f, 0.0f, 0.0f};
2355 position[0] = *(
float *) arguments[1];
2356 position[1] = *(
float *) arguments[2];
2357 position[2] = *(
float *) arguments[3];
2359 scale[0] = *(
float *) arguments[4];
2360 scale[1] = *(
float *) arguments[4];
2361 scale[2] = *(
float *) arguments[4];
2362 SetEffect(EFFECT_FLAME, (
char *) arguments[0], position, scale, rotation);
2373static void CommandBRIGHT(
void **arguments) {
2374 sceVu0FVECTOR position;
2375 sceVu0FVECTOR scale;
2376 sceVu0FVECTOR rotation = {0.0f, 0.0f, 0.0f, 0.0f};
2378 position[0] = *(
float *) arguments[1];
2379 position[1] = *(
float *) arguments[2];
2380 position[2] = *(
float *) arguments[3];
2382 scale[0] = *(
float *) arguments[4];
2383 scale[1] = *(
float *) arguments[4];
2384 scale[2] = *(
float *) arguments[4];
2385 SetEffect(EFFECT_BRIGHT, (
char *) arguments[0], position, scale, rotation);
2395static void CommandDEBUG(
void **arguments) {
2407static void CommandMOTION_PARTS(
void **arguments) {
2408 if (motion_parts_list < 4) {
2410 motion_parts_list++;
2411 strcpy(motion->
name, CurrentDir);
2412 strcat(motion->
name, (
char *) arguments[0]);
2413 motion->
values[0] = *(
float *) arguments[1];
2414 motion->
values[1] = *(
float *) arguments[2];
2415 motion->
values[2] = *(
float *) arguments[3];
2416 motion->
values[3] = *(
float *) arguments[4];
2417 motion->
values[4] = *(
float *) arguments[5];
2418 motion->
values[5] = *(
float *) arguments[6];
2419 motion->
values[6] = *(
float *) arguments[7];
2420 motion->
values[7] = *(
float *) arguments[8];
2421 motion->
values[8] = *(
float *) arguments[9];
2433static void CommandWATER_SURFACE(
void **arguments) {
2434 if (water_list < 8) {
2437 strcpy(surface->
name, (
char *) arguments[0]);
2438 surface->
grid_rows = *(
int *) arguments[1];
2440 surface->
corner_a[0] = *(
float *) arguments[3];
2441 surface->
corner_a[1] = *(
float *) arguments[4];
2442 surface->
corner_a[2] = *(
float *) arguments[5];
2444 surface->
corner_b[0] = *(
float *) arguments[6];
2445 surface->
corner_b[1] = *(
float *) arguments[7];
2446 surface->
corner_b[2] = *(
float *) arguments[8];
2448 surface->
corner_c[0] = *(
float *) arguments[9];
2449 surface->
corner_c[1] = *(
float *) arguments[10];
2450 surface->
corner_c[2] = *(
float *) arguments[11];
2456 surface->
red = *(
int *) arguments[16];
2457 surface->
green = *(
int *) arguments[17];
2458 surface->
blue = *(
int *) arguments[18];
2459 surface->
follow[0] = *(
int *) arguments[19];
2460 surface->
follow[1] = *(
int *) arguments[20];
2461 surface->
follow[2] = *(
int *) arguments[21];
2463 water_info = surface;
2475static void CommandWATER_SHAKE(
void **arguments) {
2484 wave->
row = (float) *(
int *) arguments[0];
2485 wave->
column = (float) *(
int *) arguments[1];
2486 wave->
range = *(
float *) arguments[3];
2487 wave->
power = *(
float *) arguments[2];
void SetHeight(float height)
void SetFollow(float x, float y, float z)
void AddAngle(float delta)
void SetDistance(float distance)
void AddHeight(float delta)
virtual void Step(int steps)
void SetNextRef(CFrame *parent, float x, float y, float z)
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 SetNextPos(CFrame *parent, float x, float y, float z)
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)
virtual void SetScale(float x, float y, float z)
void SetFootSoundID(int id)
virtual void ShadowStep()
virtual void SetRotation(float x, float y, float z)
void FootSoundEnable(int on)
virtual void Initialize()
virtual void SetPosition(float x, float y, float z)
virtual void ClothStep(int step)
EDITPARTS_INFO * GetPartsInfo(int index)
void SetAutoRepeat(int mask, int initial_delay, int repeat_delay)
GROUND_WATER_RIPPLE ripples[4]
CFrameVu1 * collision_frame
CFrame * GetCollisionFrame()
virtual void SetPosition(float *position)
virtual void SetRotation(float x, float y, float z)
void DrawParts(float time, float *distance, int lowest, int highest, int *out_level)
EDIT_EFFECT_INFO * effect[MAP_PARTS_EFFECT_MAX]
s32 effect_on[MAP_PARTS_EFFECT_MAX]
virtual void Initialize()
virtual void ShadowStep()
virtual void GetRotation(float *out_rotation)
void GetDir(CObject &other, float *out_direction)
virtual void SetVelocity(CVector3_f_ velocity)
float GetDistance(CObject &other)
int GetMapInitFlag(int map_no, int flag_no)
int SetMapFlag(int map_no, int flag_no, int value)
int SetMapInitFlag(int map_no, int flag_no, int value)
void SetScript(char *script, int script_size)
void SetTAG(TAG_PARAM *tags, int count)
void Initialize(CTexAnimeData *records, int count)
void TexAnime(int texture_block)
void LoadCFGFile(char *script, int script_size)
CDataAlloc2< 1 > * WorkBuffer__2
@ ED_EVENT_RETURN_MAP_JUMP
@ ED_EVENT_RETURN_OUTSIDE
EDITPARTS_ELEMENT elements[6]
OBJ_ANIME_SEQ obj_anime[32]
ED_EVENT_POINT event_points[32]
float light_direction[4][4]
float background_colour[4]
EDIT_WATER_INFO water_surfaces[8]
EDIT_MOTION_PARTS_INFO motion_parts[4]
EDIT_EFFECT_INFO effects[32]
EDIT_WATER_WAVE_INFO wave[4]
sceVu0FVECTOR ripple_params
sceVu0FMATRIX light_color
CMapParts * interior_parts
sceVu0FMATRIX light_direction
sceVu0FVECTOR ambient_color
u_int words[sizeof(EPARTS_FUNC_DATA)/sizeof(u_int)]