Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Data Structures | Functions | Variables
paintings.c File Reference
#include <ultra64.h>
#include "sm64.h"
#include "game.h"
#include "mario.h"
#include "memory.h"
#include "save_file.h"
#include "engine/surface_collision.h"
#include "engine/graph_node.h"
#include "geo_misc.h"
#include "area.h"
#include "prevent_bss_reordering.h"
#include "paintings.h"

Data Structures

struct  Struct802D4E04
 

Functions

void stopAllRippleExcept (s16 *idptr, struct PaintingData *paintingGroup[])
 
float find_mario_y_position_on_painting (struct PaintingData *painting)
 
float find_mario_z_position_on_painting (struct PaintingData *painting)
 
float painting_find_vertical_ripple_location (struct PaintingData *painting, s8 rippleSpot)
 
float find_part_of_painting_near_mario (struct PaintingData *painting)
 
float find_mario_x_position_on_painting (struct PaintingData *painting)
 
float painting_find_horizontal_ripple_location (struct PaintingData *painting, s8 rippleSpot)
 
void painting_set_ripple_type (s8 intendedStatus, struct PaintingData *painting, struct PaintingData *paintingGroup[], s8 hRippleSpot, s8 vRippleSpot, s8 resetTimer)
 
void vertical_proximity_ripple_painting_ripple (struct PaintingData *painting, struct PaintingData *paintingGroup[])
 
void vertical_proximity_ripple_painting_ripple_if_mario_enters (struct PaintingData *painting, struct PaintingData *paintingGroup[])
 
void vertical_continuous_ripple_painting_ripple (struct PaintingData *painting, struct PaintingData *paintingGroup[])
 
void vertical_continuous_ripple_painting_ripple_if_mario_enters (struct PaintingData *painting, struct PaintingData *paintingGroup[])
 
void horizontal_proximity_ripple_painting_ripple (struct PaintingData *painting, struct PaintingData *paintingGroup[])
 
void horizontal_proximity_ripple_painting_ripple_if_mario_enters (struct PaintingData *painting, struct PaintingData *paintingGroup[])
 
void horizontal_continuous_ripple_painting_ripple (struct PaintingData *painting, struct PaintingData *paintingGroup[])
 
void horizontal_continuous_ripple_painting_ripple_if_mario_enters (struct PaintingData *painting, struct PaintingData *paintingGroup[])
 
void painting_update_floors (struct PaintingData *painting)
 
void painting_update_ripple_status (struct PaintingData *painting)
 
s16 painting_calculate_point_ripple (struct PaintingData *painting, float xpos, float ypos)
 
s16 painting_conditionally_calculate_point_ripple (struct PaintingData *painting, s16 condition, s16 xpos, s16 ypos)
 
void Print1 (struct PaintingData *painting, s16 *b, s16 c)
 
void Print2 (s16 *a, s16 b, s16 c)
 
s8 small_float_to_byte (float decimal)
 
void func_802D39DC (s16 *a, s16 b)
 
voidfunc_802D3CF0 (u8 *img, s16 b, s16 c, s16 *d, s16 e, s16 f, u8 g)
 
Gfxfunc_802D43FC (struct PaintingData *painting)
 
Gfxfunc_802D45FC (struct PaintingData *painting)
 
Gfxfunc_802D4874 (struct PaintingData *painting)
 
Gfxdisplay_painting_rippling (struct PaintingData *painting)
 
Gfxdisplay_painting_not_rippling (struct PaintingData *painting)
 
void reset_painting (struct PaintingData *painting)
 
void update_ddd_painting (struct PaintingData *painting, float frontPos, float backPos, float speed)
 
void func_802D4E04 (struct GraphNodeGenerated *a, struct PaintingData *b)
 
Gfxdisplay_painting (struct PaintingData *painting)
 
void vertical_painting_ripple (struct PaintingData *painting, struct PaintingData *paintingGroup[])
 
void horizontal_painting_ripple (struct PaintingData *painting, struct PaintingData *paintingGroup[])
 
GfxGeo18_802D5B98 (s32 run, struct GraphNode *node, UNUSED s32 c)
 
GfxGeo18_802D5D0C (s32 run, UNUSED struct GraphNode *node, UNUSED f32 c[4][4])
 

Variables

s16 gPaintingMarioFloorType
 
