Puppylights

This commit is contained in:
Fazana committed 2021-09-07 12:13:40 +01:00
1 parent 2d58bddd06
commit 2a78404ef5
16 files changed
+505 -36

No files matched your search

+2
View File
@@ -127,6 +127,8 @@
//#define VISUAL_DEBUG
// Number of supported areas per level.
#define AREA_COUNT 8
// Lightweight directional lighting engine by Fazana. Intended for giving proximity and positional pointlights to small objects.
#define PUPPYLIGHTS
// BUG/GAME QOL FIXES
// Fix instant warp offset not working when warping across different areas
+1
View File
@@ -5,6 +5,7 @@
#include "level_table.h"
#include "config.h"
#include "game/puppylights.h"
#define OP_AND 0
#define OP_NAND 1
+3 -2
View File
@@ -47,6 +47,7 @@
#ifdef AUTO_COLLISION_DISTANCE
#define OBJ_FLAG_DONT_CALC_COLL_DIST (1 << 16) // 0x00010000
#endif
#define OBJ_FLAG_EMIT_LIGHT (1 << 17) // 0x00020000
#define OBJ_FLAG_HITBOX_WAS_SET (1 << 30) // 0x40000000
/* oHeldState */
@@ -283,7 +284,7 @@
#define BOWSER_SUB_ACT_HIT_MINE_START 0
#define BOWSER_SUB_ACT_HIT_MINE_FALL 1
#define BOWSER_SUB_ACT_HIT_MINE_STOP 2
#define BOWSER_SUB_ACT_JUMP_ON_STAGE_IDLE 0
#define BOWSER_SUB_ACT_JUMP_ON_STAGE_START 1
#define BOWSER_SUB_ACT_JUMP_ON_STAGE_LAND 2
@@ -299,7 +300,7 @@
/* oAction */
#define FISH_SPAWNER_ACT_SPAWN 0
#define FISH_SPAWNER_ACT_IDLE 1
#define FISH_SPAWNER_ACT_RESPAWN 2
#define FISH_SPAWNER_ACT_RESPAWN 2
/* oBehParams2ndByte */
#define FISH_SPAWNER_BP_MANY_BLUE 0
#define FISH_SPAWNER_BP_FEW_BLUE 1
+3
View File
@@ -134,6 +134,9 @@
#define /*0x1BC*/ oAngleToHome OBJECT_FIELD_S32(0x4D)
#define /*0x1C0*/ oFloor OBJECT_FIELD_SURFACE(0x4E)
#define /*0x1C4*/ oDeathSound OBJECT_FIELD_S32(0x4F)
#ifdef PUPPYLIGHTS
#define /*0x1C4*/ oLightID OBJECT_FIELD_S32(0x50)
#endif
/* Pathed (see obj_follow_path) */
#define /*0x0FC*/ oPathedStartWaypoint OBJECT_FIELD_WAYPOINT(0x1D)
+38 -22
View File
@@ -147,9 +147,22 @@ struct ObjectNode
struct ObjectNode *prev;
};
#ifdef PUPPYLIGHTS
struct PuppyLight {
Vec3t pos[2]; //The location of the light. First index is the absolute position, second index are offsets.
s16 yaw; //Used by cubes. Allows epic rotating of the volume.
s8 epicentre; //What percentage inside the volume you'll be before maximum light strength is applied. (E.g: 100 will be full strength always, and 0 will be full strength at the centre.)
u8 flags; //Some stuff to define how the volume is used. Mostly just shape stuff, but can potentially have other uses.
u8 rgba[4]; //Colour. Go on, take even the tiniest guess as to what this entails.
u8 active:1; //Whether the light will actually work. Mostly intended to be used for objects.
};
#endif
// NOTE: Since ObjectNode is the first member of Object, it is difficult to determine
// whether some of these pointers point to ObjectNode or Object.
#define MAX_OBJECT_FIELDS 0x51
struct Object
{
/*0x000*/ struct ObjectNode header;
@@ -163,33 +176,33 @@ struct Object
union
{
// Object fields. See object_fields.h.
u32 asU32[0x50];
s32 asS32[0x50];
s16 asS16[0x50][2];
f32 asF32[0x50];
u32 asU32[MAX_OBJECT_FIELDS];
s32 asS32[MAX_OBJECT_FIELDS];
s16 asS16[MAX_OBJECT_FIELDS][2];
f32 asF32[MAX_OBJECT_FIELDS];
#if !IS_64_BIT
s16 *asS16P[0x50];
s32 *asS32P[0x50];
struct Animation **asAnims[0x50];
struct Waypoint *asWaypoint[0x50];
struct ChainSegment *asChainSegment[0x50];
struct Object *asObject[0x50];
struct Surface *asSurface[0x50];
void *asVoidPtr[0x50];
const void *asConstVoidPtr[0x50];
s16 *asS16P[MAX_OBJECT_FIELDS];
s32 *asS32P[MAX_OBJECT_FIELDS];
struct Animation **asAnims[MAX_OBJECT_FIELDS];
struct Waypoint *asWaypoint[MAX_OBJECT_FIELDS];
struct ChainSegment *asChainSegment[MAX_OBJECT_FIELDS];
struct Object *asObject[MAX_OBJECT_FIELDS];
struct Surface *asSurface[MAX_OBJECT_FIELDS];
void *asVoidPtr[MAX_OBJECT_FIELDS];
const void *asConstVoidPtr[MAX_OBJECT_FIELDS];
#endif
} rawData;
#if IS_64_BIT
union {
s16 *asS16P[0x50];
s32 *asS32P[0x50];
struct Animation **asAnims[0x50];
struct Waypoint *asWaypoint[0x50];
struct ChainSegment *asChainSegment[0x50];
struct Object *asObject[0x50];
struct Surface *asSurface[0x50];
void *asVoidPtr[0x50];
const void *asConstVoidPtr[0x50];
s16 *asS16P[MAX_OBJECT_FIELDS];
s32 *asS32P[MAX_OBJECT_FIELDS];
struct Animation **asAnims[MAX_OBJECT_FIELDS];
struct Waypoint *asWaypoint[MAX_OBJECT_FIELDS];
struct ChainSegment *asChainSegment[MAX_OBJECT_FIELDS];
struct Object *asObject[MAX_OBJECT_FIELDS];
struct Surface *asSurface[MAX_OBJECT_FIELDS];
void *asVoidPtr[MAX_OBJECT_FIELDS];
const void *asConstVoidPtr[MAX_OBJECT_FIELDS];
} ptrData;
#endif
/*0x1C8*/ u32 unused1;
@@ -209,6 +222,9 @@ struct Object
/*0x218*/ void *collisionData;
/*0x21C*/ Mat4 transform;
/*0x25C*/ void *respawnInfo;
#ifdef PUPPYLIGHTS
struct PuppyLight puppylight;
#endif
};
struct ObjectHitbox