Skip to content

Commit d582f23

Browse files
committed
wip2
1 parent dee4dff commit d582f23

File tree

24 files changed

+7171
-6246
lines changed

24 files changed

+7171
-6246
lines changed

dwarf/SB04_Multi_Sku/Engine/Game/zSmoke.cpp

Lines changed: 2017 additions & 2018 deletions
Large diffs are not rendered by default.

dwarf/SB04_Multi_Sku/Engine/Game/zWad2.cpp

Lines changed: 4148 additions & 4158 deletions
Large diffs are not rendered by default.

include/rwsdk/rwplcore.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,11 @@ extern RwBool RwEngineTerm(void);
13701370
extern RwBool RwEngineInit(const RwMemoryFunctions* memFuncs, RwUInt32 initFlags,
13711371
RwUInt32 resArenaSize);
13721372

1373+
extern void RwGameCubeSetAlphaCompare(RwInt32 comp0, RwUInt8 ref0, RwInt32 op, RwInt32 comp1,
1374+
RwUInt8 ref1);
1375+
1376+
extern void _rwDlRenderStateSetZCompLoc(RwBool zBeforeTex);
1377+
13731378
#ifdef __cplusplus
13741379
}
13751380
#endif

src/SB/Core/x/xBase.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ typedef S32 (*xBaseEventCB)(xBase*, xBase*, U32, const F32*, xBase*);
2121
struct xBase
2222
{
2323
U32 id;
24-
U8 baseType; // see en_ZBASETYPE in zBase.h
24+
U8 baseType;
2525
U8 linkCount;
2626
U16 baseFlags;
2727
xLinkAsset* link;
28-
xBaseEventCB eventFunc; // 0xC
28+
void (*eventFunc)(xBase*, xBase*, U32, F32*, xBase*, U32);
2929
};
3030

3131
void xBaseInit(xBase* xb, xBaseAsset* asset);

src/SB/Core/x/xEnt.h

Lines changed: 22 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -125,63 +125,46 @@ struct xEnt : xBase
125125
xVec3* normals;
126126
};
127127

128-
// Offset: 0x10
129128
xEntAsset* asset;
130-
U16 idx; //0x14
131-
U16 num_updates;
132-
133-
// Offset: 0x18
129+
U16 idx;
134130
U8 flags;
135131
U8 miscflags;
136132
U8 subType;
137-
138-
// Offset: 0x1B
139-
U8 pflags; // p -> physics flags
140-
U8 moreFlags; //0x1c
141-
U8 isCulled;
133+
U8 pflags;
134+
U16 moreFlags;
135+
struct
136+
{
137+
U8 _isCulled : 2;
138+
U8 collisionEventReceived : 2;
139+
};
142140
U8 driving_count;
143141
U8 num_ffx;
144-
145-
// Offset: 0x20
146-
U8 collType; // XENT_COLLTYPE_* (defined below)
142+
U8 collType;
147143
U8 collLev;
148-
U8 chkby; // XENT_COLLTYPE_* bitmask
149-
U8 penby; // XENT_COLLTYPE_* bitmask
150-
151-
// Offset: 0x24
144+
U8 chkby;
145+
U8 penby;
146+
void (*visUpdate)(xEnt*);
152147
xModelInstance* model;
153148
xModelInstance* collModel;
154149
xModelInstance* camcollModel;
155-
xLightKit* lightKit;
156-
157-
// Offset: 0x34
158-
xEntUpdateCallback update;
159-
xEntUpdateCallback endUpdate;
160-
xEntBoundUpdateCallback bupdate;
161-
xEntMoveCallback move;
162-
163-
// Offset: 0x44
164-
xEntRenderCallback render;
150+
void (*update)(xEnt*, xScene*, F32);
151+
void (*endUpdate)(xEnt*, xScene*, F32);
152+
void (*bupdate)(xEnt*, xVec3*);
153+
void (*move)(xEnt*, xScene*, F32, xEntFrame*);
154+
void (*render)(xEnt*);
165155
xEntFrame* frame;
166-
xEntCollis* collis; //0x4c
167-
168-
// Offset: 0x50
156+
xEntCollis* collis;
169157
xGridBound gridb;
170-
171-
// Offset: 0x64
172158
xBound bound;
173-
174-
// Offset: 0xB0
175-
xEntTranslateCallback transl; //0xb0
176-
xFFX* ffx; //0xb4
159+
void (*transl)(xEnt*, xVec3*, xMat4x3*);
160+
xFFX* ffx;
177161
xEnt* driver;
162+
xEnt* driven;
178163
S32 driveMode;
179-
180-
// Offset: 0xC0
181164
xShadowSimpleCache* simpShadow;
182165
xEntShadow* entShadow;
183166
anim_coll_data* anim_coll;
184-
void* user_data; // 0xCC
167+
void* user_data;
185168
};
186169