float gPaintingMarioXPos
 
float gPaintingMarioYPos
 
float gPaintingMarioZPos
 
struct ThingD_8035FFA0
 
float(* D_8035FFA4 )[3]
 
struct PaintingDataripplingPainting
 
s8 dddStatus
 
struct PaintingDatahmcPaintings []
 
struct PaintingDatainsideCastlePaintings []
 
struct PaintingDatattmPaintings []
 
struct PaintingData ** paintingGroups []
 
s16 gPaintingUpdateCounter = 1
 
s16 gLastPaintingUpdateCounter = 0
 

Function Documentation

◆ display_painting()

Gfx* display_painting ( struct PaintingData painting)

◆ display_painting_not_rippling()

Gfx* display_painting_not_rippling ( struct PaintingData painting)

◆ display_painting_rippling()

Gfx* display_painting_rippling ( struct PaintingData painting)

◆ find_mario_x_position_on_painting()

float find_mario_x_position_on_painting ( struct PaintingData painting)

◆ find_mario_y_position_on_painting()

float find_mario_y_position_on_painting ( struct PaintingData painting)

unnecessary use of double constants

◆ find_mario_z_position_on_painting()

float find_mario_z_position_on_painting ( struct PaintingData painting)

◆ find_part_of_painting_near_mario()

float find_part_of_painting_near_mario ( struct PaintingData painting)

◆ func_802D39DC()

void func_802D39DC ( s16 a,
s16  b 
)

◆ func_802D3CF0()

void* func_802D3CF0 ( u8 img,
s16  b,
s16  c,
s16 d,
s16  e,
s16  f,
u8  g 
)

◆ func_802D43FC()

Gfx* func_802D43FC ( struct PaintingData painting)

◆ func_802D45FC()

Gfx* func_802D45FC ( struct PaintingData painting)

◆ func_802D4874()

Gfx* func_802D4874 ( struct PaintingData painting)

◆ func_802D4E04()

void func_802D4E04 ( struct GraphNodeGenerated a,
struct PaintingData b 
)

◆ Geo18_802D5B98()

Gfx* Geo18_802D5B98 ( s32  run,
struct GraphNode node,
UNUSED s32  c 
)

◆ Geo18_802D5D0C()

Gfx* Geo18_802D5D0C ( s32  run,
UNUSED struct GraphNode node,
UNUSED f32  c[4][4] 
)

◆ horizontal_continuous_ripple_painting_ripple()

void horizontal_continuous_ripple_painting_ripple ( struct PaintingData painting,
struct PaintingData paintingGroup[] 
)

◆ horizontal_continuous_ripple_painting_ripple_if_mario_enters()

void horizontal_continuous_ripple_painting_ripple_if_mario_enters ( struct PaintingData painting,
struct PaintingData paintingGroup[] 
)

◆ horizontal_painting_ripple()

void horizontal_painting_ripple ( struct PaintingData painting,
struct PaintingData paintingGroup[] 
)

◆ horizontal_proximity_ripple_painting_ripple()

void horizontal_proximity_ripple_painting_ripple ( struct PaintingData painting,
struct PaintingData paintingGroup[] 
)

◆ horizontal_proximity_ripple_painting_ripple_if_mario_enters()

void horizontal_proximity_ripple_painting_ripple_if_mario_enters ( struct PaintingData painting,
struct PaintingData paintingGroup[] 
)

◆ painting_calculate_point_ripple()

s16 painting_calculate_point_ripple ( struct PaintingData painting,
float  xpos,
float  ypos 
)

◆ painting_conditionally_calculate_point_ripple()

s16 painting_conditionally_calculate_point_ripple ( struct PaintingData painting,
s16  condition,
s16  xpos,
s16  ypos 
)

◆ painting_find_horizontal_ripple_location()

float painting_find_horizontal_ripple_location ( struct PaintingData painting,
s8  rippleSpot 
)

◆ painting_find_vertical_ripple_location()

float painting_find_vertical_ripple_location ( struct PaintingData painting,
s8  rippleSpot 
)

◆ painting_set_ripple_type()

void painting_set_ripple_type ( s8  intendedStatus,
struct PaintingData painting,
struct PaintingData paintingGroup[],
s8  hRippleSpot,
s8  vRippleSpot,
s8  resetTimer 
)

