DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
title.cpp
1
2#include "common.h"
3
4#include <libgraph.h>
5#include <libpkt.h>
6#include <libvu0.h>
7
8#include <cmath>
9#include <cstdlib>
10#include <cstring>
11
12#include "camera.hpp"
13#include "camerafollow.hpp"
14#include "character.hpp"
15#include "dataalloc.hpp"
16#include "dataread.hpp"
17#include "frame.hpp"
18#include "framevu1.hpp"
19#include "gamepad.hpp"
20#include "mathutil.hpp"
21#include "mds.hpp"
22#include "savedata.hpp"
23#include "snd.hpp"
24#include "sound.hpp"
25#include "title/cursol.hpp"
26#include "title/logo.hpp"
27#include "title/scfader.hpp"
28#include "title/sprite.hpp"
29
30/* The rectangle every 2D draw takes, declared here rather than reached through rect.h because the
31 two constructors that header states are not this file's: every rectangle here is built by one
32 that assigns x, y, w and h in that order, and rect.h's assigns them in the other. */
33template <class T>
34class CRect {
35public:
36 T x;
37 T y;
38 T w;
39 T h;
41 CRect() {}
42
43 CRect(T left, T top, T width, T height) {
44 x = left;
45 y = top;
46 w = width;
47 h = height;
48 }
49};
50
51/* One piece of scenery the third scene lays out: the model file, where it stands and how far it is
52 turned about the vertical axis, in degrees. */
53struct MAP_INFO {
54 char *name;
55 float position[3];
56 float rotation;
57};
58
59/* The rectangle DrawObjectVibe takes by value. It is four ints and not a CRect: the two are the
60 same fields and the name the call encodes is this one. */
61struct RECT {
62 int x;
63 int y;
64 int w;
65 int h;
66};
67
68#include "gamemode.hpp"
69#include "main.hpp"
70#include "memcard.hpp"
71#include "mglib.hpp"
72#include "object.hpp"
73#include "texture.hpp"
74#include "title/dispfade.hpp"
75#include "title/op_a.hpp"
76#include "title/op_b.hpp"
77#include "title/opening.hpp"
78#include "title/rushmovi.hpp"
79#include "title/script.hpp"
80#include "title/title.hpp"
81#include "title/titleloop.hpp"
82#include "vutext.hpp"
83#include "water.hpp"
84#include "wind.hpp"
85#ifdef PAL
86#include "mainselect.hpp"
87#endif
88class OBJ_ANIME_SEQ {
89public:
90 char name[16];
91 int anim_type;
92 int play_mode;
93 char unk_18[8];
94 sceVu0FVECTOR start_value;
95 sceVu0FVECTOR end_value;
96 float step_x;
97 float step_y;
98 float step_z;
99 char unk_4C[60];
100
101 void Initialize();
102};
103
104/* The classes this movie places in the world, declared here rather than reached through headers of
105 their own because each is another unit's to type. Only the members this file touches are named;
106 the extents are the sizes the executable gives the objects below. */
107
108/* Named rather than included, because a unit's include list is a dial on the order a call's
109 floating-point arguments are set up in and nothing here needs the definition: adding
110 renderinfo.h alone takes RushInit's three-float SetFollow out of the order the image has. */
111
112/* A frame parented to an object, which is what lets the world transform drive a model. */
113class CObjectFrame : public CObject {
114public:
115 CFrameVu1 *frame[4];
116 s32 rotation_changed;
117 s32 draw_on;
119 virtual void FrameObjectOnOff(char *name, int on);
120 virtual void Draw();
121
122 void SetFrame(CFrameVu1 *frame, int level);
123};
124
125/* One piece of scenery. The movie builds a table of them, hands each its model, and drives them
126 through the object dispatch like anything else in the world. */
127class CMapObject : public CObjectFrame {
128public:
130 CFrameVu1 *unk_D4;
133 float unk_E0;
135 int handle;
136 char unk_EC[4];
137
138 CMapObject();
139
140 virtual void Draw();
141
142 void Initialize();
143 void DrawShadow(int fast);
144};
145
146/* The dust the running feet kick up, declared here for the same reason. */
147class CRunEffect {
148public:
149 char unk_00[208];
150
151 CRunEffect();
152
153 void Lighting(int enabled);
154 void Set(float *origin);
155 void Step();
156 void Draw();
157};
158
159class CTexture;
160
161/* The movie's one fire, which is a light rather than a model. */
162class CFireOmni {
163public:
164 char unk_18[32];
165 sceVu0FVECTOR position;
166 s32 texture_set;
167 CTexture *core;
168 CTexture *glow;
169 s32 unk_3C;
170
171 CFireOmni();
172
173 void FireStep();
174 void FireCreate();
175
176 void SetPosition(float x, float y, float z) {
177 position[0] = 10.0f * x;
178 position[1] = 10.0f * y;
179 position[2] = 10.0f * z;
180 position[3] = 1.0f;
181 }
182
183 void DrawFire(int unused0, int unused1, CCamera *camera, float *eye, float scale, int layers, float camera_offset);
184};
185
186/* A run of frames the world draws as one. */
187class CMap {
188public:
189 char unk_00[2800];
190
191 void Initialize();
192 CMapObject *SetObject(CFrameVu1 *frame, int category_no, int handle);
193 CMapObject *SetObject(int index, CFrameVu1 *frame, int category_no, int handle);
194 CMapObject *GetObject(int index);
195 void Draw();
196};
197
198void wait_now_loading_vsync();
199void ObjAnimePlay(OBJ_ANIME_SEQ *sequence);
200void set2DSprite(sceVif1Packet *packet, CTexture *texture, const CRect<int> &dst, const CRect<int> &src, u_char alpha);
201void set2DSprite(sceVif1Packet *packet, CTexture *texture, const CRect<int> &dst, const CRect<int> &src, int width, int height, float angle);
202void DepthOfField(float *dist, int level, int alpha, int blur);
203
204static void InitProcA();
205static void InitProcB();
206static void AtraLight();
207static void InitProcC();
208static void InitProcD();
209static void InitProcE();
210static void InitProcF();
211static void InitProcG();
212static void InitProcH();
213static void InitProcI();
214static void InitProcTitle();
215
216/* Nothing reads this, and nothing in the image stands for it: the link this file was built by
217 removed it. It is here because the compiler carries state from one definition to the next, and
218 the follow camera below is constructed with its four arguments evaluated in an order no
219 declaration that emits nothing reaches. Deleting it puts three of those four constants in the
220 wrong registers. */
221
222CCamera Camera(4.0f);
223CCameraFollow FCamera(60.0f, 20.0f, 0.0f, 4.0f);
224CCharacter Cloud__2;
225CCharacter Logo;
226CCharacter Spark[9];
227
228/* Nothing calls this and nothing reads the table it writes: the link this file was built by
229 removed both. They are here because the compiler carries state from one definition to the next,
230 and the camera calls in TitleInit below evaluate their arguments in an order that no declaration
231 emitting nothing reaches. */
232
233void DataLoad() {
234 if (CScript.load_no != RUSH_SCENE_NONE) {
235 load_wait:
236 if (ReadBGSync()) {
237 goto load_wait;
238 }
239 }
240
241 switch (CScript.load_no) {
242 case RUSH_SCENE_A: {
243 void *buffer = read_buffer;
244 LoadFile("rmdat/rmdat1.pak", buffer, 0);
245 break;
246 }
247 case RUSH_SCENE_B:
248 LoadFileBG("rmdat/rmdat2.pak", (u_long128 *) read_buffer, 0);
249 break;
250 case RUSH_SCENE_C:
251 LoadFileBG("rmdat/rmdat3.pak", (u_long128 *) read_buffer, 0);
252 break;
253 case RUSH_SCENE_D:
254 LoadFileBG("rmdat/rmdat4.pak", (u_long128 *) read_buffer, 0);
255 break;
256 case RUSH_SCENE_E:
257 LoadFileBG("rmdat/rmdat5.pak", (u_long128 *) read_buffer, 0);
258 break;
259 case RUSH_SCENE_F:
260 LoadFileBG("rmdat/rmdat6.pak", (u_long128 *) read_buffer, 0);
261 break;
262 case RUSH_SCENE_G:
263 LoadFileBG("rmdat/rmdat7.pak", (u_long128 *) read_buffer, 0);
264 break;
265 case RUSH_SCENE_H:
266 LoadFileBG("rmdat/rmdat8.pak", (u_long128 *) read_buffer, 0);
267 break;
268 case RUSH_SCENE_I:
269 LoadFileBG("rmdat/rmdat9.pak", (u_long128 *) read_buffer, 0);
270 break;
271 case RUSH_SCENE_TITLE:
272 LoadFileBG("rmdat/title.pak", (u_long128 *) read_buffer, 0);
273 break;
274 }
275
276 CScript.load_no = RUSH_SCENE_NONE;
277
278 if (CScript.init_no != RUSH_SCENE_NONE) {
279 while (ReadBGSync())
280 ;
281
282 StartReadBG();
283 }
284
285 switch (CScript.init_no) {
286 case RUSH_SCENE_A:
287 InitProcA();
288 break;
289 case RUSH_SCENE_B:
290 InitProcB();
291 break;
292 case RUSH_SCENE_C:
293 InitProcC();
294 break;
295 case RUSH_SCENE_D:
296 InitProcD();
297 break;
298 case RUSH_SCENE_E:
299 InitProcE();
300 break;
301 case RUSH_SCENE_F:
302 InitProcF();
303 break;
304 case RUSH_SCENE_G:
305 InitProcG();
306 break;
307 case RUSH_SCENE_H:
308 InitProcH();
309 break;
310 case RUSH_SCENE_I:
311 InitProcI();
312 break;
313 case RUSH_SCENE_TITLE:
314 InitProcTitle();
315 break;
316 }
317
318 CScript.init_no = RUSH_SCENE_NONE;
319}
320
329static void InitProcA() {
330 wait_now_loading_vsync();
331
332 LOADTEXTURE_INFO2 textures[] = {
333 {"#blender#640#" HALF_BUFFER_HEIGHT_STR "#4", 0, 0},
334 {"#frame_image#640#" HALF_BUFFER_HEIGHT_STR "#4", 22, 0},
335 {0, 20, 0},
336 {0, 0, 0},
337 {0, 1, 0},
338 {0, 2, 0},
339 {0, 3, 0},
340 {0, 4, 0},
341 {0, 5, 0},
342 {0, 10, 0},
343 {0, 10, 0},
344 {"", 0, 0}
345 };
346
347#ifdef PAL
348 switch (LanguageCode) {
349 case LANG_JAPANESE:
350 textures[2].name = (char *) GetPackFile(read_buffer, "start.img", 0);
351 break;
352 case LANG_ENGLISH_US:
353 textures[2].name = (char *) GetPackFile(read_buffer, "start.img", 0);
354 break;
355 case LANG_ENGLISH_UK:
356 textures[2].name = (char *) GetPackFile(read_buffer, "start.img", 0);
357 break;
358 case LANG_FRENCH:
359 textures[2].name = (char *) GetPackFile(read_buffer, "start_f.img", 0);
360 break;
361 case LANG_GERMAN:
362 textures[2].name = (char *) GetPackFile(read_buffer, "start_g.img", 0);
363 break;
364 case LANG_ITALIAN:
365 textures[2].name = (char *) GetPackFile(read_buffer, "start_i.img", 0);
366 break;
367 case LANG_SPANISH:
368 textures[2].name = (char *) GetPackFile(read_buffer, "start_s.img", 0);
369 break;
370 }
371
372#else
373 textures[2].name = (char *) GetPackFile(read_buffer, "start.img", 0);
374#endif
375 textures[3].name = (char *) GetPackFile(read_buffer, "effect.img", 0);
376 textures[4].name = (char *) GetPackFile(read_buffer, "c01d01.img", 0);
377 textures[5].name = (char *) GetPackFile(read_buffer, "c12a01.img", 0);
378 textures[6].name = (char *) GetPackFile(read_buffer, "c08a01.img", 0);
379 textures[7].name = (char *) GetPackFile(read_buffer, "c09a01.img", 0);
380 textures[8].name = (char *) GetPackFile(read_buffer, "e04a01.img", 0);
381 textures[9].name = (char *) GetPackFile(read_buffer, "s1401.img", 0);
382 textures[10].name = (char *) GetPackFile(read_buffer, "e01s01.img", 0);
383 TexManager.Initialize(16352);
384 TexManager.LoadTextureBlock(-1, textures);
385
386 CharaTex[0] = 1;
387 CharaTex[1] = 2;
388 CharaTex[2] = 3;
389 CharaTex[3] = 4;
390 CharaTex[4] = 5;
391 CharaTex[5] = 5;
392 CharaTex[6] = 5;
393 CharaTex[7] = 5;
394 CharaTex[8] = 5;
395
396 wait_now_loading_vsync();
397
398 char *chara[5] = {"02c01d.cfg", "02c12a.cfg", "02c08a.cfg", "02c09a.cfg", "02e04a.cfg"};
399
400 CharaDataBuffer.Reset();
401
402 for (int i = 0; i < 4; i++) {
403 Chara__3[i].LoadPackData(read_buffer, chara[i], &CharaDataBuffer, 0);
404
405 CFrameAttr attr;
406
407 attr.clip_enable = false;
408 Chara__3[i].frame->SetAttr(attr, 1, 4);
409 Chara__3[i].motion_type.state.time = 1.0f;
410 Chara__3[i].motion_type.state.blend_step = 0.05f;
411 Chara__3[i].motion_type.state.motion_no = 0;
412 Chara__3[i].motion_type.state.playing_no = 0;
413 }
414
415 Chara__3[2].motion_type.state.time = 10.0f;
416 Chara__3[3].motion_type.state.time = 10.0f;
417 Chara__3[0].wind = (int) &Wind__4;
418 Chara__3[1].FootSoundEnable(0);
419
420 for (int j = 4; j < 9; j++) {
421 Chara__3[j].LoadPackData(read_buffer, chara[4], &CharaDataBuffer, 0);
422
423 CFrameAttr attr;
424
425 attr.clip_enable = false;
426 Chara__3[j].frame->SetAttr(attr, 1, 4);
427 Chara__3[j].motion_type.state.blend_step = 0.05f;
428 Chara__3[j].motion_type.state.motion_no = 0;
429 Chara__3[j].motion_type.state.playing_no = 0;
430 Chara__3[j].SetScale(5.0f, (float) (j - j + 5), 5.0f);
431 }
432
433 Chara__3[4].motion_type.state.time = 1.0f;
434 Chara__3[5].motion_type.state.time = 4.0f;
435 Chara__3[6].motion_type.state.time = 8.0f;
436 Chara__3[7].motion_type.state.time = 12.0f;
437 Chara__3[8].motion_type.state.time = 16.0f;
438 OP_CharaFrame = Chara__3[0].frame;
439
440 wait_now_loading_vsync();
441
442 OP_FireList = 0;
443 OP_AnimeSeqRot = 0;
444 MapDataBuffer.Reset();
445 OP_GroundMap.Initialize();
446 OP_BuildingMap.Initialize();
447 OP_BuildingMap2.Initialize();
448
449 CFrameAttr map_attr;
450
451 CFrameVu1 *map = LoadMDSFile(GetPackFile(read_buffer, "s1402.mds", 0), &MapDataBuffer, 2, 0, 0);
452
453 map_attr.fog_enable = true;
454 map->SetAttr(map_attr, 1, 64);
455 SetFrameAttr(map, 1);
456
457 CMapObject *object = OP_GroundMap.SetObject(map, 0, 0);
458
459 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
460 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
461
462 sceVu0FVECTOR anime_start;
463 sceVu0FVECTOR anime_step;
464
465 anime_start[0] = 0.0f;
466 anime_start[1] = 0.0f;
467 anime_start[2] = 0.0f;
468 anime_step[0] = 0.0f;
469 anime_step[1] = 0.015f;
470 anime_step[2] = 0.0f;
471 SetObjAnime("tenkyu", map, anime_start, anime_step);
472
473 anime_start[0] = 0.0f;
474 anime_start[1] = 0.0f;
475 anime_start[2] = 0.0f;
476 anime_step[0] = 0.015f;
477 anime_step[1] = 0.0f;
478 anime_step[2] = 0.0f;
479 SetObjAnime("tenkyu2", map, anime_start, anime_step);
480
481 anime_start[0] = 0.0f;
482 anime_start[1] = 0.0f;
483 anime_start[2] = 0.0f;
484 anime_step[0] = 0.05f;
485 anime_step[1] = 0.0f;
486 anime_step[2] = 0.0f;
487 SetObjAnime("tenkyu3", map, anime_start, anime_step);
488
489 anime_start[0] = 0.0f;
490 anime_start[1] = 0.0f;
491 anime_start[2] = 0.0f;
492 anime_step[0] = 1.0f;
493 anime_step[1] = 0.015f;
494 anime_step[2] = 0.0f;
495 SetObjAnime("inazuma", map, anime_start, anime_step);
496
497 map = LoadMDSFile(GetPackFile(read_buffer, "s1401.mds", 0), &MapDataBuffer, 2, 0, 0);
498 map->SetAttr(map_attr, 1, 64);
499 SetFrameAttr(map, 1);
500 object = OP_BuildingMap.SetObject(map, 0, 0);
501 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
502 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
503
504 wait_now_loading_vsync();
505
506 PathDataBuffer.Reset();
507 SceneNp = -1;
508
509 char *campath[4] = {"0201cp.cfg", "0202cp.cfg", "0203cp.cfg", "0204cp.cfg"};
510
511 for (int k = 0; k < 4; k++) {
512 Cam[k].LoadPackData(read_buffer, campath[k], &PathDataBuffer, 0);
513 Cam[k].motion_type.state.time = 1.0f;
514 Cam[k].motion_type.state.blend_step = 1.0f;
515 Cam[k].motion_type.state.motion_no = 0;
516 Cam[k].motion_type.state.playing_no = 0;
517 Cam[k].motion_type.state.camera = &MainCamera__3;
518 }
519
520 wait_now_loading_vsync();
521 OPAnalyz("sim:rmdat/rmdat1.cfg");
522 OPMdsLoad();
523}
524
525void DrawProcA() {
526 sceVu0FMATRIX flash = {
527 {100.0f, 80.0f, 60.0f, 0.0f},
528 {90.0f, 90.0f, 50.0f, 0.0f},
529 {0.0f, 0.0f, 0.0f, 0.0f},
530 {0.0f, 0.0f, 0.0f, 0.0f}
531 };
532 sceVu0FMATRIX scene_color;
533 sceVu0FMATRIX chara_color;
534
535 sceVu0CopyMatrix(scene_color, lightcolor);
536 sceVu0CopyMatrix(chara_color, flash);
537
538 static int lightning = 0;
539 static int col = 0;
540
541 if (rand() % 127 == 0) {
542 col = 254;
543 lightning = 4;
544
545 int se = rand() % 6;
546
547 if (se < 6) {
548 SndSePlay(se + 67, -1, 0);
549 }
550 }
551
552 if (CScript.camera_start == 0) {
553 if (Cam[SceneNp].motion_type.state.time > 20.0f && !StartLightning) {
554 StartLightning = 1;
555 col = 254;
556 lightning = 4;
557 SndSePlay(SE_THUNDER_CLAP, -1, 0);
558 }
559 }
560
561 for (int i = 0; i < 4; i++) {
562 if (lightcolor[i][0] < (float) col) {
563 scene_color[i][0] = (float) col;
564 }
565
566 if (lightcolor[i][1] < (float) col) {
567 scene_color[i][1] = (float) col;
568 }
569
570 if (lightcolor[i][2] < (float) col) {
571 scene_color[i][2] = (float) col;
572 }
573
574 if (flash[i][0] < (float) col) {
575 chara_color[i][0] = (float) col;
576 }
577
578 if (flash[i][1] < (float) col) {
579 chara_color[i][1] = (float) col;
580 }
581
582 if (flash[i][2] < (float) col) {
583 chara_color[i][2] = (float) col;
584 }
585
586 if (col > 2) {
587 col -= 2;
588 }
589 }
590
591 typedef float ap0, ap1, ap2, ap3, ap4, ap5, ap6, ap7, ap8, ap9, ap10, ap11, ap12, ap13, ap14, ap15;
592
593 if (CScript.camera_start == 2) {
594 Chara__3[6].SetScale((float) (col - col + 2), 2.0f, 2.0f);
595 Chara__3[8].SetScale(2.0f, 2.0f, 2.0f);
596 }
597
598 for (int i = 0; i < 9; i++) {
599 if (CScript.obj[i].disp) {
600 TexManager.ReloadTexture(Vif1Packet, CharaTex[i]);
601 Chara__3[i].Step();
602 Chara__3[i].ClothStep(0);
603 MGSetPLight(light, chara_color);
604 Chara__3[i].Draw();
605 }
606 }
607
608 MGSetPLight(light, scene_color);
609 TexManager.ReloadTexture(Vif1Packet, 10);
610
611 CMapObject *object = OP_GroundMap.GetObject(0);
612 sceVu0FVECTOR camera_position;
613
614 MainCamera__3.GetPos(camera_position);
615 object->SetPosition(camera_position);
616
617 if (lightning) {
618 object->FrameObjectOnOff("inazuma", 1);
619 } else {
620 object->FrameObjectOnOff("inazuma", 0);
621 OP_AnimeSeq[OP_AnimeSeqRot - 1].step_x = (float) (rand() % 10) / 10.0f;
622 ObjAnimePlay(&OP_AnimeSeq[OP_AnimeSeqRot - 1]);
623 }
624
625 if (lightning > 0) {
626 lightning--;
627 }
628
629 sceVu0FVECTOR ambient = {90.0f, 90.0f, 90.0f, 128.0f};
630
631 MGSetAmbient(ambient);
632
633 sceGsAlpha alpha = mgAlpha;
634
635 alpha.bits.a = 0;
636 alpha.bits.b = 2;
637 alpha.bits.c = 0;
638 alpha.bits.d = 1;
639 setAlphaFlag(Vif1Packet, &alpha);
640 object->Draw();
641 MGSetAmbient(ambientlight);
642 setAlphaFlag(Vif1Packet, &mgAlpha);
643 TexManager.ReloadTexture(Vif1Packet, 10);
644 OP_BuildingMap.Draw();
645 TexManager.ReloadTexture(GetVif1Packet(), 0);
646
647 sceVu0FVECTOR eye;
648
649 OP_CharaFrame = Cam[SceneNp].frame;
650 sceVu0CopyVector(eye, OP_CharaFrame->position);
651
652 CFire__4.FireStep();
653 CFire__4.FireCreate();
654
655 for (int i = 0; i < OP_FireList; i++) {
656 float z = OP_FirePosition[i][2];
657 float y = OP_FirePosition[i][1];
658 float x = OP_FirePosition[i][0];
659
660 CFire__4.position[0] = 10.0f * x;
661 CFire__4.position[1] = 10.0f * y;
662 CFire__4.position[2] = 10.0f * z;
663 CFire__4.position[3] = 1.0f;
664
665 float *fire_scale = &OP_FireScale[i];
666 CFire__4.DrawFire(1, 1, &MainCamera__3, eye, *fire_scale, 15, 15.0f);
667 }
668
669 TexManager.ReloadTexture(Vif1Packet, 22);
670
671 float dof[3] = {1000.0f, 2000.0f, 3000.0f};
672
673 DepthOfField(dof, 3, 32, 0);
674}
675
676CFrame *ObjectFrame3;
677class CProcess CProcess;
678CScFader CFade;
679
680class CSprite CSprite;
681class CLogo CLogo;
682class CCursol CCursol;
683
684static float TitleCameraWork[4];
685
694static void InitProcB() {
695 LOADTEXTURE_INFO2 textures[] = {
696 {"#blender#640#" HALF_BUFFER_HEIGHT_STR "#4", 0, 0},
697 {"#frame_image#640#" HALF_BUFFER_HEIGHT_STR "#4", 22, 0},
698 {"#shadow_buff#640#" HALF_BUFFER_HEIGHT_STR "#4", 23, 0},
699 {"#water_buff#640#" HALF_BUFFER_HEIGHT_STR "#4", 21, 0},
700 {0, 20, 0},
701 {0, 0, 0},
702 {0, 10, 0},
703 {0, 1, 0},
704 {0, 2, 0},
705 {0, 3, 0},
706 {0, 4, 0},
707 {0, 8, 0},
708 {0, 9, 0},
709 {"", 0, 0}
710 };
711
712#ifdef PAL
713 switch (LanguageCode) {
714 case LANG_JAPANESE:
715 textures[4].name = (char *) GetPackFile(read_buffer, "start.img", 0);
716 break;
717 case LANG_ENGLISH_US:
718 textures[4].name = (char *) GetPackFile(read_buffer, "start.img", 0);
719 break;
720 case LANG_ENGLISH_UK:
721 textures[4].name = (char *) GetPackFile(read_buffer, "start.img", 0);
722 break;
723 case LANG_FRENCH:
724 textures[4].name = (char *) GetPackFile(read_buffer, "start_f.img", 0);
725 break;
726 case LANG_GERMAN:
727 textures[4].name = (char *) GetPackFile(read_buffer, "start_g.img", 0);
728 break;
729 case LANG_ITALIAN:
730 textures[4].name = (char *) GetPackFile(read_buffer, "start_i.img", 0);
731 break;
732 case LANG_SPANISH:
733 textures[4].name = (char *) GetPackFile(read_buffer, "start_s.img", 0);
734 break;
735 }
736
737#else
738 textures[4].name = (char *) GetPackFile(read_buffer, "start.img", 0);
739#endif
740 textures[5].name = (char *) GetPackFile(read_buffer, "effect.img", 0);
741 textures[6].name = (char *) GetPackFile(read_buffer, "d01m01.img", 0);
742 textures[7].name = (char *) GetPackFile(read_buffer, "c01d01.img", 0);
743 textures[8].name = (char *) GetPackFile(read_buffer, "e01a01.img", 0);
744 textures[9].name = (char *) GetPackFile(read_buffer, "saget.img", 0);
745 textures[10].name = (char *) GetPackFile(read_buffer, "d01etc.img", 0);
746 textures[11].name = (char *) GetPackFile(read_buffer, "rm04ex.img", 0);
747 textures[12].name = (char *) GetPackFile(read_buffer, "c01w03.img", 0);
748 TexManager.Initialize(16352);
749 TexManager.LoadTextureBlock(-1, textures);
750
751 CharaTex[0] = 1;
752 CharaTex[1] = 2;
753 CharaTex[2] = 3;
754 CharaTex[3] = 4;
755 CharaTex[7] = 8;
756 CharaTex[8] = 9;
757
758 char *chara[4] = {"rm05c01d.cfg", "rm04e01a.cfg", "rm05saget.cfg", "d01o03_m.cfg"};
759
760 CharaDataBuffer.Reset();
761
762 for (int i = 0; i < 30; i++) {
763 TexAnimeDataMovie[i].Initialize();
764 }
765
766 Chara__3[3].InitializeTexAnime(TexAnimeDataMovie, 30);
767 Chara__3[3].TexAnimeOn(0);
768 Chara__3[0].LoadPackData(read_buffer, "c01d.cfg", &CharaDataBuffer, 0);
769 Chara__3[0].LoadPackData(read_buffer, "rm04c01d.cfg", &CharaDataBuffer, 0);
770
771 for (int j = 0; j < 4; j++) {
772 Chara__3[j].LoadPackData(read_buffer, chara[j], &CharaDataBuffer, 0);
773
774 CFrameAttr attr;
775
776 attr.clip_enable = false;
777 Chara__3[j].frame->SetAttr(attr, 1, 4);
778 Chara__3[j].motion_type.state.time = 1.0f;
779 Chara__3[j].motion_type.state.blend_step = 0.05f;
780 Chara__3[j].motion_type.state.motion_no = 0;
781 Chara__3[j].motion_type.state.playing_no = 0;
782 }
783
784 Chara__3[1].motion_type.state.time = 10.0f;
785 Chara__3[2].motion_type.state.time = 30.0f;
786 Chara__3[0].wind = (int) &Wind__4;
787 Chara__3[7].LoadPackData(read_buffer, "rm04ex.cfg", &CharaDataBuffer, 0);
788 Chara__3[8].LoadPackData(read_buffer, "c01w03.cfg", &CharaDataBuffer, 0);
789
790 OP_FireList = 0;
791 OP_AnimeSeqRot = 0;
792 MapDataBuffer.Reset();
793 OP_GroundMap.Initialize();
794 OP_BuildingMap.Initialize();
795
796 CFrameAttr map_attr;
797
798 CFrameVu1 *map = LoadMDSFile(GetPackFile(read_buffer, "s4201.mds", 0), &MapDataBuffer, 2, 0, 0);
799
800 map_attr.fog_enable = true;
801 map->SetAttr(map_attr, 1, 64);
802 SetFrameAttr(map, 1);
803
804 CMapObject *object = OP_GroundMap.SetObject(map, 0, 0);
805
806 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
807 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
808
809 map = LoadMDSFile(GetPackFile(read_buffer, "s4202.mds", 0), &MapDataBuffer, 2, 0, 0);
810 map->SetAttr(map_attr, 1, 64);
811 SetFrameAttr(map, 1);
812 object = OP_BuildingMap.SetObject(map, 0, 0);
813 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
814 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
815
816 PathDataBuffer.Reset();
817 SceneNp = -1;
818
819 char *campath[4] = {"rm03cam.cfg", "rm04cam.cfg", "rm05cam.cfg"};
820
821 for (int k = 0; k < 3; k++) {
822 Cam[k].LoadPackData(read_buffer, campath[k], &PathDataBuffer, 0);
823 Cam[k].motion_type.state.time = 1.0f;
824 Cam[k].motion_type.state.blend_step = 1.0f;
825 Cam[k].motion_type.state.motion_no = 0;
826 Cam[k].motion_type.state.playing_no = 0;
827 Cam[k].motion_type.state.camera = &MainCamera__3;
828 }
829
830 OP_FireList = 0;
831 OP_AnimeSeqRot = 0;
832 OPAnalyz("sim:rmdat/rmdat2.cfg");
833 OPMdsLoad();
834
835 sceVu0FVECTOR corner0 = {260.0f, 0.0f, -400.0f, 1.0f};
836 sceVu0FVECTOR corner1 = {380.0f, 0.0f, -400.0f, 1.0f};
837 sceVu0FVECTOR corner2 = {260.0f, 0.0f, -250.0f, 1.0f};
838 sceVu0FVECTOR corner3 = {380.0f, 0.0f, -250.0f, 1.0f};
839
840 Water__2.SetVertex(corner0, corner1, corner2, corner3);
841#ifdef PAL
842 float zero = 0.0f;
843 Water__2.frame.SetPosition(zero, -4.0f, zero);
844#else
845 typedef float bp0, bp1, bp2;
846 Water__2.frame.SetPosition(0.0f, -4.0f, 0.0f);
847#endif
848 Water__2.SetSize(24, 24, &WaterBuffer);
849 Water__2.SetParam(0.1f, 0.015f, 0.0f, 2.0f);
850 Water__2.SetColor(100, 110, 120, 128);
851}
852
853void DrawProcB() {
854 TexManager.ReloadTexture(Vif1Packet, 10);
855 OP_GroundMap.Draw();
856 OP_BuildingMap.Draw();
857
858 WaterProcess();
859
860 TexManager.ReloadTexture(Vif1Packet, 23);
861 CTexture *texture = TexManager.GetTexture("shadow_buff", -1);
862
863 MGBeginDrawShadow(*(sceGsTex0 *) &texture->tex0);
864
865 for (int i = 0; i < 9; i++) {
866 if (CScript.obj[i].disp) {
867 Chara__3[i].ShadowStep();
868 Chara__3[i].DrawShadow();
869 }
870 }
871
872 MGEndDrawShadow(52);
873
874 for (int i = 0; i < 9; i++) {
875 if (CScript.obj[i].disp) {
876 sceVu0FMATRIX save_light;
877 sceVu0FMATRIX save_lightcolor;
878
879 sceVu0CopyMatrix(save_light, light);
880 sceVu0CopyMatrix(save_lightcolor, lightcolor);
881
882 if (i == 0 && CScript.camera_start == 6) {
883 AtraLight();
884 }
885
886 TexManager.ReloadTexture(Vif1Packet, CharaTex[i]);
887 Chara__3[i].TextureAnime(CharaTex[i]);
888 Chara__3[i].Step();
889 Chara__3[i].ClothStep(0);
890 Chara__3[i].Draw();
891
892 sceVu0CopyMatrix(light, save_light);
893 sceVu0CopyMatrix(lightcolor, save_lightcolor);
894 MGSetPLight(light, lightcolor);
895 }
896 }
897
898 TexManager.ReloadTexture(GetVif1Packet(), 0);
899
900 if (CScript.camera_start == 4) {
901 sceVu0FVECTOR position;
902
903 sceVu0CopyVector(position, Chara__3[0].frame->position);
904 CRunFx.Lighting(1);
905
906 int frame = (int) Chara__3[0].motion_type.state.time;
907
908 if ((frame >= 73 && frame < 74) || (frame >= 83 && frame < 84)) {
909 CRunFx.Set(position);
910 }
911
912 CRunFx.Step();
913 CRunFx.Draw();
914 }
915
916 sceVu0FVECTOR eye;
917
918 OP_CharaFrame = Cam[SceneNp].frame;
919 sceVu0CopyVector(eye, OP_CharaFrame->position);
920
921 CFire__4.FireStep();
922 CFire__4.FireCreate();
923
924 for (int i = 0; i < OP_FireList; i++) {
925 float z = OP_FirePosition[i][2] / 10.0f;
926 float y = OP_FirePosition[i][1] / 10.0f;
927 float x = OP_FirePosition[i][0] / 10.0f;
928
929 CFire__4.SetPosition(x, y, z);
930
931 CFire__4.DrawFire(1, 1, &MainCamera__3, eye, OP_FireScale[i], 3, 15.0f);
932 }
933
934 TexManager.ReloadTexture(Vif1Packet, 22);
935
936 float dof[2] = {400.0f, 1000.0f};
937
938 DepthOfField(dof, 2, 32, 0);
939}
940
949static void AtraLight() {
950 if (Chara__3[2].motion_type.state.time >= 40.0f) {
951 CFrame *frame = Chara__3[2].frame->SearchFrame("light01");
952
953 if (frame) {
954 sceVu0FVECTOR position;
955 sceVu0FVECTOR eye;
956 sceVu0FVECTOR dir;
957 sceVu0FVECTOR world;
958 sceVu0FMATRIX matrix;
959
960 sceVu0CopyMatrix(matrix, frame->local);
961 position[0] = matrix[3][0];
962 position[1] = matrix[3][1];
963 position[2] = matrix[3][2];
964 frame->GetWorldPosition(world, position);
965
966 OP_CharaFrame = Chara__3[0].frame;
967 sceVu0CopyVector(eye, OP_CharaFrame->position);
968
969 dir[0] = world[0] - eye[0];
970 dir[1] = world[1] - eye[1] - 12.0f;
971 dir[2] = world[2] - eye[2];
972
973 float len = sqrt(dir[0] * dir[0] + dir[1] * dir[1] + dir[2] * dir[2]);
974
975 if (len <= 10.0f) {
976 len = 10.0f;
977 }
978
979 float power = 5.0f * (100.0f / (len * len));
980
981 sceVu0Normalize(dir, dir);
982 dir[0] *= power;
983 dir[1] *= power;
984 dir[2] *= power;
985 dir[3] = 0.0f;
986
987 light[0][3] = dir[0];
988 light[1][3] = dir[1];
989 light[2][3] = dir[2];
990 light[3][3] = 0.0f;
991
992 lightcolor[3][0] = 0.8359375f * atraGetStatusRate;
993 lightcolor[3][1] = 0.9765625f * atraGetStatusRate;
994 lightcolor[3][2] = 0.66015625f * atraGetStatusRate;
995 lightcolor[3][3] = 0.5f * atraGetStatusRate;
996 atraGetStatusRate += 2.0f;
997
998 MGSetPLight(light, lightcolor);
999 }
1000 }
1001}
1002
1011static void InitProcC() {
1012 LOADTEXTURE_INFO2 textures[] = {
1013 {"#blender#640#" HALF_BUFFER_HEIGHT_STR "#4", 0, 0},
1014 {"#frame_image#640#" HALF_BUFFER_HEIGHT_STR "#4", 22, 0},
1015 {"#shadow_buff#640#" HALF_BUFFER_HEIGHT_STR "#4", 23, 0},
1016 {"#water_buff#640#" HALF_BUFFER_HEIGHT_STR "#4", 21, 0},
1017 {0, 20, 0},
1018 {0, 0, 0},
1019 {0, 10, 0},
1020 {0, 10, 0},
1021 {0, 10, 0},
1022 {0, 1, 0},
1023 {0, 9, 0},
1024 {"", 0, 0}
1025 };
1026
1027#ifdef PAL
1028 switch (LanguageCode) {
1029 case LANG_JAPANESE:
1030 textures[4].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1031 break;
1032 case LANG_ENGLISH_US:
1033 textures[4].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1034 break;
1035 case LANG_ENGLISH_UK:
1036 textures[4].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1037 break;
1038 case LANG_FRENCH:
1039 textures[4].name = (char *) GetPackFile(read_buffer, "start_f.img", 0);
1040 break;
1041 case LANG_GERMAN:
1042 textures[4].name = (char *) GetPackFile(read_buffer, "start_g.img", 0);
1043 break;
1044 case LANG_ITALIAN:
1045 textures[4].name = (char *) GetPackFile(read_buffer, "start_i.img", 0);
1046 break;
1047 case LANG_SPANISH:
1048 textures[4].name = (char *) GetPackFile(read_buffer, "start_s.img", 0);
1049 break;
1050 }
1051
1052#else
1053 textures[4].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1054#endif
1055 textures[5].name = (char *) GetPackFile(read_buffer, "effect.img", 0);
1056 textures[6].name = (char *) GetPackFile(read_buffer, "s04b01.img", 0);
1057 textures[7].name = (char *) GetPackFile(read_buffer, "s04b02.img", 0);
1058 textures[8].name = (char *) GetPackFile(read_buffer, "s04w01.img", 0);
1059 textures[9].name = (char *) GetPackFile(read_buffer, "c01d01.img", 0);
1060 textures[10].name = (char *) GetPackFile(read_buffer, "pat.img", 0);
1061 TexManager.DeleteTextureBlock(0);
1062 TexManager.CleanUpBuffer();
1063 TexManager.Initialize(16352);
1064 TexManager.LoadTextureBlock(-1, textures);
1065
1066 CharaTex[0] = 1;
1067 CharaTex[8] = 9;
1068
1069 CharaDataBuffer.Reset();
1070 Chara__3[0].LoadPackData(read_buffer, "c01d.cfg", &CharaDataBuffer, 0);
1071
1072 CFrameAttr attr;
1073
1074 attr.clip_enable = false;
1075 Chara__3[0].frame->SetAttr(attr, 1, 4);
1076 Chara__3[0].motion_type.state.time = 10.0f;
1077 Chara__3[0].motion_type.state.blend_step = 0.05f;
1078 Chara__3[0].motion_type.state.motion_no = 0;
1079 Chara__3[0].motion_type.state.playing_no = 0;
1080 Chara__3[0].FootSoundEnable(0);
1081 Chara__3[0].wind = (int) &Wind__4;
1082
1083 Chara__3[8].LoadPackData(read_buffer, "pat.cfg", &CharaDataBuffer, 0);
1084 attr.clip_enable = false;
1085 Chara__3[8].frame->SetAttr(attr, 1, 4);
1086 Chara__3[8].motion_type.state.time = 1.0f;
1087 Chara__3[8].motion_type.state.blend_step = 0.05f;
1088 Chara__3[8].motion_type.state.motion_no = 0;
1089 Chara__3[8].motion_type.state.playing_no = 0;
1090
1091 MAP_INFO norn[] = {
1092 {"s04g01_0.mds", 0.0f, 0.0f, 0.0f, 0.0f },
1093 {"s04g02_0.mds", 0.0f, 0.0f, 0.0f, 0.0f },
1094 {"s04g04_0.mds", 0.0f, 0.0f, 0.0f, 0.0f },
1095 {"s04g06_0.mds", 0.0f, 0.0f, 0.0f, 0.0f },
1096 {"s04g03_0.mds", 0.0f, 0.0f, 0.0f, 0.0f },
1097 {"s04g05_0.mds", 0.0f, 0.0f, 0.0f, 0.0f },
1098 {"s04r01_0.mds", 0.0f, 0.0f, 74.0f, 0.0f },
1099 {"s04r02_0.mds", -56.68f, 0.0f, 47.566f, -50.0f },
1100 {"s04r03_0.mds", 32.439f, 0.0f, -66.51f, 154.0f },
1101 {"s04r05_0.mds", 82.0f, -10.0f, 109.0f, -90.0f },
1102 {"s04r06_0.mds", 61.832f, 10.0f, -127.0f, -28.0f },
1103 {"s04r07_0.mds", -54.64f, 10.0f, -115.6f, 25.0f },
1104 {"s04r08_0.mds", -90.85f, 10.0f, 75.585f, 125.0f },
1105 {"s04w01_0.mds", 0.0f, 0.0f, 0.0f, 0.0f },
1106 {"s04w02_0.mds", 0.0f, 0.0f, 0.0f, 0.0f },
1107 {"s04h01_0.mds", 0.0f, -10.0f, 0.0f, 0.0f },
1108 {"s04h02_0.mds", 127.0f, -10.0f, 109.0f, 0.0f },
1109 {"s04h03_0.mds", -140.0f, -10.0f, 110.0f, 125.0f },
1110 {"s04h03_0.mds", 90.0f, -10.0f, -180.0f, -28.0f },
1111 {"s04h03_0.mds", -80.0f, -10.0f, -170.0f, 25.0f },
1112 {"s04a01_0.mds", -63.15f, -15.0f, 128.0f, 50.0f },
1113 {"s04a01_0.mds", -126.0f, -15.0f, -110.0f, -20.0f },
1114 {"s04a01_0.mds", -178.0f, -15.0f, 46.0f, 10.0f },
1115 {"s04a01_0.mds", 12.0f, -15.0f, -218.0f, -70.0f },
1116 {"s04a01_0.mds", 204.0f, -15.0f, -152.0f, -140.0f},
1117 {"s04a01_0.mds", 244.0f, -15.0f, 14.0f, 190.0f }
1118 };
1119
1120 OP_FireList = 0;
1121 OP_AnimeSeqRot = 0;
1122 MapDataBuffer.Reset();
1123
1124 CFrameAttr map_attr;
1125 CFrameVu1 *map;
1126
1127 for (int i = 0; i < 26; i++) {
1128 map = LoadMDSFile(GetPackFile(read_buffer, norn[i].name, 0), &MapDataBuffer, 2, 0, 0);
1129
1130 map_attr.fog_enable = true;
1131 map->SetAttr(map_attr, 1, 64);
1132 SetFrameAttr(map, 1);
1133
1134 CMapObject &object = OP_NornMapObj[i];
1135
1136 object.Initialize();
1137 object.SetFrame(map, 0);
1138 OP_NornMapObj[i].handle = 0;
1139 OP_NornMapObj[i].category_no = 0;
1140 object.SetPosition(CVector3_f_(norn[i].position[0], norn[i].position[1], norn[i].position[2]));
1141 object.SetRotation(CVector3_f_(0.0f, (float) (PI_D * norn[i].rotation / 180), 0.0f));
1142 }
1143
1144 PathDataBuffer.Reset();
1145 SceneNp = -1;
1146
1147 char *campath[4] = {"rm06cam.cfg"};
1148
1149 for (int j = 0; j < 1; j++) {
1150 Cam[j].LoadPackData(read_buffer, campath[j], &PathDataBuffer, 0);
1151 Cam[j].motion_type.state.time = 1.0f;
1152 Cam[j].motion_type.state.blend_step = 1.0f;
1153 Cam[j].motion_type.state.motion_no = 0;
1154 Cam[j].motion_type.state.playing_no = 0;
1155 Cam[j].motion_type.state.camera = &MainCamera__3;
1156 }
1157
1158 OP_FireList = 0;
1159 OP_AnimeSeqRot = 0;
1160 OPAnalyz("sim:rmdat/rmdat3.cfg");
1161 OPMdsLoad();
1162
1163 sceVu0FVECTOR corner0 = {-120.0f, 0.0f, -120.0f, 1.0f};
1164 sceVu0FVECTOR corner1 = {120.0f, 0.0f, -120.0f, 1.0f};
1165 sceVu0FVECTOR corner2 = {-120.0f, 0.0f, 120.0f, 1.0f};
1166 sceVu0FVECTOR corner3 = {-120.0f, 0.0f, 120.0f, 1.0f};
1167
1168 Water__2.SetVertex(corner0, corner1, corner2, corner3);
1169 Water__2.frame.SetPosition((float) (OP_FireList & 0), 0.0f, 0.0f);
1170 Water__2.SetSize(32, 32, &WaterBuffer);
1171 Water__2.SetParam(0.1f, 0.015f, 0.0f, 2.0f);
1172 Water__2.SetColor(128, 128, 128, 128);
1173}
1174
1175void DrawProcC() {
1176 TexManager.ReloadTexture(Vif1Packet, 10);
1177
1178 for (int i = 0; i < 26; i++) {
1179 CMapObject *object = &OP_NornMapObj[i];
1180
1181 object->Draw();
1182 }
1183
1184 WaterProcess();
1185
1186 TexManager.ReloadTexture(Vif1Packet, 23);
1187 CTexture *texture = TexManager.GetTexture("shadow_buff", -1);
1188
1189 MGBeginDrawShadow(*(sceGsTex0 *) &texture->tex0);
1190
1191 for (int i = 0; i < 9; i++) {
1192 if (CScript.obj[i].disp) {
1193 Chara__3[i].ShadowStep();
1194 Chara__3[i].DrawShadow();
1195 }
1196 }
1197
1198 MGEndDrawShadow(52);
1199
1200 for (int i = 0; i < 9; i++) {
1201 if (CScript.obj[i].disp) {
1202 TexManager.ReloadTexture(Vif1Packet, CharaTex[i]);
1203 Chara__3[i].Step();
1204 Chara__3[i].ClothStep(0);
1205 Chara__3[i].Draw();
1206 }
1207 }
1208
1209 sceVu0FVECTOR eye;
1210
1211 TexManager.ReloadTexture(GetVif1Packet(), 0);
1212 OP_CharaFrame = Cam[SceneNp].frame;
1213 sceVu0CopyVector(eye, OP_CharaFrame->position);
1214
1215 CFire__4.FireStep();
1216 CFire__4.FireCreate();
1217
1218 for (int i = 0; i < OP_FireList; i++) {
1219 float z = OP_FirePosition[i][2] / 10.0f;
1220 float y = OP_FirePosition[i][1] / 10.0f;
1221 float x = OP_FirePosition[i][0] / 10.0f;
1222
1223 CFire__4.position[0] = 10.0f * x;
1224 CFire__4.position[1] = 10.0f * y;
1225 CFire__4.position[2] = 10.0f * z;
1226 CFire__4.position[3] = 1.0f;
1227
1228 CFire__4.DrawFire(1, 1, &MainCamera__3, eye, OP_FireScale[i], 2, 15.0f);
1229 }
1230
1231 TexManager.ReloadTexture(Vif1Packet, 22);
1232
1233 float dof[2] = {400.0f, 1000.0f};
1234
1235 DepthOfField(dof, 2, 32, 0);
1236}
1237
1246static void InitProcD() {
1247 LOADTEXTURE_INFO2 textures[] = {
1248 {"#blender#640#" HALF_BUFFER_HEIGHT_STR "#4", 0, 0},
1249 {"#frame_image#640#" HALF_BUFFER_HEIGHT_STR "#4", 22, 0},
1250 {"#shadow_buff#640#" HALF_BUFFER_HEIGHT_STR "#4", 23, 0},
1251 {0, 20, 0},
1252 {0, 10, 0},
1253 {0, 1, 0},
1254 {0, 1, 0},
1255 {0, 2, 0},
1256 {0, 9, 0},
1257 {"", 0, 0}
1258 };
1259
1260#ifdef PAL
1261 switch (LanguageCode) {
1262 case LANG_JAPANESE:
1263 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1264 break;
1265 case LANG_ENGLISH_US:
1266 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1267 break;
1268 case LANG_ENGLISH_UK:
1269 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1270 break;
1271 case LANG_FRENCH:
1272 textures[3].name = (char *) GetPackFile(read_buffer, "start_f.img", 0);
1273 break;
1274 case LANG_GERMAN:
1275 textures[3].name = (char *) GetPackFile(read_buffer, "start_g.img", 0);
1276 break;
1277 case LANG_ITALIAN:
1278 textures[3].name = (char *) GetPackFile(read_buffer, "start_i.img", 0);
1279 break;
1280 case LANG_SPANISH:
1281 textures[3].name = (char *) GetPackFile(read_buffer, "start_s.img", 0);
1282 break;
1283 }
1284
1285#else
1286 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1287#endif
1288 textures[4].name = (char *) GetPackFile(read_buffer, "d02i01.img", 0);
1289 textures[5].name = (char *) GetPackFile(read_buffer, "c01d01.img", 0);
1290 textures[6].name = (char *) GetPackFile(read_buffer, "c01d01an.img", 0);
1291 textures[7].name = (char *) GetPackFile(read_buffer, "e54a01.img", 0);
1292 textures[8].name = (char *) GetPackFile(read_buffer, "c01w11.img", 0);
1293 TexManager.Initialize(16352);
1294 TexManager.LoadTextureBlock(-1, textures);
1295
1296 CharaTex[0] = 1;
1297 CharaTex[1] = 2;
1298 CharaTex[2] = 2;
1299 CharaTex[8] = 9;
1300
1301 char *chara[3] = {"rm07c01d.cfg", "rm07e54b.cfg", "rm07e54a.cfg"};
1302
1303 CharaDataBuffer.Reset();
1304
1305 for (int i = 0; i < 30; i++) {
1306 TexAnimeDataMovie[i].Initialize();
1307 }
1308
1309 Chara__3[0].InitializeTexAnime(TexAnimeDataMovie, 30);
1310 Chara__3[0].LoadPackData(read_buffer, "c01d.cfg", &CharaDataBuffer, 0);
1311
1312 for (int j = 0; j < 3; j++) {
1313 Chara__3[j].LoadPackData(read_buffer, chara[j], &CharaDataBuffer, 0);
1314
1315 CFrameAttr attr;
1316
1317 attr.clip_enable = false;
1318 Chara__3[j].frame->SetAttr(attr, 1, 4);
1319 Chara__3[j].motion_type.state.time = 1.0f;
1320 Chara__3[j].motion_type.state.blend_step = 0.05f;
1321 Chara__3[j].motion_type.state.motion_no = 0;
1322 Chara__3[j].motion_type.state.playing_no = 0;
1323 }
1324
1325 Chara__3[0].motion_type.state.time = 10.0f;
1326 Chara__3[1].motion_type.state.time = 10.0f;
1327 Chara__3[2].motion_type.state.time = 10.0f;
1328 Chara__3[8].LoadPackData(read_buffer, "c01w11.cfg", &CharaDataBuffer, 0);
1329 Chara__3[0].TexAnimeOn(2);
1330 Chara__3[0].wind = (int) &Wind__4;
1331
1332 OP_FireList = 0;
1333 OP_AnimeSeqRot = 0;
1334 MapDataBuffer.Reset();
1335 OP_GroundMap.Initialize();
1336 OP_BuildingMap.Initialize();
1337 OP_BuildingMap2.Initialize();
1338
1339 CFrameAttr map_attr;
1340
1341 CFrameVu1 *map = LoadMDSFile(GetPackFile(read_buffer, "s44g01_0.mds", 0), &MapDataBuffer, 2, 0, 0);
1342
1343 map_attr.fog_enable = true;
1344 map->SetAttr(map_attr, 1, 64);
1345 SetFrameAttr(map, 1);
1346
1347 CMapObject *object = OP_GroundMap.SetObject(map, 0, 0);
1348
1349 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
1350 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
1351
1352 map = LoadMDSFile(GetPackFile(read_buffer, "s44g02_0.mds", 0), &MapDataBuffer, 2, 0, 0);
1353 map->SetAttr(map_attr, 1, 64);
1354 SetFrameAttr(map, 1);
1355 object = OP_BuildingMap.SetObject(map, 0, 0);
1356 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
1357 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
1358
1359 PathDataBuffer.Reset();
1360 SceneNp = -1;
1361
1362 char *campath[1] = {"rm07cam.cfg"};
1363
1364 for (int k = 0; k < 1; k++) {
1365 Cam[k].LoadPackData(read_buffer, campath[k], &PathDataBuffer, 0);
1366 Cam[k].motion_type.state.time = 10.0f;
1367 Cam[k].motion_type.state.blend_step = 1.0f;
1368 Cam[k].motion_type.state.motion_no = 0;
1369 Cam[k].motion_type.state.playing_no = 0;
1370 Cam[k].motion_type.state.camera = &MainCamera__3;
1371 }
1372
1373 OP_FireList = 0;
1374 OP_AnimeSeqRot = 0;
1375 OPAnalyz("sim:rmdat/rmdat4.cfg");
1376 OPMdsLoad();
1377}
1378
1379void DrawProcD() {
1380 TexManager.ReloadTexture(Vif1Packet, 10);
1381 OP_GroundMap.Draw();
1382 OP_BuildingMap.Draw();
1383
1384 TexManager.ReloadTexture(Vif1Packet, 23);
1385 CTexture *texture = TexManager.GetTexture("shadow_buff", -1);
1386
1387 MGBeginDrawShadow(*(sceGsTex0 *) &texture->tex0);
1388
1389 for (int i = 0; i < 9; i++) {
1390 if (CScript.obj[i].disp) {
1391 Chara__3[i].ShadowStep();
1392 Chara__3[i].DrawShadow();
1393 }
1394 }
1395
1396 MGEndDrawShadow(52);
1397
1398 for (int i = 0; i < 9; i++) {
1399 if (CScript.obj[i].disp) {
1400 TexManager.ReloadTexture(Vif1Packet, CharaTex[i]);
1401 Chara__3[i].TextureAnime(CharaTex[i]);
1402 Chara__3[i].Step();
1403 Chara__3[i].ClothStep(0);
1404 Chara__3[i].Draw();
1405 }
1406 }
1407
1408 TexManager.ReloadTexture(Vif1Packet, 22);
1409
1410 float dof[2] = {400.0f, 1000.0f};
1411
1412 DepthOfField(dof, 2, 32, 0);
1413}
1414
1423static void InitProcE() {
1424 LOADTEXTURE_INFO2 textures[] = {
1425 {"#blender#640#" HALF_BUFFER_HEIGHT_STR "#4", 0, 0},
1426 {"#frame_image#640#" HALF_BUFFER_HEIGHT_STR "#4", 22, 0},
1427 {"#shadow_buff#640#" HALF_BUFFER_HEIGHT_STR "#4", 23, 0},
1428 {0, 20, 0},
1429 {0, 10, 0},
1430 {0, 1, 0},
1431 {0, 1, 0},
1432 {0, 2, 0},
1433 {0, 2, 0},
1434 {"", 0, 0}
1435 };
1436
1437#ifdef PAL
1438 switch (LanguageCode) {
1439 case LANG_JAPANESE:
1440 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1441 break;
1442 case LANG_ENGLISH_US:
1443 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1444 break;
1445 case LANG_ENGLISH_UK:
1446 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1447 break;
1448 case LANG_FRENCH:
1449 textures[3].name = (char *) GetPackFile(read_buffer, "start_f.img", 0);
1450 break;
1451 case LANG_GERMAN:
1452 textures[3].name = (char *) GetPackFile(read_buffer, "start_g.img", 0);
1453 break;
1454 case LANG_ITALIAN:
1455 textures[3].name = (char *) GetPackFile(read_buffer, "start_i.img", 0);
1456 break;
1457 case LANG_SPANISH:
1458 textures[3].name = (char *) GetPackFile(read_buffer, "start_s.img", 0);
1459 break;
1460 }
1461
1462#else
1463 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1464#endif
1465 textures[4].name = (char *) GetPackFile(read_buffer, "s4501.img", 0);
1466 textures[5].name = (char *) GetPackFile(read_buffer, "c01d01.img", 0);
1467 textures[6].name = (char *) GetPackFile(read_buffer, "c01d01an.img", 0);
1468 textures[7].name = (char *) GetPackFile(read_buffer, "c04b01.img", 0);
1469 textures[8].name = (char *) GetPackFile(read_buffer, "c04b01an.img", 0);
1470 TexManager.Initialize(16352);
1471 TexManager.LoadTextureBlock(-1, textures);
1472
1473 CharaTex[0] = 1;
1474 CharaTex[1] = 2;
1475
1476 char *chara[2] = {"rm09c01d.cfg", "rm09c04b.cfg"};
1477
1478 CharaDataBuffer.Reset();
1479
1480 for (int i = 0; i < 30; i++) {
1481 TexAnimeDataMovie[i].Initialize();
1482 }
1483
1484 Chara__3[0].InitializeTexAnime(TexAnimeDataMovie, 30);
1485 Chara__3[1].InitializeTexAnime(TexAnimeDataMovie, 30);
1486 Chara__3[0].LoadPackData(read_buffer, "c01d.cfg", &CharaDataBuffer, 0);
1487
1488 for (int j = 0; j < 2; j++) {
1489 Chara__3[j].LoadPackData(read_buffer, chara[j], &CharaDataBuffer, 0);
1490
1491 CFrameAttr attr;
1492
1493 attr.clip_enable = false;
1494 Chara__3[j].frame->SetAttr(attr, 1, 4);
1495 Chara__3[j].motion_type.state.time = 1.0f;
1496 Chara__3[j].motion_type.state.blend_step = 0.05f;
1497 Chara__3[j].motion_type.state.motion_no = 0;
1498 Chara__3[j].motion_type.state.playing_no = 0;
1499 }
1500
1501 Chara__3[0].TexAnimeOn(2);
1502 Chara__3[1].TexAnimeOn(1);
1503 Chara__3[0].wind = (int) &Wind__4;
1504
1505 OP_FireList = 0;
1506 OP_AnimeSeqRot = 0;
1507 MapDataBuffer.Reset();
1508 OP_GroundMap.Initialize();
1509 OP_BuildingMap.Initialize();
1510 OP_BuildingMap2.Initialize();
1511
1512 CFrameAttr map_attr;
1513
1514 CFrameVu1 *map = LoadMDSFile(GetPackFile(read_buffer, "s4501.mds", 0), &MapDataBuffer, 2, 0, 0);
1515
1516 map_attr.fog_enable = true;
1517 map->SetAttr(map_attr, 1, 64);
1518 SetFrameAttr(map, 1);
1519
1520 CMapObject *object = OP_GroundMap.SetObject(map, 0, 0);
1521
1522 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
1523 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
1524 object->FrameObjectOnOff("door2", 0);
1525
1526 PathDataBuffer.Reset();
1527 SceneNp = -1;
1528
1529 char *campath[4] = {"rm08cam.cfg", "rm09cam.cfg"};
1530
1531 for (int k = 0; k < 2; k++) {
1532 Cam[k].LoadPackData(read_buffer, campath[k], &PathDataBuffer, 0);
1533 Cam[k].motion_type.state.time = 1.0f;
1534 Cam[k].motion_type.state.blend_step = 1.0f;
1535 Cam[k].motion_type.state.motion_no = 0;
1536 Cam[k].motion_type.state.playing_no = 0;
1537 Cam[k].motion_type.state.camera = &MainCamera__3;
1538 }
1539
1540 OP_FireList = 0;
1541 OP_AnimeSeqRot = 0;
1542 OPAnalyz("sim:rmdat/rmdat5.cfg");
1543 OPMdsLoad();
1544}
1545
1546void DrawProcE() {
1547 TexManager.ReloadTexture(Vif1Packet, 10);
1548 OP_GroundMap.Draw();
1549
1550 if (CScript.camera_start == 10 && Cam[SceneNp].motion_type.state.time >= 70.0f) {
1551 Chara__3[0].TexAnimeOn(3);
1552 }
1553
1554 TexManager.ReloadTexture(Vif1Packet, 23);
1555 CTexture *texture = TexManager.GetTexture("shadow_buff", -1);
1556
1557 MGBeginDrawShadow(*(sceGsTex0 *) &texture->tex0);
1558
1559 for (int i = 0; i < 9; i++) {
1560 if (CScript.obj[i].disp) {
1561 Chara__3[i].ShadowStep();
1562 Chara__3[i].DrawShadow();
1563 }
1564 }
1565
1566 MGEndDrawShadow(52);
1567
1568 for (int i = 0; i < 9; i++) {
1569 if (CScript.obj[i].disp) {
1570 TexManager.ReloadTexture(Vif1Packet, CharaTex[i]);
1571 Chara__3[i].TextureAnime(CharaTex[i]);
1572 Chara__3[i].Step();
1573 Chara__3[i].ClothStep(0);
1574 Chara__3[i].Draw();
1575 }
1576 }
1577}
1578
1587static void InitProcF() {
1588 LOADTEXTURE_INFO2 textures[] = {
1589 {"#blender#640#" HALF_BUFFER_HEIGHT_STR "#4", 0, 0},
1590 {"#frame_image#640#" HALF_BUFFER_HEIGHT_STR "#4", 22, 0},
1591 {"#shadow_buff#640#" HALF_BUFFER_HEIGHT_STR "#4", 23, 0},
1592 {0, 20, 0},
1593 {0, 10, 0},
1594 {0, 1, 0},
1595 {0, 1, 0},
1596 {0, 2, 0},
1597 {0, 3, 0},
1598 {0, 9, 0},
1599 {"", 0, 0}
1600 };
1601
1602#ifdef PAL
1603 switch (LanguageCode) {
1604 case LANG_JAPANESE:
1605 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1606 break;
1607 case LANG_ENGLISH_US:
1608 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1609 break;
1610 case LANG_ENGLISH_UK:
1611 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1612 break;
1613 case LANG_FRENCH:
1614 textures[3].name = (char *) GetPackFile(read_buffer, "start_f.img", 0);
1615 break;
1616 case LANG_GERMAN:
1617 textures[3].name = (char *) GetPackFile(read_buffer, "start_g.img", 0);
1618 break;
1619 case LANG_ITALIAN:
1620 textures[3].name = (char *) GetPackFile(read_buffer, "start_i.img", 0);
1621 break;
1622 case LANG_SPANISH:
1623 textures[3].name = (char *) GetPackFile(read_buffer, "start_s.img", 0);
1624 break;
1625 }
1626
1627#else
1628 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1629#endif
1630 textures[4].name = (char *) GetPackFile(read_buffer, "d02b01.img", 0);
1631 textures[5].name = (char *) GetPackFile(read_buffer, "c01d01.img", 0);
1632 textures[6].name = (char *) GetPackFile(read_buffer, "c01d01an.img", 0);
1633 textures[7].name = (char *) GetPackFile(read_buffer, "c14a01.img", 0);
1634 textures[8].name = (char *) GetPackFile(read_buffer, "rm11rock.img", 0);
1635 textures[9].name = (char *) GetPackFile(read_buffer, "c01w01.img", 0);
1636 TexManager.Initialize(16352);
1637 TexManager.LoadTextureBlock(-1, textures);
1638
1639 CharaTex[0] = 1;
1640 CharaTex[1] = 2;
1641 CharaTex[2] = 2;
1642 CharaTex[3] = 2;
1643 CharaTex[4] = 2;
1644 CharaTex[5] = 3;
1645 CharaTex[8] = 9;
1646
1647 char *chara[6] = {
1648 "rm10c01d.cfg", "rm10c14a.cfg", "rm10c14b.cfg",
1649 "rm10c14c.cfg", "rm10c14d.cfg", "rm11rock.cfg"};
1650
1651 CharaDataBuffer.Reset();
1652
1653 for (int i = 0; i < 30; i++) {
1654 TexAnimeDataMovie[i].Initialize();
1655 }
1656
1657 Chara__3[0].InitializeTexAnime(TexAnimeDataMovie, 30);
1658 Chara__3[0].LoadPackData(read_buffer, "c01d.cfg", &CharaDataBuffer, 0);
1659
1660 for (int j = 0; j < 6; j++) {
1661 Chara__3[j].LoadPackData(read_buffer, chara[j], &CharaDataBuffer, 0);
1662
1663 CFrameAttr attr;
1664
1665 attr.clip_enable = false;
1666 Chara__3[j].frame->SetAttr(attr, 1, 4);
1667 Chara__3[j].motion_type.state.time = 1.0f;
1668 Chara__3[j].motion_type.state.blend_step = 0.05f;
1669 Chara__3[j].motion_type.state.motion_no = 0;
1670 Chara__3[j].motion_type.state.playing_no = 0;
1671 }
1672
1673 Chara__3[0].TexAnimeOn(4);
1674 Chara__3[0].wind = (int) &Wind__4;
1675 Chara__3[8].LoadPackData(read_buffer, "c01w01.cfg", &CharaDataBuffer, 0);
1676 Chara__3[0].motion_type.state.time = 150.0f;
1677 Chara__3[1].motion_type.state.time = 135.0f;
1678 Chara__3[2].motion_type.state.time = 135.0f;
1679 Chara__3[3].motion_type.state.time = 135.0f;
1680 Chara__3[4].motion_type.state.time = 135.0f;
1681
1682 OP_FireList = 0;
1683 OP_AnimeSeqRot = 0;
1684 MapDataBuffer.Reset();
1685 OP_GroundMap.Initialize();
1686 OP_BuildingMap.Initialize();
1687 OP_BuildingMap2.Initialize();
1688
1689 CFrameAttr map_attr;
1690
1691 CFrameVu1 *map = LoadMDSFile(GetPackFile(read_buffer, "s4601.mds", 0), &MapDataBuffer, 2, 0, 0);
1692
1693 map_attr.fog_enable = true;
1694 map->SetAttr(map_attr, 1, 64);
1695 SetFrameAttr(map, 1);
1696
1697 CMapObject *object = OP_GroundMap.SetObject(map, 0, 0);
1698
1699 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
1700 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
1701
1702 map = LoadMDSFile(GetPackFile(read_buffer, "s4602.mds", 0), &MapDataBuffer, 2, 0, 0);
1703 map->SetAttr(map_attr, 1, 64);
1704 SetFrameAttr(map, 1);
1705 object = OP_BuildingMap.SetObject(map, 0, 0);
1706 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
1707 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
1708 object->FrameObjectOnOff("rock1", 0);
1709
1710 PathDataBuffer.Reset();
1711 SceneNp = -1;
1712
1713 char *campath[4] = {"rm10cam.cfg", "rm11cam.cfg"};
1714
1715 for (int k = 0; k < 2; k++) {
1716 Cam[k].LoadPackData(read_buffer, campath[k], &PathDataBuffer, 0);
1717 Cam[k].motion_type.state.time = 1.0f;
1718 Cam[k].motion_type.state.blend_step = 1.0f;
1719 Cam[k].motion_type.state.motion_no = 0;
1720 Cam[k].motion_type.state.playing_no = 0;
1721 Cam[k].motion_type.state.camera = &MainCamera__3;
1722 }
1723
1724 OP_FireList = 0;
1725 OP_AnimeSeqRot = 0;
1726 OPAnalyz("sim:rmdat/rmdat6.cfg");
1727 OPMdsLoad();
1728}
1729
1730void DrawProcF() {
1731 TexManager.ReloadTexture(Vif1Packet, 10);
1732 OP_GroundMap.Draw();
1733 OP_BuildingMap.Draw();
1734
1735 if (CScript.obj[5].disp) {
1736 TexManager.ReloadTexture(Vif1Packet, CharaTex[5]);
1737 Chara__3[5].Step();
1738 Chara__3[5].Draw();
1739 }
1740
1741 TexManager.ReloadTexture(Vif1Packet, 23);
1742 CTexture *texture = TexManager.GetTexture("shadow_buff", -1);
1743
1744 MGBeginDrawShadow(*(sceGsTex0 *) &texture->tex0);
1745
1746 for (int i = 0; i < 9; i++) {
1747 if (i != 5) {
1748 if (CScript.obj[i].disp) {
1749 Chara__3[i].ShadowStep();
1750 Chara__3[i].DrawShadow();
1751 }
1752 }
1753 }
1754
1755 MGEndDrawShadow(52);
1756
1757 for (int i = 0; i < 9; i++) {
1758 if (CScript.obj[i].disp) {
1759 if (i != 5) {
1760 TexManager.ReloadTexture(Vif1Packet, CharaTex[i]);
1761 Chara__3[i].TextureAnime(CharaTex[i]);
1762 Chara__3[i].Step();
1763 Chara__3[i].ClothStep(0);
1764 Chara__3[i].Draw();
1765 }
1766 }
1767 }
1768
1769 TexManager.ReloadTexture(Vif1Packet, 22);
1770
1771 float dof[2] = {400.0f, 1000.0f};
1772
1773 DepthOfField(dof, 2, 32, 0);
1774}
1775
1784static void InitProcG() {
1785 LOADTEXTURE_INFO2 textures[] = {
1786 {"#blender#640#" HALF_BUFFER_HEIGHT_STR "#4", 0, 0},
1787 {"#frame_image#640#" HALF_BUFFER_HEIGHT_STR "#4", 22, 0},
1788 {"#shadow_buff#640#" HALF_BUFFER_HEIGHT_STR "#4", 23, 0},
1789 {0, 20, 0},
1790 {0, 10, 0},
1791 {0, 10, 0},
1792 {0, 10, 0},
1793 {0, 1, 0},
1794 {0, 2, 0},
1795 {0, 2, 0},
1796 {0, 2, 0},
1797 {"", 0, 0}
1798 };
1799
1800#ifdef PAL
1801 switch (LanguageCode) {
1802 case LANG_JAPANESE:
1803 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1804 break;
1805 case LANG_ENGLISH_US:
1806 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1807 break;
1808 case LANG_ENGLISH_UK:
1809 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1810 break;
1811 case LANG_FRENCH:
1812 textures[3].name = (char *) GetPackFile(read_buffer, "start_f.img", 0);
1813 break;
1814 case LANG_GERMAN:
1815 textures[3].name = (char *) GetPackFile(read_buffer, "start_g.img", 0);
1816 break;
1817 case LANG_ITALIAN:
1818 textures[3].name = (char *) GetPackFile(read_buffer, "start_i.img", 0);
1819 break;
1820 case LANG_SPANISH:
1821 textures[3].name = (char *) GetPackFile(read_buffer, "start_s.img", 0);
1822 break;
1823 }
1824
1825#else
1826 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1827#endif
1828 textures[4].name = (char *) GetPackFile(read_buffer, "s4701.img", 0);
1829 textures[5].name = (char *) GetPackFile(read_buffer, "e02s01.img", 0);
1830 textures[6].name = (char *) GetPackFile(read_buffer, "e02s06.img", 0);
1831 textures[7].name = (char *) GetPackFile(read_buffer, "c01d01.img", 0);
1832 textures[8].name = (char *) GetPackFile(read_buffer, "c06a01.img", 0);
1833 textures[9].name = (char *) GetPackFile(read_buffer, "c06a01an.img", 0);
1834 textures[10].name = (char *) GetPackFile(read_buffer, "c06w01.img", 0);
1835 TexManager.Initialize(16352);
1836 TexManager.LoadTextureBlock(-1, textures);
1837
1838 CharaTex[0] = 1;
1839 CharaTex[1] = 2;
1840 CharaTex[2] = 2;
1841
1842 char *chara[3] = {"rm14ebc01d.cfg", "rm14ebc06a.cfg", "rm13c06a.cfg"};
1843
1844 CharaDataBuffer.Reset();
1845 Chara__3[0].LoadPackData(read_buffer, "c01d.cfg", &CharaDataBuffer, 0);
1846
1847 for (int i = 0; i < 3; i++) {
1848 Chara__3[i].LoadPackData(read_buffer, chara[i], &CharaDataBuffer, 0);
1849
1850 CFrameAttr attr;
1851
1852 attr.clip_enable = false;
1853 Chara__3[i].frame->SetAttr(attr, 1, 4);
1854 Chara__3[i].motion_type.state.time = 1.0f;
1855 Chara__3[i].motion_type.state.blend_step = 0.05f;
1856 Chara__3[i].motion_type.state.motion_no = 0;
1857 Chara__3[i].motion_type.state.playing_no = 0;
1858 }
1859
1860 Chara__3[0].motion_type.state.time = 10.0f;
1861 Chara__3[1].motion_type.state.time = 10.0f;
1862 Chara__3[2].motion_type.state.time = 82.0f;
1863 Chara__3[0].wind = (int) &Wind__4;
1864 Chara__3[1].wind = (int) &Wind__4;
1865 Chara__3[2].wind = (int) &Wind__4;
1866
1867 OP_FireList = 0;
1868 OP_AnimeSeqRot = 0;
1869 MapDataBuffer.Reset();
1870 OP_GroundMap.Initialize();
1871 OP_BuildingMap.Initialize();
1872 OP_BuildingMap2.Initialize();
1873
1874 CFrameAttr map_attr;
1875
1876 CFrameVu1 *map = LoadMDSFile(GetPackFile(read_buffer, "s4701.mds", 0), &MapDataBuffer, 2, 0, 0);
1877
1878 map_attr.fog_enable = true;
1879 map->SetAttr(map_attr, 1, 64);
1880 SetFrameAttr(map, 1);
1881
1882 CMapObject *object = OP_GroundMap.SetObject(map, 0, 0);
1883
1884 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
1885 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
1886
1887 map = LoadMDSFile(GetPackFile(read_buffer, "e02s01_0.mds", 0), &MapDataBuffer, 2, 0, 0);
1888 map->SetAttr(map_attr, 1, 64);
1889 SetFrameAttr(map, 1);
1890 object = OP_BuildingMap.SetObject(map, 0, 0);
1891 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
1892 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
1893
1894 PathDataBuffer.Reset();
1895 SceneNp = -1;
1896
1897 char *campath[3] = {"rm12cam.cfg", "rm13cam.cfg", "rm14cam.cfg"};
1898
1899 for (int j = 0; j < 3; j++) {
1900 Cam[j].LoadPackData(read_buffer, campath[j], &PathDataBuffer, 0);
1901 Cam[j].motion_type.state.time = 1.0f;
1902 Cam[j].motion_type.state.blend_step = 1.0f;
1903 Cam[j].motion_type.state.motion_no = 0;
1904 Cam[j].motion_type.state.playing_no = 0;
1905 Cam[j].motion_type.state.camera = &MainCamera__3;
1906 }
1907
1908 OP_FireList = 0;
1909 OP_AnimeSeqRot = 0;
1910 OPAnalyz("sim:rmdat/rmdat7.cfg");
1911 OPMdsLoad();
1912}
1913
1914void DrawProcG() {
1915 TexManager.ReloadTexture(Vif1Packet, 10);
1916 OP_GroundMap.Draw();
1917 OP_BuildingMap.Draw();
1918
1919 TexManager.ReloadTexture(Vif1Packet, 23);
1920 CTexture *texture = TexManager.GetTexture("shadow_buff", -1);
1921
1922 MGBeginDrawShadow(*(sceGsTex0 *) &texture->tex0);
1923
1924 for (int i = 0; i < 9; i++) {
1925 if (CScript.obj[i].disp) {
1926 Chara__3[i].ShadowStep();
1927 Chara__3[i].DrawShadow();
1928 }
1929 }
1930
1931 MGEndDrawShadow(52);
1932
1933 for (int i = 0; i < 9; i++) {
1934 if (CScript.obj[i].disp) {
1935 TexManager.ReloadTexture(Vif1Packet, CharaTex[i]);
1936 Chara__3[i].Step();
1937 Chara__3[i].ClothStep(0);
1938 Chara__3[i].Draw();
1939 }
1940 }
1941
1942 TexManager.ReloadTexture(Vif1Packet, 22);
1943
1944 float dof[2] = {400.0f, 1000.0f};
1945
1946 DepthOfField(dof, 2, 32, 0);
1947}
1948
1957static void InitProcH() {
1958 LOADTEXTURE_INFO2 textures[] = {
1959 {"#blender#640#" HALF_BUFFER_HEIGHT_STR "#4", 0, 0},
1960 {"#frame_image#640#" HALF_BUFFER_HEIGHT_STR "#4", 22, 0},
1961 {"#shadow_buff#640#" HALF_BUFFER_HEIGHT_STR "#4", 23, 0},
1962 {0, 20, 0},
1963 {0, 0, 0},
1964 {0, 10, 0},
1965 {0, 1, 0},
1966 {0, 2, 0},
1967 {0, 3, 0},
1968 {0, 4, 0},
1969 {0, 9, 0},
1970 {"", 0, 0}
1971 };
1972
1973#ifdef PAL
1974 switch (LanguageCode) {
1975 case LANG_JAPANESE:
1976 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1977 break;
1978 case LANG_ENGLISH_US:
1979 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1980 break;
1981 case LANG_ENGLISH_UK:
1982 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
1983 break;
1984 case LANG_FRENCH:
1985 textures[3].name = (char *) GetPackFile(read_buffer, "start_f.img", 0);
1986 break;
1987 case LANG_GERMAN:
1988 textures[3].name = (char *) GetPackFile(read_buffer, "start_g.img", 0);
1989 break;
1990 case LANG_ITALIAN:
1991 textures[3].name = (char *) GetPackFile(read_buffer, "start_i.img", 0);
1992 break;
1993 case LANG_SPANISH:
1994 textures[3].name = (char *) GetPackFile(read_buffer, "start_s.img", 0);
1995 break;
1996 }
1997
1998#else
1999 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
2000#endif
2001 textures[4].name = (char *) GetPackFile(read_buffer, "fire.img", 0);
2002 textures[5].name = (char *) GetPackFile(read_buffer, "d01b01.img", 0);
2003 textures[6].name = (char *) GetPackFile(read_buffer, "c12a01.img", 0);
2004 textures[7].name = (char *) GetPackFile(read_buffer, "c01d01.img", 0);
2005 textures[8].name = (char *) GetPackFile(read_buffer, "f_boll_2.img", 0);
2006 textures[9].name = (char *) GetPackFile(read_buffer, "rm16yuka.img", 0);
2007 textures[10].name = (char *) GetPackFile(read_buffer, "c01w01.img", 0);
2008 TexManager.Initialize(16352);
2009 TexManager.LoadTextureBlock(-1, textures);
2010
2011 CharaTex[0] = 1;
2012 CharaTex[1] = 2;
2013 CharaTex[2] = 3;
2014 CharaTex[3] = 4;
2015 CharaTex[8] = 9;
2016
2017 Chara__3[0].LoadPackData(read_buffer, "rm15c12a.cfg", &CharaDataBuffer, 0);
2018
2019 CFrameAttr attr;
2020
2021 attr.clip_enable = false;
2022 Chara__3[0].frame->SetAttr(attr, 1, 4);
2023 Chara__3[0].motion_type.state.time = 10.0f;
2024 Chara__3[0].motion_type.state.blend_step = 0.05f;
2025 Chara__3[0].motion_type.state.motion_no = 0;
2026 Chara__3[0].motion_type.state.playing_no = 0;
2027 Chara__3[0].FootSoundEnable(0);
2028
2029 Chara__3[1].LoadPackData(read_buffer, "c01d.cfg", &CharaDataBuffer, 0);
2030 attr.clip_enable = false;
2031 Chara__3[1].frame->SetAttr(attr, 1, 4);
2032 Chara__3[1].motion_type.state.time = 70.0f;
2033 Chara__3[1].motion_type.state.blend_step = 0.05f;
2034 Chara__3[1].motion_type.state.motion_no = 0;
2035 Chara__3[1].motion_type.state.playing_no = 0;
2036
2037 Chara__3[2].LoadPackData(read_buffer, "f_boll_2.cfg", &CharaDataBuffer, 0);
2038 attr.clip_enable = false;
2039 Chara__3[2].frame->SetAttr(attr, 1, 4);
2040 Chara__3[2].motion_type.state.time = 20.0f;
2041 Chara__3[2].motion_type.state.blend_step = 0.05f;
2042 Chara__3[2].motion_type.state.motion_no = 0;
2043 Chara__3[2].motion_type.state.playing_no = 0;
2044
2045 Chara__3[3].LoadPackData(read_buffer, "rm16yuka.cfg", &CharaDataBuffer, 0);
2046 attr.clip_enable = false;
2047 Chara__3[3].frame->SetAttr(attr, 1, 4);
2048 Chara__3[3].motion_type.state.time = 2.0f;
2049 Chara__3[3].motion_type.state.blend_step = 0.05f;
2050 Chara__3[3].motion_type.state.motion_no = 0;
2051 Chara__3[3].motion_type.state.playing_no = 0;
2052
2053 Chara__3[8].LoadPackData(read_buffer, "c01w01.cfg", &CharaDataBuffer, 0);
2054 Chara__3[1].wind = (int) &Wind__4;
2055
2056 OP_FireList = 0;
2057 OP_AnimeSeqRot = 0;
2058 MapDataBuffer.Reset();
2059 OP_GroundMap.Initialize();
2060 OP_BuildingMap.Initialize();
2061 OP_BuildingMap2.Initialize();
2062
2063 CFrameAttr map_attr;
2064
2065 CFrameVu1 *map = LoadMDSFile(GetPackFile(read_buffer, "s4801.mds", 0), &MapDataBuffer, 2, 0, 0);
2066
2067 map_attr.fog_enable = true;
2068 map->SetAttr(map_attr, 1, 64);
2069 SetFrameAttr(map, 1);
2070
2071 CMapObject *object = OP_GroundMap.SetObject(map, 0, 0);
2072
2073 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
2074 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
2075
2076 map = LoadMDSFile(GetPackFile(read_buffer, "s4802.mds", 0), &MapDataBuffer, 2, 0, 0);
2077 map_attr.fog_enable = true;
2078 map->SetAttr(map_attr, 1, 64);
2079 SetFrameAttr(map, 1);
2080 object = OP_BuildingMap.SetObject(0, map, 0, 0);
2081 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
2082 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
2083
2084 map = LoadMDSFile(GetPackFile(read_buffer, "s4803.mds", 0), &MapDataBuffer, 2, 0, 0);
2085 map_attr.fog_enable = true;
2086 map->SetAttr(map_attr, 1, 64);
2087 SetFrameAttr(map, 1);
2088 object = OP_BuildingMap.SetObject(1, map, 0, 0);
2089 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
2090 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
2091
2092 map = LoadMDSFile(GetPackFile(read_buffer, "s4804.mds", 0), &MapDataBuffer, 2, 0, 0);
2093 map_attr.fog_enable = true;
2094 map->SetAttr(map_attr, 1, 64);
2095 SetFrameAttr(map, 1);
2096 object = OP_BuildingMap.SetObject(2, map, 0, 0);
2097 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
2098 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
2099
2100 map = LoadMDSFile(GetPackFile(read_buffer, "s4805.mds", 0), &MapDataBuffer, 2, 0, 0);
2101 map_attr.fog_enable = true;
2102 map->SetAttr(map_attr, 1, 64);
2103 SetFrameAttr(map, 1);
2104 object = OP_BuildingMap.SetObject(3, map, 0, 0);
2105 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
2106 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
2107
2108 map = LoadMDSFile(GetPackFile(read_buffer, "s4806.mds", 0), &MapDataBuffer, 2, 0, 0);
2109 map_attr.fog_enable = true;
2110 map->SetAttr(map_attr, 1, 64);
2111 SetFrameAttr(map, 1);
2112 object = OP_BuildingMap.SetObject(4, map, 0, 0);
2113 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
2114 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
2115
2116 PathDataBuffer.Reset();
2117 SceneNp = -1;
2118
2119 char *campath[2] = {"rm15cam.cfg", "rm16cam.cfg"};
2120
2121 for (int i = 0; i < 2; i++) {
2122 Cam[i].LoadPackData(read_buffer, campath[i], &PathDataBuffer, 0);
2123 Cam[i].motion_type.state.time = 1.0f;
2124 Cam[i].motion_type.state.blend_step = 1.0f;
2125 Cam[i].motion_type.state.motion_no = 0;
2126 Cam[i].motion_type.state.playing_no = 0;
2127 Cam[i].motion_type.state.camera = &MainCamera__3;
2128 }
2129
2130 OP_FireList = 0;
2131 OP_AnimeSeqRot = 0;
2132 OPAnalyz("sim:rmdat/rmdat8.cfg");
2133 OPMdsLoad();
2134}
2135
2136void DrawProcH() {
2137 TexManager.ReloadTexture(Vif1Packet, 10);
2138 OP_GroundMap.Draw();
2139 OP_BuildingMap.Draw();
2140
2141 if (CScript.obj[3].disp) {
2142 TexManager.ReloadTexture(Vif1Packet, CharaTex[3]);
2143 Chara__3[3].Step();
2144 Chara__3[3].ClothStep(0);
2145 Chara__3[3].Draw();
2146 }
2147
2148 TexManager.ReloadTexture(Vif1Packet, 23);
2149 CTexture *texture = TexManager.GetTexture("shadow_buff", -1);
2150
2151 MGBeginDrawShadow(*(sceGsTex0 *) &texture->tex0);
2152
2153 for (int i = 0; i < 9; i++) {
2154 if (CScript.obj[i].disp) {
2155 Chara__3[i].ShadowStep();
2156 Chara__3[i].DrawShadow();
2157 }
2158 }
2159
2160 MGEndDrawShadow(52);
2161
2162 for (int i = 0; i < 9; i++) {
2163 if (i != 3 && CScript.obj[i].disp) {
2164 TexManager.ReloadTexture(Vif1Packet, CharaTex[i]);
2165 Chara__3[i].Step();
2166 Chara__3[i].ClothStep(0);
2167 Chara__3[i].Draw();
2168 }
2169 }
2170
2171 sceVu0FVECTOR eye;
2172
2173 TexManager.ReloadTexture(GetVif1Packet(), 0);
2174 OP_CharaFrame = Cam[SceneNp].frame;
2175 sceVu0CopyVector(eye, OP_CharaFrame->position);
2176
2177 CFire__4.FireStep();
2178 CFire__4.FireCreate();
2179
2180 for (int i = 0; i < OP_FireList; i++) {
2181 float z = OP_FirePosition[i][2] / 10.0f;
2182 float y = OP_FirePosition[i][1] / 10.0f;
2183 float x = OP_FirePosition[i][0] / 10.0f;
2184
2185 CFire__4.position[0] = 10.0f * x;
2186 CFire__4.position[1] = 10.0f * y;
2187 CFire__4.position[2] = 10.0f * z;
2188 CFire__4.position[3] = 1.0f;
2189
2190 CFire__4.DrawFire(1, 1, &MainCamera__3, eye, OP_FireScale[i], 3, 15.0f);
2191 }
2192
2193 TexManager.ReloadTexture(Vif1Packet, 22);
2194
2195 float dof[2] = {400.0f, 1000.0f};
2196
2197 DepthOfField(dof, 2, 32, 0);
2198}
2199
2208static void InitProcI() {
2209 LOADTEXTURE_INFO2 textures[] = {
2210 {"#blender#640#" HALF_BUFFER_HEIGHT_STR "#4", 0, 0},
2211 {"#frame_image#640#" HALF_BUFFER_HEIGHT_STR "#4", 22, 0},
2212 {"#shadow_buff#640#" HALF_BUFFER_HEIGHT_STR "#4", 23, 0},
2213 {0, 20, 0},
2214 {0, 3, 0},
2215 {0, 10, 0},
2216 {0, 10, 0},
2217 {0, 1, 0},
2218 {0, 2, 0},
2219 {"", 0, 0}
2220 };
2221
2222#ifdef PAL
2223 switch (LanguageCode) {
2224 case LANG_JAPANESE:
2225 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
2226 break;
2227 case LANG_ENGLISH_US:
2228 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
2229 break;
2230 case LANG_ENGLISH_UK:
2231 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
2232 break;
2233 case LANG_FRENCH:
2234 textures[3].name = (char *) GetPackFile(read_buffer, "start_f.img", 0);
2235 break;
2236 case LANG_GERMAN:
2237 textures[3].name = (char *) GetPackFile(read_buffer, "start_g.img", 0);
2238 break;
2239 case LANG_ITALIAN:
2240 textures[3].name = (char *) GetPackFile(read_buffer, "start_i.img", 0);
2241 break;
2242 case LANG_SPANISH:
2243 textures[3].name = (char *) GetPackFile(read_buffer, "start_s.img", 0);
2244 break;
2245 }
2246
2247#else
2248 textures[3].name = (char *) GetPackFile(read_buffer, "start.img", 0);
2249#endif
2250 textures[4].name = (char *) GetPackFile(read_buffer, "e305ex2.img", 0);
2251 textures[5].name = (char *) GetPackFile(read_buffer, "s1202.img", 0);
2252 textures[6].name = (char *) GetPackFile(read_buffer, "s2401.img", 0);
2253 textures[7].name = (char *) GetPackFile(read_buffer, "c01d01.img", 0);
2254 textures[8].name = (char *) GetPackFile(read_buffer, "m18ashiba.img", 0);
2255 TexManager.Initialize(16352);
2256 TexManager.LoadTextureBlock(-1, textures);
2257
2258 CharaTex[0] = 1;
2259 CharaTex[1] = 2;
2260 CharaTex[2] = 3;
2261
2262 char *chara[3] = {"rm18c01d.cfg", "rm18ashiba.cfg", "info2.cfg"};
2263
2264 CharaDataBuffer.Reset();
2265 Chara__3[0].LoadPackData(read_buffer, "c01d.cfg", &CharaDataBuffer, 0);
2266
2267 for (int i = 0; i < 3; i++) {
2268 Chara__3[i].LoadPackData(read_buffer, chara[i], &CharaDataBuffer, 0);
2269
2270 CFrameAttr attr;
2271
2272 attr.clip_enable = false;
2273 Chara__3[i].frame->SetAttr(attr, 1, 4);
2274 Chara__3[i].motion_type.state.time = 1.0f;
2275 Chara__3[i].motion_type.state.blend_step = 0.05f;
2276 Chara__3[i].motion_type.state.motion_no = 0;
2277 Chara__3[i].motion_type.state.playing_no = 0;
2278 }
2279
2280 Chara__3[1].motion_type.state.time = 23.0f;
2281 Chara__3[0].wind = (int) &Wind__4;
2282 Chara__3[2].SetScale(20.0f, 20.0f, 20.0f);
2283
2284 OP_FireList = 0;
2285 OP_AnimeSeqRot = 0;
2286 MapDataBuffer.Reset();
2287 OP_GroundMap.Initialize();
2288 OP_BuildingMap.Initialize();
2289 OP_BuildingMap2.Initialize();
2290
2291 CFrameAttr map_attr;
2292
2293 CFrameVu1 *map = LoadMDSFile(GetPackFile(read_buffer, "s24g01_0.mds", 0), &MapDataBuffer, 2, 0, 0);
2294
2295 map_attr.fog_enable = true;
2296 map->SetAttr(map_attr, 1, 64);
2297 SetFrameAttr(map, 1);
2298
2299 CMapObject *object = OP_GroundMap.SetObject(map, 0, 0);
2300
2301 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
2302 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
2303
2304 map = LoadMDSFile(GetPackFile(read_buffer, "s24g02_0.mds", 0), &MapDataBuffer, 2, 0, 0);
2305 map_attr.fog_enable = true;
2306 map->SetAttr(map_attr, 1, 64);
2307 SetFrameAttr(map, 1);
2308 object = OP_BuildingMap.SetObject(0, map, 0, 0);
2309 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
2310 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
2311
2312 map = LoadMDSFile(GetPackFile(read_buffer, "s24g03_0.mds", 0), &MapDataBuffer, 2, 0, 0);
2313 map_attr.fog_enable = true;
2314 map->SetAttr(map_attr, 1, 64);
2315 SetFrameAttr(map, 1);
2316 object = OP_BuildingMap.SetObject(1, map, 0, 0);
2317 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
2318 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
2319
2320 map = LoadMDSFile(GetPackFile(read_buffer, "ship.mds", 0), &MapDataBuffer, 2, 0, 0);
2321 map_attr.fog_enable = true;
2322 map->SetAttr(map_attr, 1, 64);
2323 SetFrameAttr(map, 1);
2324 object = OP_BuildingMap.SetObject(2, map, 0, 0);
2325 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
2326 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
2327
2328 map = LoadMDSFile(GetPackFile(read_buffer, "s24g04_0.mds", 0), &MapDataBuffer, 2, 0, 0);
2329 map_attr.fog_enable = true;
2330 map->SetAttr(map_attr, 1, 64);
2331 SetFrameAttr(map, 1);
2332 object = OP_BuildingMap2.SetObject(0, map, 0, 0);
2333 object->SetPosition(CVector3_f_(0.0f, 0.0f, 0.0f));
2334 object->SetRotation(CVector3_f_(0.0f, 0.0f, 0.0f));
2335
2336 PathDataBuffer.Reset();
2337 SceneNp = -1;
2338
2339 char *campath[4] = {"rm17cam.cfg", "rm18cam.cfg"};
2340
2341 for (int j = 0; j < 2; j++) {
2342 Cam[j].LoadPackData(read_buffer, campath[j], &PathDataBuffer, 0);
2343 Cam[j].motion_type.state.time = 1.0f;
2344 Cam[j].motion_type.state.blend_step = 1.0f;
2345 Cam[j].motion_type.state.motion_no = 0;
2346 Cam[j].motion_type.state.playing_no = 0;
2347 Cam[j].motion_type.state.camera = &MainCamera__3;
2348 }
2349
2350 OP_FireList = 0;
2351 OP_AnimeSeqRot = 0;
2352 OPAnalyz("sim:rmdat/rmdat9.cfg");
2353 OPMdsLoad();
2354}
2355
2356void DrawProcI() {
2357 TexManager.ReloadTexture(Vif1Packet, 10);
2358 OP_GroundMap.Draw();
2359 OP_BuildingMap.Draw();
2360
2361 if (CScript.camera_start == 18) {
2362 OP_BuildingMap2.Draw();
2363 }
2364
2365 if (CScript.obj[1].disp) {
2366 TexManager.ReloadTexture(Vif1Packet, CharaTex[1]);
2367 Chara__3[1].Step();
2368 Chara__3[1].Draw();
2369 }
2370
2371 if (CScript.obj[2].disp) {
2372 TexManager.ReloadTexture(Vif1Packet, CharaTex[2]);
2373 Chara__3[2].Step();
2374 Chara__3[2].Draw();
2375 }
2376
2377 if (CScript.obj[0].disp) {
2378 sceVu0FMATRIX save_light;
2379 sceVu0FMATRIX save_lightcolor;
2380
2381 sceVu0CopyMatrix(save_light, light);
2382 sceVu0CopyMatrix(save_lightcolor, lightcolor);
2383 light[1][0] = 1.3f;
2384 MGSetPLight(light, lightcolor);
2385
2386 TexManager.ReloadTexture(Vif1Packet, 23);
2387 CTexture *texture = TexManager.GetTexture("shadow_buff", -1);
2388
2389 MGBeginDrawShadow(*(sceGsTex0 *) &texture->tex0);
2390 Chara__3[0].ShadowStep();
2391 Chara__3[0].DrawShadow();
2392 MGEndDrawShadow(52);
2393
2394 sceVu0CopyMatrix(light, save_light);
2395 sceVu0CopyMatrix(lightcolor, save_lightcolor);
2396 MGSetPLight(light, lightcolor);
2397
2398 TexManager.ReloadTexture(Vif1Packet, CharaTex[0]);
2399 Chara__3[0].Step();
2400 Chara__3[0].ClothStep(0);
2401 Chara__3[0].Draw();
2402 }
2403
2404 TexManager.ReloadTexture(Vif1Packet, 22);
2405
2406 float dof[2] = {400.0f, 1000.0f};
2407
2408 DepthOfField(dof, 2, 32, 0);
2409}
2410
2419static void InitProcTitle() {
2420 LOADTEXTURE_INFO2 textures[] = {
2421 {"#blender#640#" HALF_BUFFER_HEIGHT_STR "#4", 0, 0},
2422 {"#frame_image#640#" HALF_BUFFER_HEIGHT_STR "#4", 22, 0},
2423 {"#shadow_buff#640#" HALF_BUFFER_HEIGHT_STR "#4", 23, 0},
2424 {0, 1, 0},
2425 {"", 0, 0}
2426 };
2427
2428 textures[3].name = (char *) GetPackFile(read_buffer, "title.img", 0);
2429 TexManager.Initialize(16352);
2430 TexManager.LoadTextureBlock(-1, textures);
2431}
2432
2433void DrawProcTitle() {
2434 TexManager.ReloadTexture(Vif1Packet, 1);
2435
2436 set2DSprite(GetVif1Packet(), TexManager.GetTexture("bg01", -1), CRect<int>(320, 224, 768, 768), CRect<int>(0, 0, 768, 768), 384, 384, TitleAngle);
2437 TitleAngle -= 0.0005f;
2438
2439 set2DSprite(GetVif1Packet(), TexManager.GetTexture("dc01", -1), CRect<int>(0, 80, 288, 160), CRect<int>(0, 0, 288, 160), 128);
2440 set2DSprite(GetVif1Packet(), TexManager.GetTexture("dc01", -1), CRect<int>(288, 129, 352, 160), CRect<int>(288, 49, 352, 160), 128);
2441 set2DSprite(GetVif1Packet(), TexManager.GetTexture("dc01", -1), CRect<int>(0, 366, 640, 48), CRect<int>(0, 208, 640, 48), TitleFade);
2442
2443 TitleFadeCnt++;
2444
2445 if (TitleFadeCnt >= 60) {
2446 TitleFade++;
2447
2448 if (TitleFade >= 128) {
2449 TitleFade = 128;
2450 }
2451 }
2452
2453 TexManager.ReloadTexture(Vif1Packet, 22);
2454
2455 float dof[3] = {1000.0f, 2000.0f, 3000.0f};
2456 DepthOfField(dof, 3, 32, 0);
2457}
2458
2459static void TitleSetCamera(float x, float y, float z, float dist, float height) {
2460 int i = 1;
2461 int j = 2;
2462 int k = 3;
2463 int l = 4;
2464
2465 TitleCameraWork[0] = 0.0f;
2466}
void GetPos(float *pos)
Definition camera.cpp:230
void TexAnimeOn(int no)
CFrame * frame
virtual void LoadPackData(unsigned int *pack, char *name, CDataAlloc2< 1 > *model_alloc, CDataAlloc2< 1 > *texture_alloc)
virtual void SetScale(float x, float y, float z)
void InitializeTexAnime(CTexAnimeData *data, int count)
virtual void Step()
virtual void ShadowStep()
tagMOTION_TYPE motion_type
void FootSoundEnable(int on)
void TextureAnime(int step)
virtual void DrawShadow()
virtual void Draw()
virtual void ClothStep(int step)
float y
Definition cursol.hpp:24
CTexture * core
Definition op_a.cpp:110
s32 texture_set
Definition op_a.cpp:109
sceVu0FVECTOR position
Definition op_c.cpp:109
CTexture * glow
Definition op_a.cpp:111
char clip_enable
Definition frame.hpp:29
char fog_enable
Definition frame.hpp:33
sceVu0FMATRIX local
Definition frame.hpp:74
sceVu0FVECTOR position
Definition frame.hpp:76
Definition logo.hpp:10
CFrameVu1 * collision_frame
Definition op_b.cpp:90
int handle
Definition op_b.cpp:96
int category_no
Definition title.cpp:134
CFrameVu1 * shade_frame
Definition op_b.cpp:92
CFrameVu1 * camera_frame
Definition op_b.cpp:93
Definition op_a.cpp:90
s32 rotation_changed
Definition op_b.cpp:77
CFrameVu1 * frame[4]
Definition op_b.cpp:76
s32 draw_on
Definition op_b.cpp:78
virtual void SetPosition(CVector3_f_ position)
Definition object.cpp:38
Definition op_a.cpp:55
T h
Definition op_a.cpp:60
T y
Definition op_a.cpp:58
T x
Definition op_a.cpp:57
T w
Definition op_a.cpp:59
void Lighting(int on)
void Step()
void Set(float *position)
void Draw()
SCRIPT_OBJ obj[23]
Definition script.hpp:149
int load_no
Definition script.hpp:143
int camera_start
Definition script.hpp:135
int init_no
Definition script.hpp:144
u_long tex0
Definition texture.hpp:57
CFrameVu1 frame
Definition op_c.cpp:151
sceVu0FVECTOR end_value
Definition op_a.cpp:203
float step_y
Definition op_a.cpp:205
int anim_type
Definition op_c.cpp:169
void Initialize()
Definition objanime.cpp:33
char name[16]
Definition op_a.cpp:198
sceVu0FVECTOR start_value
Definition op_a.cpp:202
int play_mode
Definition op_c.cpp:170
float step_z
Definition op_a.cpp:206
float step_x
Definition op_a.cpp:204
float rotation
Definition rushmovi.cpp:211
char * name
Definition rushmovi.cpp:209
float position[3]
Definition rushmovi.cpp:210
CCamera * camera
Definition gameutil.hpp:196
float blend_step
Definition gameutil.hpp:190
Definition title.cpp:61
int w
Definition title.cpp:64
int h
Definition title.cpp:65
int y
Definition title.cpp:63
int x
Definition title.cpp:62
MOTION_STATE state
Definition gameutil.hpp:273