187170
// collision types

src/SB/Core/x/xFX.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,46 @@ struct xFXRibbon
7979
void debug_update(F32);
8080
};
8181

82+
struct xFRect
83+
{
84+
F32 x;
85+
F32 y;
86+
F32 w;
87+
F32 h;
88+
};
89+
90+
struct xFXCameraTexture
91+
{
92+
RwCamera* cam;
93+
RwRaster* raster;
94+
RwRaster* bgraster;
95+
RpWorld* world;
96+
RwTexture* texture;
97+
U32 vert_buffer_used;
98+
xColor_tag bgcolor;
99+
RwCamera* oldcam;
100+
RpWorld* oldworld;
101+
F32 rcz;
102+
F32 w;
103+
F32 h;
104+
RwRaster* zraster;
105+
S32 max_tw;
106+
S32 max_th;
107+
F32 old_near_plane;
108+
F32 old_far_plane;
109+
F32 old_znear;
110+
111+
void zbuffer_map_and_clear(RwRaster* fraster, RwRaster* zraster, U32 fbmsk, S32 clear_flags);
112+
// void get_subview(xMat4x3& ltm, xVec2& view_window, xVec2& view_offset, RwCamera* src_cam,
113+
// xFRect& src_rect, xFRect& dst_rect);
114+
void setup_subview(RwCamera* src_cam, xFRect& src_rect, xFRect& dst_rect);
115+
void end_render();
116+
void begin_render(S32 clear_flags, U32 fbmsk_write, U32 fbmsk_finish, F32 near_plane,
117+
F32 far_plane);
118+
void destroy();
119+
U8 create(S32 w, S32 h, U8 need_zwrite, S32 bpp, S32 zbpp);
120+
};
121+
82122
#define RING_COUNT 8
83123

