forked from Sparagas/Silent-Hill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
inc_sh4_ps2_textures.bt
74 lines (67 loc) · 2.83 KB
/
inc_sh4_ps2_textures.bt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//------------------------------------------------
//--- 010 Editor v14.0 Binary Template
//
// File: inc_sh4_ps2_textures.bt
// Authors: Laurynas Zubavičius (Sparagas)
// Rodolfo Nuñez (roocker666)
// Purpose: Silent Hill 4: The Room (Sony - PlayStation 2)
// Category: Include file
//------------------------------------------------
void sh4_ps2_textures() {
struct Ps2ImgIdxDat(uint32 w, uint32 h, ubyte idx_fmt) {
if (idx_fmt == idx_8b_256)
ubyte idx_8b_256[w * h];
else if (idx_fmt == idx_4b_16)
ubyte idx_4b_16[w * h / 2];
};
FSeek(ofs_ps2_img_idx_hdr[0] + ps2_img_idx_hdr.ps2_img_idx_hdr[0].ofs);
struct {
local uint16 i;
for (i = 0; i < num_img_idx; i++) {
FSeek(ofs_ps2_img_idx_hdr[i] + ps2_img_idx_hdr.ps2_img_idx_hdr[i].ofs
);
Ps2ImgIdxDat ps2_img_idx_dat(ps2_img_idx_hdr.ps2_img_idx_hdr[i].w,
ps2_img_idx_hdr.ps2_img_idx_hdr[i].h,
ps2_img_idx_hdr.ps2_img_idx_hdr[i].idx_fmt);
}
} ps2_img_idx_dat;
struct Ps2ImgPalDat {
RGBA rgba1_pt1[8];
RGBA rgba2_pt1[8];
RGBA rgba1_pt2[8];
RGBA rgba2_pt2[8];
};
FSeek(ofs_ps2_img_pal_hdr[0] + ps2_img_pal_hdr.ps2_img_pal_hdr[0].ofs);
struct {
local uint16 i;
for (i = 0; i < num_img_idx; i++) {
FSeek(ofs_ps2_img_pal_hdr[i] + ps2_img_pal_hdr.ps2_img_pal_hdr[i].ofs);
struct {
local uint32 j;
for (j = 0; j < ps2_img_pal_hdr.ps2_img_pal_hdr[i].num_pal; j++) {
struct {
if (ps2_img_idx_hdr.ps2_img_idx_hdr[i].idx_fmt == idx_8b_256) {
Ps2ImgPalDat pal256_pt1;
Ps2ImgPalDat pal256_pt2;
Ps2ImgPalDat pal256_pt3;
Ps2ImgPalDat pal256_pt4;
Ps2ImgPalDat pal256_pt5;
Ps2ImgPalDat pal256_pt6;
Ps2ImgPalDat pal256_pt7;
Ps2ImgPalDat pal256_pt8;
} else if (ps2_img_idx_hdr.ps2_img_idx_hdr[i].idx_fmt == idx_4b_16) {
Ps2ImgPalDat pal16_00_and_01;
Ps2ImgPalDat pal16_02_and_03;
Ps2ImgPalDat pal16_04_and_05;
Ps2ImgPalDat pal16_06_and_07;
Ps2ImgPalDat pal16_08_and_09;
Ps2ImgPalDat pal16_10_and_11;
Ps2ImgPalDat pal16_12_and_13;
Ps2ImgPalDat pal16_14_and_15;
}
} ps2_img_pal_dat;
}
} ps2_img_dat;
}
} ps2_img_dat;
};