14#include "dataalloc.hpp"
17#include "framevu1.hpp"
19#include "mainselect.hpp"
23#include "renderinfo.hpp"
26#include "title/bombeffect.hpp"
27#include "title/majinbeem.hpp"
28#include "title/op_a.hpp"
29#include "title/op_b.hpp"
30#include "title/op_c.hpp"
31#include "title/opening.hpp"
32#include "title/script.hpp"
34#include "visualvu1.hpp"
57 CRect(T left, T top, T width, T height) {
63} __attribute__((aligned(16)));
76 virtual void FrameObjectOnOff(
char *name,
int on);
100 void DrawShadow(
int fast);
119 void DrawFire(
int unused0,
int unused1,
CCamera *camera,
float *eye,
float scale,
int layers,
float camera_offset);
155 void SetVertex(
float *corner0,
float *corner1,
float *corner2,
float *corner3);
158 void SetColor(u_char red, u_char green, u_char blue, u_char alpha);
159 void Shake(
int x,
int y,
float height_change);
200 void Initialize(
CEffect *table,
int count);
203 void Step(
int unused);
274void MoveImageTest(
sceVif1Packet *packet,
int sbp,
int sbw,
int spsm,
const CRect<int> &rect,
int dbp,
int dbw,
int dpsm,
int dsax,
int dsay,
int dir);
277void DepthOfField(
float *dist,
int level,
int alpha,
int blur);
279static void MapLoad();
280static void MapLoad2();
281static void LoadCharaMajin();
282static void DrawDancer();
283static void InchikiShadow();
284static void DrawShadow(
int shadow_no,
float x,
float y,
float z);
285static void MajinBeemProcess();
286static void SmokeProcess();
287static void WaterProcess();
288static int KageCheck(
int actor);
289static void LightSet(
float x,
float y,
float z,
int actor);
290static void setTexScroll();
291static void setTexAnim();
292void FaceChangeD(
int actor);
297static CFrame *TaimatsuFrame[12];
310static float FireStep;
311static int MajinBgmStart;
312static int DanceBgmStart;
313static int DanceBgmCnt;
322void FaceChange(
int actor_no) {
324 {0, 0, 42, 40, 87, 35, 0, 0, 256, 2, 0},
325 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0},
326 {0, 0, 32, 40, 84, 35, 0, 0, 448, 3, 0},
327 {
"c09a01",
"c09a01an", 10, 40, 73, 35, 0, 0, 448, 2, 0},
328 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0},
329 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0},
330 {0, 0, 8, 40, 76, 35, 0, 0, 256, 2, 0},
331 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0},
332 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0},
333 {
"p09a01",
"p09a01an_2", 44, 40, 92, 32, 0, 0, 256, 2, 0},
334 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0},
335 {
"c01d01",
"c01d01an_3", 27, 48, 78, 44, 0, 0, 512, 3, 0},
336 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0},
337 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0},
338 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0},
339 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0},
340 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0},
341 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0},
342 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0},
343 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0},
344 {0, 0, 42, 40, 87, 35, 0, 0, 320, 2, 0}
353 sceVif1PkCnt(Vif1Packet, 0);
354 sceVif1PkOpenDirectCode(Vif1Packet, 0);
355 sceVif1PkOpenGifTag(Vif1Packet, *(u_long128 *) &GiftagAD);
356 sceVif1PkAddGsAD(Vif1Packet, SCE_GS_TEXFLUSH, 0);
357 sceVif1PkCloseGifTag(Vif1Packet);
358 sceVif1PkCloseDirectCode(Vif1Packet);
360 if (face[actor_no].plate == 0) {
364 plate = TexManager.GetTexture(face[actor_no].plate, -1);
365 strip = TexManager.GetTexture(face[actor_no].strip, -1);
367 if (plate == 0 || strip == 0) {
371 sbp = strip->
tex0 & 0x3fff;
372 dbp = plate->tex0 & 0x3fff;
373 sbw = (strip->tex0 >> 14) & 0x3f;
374 dbw = (plate->tex0 >> 14) & 0x3f;
376 face[actor_no].
eye = CScript__2.
obj[actor_no].
eye;
378 CRect<int> eye(0, face[actor_no].strip_bottom - face[actor_no].eye_height * (face[actor_no].eye + 1), 128, face[actor_no].eye_height);
380 MoveImageTest(Vif1Packet, sbp, sbw, SCE_GS_PSMT8, eye, dbp, dbw, SCE_GS_PSMT8, 0, 128 - face[actor_no].eye_height - face[actor_no].eye_bottom, 0);
385 if (CScript__2.
obj[actor_no].
talk) {
387 if (rand() % 5 == 0) {
389 if ((
int) (100.0f * CScript__2.
obj[actor_no].
mouth_time) % 6 == 0) {
391 CScript__2.
obj[actor_no].
mouth = rand() % 4;
396 CScript__2.
obj[actor_no].
talk =
false;
401 CRect<int> mouth(128, face[actor_no].strip_bottom - face[actor_no].mouth_height * (face[actor_no].mouth + 1), 128, face[actor_no].mouth_height);
403 MoveImageTest(Vif1Packet, sbp, sbw, SCE_GS_PSMT8, mouth, dbp, dbw, SCE_GS_PSMT8, 0, 128 - face[actor_no].mouth_height - face[actor_no].mouth_bottom, 0);
405 sceVif1PkCnt(Vif1Packet, 0);
406 sceVif1PkOpenDirectCode(Vif1Packet, 0);
407 sceVif1PkOpenGifTag(Vif1Packet, *(u_long128 *) &GiftagAD);
408 sceVif1PkAddGsAD(Vif1Packet, SCE_GS_TEXFLUSH, 0);
409 sceVif1PkCloseGifTag(Vif1Packet);
410 sceVif1PkCloseDirectCode(Vif1Packet);
416void OpC_LoadDataBG() {
420 LoadFileBG(
"opdat/norn2/norn2.pim", (u_long128 *) read_buffer, 0);
421 CScript__2.
load_no = OP_SCENE_NONE;
424void OpC_LoadDataBG2() {
428 LoadFileBG(
"opdat/norn2/ndance.pak", (u_long128 *) read_buffer, 0);
429 CScript__2.
load_no = OP_SCENE_NONE;
432void OpC_LoadDataBG3() {
436 LoadFileBG(
"opdat/norn2/majin.pak", (u_long128 *) read_buffer, 0);
437 CScript__2.
load_no = OP_SCENE_NONE;
440void OpC_LoadDataBG4() {
444 LoadFileBG(
"opdat/norn2/norn2.pim", (u_long128 *) read_buffer, 0);
445 CScript__2.
load_no = OP_SCENE_NONE;
448void OpC_LoadDataBG5() {
452 LoadFileBG(
"opdat/norn3/norn3.pak", (u_long128 *) read_buffer, 0);
453 CScript__2.
load_no = OP_SCENE_NONE;
460void OpC_InitProcess() {
465 {
"#water_buff#640#" HALF_BUFFER_HEIGHT_STR
"#4", 22, 0},
466 {
"#blender#640#" HALF_BUFFER_HEIGHT_STR
"#4", 0, 0},
467 {
"#fontbase#512#256#1", 26, 0},
468 {
"#fukidashibase#640#" HALF_BUFFER_HEIGHT_STR
"#4", 26, 0},
469 {
"#shadow_buff#640#" HALF_BUFFER_HEIGHT_STR
"#4", 23, 0},
470 {
"#frame_image#640#" HALF_BUFFER_HEIGHT_STR
"#4", 22, 0},
497 tex[6].
name = (
char *) GetPackFile(read_buffer,
"fire.img", 0);
498 tex[7].
name = (
char *) GetPackFile(read_buffer,
"t0203.img", 0);
499 tex[8].
name = (
char *) GetPackFile(read_buffer,
"e01b01.img", 0);
500 tex[9].
name = (
char *) GetPackFile(read_buffer,
"e01b02.img", 0);
501 tex[10].
name = (
char *) GetPackFile(read_buffer,
"e01b03.img", 0);
502 tex[11].
name = (
char *) GetPackFile(read_buffer,
"e01t01.img", 0);
503 tex[12].
name = (
char *) GetPackFile(read_buffer,
"t0205.img", 0);
504 tex[13].
name = (
char *) GetPackFile(read_buffer,
"t0003.img", 0);
505 tex[14].
name = (
char *) GetPackFile(read_buffer,
"e01s03.img", 0);
506 tex[15].
name = (
char *) GetPackFile(read_buffer,
"e01s06.img", 0);
507 tex[16].
name = (
char *) GetPackFile(read_buffer,
"t0001.img", 0);
508 tex[17].
name = (
char *) GetPackFile(read_buffer,
"gaiji.img", 0);
509 tex[18].
name = (
char *) GetPackFile(read_buffer,
"fuki256.img", 0);
510 tex[19].
name = (
char *) GetPackFile(read_buffer,
"syst04.img", 0);
511 tex[20].
name = (
char *) GetPackFile(read_buffer,
"pause.img", 0);
514 switch (LanguageCode) {
516 tex[21].
name = (
char *) GetPackFile(read_buffer,
"pause_e.img", 0);
518 case LANG_ENGLISH_US:
519 tex[21].
name = (
char *) GetPackFile(read_buffer,
"pause_e.img", 0);
521 case LANG_ENGLISH_UK:
522 tex[21].
name = (
char *) GetPackFile(read_buffer,
"pause_e.img", 0);
525 tex[21].
name = (
char *) GetPackFile(read_buffer,
"pause_f.img", 0);
528 tex[21].
name = (
char *) GetPackFile(read_buffer,
"pause_g.img", 0);
531 tex[21].
name = (
char *) GetPackFile(read_buffer,
"pause_i.img", 0);
534 tex[21].
name = (
char *) GetPackFile(read_buffer,
"pause_s.img", 0);
538 tex[21].
name = (
char *) GetPackFile(read_buffer,
"pause_e.img", 0);
539 tex[22].
name = (
char *) GetPackFile(read_buffer,
"start2.img", 0);
542 TexManager.Initialize(16352);
543 TexManager.LoadTextureBlock(-1, tex);
545 LoadFile(
"opdat/norn2/norn2b.pak", (
void *) read_buffer, 0);
547 tex[0].
name = (
char *) GetPackFile(read_buffer,
"t0201.img", 0);
548 tex[0].block_no = 12;
549 tex[0].mipmap =
false;
550 tex[1].
name = (
char *) GetPackFile(read_buffer,
"t0206.img", 0);
551 tex[1].block_no = 12;
552 tex[1].mipmap =
false;
553 tex[2].
name = (
char *) GetPackFile(read_buffer,
"c01d01.img", 0);
555 tex[2].mipmap =
false;
556 tex[3].
name = (
char *) GetPackFile(read_buffer,
"c01d01an.img", 0);
558 tex[3].mipmap =
false;
559 tex[4].
name = (
char *) GetPackFile(read_buffer,
"p03a01.img", 0);
561 tex[4].block_no = 14;
563 tex[4].block_no = 13;
565 tex[4].mipmap =
false;
566 tex[5].
name = (
char *) GetPackFile(read_buffer,
"p08a01.img", 0);
568 tex[5].block_no = 15;
570 tex[5].block_no = 14;
572 tex[5].mipmap =
false;
573 tex[6].
name = (
char *) GetPackFile(read_buffer,
"p07a01.img", 0);
575 tex[6].mipmap =
false;
576 tex[7].
name = (
char *) GetPackFile(read_buffer,
"yokobue.img", 0);
578 tex[7].mipmap =
false;
579 tex[8].
name = (
char *) GetPackFile(read_buffer,
"p02a01.img", 0);
581 tex[8].mipmap =
false;
582 tex[9].
name = (
char *) GetPackFile(read_buffer,
"guiter.img", 0);
584 tex[9].mipmap =
false;
586 tex[10].block_no = 0;
587 tex[10].mipmap =
false;
589 TexManager.LoadTextureBlock(-1, tex);
593 CharaTex__2[12] = 14;
594 CharaTex__2[13] = 15;
597 CharaTex__2[12] = 14;
598 CharaTex__2[13] = 15;
601 CharaTex__2[12] = 13;
602 CharaTex__2[13] = 14;
605 CharaTex__2[12] = 13;
606 CharaTex__2[13] = 14;
630 CSnd.
SetVol(MIDI_PORT_SE_TITLE, 256);
631 CSnd.
SetVol(MIDI_PORT_SE_DEFAULT, 256);
632 CSnd.
SetVol(MIDI_PORT_UNK_D, 256);
633 CSnd.
SetVol(MIDI_PORT_SE_SPECIAL, 256);
634 CSnd.
SQ_Play(MIDI_PORT_AMBIENT, 0);
636 sceVu0FVECTOR river1 = {50.0f, 100.0f, -100.0f, 0.0f};
638 OpPlayVolPanSE(river1, 50.0f, 500.0f, MIDI_PORT_SE_TITLE, 16, 21);
640 sceVu0FVECTOR river2 = {0.0f, 0.0f, 0.0f, 0.0f};
642 OpPlayVolPanSE(river2, 50.0f, 500.0f, MIDI_PORT_SE_TITLE, 16, 22);
644 sceVu0FVECTOR river3 = {0.0f, 0.0f, 300.0f, 0.0f};
646 OpPlayVolPanSE(river3, 100.0f, 300.0f, MIDI_PORT_SE_TITLE, 16, 24);
651 CharaDataBuffer__2[0].
used = 0;
652 Chara__3[11].
LoadPackData(read_buffer,
"04c01d.cfg", &CharaDataBuffer__2[0], 0);
657 Chara__3[11].
frame->SetAttr(attr11, 1, 4);
663 Chara__3[17].
LoadPackData(read_buffer,
"04p07a.cfg", &CharaDataBuffer__2[0], 0);
668 Chara__3[17].
frame->SetAttr(attr17, 1, 4);
674 Chara__3[18].
LoadPackData(read_buffer,
"04p02a.cfg", &CharaDataBuffer__2[0], 0);
679 Chara__3[18].
frame->SetAttr(attr18, 1, 4);
685 Chara__3[12].
LoadPackData(read_buffer,
"04p03a.cfg", &CharaDataBuffer__2[0], 0);
690 Chara__3[12].
frame->SetAttr(attr12, 1, 4);
696 CharaDataBuffer__2[6].
used = 0;
697 Chara__3[13].
LoadPackData(read_buffer,
"04p08a.cfg", &CharaDataBuffer__2[6], 0);
702 Chara__3[13].
frame->SetAttr(attr13, 1, 4);
709 OPAnalyz(
"opdat/norn2.cfg");
713 for (
int i = 0; i < 2; i++) {
726 strcpy(Fuusya[i].name,
"hane");
727 InitObjAnime(DoransFuusya[i], &Fuusya[i]);
730 for (
int i = 0; i < 8; i++) {
740 strcpy(Taimatsu[i].name,
"effect");
741 InitObjAnime(TaimatsuFrame[i], &Taimatsu[i]);
753 strcpy(Taimatsu[8].name,
"hikari");
754 InitObjAnime(TaimatsuFrame[8], &Taimatsu[8]);
756 sceVu0FVECTOR corner0 = {-160.0f, 0.0f, -160.0f, 1.0f};
757 sceVu0FVECTOR corner1 = {160.0f, 0.0f, -160.0f, 1.0f};
758 sceVu0FVECTOR corner2 = {-160.0f, 0.0f, 160.0f, 1.0f};
759 sceVu0FVECTOR corner3 = {160.0f, 0.0f, 160.0f, 1.0f};
761 Water.SetVertex(corner0, corner1, corner2, corner3);
762 Water.
frame.SetPosition(0.0f, -10.0f, 0.0f);
763 Water.SetSize(32, 32, &WaterBuffer__2);
764 Water.SetParam(0.1f, 0.015f, 0.0f, 2.0f);
765 Water.SetColor(128, 128, 128, 128);
767 for (
int i = 0; i < 3; i++) {
768 for (
int j = 0; j < 8; j++) {
773 for (
int i = 0; i < 3; i++) {
775 CBeem[i].
alphas[59] = 0.0f;
786void OpC_InitProcess2() {
790 TexManager.DeleteTextureBlock(0);
792 TexManager.DeleteTextureBlock(15);
794 TexManager.DeleteTextureBlock(14);
796 TexManager.CleanUpBuffer();
799 {
"#blender#640#" HALF_BUFFER_HEIGHT_STR
"#4", 0, 0},
816 tex[1].
name = (
char *) GetPackFile(read_buffer,
"fire.img", 0);
818 tex[1].mipmap =
false;
821 TexManager.LoadTextureBlock(0, tex);
823 tex[0].
name = (
char *) GetPackFile(read_buffer,
"ashikage.img", 0);
825 tex[0].block_no = 18;
827 tex[0].block_no = 17;
829 tex[0].mipmap =
false;
833 TexManager.LoadTextureBlock(18, tex);
835 TexManager.LoadTextureBlock(17, tex);
838 CharaDataBuffer__2[6].
used = 0;
840 CFrameVu1 *shadow = LoadMDSFile((u_int *) GetPackFile(read_buffer,
"ashikage.mds", 0), &CharaDataBuffer__2[6], 2, 0, 0);
842 for (
int i = 0; i < 16; i++) {
846 tex[0].
name = (
char *) GetPackFile(read_buffer,
"p05b01.img", 0);
848 tex[0].mipmap =
false;
851 TexManager.LoadTextureBlock(4, tex);
852 Chara__3[14].
LoadPackData(read_buffer,
"04p05b.cfg", &CharaDataBuffer__2[6], 0);
857 Chara__3[14].
frame->SetAttr(attr14, 1, 4);
863 tex[0].
name = (
char *) GetPackFile(read_buffer,
"p15a01.img", 0);
865 tex[0].mipmap =
false;
868 TexManager.LoadTextureBlock(9, tex);
869 Chara__3[19].
LoadPackData(read_buffer,
"04p15a.cfg", &CharaDataBuffer__2[6], 0);
874 Chara__3[19].
frame->SetAttr(attr19, 1, 4);
880 Chara__3[20].
LoadPackData(read_buffer,
"04p16a.cfg", &CharaDataBuffer__2[6], 0);
885 Chara__3[20].
frame->SetAttr(attr20, 1, 4);
891 tex[0].
name = (
char *) GetPackFile(read_buffer,
"p01a01.img", 0);
893 tex[0].mipmap =
false;
896 TexManager.LoadTextureBlock(5, tex);
897 Chara__3[15].
LoadPackData(read_buffer,
"04p01a.cfg", &CharaDataBuffer__2[6], 0);
902 Chara__3[15].
frame->SetAttr(attr15, 1, 4);
908 tex[0].
name = (
char *) GetPackFile(read_buffer,
"p12a01.img", 0);
910 tex[0].mipmap =
false;
913 TexManager.LoadTextureBlock(6, tex);
914 Chara__3[16].
LoadPackData(read_buffer,
"04p12a.cfg", &CharaDataBuffer__2[6], 0);
919 Chara__3[16].
frame->SetAttr(attr16, 1, 4);
931void OpC_InitProcess3() {
935 TexManager.DeleteTextureBlock(7);
936 TexManager.DeleteTextureBlock(5);
937 TexManager.DeleteTextureBlock(6);
938 TexManager.DeleteTextureBlock(4);
939 TexManager.DeleteTextureBlock(9);
940 TexManager.DeleteTextureBlock(10);
942 TexManager.DeleteTextureBlock(13);
944 TexManager.CleanUpBuffer();
948 tex[0].
name = (
char *) GetPackFile(read_buffer,
"b0203.img", 0);
949 tex[0].block_no = 10;
950 tex[0].mipmap =
false;
951 tex[1].
name = (
char *) GetPackFile(read_buffer,
"b0204.img", 0);
952 tex[1].block_no = 10;
953 tex[1].mipmap =
false;
954 tex[2].
name = (
char *) GetPackFile(read_buffer,
"tukikage.img", 0);
955 tex[2].block_no = 10;
956 tex[2].mipmap =
false;
959 TexManager.LoadTextureBlock(10, tex);
961 tex[0].
name = (
char *) GetPackFile(read_buffer,
"c08a01.img", 0);
963 tex[0].block_no = 16;
965 tex[0].block_no = 15;
967 tex[0].mipmap =
false;
971 TexManager.LoadTextureBlock(16, tex);
973 TexManager.LoadTextureBlock(15, tex);
976 tex[0].
name = (
char *) GetPackFile(read_buffer,
"c09a01.img", 0);
978 tex[0].block_no = 17;
980 tex[0].block_no = 16;
982 tex[0].mipmap =
false;
986 TexManager.LoadTextureBlock(17, tex);
988 TexManager.LoadTextureBlock(16, tex);
991 tex[0].
name = (
char *) GetPackFile(read_buffer,
"beem.img", 0);
993 tex[0].block_no = 18;
995 tex[0].block_no = 17;
997 tex[0].mipmap =
false;
1001 TexManager.LoadTextureBlock(18, tex);
1003 TexManager.LoadTextureBlock(17, tex);
1006 CharaDataBuffer__2[6].
used = 0;
1007 Chara__3[1].
LoadPackData(read_buffer,
"04c08a.cfg", &CharaDataBuffer__2[6], 0);
1012 Chara__3[1].
frame->SetAttr(attr1, 1, 4);
1018 Chara__3[3].
LoadPackData(read_buffer,
"04c09a.cfg", &CharaDataBuffer__2[6], 0);
1023 Chara__3[3].
frame->SetAttr(attr3, 1, 4);
1034 CFrameVu1 *frame = LoadMDSFile((u_int *) GetPackFile(read_buffer,
"b0203.mds", 0), &MapDataBuffer, 2, 0, 0);
1036 frame->SetAttr(sky_attr, 1, 4608);
1040 sky0.SetFrame(frame, 0);
1041 OP_NornMapObj3[0].
handle = 0;
1042 OP_NornMapObj3[0].
unk_34 = 0;
1046 frame = LoadMDSFile((u_int *) GetPackFile(read_buffer,
"b0204.mds", 0), &MapDataBuffer, 2, 0, 0);
1047 frame->SetAttr(sky_attr, 1, 4608);
1048 OP_NornMapObj3[1].Initialize();
1049 OP_NornMapObj3[1].SetFrame(frame, 0);
1050 OP_NornMapObj3[1].
handle = 0;
1051 OP_NornMapObj3[1].
unk_34 = 0;
1058 frame = LoadMDSFile((u_int *) GetPackFile(read_buffer,
"b0302.mds", 0), &MapDataBuffer, 2, 0, 0);
1059 OP_NornMapObj3[2].Initialize();
1060 OP_NornMapObj3[2].SetFrame(frame, 0);
1061 OP_NornMapObj3[2].
handle = 0;
1062 OP_NornMapObj3[2].
unk_34 = 0;
1069 frame = LoadMDSFile((u_int *) GetPackFile(read_buffer,
"tukikage.mds", 0), &MapDataBuffer, 2, 0, 0);
1070 OP_NornMapObj3[3].Initialize();
1071 OP_NornMapObj3[3].SetFrame(frame, 0);
1072 OP_NornMapObj3[3].
handle = 0;
1073 OP_NornMapObj3[3].
unk_34 = 0;
1083 CSnd.
SetVol(MIDI_PORT_SE_TITLE, 256);
1084 CSnd.
SetVol(MIDI_PORT_SE_DEFAULT, 256);
1085 CSnd.
SetVol(MIDI_PORT_UNK_D, 256);
1086 CSnd.
SetVol(MIDI_PORT_SE_SPECIAL, 256);
1094void OpC_InitProcess4() {
1095 while (ReadBGSync())
1098 TexManager.DeleteTextureBlock(0);
1099 TexManager.DeleteTextureBlock(10);
1100 TexManager.DeleteTextureBlock(11);
1101 TexManager.CleanUpBuffer();
1104 {
"#blender#640#" HALF_BUFFER_HEIGHT_STR
"#4", 0, 0},
1121 tex[1].
name = (
char *) GetPackFile(read_buffer,
"fire.img", 0);
1122 tex[1].block_no = 0;
1123 tex[1].mipmap =
false;
1124 tex[2].
name = (
char *) GetPackFile(read_buffer,
"t0203.img", 0);
1125 tex[2].block_no = 10;
1126 tex[2].mipmap =
false;
1127 tex[3].
name = (
char *) GetPackFile(read_buffer,
"e01b01.img", 0);
1128 tex[3].block_no = 10;
1129 tex[3].mipmap =
false;
1130 tex[4].
name = (
char *) GetPackFile(read_buffer,
"e01b02.img", 0);
1131 tex[4].block_no = 10;
1132 tex[4].mipmap =
false;
1133 tex[5].
name = (
char *) GetPackFile(read_buffer,
"e01b03.img", 0);
1134 tex[5].block_no = 10;
1135 tex[5].mipmap =
false;
1136 tex[6].
name = (
char *) GetPackFile(read_buffer,
"e01t01.img", 0);
1138 tex[6].block_no = 13;
1140 tex[6].block_no = 10;
1142 tex[6].mipmap =
false;
1143 tex[7].
name = (
char *) GetPackFile(read_buffer,
"t0205.img", 0);
1144 tex[7].block_no = 10;
1145 tex[7].mipmap =
false;
1146 tex[8].
name = (
char *) GetPackFile(read_buffer,
"t0003.img", 0);
1147 tex[8].block_no = 11;
1148 tex[8].mipmap =
false;
1149 tex[9].
name = (
char *) GetPackFile(read_buffer,
"e01s03.img", 0);
1150 tex[9].block_no = 11;
1151 tex[9].mipmap =
false;
1152 tex[10].
name = (
char *) GetPackFile(read_buffer,
"e01s06.img", 0);
1153 tex[10].block_no = 11;
1154 tex[10].mipmap =
false;
1155 tex[11].
name = (
char *) GetPackFile(read_buffer,
"t0001.img", 0);
1156 tex[11].block_no = 11;
1157 tex[11].mipmap =
false;
1158 tex[12].
name = (
char *) GetPackFile(read_buffer,
"bakuhatu.img", 0);
1160 tex[12].block_no = 18;
1162 tex[12].block_no = 17;
1164 tex[12].mipmap =
false;
1165 tex[13].
name = (
char *) GetPackFile(read_buffer,
"sunakemuri.img", 0);
1167 tex[13].block_no = 18;
1169 tex[13].block_no = 17;
1171 tex[13].mipmap =
false;
1174 TexManager.LoadTextureBlock(-1, tex);
1180void OpC_InitProcess5() {
1181 while (ReadBGSync())
1185 TexManager.DeleteTextureBlock(14);
1187 TexManager.DeleteTextureBlock(13);
1190 TexManager.DeleteTextureBlock(18);
1192 TexManager.DeleteTextureBlock(17);
1194 TexManager.DeleteTextureBlock(0);
1195 TexManager.CleanUpBuffer();
1198 {
"#blender#640#" HALF_BUFFER_HEIGHT_STR
"#4", 0, 0},
1215 tex[1].
name = (
char *) GetPackFile(read_buffer,
"fire.img", 0);
1216 tex[1].block_no = 0;
1217 tex[1].mipmap =
false;
1220 TexManager.LoadTextureBlock(0, tex);
1222 tex[0].
name = (
char *) GetPackFile(read_buffer,
"smoke.img", 0);
1224 tex[0].block_no = 18;
1226 tex[0].block_no = 17;
1228 tex[0].mipmap =
false;
1229 tex[1].
name = (
char *) GetPackFile(read_buffer,
"beem.img", 0);
1231 tex[1].block_no = 18;
1233 tex[1].block_no = 17;
1235 tex[1].mipmap =
false;
1236 tex[2].
name = (
char *) GetPackFile(read_buffer,
"bakuhatu.img", 0);
1238 tex[2].block_no = 18;
1240 tex[2].block_no = 17;
1242 tex[2].mipmap =
false;
1243 tex[3].
name = (
char *) GetPackFile(read_buffer,
"sunakemuri.img", 0);
1245 tex[3].block_no = 18;
1247 tex[3].block_no = 17;
1249 tex[3].mipmap =
false;
1253 TexManager.LoadTextureBlock(18, tex);
1255 TexManager.LoadTextureBlock(17, tex);
1258 CharaDataBuffer__2[6].
used = 0;
1261 Chara__3[11].
LoadPackData(read_buffer,
"04c01d.cfg", &CharaDataBuffer__2[0], 0);
1266 Chara__3[11].
frame->SetAttr(attr11, 1, 4);
1271 Chara__3[11].
wind = (int) &Wind;
1273 tex[0].
name = (
char *) GetPackFile(read_buffer,
"p09a01.img", 0);
1274 tex[0].block_no = 3;
1275 tex[0].mipmap =
false;
1276 tex[1].
name = (
char *) GetPackFile(read_buffer,
"p09a01an.img", 0);
1277 tex[1].block_no = 3;
1278 tex[1].mipmap =
false;
1281 TexManager.LoadTextureBlock(3, tex);
1282 Chara__3[9].
LoadPackData(read_buffer,
"04p09a.cfg", &CharaDataBuffer__2[6], 0);
1287 Chara__3[9].
frame->SetAttr(attr9, 1, 4);
1293 tex[0].
name = (
char *) GetPackFile(read_buffer,
"p08a01.img", 0);
1295 tex[0].block_no = 15;
1297 tex[0].block_no = 14;
1299 tex[0].mipmap =
false;
1303 TexManager.LoadTextureBlock(15, tex);
1305 TexManager.LoadTextureBlock(14, tex);
1307 Chara__3[13].
LoadPackData(read_buffer,
"04p08a.cfg", &CharaDataBuffer__2[6], 0);
1312 Chara__3[13].
frame->SetAttr(attr13, 1, 4);
1318 Chara__3[18].
LoadPackData(read_buffer,
"04p02a.cfg", &CharaDataBuffer__2[6], 0);
1323 Chara__3[18].
frame->SetAttr(attr18, 1, 4);
1329 Chara__3[1].
LoadPackData(read_buffer,
"04c08a.cfg", &CharaDataBuffer__2[6], 0);
1334 Chara__3[1].
frame->SetAttr(attr1, 1, 4);
1340 Chara__3[3].
LoadPackData(read_buffer,
"04c09a.cfg", &CharaDataBuffer__2[6], 0);
1345 Chara__3[3].
frame->SetAttr(attr3, 1, 4);
1362 Fuusya[0].
step_z = -0.5f;
1363 strcpy(Fuusya[0].name,
"hane");
1364 InitObjAnime(DoransFuusya[0], &Fuusya[0]);
1377 Fuusya[1].
step_z = -0.048f;
1378 strcpy(Fuusya[1].name,
"obj1");
1379 InitObjAnime(DoransFuusya[1], &Fuusya[1]);
1381 for (
int i = 0; i < 5; i++) {
1391 strcpy(Taimatsu[i].name,
"effect");
1392 InitObjAnime(TaimatsuFrame[i], &Taimatsu[i]);
1404 strcpy(Taimatsu[8].name,
"hikari");
1405 InitObjAnime(TaimatsuFrame[8], &Taimatsu[8]);
1407 EffectTable = (
CEffect *) CharaDataBuffer__2[0].Alloc(12800);
1408 Smoke.Initialize(EffectTable, 50);
1425static void MapLoad() {
1427 {
"opdat/norn2/t0207.mds", 0, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f} },
1428 {
"opdat/norn2/e01h01_0.mds",
"opdat/norn2/e01h01_s.mds", {-35.0f, 0.0f, -20.0f}, {0.0f, 0.0f, 0.0f} },
1429 {
"opdat/norn2/e01h05_2.mds", 0, {50.0f, 0.0f, 20.0f}, {0.0f, -90.0f, 0.0f} },
1430 {
"opdat/norn2/e01h11_2.mds", 0, {50.0f, 0.0f, -10.0f}, {0.0f, -90.0f, 0.0f} },
1431 {
"opdat/norn2/e01h07_2.mds", 0, {5.0f, 0.0f, -20.0f}, {0.0f, 0.0f, 0.0f} },
1432 {
"opdat/norn2/e01h08_2.mds", 0, {-45.0f, 0.0f, -45.0f}, {0.0f, 0.0f, 0.0f} },
1433 {
"opdat/norn2/e01h02_2.mds", 0, {-60.0f, 0.0f, 30.0f}, {0.0f, 90.0f, 0.0f} },
1434 {
"opdat/norn2/e01h06_2.mds", 0, {0.0f, 4.7424f, 79.274f}, {0.0f, 0.0f, 0.0f} },
1435 {
"opdat/norn2/e01a02_1.mds", 0, {0.0f, 0.0f, 59.965f}, {0.0f, 0.0f, 0.0f} },
1436 {
"opdat/norn2/t0002.mds", 0, {-23.7809f, 0.0f, 19.8331f}, {0.0f, -4.4f, 0.0f} },
1437 {0, 0, {23.1908f, 0.0f, 38.0943f}, {0.0f, -170.971f, 0.0f}},
1438 {
"opdat/norn2/e01t01_0.mds", 0, {-45.0f, 0.1f, -5.0f}, {0.0f, 0.0f, 0.0f} },
1439 {
"opdat/norn2/e01t01_1.mds", 0, {65.0f, 0.1f, 45.0f}, {0.0f, -90.0f, 0.0f} },
1440 {0, 0, {55.0f, 0.1f, 55.0f}, {0.0f, -90.0f, 0.0f} },
1441 {0, 0, {-45.0f, 0.1f, 55.0f}, {0.0f, -90.0f, 0.0f} },
1442 {0, 0, {55.0f, 0.1f, 5.0f}, {0.0f, -90.0f, 0.0f} },
1443 {
"opdat/norn2/e01c01_0.mds", 0, {25.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1444 {0, 0, {-45.0f, 0.0f, 5.0f}, {0.0f, -90.0f, 0.0f} },
1445 {
"opdat/norn2/e01c02_0.mds", 0, {-45.0f, 0.0f, 25.0f}, {0.0f, 0.0f, 0.0f} },
1446 {0, 0, {-45.0f, 0.0f, 15.0f}, {0.0f, 0.0f, 0.0f} },
1447 {0, 0, {-25.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1448 {0, 0, {-5.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1449 {0, 0, {-15.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1450 {0, 0, {15.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1451 {0, 0, {25.0f, 0.0f, -5.0f}, {0.0f, 0.0f, 0.0f} },
1452 {0, 0, {25.0f, 0.0f, -15.0f}, {0.0f, 0.0f, 0.0f} },
1453 {0, 0, {25.0f, 0.0f, -25.0f}, {0.0f, 0.0f, 0.0f} },
1454 {
"opdat/norn2/e01c06_0.mds", 0, {-45.0f, 0.0f, 35.0f}, {0.0f, 180.0f, 0.0f} },
1455 {
"opdat/norn2/e01c07_0.mds", 0, {-35.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1456 {0, 0, {5.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1457 {
"opdat/norn2/e01c08_0.mds", 0, {25.0f, -0.01f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1458 {0, 0, {-45.0f, -0.01f, 5.0f}, {0.0f, -90.0f, 0.0f} },
1459 {0, 0, {-45.0f, -0.01f, 25.0f}, {0.0f, 0.0f, 0.0f} },
1460 {0, 0, {-45.0f, -0.01f, 15.0f}, {0.0f, 0.0f, 0.0f} },
1461 {0, 0, {-25.0f, -0.01f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1462 {0, 0, {-5.0f, -0.01f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1463 {0, 0, {-15.0f, -0.01f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1464 {0, 0, {15.0f, -0.01f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1465 {0, 0, {25.0f, -0.01f, -5.0f}, {0.0f, 0.0f, 0.0f} },
1466 {0, 0, {25.0f, -0.01f, -15.0f}, {0.0f, 0.0f, 0.0f} },
1467 {0, 0, {25.0f, -0.01f, -25.0f}, {0.0f, 0.0f, 0.0f} },
1468 {0, 0, {-45.0f, -0.01f, 35.0f}, {0.0f, 180.0f, 0.0f} },
1469 {0, 0, {-35.0f, -0.01f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1470 {0, 0, {5.0f, -0.01f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1471 {
"opdat/norn2/e01w01_0.mds", 0, {25.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1472 {0, 0, {-45.0f, 0.0f, 5.0f}, {0.0f, -90.0f, 0.0f} },
1473 {
"opdat/norn2/e01w02_0.mds", 0, {-45.0f, 0.0f, 25.0f}, {0.0f, 0.0f, 0.0f} },
1474 {0, 0, {-45.0f, 0.0f, 15.0f}, {0.0f, 0.0f, 0.0f} },
1475 {0, 0, {-25.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1476 {0, 0, {-5.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1477 {0, 0, {-15.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1478 {0, 0, {15.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1479 {0, 0, {25.0f, 0.0f, -5.0f}, {0.0f, 0.0f, 0.0f} },
1480 {0, 0, {25.0f, 0.0f, -15.0f}, {0.0f, 0.0f, 0.0f} },
1481 {0, 0, {25.0f, 0.0f, -25.0f}, {0.0f, 0.0f, 0.0f} },
1482 {
"opdat/norn2/e01w06_0.mds", 0, {-45.0f, 0.0f, 35.0f}, {0.0f, 180.0f, 0.0f} },
1483 {
"opdat/norn2/e01r02_0.mds", 0, {-35.0f, 0.05f, -35.0f}, {0.0f, 90.0f, 0.0f} },
1484 {0, 0, {-25.0f, 0.05f, -35.0f}, {0.0f, 90.0f, 0.0f} },
1485 {
"opdat/norn2/e01r02_0.mds", 0, {-15.0f, 0.05f, -25.0f}, {0.0f, 0.0f, 0.0f} },
1486 {0, 0, {-5.0f, 0.05f, -5.0f}, {0.0f, -90.0f, 0.0f} },
1487 {0, 0, {-15.0f, 0.05f, -15.0f}, {0.0f, 0.0f, 0.0f} },
1488 {0, 0, {-25.0f, 0.05f, -5.0f}, {0.0f, 90.0f, 0.0f} },
1489 {
"opdat/norn2/e01r03_0.mds", 0, {-15.0f, 0.05f, -35.0f}, {0.0f, 0.0f, 0.0f} },
1490 {0, 0, {-15.0f, 0.05f, -5.0f}, {0.0f, 180.0f, 0.0f} },
1491 {
"opdat/norn2/e01r06_0.mds", 0, {-35.0f, 0.05f, -5.0f}, {0.0f, 90.0f, 0.0f} },
1492 {0, 0, {5.0f, 0.05f, -5.0f}, {0.0f, -90.0f, 0.0f} },
1493 {
"opdat/norn2/t0004.mds", 0, {-32.9331f, 0.06f, 10.3033f}, {0.0f, 0.0f, 0.0f} },
1494 {0, 0, {-36.9302f, 0.06f, 10.3033f}, {0.0f, 0.0f, 0.0f} },
1495 {0, 0, {-36.9302f, 0.06f, -0.0916f}, {0.0f, 0.0f, 0.0f} },
1496 {0, 0, {-32.9331f, 0.06f, -0.0916f}, {0.0f, 0.0f, 0.0f} },
1497 {0, 0, {3.0797f, 0.06f, -0.0916f}, {0.0f, 0.0f, 0.0f} },
1498 {0, 0, {7.0849f, 0.06f, -0.0916f}, {0.0f, 0.0f, 0.0f} },
1499 {0, 0, {7.0849f, 0.06f, 10.3125f}, {0.0f, 0.0f, 0.0f} },
1500 {0, 0, {3.0797f, 0.06f, 10.3125f}, {0.0f, 0.0f, 0.0f} },
1501 {
"opdat/norn2/t0213.mds", 0, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f} }
1509 MapDataBuffer.
used = 0;
1511 for (i = 0; i < 75; i++) {
1513 LoadFile(norn[i].name, (
void *) read_buffer, 0);
1514 frame = LoadMDSFile(read_buffer, &MapDataBuffer, 2, 0, 0);
1518 DoransFuusya[0] = frame;
1522 DoransFuusya[1] = frame;
1525 if (i >= 67 && i < 75) {
1526 TaimatsuFrame[i - 67] = frame;
1529 SetFrameAttr(frame, 1);
1530 frame->SetAttr(attr, 1, 64);
1534 object.Initialize();
1535 object.SetFrame(frame, 0);
1536 OP_NornMapObj[i].
handle = 0;
1537 OP_NornMapObj[i].
unk_34 = 0;
1539 object.SetPosition(
CVector3_f_(10.0f * norn[i].position[0], 10.0f * norn[i].position[1], 10.0f * norn[i].position[2]));
1540 object.SetRotation(
CVector3_f_((
float) (PI_D * norn[i].rotation[0] / 180), (
float) (PI_D * norn[i].rotation[1] / 180), (
float) (PI_D * norn[i].rotation[2] / 180)));
1542 object.FrameObjectOnOff(
"win1", 0);
1543 object.FrameObjectOnOff(
"light1", 0);
1545 if (norn[i].shadow_name) {
1546 LoadFile(norn[i].shadow_name, (
void *) read_buffer, 0);
1547 object.shadow_frame = LoadMDSFile(read_buffer, &MapDataBuffer, 14, 0, 0);
1548 object.shadow_offset = -20.0f;
1553 {
"opdat/norn/t0006.mds", 0, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f} },
1554 {
"opdat/norn2/t0001.mds", 0, {-33.25f, 0.03f, 13.0707f}, {0.0f, 0.0f, 0.0f} },
1555 {0, 0, {-23.25f, 0.03f, 13.0707f}, {0.0f, 0.0f, 0.0f} },
1556 {0, 0, {-13.25f, 0.03f, 13.0707f}, {0.0f, 0.0f, 0.0f} },
1557 {0, 0, {-3.25f, 0.03f, 13.0707f}, {0.0f, 0.0f, 0.0f} },
1558 {0, 0, {14.9146f, 0.03f, 13.0707f}, {0.0f, 0.0f, 0.0f} },
1559 {0, 0, {24.9146f, 0.03f, 13.0707f}, {0.0f, 0.0f, 0.0f} },
1560 {0, 0, {34.9146f, 0.03f, 13.0707f}, {0.0f, 0.0f, 0.0f} },
1561 {0, 0, {36.4833f, 0.03f, 17.4747f}, {0.0f, -90.0f, 0.0f} },
1562 {0, 0, {36.4833f, 0.03f, 27.4747f}, {0.0f, -90.0f, 0.0f} },
1563 {0, 0, {36.4833f, 0.03f, 37.4747f}, {0.0f, -90.0f, 0.0f} },
1564 {0, 0, {36.4833f, 0.03f, 47.4747f}, {0.0f, -90.0f, 0.0f} },
1565 {0, 0, {34.9598f, 0.03f, 52.2721f}, {0.0f, -180.0f, 0.0f} },
1566 {0, 0, {25.8411f, 0.03f, 52.2721f}, {0.0f, -180.0f, 0.0f} },
1567 {0, 0, {16.0658f, 0.03f, 52.2721f}, {0.0f, -180.0f, 0.0f} },
1568 {0, 0, {6.657f, 0.03f, 52.2721f}, {0.0f, -180.0f, 0.0f} },
1569 {0, 0, {-6.7301f, 0.03f, 52.2721f}, {0.0f, -180.0f, 0.0f} },
1570 {0, 0, {-15.4243f, 0.03f, 52.2721f}, {0.0f, -180.0f, 0.0f} },
1571 {0, 0, {-24.5027f, 0.03f, 52.2721f}, {0.0f, -180.0f, 0.0f} },
1572 {0, 0, {-33.5025f, 0.03f, 52.2721f}, {0.0f, -180.0f, 0.0f} },
1573 {0, 0, {-35.0227f, 0.03f, 47.4712f}, {0.0f, 90.0f, 0.0f} },
1574 {0, 0, {-35.0227f, 0.03f, 37.4712f}, {0.0f, 90.0f, 0.0f} },
1575 {0, 0, {-35.0227f, 0.03f, 27.4712f}, {0.0f, 90.0f, 0.0f} },
1576 {0, 0, {-35.0227f, 0.03f, 17.4712f}, {0.0f, 90.0f, 0.0f} },
1577 {
"opdat/norn2/t0003.mds", 0, {-28.23f, 0.03f, 13.1174f}, {0.0f, 0.0f, 0.0f} },
1578 {0, 0, {-18.23f, 0.03f, 13.1174f}, {0.0f, 0.0f, 0.0f} },
1579 {0, 0, {-8.23f, 0.03f, 13.1174f}, {0.0f, 0.0f, 0.0f} },
1580 {0, 0, {19.937f, 0.03f, 13.1174f}, {0.0f, 0.0f, 0.0f} },
1581 {0, 0, {29.937f, 0.03f, 13.1174f}, {0.0f, 0.0f, 0.0f} },
1582 {0, 0, {36.4365f, 0.03f, 22.4967f}, {0.0f, -90.0f, 0.0f} },
1583 {0, 0, {36.4365f, 0.03f, 32.4967f}, {0.0f, -90.0f, 0.0f} },
1584 {0, 0, {36.4365f, 0.03f, 42.4967f}, {0.0f, -90.0f, 0.0f} },
1585 {0, 0, {31.6374f, 0.03f, 52.3176f}, {0.0f, -180.0f, 0.0f} },
1586 {0, 0, {21.6374f, 0.03f, 52.3176f}, {0.0f, -180.0f, 0.0f} },
1587 {0, 0, {11.6374f, 0.03f, 52.3176f}, {0.0f, -180.0f, 0.0f} },
1588 {0, 0, {-10.1013f, 0.03f, 52.3176f}, {0.0f, -180.0f, 0.0f} },
1589 {0, 0, {-20.1013f, 0.03f, 52.3176f}, {0.0f, -180.0f, 0.0f} },
1590 {0, 0, {-30.1013f, 0.03f, 52.3176f}, {0.0f, -180.0f, 0.0f} },
1591 {0, 0, {-34.9775f, 0.03f, 42.4508f}, {0.0f, 90.0f, 0.0f} },
1592 {0, 0, {-34.9775f, 0.03f, 32.4508f}, {0.0f, 90.0f, 0.0f} },
1593 {0, 0, {-34.9775f, 0.03f, 22.4508f}, {0.0f, 90.0f, 0.0f} },
1594 {
"opdat/norn2/t0212.mds", 0, {0.0f, 0.02f, 30.0f}, {0.0f, 0.0f, 0.0f} },
1595 {
"opdat/norn2/t0208.mds", 0, {0.0f, 0.0f, 29.999f}, {0.0f, 0.0f, 0.0f} },
1596 {
"opdat/norn2/t0201.mds", 0, {8.1246f, 0.0f, 21.2374f}, {0.0f, -190.452f, 0.0f}},
1597 {0, 0, {9.3114f, 0.0f, 21.4458f}, {0.0f, -243.621f, 0.0f}},
1598 {0, 0, {9.8278f, 0.0f, 22.3789f}, {0.0f, -237.204f, 0.0f}},
1599 {0, 0, {9.6149f, 1.2748f, 21.9196f}, {0.0f, -237.777f, 0.0f}},
1600 {0, 0, {-10.8524f, 0.0f, 38.0058f}, {0.0f, 279.8325f, 0.0f}},
1601 {0, 0, {-11.6807f, 0.0f, 36.7247f}, {0.0f, 281.7807f, 0.0f}},
1602 {0, 0, {-11.9794f, 0.0f, 37.8902f}, {0.0f, 287.5107f, 0.0f}},
1603 {0, 0, {-12.2587f, 0.0f, 39.046f}, {0.0f, 288.9999f, 0.0f}},
1604 {0, 0, {-10.9969f, 0.0f, 39.1231f}, {0.0f, 280.291f, 0.0f} },
1605 {0, 0, {24.4449f, 0.0f, 28.8081f}, {0.0f, -84.5684f, 0.0f}},
1606 {0, 0, {24.5097f, 1.2748f, 29.317f}, {0.0f, -84.5684f, 0.0f}},
1607 {0, 0, {24.7114f, 0.0f, 29.8031f}, {0.0f, -84.5684f, 0.0f}},
1608 {0, 0, {24.9802f, 1.2748f, 30.2274f}, {0.0f, -84.5684f, 0.0f}},
1609 {0, 0, {25.2412f, 0.0f, 30.6682f}, {0.0f, -84.5684f, 0.0f}},
1610 {
"opdat/norn2/t0202.mds", 0, {6.9352f, 0.0f, 22.8016f}, {0.0f, -66.4631f, 0.0f}},
1611 {0, 0, {-14.5591f, 0.0f, 35.5869f}, {0.0f, 112.4143f, 0.0f}},
1612 {
"opdat/norn2/t0203.mds", 0, {8.5959f, 0.0f, 23.4822f}, {0.0f, -49.7327f, 0.0f}},
1613 {0, 0, {-13.0716f, 0.0f, 36.4929f}, {0.0f, 129.2592f, 0.0f}},
1614 {0, 0, {-14.4103f, 0.0f, 37.4364f}, {0.0f, 112.5289f, 0.0f}},
1615 {
"opdat/norn2/t0204.mds", 0, {-9.0122f, 0.0f, 20.8749f}, {0.0f, -234.912f, 0.0f}},
1616 {0, 0, {-9.9647f, 0.0f, 21.4127f}, {0.0f, -227.234f, 0.0f}},
1617 {0, 0, {-10.7374f, 0.0f, 22.1576f}, {0.0f, -223.797f, 0.0f}},
1618 {0, 0, {-9.4268f, 0.9971f, 21.1822f}, {0.0f, -241.444f, 0.0f}},
1619 {0, 0, {-10.3487f, 0.9971f, 21.8464f}, {0.0f, -225.287f, 0.0f}},
1620 {0, 0, {-9.8716f, 1.9904f, 21.4498f}, {0.0f, -228.61f, 0.0f} },
1621 {0, 0, {12.8223f, 0.0f, 26.3336f}, {0.0f, -343.545f, 0.0f}},
1622 {0, 0, {11.8478f, 0.0f, 26.9861f}, {0.0f, -348.702f, 0.0f}},
1623 {0, 0, {11.9701f, 0.0f, 28.1885f}, {0.0f, -354.661f, 0.0f}},
1624 {0, 0, {13.085f, 0.0f, 27.3741f}, {0.0f, -346.983f, 0.0f}},
1625 {0, 0, {11.7334f, 0.9971f, 27.8052f}, {0.0f, -348.358f, 0.0f}},
1626 {0, 0, {12.58f, 0.9971f, 26.905f}, {0.0f, -337.013f, 0.0f}},
1627 {0, 0, {12.8088f, 0.0f, 38.6433f}, {0.0f, -382.965f, 0.0f}},
1628 {0, 0, {11.6416f, 0.0f, 38.5285f}, {0.0f, -388.121f, 0.0f}},
1629 {0, 0, {10.9726f, 0.0f, 39.535f}, {0.0f, -394.08f, 0.0f} },
1630 {0, 0, {12.3514f, 0.0f, 39.6143f}, {0.0f, -386.402f, 0.0f}},
1631 {0, 0, {11.0331f, 0.9971f, 39.0886f}, {0.0f, -387.777f, 0.0f}},
1632 {0, 0, {12.2587f, 0.9971f, 38.9308f}, {0.0f, -376.433f, 0.0f}},
1633 {
"opdat/norn2/t0205.mds", 0, {-9.8702f, 2.9808f, 21.5102f}, {0.0f, -140.374f, 0.0f}},
1634 {0, 0, {-11.6688f, 1.2789f, 36.7089f}, {0.0f, -61.7649f, 0.0f}},
1635 {0, 0, {12.4831f, 1.9258f, 26.9556f}, {0.0f, -84.3394f, 0.0f}},
1636 {
"opdat/norn2/t0206.mds", 0, {-4.3913f, 0.0f, 18.9443f}, {0.0f, 18.3347f, 0.0f} },
1637 {0, 0, {-13.2586f, 0.0f, 27.5378f}, {0.0f, 77.6931f, 0.0f} },
1638 {0, 0, {4.648f, 0.0f, 19.1829f}, {0.0f, -21.6578f, 0.0f}},
1639 {0, 0, {13.7675f, 0.0f, 33.1962f}, {0.0f, -110.58f, 0.0f} }
1642 for (
int j = 0; j < 87; j++) {
1643 if (ground[j].name) {
1644 LoadFile(ground[j].name, (
void *) read_buffer, 0);
1645 ground_frame = LoadMDSFile(read_buffer, &MapDataBuffer, 2, 0, 0);
1649 ground_frame->SetAttr(attr, 1, 64);
1650 SetFrameAttr(ground_frame, 1);
1654 TaimatsuFrame[8] = ground_frame;
1658 CFrame *sun = ground_frame->SearchFrame(
"sun3");
1665 sun->SetPosition(x, (
float) y, (
float) z);
1670 object.Initialize();
1671 object.SetFrame(ground_frame, 0);
1672 OP_NornMapObj2[j].
handle = 0;
1673 OP_NornMapObj2[j].
unk_34 = 0;
1675 object.SetPosition(
CVector3_f_(10.0f * ground[j].position[0], 10.0f * ground[j].position[1], 10.0f * ground[j].position[2]));
1676 object.SetRotation(
CVector3_f_((
float) (PI_D * ground[j].rotation[0] / 180), (
float) (PI_D * ground[j].rotation[1] / 180), (
float) (PI_D * ground[j].rotation[2] / 180)));
1690static void MapLoad2() {
1692 {
"b0301.mds", 0, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f} },
1693 {
"e01h01_1.mds", 0, {-35.0f, 0.0f, -20.0f}, {0.0f, 0.0f, 0.0f} },
1694 {
"e01h05_2.mds", 0, {50.0f, 0.0f, 20.0f}, {0.0f, -90.0f, 0.0f} },
1695 {
"e01h11_2.mds", 0, {55.0f, 0.0f, -10.0f}, {0.0f, -90.0f, 0.0f} },
1696 {
"e01h07_2.mds", 0, {5.0f, 0.0f, -20.0f}, {0.0f, 0.0f, 0.0f} },
1697 {
"e01h02_2.mds", 0, {-60.0f, 0.0f, 30.0f}, {0.0f, 90.0f, 0.0f} },
1698 {
"e01h06_2.mds", 0, {0.0f, 4.7424f, 79.274f}, {0.0f, 0.0f, 0.0f} },
1699 {
"e01a02_1.mds", 0, {0.0f, 0.0f, 59.965f}, {0.0f, 0.0f, 0.0f} },
1700 {
"t0304.mds", 0, {-5.0f, 0.0f, -45.0f}, {0.0f, 0.0f, 0.0f} },
1701 {0, 0, {-25.0f, 0.0f, -45.0f}, {0.0f, 0.0f, 0.0f} },
1702 {
"t0305.mds", 0, {45.0f, 0.0f, -50.0f}, {0.0f, 0.0f, 0.0f} },
1703 {
"t0002.mds", 0, {-23.7809f, 0.0f, 19.8331f}, {0.0f, -4.4f, 0.0f} },
1704 {0, 0, {23.1908f, 0.0f, 38.0943f}, {0.0f, -170.971f, 0.0f}},
1705 {
"e01t01_0.mds", 0, {-45.0f, 0.1f, -5.0f}, {0.0f, 0.0f, 0.0f} },
1706 {0, 0, {65.0f, 0.1f, 45.0f}, {0.0f, 0.0f, 0.0f} },
1707 {
"e01t01_1.mds", 0, {55.0f, 0.1f, -35.0f}, {0.0f, -90.0f, 0.0f} },
1708 {0, 0, {-45.0f, 0.1f, 55.0f}, {0.0f, -90.0f, 0.0f} },
1709 {0, 0, {-55.0f, 0.1f, 5.0f}, {0.0f, -90.0f, 0.0f} },
1710 {
"e01c01_0.mds", 0, {25.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1711 {0, 0, {-45.0f, 0.0f, 5.0f}, {0.0f, -90.0f, 0.0f} },
1712 {
"e01c02_0.mds", 0, {-45.0f, 0.0f, 25.0f}, {0.0f, 0.0f, 0.0f} },
1713 {0, 0, {-45.0f, 0.0f, 15.0f}, {0.0f, 0.0f, 0.0f} },
1714 {0, 0, {-25.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1715 {0, 0, {-5.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1716 {0, 0, {-15.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1717 {0, 0, {15.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1718 {0, 0, {25.0f, 0.0f, -5.0f}, {0.0f, 0.0f, 0.0f} },
1719 {0, 0, {25.0f, 0.0f, -15.0f}, {0.0f, 0.0f, 0.0f} },
1720 {0, 0, {25.0f, 0.0f, -25.0f}, {0.0f, 0.0f, 0.0f} },
1721 {
"e01c06_0.mds", 0, {-45.0f, 0.0f, 35.0f}, {0.0f, 180.0f, 0.0f} },
1722 {
"e01c07_0.mds", 0, {-35.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1723 {0, 0, {5.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1724 {
"e01c08_0.mds", 0, {25.0f, -0.01f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1725 {0, 0, {-45.0f, -0.01f, 5.0f}, {0.0f, -90.0f, 0.0f} },
1726 {0, 0, {-45.0f, -0.01f, 25.0f}, {0.0f, 0.0f, 0.0f} },
1727 {0, 0, {-45.0f, -0.01f, 15.0f}, {0.0f, 0.0f, 0.0f} },
1728 {0, 0, {-25.0f, -0.01f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1729 {0, 0, {-5.0f, -0.01f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1730 {0, 0, {-15.0f, -0.01f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1731 {0, 0, {15.0f, -0.01f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1732 {0, 0, {25.0f, -0.01f, -5.0f}, {0.0f, 0.0f, 0.0f} },
1733 {0, 0, {25.0f, -0.01f, -15.0f}, {0.0f, 0.0f, 0.0f} },
1734 {0, 0, {25.0f, -0.01f, -25.0f}, {0.0f, 0.0f, 0.0f} },
1735 {0, 0, {-45.0f, -0.01f, 35.0f}, {0.0f, 180.0f, 0.0f} },
1736 {0, 0, {-35.0f, -0.01f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1737 {0, 0, {5.0f, -0.01f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1738 {
"e01w01_0.mds", 0, {25.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1739 {0, 0, {-45.0f, 0.0f, 5.0f}, {0.0f, -90.0f, 0.0f} },
1740 {
"e01w02_0.mds", 0, {-45.0f, 0.0f, 25.0f}, {0.0f, 0.0f, 0.0f} },
1741 {0, 0, {-45.0f, 0.0f, 15.0f}, {0.0f, 0.0f, 0.0f} },
1742 {0, 0, {-25.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1743 {0, 0, {-5.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1744 {0, 0, {-15.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1745 {0, 0, {15.0f, 0.0f, 5.0f}, {0.0f, 90.0f, 0.0f} },
1746 {0, 0, {25.0f, 0.0f, -5.0f}, {0.0f, 0.0f, 0.0f} },
1747 {0, 0, {25.0f, 0.0f, -15.0f}, {0.0f, 0.0f, 0.0f} },
1748 {0, 0, {25.0f, 0.0f, -25.0f}, {0.0f, 0.0f, 0.0f} },
1749 {
"e01w06_0.mds", 0, {-45.0f, 0.0f, 35.0f}, {0.0f, 180.0f, 0.0f} },
1750 {
"e01r02_0.mds", 0, {-35.0f, 0.05f, -35.0f}, {0.0f, 90.0f, 0.0f} },
1751 {0, 0, {-25.0f, 0.05f, -35.0f}, {0.0f, 90.0f, 0.0f} },
1752 {
"e01r02_0.mds", 0, {-15.0f, 0.05f, -25.0f}, {0.0f, 0.0f, 0.0f} },
1753 {0, 0, {-5.0f, 0.05f, -5.0f}, {0.0f, -90.0f, 0.0f} },
1754 {0, 0, {-15.0f, 0.05f, -15.0f}, {0.0f, 0.0f, 0.0f} },
1755 {0, 0, {-25.0f, 0.05f, -5.0f}, {0.0f, 90.0f, 0.0f} },
1756 {
"e01r03_0.mds", 0, {-15.0f, 0.05f, -35.0f}, {0.0f, 0.0f, 0.0f} },
1757 {0, 0, {-15.0f, 0.05f, -5.0f}, {0.0f, 180.0f, 0.0f} },
1758 {
"e01r06_0.mds", 0, {-35.0f, 0.05f, -5.0f}, {0.0f, 90.0f, 0.0f} },
1759 {0, 0, {5.0f, 0.05f, -5.0f}, {0.0f, -90.0f, 0.0f} },
1760 {
"t0302.mds", 0, {2.9721f, 0.06f, -0.6331f}, {0.0f, 36.2109f, 0.0f} },
1761 {0, 0, {7.2685f, 0.06f, 11.4402f}, {0.0f, -116.883f, 0.0f}},
1762 {0, 0, {2.9715f, 0.06f, 12.3798f}, {0.0f, 135.9057f, 0.0f}},
1763 {0, 0, {7.6022f, 0.06f, -3.0402f}, {0.0f, 75.5158f, 0.0f} },
1764 {0, 0, {-35.9097f, 0.06f, 12.6724f}, {0.0f, 145.6459f, 0.0f}},
1765 {
"t0213.mds", 0, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f} },
1766 {
"t0306.mds", 0, {45.0f, 0.0f, 50.0f}, {0.0f, 90.0f, 0.0f} },
1767 {
"t0307.mds", 0, {45.0f, 0.0f, 50.0f}, {0.0f, 180.0f, 0.0f} }
1775 CharaDataBuffer__2[0].
used = 0;
1777 for (i = 0; i < 76; i++) {
1779 frame = LoadMDSFile((u_int *) GetPackFile(read_buffer, norn[i].name, 0), &CharaDataBuffer__2[0], 2, 0, 0);
1783 DoransFuusya[0] = frame;
1787 DoransFuusya[1] = frame;
1790 if (i >= 69 && i < 74) {
1791 TaimatsuFrame[i - 69] = frame;
1794 frame->SetAttr(attr, 1, 64);
1795 SetFrameAttr(frame, 1);
1799 object.Initialize();
1800 object.SetFrame(frame, 0);
1801 OP_NornMapObj[i].
handle = 0;
1802 OP_NornMapObj[i].
unk_34 = 0;
1804 object.SetPosition(
CVector3_f_(10.0f * norn[i].position[0], 10.0f * norn[i].position[1], 10.0f * norn[i].position[2]));
1805 object.SetRotation(
CVector3_f_((
float) (PI_D * norn[i].rotation[0] / 180), (
float) (PI_D * norn[i].rotation[1] / 180), (
float) (PI_D * norn[i].rotation[2] / 180)));
1807 object.FrameObjectOnOff(
"win1", 0);
1808 object.FrameObjectOnOff(
"light1", 0);
1810 if (norn[i].shadow_name) {
1811 LoadFile(norn[i].shadow_name, (
void *) read_buffer, 0);
1812 object.shadow_frame = LoadMDSFile(read_buffer, &MapDataBuffer, 14, 0, 0);
1813 object.shadow_offset = -20.0f;
1818 {
"t0006.mds", 0, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f} },
1819 {
"t0001.mds", 0, {-33.25f, 0.03f, 13.0707f}, {0.0f, 0.0f, 0.0f} },
1820 {0, 0, {-23.25f, 0.03f, 13.0707f}, {0.0f, 0.0f, 0.0f} },
1821 {0, 0, {-3.25f, 0.03f, 13.0707f}, {0.0f, 0.0f, 0.0f} },
1822 {0, 0, {14.9146f, 0.03f, 13.0707f}, {0.0f, 0.0f, 0.0f} },
1823 {0, 0, {24.9146f, 0.03f, 13.0707f}, {0.0f, 0.0f, 0.0f} },
1824 {0, 0, {34.9146f, 0.03f, 13.0707f}, {0.0f, 0.0f, 0.0f} },
1825 {0, 0, {36.4833f, 0.03f, 17.4747f}, {0.0f, -90.0f, 0.0f} },
1826 {0, 0, {6.657f, 0.03f, 52.2721f}, {0.0f, -180.0f, 0.0f} },
1827 {0, 0, {-24.5027f, 0.03f, 52.2721f}, {0.0f, -180.0f, 0.0f} },
1828 {0, 0, {-33.5025f, 0.03f, 52.2721f}, {0.0f, -180.0f, 0.0f} },
1829 {0, 0, {-35.0227f, 0.03f, 37.4712f}, {0.0f, 90.0f, 0.0f} },
1830 {0, 0, {-35.0227f, 0.03f, 27.4712f}, {0.0f, 90.0f, 0.0f} },
1831 {
"t0301.mds", 0, {-35.6934f, 0.0f, 20.4342f}, {0.0f, 130.0f, 0.0f} },
1832 {0, 0, {-32.5089f, 0.0f, 46.7067f}, {0.0f, -74.3699f, 0.0f}},
1833 {0, 0, {-10.4729f, 0.0f, 13.2973f}, {0.0f, 79.7557f, 0.0f} },
1834 {0, 0, {15.1651f, 0.0f, 54.5186f}, {0.0f, 207.0f, 0.0f} },
1835 {0, 0, {35.441f, 0.0f, 28.889f}, {0.0f, 156.3029f, 0.0f}},
1836 {0, 0, {-6.7649f, 0.0f, 49.889f}, {0.0f, 17.6471f, 0.0f} },
1837 {0, 0, {-17.6795f, 0.0f, 54.369f}, {0.0f, 105.768f, 0.0f} },
1838 {0, 0, {34.153f, 0.0f, 39.193f}, {0.0f, 42.628f, 0.0f} },
1839 {0, 0, {28.736f, 0.0f, 55.7777f}, {0.0f, 121.467f, 0.0f} },
1840 {
"t0003.mds", 0, {-28.23f, 0.03f, 13.1174f}, {0.0f, 0.0f, 0.0f} },
1841 {0, 0, {19.937f, 0.03f, 13.1174f}, {0.0f, 0.0f, 0.0f} },
1842 {0, 0, {29.937f, 0.03f, 13.1174f}, {0.0f, 0.0f, 0.0f} },
1843 {0, 0, {-30.1013f, 0.03f, 52.3176f}, {0.0f, -180.0f, 0.0f} },
1844 {
"t0212.mds", 0, {0.0f, 0.02f, 30.0f}, {0.0f, 0.0f, 0.0f} },
1845 {
"t0208.mds", 0, {0.0f, 0.0f, 29.999f}, {0.0f, 0.0f, 0.0f} },
1846 {
"t0201.mds", 0, {9.8278f, 0.0f, 22.3789f}, {0.0f, -237.204f, 0.0f}},
1847 {0, 0, {-11.6807f, 0.0f, 36.7247f}, {0.0f, 281.7807f, 0.0f}},
1848 {
"t0303.mds", 0, {5.6932f, 0.0f, 21.7183f}, {0.0f, -40.0f, 0.0f} },
1849 {0, 0, {8.0326f, 0.0f, 25.0416f}, {0.0f, 57.0f, 0.0f} },
1850 {0, 0, {8.1469f, 0.0f, 18.4168f}, {0.0f, 77.0f, 0.0f} },
1851 {0, 0, {-11.9749f, 0.0f, 34.2407f}, {0.0f, 157.0f, 0.0f} },
1852 {0, 0, {-10.5469f, 0.0f, 36.1527f}, {0.0f, 217.0f, 0.0f} },
1853 {0, 0, {-18.8727f, 0.0f, 32.604f}, {0.0f, 40.0f, 0.0f} },
1854 {0, 0, {12.1088f, 0.0f, 43.2429f}, {0.0f, -55.0f, 0.0f} },
1855 {0, 0, {-25.5735f, 0.0f, 30.4597f}, {0.0f, -52.0f, 0.0f} },
1856 {0, 0, {-27.1088f, 0.0f, 29.2536f}, {0.0f, 22.0f, 0.0f} },
1857 {0, 0, {-28.1088f, 0.0f, 33.4081f}, {0.0f, 78.0f, 0.0f} },
1858 {
"t0202.mds", 0, {6.9352f, 0.0f, 22.8016f}, {0.0f, -66.4631f, 0.0f}},
1859 {0, 0, {-14.5591f, 0.0f, 35.5869f}, {0.0f, 112.4143f, 0.0f}},
1860 {
"t0203.mds", 0, {8.5959f, 0.0f, 23.4822f}, {0.0f, -49.7327f, 0.0f}},
1861 {0, 0, {-13.0716f, 0.0f, 36.4929f}, {0.0f, 129.2592f, 0.0f}},
1862 {0, 0, {-14.4103f, 0.0f, 37.4364f}, {0.0f, 112.5289f, 0.0f}},
1863 {
"t0204.mds", 0, {19.0043f, 0.0f, 20.5515f}, {0.0f, 18.2201f, 0.0f} },
1864 {0, 0, {23.1962f, 0.0f, 27.52f}, {0.0f, 71.7343f, 0.0f} },
1865 {0, 0, {19.0335f, 0.0f, 22.3668f}, {0.0f, 39.5341f, 0.0f} },
1866 {0, 0, {15.9599f, 0.0f, 27.5015f}, {0.0f, -11.6883f, 0.0f}},
1867 {0, 0, {-11.7777f, 0.0f, 28.0256f}, {0.0f, -16.9596f, 0.0f}},
1868 {0, 0, {-8.2194f, 0.0f, 22.6732f}, {0.0f, -23.3767f, 0.0f}},
1869 {0, 0, {-8.9274f, 0.0f, 17.7011f}, {0.0f, 28.9917f, 0.0f} },
1870 {0, 0, {-15.2388f, 0.0f, 22.5856f}, {0.0f, -15.5854f, 0.0f}},
1871 {0, 0, {-12.4433f, 0.0f, 23.0674f}, {0.0f, 15.2407f, 0.0f} },
1872 {0, 0, {-11.3862f, 0.0f, 21.697f}, {0.0f, -10.657f, 0.0f} },
1873 {0, 0, {11.704f, 0.0f, 38.1355f}, {0.0f, -45.7425f, 0.0f}},
1874 {0, 0, {14.5128f, 0.0f, 38.3406f}, {0.0f, -16.272f, 0.0f} },
1875 {0, 0, {10.6253f, 0.0f, 40.4613f}, {0.0f, 25.3247f, 0.0f} },
1876 {0, 0, {-21.0844f, 0.0f, 38.2517f}, {0.0f, 50.0f, 0.0f} },
1877 {
"t0205.mds", 0, {-11.6688f, 1.2789f, 36.7089f}, {0.0f, -61.7649f, 0.0f}},
1878 {
"t0206.mds", 0, {-4.3913f, 0.0f, 18.9443f}, {0.0f, 18.3347f, 0.0f} },
1879 {0, 0, {13.2586f, 0.0f, 33.1962f}, {0.0f, 110.58f, 0.0f} }
1882 for (
int j = 0; j < 62; j++) {
1883 if (ground[j].name) {
1884 ground_frame = LoadMDSFile((u_int *) GetPackFile(read_buffer, ground[j].name, 0), &CharaDataBuffer__2[6], 2, 0, 0);
1888 ground_frame->SetAttr(attr, 1, 64);
1889 SetFrameAttr(ground_frame, 1);
1893 TaimatsuFrame[8] = ground_frame;
1898 object.Initialize();
1899 object.SetFrame(ground_frame, 0);
1900 OP_NornMapObj2[j].
handle = 0;
1901 OP_NornMapObj2[j].
unk_34 = 0;
1903 object.SetPosition(
CVector3_f_(10.0f * ground[j].position[0], 10.0f * ground[j].position[1], 10.0f * ground[j].position[2]));
1904 object.SetRotation(
CVector3_f_((
float) (PI_D * ground[j].rotation[0] / 180), (
float) (PI_D * ground[j].rotation[1] / 180), (
float) (PI_D * ground[j].rotation[2] / 180)));
1907 object.FrameObjectOnOff(
"sun3", 0);
1921void OpC_MotionProcess() {
1922 for (
int i = 0; i < 23; i++) {
1925 if (Chara__3[i].motion_type.state.time > (
float) (Chara__3[i].motion_type.motion_info[CScript__2.
obj[i].
motion].end - 1)) {
1938 typedef float MotionLocal0, MotionLocal1, MotionLocal2, MotionLocal3, MotionLocal4, MotionLocal5, MotionLocal6, MotionLocal7, MotionLocal8, MotionLocal9, MotionLocal10, MotionLocal11, MotionLocal12, MotionLocal13, MotionLocal14, MotionLocal15, MotionLocal16, MotionLocal17, MotionLocal18, MotionLocal19, MotionLocal20, MotionLocal21, MotionLocal22, MotionLocal23;
1939 char *frame_names[21] = {
"",
"c08a",
"",
"",
"c08a",
"point",
"",
"",
"",
"p09a",
"",
"c01d",
"p03a",
1940 "p08a",
"p05b",
"p01a",
"p12a",
"p07a",
"p02a",
"p15a",
"p16a"};
1941 sceVu0FMATRIX matrix;
1943 for (
int i = 0; i < 23; i++) {
1945 CFrame *frame = Cam__2[SceneNp__2].
frame->SearchFrame(frame_names[i]);
1948 frame->GetLWMatrix(matrix);
1949 Chara__3[i].
SetRotation(0.0f, atan2f(matrix[2][0], matrix[2][2]), 0.0f);
1950 float x = matrix[3][0];
1951 float y = matrix[3][1];
1952 float z = matrix[3][2];
1959 CFrame *frame = Chara__3[1].
frame->SearchFrame(
"f0");
1962 sceVu0FMATRIX beam_matrix;
1964 frame->GetLWMatrix(beam_matrix);
1965 sceVu0Normalize(beam_matrix[0], beam_matrix[0]);
1966 sceVu0Normalize(beam_matrix[1], beam_matrix[1]);
1967 sceVu0Normalize(beam_matrix[2], beam_matrix[2]);
1970 Chara__3[3].
frame->SetTransMatrix(beam_matrix);
1982 Chara__3[11].
wind = (int) &Wind;
1985 static int camera = 0;
1995 for (
int i = 0; i < 10; i++) {
2017 ObjAnimePlay(&Fuusya[0]);
2019 if (CScript__2.
scene != OP_SCENE_NORUNE_BURNING) {
2020 ObjAnimePlay(&Fuusya[1]);
2022 ObjAnimePlay(&Fuusya[1]);
2027 if (CScript__2.
scene == OP_SCENE_NORUNE_BURNING) {
2028 for (
int i = 0; i < 5; i++) {
2029 ObjAnimePlay(&Taimatsu[i]);
2032 ObjAnimePlay(&Taimatsu[8]);
2034 for (
int i = 0; i < 9; i++) {
2035 ObjAnimePlay(&Taimatsu[i]);
2040 static float step = 0.5f;
2041 static float d = 2.0f;
2046 Fuusya[1].
step_z = -0.12f * 1.2f;
2048 Fuusya[1].
step_z = -0.12f;
2055 Fuusya[1].
step_z = -0.04f * 1.2f;
2057 Fuusya[1].
step_z = -0.04f;
2062 if (Cam__2[SceneNp__2].motion_type.state.time < 258.0f) {
2064 step = 0.025f * 1.2f;
2069 Fuusya[1].
step_z = -0.0048f * 1.2f;
2071 Fuusya[1].
step_z = -0.0048f;
2074 if (FireStep >= 1.0f) {
2080 if (Cam__2[SceneNp__2].motion_type.state.time < 270.0f) {
2083 OP_MainCamera.
GetRef(ref);
2089 ref[1] += (float) (rand() % 10) / d;
2090 OP_MainCamera.
SetRef(ref);
2099 Fuusya[1].
step_z = -10.0f * 1.2f;
2101 Fuusya[1].
step_z = -10.0f;
2106 Op_MotionInfo.
speed = step;
2112 if (CScript__2.
obj[4].
load != -1) {
2127static void LoadCharaMajin() {
2130 LoadFileBG(
"opdat/norn2/majinb.pak", (u_long128 *) read_buffer, 0);
2135 if (!ReadBGSync()) {
2143 Chara__3[4].
LoadPackData(read_buffer,
"04c08b.cfg", &CharaDataBuffer__2[6], 0);
2160void OpC_SoundProcess() {
2161 static float vol = 40.0f;
2164 if (!DanceBgmStart) {
2168 DanceBgmCnt = DanceBgmCnt + 1;
2172 if (DanceBgmCnt == 53) {
2174 if (DanceBgmCnt == 63) {
2185 CSnd.
SQ_Play(MIDI_PORT_AMBIENT, 0);
2193 sceVu0FVECTOR river1 = {50.0f, 100.0f, -100.0f, 0.0f};
2195 OpSetVolPanSE(river1, 50.0f, 500.0f, 15, 16, 21);
2197 sceVu0FVECTOR river2 = {0.0f, 0.0f, 0.0f, 0.0f};
2202 river2_near = 50.0f;
2203 OpSetVolPanSE(river2, river2_near, river2_far, 15, 16, 22);
2205 sceVu0FVECTOR river3 = {0.0f, 0.0f, 300.0f, 0.0f};
2209 river3_far = (float) (cnt - cnt + 300);
2210 river3_near = 100.0f;
2211 OpSetVolPanSE(river3, river3_near, river3_far, 15, 16, 24);
2215 {14, 40, 50, 893, 0, 90 },
2216 {14, 40, 55, 1100, 0, 127},
2217 {14, 40, 52, 1100, 1, 127},
2218 {14, 40, 52, 1292, 0, 127},
2219 {14, 40, 56, 1292, 1, 127},
2220 {14, 40, 57, 1292, 2, 127},
2221 {14, 40, 52, 1554, 0, 127},
2222 {14, 40, 57, 1554, 1, 127},
2223 {14, 40, 53, 1585, 0, 127},
2224 {14, 40, 55, 1585, 1, 127},
2225 {14, 40, 52, 1863, 0, 127},
2226 {14, 40, 57, 1863, 1, 127},
2227 {14, 40, 52, 2033, 0, 127},
2228 {14, 40, 57, 2033, 1, 127},
2229 {14, 40, 52, 2115, 0, 127},
2230 {14, 40, 57, 2115, 0, 127},
2231 {14, 40, 53, 2156, 0, 127},
2232 {14, 40, 55, 2156, 1, 127},
2233 {14, 40, 53, 2217, 0, 127},
2234 {14, 40, 57, 2217, 1, 127},
2235 {14, 40, 53, 2275, 0, 127},
2236 {14, 40, 55, 2275, 1, 127},
2237 {14, 40, 59, 2349, 0, 127},
2238 {14, 40, 71, 2441, 0, 80 },
2239 {14, 40, 61, 2445, 0, 127},
2240 {14, 40, 62, 2469, 0, 127},
2241 {14, 40, 64, 2503, 0, 127},
2242 {14, 40, 65, 2528, 0, 127},
2243 {14, 40, 62, 2528, 0, 127},
2244 {14, 40, 66, 2586, 0, 127},
2245 {14, 40, 61, 2588, 1, 127},
2246 {14, 40, 67, 2642, 0, 127},
2247 {14, 40, 61, 2686, 0, 127},
2248 {14, 40, 69, 2740, 0, 127},
2249 {14, 40, 62, 2756, 0, 127},
2250 {14, 40, 69, 2810, 0, 127},
2251 {14, 40, 72, 3006, 3, 100},
2252 {14, 1, 67, 3006, 4, 127},
2253 {14, 40, 67, 3307, 0, 127},
2254 {14, 40, 74, 3339, 0, 127},
2255 {14, 40, 74, 3572, 0, 127},
2256 {14, 40, 75, 4255, 0, 127},
2257 {14, 40, 77, 4305, 0, 127}
2264 SndCnt = SndCnt + 1;
2268 for (
int i = 0; i < 43; i++) {
2271 if (SndCnt == SndInfo[i].count * 5 / 6) {
2273 if (SndCnt == SndInfo[i].count) {
2275 OpPlayVolSE(SndInfo[i].group, SndInfo[i].no, SndInfo[i].voice, 1.0f);
2279 int footstep_ground = 40;
2281 if (CScript__2.
camera_start == 58 && Cam__2[SceneNp__2].motion_type.state.time < 80.0f) {
2282 footstep_ground = 44;
2285 if (CScript__2.
camera_start == 67 && Cam__2[SceneNp__2].motion_type.state.time > 45.0f) {
2286 footstep_ground = 44;
2289 if (CScript__2.
camera_start == 67 && Cam__2[SceneNp__2].motion_type.state.time > 70.0f) {
2290 footstep_ground = 40;
2294 static int wait = 0;
2295 sceVu0FVECTOR position;
2298 sceVu0CopyVector(position, Chara__3[11].pos);
2299 motion_frame = (int) Chara__3[11].motion_type.state.time;
2303 if (motion_frame > 73.0f && motion_frame < 76.0f) {
2305 if (motion_frame > 73.0f && motion_frame < 75.0f) {
2307 if (footstep_ground == 40) {
2308 OpPlayVolPanSE(position, 10.0f, 400.0f, MIDI_PORT_SE_DEFAULT, 21, 20);
2310 OpPlayVolPanSE(position, 10.0f, 400.0f, MIDI_PORT_SE_DEFAULT, 21, 32);
2315 }
else if (motion_frame > 83.0f && motion_frame < 86.0f) {
2317 }
else if (motion_frame > 83.0f && motion_frame < 85.0f) {
2319 if (footstep_ground == 40) {
2320 OpPlayVolPanSE(position, 10.0f, 400.0f, MIDI_PORT_SE_DEFAULT, 21, 21);
2322 OpPlayVolPanSE(position, 10.0f, (
float) (footstep_ground - footstep_ground + 400), MIDI_PORT_SE_DEFAULT, 21, 33);
2333 static int wait = 0;
2334 sceVu0FVECTOR position;
2337 sceVu0CopyVector(position, Chara__3[11].pos);
2338 motion_frame = (int) Chara__3[11].motion_type.state.time;
2342 if (motion_frame > 258.0f && motion_frame < 261) {
2344 if (motion_frame > 258.0f && motion_frame < 260.0f) {
2346 OpPlayVolPanSE(position, 10.0f, 400.0f, MIDI_PORT_SE_DEFAULT, 21, 20);
2349 }
else if (motion_frame > 268.0f && motion_frame < 271) {
2351 }
else if (motion_frame > 268.0f && motion_frame < 270.0f) {
2353 OpPlayVolPanSE(position, 10.0f, 400.0f, MIDI_PORT_SE_DEFAULT, 21, 21);
2361 if (CScript__2.
obj[13].
disp) {
2362 static int wait = 0;
2363 sceVu0FVECTOR position;
2366 sceVu0CopyVector(position, Chara__3[13].pos);
2367 motion_frame = (int) Chara__3[13].motion_type.state.time;
2371 if (motion_frame > 123.0f && motion_frame < 126.0f) {
2373 if (motion_frame > 123.0f && motion_frame < 125.0f) {
2375 OpPlayVolPanSE(position, 10.0f, (
float) (wait - wait + 300), MIDI_PORT_SE_DEFAULT, 21, 20);
2378 }
else if (motion_frame > 133.0f && motion_frame < 136.0f) {
2380 }
else if (motion_frame > 133.0f && motion_frame < 135.0f) {
2382 OpPlayVolPanSE(position, 10.0f, (
float) (wait - wait + 300), MIDI_PORT_SE_DEFAULT, 21, 21);
2390 if (CScript__2.
scene == OP_SCENE_NORUNE_RUINED && CScript__2.
obj[12].
disp) {
2391 static int wait = 0;
2392 sceVu0FVECTOR position;
2395 sceVu0CopyVector(position, Chara__3[12].pos);
2396 motion_frame = (int) Chara__3[12].motion_type.state.time;
2400 if (motion_frame > 33.0f && motion_frame < 36.0f) {
2402 if (motion_frame > 33.0f && motion_frame < 35.0f) {
2404 OpPlayVolPanSE(position, 10.0f, (
float) (wait - wait + 300), MIDI_PORT_SE_DEFAULT, 21, 20);
2407 }
else if (motion_frame > 43.0f && motion_frame < 46.0f) {
2409 }
else if (motion_frame > 43.0f && motion_frame < 45.0f) {
2411 OpPlayVolPanSE(position, 10.0f, 300.0f, MIDI_PORT_SE_DEFAULT, 21, 21);
2426void OpC_DrawProcess() {
2427 sceVu0FMATRIX light_save;
2428 sceVu0FVECTOR ambient_save;
2431 sceVu0CopyMatrix(light_save, light);
2432 sceVu0CopyVector(ambient_save, ambientlight);
2433 far_fog = op_fogRate[1];
2448 typedef float RenderPhase0, RenderPhase1, RenderPhase2;
2449 MGSetRenderInfo(mgRenderInfo.
scale[0], 6.0f, 0xffff);
2457 MGSetRenderInfo(mgRenderInfo.
scale[0], 4.0f, 0xffff);
2461 typedef float DefaultRenderPhase;
2462 MGSetRenderInfo(mgRenderInfo.
scale[0], 8.0f, 0xffff);
2466 MGSetFogParm(op_fogRate[0], far_fog, op_fogColor[0], op_fogColor[1], op_fogColor[2], op_fogRate[2], op_fogRate[3]);
2468 switch (CScript__2.
scene) {
2469 case OP_SCENE_MAJIN:
2470 TexManager.ReloadTexture(Vif1Packet, 10);
2472 for (
int i = 0; i < 3; i++) {
2482 case OP_SCENE_NORUNE_BURNING:
2483 TexManager.ReloadTexture(Vif1Packet, 10);
2487 for (
int i = 0; i < 74; i++) {
2488 if (i > 0 && (i <= 17 || i >= 68) && i <= 72) {
2493 sceVu0FVECTOR position;
2495 sceVu0CopyVector(position,
object.pos);
2496 LightSet(position[0], position[1], position[2], 0);
2500 TexManager.ReloadTexture(Vif1Packet, 13);
2502 for (
int i = 0; i < 74; i++) {
2503 if ((i > 0 && i <= 17) || (i >= 68 && i < 73)) {
2505 sceVu0FVECTOR position;
2507 sceVu0CopyVector(position,
object.pos);
2508 LightSet(position[0], position[1], position[2], 0);
2513 for (
int i = 0; i < 74; i++) {
2515 sceVu0FVECTOR position;
2517 sceVu0CopyVector(position,
object.pos);
2518 LightSet(position[0], position[1], position[2], 0);
2523 if (CScript__2.
camera_start == 100 && Cam__2[SceneNp__2].motion_type.state.time > 262.0f) {
2525 sceVu0FVECTOR position;
2527 sceVu0CopyVector(position,
object.pos);
2528 LightSet(position[0], position[1], position[2], 0);
2532 sceVu0FVECTOR position;
2534 sceVu0CopyVector(position,
object.pos);
2535 LightSet(position[0], position[1], position[2], 0);
2539 TexManager.ReloadTexture(Vif1Packet, 11);
2541 for (
int i = 0; i < 26; i++) {
2543 sceVu0FVECTOR position;
2545 sceVu0CopyVector(position,
object.pos);
2546 LightSet(position[0], position[1], position[2], 0);
2550 TexManager.ReloadTexture(Vif1Packet, 12);
2552 for (
int i = 26; i < 62; i++) {
2554 sceVu0FVECTOR position;
2556 sceVu0CopyVector(position,
object.pos);
2557 LightSet(position[0], position[1], position[2], 0);
2564 TexManager.ReloadTexture(Vif1Packet, 10);
2568 for (
int i = 0; i < 75; i++) {
2569 if (i > 0 && (i <= 15 || i >= 66) && i <= 73) {
2574 sceVu0FVECTOR position;
2576 sceVu0CopyVector(position,
object.pos);
2577 LightSet(position[0], position[1], position[2], 0);
2581 TexManager.ReloadTexture(Vif1Packet, 13);
2583 for (
int i = 0; i < 75; i++) {
2584 if ((i > 0 && i <= 15) || (i >= 66 && i < 74)) {
2586 sceVu0FVECTOR position;
2588 sceVu0CopyVector(position,
object.pos);
2589 LightSet(position[0], position[1], position[2], 0);
2594 for (
int i = 0; i < 75; i++) {
2596 sceVu0FVECTOR position;
2598 sceVu0CopyVector(position,
object.pos);
2599 LightSet(position[0], position[1], position[2], 0);
2604 TexManager.ReloadTexture(Vif1Packet, 11);
2606 for (
int i = 0; i < 41; i++) {
2608 sceVu0FVECTOR position;
2610 sceVu0CopyVector(position,
object.pos);
2611 LightSet(position[0], position[1], position[2], 0);
2615 TexManager.ReloadTexture(Vif1Packet, 12);
2617 for (
int i = 41; i < 87; i++) {
2619 sceVu0FVECTOR position;
2621 sceVu0CopyVector(position,
object.pos);
2622 LightSet(position[0], position[1], position[2], 0);
2630 static int bright = 255;
2632 if (CScript__2.
sprite == 1) {
2639 sceVu0FMATRIX color;
2641 sceVu0CopyMatrix(color, lightcolor);
2645 if (color[0][0] < (
float) bright) {
2646 color[0][0] = (float) bright;
2650 if (color[0][1] < (
float) bright) {
2651 color[0][1] = (float) bright;
2655 if (color[0][2] < (
float) bright) {
2656 color[0][2] = (float) bright;
2660 bright = bright - 4;
2661 MGSetPLight(light, color);
2670 TexManager.ReloadTexture(Vif1Packet, 22);
2680 float dof[2] = {200.0f, 400.0f};
2682 DepthOfField(dof, 2, 32, 0);
2689 float dof[2] = {200.0f, 400.0f};
2691 DepthOfField(dof, 2, 64, 0);
2695 float dof[2] = {200.0f, 400.0f};
2697 DepthOfField(dof, 2, 48, 0);
2704 MGGetFBuffBackTex(&back);
2708 texture.
tex0 = *(u_long *) &back;
2709 set2DSprite(Vif1Packet, &texture,
CRect<int>(0, 0, 640, SCREEN_HEIGHT),
CRect<int>(0, 0, 640, SCREEN_HALF_HEIGHT), 128, 128, 128, 105);
2712 for (
int i = 0; i < 23; i++) {
2713 if (KageCheck(i) && CScript__2.
obj[i].
disp) {
2714 TexManager.ReloadTexture(Vif1Packet, 23);
2715 MGBeginDrawShadow(*(
sceGsTex0 *) &TexManager.GetTexture(
"shadow_buff", -1)->
tex0);
2721 if (CScript__2.
scene != OP_SCENE_MAJIN) {
2722 sceVu0FVECTOR position;
2724 sceVu0CopyVector(position, Chara__3[i].pos);
2725 LightSet(position[0], position[1], position[2], 1);
2729 MGEndDrawShadow(52);
2733 for (
int i = 0; i < 23; i++) {
2735 TexManager.ReloadTexture(Vif1Packet, CharaTex__2[i]);
2742 if (CScript__2.
scene != OP_SCENE_MAJIN) {
2743 sceVu0FVECTOR position;
2745 sceVu0CopyVector(position, Chara__3[i].pos);
2746 LightSet(position[0], position[1], position[2], 0);
2754 if (CScript__2.
scene == OP_SCENE_DANCE) {
2760 TexManager.ReloadTexture(Vif1Packet, 10);
2765 TexManager.ReloadTexture(Vif1Packet, 23);
2766 MGBeginDrawShadow(*(
sceGsTex0 *) &TexManager.GetTexture(
"shadow_buff", -1)->
tex0);
2768 if (CScript__2.
scene != OP_SCENE_NORUNE_BURNING) {
2769 for (
int i = 0; i < 75; i++) {
2771 sceVu0FVECTOR position;
2773 sceVu0CopyVector(position,
object.pos);
2774 LightSet(position[0], position[1], position[2], 0);
2775 object.DrawShadow(0);
2778 for (
int i = 0; i < 76; i++) {
2780 sceVu0FVECTOR position;
2782 sceVu0CopyVector(position,
object.pos);
2783 LightSet(position[0], position[1], position[2], 0);
2784 object.DrawShadow(0);
2788 MGEndDrawShadow(52);
2791 if (CScript__2.
scene != OP_SCENE_MAJIN && OP_FireList > 0) {
2792 TexManager.ReloadTexture(GetVif1Packet(), 0);
2794 if (!Pause && FireStep >= 1.0f) {
2799 OP_CharaFrame__2 = Cam__2[SceneNp__2].
frame;
2803 sceVu0CopyVector(eye, OP_CharaFrame__2->
position);
2805 if (CScript__2.
scene != OP_SCENE_NORUNE_BURNING) {
2806 for (
int i = 0; i < 22; i++) {
2807 float z = OP_FirePosition[i][2];
2808 float y = OP_FirePosition[i][1];
2809 float x = OP_FirePosition[i][0];
2816 int fire_flag = OP_FireFlg[i];
2818 if (fire_flag == 1) {
2819 CFire.DrawFire(1, 1, &OP_MainCamera, eye, OP_FireScale[i], 3, (
float) (15.0 * OP_FireScale[i]));
2821 CFire.DrawFire(1, 1, &OP_MainCamera, eye, OP_FireScale[i], 2, 15.0f);
2825 for (
int i = 0; i < OP_FireList; i++) {
2827 OP_FirePosition[i][1] = -100.0f;
2830 float z = OP_FirePosition[i][2];
2831 float y = OP_FirePosition[i][1];
2832 float x = OP_FirePosition[i][0];
2839 int fire_flag = OP_FireFlg[i];
2841 if (fire_flag == 1) {
2842 CFire.DrawFire(1, 1, &OP_MainCamera, eye, OP_FireScale[i], 3, 15.0f);
2844 CFire.DrawFire(1, 1, &OP_MainCamera, eye, OP_FireScale[i], 2, 15.0f);
2850 if (CScript__2.
scene >= OP_SCENE_MAJIN) {
2851 if (CScript__2.
camera_start == 77 && Cam__2[SceneNp__2].motion_type.state.time > 37.5f && !MajinBgmStart) {
2855 CSnd.
Fade(MIDI_PORT_AMBIENT, -1.0f, 0);
2861 if (CScript__2.
scene == OP_SCENE_NORUNE_BURNING) {
2863 TexManager.ReloadTexture(Vif1Packet, 18);
2865 TexManager.ReloadTexture(Vif1Packet, 17);
2870 if (CScript__2.
scene >= OP_SCENE_NORUNE_RUINED) {
2872 int bomb = CScript__2.
bom_no;
2873 float size = CScript__2.
bom_size[bomb];
2875 for (
int i = 0; i < 8; i++) {
2876 sceVu0CopyVector(CBomb[bomb].positions[i], CScript__2.
bom_pos[bomb]);
2877 CBomb[bomb].
phases[i] = BOMB_PHASE_BURST;
2878 CBomb[bomb].
counters[i] = -(i * 3);
2879 CBomb[bomb].
alphas[i] = 128.0f;
2880 CBomb[bomb].
sizes[i] = size;
2881 CBomb[bomb].
active[i] = 1;
2884 CBomb[bomb].
phases[0] = BOMB_PHASE_LINGER;
2885 CBomb[bomb].
phases[1] = BOMB_PHASE_BLOOM;
2886 CBomb[bomb].
alphas[5] = 32.0f;
2887 CBomb[bomb].
alphas[6] = 32.0f;
2888 CBomb[bomb].
alphas[7] = 32.0f;
2893 TexManager.ReloadTexture(Vif1Packet, 18);
2895 TexManager.ReloadTexture(Vif1Packet, 17);
2906 for (
int i = 0; i < 3; i++) {
2911 CBomb[i].
Draw(&OP_MainCamera, dust);
2915 sceVu0CopyMatrix(light, light_save);
2916 sceVu0CopyVector(ambientlight, ambient_save);
2917 MGSetPLight(light, lightcolor);
2918 MGSetAmbient(ambientlight);
2931static void DrawDancer() {
2932 sceVu0FMATRIX matrix;
2933 register float zero = 0.0f;
2935 if (CScript__2.
obj[19].
disp) {
2936 TexManager.ReloadTexture(Vif1Packet, CharaTex__2[19]);
2937 CharaF[0] = Chara__3[19].
frame;
2939 CFrame *frame = Cam__2[SceneNp__2].
frame->SearchFrame(
"p15a1");
2942 frame->GetLWMatrix(matrix);
2944 CharaF[0]->SetRotation((
float) zero, atan2f(matrix[2][0], matrix[2][2]), zero);
2946 CharaF[0]->SetRotation(0.0f, atan2f(matrix[2][0], matrix[2][2]), (
float) zero);
2948 float x = matrix[3][0];
2949 float y = matrix[3][1];
2950 float z = matrix[3][2];
2951 CharaF[0]->SetPosition(x, y, z);
2952 LightSet(matrix[3][0], matrix[3][1], matrix[3][2], 0);
2955 frame = CharaF[0]->SearchFrame(
"r_foot");
2958 frame->GetLWMatrix(matrix);
2959 DrawShadow(10, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
2962 frame = CharaF[0]->SearchFrame(
"l_foot");
2965 frame->GetLWMatrix(matrix);
2966 DrawShadow(11, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
2970 TexManager.ReloadTexture(Vif1Packet, CharaTex__2[19]);
2971 CharaF[1] = Chara__3[19].
frame;
2973 CFrame *second_frame = Cam__2[SceneNp__2].
frame->SearchFrame(
"p15a2");
2976 second_frame->GetLWMatrix(matrix);
2978 CharaF[1]->SetRotation(0.0f, atan2f(matrix[2][0], matrix[2][2]), zero);
2980 CharaF[1]->SetRotation((
float) zero, atan2f(matrix[2][0], matrix[2][2]), zero);
2982 float x = matrix[3][0];
2983 float y = matrix[3][1];
2984 float z = matrix[3][2];
2985 CharaF[1]->SetPosition(x, y, z);
2986 LightSet(matrix[3][0], matrix[3][1], matrix[3][2], 0);
2989 frame = CharaF[1]->SearchFrame(
"r_foot");
2992 frame->GetLWMatrix(matrix);
2993 DrawShadow(12, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
2996 frame = CharaF[1]->SearchFrame(
"l_foot");
2999 frame->GetLWMatrix(matrix);
3000 DrawShadow(13, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3007 if (CScript__2.
obj[20].
disp) {
3008 TexManager.ReloadTexture(Vif1Packet, CharaTex__2[20]);
3009 CharaF[2] = Chara__3[20].
frame;
3011 CFrame *frame = Cam__2[SceneNp__2].
frame->SearchFrame(
"p16a1");
3014 sceVu0FMATRIX matrix2;
3016 frame->GetLWMatrix(matrix2);
3018 CharaF[2]->SetRotation(0.0f, atan2f(matrix2[2][0], matrix2[2][2]), zero);
3020 CharaF[2]->SetRotation(0.0f, atan2f(matrix2[2][0], matrix2[2][2]), (
float) zero);
3022 float x = matrix2[3][0];
3023 float y = matrix2[3][1];
3024 float z = matrix2[3][2];
3025 CharaF[2]->SetPosition(x, y, z);
3026 LightSet(matrix2[3][0], matrix2[3][1], matrix2[3][2], 0);
3029 frame = CharaF[2]->SearchFrame(
"r_foot");
3032 frame->GetLWMatrix(matrix2);
3033 DrawShadow(14, (
float) matrix2[3][0], (
float) matrix2[3][1], (
float) matrix2[3][2]);
3036 frame = CharaF[2]->SearchFrame(
"l_foot");
3039 frame->GetLWMatrix(matrix2);
3040 DrawShadow(15, (
float) matrix2[3][0], (
float) matrix2[3][1], (
float) matrix2[3][2]);
3056static void InchikiShadow() {
3057 sceVu0FMATRIX matrix;
3060 if (CScript__2.
obj[14].
disp) {
3061 frame = Chara__3[14].
frame->SearchFrame(
"r_foot");
3064 frame->GetLWMatrix(matrix);
3065 DrawShadow(0, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3068 frame = Chara__3[14].
frame->SearchFrame(
"l_foot");
3071 frame->GetLWMatrix(matrix);
3072 DrawShadow(1, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3076 if (CScript__2.
obj[15].
disp) {
3077 frame = Chara__3[15].
frame->SearchFrame(
"r_foot");
3080 frame->GetLWMatrix(matrix);
3081 DrawShadow(2, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3084 frame = Chara__3[15].
frame->SearchFrame(
"l_foot");
3087 frame->GetLWMatrix(matrix);
3088 DrawShadow(3, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3092 if (CScript__2.
obj[16].
disp) {
3093 frame = Chara__3[16].
frame->SearchFrame(
"r_foot");
3096 frame->GetLWMatrix(matrix);
3097 DrawShadow(4, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3100 frame = Chara__3[16].
frame->SearchFrame(
"l_foot");
3103 frame->GetLWMatrix(matrix);
3104 DrawShadow(5, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3108 if (CScript__2.
obj[17].
disp) {
3109 frame = Chara__3[17].
frame->SearchFrame(
"eff19");
3112 frame->GetLWMatrix(matrix);
3113 DrawShadow(4, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3116 frame = Chara__3[17].
frame->SearchFrame(
"eff7");
3119 frame->GetLWMatrix(matrix);
3120 DrawShadow(5, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3124 if (CScript__2.
obj[18].
disp) {
3125 frame = Chara__3[18].
frame->SearchFrame(
"r_foot");
3128 frame->GetLWMatrix(matrix);
3129 DrawShadow(4, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3132 frame = Chara__3[18].
frame->SearchFrame(
"l_foot");
3135 frame->GetLWMatrix(matrix);
3136 DrawShadow(5, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3140 if (CScript__2.
obj[19].
disp) {
3141 frame = Chara__3[19].
frame->SearchFrame(
"r_foot");
3144 frame->GetLWMatrix(matrix);
3145 DrawShadow(6, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3148 frame = Chara__3[19].
frame->SearchFrame(
"l_foot");
3151 frame->GetLWMatrix(matrix);
3152 DrawShadow(7, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3156 if (CScript__2.
obj[20].
disp) {
3157 frame = Chara__3[20].
frame->SearchFrame(
"r_foot");
3160 frame->GetLWMatrix(matrix);
3161 DrawShadow(6, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3164 frame = Chara__3[20].
frame->SearchFrame(
"l_foot");
3167 frame->GetLWMatrix(matrix);
3168 DrawShadow(7, (
float) matrix[3][0], (
float) matrix[3][1], (
float) matrix[3][2]);
3183static void DrawShadow(
int shadow_no,
float x,
float y,
float z) {
3184 sceVu0FVECTOR ambient = {0.0f, 0.0f, 0.0f, 54.0f};
3187 TexManager.ReloadTexture(Vif1Packet, 18);
3189 TexManager.ReloadTexture(Vif1Packet, 17);
3191 ambient[3] = ambient[3] - 10.0f * y;
3193 if (ambient[3] > 0.0f) {
3194 MGSetAmbient(ambient);
3196 float heading = atan2f(x, z - 300.0f);
3198 Shadow[shadow_no]->SetPosition(x, 0.05f, z);
3199 Shadow[shadow_no]->SetRotation(1.5533431f, heading, 0.0f);
3200 MGDraw(Shadow[shadow_no]);
3201 MGSetAmbient(ambientlight);
3216static void MajinBeemProcess() {
3217 char *frame_names[10] = {
"yubi",
"heso",
"l_asi",
"r_asi",
"kuti",
"toutyou",
"yubi",
"yubi",
"yubi",
3224 if (CScript__2.
scene == OP_SCENE_MAJIN) {
3230 if (CScript__2.
scene == OP_SCENE_MAJIN) {
3237 int beam = CScript__2.
beem_no;
3240 static sceVu0FVECTOR pos = {0.0f, 0.0f, 0.0f, 0.0f};
3241 static sceVu0FVECTOR pos2 = {0.0f, 0.0f, 0.0f, 0.0f};
3242 sceVu0FMATRIX matrix;
3244 CFrame *frame = Chara__3[1].
frame->SearchFrame(frame_names[MBeemCnt]);
3246 MBeemCnt = MBeemCnt + 1;
3249 frame->GetLWMatrix(matrix);
3250 pos[0] = matrix[3][0];
3251 pos[1] = matrix[3][1];
3252 pos[2] = matrix[3][2];
3255 CFrame *end = Cam__2[SceneNp__2].
frame->SearchFrame(
"end");
3258 end->GetLWMatrix(matrix);
3259 pos2[0] = matrix[3][0];
3260 pos2[1] = matrix[3][1];
3261 pos2[2] = matrix[3][2];
3264 if (MBeemCnt - 1 == 2 || MBeemCnt - 1 == 3) {
3265 sceVu0CopyVector(CBeem[beam].target, pos2);
3266 CBeem[beam].
speed = speed;
3268 for (
int i = 0; i < 60; i++) {
3269 sceVu0CopyVector(CBeem[beam].positions[i], pos);
3270 CBeem[beam].
state = MAJIN_BEEM_AIM;
3272 CBeem[beam].
alphas[i] = 128.0f - (float) (2 * i);
3273 CBeem[beam].
sizes[i] = 20.0f - (float) (i / 3);
3275 if (CBeem[beam].sizes[i] < 8.0f) {
3276 CBeem[beam].
sizes[i] = 8.0f;
3279 CBeem[beam].
active =
true;
3282 for (
int i = 0; i < 10; i++) {
3283 CBeem[beam].
sizes[i] = 20.0f;
3286 CBeem[beam].
alphas[59] = 128.0f;
3287 CBeem[beam].
sizes[59] = 48.0f;
3289 sceVu0CopyVector(CBeem[beam].target, pos2);
3290 CBeem[beam].
speed = speed;
3292 for (
int i = 0; i < 60; i++) {
3293 sceVu0CopyVector(CBeem[beam].positions[i], pos);
3294 CBeem[beam].
state = MAJIN_BEEM_AIM;
3296 CBeem[beam].
alphas[i] = 128.0f - (float) (2 * i);
3297 CBeem[beam].
sizes[i] = 20.0f - (float) (i / 3);
3299 if (CBeem[beam].sizes[i] < 8.0f) {
3300 CBeem[beam].
sizes[i] = 8.0f;
3303 CBeem[beam].
active =
true;
3306 for (
int i = 0; i < 10; i++) {
3307 CBeem[beam].
sizes[i] = 20.0f;
3310 CBeem[beam].
alphas[59] = 128.0f;
3311 CBeem[beam].
sizes[59] = 32.0f;
3314 sceVu0CopyVector(CBeem[beam].target, CScript__2.
beem_to[beam]);
3315 CBeem[beam].
speed = speed;
3317 for (
int i = 0; i < 60; i++) {
3318 sceVu0CopyVector(CBeem[beam].positions[i], CScript__2.
beem_from[beam]);
3319 CBeem[beam].
state = MAJIN_BEEM_AIM;
3321 CBeem[beam].
alphas[i] = 128.0f - (float) (2 * i);
3322 CBeem[beam].
sizes[i] = 20.0f - (float) (i / 3);
3324 if (CBeem[beam].sizes[i] < 8.0f) {
3325 CBeem[beam].
sizes[i] = 8.0f;
3328 CBeem[beam].
active =
true;
3331 for (
int i = 0; i < 10; i++) {
3332 CBeem[beam].
sizes[i] = 20.0f;
3335 CBeem[beam].
alphas[59] = 128.0f;
3336 CBeem[beam].
sizes[59] = 0.0f;
3343 TexManager.ReloadTexture(Vif1Packet, 18);
3345 TexManager.ReloadTexture(Vif1Packet, 17);
3348 for (
int i = 0; i < 3; i++) {
3353 CBeem[i].
Draw(&OP_MainCamera);
3356 if (CScript__2.
obj[1].
disp && CScript__2.
scene == OP_SCENE_MAJIN) {
3360 if (MBeemCnt == 0) {
3363 part = MBeemCnt - 1;
3366 CFrame *frame = Chara__3[1].
frame->SearchFrame(frame_names[part]);
3369 sceVu0FMATRIX matrix;
3371 frame->GetLWMatrix(matrix);
3372 head[0] = matrix[3][0];
3373 head[1] = matrix[3][1];
3374 head[2] = matrix[3][2];
3375 OP_CharaFrame__2 = Cam__2[SceneNp__2].
frame;
3379 sceVu0CopyVector(eye, OP_CharaFrame__2->
position);
3380 CBeem[CScript__2.
beem_no].
Draw2(&OP_MainCamera, head, eye);
3396static void SmokeProcess() {
3406 sceVu0FVECTOR position = {400.0f, 10.0f, -450.0f, 1.0f};
3410 sceVu0CopyVector(param.
position, position);
3413 param.
wobble_rate = (float) PI_D / (20.0f + 10 * rand() / 2147483648.0f);
3417 param.
rise_speed = 1.5f + 0.2f * rand() / 2147483648.0f;
3421 param.
texture = TexManager.GetTexture(
"gray smoke", -1);
3423 switch (rand() % 4) {
3444 Smoke.EnterEffect(¶m);
3448 position[2] = 300.0f;
3452 param2.Initialize();
3453 sceVu0CopyVector(param2.
position, position);
3456 param2.
wobble_rate = (float) PI_D / (20.0f + 10 * rand() / 2147483648.0f);
3460 param2.
rise_speed = 1.5f + 0.2f * rand() / 2147483648.0f;
3464 param2.
texture = TexManager.GetTexture(
"gray smoke", -1);
3466 switch (rand() % 4) {
3487 Smoke.EnterEffect(¶m2);
3504static void WaterProcess() {
3510 MGGetFBuffTex(&frame_tex);
3512 CRect<int> rect(0, 0, 640, SCREEN_HALF_HEIGHT);
3515 MGMoveImage(&frame_tex, rect, &surface, 0, 0, 0);
3519 OP_MainCamera.
GetRef(ref);
3521 Water.
frame.SetPosition(ref);
3527 Water.Shake((
int) (32.0f * rand() / 2147483648.0f), (
int) (32.0f * rand() / 2147483648.0f), -0.5f);
3529 Water.DrawVu1(&mgRenderInfo, GetVif1Packet(), 0);
3530 MGSetGsZBUF(&mgZBuffer);
3543static int KageCheck(
int actor) {
3572 if (CScript__2.
scene < OP_SCENE_NORUNE_BURNING && actor == 18) {
3602static void LightSet(
float x,
float y,
float z,
int actor) {
3613 dir[2] = 299.99f - z;
3614 sceVu0Normalize(dir, dir);
3615 light[0][0] = dir[0];
3616 light[1][0] = dir[1];
3617 light[2][0] = dir[2];
3620 dir[2] = z - 299.99f;
3621 sceVu0Normalize(dir, dir);
3622 light[0][1] = dir[0];
3623 light[1][1] = dir[1];
3624 light[2][1] = dir[2];
3626 sceVu0FMATRIX color;
3628 sceVu0CopyMatrix(color, lightcolor);
3642 int falloff = (int) DistVector(from, to) / 20;
3648 color[0][0] = color[0][0] - (float) falloff;
3649 color[0][0] = color[0][0] + (float) (rand() % 20 - 10);
3650 MGSetPLight(light, color);
3652 sceVu0FVECTOR ambient;
3654 sceVu0CopyVector(ambient, ambientlight);
3656 if (CScript__2.
scene != OP_SCENE_NORUNE_BURNING) {
3657 falloff = (int) DistVector(from, to) / 10;
3663 ambient[0] += 20.0f;
3664 ambient[0] = ambient[0] - (float) falloff;
3666 ambient[0] += 25.0f;
3667 ambient[1] += 10.0f;
3670 MGSetAmbient(ambient);
3673static int setTexScrollCnt;
3674static float setTexScrollCntf;
3675static int setTexAnimCnt;
3676static float setTexAnimCntf;
3687static void setTexScroll() {
3688 if (setTexScrollCntf >= 126.0f) {
3689 setTexScrollCntf = 0.0f;
3691 setTexScrollCntf += 0.5f;
3694 setTexScrollCnt = (int) setTexScrollCntf;
3696 CTexture *plate = TexManager.GetTexture(
"e01b20", -1);
3697 CTexture *strip = TexManager.GetTexture(
"e01b21", -1);
3699 if (plate == 0 || strip == 0) {
3703 int dbp = plate->
tex0 & 0x3fff;
3704 int sbp = strip->
tex0 & 0x3fff;
3705 int dbw = (plate->
tex0 >> 14) & 0x3f;
3706 int sbw = (strip->
tex0 >> 14) & 0x3f;
3712 dst_tex.PSM = SCE_GS_PSMT8;
3715 src_tex.PSM = SCE_GS_PSMT8;
3717 if (setTexScrollCnt != 128) {
3718 MoveImageTest(Vif1Packet, sbp, sbw, SCE_GS_PSMT8,
CRect<int>(setTexScrollCnt, 0, 128 - setTexScrollCnt, 128), dbp, dbw, SCE_GS_PSMT8, 0, 0, 0);
3721 if (setTexScrollCnt != 0) {
3722 MoveImageTest(Vif1Packet, sbp, sbw, SCE_GS_PSMT8,
CRect<int>(0, 0, setTexScrollCnt, 128), dbp, dbw, SCE_GS_PSMT8, 128 - setTexScrollCnt, 0, 0);
3736static void setTexAnim() {
3737 sceVif1PkCnt(Vif1Packet, 0);
3738 sceVif1PkOpenDirectCode(Vif1Packet, 0);
3739 sceVif1PkOpenGifTag(Vif1Packet, *(u_long128 *) &GiftagAD);
3740 sceVif1PkAddGsAD(Vif1Packet, SCE_GS_TEXFLUSH, 0);
3741 sceVif1PkCloseGifTag(Vif1Packet);
3742 sceVif1PkCloseDirectCode(Vif1Packet);
3744 if (setTexAnimCntf >= 7.0f) {
3745 setTexAnimCntf = 0.0f;
3747 setTexAnimCntf += 0.2f;
3750 setTexAnimCnt = (int) setTexAnimCntf;
3752 CTexture *strip = TexManager.GetTexture(
"e01b23", -1);
3753 CTexture *plate = TexManager.GetTexture(
"e01b22", -1);
3755 if (strip == 0 || plate == 0) {
3760 sceVif1PkCnt(Vif1Packet, 0);
3761 sceVif1PkOpenDirectCode(Vif1Packet, 0);
3762 sceVif1PkOpenGifTag(Vif1Packet, *(u_long128 *) &GiftagAD);
3763 sceVif1PkAddGsAD(Vif1Packet, SCE_GS_TEXFLUSH, 0);
3764 sceVif1PkCloseGifTag(Vif1Packet);
3765 sceVif1PkCloseDirectCode(Vif1Packet);
void Draw(CCamera *camera, int dust_only)
void SetRef(CFrame *parent, float x, float y, float z)
virtual void LoadPackData(unsigned int *pack, char *name, CDataAlloc2< 1 > *model_alloc, CDataAlloc2< 1 > *texture_alloc)
virtual void ShadowStep()
tagMOTION_TYPE motion_type
virtual void SetRotation(float x, float y, float z)
virtual void DrawShadow()
virtual void Initialize()
virtual void SetPosition(float x, float y, float z)
virtual void ClothStep(int step)
int position_oscillation_flags
void Draw(CCamera *camera)
void Draw2(CCamera *camera, float *head, float *source)
CFrameVu1 * collision_frame
virtual void SetRotation(CVector3_f_ rotation)
virtual void SetPosition(CVector3_f_ position)
sceVu0FVECTOR beem_from[3]
int LoadSoundFileFromPack(char *name, unsigned int *pack)
void SetVol(int port, int volume)
void Fade(int port, float step, int volume)
void SQ_Play(int port, int seq_no)
void SetReverb(int core, int mode, int depth)
void SetVelocity(float speed)
void SetDir(float *direction)
sceVu0FVECTOR start_value
MOTION_INFO * motion_info