84124
extern xFXRing ringlist[RING_COUNT];
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#include "xFXHighDynamicRange.h"
2+
3+
// char buffer[16];
4+
// char buffer[16];
5+
// F32 scale;
6+
U8 HDR_brightening;
7+
// F32 overbrighten;
8+
// F32 overbrighten_decay;
9+
// S32 downsamples;
10+
// U8 blur_faster;
11+
// F32 colorize_red;
12+
// F32 colorize_green;
13+
// F32 colorize_blue;
14+
// F32 colorize_alpha;
15+
// U8 enabled;
16+
// S32 background_glow_normal;
17+
// S32 background_darken_normal;
18+
// interpolator background_glow;
19+
// interpolator background_darken;
20+
// S32 saved_alpha_test;
21+
// //<unknown fundamental type(0xa510)>* blur_packet[5];
22+
// xVec2 diagonal_00_11_offsets[2];
23+
// xVec2 diagonal_01_10_offsets[2];
24+
// xVec2 square_offsets[4];
25+
// downsample_pass_info downsample_passes_fast[5];
26+
// downsample_pass_info downsample_passes_slow[5];
27+
// xFXCameraTexture blurbuffer[5];
28+
// RwRaster* backbuffer_raster;
29+
// xFXCameraTexture downbuffer[5];
30+
// S32 old_alpha_test;
31+
// S32 our_alpha_test;
32+
// S32 _rpPTankAtomicDataOffset;
33+
// //<unknown fundamental type(0xa510)>* _rwDMAGateSlot;
34+
// xColor_tag g_WHITE;
35+
// U32 ourGlobals[4096];
36+
// xColor_tag g_BLACK;
37+
// xGlobals* xglobals;
38+
// xColor_tag g_MAGENTA;
39+
// U32 FB_YRES;
40+
// U32 FB_XRES;
41+
42+
void xFXHighDynamicRangeResetGlowClamp()
43+
{
44+
S32 alpha_test;
45+
}
46+
47+
void xFXHighDynamicRangeSetGlowClamp(S32 glow_min, bool dest_test)
48+
{
49+
S32 iVar1;
50+
51+
iVar1 = 0xff;
52+
if (glow_min < 0xff)
53+
{
54+
iVar1 = glow_min;
55+
}
56+
if (iVar1 < 0)
57+
{
58+
iVar1 = 0;
59+
}
60+
else
61+
{
62+
iVar1 = 0xff;
63+
if (glow_min < 0xff)
64+
{
65+
iVar1 = glow_min;
66+
}
67+
}
68+
RwGameCubeSetAlphaCompare(7, 0, 1, 6, (char)iVar1);
69+
_rwDlRenderStateSetZCompLoc(FALSE);
70+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#ifndef XFXHIGHDYNAMICRANGE_H
2+
#define XFXHIGHDYNAMICRANGE_H
3+
4+
#include "xFX.h"
5+
#include "xGlobals.h"
6+
#include "xModelBlur.h"
7+
#include "xFX.h"
8+
9+
struct downsample_pass_info
10+
{
11+
xVec2* offset;
12+
S32 resamples;
13+
};
14+
15+
struct interpolator
16+
{
17+
F32 value;
18+
F32 start;
19+
F32 end;
20+
F32 t;
21+
F32 trate;
22+
};
23+
24+
#endif

src/SB/Core/x/xGlobals.h

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include "iCamera.h"
88
#include "iTime.h"
99
#include "zScene.h"
10+
#include "xEnt.h"
11+
#include "zEnt.h"
1012

1113
#include <rwcore.h>
1214
#include <rpworld.h>
@@ -26,10 +28,19 @@ enum sceDemoEndReason
2628
SCE_DEMO_ENDREASON_NETCONFIG_COMPLETE
2729
};
2830

29-
struct zPlayer
31+
// struct zPlayer
32+
// {
33+
// // Why empty? (iFMV dwarf shows this)
34+
// // Non-empty ones exist in the zWads
35+
// };
36+
37+
struct zPlayer : zEnt
3038
{
31-
// Why empty? (iFMV dwarf shows this)
32-
// Non-empty ones exist in the zWads
39+
xVec3 trigLastFramePos;
40+
S32 zPlayerFlags;
41+
U32 lorezModelID;
42+
xModelInstance* lorezModel;
43+
xModelInstance* hirezModel;
3344
};
3445

3546
struct PS2DemoGlobals
@@ -59,10 +70,10 @@ struct xGlobals
5970
xCamGroup* cam;
6071
xCamScreen* screen;
6172
xVec4 frustplane[12];
62-
_tagxPad* pad0;
73+
_tagxPad* pad0; // 0x3e4
6374
_tagxPad* pad1;
6475
_tagxPad* pad2;
65-
_tagxPad* pad3;
76+
_tagxPad* pad3; // 0x3f0
6677
_tagxPad* pad[4];
6778
S32 profile;
6879
char profFunc[128][6];

0 commit comments

Comments
 (0)