mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
name and document lights, CC modes and textures (#607)
This commit is contained in:
@@ -5,11 +5,11 @@ This repo contains a work-in-progress decompilation of Diddy Kong Racing for the
|
||||
All versions are supported, and the US 1.0 version (SHA1 = 0cb115d8716dbbc2922fda38e533b9fe63bb9670) of the game is the default if not specified.
|
||||
|
||||
<!-- README_SCORE_SUMMARY_BEGIN -->
|
||||
As of June 1, 2025, this is our current score:
|
||||
As of June 5, 2025, this is our current score:
|
||||
|
||||
    Decomp progress: 89.17%
|
||||
|
||||
    Documentation progress: 58.97%
|
||||
    Documentation progress: 59.17%
|
||||
<!-- README_SCORE_SUMMARY_END -->
|
||||
|
||||
---
|
||||
@@ -117,30 +117,30 @@ s32 is_drumstick_unlocked(void) {
|
||||
```
|
||||
|
||||
<!-- README_SCORE_BEGIN -->
|
||||
As of June 1, 2025, this is our current score:
|
||||
As of June 5, 2025, this is our current score:
|
||||
```
|
||||
===================================================================
|
||||
ADVENTURE ONE (ASM -> C Decompilation)
|
||||
-------------- 89.17% Complete (90.50% NON_MATCHING) --------------
|
||||
# Decompiled functions: 1907
|
||||
# GLOBAL_ASM remaining: 44
|
||||
====================================================================
|
||||
ADVENTURE ONE (ASM -> C Decompilation)
|
||||
-------------- 89.17% Complete (90.50% NON_MATCHING) ---------------
|
||||
# Decompiled functions: 1907
|
||||
# GLOBAL_ASM remaining: 44
|
||||
# NON_MATCHING functions: 6
|
||||
# NON_EQUIVALENT WIP functions: 15
|
||||
--------------------------- Game Status ---------------------------
|
||||
# NON_EQUIVALENT WIP functions: 23
|
||||
--------------------------- Game Status ----------------------------
|
||||
Balloons: 41/47, Keys: 4/4, Trophies: 4/5
|
||||
T.T. Amulets: 4/4, Wizpig Amulets: 4/4
|
||||
-------------------------------------------------------------------
|
||||
T.T. Amulets: 4/4, Wizpig Amulets: 4/4
|
||||
--------------------------------------------------------------------
|
||||
We are racing in Spaceport Alpha. (Lap 3/3)
|
||||
===================================================================
|
||||
====================================================================
|
||||
ADVENTURE TWO (Cleanup & Documentation)
|
||||
------------------------- 58.97% Complete -------------------------
|
||||
# Documented functions: 1204
|
||||
# Undocumented remaining: 450
|
||||
--------------------------- Game Status ---------------------------
|
||||
Balloons: 28/47, Keys: 3/4, Trophies: 2/5
|
||||
T.T. Amulets: 3/4, Wizpig Amulets: 2/4
|
||||
-------------------------------------------------------------------
|
||||
We are collecting silver coins in Pirate Lagoon. (8/8 silver coins)
|
||||
===================================================================
|
||||
------------------------- 59.17% Complete --------------------------
|
||||
# Documented functions: 1206
|
||||
# Undocumented remaining: 448
|
||||
--------------------------- Game Status ----------------------------
|
||||
Balloons: 29/47, Keys: 3/4, Trophies: 2/5
|
||||
T.T. Amulets: 3/4, Wizpig Amulets: 2/4
|
||||
--------------------------------------------------------------------
|
||||
We are collecting silver coins in Treasure Caves. (0/8 silver coins)
|
||||
====================================================================
|
||||
```
|
||||
<!-- README_SCORE_END -->
|
||||
|
||||
+63
-33
@@ -6,29 +6,63 @@
|
||||
|
||||
// This file is an extension of PR/gbi.h
|
||||
|
||||
// Color combiner values. These need better names!
|
||||
#define DKR_CC_UNK0 0, 0, 0, COMBINED, COMBINED, 0, PRIMITIVE, 0
|
||||
#define DKR_CC_UNK1 ENVIRONMENT, COMBINED, ENV_ALPHA, COMBINED, COMBINED, 0, PRIMITIVE, 0
|
||||
#define DKR_CC_UNK2 ENVIRONMENT, COMBINED, ENV_ALPHA, COMBINED, 0, 0, 0, COMBINED
|
||||
#define DKR_CC_UNK3 ENVIRONMENT, SHADE, ENV_ALPHA, SHADE, 0, 0, 0, SHADE
|
||||
#define DKR_CC_UNK4 ENVIRONMENT, SHADE, ENV_ALPHA, SHADE, 0, 0, 0, PRIMITIVE
|
||||
#define DKR_CC_UNK5 TEXEL0, PRIMITIVE, SHADE_ALPHA, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0
|
||||
#define DKR_CC_UNK6 ENVIRONMENT, COMBINED, SHADE, COMBINED, 0, 0, 0, COMBINED
|
||||
#define DKR_CC_UNK7 TEXEL1, TEXEL0, PRIMITIVE, TEXEL0, TEXEL1, TEXEL0, PRIMITIVE, TEXEL0
|
||||
#define DKR_CC_UNK8 COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED
|
||||
#define DKR_CC_UNK9 PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0
|
||||
#define DKR_CC_UNK10 TEXEL0, 0, SCALE, 0, 0, 0, 0, TEXEL0
|
||||
#define DKR_CC_UNK11 ENVIRONMENT, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL0, 0, PRIMITIVE, 0
|
||||
#define DKR_CC_UNK12 0, 0, 0, ENVIRONMENT, 0, 0, 0, TEXEL0
|
||||
#define DKR_CC_UNK13 ENVIRONMENT, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL1, 0, PRIMITIVE, 0
|
||||
#define DKR_CC_UNK14 TEXEL1, TEXEL0, SHADE, TEXEL0, 1, TEXEL0, PRIMITIVE, TEXEL0
|
||||
#define DKR_CC_UNK15 ENVIRONMENT, COMBINED, ENV_ALPHA, COMBINED, COMBINED, 0, SHADE, 0
|
||||
#define DKR_CC_UNK16 ENVIRONMENT, TEXEL0, ENV_ALPHA, TEXEL0, 0, 0, 0, PRIMITIVE
|
||||
// Color combiner values.
|
||||
|
||||
#define DKR_CC_ENVIRONMENT 0, 0, 0, ENVIRONMENT, 0, 0, 0, ENVIRONMENT
|
||||
#define DKR_CC_DECALFADEPRIM 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0
|
||||
// cycle 1 modes
|
||||
|
||||
// For some reason DKR has a value for G_MDSFT_BLENDMASK, despite the fact that it is unsupported.
|
||||
#define G_CC_ENVIRONMENT 0, 0, 0, ENVIRONMENT, 0, 0, 0, ENVIRONMENT
|
||||
// blend two textures, modulated by SHADE, alpha modulated between texture and 1 by PRIMITITIVE
|
||||
#define G_CC_BLENDTEX_MODULATEA_1_PRIM TEXEL1, TEXEL0, SHADE, TEXEL0, 1, TEXEL0, PRIMITIVE, TEXEL0
|
||||
|
||||
// The following several modes, where blending with ENVIRONMENT is modulated by ENV_ALPHA,
|
||||
// are likely used to create ambient lighting defined by EnvColor (color and intensity)
|
||||
|
||||
// Blend with ENVIRONMENT modulated by ENV_ALPHA, alpha unchanged
|
||||
#define G_CC_BLENDI_ENV_ALPHA ENVIRONMENT, SHADE, ENV_ALPHA, SHADE, 0, 0, 0, SHADE
|
||||
// Blend SHADE and ENVIRONMENT with ENV_ALPHA, alpha from PRIMITIVE
|
||||
#define G_CC_BLENDI_ENV_ALPHA_A_PRIM ENVIRONMENT, SHADE, ENV_ALPHA, SHADE, 0, 0, 0, PRIMITIVE
|
||||
|
||||
// The following modes do not use vertex colors at all
|
||||
|
||||
// Blend TEXEL0 and ENVIRONMENT with ENV_ALPHA, alpha from PRIMITIVE
|
||||
#define G_CC_BLENDT_ENV_ALPHA_A_PRIM ENVIRONMENT, TEXEL0, ENV_ALPHA, TEXEL0, 0, 0, 0, PRIMITIVE
|
||||
// Blend TEXEL0 and ENVIRONMENT with ENV_ALPHA, alpha = TEXEL0 * PRIMITIVE
|
||||
#define G_CC_BLENDT_ENV_ALPHA_A_TxP ENVIRONMENT, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL0, 0, PRIMITIVE, 0
|
||||
// Like above, but alpha = TEXEL1 * PRIMITIVE
|
||||
#define G_CC_BLENDT_ENV_ALPHA_A_T1xP ENVIRONMENT, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL1, 0, PRIMITIVE, 0
|
||||
|
||||
// Decal with alpha modulated by PRIMITIVE
|
||||
#define G_CC_DECAL_A_PRIM 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0
|
||||
// PRIMITIVE and TEXEL0 blend using SHADE_ALPHA, alpha = TEXEL0 * PRIMITIVE
|
||||
#define G_CC_BLEND_SHADEALPHA TEXEL0, PRIMITIVE, SHADE_ALPHA, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0
|
||||
// PRIM and ENV blend, alpha = TEXEL0 * PRIM
|
||||
#define G_CC_BLENDPE_A_PRIM PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0
|
||||
// TEXEL0 * SCALE, used in G_CYC_COPY, unclear purpose
|
||||
#define G_CC_DECAL_SCALE TEXEL0, 0, SCALE, 0, 0, 0, 0, TEXEL0
|
||||
// ENVIRONMENT color, alpha from TEXEL0, used for text
|
||||
#define G_CC_ENV_DECALA 0, 0, 0, ENVIRONMENT, 0, 0, 0, TEXEL0
|
||||
// blend two textures, modulated by PRIMITIVE
|
||||
// used for blinking lights
|
||||
#define G_CC_BLENDTEX_PRIM TEXEL1, TEXEL0, PRIMITIVE, TEXEL0, TEXEL1, TEXEL0, PRIMITIVE, TEXEL0
|
||||
|
||||
// cycle 2 modes
|
||||
|
||||
// Alpha = COMBINED * PRIM
|
||||
#define G_CC_MODULATEA_PRIM2 0, 0, 0, COMBINED, COMBINED, 0, PRIMITIVE, 0
|
||||
// Blend with ENV using ENV_ALPHA, alpha = COMBINED * PRIM
|
||||
#define G_CC_BLENDI_ENV_ALPHA_PRIM2 ENVIRONMENT, COMBINED, ENV_ALPHA, COMBINED, COMBINED, 0, PRIMITIVE, 0
|
||||
// Blend with ENV using ENV_ALPHA, alpha unchanged
|
||||
#define G_CC_BLEND_ENV_ALPHA2 ENVIRONMENT, COMBINED, ENV_ALPHA, COMBINED, 0, 0, 0, COMBINED
|
||||
// Blend with ENV using SHADE, alpha unchanged; used after G_CC_BLEND_SHADEALPHA
|
||||
#define G_CC_BLENDI_SHADE ENVIRONMENT, COMBINED, SHADE, COMBINED, 0, 0, 0, COMBINED
|
||||
// Blend with ENV using ENV_ALPHA, alpha = COMBINED * SHADE; used for water
|
||||
#define G_CC_BLENDI_ENV_ALPHA_MODULATEA2 ENVIRONMENT, COMBINED, ENV_ALPHA, COMBINED, COMBINED, 0, SHADE, 0
|
||||
#define G_CC_MODULATEIDECALA2 COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED
|
||||
|
||||
// Inside the RSP, when we change otherMode, it sends the new mode to the RDP with the lower 4 bits set to 1.
|
||||
// If we use the standard g*SPSetOtherMode macros, this doesn't matter to us.
|
||||
// But in DKR, direct command transmission to the RDP is often used, bypassing processing in the RSP,
|
||||
// so in custom code we also need to set those 4 bits to 1.
|
||||
#define G_DKR_BLENDMASK 15
|
||||
|
||||
// OtherMode_H values.
|
||||
@@ -52,18 +86,14 @@
|
||||
// OtherMode_L values.
|
||||
#define DKR_OML_COMMON G_AC_NONE | G_ZS_PIXEL
|
||||
|
||||
// Render mode values. These need better names!
|
||||
#define DKR_RM_UNKNOWN0 Z_UPD | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_IN, G_BL_1MA)
|
||||
#define DKR_RM_UNKNOWN1 GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_IN, G_BL_1MA)
|
||||
#define DKR_RM_UNKNOWN2 AA_EN | IM_RD | CLR_ON_CVG | FORCE_BL | CVG_DST_WRAP | ZMODE_OPA
|
||||
#define DKR_RM_UNKNOWN2_1 DKR_RM_UNKNOWN2 | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
|
||||
#define DKR_RM_UNKNOWN2_2 DKR_RM_UNKNOWN2 | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
|
||||
#define DKR_RM_UNKNOWN3 AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_X_ALPHA | ALPHA_CVG_SEL | CVG_DST_CLAMP | ZMODE_OPA
|
||||
#define DKR_RM_UNKNOWN3_1 DKR_RM_UNKNOWN3 | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
|
||||
#define DKR_RM_UNKNOWN3_2 DKR_RM_UNKNOWN3 | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
|
||||
#define DKR_RM_UNKNOWN4 AA_EN | Z_CMP | IM_RD | CVG_X_ALPHA | FORCE_BL | CVG_DST_CLAMP | ZMODE_XLU
|
||||
#define DKR_RM_UNKNOWN4_1 DKR_RM_UNKNOWN4 | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
|
||||
#define DKR_RM_UNKNOWN4_2 DKR_RM_UNKNOWN4 | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
|
||||
// modified version of RM_AA_ZB_XLU_LINE, with ALPHA_CVG_SEL disabled
|
||||
#define RM_AA_ZB_XLU_LINE_MOD(clk) \
|
||||
AA_EN | Z_CMP | IM_RD | CVG_X_ALPHA | \
|
||||
FORCE_BL | CVG_DST_CLAMP | ZMODE_XLU | \
|
||||
GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
|
||||
|
||||
#define G_RM_AA_ZB_XLU_LINE_MOD RM_AA_ZB_XLU_LINE_MOD(1)
|
||||
#define G_RM_AA_ZB_XLU_LINE_MOD2 RM_AA_ZB_XLU_LINE_MOD(2)
|
||||
|
||||
// Temporary until all commands are properly defined.
|
||||
#define fast3d_cmd(pkt, word0, word1) \
|
||||
|
||||
+30
-30
@@ -799,8 +799,8 @@ typedef struct ObjectHeader {
|
||||
/* 0x1C */ ObjHeaderParticleEntry *objectParticles;
|
||||
s32 pad20;
|
||||
/* 0x24 */ ObjectHeader24 *unk24;
|
||||
/* 0x28 */ f32 shadeBrightness;
|
||||
/* 0x2C */ f32 shadeAmbient;
|
||||
/* 0x28 */ f32 shadeAmbient;
|
||||
/* 0x2C */ f32 shadeDiffuse;
|
||||
/* 0x30 */ u16 flags;
|
||||
/* 0x32 */ s16 shadowGroup;
|
||||
/* 0x34 */ s16 unk34;
|
||||
@@ -835,7 +835,7 @@ typedef struct ObjectHeader {
|
||||
/* 0x5E */ u8 pad5E[0x2];
|
||||
/* 0x60 */ char internalName[16];
|
||||
/* 0x70 */ u8 unk70;
|
||||
/* 0x71 */ u8 unk71;
|
||||
/* 0x71 */ u8 directionalPointLighting; // If enabled, the model is lit from the direction of the light source; if disabled, lighting is applied evenly from all sides
|
||||
/* 0x72 */ u8 unk72;
|
||||
u8 pad73[0x5];
|
||||
} ObjectHeader;
|
||||
@@ -876,33 +876,33 @@ typedef struct WaterEffect {
|
||||
} WaterEffect;
|
||||
|
||||
typedef struct ShadeProperties {
|
||||
f32 unk0;
|
||||
u8 unk4;
|
||||
u8 unk5;
|
||||
u8 unk6;
|
||||
u8 unk7;
|
||||
s16 unk8;
|
||||
s16 unkA;
|
||||
s16 unkC;
|
||||
u8 unkE;
|
||||
u8 unkF;
|
||||
u8 unk10;
|
||||
u8 unk11;
|
||||
s16 unk12;
|
||||
s16 unk14;
|
||||
s16 unk16;
|
||||
u8 unk18;
|
||||
u8 unk19;
|
||||
u8 unk1A;
|
||||
u8 unk1B;
|
||||
s16 unk1C;
|
||||
s16 unk1E;
|
||||
s16 unk20;
|
||||
s16 unk22;
|
||||
s16 unk24;
|
||||
s16 unk26;
|
||||
f32 brightness;
|
||||
f32 ambient;
|
||||
/* 0x00 */ f32 unk0;
|
||||
/* 0x04 */ u8 lightR;
|
||||
/* 0x05 */ u8 lightG;
|
||||
/* 0x06 */ u8 lightB;
|
||||
/* 0x07 */ u8 lightIntensity;
|
||||
/* 0x08 */ s16 lightDirX;
|
||||
/* 0x0A */ s16 lightDirY;
|
||||
/* 0x0C */ s16 lightDirZ;
|
||||
/* 0x0E */ u8 secondaryLightR;
|
||||
/* 0x0F */ u8 secondaryLightG;
|
||||
/* 0x10 */ u8 secondaryLightB;
|
||||
/* 0x11 */ u8 secondaryLightIntensity;
|
||||
/* 0x12 */ s16 secondaryLightDirX;
|
||||
/* 0x14 */ s16 secondaryLightDirY;
|
||||
/* 0x16 */ s16 secondaryLightDirZ;
|
||||
/* 0x18 */ u8 shadowR;
|
||||
/* 0x19 */ u8 shadowG;
|
||||
/* 0x1A */ u8 shadowB;
|
||||
/* 0x1B */ u8 unk1B;
|
||||
/* 0x1C */ s16 shadowDirX;
|
||||
/* 0x1E */ s16 shadowDirY;
|
||||
/* 0x20 */ s16 shadowDirZ;
|
||||
/* 0x22 */ s16 unk22;
|
||||
/* 0x24 */ s16 unk24;
|
||||
/* 0x26 */ s16 unk26;
|
||||
/* 0x28 */ f32 ambient;
|
||||
/* 0x2C */ f32 diffuse;
|
||||
} ShadeProperties;
|
||||
|
||||
typedef f32 FakeHalfMatrix[2][4];
|
||||
|
||||
+3
-3
@@ -18,16 +18,16 @@ Gfx dDialogueBoxBegin[] = {
|
||||
|
||||
Gfx dDialogueBoxDrawModes[][2] = {
|
||||
{
|
||||
gsDPSetCombineMode(DKR_CC_UNK11, DKR_CC_UNK11),
|
||||
gsDPSetCombineMode(G_CC_BLENDT_ENV_ALPHA_A_TxP, G_CC_BLENDT_ENV_ALPHA_A_TxP),
|
||||
gsDPSetOtherMode(DKR_OMH_1CYC_POINT_NOPERSP, DKR_OML_COMMON | G_RM_XLU_SURF | G_RM_XLU_SURF2),
|
||||
},
|
||||
{
|
||||
gsDPSetCombineMode(DKR_CC_ENVIRONMENT, DKR_CC_ENVIRONMENT),
|
||||
gsDPSetCombineMode(G_CC_ENVIRONMENT, G_CC_ENVIRONMENT),
|
||||
gsDPSetOtherMode(DKR_OMH_1CYC_POINT_NOPERSP, DKR_OML_COMMON | G_RM_XLU_SURF | G_RM_XLU_SURF2),
|
||||
},
|
||||
#if REGION == REGION_JP
|
||||
{
|
||||
gsDPSetCombineMode(DKR_CC_UNK13, G_CC_PASS2),
|
||||
gsDPSetCombineMode(G_CC_BLENDT_ENV_ALPHA_A_T1xP, G_CC_PASS2),
|
||||
gsDPSetOtherMode(DKR_OMH_2CYC_POINT_NOPERSP, DKR_OML_COMMON | G_RM_NOOP | G_RM_XLU_SURF2),
|
||||
},
|
||||
#endif
|
||||
|
||||
+143
-139
@@ -14,8 +14,8 @@ ObjectLight *D_800DC954 = NULL;
|
||||
s32 gMaxLights = 0;
|
||||
s32 gNumActiveLights = 0;
|
||||
unk800DC960 *D_800DC960 = NULL;
|
||||
Vec3f *D_800DC964 = NULL;
|
||||
s32 D_800DC968 = 0; // Currently unknown, might be a different type.
|
||||
Vec3f *gLightDirs = NULL;
|
||||
s32 numLights = 0; // Currently unknown, might be a different type.
|
||||
|
||||
/*******************************/
|
||||
|
||||
@@ -38,7 +38,7 @@ void free_lights(void) {
|
||||
gActiveLights = NULL;
|
||||
D_800DC954 = NULL;
|
||||
D_800DC960 = NULL;
|
||||
D_800DC964 = NULL;
|
||||
gLightDirs = NULL;
|
||||
}
|
||||
gNumActiveLights = 0;
|
||||
gMaxLights = 0;
|
||||
@@ -62,7 +62,7 @@ void setup_lights(s32 count) {
|
||||
buffer += temp * sizeof(ObjectLight *);
|
||||
D_800DC954 = (ObjectLight *) buffer;
|
||||
D_800DC960 = (unk800DC960 *) ((u32) D_800DC954 + temp * sizeof(ObjectLight));
|
||||
D_800DC964 = (Vec3f *) ((u32) D_800DC960 + temp * sizeof(unk800DC960));
|
||||
gLightDirs = (Vec3f *) ((u32) D_800DC960 + temp * sizeof(unk800DC960));
|
||||
for (i = 0; i < gMaxLights; i++) {
|
||||
gActiveLights[i] = &D_800DC954[i];
|
||||
}
|
||||
@@ -95,16 +95,16 @@ ObjectLight *func_80031CAC(Object *obj, LevelObjectEntry_RgbaLight *lightEntry)
|
||||
light->pos.y = lightEntry->common.y;
|
||||
light->pos.z = lightEntry->common.z;
|
||||
}
|
||||
light->unk1C = lightEntry->unkA << 16;
|
||||
light->colourR = lightEntry->unkA << 16;
|
||||
light->unk2C = 0;
|
||||
light->unk3C = 0;
|
||||
light->unk20 = lightEntry->unkB << 16;
|
||||
light->colourG = lightEntry->unkB << 16;
|
||||
light->unk30 = 0;
|
||||
light->unk3E = 0;
|
||||
light->unk24 = lightEntry->unkC << 16;
|
||||
light->colourB = lightEntry->unkC << 16;
|
||||
light->unk34 = 0;
|
||||
light->unk40 = 0;
|
||||
light->unk28 = lightEntry->unkD << 16;
|
||||
light->intensity = lightEntry->unkD << 16;
|
||||
light->unk38 = 0;
|
||||
light->unk42 = 0;
|
||||
light->unk44 = NULL;
|
||||
@@ -162,16 +162,16 @@ ObjectLight *add_object_light(Object *obj, ObjectHeader24 *arg1) {
|
||||
light->pos.x = light->homeX;
|
||||
light->pos.y = light->homeY;
|
||||
light->pos.z = light->homeZ;
|
||||
light->unk1C = arg1->unk2 << 16;
|
||||
light->colourR = arg1->unk2 << 16;
|
||||
light->unk2C = 0;
|
||||
light->unk3C = 0;
|
||||
light->unk20 = arg1->unk3 << 16;
|
||||
light->colourG = arg1->unk3 << 16;
|
||||
light->unk30 = 0;
|
||||
light->unk3E = 0;
|
||||
light->unk24 = arg1->unk4 << 16;
|
||||
light->colourB = arg1->unk4 << 16;
|
||||
light->unk34 = 0;
|
||||
light->unk40 = 0;
|
||||
light->unk28 = arg1->unk5 << 16;
|
||||
light->intensity = arg1->unk5 << 16;
|
||||
light->unk38 = 0;
|
||||
light->unk42 = 0;
|
||||
if (arg1->unk6 != 0xFFFF) {
|
||||
@@ -234,14 +234,14 @@ UNUSED void toggle_object_light(ObjectLight *light) {
|
||||
UNUSED void func_80032248(ObjectLight *light, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
|
||||
if (arg2 > 0) {
|
||||
light->unk3C = arg2;
|
||||
light->unk2C = ((arg1 << 0x10) - light->unk1C) / arg2;
|
||||
light->unk2C = ((arg1 << 0x10) - light->colourR) / arg2;
|
||||
}
|
||||
if (arg4 > 0) {
|
||||
light->unk3E = arg4;
|
||||
light->unk30 = ((arg3 << 0x10) - light->unk20) / arg4;
|
||||
light->unk30 = ((arg3 << 0x10) - light->colourG) / arg4;
|
||||
}
|
||||
if (arg6 > 0) {
|
||||
light->unk34 = ((arg5 << 0x10) - light->unk24) / arg6;
|
||||
light->unk34 = ((arg5 << 0x10) - light->colourB) / arg6;
|
||||
light->unk40 = arg6;
|
||||
}
|
||||
}
|
||||
@@ -249,7 +249,7 @@ UNUSED void func_80032248(ObjectLight *light, s32 arg1, s32 arg2, s32 arg3, s32
|
||||
UNUSED void func_80032344(ObjectLight *light, s32 arg1, s32 arg2) {
|
||||
if (arg2 > 0) {
|
||||
light->unk42 = arg2;
|
||||
light->unk38 = ((arg1 << 0x10) - light->unk28) / arg2;
|
||||
light->unk38 = ((arg1 << 0x10) - light->intensity) / arg2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,49 +295,49 @@ void func_80032424(ObjectLight *light, s32 updateRate) {
|
||||
var_a3 = light->unk44;
|
||||
}
|
||||
temp_v0 = (0x10000 / temp_v1->unk4);
|
||||
light->unk1C = ((var_a3->unk0 - temp_v1->unk0) * light->unk4C * temp_v0) + (temp_v1->unk0 << 0x10);
|
||||
light->unk20 = ((var_a3->unk1 - temp_v1->unk1) * light->unk4C * temp_v0) + (temp_v1->unk1 << 0x10);
|
||||
light->unk24 = ((var_a3->unk2 - temp_v1->unk2) * light->unk4C * temp_v0) + (temp_v1->unk2 << 0x10);
|
||||
light->unk28 = ((var_a3->unk3 - temp_v1->unk3) * light->unk4C * temp_v0) + (temp_v1->unk3 << 0x10);
|
||||
light->colourR = ((var_a3->unk0 - temp_v1->unk0) * light->unk4C * temp_v0) + (temp_v1->unk0 << 0x10);
|
||||
light->colourG = ((var_a3->unk1 - temp_v1->unk1) * light->unk4C * temp_v0) + (temp_v1->unk1 << 0x10);
|
||||
light->colourB = ((var_a3->unk2 - temp_v1->unk2) * light->unk4C * temp_v0) + (temp_v1->unk2 << 0x10);
|
||||
light->intensity = ((var_a3->unk3 - temp_v1->unk3) * light->unk4C * temp_v0) + (temp_v1->unk3 << 0x10);
|
||||
} else {
|
||||
if (light->unk3C != 0) {
|
||||
temp_v0 = light->unk3C;
|
||||
if (updateRate < light->unk3C) {
|
||||
light->unk1C += light->unk2C * updateRate;
|
||||
light->colourR += light->unk2C * updateRate;
|
||||
light->unk3C -= updateRate;
|
||||
} else {
|
||||
light->unk3C = 0;
|
||||
light->unk1C += light->unk2C * temp_v0;
|
||||
light->colourR += light->unk2C * temp_v0;
|
||||
}
|
||||
}
|
||||
if (light->unk3E != 0) {
|
||||
temp_v0 = light->unk3E;
|
||||
if (updateRate < light->unk3E) {
|
||||
light->unk20 += light->unk30 * updateRate;
|
||||
light->colourG += light->unk30 * updateRate;
|
||||
light->unk3E -= updateRate;
|
||||
} else {
|
||||
light->unk3E = 0;
|
||||
light->unk20 += light->unk30 * temp_v0;
|
||||
light->colourG += light->unk30 * temp_v0;
|
||||
}
|
||||
}
|
||||
if (light->unk40 != 0) {
|
||||
temp_v0 = light->unk40;
|
||||
if (updateRate < light->unk40) {
|
||||
light->unk24 += light->unk34 * updateRate;
|
||||
light->colourB += light->unk34 * updateRate;
|
||||
light->unk40 -= updateRate;
|
||||
} else {
|
||||
light->unk40 = 0;
|
||||
light->unk24 += light->unk34 * temp_v0;
|
||||
light->colourB += light->unk34 * temp_v0;
|
||||
}
|
||||
}
|
||||
if (light->unk42 != 0) {
|
||||
temp_v0 = light->unk42;
|
||||
if (updateRate < light->unk42) {
|
||||
light->unk28 += light->unk38 * updateRate;
|
||||
light->intensity += light->unk38 * updateRate;
|
||||
light->unk42 -= updateRate;
|
||||
} else {
|
||||
light->unk42 = 0;
|
||||
light->unk28 += light->unk38 * temp_v0;
|
||||
light->intensity += light->unk38 * temp_v0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -367,7 +367,7 @@ void func_80032424(ObjectLight *light, s32 updateRate) {
|
||||
}
|
||||
light->unk5 = 1;
|
||||
}
|
||||
if (light->unk5 != 0) {
|
||||
if (light->unk5) {
|
||||
light->unk50 = light->pos.x - light->radius;
|
||||
light->unk56 = light->pos.x + light->radius;
|
||||
if (light->unk0 == 1) {
|
||||
@@ -385,17 +385,17 @@ void func_80032424(ObjectLight *light, s32 updateRate) {
|
||||
light->unk5A = light->pos.z + light->radius;
|
||||
}
|
||||
if (light->unk1 == 2) {
|
||||
light->unk7C.z = -1.0f;
|
||||
light->direction.z = -1.0f;
|
||||
rotation.y_rotation = light->unk70;
|
||||
rotation.x_rotation = light->unk72;
|
||||
rotation.z_rotation = 0;
|
||||
vec3f_rotate_py(&rotation, &light->unk7C);
|
||||
vec3f_rotate_py(&rotation, &light->direction);
|
||||
if (light->owner != NULL) {
|
||||
vec3f_rotate(&light->owner->segment.trans.rotation, &light->unk7C);
|
||||
vec3f_rotate(&light->owner->segment.trans.rotation, &light->direction);
|
||||
}
|
||||
light->unk7C.x = -light->unk7C.x;
|
||||
light->unk7C.y = -light->unk7C.y;
|
||||
light->unk7C.z = -light->unk7C.z;
|
||||
light->direction.x = -light->direction.x;
|
||||
light->direction.y = -light->direction.y;
|
||||
light->direction.z = -light->direction.z;
|
||||
}
|
||||
light->unk5 = 0;
|
||||
}
|
||||
@@ -431,11 +431,11 @@ s32 get_light_count(void) {
|
||||
|
||||
void func_80032C7C(Object *object) {
|
||||
ObjectLight *light;
|
||||
s16 phi_a0, phi_a1;
|
||||
f32 f20;
|
||||
s16 sp82;
|
||||
s16 sp80;
|
||||
s16 sp7E;
|
||||
s16 primIndex, secIndex;
|
||||
f32 intensity;
|
||||
s16 objX;
|
||||
s16 objY;
|
||||
s16 objZ;
|
||||
u8 sp64;
|
||||
s32 i;
|
||||
|
||||
@@ -458,22 +458,24 @@ void func_80032C7C(Object *object) {
|
||||
break;
|
||||
}
|
||||
|
||||
sp82 = object->segment.trans.x_position;
|
||||
sp80 = object->segment.trans.y_position;
|
||||
sp7E = object->segment.trans.z_position;
|
||||
D_800DC968 = 0;
|
||||
objX = object->segment.trans.x_position;
|
||||
objY = object->segment.trans.y_position;
|
||||
objZ = object->segment.trans.z_position;
|
||||
|
||||
numLights = 0;
|
||||
|
||||
for (i = 0; i < gNumActiveLights; i++) {
|
||||
light = gActiveLights[i];
|
||||
if ((light->unk2 & sp64) && (light->enabled == 1) && (sp82 >= light->unk50) && (light->unk56 >= sp82) &&
|
||||
(sp80 >= light->unk52) && (light->unk58 >= sp80) && (sp7E >= light->unk54) && (light->unk5A >= sp7E)) {
|
||||
if ((light->unk2 & sp64) && (light->enabled == TRUE) && (objX >= light->unk50) && (light->unk56 >= objX) &&
|
||||
(objY >= light->unk52) && (light->unk58 >= objY) && (objZ >= light->unk54) && (light->unk5A >= objZ)) {
|
||||
if (light->unk0 == 0) {
|
||||
if (light->unk28 >= 0x10000) {
|
||||
D_800DC960[D_800DC968].unk0 = light;
|
||||
D_800DC960[D_800DC968].unk4 = light->unk1C >> 0x10;
|
||||
D_800DC960[D_800DC968].unk8 = light->unk20 >> 0x10;
|
||||
D_800DC960[D_800DC968].unkC = light->unk24 >> 0x10;
|
||||
D_800DC960[D_800DC968].unk10 = light->unk28 >> 0x10;
|
||||
D_800DC968++;
|
||||
if (light->intensity >= 0x10000) {
|
||||
D_800DC960[numLights].lightObj = light;
|
||||
D_800DC960[numLights].colourR = light->colourR >> 0x10;
|
||||
D_800DC960[numLights].colourG = light->colourG >> 0x10;
|
||||
D_800DC960[numLights].colourB = light->colourB >> 0x10;
|
||||
D_800DC960[numLights].intensity = light->intensity >> 0x10;
|
||||
numLights++;
|
||||
}
|
||||
} else {
|
||||
gLightDiffX = light->pos.x - object->segment.trans.x_position;
|
||||
@@ -486,14 +488,14 @@ void func_80032C7C(Object *object) {
|
||||
(gLightDiffX * gLightDiffX) + (gLightDiffY * gLightDiffY) + (gLightDiffZ * gLightDiffZ);
|
||||
if (gLightDistance < light->radiusSquare) {
|
||||
if (light->unk1 == 2) {
|
||||
f20 = light_direction_calc(light);
|
||||
intensity = light_direction_calc(light);
|
||||
} else {
|
||||
f20 = 1.0f;
|
||||
intensity = 1.0f;
|
||||
}
|
||||
if (f20 > 0.0f) {
|
||||
f20 *= light_distance_calc(light);
|
||||
if (f20 > 0.0f) {
|
||||
if (object->segment.header->unk71 != 0) {
|
||||
if (intensity > 0.0f) {
|
||||
intensity *= light_distance_calc(light);
|
||||
if (intensity > 0.0f) {
|
||||
if (object->segment.header->directionalPointLighting) {
|
||||
if (gLightDistance > 0.0f) {
|
||||
f32 temp = 1.0f / sqrtf(gLightDistance);
|
||||
gLightDiffX *= temp;
|
||||
@@ -504,16 +506,16 @@ void func_80032C7C(Object *object) {
|
||||
gLightDiffY = 0;
|
||||
gLightDiffZ = -1.0f;
|
||||
}
|
||||
D_800DC964[D_800DC968].x = gLightDiffX;
|
||||
D_800DC964[D_800DC968].y = gLightDiffY;
|
||||
D_800DC964[D_800DC968].z = gLightDiffZ;
|
||||
gLightDirs[numLights].x = gLightDiffX;
|
||||
gLightDirs[numLights].y = gLightDiffY;
|
||||
gLightDirs[numLights].z = gLightDiffZ;
|
||||
}
|
||||
D_800DC960[D_800DC968].unk0 = light;
|
||||
D_800DC960[D_800DC968].unk4 = light->unk1C >> 0x10;
|
||||
D_800DC960[D_800DC968].unk8 = light->unk20 >> 0x10;
|
||||
D_800DC960[D_800DC968].unkC = light->unk24 >> 0x10;
|
||||
D_800DC960[D_800DC968].unk10 = (u8) f20;
|
||||
D_800DC968++;
|
||||
D_800DC960[numLights].lightObj = light;
|
||||
D_800DC960[numLights].colourR = light->colourR >> 0x10;
|
||||
D_800DC960[numLights].colourG = light->colourG >> 0x10;
|
||||
D_800DC960[numLights].colourB = light->colourB >> 0x10;
|
||||
D_800DC960[numLights].intensity = (u8) intensity;
|
||||
numLights++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -521,66 +523,68 @@ void func_80032C7C(Object *object) {
|
||||
}
|
||||
}
|
||||
|
||||
if (object->segment.header->unk71 != 0) {
|
||||
if (D_800DC968 == 0) {
|
||||
object->shading->unk7 = 0;
|
||||
object->shading->unk11 = 0;
|
||||
} else if (D_800DC968 == 1) {
|
||||
object->shading->unk4 = D_800DC960[0].unk4;
|
||||
object->shading->unk5 = D_800DC960[0].unk8;
|
||||
object->shading->unk6 = D_800DC960[0].unkC;
|
||||
object->shading->unk7 = D_800DC960[0].unk10;
|
||||
object->shading->unk11 = 0;
|
||||
object->shading->unk8 = D_800DC964[0].x * 8192.0f;
|
||||
object->shading->unkA = D_800DC964[0].y * 8192.0f;
|
||||
object->shading->unkC = D_800DC964[0].z * 8192.0f;
|
||||
if (object->segment.header->directionalPointLighting) {
|
||||
// find two brightest light sources
|
||||
if (numLights == 0) {
|
||||
object->shading->lightIntensity = 0;
|
||||
object->shading->secondaryLightIntensity = 0;
|
||||
} else if (numLights == 1) {
|
||||
object->shading->lightR = D_800DC960[0].colourR;
|
||||
object->shading->lightG = D_800DC960[0].colourG;
|
||||
object->shading->lightB = D_800DC960[0].colourB;
|
||||
object->shading->lightIntensity = D_800DC960[0].intensity;
|
||||
object->shading->secondaryLightIntensity = 0;
|
||||
object->shading->lightDirX = gLightDirs[0].x * 8192.0f;
|
||||
object->shading->lightDirY = gLightDirs[0].y * 8192.0f;
|
||||
object->shading->lightDirZ = gLightDirs[0].z * 8192.0f;
|
||||
} else {
|
||||
if (D_800DC960[1].unk10 < D_800DC960[0].unk10) {
|
||||
phi_a0 = 0;
|
||||
phi_a1 = 1;
|
||||
if (D_800DC960[1].intensity < D_800DC960[0].intensity) {
|
||||
primIndex = 0;
|
||||
secIndex = 1;
|
||||
} else {
|
||||
phi_a0 = 1;
|
||||
phi_a1 = 0;
|
||||
primIndex = 1;
|
||||
secIndex = 0;
|
||||
}
|
||||
for (i = 2; i < D_800DC968; i++) {
|
||||
if (D_800DC960[phi_a1].unk10 < D_800DC960[i].unk10) {
|
||||
if (D_800DC960[phi_a0].unk10 < D_800DC960[i].unk10) {
|
||||
phi_a1 = phi_a0;
|
||||
phi_a0 = i;
|
||||
for (i = 2; i < numLights; i++) {
|
||||
if (D_800DC960[secIndex].intensity < D_800DC960[i].intensity) {
|
||||
if (D_800DC960[primIndex].intensity < D_800DC960[i].intensity) {
|
||||
secIndex = primIndex;
|
||||
primIndex = i;
|
||||
} else {
|
||||
phi_a1 = i;
|
||||
secIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
object->shading->unk4 = D_800DC960[phi_a0].unk4;
|
||||
object->shading->unk5 = D_800DC960[phi_a0].unk8;
|
||||
object->shading->unk6 = D_800DC960[phi_a0].unkC;
|
||||
object->shading->unk7 = D_800DC960[phi_a0].unk10;
|
||||
object->shading->unk8 = D_800DC964[phi_a0].x * 8192.0f;
|
||||
object->shading->unkA = D_800DC964[phi_a0].y * 8192.0f;
|
||||
object->shading->unkC = D_800DC964[phi_a0].z * 8192.0f;
|
||||
object->shading->unkE = D_800DC960[phi_a1].unk4;
|
||||
object->shading->unkF = D_800DC960[phi_a1].unk8;
|
||||
object->shading->unk10 = D_800DC960[phi_a1].unkC;
|
||||
object->shading->unk11 = D_800DC960[phi_a1].unk10;
|
||||
object->shading->unk12 = D_800DC964[phi_a1].x * 8192.0f;
|
||||
object->shading->unk14 = D_800DC964[phi_a1].y * 8192.0f;
|
||||
object->shading->unk16 = D_800DC964[phi_a1].z * 8192.0f;
|
||||
object->shading->lightR = D_800DC960[primIndex].colourR;
|
||||
object->shading->lightG = D_800DC960[primIndex].colourG;
|
||||
object->shading->lightB = D_800DC960[primIndex].colourB;
|
||||
object->shading->lightIntensity = D_800DC960[primIndex].intensity;
|
||||
object->shading->lightDirX = gLightDirs[primIndex].x * 8192.0f;
|
||||
object->shading->lightDirY = gLightDirs[primIndex].y * 8192.0f;
|
||||
object->shading->lightDirZ = gLightDirs[primIndex].z * 8192.0f;
|
||||
|
||||
object->shading->secondaryLightR = D_800DC960[secIndex].colourR;
|
||||
object->shading->secondaryLightG = D_800DC960[secIndex].colourG;
|
||||
object->shading->secondaryLightB = D_800DC960[secIndex].colourB;
|
||||
object->shading->secondaryLightIntensity = D_800DC960[secIndex].intensity;
|
||||
object->shading->secondaryLightDirX = gLightDirs[secIndex].x * 8192.0f;
|
||||
object->shading->secondaryLightDirY = gLightDirs[secIndex].y * 8192.0f;
|
||||
object->shading->secondaryLightDirZ = gLightDirs[secIndex].z * 8192.0f;
|
||||
}
|
||||
} else {
|
||||
if (D_800DC968 > 0) {
|
||||
if (D_800DC968 >= 2) {
|
||||
if (numLights > 0) {
|
||||
if (numLights >= 2) {
|
||||
func_800337E4();
|
||||
}
|
||||
object->shading->unk4 = D_800DC960[0].unk4;
|
||||
object->shading->unk5 = D_800DC960[0].unk8;
|
||||
object->shading->unk6 = D_800DC960[0].unkC;
|
||||
object->shading->unk7 = D_800DC960[0].unk10;
|
||||
object->shading->lightR = D_800DC960[0].colourR;
|
||||
object->shading->lightG = D_800DC960[0].colourG;
|
||||
object->shading->lightB = D_800DC960[0].colourB;
|
||||
object->shading->lightIntensity = D_800DC960[0].intensity;
|
||||
} else {
|
||||
object->shading->unk4 = 0xFF;
|
||||
object->shading->unk5 = 0xFF;
|
||||
object->shading->unk6 = 0xFF;
|
||||
object->shading->unk7 = 0;
|
||||
object->shading->lightR = 255;
|
||||
object->shading->lightG = 255;
|
||||
object->shading->lightB = 255;
|
||||
object->shading->lightIntensity = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -590,28 +594,28 @@ void func_800337E4(void) {
|
||||
s32 temp_lo;
|
||||
s32 i;
|
||||
|
||||
for (i = 1; i < D_800DC968; i++) {
|
||||
if (D_800DC960[i].unk10 >= 2) {
|
||||
if (D_800DC960[0].unk10 >= D_800DC960[i].unk10) {
|
||||
temp_lo = (D_800DC960[i].unk10 << 16) / D_800DC960[0].unk10;
|
||||
D_800DC960[0].unk4 += (D_800DC960[i].unk4 * temp_lo) >> 16;
|
||||
D_800DC960[0].unk8 += (D_800DC960[i].unk8 * temp_lo) >> 16;
|
||||
D_800DC960[0].unkC += (D_800DC960[i].unkC * temp_lo) >> 16;
|
||||
for (i = 1; i < numLights; i++) {
|
||||
if (D_800DC960[i].intensity >= 2) {
|
||||
if (D_800DC960[0].intensity >= D_800DC960[i].intensity) {
|
||||
temp_lo = (D_800DC960[i].intensity << 16) / D_800DC960[0].intensity;
|
||||
D_800DC960[0].colourR += (D_800DC960[i].colourR * temp_lo) >> 16;
|
||||
D_800DC960[0].colourG += (D_800DC960[i].colourG * temp_lo) >> 16;
|
||||
D_800DC960[0].colourB += (D_800DC960[i].colourB * temp_lo) >> 16;
|
||||
} else {
|
||||
temp_lo = (D_800DC960[0].unk10 << 16) / D_800DC960[i].unk10;
|
||||
D_800DC960[0].unk4 = ((D_800DC960[0].unk4 * temp_lo) >> 16) + D_800DC960[i].unk4;
|
||||
D_800DC960[0].unk8 = ((D_800DC960[0].unk8 * temp_lo) >> 16) + D_800DC960[i].unk8;
|
||||
D_800DC960[0].unkC = ((D_800DC960[0].unkC * temp_lo) >> 16) + D_800DC960[i].unkC;
|
||||
D_800DC960[0].unk10 = D_800DC960[i].unk10;
|
||||
temp_lo = (D_800DC960[0].intensity << 16) / D_800DC960[i].intensity;
|
||||
D_800DC960[0].colourR = ((D_800DC960[0].colourR * temp_lo) >> 16) + D_800DC960[i].colourR;
|
||||
D_800DC960[0].colourG = ((D_800DC960[0].colourG * temp_lo) >> 16) + D_800DC960[i].colourG;
|
||||
D_800DC960[0].colourB = ((D_800DC960[0].colourB * temp_lo) >> 16) + D_800DC960[i].colourB;
|
||||
D_800DC960[0].intensity = D_800DC960[i].intensity;
|
||||
}
|
||||
if (D_800DC960[0].unk4 >= 256) {
|
||||
D_800DC960[0].unk4 = 255;
|
||||
if (D_800DC960[0].colourR >= 256) {
|
||||
D_800DC960[0].colourR = 255;
|
||||
}
|
||||
if (D_800DC960[0].unk8 >= 256) {
|
||||
D_800DC960[0].unk8 = 255;
|
||||
if (D_800DC960[0].colourG >= 256) {
|
||||
D_800DC960[0].colourG = 255;
|
||||
}
|
||||
if (D_800DC960[0].unkC >= 256) {
|
||||
D_800DC960[0].unkC = 255;
|
||||
if (D_800DC960[0].colourB >= 256) {
|
||||
D_800DC960[0].colourB = 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -624,7 +628,7 @@ f32 light_distance_calc(ObjectLight *light) {
|
||||
f32 dist;
|
||||
f32 mag;
|
||||
|
||||
dist = light->unk28 / 65536.0f;
|
||||
dist = light->intensity / 65536.0f;
|
||||
switch (light->type) {
|
||||
case LIGHT_UNK1:
|
||||
mag = 1.0f - (sqrtf(gLightDistance) * light->radiusMag);
|
||||
@@ -656,14 +660,14 @@ f32 light_distance_calc(ObjectLight *light) {
|
||||
* Official Name: lightDirectionCalc
|
||||
*/
|
||||
f32 light_direction_calc(ObjectLight *light) {
|
||||
f32 mag;
|
||||
f32 invDist;
|
||||
f32 distance;
|
||||
|
||||
distance = gLightDistance;
|
||||
if (distance > 0.0f) {
|
||||
mag = 1.0f / sqrtf(distance);
|
||||
distance = (gLightDiffX * mag * light->unk7C.x) + (gLightDiffY * mag * light->unk7C.y) +
|
||||
(gLightDiffZ * mag * light->unk7C.z);
|
||||
invDist = 1.0f / sqrtf(distance);
|
||||
distance = (gLightDiffX * invDist * light->direction.x) + (gLightDiffY * invDist * light->direction.y) +
|
||||
(gLightDiffZ * invDist * light->direction.z);
|
||||
if (distance < 0.0f) {
|
||||
distance = 0.0f;
|
||||
}
|
||||
|
||||
+10
-10
@@ -41,10 +41,10 @@ typedef struct ObjectLight {
|
||||
s16 homeZ;
|
||||
Object *owner;
|
||||
Vec3f pos;
|
||||
s32 unk1C;
|
||||
s32 unk20;
|
||||
s32 unk24;
|
||||
s32 unk28;
|
||||
s32 colourR;
|
||||
s32 colourG;
|
||||
s32 colourB;
|
||||
s32 intensity;
|
||||
s32 unk2C;
|
||||
s32 unk30;
|
||||
s32 unk34;
|
||||
@@ -78,16 +78,16 @@ typedef struct ObjectLight {
|
||||
s16 unk76;
|
||||
u16 unk78;
|
||||
u16 unk7A;
|
||||
Vec3f unk7C; // Think this might be scale.
|
||||
Vec3f direction; // Think this might be scale.
|
||||
} ObjectLight;
|
||||
|
||||
/* Size: 0x14 bytes */
|
||||
typedef struct unk800DC960 {
|
||||
ObjectLight* unk0;
|
||||
s32 unk4;
|
||||
s32 unk8;
|
||||
s32 unkC;
|
||||
s32 unk10;
|
||||
ObjectLight* lightObj;
|
||||
s32 colourR;
|
||||
s32 colourG;
|
||||
s32 colourB;
|
||||
s32 intensity;
|
||||
} unk800DC960;
|
||||
|
||||
void free_lights(void);
|
||||
|
||||
@@ -622,8 +622,8 @@ void obj_loop_trophycab(Object *obj, s32 updateRate) {
|
||||
}
|
||||
}
|
||||
}
|
||||
obj->shading->ambient = 0.612f;
|
||||
obj->shading->brightness = 0.0f;
|
||||
obj->shading->diffuse = 0.612f;
|
||||
obj->shading->ambient = 0.0f;
|
||||
tempObj = get_racer_object(PLAYER_ONE);
|
||||
if (tempObj != NULL) {
|
||||
diffX = obj->segment.trans.x_position - tempObj->segment.trans.x_position;
|
||||
@@ -690,7 +690,7 @@ void obj_loop_trophycab(Object *obj, s32 updateRate) {
|
||||
}
|
||||
obj->unk5C->unk100 = NULL;
|
||||
if (worldBalloons) {
|
||||
obj->shading->brightness = 0.552f;
|
||||
obj->shading->ambient = 0.552f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6173,7 +6173,7 @@ void obj_init_midifade(Object *obj, LevelObjectEntry_MidiFade *entry) {
|
||||
midiFade->unkC = oy;
|
||||
midiFade->unk10 = oz;
|
||||
midiFade->unk14 = -((obj->segment.trans.x_position * ox) + (obj->segment.trans.y_position * oy) +
|
||||
(obj->segment.trans.z_position * oz));
|
||||
(obj->segment.trans.z_position * oz));
|
||||
midiFade->unk2 = entry->unk1A;
|
||||
midiFade->unk40 = entry->unk1B;
|
||||
|
||||
|
||||
+30
-16
@@ -773,7 +773,7 @@ s32 func_80060EA8(ObjectModel *arg0) {
|
||||
for (var_s1 = 0; var_s1 < temp_v1; var_s1++) {
|
||||
if (temp_ra[var_s1].miscData != BATCH_VTX_COL || (temp_ra[var_s1].flags & RENDER_ENVMAP)) {
|
||||
var_a3 = (var_a3 + (temp_ra[var_s1 + 1]).verticesOffset) - temp_ra[var_s1].verticesOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (var_a3 > 0) {
|
||||
temp_s3 = arg0->vertices;
|
||||
@@ -791,10 +791,10 @@ s32 func_80060EA8(ObjectModel *arg0) {
|
||||
mempool_free(spAC);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
var_v1 = arg0->numberOfBatches;
|
||||
for (var_s1_2 = 0; var_s1_2 < var_v1; var_s1_2++) {
|
||||
temp_v0_4 = &var_ra[var_s1_2];
|
||||
temp_v0_4 = &var_ra[var_s1_2];
|
||||
temp_s4 = temp_v0_4->verticesOffset;
|
||||
for (var_s5 = temp_v0_4->facesOffset; var_s5 < (temp_v0_4 + 1)->facesOffset; var_s5 += 1) {
|
||||
for (var_a3_2 = 0; var_a3_2 < 3; var_a3_2++) {
|
||||
@@ -835,17 +835,23 @@ s32 func_80060EA8(ObjectModel *arg0) {
|
||||
var_a1 = 0;
|
||||
temp_v1_3 = &temp_s3[var_t3];
|
||||
if (batchNum >= 0) {
|
||||
loop_30:
|
||||
loop_30:
|
||||
temp_a3 = &var_ra[var_a1];
|
||||
if ((sp50->miscData == temp_a3->miscData) && (((var_a0 = temp_a3->verticesOffset, (var_a1 == batchNum)) && (var_a0 < var_t3)) || ((var_a1 != batchNum) && (var_a0 < (temp_a3 + 1)->verticesOffset))) && (var_a2 < 0)) {
|
||||
loop_36:
|
||||
if ((sp50->miscData == temp_a3->miscData) &&
|
||||
(((var_a0 = temp_a3->verticesOffset, (var_a1 == batchNum)) && (var_a0 < var_t3)) ||
|
||||
((var_a1 != batchNum) && (var_a0 < (temp_a3 + 1)->verticesOffset))) &&
|
||||
(var_a2 < 0)) {
|
||||
loop_36:
|
||||
temp_v1_4 = &temp_s3[var_a0];
|
||||
if ((temp_v1_3->x == temp_v1_4->x) && (temp_v1_3->y == temp_v1_4->y) && (temp_v1_3->z == temp_v1_4->z)) {
|
||||
if ((temp_v1_3->x == temp_v1_4->x) && (temp_v1_3->y == temp_v1_4->y) &&
|
||||
(temp_v1_3->z == temp_v1_4->z)) {
|
||||
var_a2 = *(temp_v0_5 + (var_a0 * 2));
|
||||
}
|
||||
temp_t8_3 = var_a0 + 1;
|
||||
var_a0 = temp_t8_3;
|
||||
if ((((var_a1 == batchNum) && (temp_t8_3 < var_t3)) || ((var_a1 != batchNum) && (var_a0 < (temp_a3 + 1)->verticesOffset))) && (var_a2 < 0)) {
|
||||
if ((((var_a1 == batchNum) && (temp_t8_3 < var_t3)) ||
|
||||
((var_a1 != batchNum) && (var_a0 < (temp_a3 + 1)->verticesOffset))) &&
|
||||
(var_a2 < 0)) {
|
||||
goto loop_36;
|
||||
}
|
||||
}
|
||||
@@ -868,16 +874,23 @@ loop_36:
|
||||
var_a1_2 = 0;
|
||||
temp_v1_5 = &temp_s3[var_t3];
|
||||
if (batchNum >= 0) {
|
||||
loop_54:
|
||||
loop_54:
|
||||
temp_a3_2 = &var_ra[var_a1_2];
|
||||
if ((temp_a3_2->flags & RENDER_ENVMAP) && (((var_a0_2 = temp_a3_2->verticesOffset, (var_a1_2 == batchNum)) && (var_a0_2 < var_t3)) || ((var_a1_2 != batchNum) && (var_a0_2 < (temp_a3_2 + 1)->facesOffset))) && (var_a2_2 < 0)) {
|
||||
loop_60:
|
||||
if ((temp_a3_2->flags & RENDER_ENVMAP) &&
|
||||
(((var_a0_2 = temp_a3_2->verticesOffset, (var_a1_2 == batchNum)) &&
|
||||
(var_a0_2 < var_t3)) ||
|
||||
((var_a1_2 != batchNum) && (var_a0_2 < (temp_a3_2 + 1)->facesOffset))) &&
|
||||
(var_a2_2 < 0)) {
|
||||
loop_60:
|
||||
temp_v1_6 = &temp_s3[var_a0_2];
|
||||
if ((temp_v1_5->x == temp_v1_6->x) && (temp_v1_5->y == temp_v1_6->y) && (temp_v1_5->z == temp_v1_6->z)) {
|
||||
if ((temp_v1_5->x == temp_v1_6->x) && (temp_v1_5->y == temp_v1_6->y) &&
|
||||
(temp_v1_5->z == temp_v1_6->z)) {
|
||||
var_a2_2 = *(temp_v0_5 + (var_a0_2 * 2));
|
||||
}
|
||||
var_a0_2++;
|
||||
if ((((var_a1_2 == batchNum) && (var_a0_2 < var_t3)) || ((var_a1_2 != batchNum) && (var_a0_2 < (temp_a3_2 + 1)->facesOffset))) && (var_a2_2 < 0)) {
|
||||
if ((((var_a1_2 == batchNum) && (var_a0_2 < var_t3)) ||
|
||||
((var_a1_2 != batchNum) && (var_a0_2 < (temp_a3_2 + 1)->facesOffset))) &&
|
||||
(var_a2_2 < 0)) {
|
||||
goto loop_60;
|
||||
}
|
||||
}
|
||||
@@ -920,7 +933,8 @@ loop_60:
|
||||
while (var_s1_4 < var_v1_3) {
|
||||
temp_s1_2 = var_s1_4 + 1;
|
||||
temp_t0 = &var_ra[var_s1_4];
|
||||
if ((temp_t0->miscData != BATCH_VTX_COL) || (var_t8_2 = temp_s1_2 << 0x10, ((temp_t0->flags & RENDER_ENVMAP) != 0))) {
|
||||
if ((temp_t0->miscData != BATCH_VTX_COL) ||
|
||||
(var_t8_2 = temp_s1_2 << 0x10, ((temp_t0->flags & RENDER_ENVMAP) != 0))) {
|
||||
var_s5_2 = temp_t0->facesOffset;
|
||||
var_t8_2 = temp_s1_2 << 0x10;
|
||||
if (var_s5_2 < (temp_t0 + 1)->facesOffset) {
|
||||
@@ -929,7 +943,7 @@ loop_60:
|
||||
temp_a0 = &spB0->verticesArray[var_t7];
|
||||
var_a3_4 = 0;
|
||||
var_t6 = temp_a0;
|
||||
loop_89:
|
||||
loop_89:
|
||||
temp_a2 = *(temp_v0_5 + ((s16) (var_t6[1] + temp_t0->verticesOffset) * 2));
|
||||
var_a3_4 += 1;
|
||||
if (temp_a2 >= 0) {
|
||||
@@ -975,7 +989,7 @@ loop_89:
|
||||
var_t9_2 = temp_a3_3 << 0x10;
|
||||
if (temp_a2_2 >= 0) {
|
||||
spA0[var_a0_3].x = temp_v0_6[temp_a2_2].x;
|
||||
spA0[var_a0_3].y= temp_v0_6[temp_a2_2].y;
|
||||
spA0[var_a0_3].y = temp_v0_6[temp_a2_2].y;
|
||||
spA0[var_a0_3].z = temp_v0_6[temp_a2_2].z;
|
||||
var_t9_2 = temp_a3_3 << 0x10;
|
||||
var_a0_3++;
|
||||
|
||||
+137
-130
@@ -2164,26 +2164,25 @@ s32 init_object_shading(Object *obj, ShadeProperties *shadeData) {
|
||||
if (obj->segment.header->modelType == OBJECT_MODEL_TYPE_3D_MODEL) {
|
||||
for (i = 0; obj->unk68[i] == NULL; i++) {}
|
||||
if (obj->unk68[i] != NULL && obj->unk68[i]->objModel->unk40 != NULL) {
|
||||
set_shading_properties(obj->shading, obj->segment.header->shadeBrightness,
|
||||
obj->segment.header->shadeAmbient, 0, obj->segment.header->shadeAngleY,
|
||||
obj->segment.header->shadeAngleZ);
|
||||
set_shading_properties(obj->shading, obj->segment.header->shadeAmbient, obj->segment.header->shadeDiffuse,
|
||||
0, obj->segment.header->shadeAngleY, obj->segment.header->shadeAngleZ);
|
||||
if (obj->segment.header->unk3D != 0) {
|
||||
obj->shading->unk4 = obj->segment.header->unk3A;
|
||||
obj->shading->unk5 = obj->segment.header->unk3B;
|
||||
obj->shading->unk6 = obj->segment.header->unk3C;
|
||||
obj->shading->unk7 = obj->segment.header->unk3D;
|
||||
obj->shading->unk8 = -(obj->shading->unk1C >> 1);
|
||||
obj->shading->unkA = -(obj->shading->unk1E >> 1);
|
||||
obj->shading->unkC = -(obj->shading->unk20 >> 1);
|
||||
obj->shading->lightR = obj->segment.header->unk3A;
|
||||
obj->shading->lightG = obj->segment.header->unk3B;
|
||||
obj->shading->lightB = obj->segment.header->unk3C;
|
||||
obj->shading->lightIntensity = obj->segment.header->unk3D;
|
||||
obj->shading->lightDirX = -(obj->shading->shadowDirX >> 1);
|
||||
obj->shading->lightDirY = -(obj->shading->shadowDirY >> 1);
|
||||
obj->shading->lightDirZ = -(obj->shading->shadowDirZ >> 1);
|
||||
}
|
||||
returnSize = sizeof(ShadeProperties);
|
||||
}
|
||||
} else if (obj->segment.header->modelType == OBJECT_MODEL_TYPE_SPRITE_BILLBOARD) {
|
||||
obj->shading->unk0 = 1.0f;
|
||||
shadeData->unk4 = 0xFF;
|
||||
shadeData->unk5 = 0xFF;
|
||||
shadeData->unk6 = 0xFF;
|
||||
shadeData->unk7 = 0;
|
||||
shadeData->lightR = 255;
|
||||
shadeData->lightG = 255;
|
||||
shadeData->lightB = 255;
|
||||
shadeData->lightIntensity = 0;
|
||||
returnSize = 8;
|
||||
}
|
||||
if (returnSize == 0) {
|
||||
@@ -3181,8 +3180,8 @@ void render_3d_billboard(Object *obj) {
|
||||
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, 255, 255, 255, 255);
|
||||
}
|
||||
if (hasEnvCol) {
|
||||
gDPSetEnvColor(gObjectCurrDisplayList++, obj->shading->unk4, obj->shading->unk5, obj->shading->unk6,
|
||||
obj->shading->unk7);
|
||||
gDPSetEnvColor(gObjectCurrDisplayList++, obj->shading->lightR, obj->shading->lightG, obj->shading->lightB,
|
||||
obj->shading->lightIntensity);
|
||||
} else if (obj->behaviorId == BHV_LAVA_SPURT) {
|
||||
hasEnvCol = TRUE;
|
||||
gDPSetEnvColor(gObjectCurrDisplayList++, 255, 255, 0, 255);
|
||||
@@ -3238,11 +3237,11 @@ void render_3d_billboard(Object *obj) {
|
||||
void render_3d_model(Object *obj) {
|
||||
s32 i;
|
||||
s32 intensity;
|
||||
s32 alpha;
|
||||
s32 opacity;
|
||||
s32 vertOffset;
|
||||
s32 obj60_unk0;
|
||||
s32 hasOpacity;
|
||||
s32 hasEnvCol;
|
||||
s32 hasLighting;
|
||||
s32 flags;
|
||||
s32 meshBatch;
|
||||
s32 cicFailed;
|
||||
@@ -3261,12 +3260,12 @@ void render_3d_model(Object *obj) {
|
||||
if (obj68 != NULL) {
|
||||
objModel = obj68->objModel;
|
||||
hasOpacity = FALSE;
|
||||
hasEnvCol = FALSE;
|
||||
hasLighting = FALSE;
|
||||
intensity = 255;
|
||||
if (obj->shading != NULL) {
|
||||
intensity = (s32) (obj->shading->unk0 * 255.0f * gCurrentLightIntensity);
|
||||
hasOpacity = TRUE;
|
||||
hasEnvCol = TRUE;
|
||||
hasLighting = TRUE;
|
||||
}
|
||||
if (obj->behaviorId == BHV_RACER) {
|
||||
racerObj = &obj->unk64->racer;
|
||||
@@ -3324,44 +3323,44 @@ void render_3d_model(Object *obj) {
|
||||
racerObj->headAngle = 0;
|
||||
}
|
||||
}
|
||||
alpha = obj->segment.object.opacity;
|
||||
if (alpha > 255) {
|
||||
alpha = 255;
|
||||
opacity = obj->segment.object.opacity;
|
||||
if (opacity > 255) {
|
||||
opacity = 255;
|
||||
}
|
||||
// If the behavior is a water zipper, then halve it's transparency.
|
||||
if (obj->behaviorId == BHV_ZIPPER_WATER) {
|
||||
alpha >>= 1;
|
||||
opacity >>= 1;
|
||||
}
|
||||
if (alpha < 255) {
|
||||
if (opacity < 255) {
|
||||
hasOpacity = TRUE;
|
||||
}
|
||||
if (hasEnvCol) {
|
||||
gDPSetEnvColor(gObjectCurrDisplayList++, obj->shading->unk4, obj->shading->unk5, obj->shading->unk6,
|
||||
obj->shading->unk7);
|
||||
if (hasLighting) {
|
||||
gDPSetEnvColor(gObjectCurrDisplayList++, obj->shading->lightR, obj->shading->lightG, obj->shading->lightB,
|
||||
obj->shading->lightIntensity);
|
||||
} else {
|
||||
gDPSetEnvColor(gObjectCurrDisplayList++, 255, 255, 255, 0);
|
||||
}
|
||||
if (obj->segment.header->unk71) {
|
||||
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, obj->shading->unk18, obj->shading->unk19,
|
||||
obj->shading->unk1A, alpha);
|
||||
tex_primcolour_on();
|
||||
if (obj->segment.header->directionalPointLighting) {
|
||||
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, obj->shading->shadowR, obj->shading->shadowG,
|
||||
obj->shading->shadowB, opacity);
|
||||
directional_lighting_on();
|
||||
} else if (hasOpacity) {
|
||||
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, intensity, intensity, intensity, alpha);
|
||||
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, intensity, intensity, intensity, opacity);
|
||||
} else {
|
||||
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, 255, 255, 255, 255);
|
||||
}
|
||||
if (alpha < 255) {
|
||||
if (opacity < 255) {
|
||||
meshBatch = render_mesh(objModel, obj, 0, RENDER_SEMI_TRANSPARENT, vertOffset);
|
||||
} else {
|
||||
meshBatch = render_mesh(objModel, obj, 0, RENDER_NONE, vertOffset);
|
||||
}
|
||||
if (obj->segment.header->unk71) {
|
||||
if (obj->segment.header->directionalPointLighting) {
|
||||
if (hasOpacity) {
|
||||
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, intensity, intensity, intensity, alpha);
|
||||
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, intensity, intensity, intensity, opacity);
|
||||
} else {
|
||||
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, 255, 255, 255, 255);
|
||||
}
|
||||
tex_primcolour_off();
|
||||
directional_lighting_off();
|
||||
}
|
||||
if (obj->unk60 != NULL) {
|
||||
obj60_unk0 = obj->unk60->unk0;
|
||||
@@ -3385,7 +3384,7 @@ void render_3d_model(Object *obj) {
|
||||
} else {
|
||||
flags = (RENDER_Z_COMPARE | RENDER_FOG_ACTIVE | RENDER_Z_UPDATE | RENDER_ANTI_ALIASING);
|
||||
}
|
||||
if (alpha < 255) {
|
||||
if (opacity < 255) {
|
||||
flags |= RENDER_SEMI_TRANSPARENT;
|
||||
}
|
||||
#ifdef ANTI_TAMPER
|
||||
@@ -3405,7 +3404,8 @@ void render_3d_model(Object *obj) {
|
||||
if (var_v0_2) {
|
||||
func_80012C98(&gObjectCurrDisplayList);
|
||||
gDPSetEnvColor(gObjectCurrDisplayList++, 255, 255, 255, 0);
|
||||
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, intensity, intensity, intensity, alpha);
|
||||
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, intensity, intensity, intensity,
|
||||
opacity);
|
||||
}
|
||||
loopObj->properties.common.unk0 =
|
||||
render_sprite_billboard(&gObjectCurrDisplayList, &gObjectCurrMatrix,
|
||||
@@ -3444,20 +3444,20 @@ void render_3d_model(Object *obj) {
|
||||
}
|
||||
}
|
||||
if (meshBatch != -1) {
|
||||
if (obj->segment.header->unk71) {
|
||||
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, obj->shading->unk18, obj->shading->unk19,
|
||||
obj->shading->unk1A, alpha);
|
||||
tex_primcolour_on();
|
||||
if (obj->segment.header->directionalPointLighting) {
|
||||
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, obj->shading->shadowR, obj->shading->shadowG,
|
||||
obj->shading->shadowB, opacity);
|
||||
directional_lighting_on();
|
||||
}
|
||||
render_mesh(objModel, obj, meshBatch, RENDER_SEMI_TRANSPARENT, vertOffset);
|
||||
if (obj->segment.header->unk71) {
|
||||
tex_primcolour_off();
|
||||
if (obj->segment.header->directionalPointLighting) {
|
||||
directional_lighting_off();
|
||||
}
|
||||
}
|
||||
if (hasOpacity || obj->segment.header->unk71) {
|
||||
if (hasOpacity || obj->segment.header->directionalPointLighting) {
|
||||
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, 255, 255, 255, 255);
|
||||
}
|
||||
if (hasEnvCol) {
|
||||
if (hasLighting) {
|
||||
gDPSetEnvColor(gObjectCurrDisplayList++, 255, 255, 255, 0);
|
||||
}
|
||||
mtx_pop(&gObjectCurrDisplayList);
|
||||
@@ -6704,52 +6704,52 @@ UNUSED void func_8001D248(UNUSED s32 arg0, UNUSED s32 arg1, UNUSED s32 arg2) {
|
||||
* Applies shading properties to a global variable.
|
||||
* Presumably intended for level geometry, which supports shading, but never uses it.
|
||||
*/
|
||||
void set_world_shading(f32 brightness, f32 ambient, s16 angleX, s16 angleY, s16 angleZ) {
|
||||
set_shading_properties((ShadeProperties *) &gWorldShading, brightness, ambient, angleX, angleY, angleZ);
|
||||
void set_world_shading(f32 ambient, f32 diffuse, s16 angleX, s16 angleY, s16 angleZ) {
|
||||
set_shading_properties((ShadeProperties *) &gWorldShading, ambient, diffuse, angleX, angleY, angleZ);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add values onto the existing properties of an objects shading.
|
||||
* Resets the shading based off the new values.
|
||||
*/
|
||||
UNUSED void add_shading_properties(Object *obj, f32 brightnessChange, f32 ambientChange, s16 angleX, s16 angleY,
|
||||
UNUSED void add_shading_properties(Object *obj, f32 ambientChange, f32 diffuseChange, s16 angleX, s16 angleY,
|
||||
s16 angleZ) {
|
||||
if (obj->shading != NULL) {
|
||||
obj->shading->brightness += brightnessChange;
|
||||
if (obj->shading->brightness < 0.0f) {
|
||||
obj->shading->brightness = 0.0f;
|
||||
} else if (obj->shading->brightness > 1.0f) {
|
||||
obj->shading->brightness = 1.0f;
|
||||
}
|
||||
obj->shading->ambient += ambientChange;
|
||||
if (obj->shading->ambient < 0.0f) {
|
||||
obj->shading->ambient = 0.0f;
|
||||
} else if (obj->shading->ambient > 1.0f) {
|
||||
obj->shading->ambient = 1.0f;
|
||||
}
|
||||
if (obj->shading->ambient >= 2.0f) {
|
||||
obj->shading->ambient = 1.99f;
|
||||
obj->shading->diffuse += diffuseChange;
|
||||
if (obj->shading->diffuse < 0.0f) {
|
||||
obj->shading->diffuse = 0.0f;
|
||||
}
|
||||
set_shading_properties(obj->shading, obj->shading->brightness, obj->shading->ambient,
|
||||
if (obj->shading->diffuse >= 2.0f) {
|
||||
obj->shading->diffuse = 1.99f;
|
||||
}
|
||||
set_shading_properties(obj->shading, obj->shading->ambient, obj->shading->diffuse,
|
||||
(obj->shading->unk22 + angleX), (obj->shading->unk24 + angleY),
|
||||
(obj->shading->unk26 + angleZ));
|
||||
if (obj->segment.header->unk3D != 0) {
|
||||
obj->shading->unk4 = obj->segment.header->unk3A;
|
||||
obj->shading->unk5 = obj->segment.header->unk3B;
|
||||
obj->shading->unk6 = obj->segment.header->unk3C;
|
||||
obj->shading->unk7 = obj->segment.header->unk3D;
|
||||
obj->shading->unk8 = -(obj->shading->unk1C >> 1);
|
||||
obj->shading->unkA = -(obj->shading->unk1E >> 1);
|
||||
obj->shading->unkC = -(obj->shading->unk20 >> 1);
|
||||
obj->shading->lightR = obj->segment.header->unk3A;
|
||||
obj->shading->lightG = obj->segment.header->unk3B;
|
||||
obj->shading->lightB = obj->segment.header->unk3C;
|
||||
obj->shading->lightIntensity = obj->segment.header->unk3D;
|
||||
obj->shading->lightDirX = -(obj->shading->shadowDirX >> 1);
|
||||
obj->shading->lightDirY = -(obj->shading->shadowDirY >> 1);
|
||||
obj->shading->lightDirZ = -(obj->shading->shadowDirZ >> 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void set_shading_properties(ShadeProperties *arg0, f32 brightness, f32 ambient, s16 angleX, s16 angleY, s16 angleZ) {
|
||||
void set_shading_properties(ShadeProperties *arg0, f32 ambient, f32 diffuse, s16 angleX, s16 angleY, s16 angleZ) {
|
||||
Vec3s angle;
|
||||
Vec3f velocityPos;
|
||||
|
||||
arg0->unk22 = angleX;
|
||||
arg0->brightness = brightness;
|
||||
arg0->ambient = ambient;
|
||||
arg0->diffuse = diffuse;
|
||||
arg0->unk0 = 1.0f;
|
||||
arg0->unk24 = angleY;
|
||||
arg0->unk26 = angleZ;
|
||||
@@ -6760,12 +6760,12 @@ void set_shading_properties(ShadeProperties *arg0, f32 brightness, f32 ambient,
|
||||
velocityPos.x = 0.0f;
|
||||
velocityPos.y = 0.0f;
|
||||
vec3f_rotate(&angle, &velocityPos);
|
||||
arg0->unk1C = -velocityPos.x;
|
||||
arg0->unk1E = -velocityPos.y;
|
||||
arg0->unk20 = -velocityPos.z;
|
||||
arg0->unk18 = 0;
|
||||
arg0->unk19 = 0;
|
||||
arg0->unk1A = 0;
|
||||
arg0->shadowDirX = -velocityPos.x;
|
||||
arg0->shadowDirY = -velocityPos.y;
|
||||
arg0->shadowDirZ = -velocityPos.z;
|
||||
arg0->shadowR = 0;
|
||||
arg0->shadowG = 0;
|
||||
arg0->shadowB = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -6809,11 +6809,11 @@ void obj_shade_fancy(ObjectModel *model, Object *object, s32 arg2, f32 intensity
|
||||
|
||||
if (dynamicLightingEnabled) {
|
||||
// Calculates dynamic lighting for the object
|
||||
if (object->segment.header->unk71) {
|
||||
// Dynamic lighting for some objects? (Intro diddy, Taj, T.T., Bosses)
|
||||
if (object->segment.header->directionalPointLighting) {
|
||||
// Dynamic directional lighting for some objects (Intro diddy, Taj, T.T., Bosses)
|
||||
calc_dynamic_lighting_for_object_1(object, model, arg2, object, intensity, 1.0f);
|
||||
} else {
|
||||
// Dynamic lighting for other objects? (Racers, Rare logo, Wizpig face, etc.)
|
||||
// Dynamic ambient lighting for other objects (Racers, Rare logo, Wizpig face, etc.)
|
||||
calc_dynamic_lighting_for_object_2(object, model, arg2, intensity);
|
||||
}
|
||||
}
|
||||
@@ -6828,93 +6828,100 @@ void obj_shade_fancy(ObjectModel *model, Object *object, s32 arg2, f32 intensity
|
||||
|
||||
void calc_dynamic_lighting_for_object_1(Object *object, ObjectModel *model, s16 arg2, Object *anotherObject,
|
||||
f32 intensity, f32 arg5) {
|
||||
s16 sp9E;
|
||||
s16 normIdx;
|
||||
s16 j;
|
||||
s16 i;
|
||||
Vec3s sp94;
|
||||
Vec3s objRot;
|
||||
s32 s6;
|
||||
s32 x1, y1, z1;
|
||||
s32 x2, y2, z2;
|
||||
s32 ambientTemp;
|
||||
s32 brightnessTemp;
|
||||
s32 t8;
|
||||
s32 v1;
|
||||
Vec3f sp5C;
|
||||
s32 lightDirX, lightDirY, lightDirZ; // 16.16 fixed point, normalized
|
||||
s32 shadowDirX, shadowDirY, shadowDirZ; // 16.16 fixed point, normalized
|
||||
s32 diffuseFactor;
|
||||
s32 ambientFactor;
|
||||
s32 lightIntensity;
|
||||
s32 shadeStrength;
|
||||
Vec3f direction;
|
||||
Vertex *vertices;
|
||||
Vec3s *model40Entries;
|
||||
Vec3s *normals;
|
||||
|
||||
if (object->shading == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
vertices = object->curVertData;
|
||||
model40Entries = model->unk40;
|
||||
sp9E = 0;
|
||||
normals = model->unk40;
|
||||
normIdx = 0;
|
||||
|
||||
sp5C.x = -(object->shading->unk8 << 3);
|
||||
sp5C.y = -(object->shading->unkA << 3);
|
||||
sp5C.z = -(object->shading->unkC << 3);
|
||||
sp94.y_rotation = -object->segment.trans.rotation.y_rotation;
|
||||
sp94.x_rotation = -object->segment.trans.rotation.x_rotation;
|
||||
sp94.z_rotation = -object->segment.trans.rotation.z_rotation;
|
||||
vec3f_rotate_ypr(&sp94, &sp5C);
|
||||
direction.x = -(object->shading->lightDirX << 3);
|
||||
direction.y = -(object->shading->lightDirY << 3);
|
||||
direction.z = -(object->shading->lightDirZ << 3);
|
||||
objRot.y_rotation = -object->segment.trans.rotation.y_rotation;
|
||||
objRot.x_rotation = -object->segment.trans.rotation.x_rotation;
|
||||
objRot.z_rotation = -object->segment.trans.rotation.z_rotation;
|
||||
vec3f_rotate_ypr(&objRot, &direction);
|
||||
|
||||
if (object->segment.header->unk3D != 0 && arg2) {
|
||||
mtxf_transform_dir(get_projection_matrix_f32(), &sp5C, &sp5C);
|
||||
mtxf_transform_dir(get_projection_matrix_f32(), &direction, &direction);
|
||||
}
|
||||
|
||||
x1 = -sp5C.x;
|
||||
y1 = -sp5C.y;
|
||||
z1 = -sp5C.z;
|
||||
s6 = object->shading->unk7;
|
||||
sp5C.x = object->shading->unk1C << 2;
|
||||
sp5C.y = object->shading->unk1E << 2;
|
||||
sp5C.z = object->shading->unk20 << 2;
|
||||
lightDirX = -direction.x;
|
||||
lightDirY = -direction.y;
|
||||
lightDirZ = -direction.z;
|
||||
s6 = object->shading->lightIntensity;
|
||||
|
||||
direction.x = object->shading->shadowDirX << 2;
|
||||
direction.y = object->shading->shadowDirY << 2;
|
||||
direction.z = object->shading->shadowDirZ << 2;
|
||||
|
||||
if (arg2) {
|
||||
mtxf_transform_dir(get_projection_matrix_f32(), &sp5C, &sp5C);
|
||||
mtxf_transform_dir(get_projection_matrix_f32(), &direction, &direction);
|
||||
}
|
||||
vec3f_rotate_ypr(&sp94, &sp5C);
|
||||
vec3f_rotate_ypr(&objRot, &direction);
|
||||
|
||||
x2 = sp5C.x;
|
||||
y2 = sp5C.y;
|
||||
z2 = sp5C.z;
|
||||
shadowDirX = direction.x;
|
||||
shadowDirY = direction.y;
|
||||
shadowDirZ = direction.z;
|
||||
|
||||
brightnessTemp = object->shading->brightness * object->shading->unk0 * 255.0f * intensity;
|
||||
ambientTemp = object->shading->ambient * object->shading->unk0 * 255.0f * intensity;
|
||||
ambientFactor = object->shading->ambient * object->shading->unk0 * 255.0f * intensity;
|
||||
diffuseFactor = object->shading->diffuse * object->shading->unk0 * 255.0f * intensity;
|
||||
|
||||
for (i = 0; i < model->numberOfBatches; i++) {
|
||||
if (model->batches[i].miscData != BATCH_VTX_COL) { // 0xFF means use vertex colors
|
||||
for (j = model->batches[i].verticesOffset; j < model->batches[i + 1].verticesOffset; j++) {
|
||||
t8 = (model40Entries[sp9E].x * x1 + model40Entries[sp9E].y * y1 + model40Entries[sp9E].z * z1) >> 13;
|
||||
if (t8 > 0) {
|
||||
t8 = (t8 * s6) >> 16;
|
||||
if (t8 > 255) {
|
||||
t8 = 255;
|
||||
// calculate lighting
|
||||
lightIntensity = (normals[normIdx].x * lightDirX + normals[normIdx].y * lightDirY +
|
||||
normals[normIdx].z * lightDirZ) >>
|
||||
13;
|
||||
if (lightIntensity > 0) {
|
||||
lightIntensity = (lightIntensity * s6) >> 16;
|
||||
if (lightIntensity > 255) {
|
||||
lightIntensity = 255;
|
||||
}
|
||||
} else {
|
||||
t8 = 0;
|
||||
lightIntensity = 0;
|
||||
}
|
||||
|
||||
v1 = (model40Entries[sp9E].x * x2 + model40Entries[sp9E].y * y2 + model40Entries[sp9E].z * z2) >> 13;
|
||||
if (v1 > 0) {
|
||||
v1 = (v1 * ambientTemp) >> 16;
|
||||
v1 += brightnessTemp;
|
||||
if (v1 > 255) {
|
||||
v1 = 255;
|
||||
// calculate shading
|
||||
shadeStrength = (normals[normIdx].x * shadowDirX + normals[normIdx].y * shadowDirY +
|
||||
normals[normIdx].z * shadowDirZ) >>
|
||||
13;
|
||||
if (shadeStrength > 0) {
|
||||
shadeStrength = (shadeStrength * diffuseFactor) >> 16;
|
||||
shadeStrength += ambientFactor;
|
||||
if (shadeStrength > 255) {
|
||||
shadeStrength = 255;
|
||||
}
|
||||
} else {
|
||||
v1 = brightnessTemp;
|
||||
shadeStrength = ambientFactor;
|
||||
}
|
||||
|
||||
vertices[j].r = t8;
|
||||
vertices[j].g = t8;
|
||||
vertices[j].b = t8;
|
||||
vertices[j].a = v1;
|
||||
sp9E++;
|
||||
vertices[j].r = lightIntensity;
|
||||
vertices[j].g = lightIntensity;
|
||||
vertices[j].b = lightIntensity;
|
||||
vertices[j].a = shadeStrength;
|
||||
normIdx++;
|
||||
}
|
||||
} else if (model->batches[i].flags & RENDER_ENVMAP) {
|
||||
sp9E += model->batches[i + 1].verticesOffset - model->batches[i].verticesOffset;
|
||||
normIdx += model->batches[i + 1].verticesOffset - model->batches[i].verticesOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -406,8 +406,8 @@ void ainode_enable(void);
|
||||
void ainode_tail_set(s32 nodeID);
|
||||
Object *ainode_tail(s32 *nodeID);
|
||||
Object *ainode_get(s32 nodeID);
|
||||
void set_world_shading(f32 brightness, f32 ambient, s16 angleX, s16 angleY, s16 angleZ);
|
||||
void set_shading_properties(ShadeProperties *arg0, f32 brightness, f32 ambient, s16 angleX, s16 angleY, s16 angleZ);
|
||||
void set_world_shading(f32 ambient, f32 diffuse, s16 angleX, s16 angleY, s16 angleZ);
|
||||
void set_shading_properties(ShadeProperties *arg0, f32 ambient, f32 diffuse, s16 angleX, s16 angleY, s16 angleZ);
|
||||
void obj_shade_fancy(ObjectModel *model, Object *object, s32 arg2, f32 intensity);
|
||||
s32 *get_misc_asset(s32 index);
|
||||
s32 func_8001E2EC(s32 arg0);
|
||||
|
||||
+1
-1
@@ -515,7 +515,7 @@ s32 debug_text_character(Gfx **dList, s32 asciiVal) {
|
||||
fontCharU = gDebugFontCoords[gDebugFontTexture][asciiVal].u;
|
||||
fontCharWidth = (gDebugFontCoords[gDebugFontTexture][asciiVal].v - fontCharU) + 1;
|
||||
if (gDebugTextOn) {
|
||||
gDPSetCombineMode((*dList)++, DKR_CC_UNK12, DKR_CC_UNK12);
|
||||
gDPSetCombineMode((*dList)++, G_CC_ENV_DECALA, G_CC_ENV_DECALA);
|
||||
gSPTextureRectangle((*dList)++, (gDebugTextX << 2), (gDebugTextY << 2), ((gDebugTextX + fontCharWidth) << 2),
|
||||
((gDebugTextY + 10) << 2), 0, (fontCharU << 5), 0, 1024, 1024);
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
// Render settings for the screens
|
||||
Gfx gRdpSetModeScreenAsset[] = {
|
||||
gsDPSetCombineMode(DKR_CC_UNK10, DKR_CC_UNK10),
|
||||
gsDPSetCombineMode(G_CC_DECAL_SCALE, G_CC_DECAL_SCALE),
|
||||
gsDPSetOtherMode(DKR_OMH_COPY_POINT_NOPERSP, DKR_OML_COMMON | G_RM_NOOP | G_RM_NOOP2),
|
||||
};
|
||||
|
||||
|
||||
+249
-181
File diff suppressed because it is too large
Load Diff
@@ -151,8 +151,8 @@ s32 tex_get_table_3D(void);
|
||||
s32 sprite_table_size(void);
|
||||
void set_texture_colour_tag(s32 tagID);
|
||||
void rendermode_reset(Gfx **dList);
|
||||
void tex_primcolour_on(void);
|
||||
void tex_primcolour_off(void);
|
||||
void directional_lighting_on(void);
|
||||
void directional_lighting_off(void);
|
||||
void material_set_no_tex_offset(Gfx **dList, TextureHeader *texhead, u32 flags);
|
||||
void sprite_opaque(s32 setting);
|
||||
s32 tex_palette_id(s16 paletteID);
|
||||
|
||||
+2
-2
@@ -1558,7 +1558,7 @@ void draw_gradient_background(void) {
|
||||
headerGreen1 = gCurrentLevelHeader2->BGColourBottomG;
|
||||
headerBlue1 = gCurrentLevelHeader2->BGColourBottomB;
|
||||
rendermode_reset(&gTrackDL);
|
||||
material_set_no_tex_offset(&gTrackDL, 0, RENDER_FOG_ACTIVE);
|
||||
material_set_no_tex_offset(&gTrackDL, NULL, RENDER_FOG_ACTIVE);
|
||||
gSPVertexDKR(gTrackDL++, OS_K0_TO_PHYSICAL(verts), 4, 0);
|
||||
gSPPolygon(gTrackDL++, OS_K0_TO_PHYSICAL(tris), 2, 0);
|
||||
|
||||
@@ -1829,7 +1829,7 @@ void render_level_geometry_and_objects(void) {
|
||||
}
|
||||
|
||||
rendermode_reset(&gTrackDL);
|
||||
material_set_no_tex_offset(&gTrackDL, 0, RENDER_FOG_ACTIVE | RENDER_Z_COMPARE);
|
||||
material_set_no_tex_offset(&gTrackDL, NULL, RENDER_FOG_ACTIVE | RENDER_Z_COMPARE);
|
||||
func_80012C3C(&gTrackDL);
|
||||
|
||||
// Particles and FX
|
||||
|
||||
+2
-2
@@ -988,7 +988,7 @@ void waves_render(Gfx **dList, Mtx **mtx, s32 viewportID) {
|
||||
tex2 = set_animated_texture_header(gWaveTexture, gWaveBatch->texOffset * (128 * 128));
|
||||
wave_load_material(tex1, 1);
|
||||
wave_load_material(tex2, 0);
|
||||
gDPSetCombineMode(gWaveDL++, DKR_CC_UNK14, DKR_CC_UNK15);
|
||||
gDPSetCombineMode(gWaveDL++, G_CC_BLENDTEX_MODULATEA_1_PRIM, G_CC_BLENDI_ENV_ALPHA_MODULATEA2);
|
||||
if (TEX_FORMAT(tex1->format) == TEX_FORMAT_RGBA32 &&
|
||||
cam_get_viewport_layout() <= VIEWPORT_LAYOUT_1_PLAYER) {
|
||||
gDPSetOtherMode(gWaveDL++, DKR_OMH_2CYC_BILERP, DKR_OML_COMMON | G_RM_AA_ZB_XLU_INTER2);
|
||||
@@ -1006,7 +1006,7 @@ void waves_render(Gfx **dList, Mtx **mtx, s32 viewportID) {
|
||||
gSPSetGeometryMode(gWaveDL++, G_FOG);
|
||||
tex1 = set_animated_texture_header(gWaveTexture, gWaveBatch->texOffset * (128 * 128));
|
||||
gDkrDmaDisplayList(gWaveDL++, OS_K0_TO_PHYSICAL(tex1->cmd), tex1->numberOfCommands);
|
||||
gDPSetCombineMode(gWaveDL++, DKR_CC_UNK16, DKR_CC_UNK8);
|
||||
gDPSetCombineMode(gWaveDL++, G_CC_BLENDT_ENV_ALPHA_A_PRIM, G_CC_MODULATEIDECALA2);
|
||||
gDPSetOtherMode(gWaveDL++, DKR_OMH_2CYC_BILERP, DKR_OML_COMMON | G_RM_FOG_SHADE_A | G_RM_AA_ZB_OPA_SURF2);
|
||||
gDPSetPrimColor(gWaveDL++, 0, 0, 255, 255, 255, 255);
|
||||
if (D_800E3180 != NULL) {
|
||||
|
||||
@@ -1275,8 +1275,8 @@ tex_free = 0x8007B5CC;
|
||||
set_texture_colour_tag = 0x8007B684;
|
||||
tex_cache_index = 0x8007B690;
|
||||
rendermode_reset = 0x8007B6E0;
|
||||
tex_primcolour_on = 0x8007B74C;
|
||||
tex_primcolour_off = 0x8007B764;
|
||||
directional_lighting_on = 0x8007B74C;
|
||||
directional_lighting_off = 0x8007B764;
|
||||
set_animated_texture_header = 0x8007B77C;
|
||||
material_set_no_tex_offset = 0x8007B7D8;
|
||||
material_set = 0x8007B7F8;
|
||||
@@ -2257,7 +2257,7 @@ D_800DC954 = 0x800DE2F4;
|
||||
gMaxLights = 0x800DE2F8;
|
||||
gNumActiveLights = 0x800DE2FC;
|
||||
D_800DC960 = 0x800DE300;
|
||||
D_800DC964 = 0x800DE304;
|
||||
gLightDirs = 0x800DE304;
|
||||
D_800DC968 = 0x800DE308;
|
||||
|
||||
// object_functions.c .data
|
||||
@@ -2450,7 +2450,7 @@ dRenderSettingsDecal = 0x800E0798;
|
||||
dRenderSettingsSolidColourVtxAlpha = 0x800E0898;
|
||||
dRenderSettingsSolidColour = 0x800E08D8;
|
||||
dRenderSettingsPrimOverlay = 0x800E09D8;
|
||||
dRenderSettingsPrimCol = 0x800E0A58;
|
||||
dRenderSettingsDirectionalLighting = 0x800E0A58;
|
||||
dRenderSettingsBlinkingLights = 0x800E0B58;
|
||||
dBasicRenderSettingsZBOff = 0x800E0D58;
|
||||
dBasicRenderSettingsZBOn = 0x800E0D88;
|
||||
@@ -4135,9 +4135,9 @@ gTextureCache = 0x80127DB8;
|
||||
gCiPalettes = 0x80127DBC;
|
||||
gNumberOfLoadedTextures = 0x80127DC0;
|
||||
D_80126334 = 0x80127DC4;
|
||||
gTextureAssetID = 0x80127DC8;
|
||||
gTextureTableSize = 0x80127DC8;
|
||||
gCiPalettesSize = 0x80127DD0;
|
||||
D_80126344 = 0x80127DD4;
|
||||
gFirstTexIsLoaded = 0x80127DD4;
|
||||
gSpriteOffsetTable = 0x80127DD8;
|
||||
gSpriteCache = 0x80127DDC;
|
||||
gCurrentSprite = 0x80127DE0;
|
||||
@@ -4154,7 +4154,7 @@ gBlockedRenderFlags = 0x80127E08;
|
||||
gCurrentTextureHeader = 0x80127E0C;
|
||||
gUsingTexture = 0x80127E10;
|
||||
gForceFlags = 0x80127E12;
|
||||
gUsePrimColour = 0x80127E14;
|
||||
gUseDirectionalLighting = 0x80127E14;
|
||||
|
||||
// menu .bss
|
||||
gCourseInitials = 0x80127E20;
|
||||
|
||||
@@ -1271,8 +1271,8 @@ tex_free = 0x8007B2BC;
|
||||
set_texture_colour_tag = 0x8007B374;
|
||||
tex_cache_index = 0x8007B380;
|
||||
rendermode_reset = 0x8007B3D0;
|
||||
tex_primcolour_on = 0x8007B43C;
|
||||
tex_primcolour_off = 0x8007B454;
|
||||
directional_lighting_on = 0x8007B43C;
|
||||
directional_lighting_off = 0x8007B454;
|
||||
set_animated_texture_header = 0x8007B46C;
|
||||
material_set_no_tex_offset = 0x8007B4C8;
|
||||
material_set = 0x8007B4E8;
|
||||
@@ -2153,7 +2153,7 @@ D_800DC954 = 0x800DC9E4;
|
||||
gMaxLights = 0x800DC9E8;
|
||||
gNumActiveLights = 0x800DC9EC;
|
||||
D_800DC960 = 0x800DC9F0;
|
||||
D_800DC964 = 0x800DC9F4;
|
||||
gLightDirs = 0x800DC9F4;
|
||||
D_800DC968 = 0x800DC9F8;
|
||||
gTajTransformTransitionEnd = 0x800DCA00;
|
||||
gTajTransition = 0x800DCA08;
|
||||
@@ -2303,7 +2303,7 @@ dRenderSettingsDecal = 0x800DEE78;
|
||||
dRenderSettingsSolidColourVtxAlpha = 0x800DEF78;
|
||||
dRenderSettingsSolidColour = 0x800DEFB8;
|
||||
dRenderSettingsPrimOverlay = 0x800DF0B8;
|
||||
dRenderSettingsPrimCol = 0x800DF138;
|
||||
dRenderSettingsDirectionalLighting = 0x800DF138;
|
||||
dRenderSettingsBlinkingLights = 0x800DF238;
|
||||
dBasicRenderSettingsZBOff = 0x800DF438;
|
||||
dBasicRenderSettingsZBOn = 0x800DF468;
|
||||
@@ -3821,9 +3821,9 @@ gTextureCache = 0x801263B8;
|
||||
gCiPalettes = 0x801263BC;
|
||||
gNumberOfLoadedTextures = 0x801263C0;
|
||||
D_80126334 = 0x801263C4;
|
||||
gTextureAssetID = 0x801263C8;
|
||||
gTextureTableSize = 0x801263C8;
|
||||
gCiPalettesSize = 0x801263D0;
|
||||
D_80126344 = 0x801263D4;
|
||||
gFirstTexIsLoaded = 0x801263D4;
|
||||
gSpriteOffsetTable = 0x801263D8;
|
||||
gSpriteCache = 0x801263DC;
|
||||
gCurrentSprite = 0x801263E0;
|
||||
@@ -3840,7 +3840,7 @@ gBlockedRenderFlags = 0x80126408;
|
||||
gCurrentTextureHeader = 0x8012640C;
|
||||
gUsingTexture = 0x80126410;
|
||||
gForceFlags = 0x80126412;
|
||||
gUsePrimColour = 0x80126414;
|
||||
gUseDirectionalLighting = 0x80126414;
|
||||
gCourseInitials = 0x80126420;
|
||||
gFLapInitials = 0x80126424;
|
||||
gAdventureSaveGhost = 0x80126428;
|
||||
|
||||
@@ -1194,8 +1194,8 @@ tex_free = 0x8007B70C;
|
||||
set_texture_colour_tag = 0x8007B7C4;
|
||||
tex_cache_index = 0x8007B7D0;
|
||||
rendermode_reset = 0x8007B820;
|
||||
tex_primcolour_on = 0x8007B88C;
|
||||
tex_primcolour_off = 0x8007B8A4;
|
||||
directional_lighting_on = 0x8007B88C;
|
||||
directional_lighting_off = 0x8007B8A4;
|
||||
set_animated_texture_header = 0x8007B8BC;
|
||||
material_set_no_tex_offset = 0x8007B918;
|
||||
material_set = 0x8007B938;
|
||||
@@ -2080,7 +2080,7 @@ D_800DC954 = 0x800DCF54;
|
||||
gMaxLights = 0x800DCF58;
|
||||
gNumActiveLights = 0x800DCF5C;
|
||||
D_800DC960 = 0x800DCF60;
|
||||
D_800DC964 = 0x800DCF64;
|
||||
gLightDirs = 0x800DCF64;
|
||||
D_800DC968 = 0x800DCF68;
|
||||
gTajTransformTransitionEnd = 0x800DCF70;
|
||||
gTajTransition = 0x800DCF78;
|
||||
@@ -2231,7 +2231,7 @@ dRenderSettingsDecal = 0x800DF3F8;
|
||||
dRenderSettingsSolidColourVtxAlpha = 0x800DF4F8;
|
||||
dRenderSettingsSolidColour = 0x800DF538;
|
||||
dRenderSettingsPrimOverlay = 0x800DF638;
|
||||
dRenderSettingsPrimCol = 0x800DF6B8;
|
||||
dRenderSettingsDirectionalLighting = 0x800DF6B8;
|
||||
dRenderSettingsBlinkingLights = 0x800DF7B8;
|
||||
dBasicRenderSettingsZBOff = 0x800DF9B8;
|
||||
dBasicRenderSettingsZBOn = 0x800DF9E8;
|
||||
@@ -3753,9 +3753,9 @@ gTextureCache = 0x80126958;
|
||||
gCiPalettes = 0x8012695C;
|
||||
gNumberOfLoadedTextures = 0x80126960;
|
||||
D_80126334 = 0x80126964;
|
||||
gTextureAssetID = 0x80126968;
|
||||
gTextureTableSize = 0x80126968;
|
||||
gCiPalettesSize = 0x80126970;
|
||||
D_80126344 = 0x80126974;
|
||||
gFirstTexIsLoaded = 0x80126974;
|
||||
gSpriteOffsetTable = 0x80126978;
|
||||
gSpriteCache = 0x8012697C;
|
||||
gCurrentSprite = 0x80126980;
|
||||
@@ -3772,7 +3772,7 @@ gBlockedRenderFlags = 0x801269A8;
|
||||
gCurrentTextureHeader = 0x801269AC;
|
||||
gUsingTexture = 0x801269B0;
|
||||
gForceFlags = 0x801269B2;
|
||||
gUsePrimColour = 0x801269B4;
|
||||
gUseDirectionalLighting = 0x801269B4;
|
||||
gCourseInitials = 0x801269C0;
|
||||
gFLapInitials = 0x801269C4;
|
||||
gAdventureSaveGhost = 0x801269C8;
|
||||
|
||||
@@ -1271,8 +1271,8 @@ tex_free = 0x8007B2BC;
|
||||
set_texture_colour_tag = 0x8007B374;
|
||||
tex_cache_index = 0x8007B380;
|
||||
rendermode_reset = 0x8007B3D0;
|
||||
tex_primcolour_on = 0x8007B43C;
|
||||
tex_primcolour_off = 0x8007B454;
|
||||
directional_lighting_on = 0x8007B43C;
|
||||
directional_lighting_off = 0x8007B454;
|
||||
set_animated_texture_header = 0x8007B46C;
|
||||
material_set_no_tex_offset = 0x8007B4C8;
|
||||
material_set = 0x8007B4E8;
|
||||
@@ -2252,7 +2252,7 @@ D_800DC954 = 0x800DC954;
|
||||
gMaxLights = 0x800DC958;
|
||||
gNumActiveLights = 0x800DC95C;
|
||||
D_800DC960 = 0x800DC960;
|
||||
D_800DC964 = 0x800DC964;
|
||||
gLightDirs = 0x800DC964;
|
||||
D_800DC968 = 0x800DC968;
|
||||
|
||||
// object_functions.c .data
|
||||
@@ -2444,7 +2444,7 @@ dRenderSettingsDecal = 0x800DEDE8;
|
||||
dRenderSettingsSolidColourVtxAlpha = 0x800DEEE8;
|
||||
dRenderSettingsSolidColour = 0x800DEF28;
|
||||
dRenderSettingsPrimOverlay = 0x800DF028;
|
||||
dRenderSettingsPrimCol = 0x800DF0A8;
|
||||
dRenderSettingsDirectionalLighting = 0x800DF0A8;
|
||||
dRenderSettingsBlinkingLights = 0x800DF1A8;
|
||||
dBasicRenderSettingsZBOff = 0x800DF3A8;
|
||||
dBasicRenderSettingsZBOn = 0x800DF3D8;
|
||||
@@ -4248,9 +4248,9 @@ gTextureCache = 0x80126328;
|
||||
gCiPalettes = 0x8012632C;
|
||||
gNumberOfLoadedTextures = 0x80126330;
|
||||
D_80126334 = 0x80126334;
|
||||
gTextureAssetID = 0x80126338;
|
||||
gTextureTableSize = 0x80126338;
|
||||
gCiPalettesSize = 0x80126340;
|
||||
D_80126344 = 0x80126344;
|
||||
gFirstTexIsLoaded = 0x80126344;
|
||||
gSpriteOffsetTable = 0x80126348;
|
||||
gSpriteCache = 0x8012634C;
|
||||
gCurrentSprite = 0x80126350;
|
||||
@@ -4267,7 +4267,7 @@ gBlockedRenderFlags = 0x80126378;
|
||||
gCurrentTextureHeader = 0x8012637C;
|
||||
gUsingTexture = 0x80126380;
|
||||
gForceFlags = 0x80126382;
|
||||
gUsePrimColour = 0x80126384;
|
||||
gUseDirectionalLighting = 0x80126384;
|
||||
|
||||
// menu .bss
|
||||
gCourseInitials = 0x80126390;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user