Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,035 changes: 2,017 additions & 2,018 deletions dwarf/SB04_Multi_Sku/Engine/Game/zSmoke.cpp

Large diffs are not rendered by default.

8,306 changes: 4,148 additions & 4,158 deletions dwarf/SB04_Multi_Sku/Engine/Game/zWad2.cpp

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions include/rwsdk/rwplcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,11 @@ extern RwBool RwEngineTerm(void);
extern RwBool RwEngineInit(const RwMemoryFunctions* memFuncs, RwUInt32 initFlags,
RwUInt32 resArenaSize);

extern void RwGameCubeSetAlphaCompare(RwInt32 comp0, RwUInt8 ref0, RwInt32 op, RwInt32 comp1,
RwUInt8 ref1);

extern void _rwDlRenderStateSetZCompLoc(RwBool zBeforeTex);

#ifdef __cplusplus
}
#endif
Expand Down
9 changes: 9 additions & 0 deletions src/SB/Core/gc/iSnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ enum iSndGroupHandle
{
};

// enum eSNDCurrentPlayer
// {
// eCurrentPlayerSpongeBob,
// eCurrentPlayerPatrick,
// eCurrentPlayerCar,
// eCurrentPlayerSpongePat,
// eCurrentPlayerCount
// };

void arq_callback(long);
void iSndExit();

Expand Down
4 changes: 2 additions & 2 deletions src/SB/Core/x/xBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ typedef S32 (*xBaseEventCB)(xBase*, xBase*, U32, const F32*, xBase*);
struct xBase
{
U32 id;
U8 baseType; // see en_ZBASETYPE in zBase.h
U8 baseType;
U8 linkCount;
U16 baseFlags;
xLinkAsset* link;
xBaseEventCB eventFunc; // 0xC
void (*eventFunc)(xBase*, xBase*, U32, F32*, xBase*, U32);
};

void xBaseInit(xBase* xb, xBaseAsset* asset);
Expand Down
61 changes: 22 additions & 39 deletions src/SB/Core/x/xEnt.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,63 +125,46 @@ struct xEnt : xBase
xVec3* normals;
};

// Offset: 0x10
xEntAsset* asset;
U16 idx; //0x14
U16 num_updates;

// Offset: 0x18
U16 idx;
U8 flags;
U8 miscflags;
U8 subType;

// Offset: 0x1B
U8 pflags; // p -> physics flags
U8 moreFlags; //0x1c
U8 isCulled;
U8 pflags;
U16 moreFlags;
struct
{
U8 _isCulled : 2;
U8 collisionEventReceived : 2;
};
U8 driving_count;
U8 num_ffx;

// Offset: 0x20
U8 collType; // XENT_COLLTYPE_* (defined below)
U8 collType;
U8 collLev;
U8 chkby; // XENT_COLLTYPE_* bitmask
U8 penby; // XENT_COLLTYPE_* bitmask

// Offset: 0x24
U8 chkby;
U8 penby;
void (*visUpdate)(xEnt*);
xModelInstance* model;
xModelInstance* collModel;
xModelInstance* camcollModel;
xLightKit* lightKit;

// Offset: 0x34
xEntUpdateCallback update;
xEntUpdateCallback endUpdate;
xEntBoundUpdateCallback bupdate;
xEntMoveCallback move;

// Offset: 0x44
xEntRenderCallback render;
void (*update)(xEnt*, xScene*, F32);
void (*endUpdate)(xEnt*, xScene*, F32);
void (*bupdate)(xEnt*, xVec3*);
void (*move)(xEnt*, xScene*, F32, xEntFrame*);
void (*render)(xEnt*);
xEntFrame* frame;
xEntCollis* collis; //0x4c

// Offset: 0x50
xEntCollis* collis;
xGridBound gridb;

// Offset: 0x64
xBound bound;

// Offset: 0xB0
xEntTranslateCallback transl; //0xb0
xFFX* ffx; //0xb4
void (*transl)(xEnt*, xVec3*, xMat4x3*);
xFFX* ffx;
xEnt* driver;
xEnt* driven;
S32 driveMode;

// Offset: 0xC0
xShadowSimpleCache* simpShadow;
xEntShadow* entShadow;
anim_coll_data* anim_coll;
void* user_data; // 0xCC
void* user_data;
};

// collision types
Expand Down
40 changes: 40 additions & 0 deletions src/SB/Core/x/xFX.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,46 @@ struct xFXRibbon
void debug_update(F32);
};

struct xFRect
{
F32 x;
F32 y;
F32 w;
F32 h;
};