◆ painting_update_floors()

void painting_update_floors ( struct PaintingData painting)

◆ painting_update_ripple_status()

void painting_update_ripple_status ( struct PaintingData painting)

After ~6.47 days, paintings with RIPPLE_TRIGGER_CONTINUOUS will increment this to 16777216 (1 << 24), at which point it will freeze (due to floating-point imprecision?) and the painting will stop rippling. This happens to HMC, DDD, and CotMC. This happens on Wii VC. Untested on N64 and Wii U VC.

◆ Print1()

void Print1 ( struct PaintingData painting,
s16 b,
s16  c 
)

◆ Print2()

void Print2 ( s16 a,
s16  b,
s16  c 
)

◆ reset_painting()

void reset_painting ( struct PaintingData painting)

◆ small_float_to_byte()

s8 small_float_to_byte ( float  decimal)

◆ stopAllRippleExcept()

void stopAllRippleExcept ( s16 idptr,
struct PaintingData paintingGroup[] 
)

◆ update_ddd_painting()

void update_ddd_painting ( struct PaintingData painting,
float  frontPos,
float  backPos,
float  speed 
)

◆ vertical_continuous_ripple_painting_ripple()

void vertical_continuous_ripple_painting_ripple ( struct PaintingData painting,
struct PaintingData paintingGroup[] 
)

◆ vertical_continuous_ripple_painting_ripple_if_mario_enters()

void vertical_continuous_ripple_painting_ripple_if_mario_enters ( struct PaintingData painting,
struct PaintingData paintingGroup[] 
)

◆ vertical_painting_ripple()

void vertical_painting_ripple ( struct PaintingData painting,
struct PaintingData paintingGroup[] 
)

◆ vertical_proximity_ripple_painting_ripple()

void vertical_proximity_ripple_painting_ripple ( struct PaintingData painting,
struct PaintingData paintingGroup[] 
)

◆ vertical_proximity_ripple_painting_ripple_if_mario_enters()

void vertical_proximity_ripple_painting_ripple_if_mario_enters ( struct PaintingData painting,
struct PaintingData paintingGroup[] 
)

Variable Documentation

◆ D_8035FFA0

struct Thing* D_8035FFA0

◆ D_8035FFA4

float(* D_8035FFA4)[3]

◆ dddStatus

s8 dddStatus

◆ gLastPaintingUpdateCounter

s16 gLastPaintingUpdateCounter = 0

◆ gPaintingMarioFloorType

s16 gPaintingMarioFloorType

◆ gPaintingMarioXPos

float gPaintingMarioXPos

◆ gPaintingMarioYPos

float gPaintingMarioYPos

◆ gPaintingMarioZPos

float gPaintingMarioZPos

◆ gPaintingUpdateCounter

s16 gPaintingUpdateCounter = 1

◆ hmcPaintings

struct PaintingData* hmcPaintings[]
Initial value:
= {
}
struct PaintingData cotmc_painting[]
#define NULL
Definition: mbi.h:101

◆ insideCastlePaintings

struct PaintingData* insideCastlePaintings[]
Initial value:
= {
}
struct PaintingData ccm_painting[]
struct PaintingData hmc_painting[]
struct PaintingData wf_painting[]
struct PaintingData bob_painting[]
struct PaintingData ssl_painting[]
struct PaintingData lll_painting[]
struct PaintingData thi_huge_painting[]
struct PaintingData sl_painting[]
struct PaintingData ttm_painting[]
struct PaintingData ttc_painting[]
struct PaintingData thi_tiny_painting[]
#define NULL
Definition: mbi.h:101
struct PaintingData ddd_painting[]
struct PaintingData jrb_painting[]
struct PaintingData wdw_painting[]

◆ paintingGroups

struct PaintingData** paintingGroups[]
Initial value:
= {
}
struct PaintingData * insideCastlePaintings[]
Definition: paintings.c:27
struct PaintingData * hmcPaintings[]
Definition: paintings.c:22
struct PaintingData * ttmPaintings[]
Definition: paintings.c:33

◆ ripplingPainting

struct PaintingData* ripplingPainting

◆ ttmPaintings

struct PaintingData* ttmPaintings[]
Initial value:
= {
}
struct PaintingData ttm_slide_painting[]
#define NULL
Definition: mbi.h:101