Basic Vertex Point Lighting Engine (#716)
* CONCEPT: Basic vertex lighting engine Set the geometry mode on your model to G_LIGHTING_ENGINE_EXT, spawn a `bhvAmbientLight`, spawn some `bhvPointLight`s, and then you got yourself a mighty interesting scene. * Fixes * How did I miss this * Make light set home pos
|
|
@ -70,7 +70,8 @@ in_files = [
|
|||
"src/game/ingame_menu.h",
|
||||
"src/game/first_person_cam.h",
|
||||
"src/engine/behavior_script.h",
|
||||
"src/audio/seqplayer.h"
|
||||
"src/audio/seqplayer.h",
|
||||
"src/engine/lighting_engine.h"
|
||||
]
|
||||
|
||||
override_allowed_functions = {
|
||||
|
|
@ -126,7 +127,8 @@ override_disallowed_functions = {
|
|||
"src/game/first_person_cam.h": [ "first_person_update" ],
|
||||
"src/pc/lua/utils/smlua_collision_utils.h": [ "collision_find_surface_on_ray" ],
|
||||
"src/engine/behavior_script.h": [ "stub_behavior_script_2", "cur_obj_update" ],
|
||||
"src/pc/utils/misc.h": [ "str_.*", "file_get_line", "delta_interpolate_(normal|rgba|mtx)", "detect_and_skip_mtx_interpolation" ]
|
||||
"src/pc/utils/misc.h": [ "str_.*", "file_get_line", "delta_interpolate_(normal|rgba|mtx)", "detect_and_skip_mtx_interpolation" ],
|
||||
"src/engine/lighting_engine.h": [ "le_calculate_vertex_lighting", "le_clear", "le_shutdown" ]
|
||||
}
|
||||
|
||||
override_hide_functions = {
|
||||
|
|
|
|||
|
|
@ -896,7 +896,9 @@ id_RM_Scroll_Texture = 535 --- @type BehaviorId
|
|||
id_editor_Scroll_Texture = 536 --- @type BehaviorId
|
||||
id_bhvBlueCoinNumber = 537 --- @type BehaviorId
|
||||
id_bhvStarNumber = 538 --- @type BehaviorId
|
||||
id_bhv_max_count = 539 --- @type BehaviorId
|
||||
id_bhvAmbientLight = 539 --- @type BehaviorId
|
||||
id_bhvPointLight = 540 --- @type BehaviorId
|
||||
id_bhv_max_count = 541 --- @type BehaviorId
|
||||
|
||||
--- @alias BehaviorId
|
||||
--- | `id_bhv1Up`
|
||||
|
|
@ -1438,6 +1440,8 @@ id_bhv_max_count = 539 --- @type BehaviorId
|
|||
--- | `id_editor_Scroll_Texture`
|
||||
--- | `id_bhvBlueCoinNumber`
|
||||
--- | `id_bhvStarNumber`
|
||||
--- | `id_bhvAmbientLight`
|
||||
--- | `id_bhvPointLight`
|
||||
--- | `id_bhv_max_count`
|
||||
|
||||
--- @type integer
|
||||
|
|
|
|||
|
|
@ -119,6 +119,11 @@ function bhv_alpha_boo_key_loop()
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- Behavior loop function for the lighting engine ambient light. Takes the first 3 behavior parameter bytes for RGB color
|
||||
function bhv_ambient_light_init()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- Behavior init function for ambient sounds
|
||||
function bhv_ambient_sounds_init()
|
||||
-- ...
|
||||
|
|
@ -1764,6 +1769,16 @@ function bhv_play_music_track_when_touched_loop()
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- Behavior init function for the lighting engine point light. Takes the first 3 behavior parameter bytes for RGB color and the last for radius
|
||||
function bhv_point_light_init()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- Behavior loop function for the lighting engine point light
|
||||
function bhv_point_light_loop()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- Behavior loop function for Pokey body part
|
||||
function bhv_pokey_body_part_update()
|
||||
-- ...
|
||||
|
|
@ -4821,6 +4836,87 @@ function warp_special(arg)
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- @param x number
|
||||
--- @param y number
|
||||
--- @param z number
|
||||
--- @param r integer
|
||||
--- @param g integer
|
||||
--- @param b integer
|
||||
--- @param radius number
|
||||
--- @param intensity number
|
||||
--- @return integer
|
||||
--- Adds a lighting engine point light at `x`, `y`, `z` with color `r`, `g`, `b` and `radius` with `intensity`
|
||||
function le_add_light(x, y, z, r, g, b, radius, intensity)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param pos Vec3f
|
||||
--- @param out Color
|
||||
--- @param lightIntensityScalar number
|
||||
--- Calculates the lighting with `lightIntensityScalar` at a position and outputs the color in `out`
|
||||
function le_calculate_lighting_color(pos, out, lightIntensityScalar)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param pos Vec3f
|
||||
--- @param out Vec3f
|
||||
--- Calculates the lighting direction from a position and outputs the result in `out`
|
||||
function le_calculate_lighting_dir(pos, out)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @return integer
|
||||
--- Gets the total number of lights currently loaded in the lighting engine
|
||||
function le_get_light_count()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param id integer
|
||||
--- Removes a lighting engine point light corresponding to `id`
|
||||
function le_remove_light(id)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param r integer
|
||||
--- @param g integer
|
||||
--- @param b integer
|
||||
--- Sets the lighting engine ambient color
|
||||
function le_set_ambient_color(r, g, b)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param id integer
|
||||
--- @param r integer
|
||||
--- @param g integer
|
||||
--- @param b integer
|
||||
--- Sets a lighting engine point light's color to `r`, `g`, `b`
|
||||
function le_set_light_color(id, r, g, b)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param id integer
|
||||
--- @param intensity number
|
||||
--- Sets a lighting engine point light's `intensity`
|
||||
function le_set_light_intensity(id, intensity)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param id integer
|
||||
--- @param x number
|
||||
--- @param y number
|
||||
--- @param z number
|
||||
--- Sets a lighting engine point light's position to `x`, `y`, `z`
|
||||
function le_set_light_pos(id, x, y, z)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param id integer
|
||||
--- @param radius number
|
||||
--- Sets a lighting engine point light's `radius`
|
||||
function le_set_light_radius(id, radius)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param m MarioState
|
||||
--- Adjusts the pitch/volume of Mario's movement-based sounds according to his forward velocity (`m.forwardVel`). Useful for adding dynamic audio feedback based on Mario's running or walking speed
|
||||
function adjust_sound_for_speed(m)
|
||||
|
|
@ -9422,14 +9518,21 @@ end
|
|||
--- @param gfx Pointer_Gfx
|
||||
--- @param offset integer
|
||||
--- @return Pointer_Vtx
|
||||
--- Gets a vertex from a display list command if it has the correct op. Intended to be used with `gfx_parse`.
|
||||
--- Gets a vertex from a display list command if it has the correct op. Intended to be used with `gfx_parse`
|
||||
function gfx_get_vtx(gfx, offset)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param cmd Pointer_Gfx
|
||||
--- @return integer
|
||||
--- Gets the number of vertices from a display list command if it has the correct op
|
||||
function gfx_get_vtx_count(cmd)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param cmd Pointer_Gfx
|
||||
--- @param func function
|
||||
--- Traverses a display list. Takes a Lua function as a parameter, which is called back for each command in the display list with the parameters `cmd` (display list pointer), and `op`.
|
||||
--- Traverses a display list. Takes a Lua function as a parameter, which is called back for each command in the display list with the parameters `cmd` (display list pointer), and `op`
|
||||
function gfx_parse(cmd, func)
|
||||
-- ...
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1708,6 +1708,7 @@
|
|||
--- @field public oKoopaTheQuickRaceIndex integer
|
||||
--- @field public oKoopaTurningAwayFromWall integer
|
||||
--- @field public oKoopaUnshelledTimeUntilTurn integer
|
||||
--- @field public oLightID integer
|
||||
--- @field public oLllRotatingHexFlameUnkF4 number
|
||||
--- @field public oLllRotatingHexFlameUnkF8 number
|
||||
--- @field public oLllRotatingHexFlameUnkFC number
|
||||
|
|
|
|||
|
|
@ -6436,3 +6436,19 @@ const BehaviorScript editor_Scroll_Texture[] = {
|
|||
CALL_NATIVE(uv_update_scroll),
|
||||
END_LOOP(),
|
||||
};
|
||||
|
||||
const BehaviorScript bhvAmbientLight[] = {
|
||||
BEGIN(OBJ_LIST_DEFAULT),
|
||||
ID(id_bhvAmbientLight),
|
||||
CALL_NATIVE(bhv_ambient_light_init),
|
||||
};
|
||||
|
||||
const BehaviorScript bhvPointLight[] = {
|
||||
BEGIN(OBJ_LIST_DEFAULT),
|
||||
ID(id_bhvPointLight),
|
||||
SET_HOME(),
|
||||
CALL_NATIVE(bhv_point_light_init),
|
||||
BEGIN_LOOP(),
|
||||
CALL_NATIVE(bhv_point_light_loop),
|
||||
END_LOOP(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -551,7 +551,9 @@ const struct BehaviorTableEntry gBehaviorTable[id_bhv_max_count] = {
|
|||
BHV_ENTRY(bhvYellowCoin),
|
||||
BHV_ENTRY(bhvYoshi),
|
||||
BHV_ENTRY(RM_Scroll_Texture),
|
||||
BHV_ENTRY(editor_Scroll_Texture)
|
||||
BHV_ENTRY(editor_Scroll_Texture),
|
||||
BHV_ENTRY(bhvAmbientLight),
|
||||
BHV_ENTRY(bhvPointLight)
|
||||
};
|
||||
|
||||
enum BehaviorId get_id_from_behavior(const BehaviorScript* behavior) {
|
||||
|
|
|
|||
|
|
@ -776,6 +776,8 @@ s64 DynOS_Bhv_ParseBehaviorScriptConstants(const String &_Arg, bool *found) {
|
|||
bhv_constant(id_bhvYoshi);
|
||||
bhv_constant(id_RM_Scroll_Texture);
|
||||
bhv_constant(id_editor_Scroll_Texture);
|
||||
bhv_constant(id_bhvAmbientLight);
|
||||
bhv_constant(id_bhvPointLight);
|
||||
|
||||
// Define a special type for new ids that don't override.
|
||||
if (_Arg == "id_bhvNewId") { return (BehaviorScript) (0xFFFF); }
|
||||
|
|
@ -1884,6 +1886,9 @@ s64 DynOS_Bhv_ParseBehaviorScriptConstants(const String &_Arg, bool *found) {
|
|||
/* BreakableWall */
|
||||
bhv_constant(oBreakableWallForce);
|
||||
|
||||
/* PointLight */
|
||||
bhv_constant(oLightID);
|
||||
|
||||
*found = false;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -550,6 +550,8 @@ s64 DynOS_Common_ParseBhvConstants(const String &_Arg, bool *found) {
|
|||
common_constant(bhvUnusedFakeStar);
|
||||
common_constant(RM_Scroll_Texture);
|
||||
common_constant(editor_Scroll_Texture);
|
||||
common_constant(bhvAmbientLight);
|
||||
common_constant(bhvPointLight);
|
||||
|
||||
// Legacy behavior names
|
||||
common_legacy_constant(bhvFish2, bhvManyBlueFishSpawner);
|
||||
|
|
|
|||
|
|
@ -350,6 +350,7 @@ s64 DynOS_Gfx_ParseGfxConstants(const String& _Arg, bool* found) {
|
|||
|
||||
// Extended
|
||||
gfx_constant(G_LIGHT_MAP_EXT);
|
||||
gfx_constant(G_LIGHTING_ENGINE_EXT);
|
||||
|
||||
// Common values
|
||||
gfx_constant(CALC_DXT(4,G_IM_SIZ_4b_BYTES));
|
||||
|
|
|
|||
|
|
@ -2030,6 +2030,9 @@ static const void* sDynosBuiltinFuncs[] = {
|
|||
define_builtin(spawn_star_number),
|
||||
define_builtin(bhv_ferris_wheel_platform_init),
|
||||
define_builtin(geo_mario_cap_display_list),
|
||||
define_builtin(bhv_ambient_light_init),
|
||||
define_builtin(bhv_point_light_init),
|
||||
define_builtin(bhv_point_light_loop),
|
||||
};
|
||||
|
||||
const void* DynOS_Builtin_Func_GetFromName(const char* aDataName) {
|
||||
|
|
|
|||
|
|
@ -650,7 +650,9 @@
|
|||
| id_editor_Scroll_Texture | 536 |
|
||||
| id_bhvBlueCoinNumber | 537 |
|
||||
| id_bhvStarNumber | 538 |
|
||||
| id_bhv_max_count | 539 |
|
||||
| id_bhvAmbientLight | 539 |
|
||||
| id_bhvPointLight | 540 |
|
||||
| id_bhv_max_count | 541 |
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
|
|
|
|||
6
docs/lua/examples/lighting-engine-demo/a-constants.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
LEVEL_HL = level_register("level_hl_entry", COURSE_BOB, "Black Mesa", "hl", 28000, 0x28, 0x28, 0x28)
|
||||
LEVEL_CANALS = level_register("level_canals_entry", COURSE_WF, "Sunset Canals", "canals", 28000, 0x20, 0x20, 0x20)
|
||||
|
||||
SOUND_CUSTOM_FLASHLIGHT = audio_sample_load("flashlight.ogg")
|
||||
|
||||
DEFAULT_LIGHTING_DIR = 0x28 / 127
|
||||
6
docs/lua/examples/lighting-engine-demo/a-utils.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
--- @param cond boolean
|
||||
--- Human readable ternary operator
|
||||
function if_then_else(cond, ifTrue, ifFalse)
|
||||
if cond then return ifTrue end
|
||||
return ifFalse
|
||||
end
|
||||
11
docs/lua/examples/lighting-engine-demo/data/behavior_data.c
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/* ================ New Behaviors ================ */
|
||||
|
||||
const BehaviorScript bhvFlashlight[] = {
|
||||
BEGIN(OBJ_LIST_DEFAULT),
|
||||
ID(id_bhvNewId), // id_bhvNewId signifies a new behavior.
|
||||
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
|
||||
CALL_NATIVE(bhv_point_light_init),
|
||||
BEGIN_LOOP(),
|
||||
CALL_NATIVE(bhv_flashlight_loop),
|
||||
END_LOOP(),
|
||||
};
|
||||
BIN
docs/lua/examples/lighting-engine-demo/data/bhvFlashlight.bhv
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#include "src/game/envfx_snow.h"
|
||||
|
||||
const GeoLayout canals_area_1_geo[] = {
|
||||
GEO_NODE_START(),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_DISPLAY_LIST(LAYER_OPAQUE, canals_dl_ground_mesh_layer_1),
|
||||
GEO_DISPLAY_LIST(LAYER_OPAQUE, canals_dl_pillar_mesh_layer_1),
|
||||
GEO_DISPLAY_LIST(LAYER_OPAQUE, canals_dl_ramp_mesh_layer_1),
|
||||
GEO_ASM(0, geo_hide_if_dnc),
|
||||
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, canals_dl_skybox_mesh_layer_5),
|
||||
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, canals_dl_waterplane_mesh_layer_5),
|
||||
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, canals_dl_waterplane_001_mesh_layer_5),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_RETURN(),
|
||||
};
|
||||
const GeoLayout canals_area_1[] = {
|
||||
GEO_NODE_SCREEN_AREA(10, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_ZBUFFER(0),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_NODE_ORTHO(100.0000),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_BACKGROUND(BACKGROUND_OCEAN_SKY, geo_skybox_main),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_ZBUFFER(1),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_CAMERA_FRUSTUM_WITH_FUNC(45.0000, 100, 100000, geo_camera_fov),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_CAMERA(CAMERA_MODE_FREE_ROAM, 0, 0, 0, 0, -100, 0, geo_camera_main),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_BRANCH(1, canals_area_1_geo),
|
||||
GEO_RENDER_OBJ(),
|
||||
GEO_ASM(ENVFX_MODE_NONE, geo_envfx_main),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_DISPLAY_LIST(LAYER_OPAQUE, canals_dl_material_revert_render_settings),
|
||||
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, canals_dl_material_revert_render_settings),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_END(),
|
||||
};
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
const MacroObject canals_area_1_macro_objs[] = {
|
||||
MACRO_OBJECT(macro_box_koopa_shell, 0, -8100, 2845, -4989),
|
||||
MACRO_OBJECT_END(),
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
// Replace the level specific camera volume struct in src/game/camera.c with this.
|
||||
// Make sure to also add the struct name to the LEVEL_DEFINE in levels/level_defines.h.
|
||||
struct CameraTrigger sCamCanals[] = {
|
||||
NULL_TRIGGER
|
||||
};
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
|
@ -0,0 +1 @@
|
|||
#include "levels/canals/area_1/geo.inc.c"
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
extern const GeoLayout canals_area_1_geo[];
|
||||
extern const GeoLayout canals_area_1[];
|
||||
extern const Collision canals_area_1_collision[];
|
||||
extern const MacroObject canals_area_1_macro_objs[];
|
||||
extern u8 canals_dl_dirt_rgba16[];
|
||||
extern u8 canals_dl_concrete_rgba16[];
|
||||
extern u8 canals_dl_debris_rgba16[];
|
||||
extern u8 canals_dl_oldwall_rgba16[];
|
||||
extern u8 canals_dl_rock_rgba16[];
|
||||
extern u8 canals_dl_water_ci8[];
|
||||
extern u8 canals_dl_water_pal_rgba16[];
|
||||
extern Vtx canals_dl_ground_mesh_layer_1_vtx_0[397];
|
||||
extern Gfx canals_dl_ground_mesh_layer_1_tri_0[];
|
||||
extern Vtx canals_dl_ground_mesh_layer_1_vtx_1[888];
|
||||
extern Gfx canals_dl_ground_mesh_layer_1_tri_1[];
|
||||
extern Vtx canals_dl_ground_mesh_layer_1_vtx_2[438];
|
||||
extern Gfx canals_dl_ground_mesh_layer_1_tri_2[];
|
||||
extern Vtx canals_dl_ground_mesh_layer_1_vtx_3[4];
|
||||
extern Gfx canals_dl_ground_mesh_layer_1_tri_3[];
|
||||
extern Vtx canals_dl_ground_mesh_layer_1_vtx_4[139];
|
||||
extern Gfx canals_dl_ground_mesh_layer_1_tri_4[];
|
||||
extern Vtx canals_dl_ground_mesh_layer_1_vtx_5[338];
|
||||
extern Gfx canals_dl_ground_mesh_layer_1_tri_5[];
|
||||
extern Vtx canals_dl_pillar_mesh_layer_1_vtx_0[254];
|
||||
extern Gfx canals_dl_pillar_mesh_layer_1_tri_0[];
|
||||
extern Vtx canals_dl_pillar_mesh_layer_1_vtx_1[159];
|
||||
extern Gfx canals_dl_pillar_mesh_layer_1_tri_1[];
|
||||
extern Vtx canals_dl_pillar_mesh_layer_1_vtx_2[8];
|
||||
extern Gfx canals_dl_pillar_mesh_layer_1_tri_2[];
|
||||
extern Vtx canals_dl_ramp_mesh_layer_1_vtx_0[19];
|
||||
extern Gfx canals_dl_ramp_mesh_layer_1_tri_0[];
|
||||
extern Vtx canals_dl_skybox_mesh_layer_5_vtx_0[46];
|
||||
extern Gfx canals_dl_skybox_mesh_layer_5_tri_0[];
|
||||
extern Vtx canals_dl_waterplane_mesh_layer_5_vtx_0[335];
|
||||
extern Gfx canals_dl_waterplane_mesh_layer_5_tri_0[];
|
||||
extern Vtx canals_dl_waterplane_001_mesh_layer_5_vtx_0[1280];
|
||||
extern Gfx canals_dl_waterplane_001_mesh_layer_5_tri_0[];
|
||||
extern Gfx mat_canals_dl_dirt[];
|
||||
extern Gfx mat_revert_canals_dl_dirt[];
|
||||
extern Gfx mat_canals_dl_concrete[];
|
||||
extern Gfx mat_revert_canals_dl_concrete[];
|
||||
extern Gfx mat_canals_dl_debris[];
|
||||
extern Gfx mat_revert_canals_dl_debris[];
|
||||
extern Gfx mat_canals_dl_black[];
|
||||
extern Gfx mat_revert_canals_dl_black[];
|
||||
extern Gfx mat_canals_dl_oldwall[];
|
||||
extern Gfx mat_revert_canals_dl_oldwall[];
|
||||
extern Gfx mat_canals_dl_rock[];
|
||||
extern Gfx mat_revert_canals_dl_rock[];
|
||||
extern Gfx mat_canals_dl_sky[];
|
||||
extern Gfx mat_revert_canals_dl_sky[];
|
||||
extern Gfx mat_canals_dl_water[];
|
||||
extern Gfx mat_revert_canals_dl_water[];
|
||||
extern Gfx canals_dl_ground_mesh_layer_1[];
|
||||
extern Gfx canals_dl_pillar_mesh_layer_1[];
|
||||
extern Gfx canals_dl_ramp_mesh_layer_1[];
|
||||
extern Gfx canals_dl_skybox_mesh_layer_5[];
|
||||
extern Gfx canals_dl_waterplane_mesh_layer_5[];
|
||||
extern Gfx canals_dl_waterplane_001_mesh_layer_5[];
|
||||
extern Gfx canals_dl_material_revert_render_settings[];
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#include "levels/canals/texture_include.inc.c"
|
||||
#include "levels/canals/area_1/collision.inc.c"
|
||||
#include "levels/canals/area_1/macro.inc.c"
|
||||
#include "levels/canals/area_1/spline.inc.c"
|
||||
#include "levels/canals/model.inc.c"
|
||||
7096
docs/lua/examples/lighting-engine-demo/levels/canals/model.inc.c
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
|
@ -0,0 +1,48 @@
|
|||
#include <ultra64.h>
|
||||
#include "sm64.h"
|
||||
#include "behavior_data.h"
|
||||
#include "model_ids.h"
|
||||
#include "seq_ids.h"
|
||||
#include "dialog_ids.h"
|
||||
#include "segment_symbols.h"
|
||||
#include "level_commands.h"
|
||||
|
||||
#include "game/level_update.h"
|
||||
|
||||
#include "levels/scripts.h"
|
||||
|
||||
#include "make_const_nonconst.h"
|
||||
#include "levels/canals/header.h"
|
||||
|
||||
const LevelScript level_canals_entry[] = {
|
||||
INIT_LEVEL(),
|
||||
LOAD_MIO0(0x7, _canals_segment_7SegmentRomStart, _canals_segment_7SegmentRomEnd),
|
||||
LOAD_MIO0(0xa, _water_skybox_mio0SegmentRomStart, _water_skybox_mio0SegmentRomEnd),
|
||||
ALLOC_LEVEL_POOL(),
|
||||
MARIO(MODEL_MARIO, 0x00000001, bhvMario),
|
||||
|
||||
AREA(1, canals_area_1),
|
||||
WARP_NODE(0x0A, 51, 0x01, 0x0A, WARP_NO_CHECKPOINT),
|
||||
WARP_NODE(0xF0, 51, 0x01, 0x0A, WARP_NO_CHECKPOINT),
|
||||
WARP_NODE(0xF1, 51, 0x01, 0x0A, WARP_NO_CHECKPOINT),
|
||||
WARP_NODE(0xF2, LEVEL_CASTLE_GROUNDS, 0x01, 0x0A, WARP_NO_CHECKPOINT),
|
||||
OBJECT(MODEL_NONE, -2378, 250, -457, 0, 0, 0, (0xEB << 24) | (0x9B << 16) | (0x47 << 8) | (0x00), bhvAmbientLight),
|
||||
OBJECT(MODEL_NONE, -8000, 140, -4400, 0, 180, 0, 0x000A0000, bhvInstantActiveWarp),
|
||||
MARIO_POS(0x01, 180, -8000, 140, -4400),
|
||||
OBJECT(MODEL_NONE, -3800, -50, 5899, 0, 0, 0, (0x00 << 24) | (0xF2 << 16) | (0x00 << 8) | (0x00), bhvWarp),
|
||||
TERRAIN(canals_area_1_collision),
|
||||
MACRO_OBJECTS(canals_area_1_macro_objs),
|
||||
SET_BACKGROUND_MUSIC(0x00, SEQ_SOUND_PLAYER),
|
||||
TERRAIN_TYPE(TERRAIN_GRASS),
|
||||
/* Fast64 begin persistent block [area commands] */
|
||||
/* Fast64 end persistent block [area commands] */
|
||||
END_AREA(),
|
||||
|
||||
FREE_LEVEL_POOL(),
|
||||
MARIO_POS(0x01, 180, -8000, 140, -4400),
|
||||
CALL(0, lvl_init_or_update),
|
||||
CALL_LOOP(1, lvl_init_or_update),
|
||||
CLEAR_LEVEL(),
|
||||
SLEEP_BEFORE_EXIT(1),
|
||||
EXIT(),
|
||||
};
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
Gfx canals_dl_dirt_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 canals_dl_dirt_rgba16[] = {
|
||||
#include "levels/canals/dirt.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx canals_dl_concrete_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 canals_dl_concrete_rgba16[] = {
|
||||
#include "levels/canals/concrete.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx canals_dl_debris_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 canals_dl_debris_rgba16[] = {
|
||||
#include "levels/canals/debris.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx canals_dl_oldwall_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 canals_dl_oldwall_rgba16[] = {
|
||||
#include "levels/canals/oldwall.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx canals_dl_rock_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 canals_dl_rock_rgba16[] = {
|
||||
#include "levels/canals/rock.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx canals_dl_water_ci8_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 canals_dl_water_ci8[] = {
|
||||
#include "levels/canals/water.ci8.inc.c"
|
||||
};
|
||||
|
||||
Gfx canals_dl_water_pal_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 canals_dl_water_pal_rgba16[] = {
|
||||
#include "levels/canals/water.rgba16.pal"
|
||||
};
|
||||
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 568 B |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 569 B |
|
After Width: | Height: | Size: 594 B |
|
|
@ -0,0 +1,35 @@
|
|||
#include "src/game/envfx_snow.h"
|
||||
|
||||
const GeoLayout hl_area_1_geo[] = {
|
||||
GEO_NODE_START(),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_DISPLAY_LIST(LAYER_OPAQUE, hl_dl_map_mesh_layer_1),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_RETURN(),
|
||||
};
|
||||
const GeoLayout hl_area_1[] = {
|
||||
GEO_NODE_SCREEN_AREA(10, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_ZBUFFER(0),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_NODE_ORTHO(100.0000),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_BACKGROUND_COLOR(0x0001),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_ZBUFFER(1),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_CAMERA_FRUSTUM_WITH_FUNC(45.0000, 100, 100000, geo_camera_fov),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_CAMERA(CAMERA_MODE_FREE_ROAM, 0, 0, 0, 0, -100, 0, geo_camera_main),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_BRANCH(1, hl_area_1_geo),
|
||||
GEO_RENDER_OBJ(),
|
||||
GEO_ASM(ENVFX_MODE_NONE, geo_envfx_main),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_DISPLAY_LIST(LAYER_OPAQUE, hl_dl_material_revert_render_settings),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_END(),
|
||||
};
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
const MacroObject hl_area_1_macro_objs[] = {
|
||||
MACRO_OBJECT_END(),
|
||||
};
|
||||
|
||||
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 284 B |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
|
@ -0,0 +1,5 @@
|
|||
// Replace the level specific camera volume struct in src/game/camera.c with this.
|
||||
// Make sure to also add the struct name to the LEVEL_DEFINE in levels/level_defines.h.
|
||||
struct CameraTrigger sCamHl[] = {
|
||||
NULL_TRIGGER
|
||||
};
|
||||
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 5 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 9.4 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 9 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 659 B |
|
|
@ -0,0 +1 @@
|
|||
#include "levels/hl/area_1/geo.inc.c"
|
||||
271
docs/lua/examples/lighting-engine-demo/levels/hl/header.inc.h
Normal file
|
|
@ -0,0 +1,271 @@
|
|||
extern const GeoLayout hl_area_1_geo[];
|
||||
extern const GeoLayout hl_area_1[];
|
||||
extern const Collision hl_area_1_collision[];
|
||||
extern const MacroObject hl_area_1_macro_objs[];
|
||||
extern u8 hl_dl_fifties_cmp3b_rgba16[];
|
||||
extern u8 hl_dl_ca1x_monside_rgba16[];
|
||||
extern u8 hl_dl_drkmtlt_bord11_rgba16[];
|
||||
extern u8 hl_dl_c2a4e_w1b_rgba16[];
|
||||
extern u8 hl_dl_c1a0_labw4_rgba16[];
|
||||
extern u8 hl_dl_drkmtl_scrn3_rgba16[];
|
||||
extern u8 hl_dl_c1a0_labw5_rgba16[];
|
||||
extern u8 hl_dl_drkmtlt_ceil01b_rgba16[];
|
||||
extern u8 hl_dl_c1a0_labglu_rgba16[];
|
||||
extern u8 hl_dl__0c2a4e_w1_rgba16[];
|
||||
extern u8 hl_dl_fifties_cmp3c_rgba16[];
|
||||
extern u8 hl_dl_c1a1_flr1_rgba16[];
|
||||
extern u8 hl_dl_lab1_b4_rgba16[];
|
||||
extern u8 hl_dl__spotyellow_rgba16[];
|
||||
extern u8 hl_dl_c1a0_labw7_rgba16[];
|
||||
extern u8 hl_dl_lab1_comp3e_rgba16[];
|
||||
extern u8 hl_dl_basetrim02_rgba16[];
|
||||
extern u8 hl_dl_out_dmplid_rgba16[];
|
||||
extern u8 hl_dl__a_lab1_sw1_rgba16[];
|
||||
extern u8 hl_dl_generic028_rgba16[];
|
||||
extern u8 hl_dl_c1a1_flr2c_rgba16[];
|
||||
extern u8 hl_dl_generic46_rgba16[];
|
||||
extern u8 hl_dl_c2a4x_c1_rgba16[];
|
||||
extern u8 hl_dl__0_generic85_rgba16[];
|
||||
extern u8 hl_dl_fifties_mon1b_rgba16[];
|
||||
extern u8 hl_dl__0_fifties_lgt2_rgba16[];
|
||||
extern u8 hl_dl_generic015v2_rgba16[];
|
||||
extern u8 hl_dl_drkmtl_scrn_rgba16[];
|
||||
extern u8 hl_dl_babtech_ceil01_rgba16[];
|
||||
extern u8 hl_dl__0_fifties_lgt3_rgba16[];
|
||||
extern u8 hl_dl_c1a0_wx_rgba16[];
|
||||
extern u8 hl_dl_black_rgba16[];
|
||||
extern u8 hl_dl__lab_crt8_rgba16[];
|
||||
extern u8 hl_dl_lab1_map2_rgba16[];
|
||||
extern u8 hl_dl_flatbed_bumper_rgba16[];
|
||||
extern u8 hl_dl_pfab_bks1b_rgba16[];
|
||||
extern u8 hl_dl_paper1_rgba16[];
|
||||
extern u8 hl_dl__spotblue_rgba16[];
|
||||
extern u8 hl_dl_stripes2_rgba16[];
|
||||
extern u8 hl_dl_pfab_bks1a_rgba16[];
|
||||
extern u8 hl_dl__lab1_cmp2_rgba16[];
|
||||
extern u8 hl_dl_lab1_flr10_rgba16[];
|
||||
extern u8 hl_dl_duct_vnt_rgba16[];
|
||||
extern u8 hl_dl_signc1a1_1_rgba16[];
|
||||
extern u8 hl_dl_c1a1sign2a_rgba16[];
|
||||
extern u8 hl_dl_lab1_map1_rgba16[];
|
||||
extern u8 hl_dl_c1a1sign2b_rgba16[];
|
||||
extern u8 hl_dl__gratestep2_rgba16[];
|
||||
extern u8 hl_dl__lab_crt2_rgba16[];
|
||||
extern u8 hl_dl_lab1_door2a_rgba16[];
|
||||
extern u8 hl_dl_c1a1dooredge_rgba16[];
|
||||
extern u8 hl_dl_lab1_gear3_rgba16[];
|
||||
extern u8 hl_dl_lab1_gear2_rgba16[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_0[259];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_0[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_1[67];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_1[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_2[335];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_2[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_3[379];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_3[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_4[129];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_4[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_5[24];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_5[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_6[83];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_6[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_7[90];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_7[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_8[113];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_8[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_9[111];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_9[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_10[195];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_10[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_11[60];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_11[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_12[262];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_12[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_13[24];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_13[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_14[84];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_14[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_15[9];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_15[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_16[32];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_16[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_17[12];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_17[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_18[20];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_18[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_19[124];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_19[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_20[172];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_20[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_21[20];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_21[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_22[4];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_22[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_23[13];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_23[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_24[14];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_24[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_25[16];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_25[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_26[22];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_26[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_27[16];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_27[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_28[52];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_28[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_29[13];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_29[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_30[29];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_30[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_31[8];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_31[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_32[12];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_32[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_33[7];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_33[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_34[4];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_34[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_35[16];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_35[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_36[8];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_36[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_37[8];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_37[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_38[14];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_38[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_39[8];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_39[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_40[4];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_40[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_41[11];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_41[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_42[4];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_42[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_43[4];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_43[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_44[8];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_44[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_45[7];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_45[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_46[8];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_46[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_47[72];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_47[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_48[4];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_48[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_49[22];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_49[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_50[52];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_50[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_51[112];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_51[];
|
||||
extern Vtx hl_dl_map_mesh_layer_1_vtx_52[158];
|
||||
extern Gfx hl_dl_map_mesh_layer_1_tri_52[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_FIFTIES_CMP3B_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_FIFTIES_CMP3B_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_CA1X_MONSIDE_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_CA1X_MONSIDE_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_DRKMTLT_BORD11_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_DRKMTLT_BORD11_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_C2A4E_W1B_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_C2A4E_W1B_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_C1A0_LABW4_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_C1A0_LABW4_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_DRKMTL_SCRN3_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_DRKMTL_SCRN3_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_C1A0_LABW5_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_C1A0_LABW5_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_DRKMTLT_CEIL01B_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_DRKMTLT_CEIL01B_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_C1A0_LABGLU_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_C1A0_LABGLU_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE__0C2A4E_W1_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE__0C2A4E_W1_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_FIFTIES_CMP3C_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_FIFTIES_CMP3C_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_C1A1_FLR1_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_C1A1_FLR1_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_LAB1_B4_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_LAB1_B4_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE__SPOTYELLOW_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE__SPOTYELLOW_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_C1A0_LABW7_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_C1A0_LABW7_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_LAB1_COMP3E_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_LAB1_COMP3E_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_BASETRIM02_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_BASETRIM02_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_OUT_DMPLID_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_OUT_DMPLID_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE__A_LAB1_SW1_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE__A_LAB1_SW1_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_GENERIC028_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_GENERIC028_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_C1A1_FLR2C_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_C1A1_FLR2C_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_GENERIC46_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_GENERIC46_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_C2A4X_C1_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_C2A4X_C1_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE__0_GENERIC85_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE__0_GENERIC85_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_FIFTIES_MON1B_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_FIFTIES_MON1B_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE__0_FIFTIES_LGT2_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE__0_FIFTIES_LGT2_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_GENERIC015V2_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_GENERIC015V2_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_DRKMTL_SCRN000_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_DRKMTL_SCRN000_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_BABTECH_CEIL01_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_BABTECH_CEIL01_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE__0_FIFTIES_LGT3_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE__0_FIFTIES_LGT3_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_C1A0_WX_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_C1A0_WX_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_BLACK_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_BLACK_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE__LAB_CRT8000_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE__LAB_CRT8000_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_LAB1_MAP2_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_LAB1_MAP2_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_FLATBED_BUMPER_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_FLATBED_BUMPER_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_PFAB_BKS1B_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_PFAB_BKS1B_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_PAPER1_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_PAPER1_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE__SPOTBLUE_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE__SPOTBLUE_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_STRIPES2_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_STRIPES2_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_PFAB_BKS1A_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_PFAB_BKS1A_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE__LAB1_CMP2000_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE__LAB1_CMP2000_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_LAB1_FLR10_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_LAB1_FLR10_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_DUCT_VNT_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_DUCT_VNT_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_SIGNC1A1_1_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_SIGNC1A1_1_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_C1A1SIGN2A_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_C1A1SIGN2A_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_LAB1_MAP1_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_LAB1_MAP1_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_C1A1SIGN2B_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_C1A1SIGN2B_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE__GRATESTEP2_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE__GRATESTEP2_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE__LAB_CRT2000_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE__LAB_CRT2000_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_LAB1_DOOR2A_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_LAB1_DOOR2A_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_C1A1DOOREDGE_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_C1A1DOOREDGE_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_LAB1_GEAR3_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_LAB1_GEAR3_f3d[];
|
||||
extern Gfx mat_hl_dl_HALFLIFE_LAB1_GEAR2_f3d[];
|
||||
extern Gfx mat_revert_hl_dl_HALFLIFE_LAB1_GEAR2_f3d[];
|
||||
extern Gfx hl_dl_map_mesh_layer_1[];
|
||||
extern Gfx hl_dl_material_revert_render_settings[];
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 454 B |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
|
@ -0,0 +1,5 @@
|
|||
#include "levels/hl/texture_include.inc.c"
|
||||
#include "levels/hl/area_1/collision.inc.c"
|
||||
#include "levels/hl/area_1/macro.inc.c"
|
||||
#include "levels/hl/area_1/spline.inc.c"
|
||||
#include "levels/hl/model.inc.c"
|
||||
7384
docs/lua/examples/lighting-engine-demo/levels/hl/model.inc.c
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 976 B |
|
After Width: | Height: | Size: 583 B |
51
docs/lua/examples/lighting-engine-demo/levels/hl/script.c
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#include <ultra64.h>
|
||||
#include "sm64.h"
|
||||
#include "behavior_data.h"
|
||||
#include "model_ids.h"
|
||||
#include "seq_ids.h"
|
||||
#include "dialog_ids.h"
|
||||
#include "segment_symbols.h"
|
||||
#include "level_commands.h"
|
||||
|
||||
#include "game/level_update.h"
|
||||
|
||||
#include "levels/scripts.h"
|
||||
|
||||
#include "make_const_nonconst.h"
|
||||
#include "levels/hl/header.h"
|
||||
|
||||
const LevelScript level_hl_entry[] = {
|
||||
INIT_LEVEL(),
|
||||
LOAD_MIO0(0x7, _hl_segment_7SegmentRomStart, _hl_segment_7SegmentRomEnd),
|
||||
ALLOC_LEVEL_POOL(),
|
||||
MARIO(MODEL_MARIO, 0x00000001, bhvMario),
|
||||
|
||||
AREA(1, hl_area_1),
|
||||
WARP_NODE(0x0A, 50, 0x01, 0x0A, WARP_NO_CHECKPOINT),
|
||||
WARP_NODE(0xF0, 51, 0x01, 0x0A, WARP_NO_CHECKPOINT),
|
||||
WARP_NODE(0xF1, 50, 0x01, 0x0A, WARP_NO_CHECKPOINT),
|
||||
WARP_NODE(0x01, 50, 0x01, 0x0A, WARP_NO_CHECKPOINT),
|
||||
WARP_NODE(0x02, 50, 0x01, 0x0A, WARP_NO_CHECKPOINT),
|
||||
OBJECT(MODEL_NONE, 0, 0, 0, 0, 0, 0, (0x64 << 24) | (0x64 << 16) | (0x78 << 8) | (0x00), bhvAmbientLight),
|
||||
OBJECT(MODEL_NONE, 1296, -527, -592, 0, 0, 0, 0x000A0000, bhvInstantActiveWarp),
|
||||
MARIO_POS(0x01, 0, 1296, -527, -592),
|
||||
OBJECT(MODEL_NONE, -111, -287, -1006, 0, 0, 0, (0x32 << 24) | (0x32 << 16) | (0x46 << 8) | (0x64), bhvPointLight),
|
||||
OBJECT(MODEL_NONE, -111, -287, -183, 0, 0, 0, (0x32 << 24) | (0x32 << 16) | (0x46 << 8) | (0x64), bhvPointLight),
|
||||
OBJECT(MODEL_NONE, -111, -287, -618, 0, 0, 0, (0x32 << 24) | (0x32 << 16) | (0x46 << 8) | (0x64), bhvPointLight),
|
||||
OBJECT(MODEL_NONE, -111, -287, -618, 0, 0, 0, (0x46 << 24) | (0x50 << 16) | (0x64 << 8) | (0x64), bhvPointLight),
|
||||
TERRAIN(hl_area_1_collision),
|
||||
MACRO_OBJECTS(hl_area_1_macro_objs),
|
||||
SET_BACKGROUND_MUSIC(0x00, SEQ_SOUND_PLAYER),
|
||||
TERRAIN_TYPE(TERRAIN_STONE),
|
||||
/* Fast64 begin persistent block [area commands] */
|
||||
/* Fast64 end persistent block [area commands] */
|
||||
END_AREA(),
|
||||
|
||||
FREE_LEVEL_POOL(),
|
||||
MARIO_POS(0x01, 0, 1296, -527, -592),
|
||||
CALL(0, lvl_init_or_update),
|
||||
CALL_LOOP(1, lvl_init_or_update),
|
||||
CLEAR_LEVEL(),
|
||||
SLEEP_BEFORE_EXIT(1),
|
||||
EXIT(),
|
||||
};
|
||||
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
|
@ -0,0 +1,265 @@
|
|||
Gfx hl_dl_fifties_cmp3b_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_fifties_cmp3b_rgba16[] = {
|
||||
#include "levels/hl/fifties_cmp3b.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_ca1x_monside_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_ca1x_monside_rgba16[] = {
|
||||
#include "levels/hl/ca1x_monside.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_drkmtlt_bord11_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_drkmtlt_bord11_rgba16[] = {
|
||||
#include "levels/hl/drkmtlt_bord11.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_c2a4e_w1b_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_c2a4e_w1b_rgba16[] = {
|
||||
#include "levels/hl/c2a4e_w1b.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_c1a0_labw4_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_c1a0_labw4_rgba16[] = {
|
||||
#include "levels/hl/c1a0_labw4.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_drkmtl_scrn3_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_drkmtl_scrn3_rgba16[] = {
|
||||
#include "levels/hl/drkmtl_scrn3.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_c1a0_labw5_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_c1a0_labw5_rgba16[] = {
|
||||
#include "levels/hl/c1a0_labw5.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_drkmtlt_ceil01b_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_drkmtlt_ceil01b_rgba16[] = {
|
||||
#include "levels/hl/drkmtlt_ceil01b.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_c1a0_labglu_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_c1a0_labglu_rgba16[] = {
|
||||
#include "levels/hl/c1a0_labglu.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl__0c2a4e_w1_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl__0c2a4e_w1_rgba16[] = {
|
||||
#include "levels/hl/_0c2a4e_w1.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_fifties_cmp3c_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_fifties_cmp3c_rgba16[] = {
|
||||
#include "levels/hl/fifties_cmp3c.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_c1a1_flr1_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_c1a1_flr1_rgba16[] = {
|
||||
#include "levels/hl/c1a1_flr1.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_lab1_b4_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_lab1_b4_rgba16[] = {
|
||||
#include "levels/hl/lab1_b4.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl__spotyellow_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl__spotyellow_rgba16[] = {
|
||||
#include "levels/hl/_spotyellow.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_c1a0_labw7_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_c1a0_labw7_rgba16[] = {
|
||||
#include "levels/hl/c1a0_labw7.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_lab1_comp3e_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_lab1_comp3e_rgba16[] = {
|
||||
#include "levels/hl/lab1_comp3e.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_basetrim02_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_basetrim02_rgba16[] = {
|
||||
#include "levels/hl/basetrim02.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_out_dmplid_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_out_dmplid_rgba16[] = {
|
||||
#include "levels/hl/out_dmplid.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl__a_lab1_sw1_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl__a_lab1_sw1_rgba16[] = {
|
||||
#include "levels/hl/_a_lab1_sw1.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_generic028_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_generic028_rgba16[] = {
|
||||
#include "levels/hl/generic028.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_c1a1_flr2c_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_c1a1_flr2c_rgba16[] = {
|
||||
#include "levels/hl/c1a1_flr2c.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_generic46_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_generic46_rgba16[] = {
|
||||
#include "levels/hl/generic46.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_c2a4x_c1_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_c2a4x_c1_rgba16[] = {
|
||||
#include "levels/hl/c2a4x_c1.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl__0_generic85_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl__0_generic85_rgba16[] = {
|
||||
#include "levels/hl/_0_generic85.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_fifties_mon1b_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_fifties_mon1b_rgba16[] = {
|
||||
#include "levels/hl/fifties_mon1b.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl__0_fifties_lgt2_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl__0_fifties_lgt2_rgba16[] = {
|
||||
#include "levels/hl/_0_fifties_lgt2.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_generic015v2_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_generic015v2_rgba16[] = {
|
||||
#include "levels/hl/generic015v2.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_drkmtl_scrn_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_drkmtl_scrn_rgba16[] = {
|
||||
#include "levels/hl/drkmtl_scrn.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_babtech_ceil01_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_babtech_ceil01_rgba16[] = {
|
||||
#include "levels/hl/babtech_ceil01.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl__0_fifties_lgt3_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl__0_fifties_lgt3_rgba16[] = {
|
||||
#include "levels/hl/_0_fifties_lgt3.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_c1a0_wx_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_c1a0_wx_rgba16[] = {
|
||||
#include "levels/hl/c1a0_wx.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_black_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_black_rgba16[] = {
|
||||
#include "levels/hl/black.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl__lab_crt8_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl__lab_crt8_rgba16[] = {
|
||||
#include "levels/hl/_lab_crt8.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_lab1_map2_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_lab1_map2_rgba16[] = {
|
||||
#include "levels/hl/lab1_map2.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_flatbed_bumper_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_flatbed_bumper_rgba16[] = {
|
||||
#include "levels/hl/flatbed_bumper.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_pfab_bks1b_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_pfab_bks1b_rgba16[] = {
|
||||
#include "levels/hl/pfab_bks1b.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_paper1_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_paper1_rgba16[] = {
|
||||
#include "levels/hl/paper1.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl__spotblue_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl__spotblue_rgba16[] = {
|
||||
#include "levels/hl/_spotblue.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_stripes2_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_stripes2_rgba16[] = {
|
||||
#include "levels/hl/stripes2.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_pfab_bks1a_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_pfab_bks1a_rgba16[] = {
|
||||
#include "levels/hl/pfab_bks1a.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl__lab1_cmp2_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl__lab1_cmp2_rgba16[] = {
|
||||
#include "levels/hl/_lab1_cmp2.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_lab1_flr10_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_lab1_flr10_rgba16[] = {
|
||||
#include "levels/hl/lab1_flr10.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_duct_vnt_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_duct_vnt_rgba16[] = {
|
||||
#include "levels/hl/duct_vnt.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_signc1a1_1_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_signc1a1_1_rgba16[] = {
|
||||
#include "levels/hl/signc1a1_1.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_c1a1sign2a_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_c1a1sign2a_rgba16[] = {
|
||||
#include "levels/hl/c1a1sign2a.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_lab1_map1_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_lab1_map1_rgba16[] = {
|
||||
#include "levels/hl/lab1_map1.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_c1a1sign2b_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_c1a1sign2b_rgba16[] = {
|
||||
#include "levels/hl/c1a1sign2b.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl__gratestep2_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl__gratestep2_rgba16[] = {
|
||||
#include "levels/hl/_gratestep2.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl__lab_crt2_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl__lab_crt2_rgba16[] = {
|
||||
#include "levels/hl/_lab_crt2.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_lab1_door2a_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_lab1_door2a_rgba16[] = {
|
||||
#include "levels/hl/lab1_door2a.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_c1a1dooredge_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_c1a1dooredge_rgba16[] = {
|
||||
#include "levels/hl/c1a1dooredge.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_lab1_gear3_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_lab1_gear3_rgba16[] = {
|
||||
#include "levels/hl/lab1_gear3.rgba16.inc.c"
|
||||
};
|
||||
|
||||
Gfx hl_dl_lab1_gear2_rgba16_aligner[] = {gsSPEndDisplayList()};
|
||||
u8 hl_dl_lab1_gear2_rgba16[] = {
|
||||
#include "levels/hl/lab1_gear2.rgba16.inc.c"
|
||||
};
|
||||
|
||||
111
docs/lua/examples/lighting-engine-demo/main.lua
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
-- name: Lighting Engine Demo
|
||||
-- description: Lighting Engine Demo\nBy \\#ec7731\\Agent X\n\n\\#dcdcdc\\Open the panel in the pause menu to see what you can do.
|
||||
|
||||
local flashlightColor = { 255, 255, 200 }
|
||||
|
||||
--- @param node GraphNode
|
||||
function geo_hide_if_dnc(node)
|
||||
local dl = cast_graph_node(node.next)
|
||||
gfx_parse(dl.displayList, function(cmd, op)
|
||||
if op == G_SETENVCOLOR then
|
||||
gfx_set_command(cmd, "gsDPSetEnvColor", 255, 255, 255, if_then_else(_G.dayNightCycleApi ~= nil and _G.dayNightCycleApi.is_dnc_enabled(), 0, 255))
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
--- @param o Object
|
||||
local function bhv_spawn_point_light(o)
|
||||
local light = spawn_non_sync_object(
|
||||
id_bhvPointLight,
|
||||
E_MODEL_NONE,
|
||||
o.oPosX, o.oPosY, o.oPosZ,
|
||||
nil
|
||||
)
|
||||
if get_id_from_behavior(o.behavior) == id_bhvKoopaShell then
|
||||
light.oBehParams = 0x00FF0032
|
||||
else
|
||||
light.oBehParams = 0xFFFFFF32
|
||||
end
|
||||
light.parentObj = o
|
||||
end
|
||||
|
||||
--- @param o Object
|
||||
function bhv_flashlight_loop(o)
|
||||
local pos = gMarioStates[0].pos
|
||||
local yaw = gFirstPersonCamera.yaw + 0x8000
|
||||
o.oPosX = pos.x + sins(yaw) * 300
|
||||
o.oPosY = pos.y + -gFirstPersonCamera.pitch * 0.06
|
||||
o.oPosZ = pos.z + coss(yaw) * 300
|
||||
le_set_light_pos(o.oLightID, o.oPosX, o.oPosY, o.oPosZ)
|
||||
le_set_light_color(o.oLightID, flashlightColor[1], flashlightColor[2], flashlightColor[3])
|
||||
end
|
||||
|
||||
local function spawn_flashlight()
|
||||
local flashlight = spawn_non_sync_object(
|
||||
bhvFlashlight,
|
||||
E_MODEL_NONE,
|
||||
0, 0, 0,
|
||||
nil
|
||||
)
|
||||
flashlight.oBehParams = (flashlightColor[1] << 24) | (flashlightColor[2] << 16) | (flashlightColor[3] << 8) | (90)
|
||||
return flashlight
|
||||
end
|
||||
|
||||
--- @param flashlight Object
|
||||
local function delete_flashlight(flashlight)
|
||||
le_remove_light(flashlight.oLightID)
|
||||
obj_mark_for_deletion(flashlight)
|
||||
return nil
|
||||
end
|
||||
|
||||
--- @param m MarioState
|
||||
local function calculate_mario_lighting(m)
|
||||
local color = { r = 0, g = 0, b = 0 }
|
||||
local dir = { x = 0, y = 0, z = 0 }
|
||||
|
||||
le_calculate_lighting_color(m.pos, color, 0.25)
|
||||
le_calculate_lighting_dir(m.pos, dir)
|
||||
|
||||
m.marioBodyState.lightR = color.r
|
||||
m.marioBodyState.lightG = color.g
|
||||
m.marioBodyState.lightB = color.b
|
||||
m.marioBodyState.shadeR = m.marioBodyState.lightR * 0.5
|
||||
m.marioBodyState.shadeG = m.marioBodyState.lightG * 0.5
|
||||
m.marioBodyState.shadeB = m.marioBodyState.lightB * 0.5
|
||||
|
||||
m.marioBodyState.lightingDirX = -DEFAULT_LIGHTING_DIR + dir.x
|
||||
m.marioBodyState.lightingDirY = -DEFAULT_LIGHTING_DIR + dir.y
|
||||
m.marioBodyState.lightingDirZ = -DEFAULT_LIGHTING_DIR + dir.z
|
||||
end
|
||||
|
||||
--- @param m MarioState
|
||||
local function mario_update(m)
|
||||
if m.playerIndex ~= 0 then return end
|
||||
|
||||
calculate_mario_lighting(m)
|
||||
|
||||
if (m.controller.buttonPressed & L_JPAD) ~= 0 then
|
||||
audio_sample_play(SOUND_CUSTOM_FLASHLIGHT, m.pos, 1.0)
|
||||
local flashlight = obj_get_first_with_behavior_id(bhvFlashlight)
|
||||
if flashlight ~= nil then
|
||||
delete_flashlight(flashlight)
|
||||
else
|
||||
spawn_flashlight()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function on_set_flashlight_color(index, value)
|
||||
flashlightColor[index + 1] = value
|
||||
end
|
||||
|
||||
id_bhvKoopaShell = hook_behavior(id_bhvKoopaShell, OBJ_LIST_LEVEL, false, bhv_spawn_point_light, nil, "bhvKoopaShell")
|
||||
|
||||
hook_event(HOOK_MARIO_UPDATE, mario_update)
|
||||
|
||||
hook_mod_menu_slider("Flashlight Red", flashlightColor[1], 0, 255, on_set_flashlight_color)
|
||||
hook_mod_menu_slider("Flashlight Green", flashlightColor[2], 0, 255, on_set_flashlight_color)
|
||||
hook_mod_menu_slider("Flashlight Blue", flashlightColor[3], 0, 255, on_set_flashlight_color)
|
||||
hook_mod_menu_button("Warp to Black Mesa", function() warp_to_level(LEVEL_HL, 1, 0) end)
|
||||
hook_mod_menu_button("Warp to Sunset Canals", function() warp_to_level(LEVEL_CANALS, 1, 0) end)
|
||||
BIN
docs/lua/examples/lighting-engine-demo/sound/flashlight.ogg
Normal file
|
|
@ -436,6 +436,27 @@ Behavior loop function for alpha boo key
|
|||
|
||||
<br />
|
||||
|
||||
## [bhv_ambient_light_init](#bhv_ambient_light_init)
|
||||
|
||||
### Description
|
||||
Behavior loop function for the lighting engine ambient light. Takes the first 3 behavior parameter bytes for RGB color
|
||||
|
||||
### Lua Example
|
||||
`bhv_ambient_light_init()`
|
||||
|
||||
### Parameters
|
||||
- None
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void bhv_ambient_light_init(void);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [bhv_ambient_sounds_init](#bhv_ambient_sounds_init)
|
||||
|
||||
### Description
|
||||
|
|
@ -7345,6 +7366,48 @@ Behavior loop function for playing a jingle when in a 200 unit radius
|
|||
|
||||
<br />
|
||||
|
||||
## [bhv_point_light_init](#bhv_point_light_init)
|
||||
|
||||
### Description
|
||||
Behavior init function for the lighting engine point light. Takes the first 3 behavior parameter bytes for RGB color and the last for radius
|
||||
|
||||
### Lua Example
|
||||
`bhv_point_light_init()`
|
||||
|
||||
### Parameters
|
||||
- None
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void bhv_point_light_init(void);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [bhv_point_light_loop](#bhv_point_light_loop)
|
||||
|
||||
### Description
|
||||
Behavior loop function for the lighting engine point light
|
||||
|
||||
### Lua Example
|
||||
`bhv_point_light_loop()`
|
||||
|
||||
### Parameters
|
||||
- None
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void bhv_point_light_loop(void);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [bhv_pokey_body_part_update](#bhv_pokey_body_part_update)
|
||||
|
||||
### Description
|
||||
|
|
|
|||
|
|
@ -6241,6 +6241,260 @@ Special warps to arg (`SPECIAL_WARP_*`)
|
|||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
---
|
||||
# functions from lighting_engine.h
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
## [le_add_light](#le_add_light)
|
||||
|
||||
### Description
|
||||
Adds a lighting engine point light at `x`, `y`, `z` with color `r`, `g`, `b` and `radius` with `intensity`
|
||||
|
||||
### Lua Example
|
||||
`local integerValue = le_add_light(x, y, z, r, g, b, radius, intensity)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| x | `number` |
|
||||
| y | `number` |
|
||||
| z | `number` |
|
||||
| r | `integer` |
|
||||
| g | `integer` |
|
||||
| b | `integer` |
|
||||
| radius | `number` |
|
||||
| intensity | `number` |
|
||||
|
||||
### Returns
|
||||
- `integer`
|
||||
|
||||
### C Prototype
|
||||
`s16 le_add_light(f32 x, f32 y, f32 z, u8 r, u8 g, u8 b, f32 radius, f32 intensity);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [le_calculate_lighting_color](#le_calculate_lighting_color)
|
||||
|
||||
### Description
|
||||
Calculates the lighting with `lightIntensityScalar` at a position and outputs the color in `out`
|
||||
|
||||
### Lua Example
|
||||
`le_calculate_lighting_color(pos, out, lightIntensityScalar)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| pos | [Vec3f](structs.md#Vec3f) |
|
||||
| out | `Color` |
|
||||
| lightIntensityScalar | `number` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void le_calculate_lighting_color(Vec3f pos, Color out, f32 lightIntensityScalar);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [le_calculate_lighting_dir](#le_calculate_lighting_dir)
|
||||
|
||||
### Description
|
||||
Calculates the lighting direction from a position and outputs the result in `out`
|
||||
|
||||
### Lua Example
|
||||
`le_calculate_lighting_dir(pos, out)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| pos | [Vec3f](structs.md#Vec3f) |
|
||||
| out | [Vec3f](structs.md#Vec3f) |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void le_calculate_lighting_dir(Vec3f pos, Vec3f out);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [le_get_light_count](#le_get_light_count)
|
||||
|
||||
### Description
|
||||
Gets the total number of lights currently loaded in the lighting engine
|
||||
|
||||
### Lua Example
|
||||
`local integerValue = le_get_light_count()`
|
||||
|
||||
### Parameters
|
||||
- None
|
||||
|
||||
### Returns
|
||||
- `integer`
|
||||
|
||||
### C Prototype
|
||||
`s16 le_get_light_count(void);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [le_remove_light](#le_remove_light)
|
||||
|
||||
### Description
|
||||
Removes a lighting engine point light corresponding to `id`
|
||||
|
||||
### Lua Example
|
||||
`le_remove_light(id)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| id | `integer` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void le_remove_light(s16 id);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [le_set_ambient_color](#le_set_ambient_color)
|
||||
|
||||
### Description
|
||||
Sets the lighting engine ambient color
|
||||
|
||||
### Lua Example
|
||||
`le_set_ambient_color(r, g, b)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| r | `integer` |
|
||||
| g | `integer` |
|
||||
| b | `integer` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void le_set_ambient_color(u8 r, u8 g, u8 b);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [le_set_light_color](#le_set_light_color)
|
||||
|
||||
### Description
|
||||
Sets a lighting engine point light's color to `r`, `g`, `b`
|
||||
|
||||
### Lua Example
|
||||
`le_set_light_color(id, r, g, b)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| id | `integer` |
|
||||
| r | `integer` |
|
||||
| g | `integer` |
|
||||
| b | `integer` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void le_set_light_color(s16 id, u8 r, u8 g, u8 b);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [le_set_light_intensity](#le_set_light_intensity)
|
||||
|
||||
### Description
|
||||
Sets a lighting engine point light's `intensity`
|
||||
|
||||
### Lua Example
|
||||
`le_set_light_intensity(id, intensity)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| id | `integer` |
|
||||
| intensity | `number` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void le_set_light_intensity(s16 id, f32 intensity);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [le_set_light_pos](#le_set_light_pos)
|
||||
|
||||
### Description
|
||||
Sets a lighting engine point light's position to `x`, `y`, `z`
|
||||
|
||||
### Lua Example
|
||||
`le_set_light_pos(id, x, y, z)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| id | `integer` |
|
||||
| x | `number` |
|
||||
| y | `number` |
|
||||
| z | `number` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void le_set_light_pos(s16 id, f32 x, f32 y, f32 z);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [le_set_light_radius](#le_set_light_radius)
|
||||
|
||||
### Description
|
||||
Sets a lighting engine point light's `radius`
|
||||
|
||||
### Lua Example
|
||||
`le_set_light_radius(id, radius)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| id | `integer` |
|
||||
| radius | `number` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void le_set_light_radius(s16 id, f32 radius);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
---
|
||||
|
||||
|
|
|
|||