struct xFXCameraTexture
{
RwCamera* cam;
RwRaster* raster;
RwRaster* bgraster;
RpWorld* world;
RwTexture* texture;
U32 vert_buffer_used;
xColor_tag bgcolor;
RwCamera* oldcam;
RpWorld* oldworld;
F32 rcz;
F32 w;
F32 h;
RwRaster* zraster;
S32 max_tw;
S32 max_th;
F32 old_near_plane;
F32 old_far_plane;
F32 old_znear;

void zbuffer_map_and_clear(RwRaster* fraster, RwRaster* zraster, U32 fbmsk, S32 clear_flags);
// void get_subview(xMat4x3& ltm, xVec2& view_window, xVec2& view_offset, RwCamera* src_cam,
// xFRect& src_rect, xFRect& dst_rect);
void setup_subview(RwCamera* src_cam, xFRect& src_rect, xFRect& dst_rect);
void end_render();
void begin_render(S32 clear_flags, U32 fbmsk_write, U32 fbmsk_finish, F32 near_plane,
F32 far_plane);
void destroy();
U8 create(S32 w, S32 h, U8 need_zwrite, S32 bpp, S32 zbpp);
};

#define RING_COUNT 8

extern xFXRing ringlist[RING_COUNT];
Expand Down
70 changes: 70 additions & 0 deletions src/SB/Core/x/xFXHighDynamicRange.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#include "xFXHighDynamicRange.h"

// char buffer[16];
// char buffer[16];
// F32 scale;
U8 HDR_brightening;
// F32 overbrighten;
// F32 overbrighten_decay;
// S32 downsamples;
// U8 blur_faster;
// F32 colorize_red;
// F32 colorize_green;
// F32 colorize_blue;
// F32 colorize_alpha;
// U8 enabled;
// S32 background_glow_normal;
// S32 background_darken_normal;
// interpolator background_glow;
// interpolator background_darken;
// S32 saved_alpha_test;
// //<unknown fundamental type(0xa510)>* blur_packet[5];
// xVec2 diagonal_00_11_offsets[2];
// xVec2 diagonal_01_10_offsets[2];
// xVec2 square_offsets[4];
// downsample_pass_info downsample_passes_fast[5];
// downsample_pass_info downsample_passes_slow[5];
// xFXCameraTexture blurbuffer[5];
// RwRaster* backbuffer_raster;
// xFXCameraTexture downbuffer[5];
// S32 old_alpha_test;
// S32 our_alpha_test;
// S32 _rpPTankAtomicDataOffset;
// //<unknown fundamental type(0xa510)>* _rwDMAGateSlot;
// xColor_tag g_WHITE;
// U32 ourGlobals[4096];
// xColor_tag g_BLACK;
// xGlobals* xglobals;
// xColor_tag g_MAGENTA;
// U32 FB_YRES;
// U32 FB_XRES;

void xFXHighDynamicRangeResetGlowClamp()
{
S32 alpha_test;
}

void xFXHighDynamicRangeSetGlowClamp(S32 glow_min, bool dest_test)
{
S32 iVar1;

iVar1 = 0xff;
if (glow_min < 0xff)
{
iVar1 = glow_min;
}
if (iVar1 < 0)
{
iVar1 = 0;
}
else
{
iVar1 = 0xff;
if (glow_min < 0xff)
{
iVar1 = glow_min;
}
}
RwGameCubeSetAlphaCompare(7, 0, 1, 6, (char)iVar1);
_rwDlRenderStateSetZCompLoc(FALSE);
}
24 changes: 24 additions & 0 deletions src/SB/Core/x/xFXHighDynamicRange.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef XFXHIGHDYNAMICRANGE_H
#define XFXHIGHDYNAMICRANGE_H

#include "xFX.h"
#include "xGlobals.h"
#include "xModelBlur.h"
#include "xFX.h"

struct downsample_pass_info
{
xVec2* offset;
S32 resamples;
};

struct interpolator
{
F32 value;
F32 start;
F32 end;
F32 t;
F32 trate;
};

#endif
21 changes: 16 additions & 5 deletions src/SB/Core/x/xGlobals.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "iCamera.h"
#include "iTime.h"
#include "zScene.h"
#include "xEnt.h"
#include "zEnt.h"

#include <rwcore.h>
#include <rpworld.h>
Expand All @@ -26,10 +28,19 @@ enum sceDemoEndReason
SCE_DEMO_ENDREASON_NETCONFIG_COMPLETE
};

struct zPlayer
// struct zPlayer
// {
// // Why empty? (iFMV dwarf shows this)
// // Non-empty ones exist in the zWads
// };

struct zPlayer : zEnt
{
// Why empty? (iFMV dwarf shows this)
// Non-empty ones exist in the zWads
xVec3 trigLastFramePos;
S32 zPlayerFlags;
U32 lorezModelID;
xModelInstance* lorezModel;
xModelInstance* hirezModel;
};

struct PS2DemoGlobals
Expand Down Expand Up @@ -59,10 +70,10 @@ struct xGlobals
xCamGroup* cam;
xCamScreen* screen;
xVec4 frustplane[12];
_tagxPad* pad0;
_tagxPad* pad0; // 0x3e4
_tagxPad* pad1;
_tagxPad* pad2;
_tagxPad* pad3;
_tagxPad* pad3; // 0x3f0
_tagxPad* pad[4];
S32 profile;
char profFunc[128][6];
Expand Down
Loading