From 784614347b8e5424b11555d096682697ee8e26e7 Mon Sep 17 00:00:00 2001 From: MysterD Date: Wed, 30 Mar 2022 21:36:47 -0700 Subject: [PATCH] Added big paddle example --- .../actors/big_paddle/collision.inc.c | 69 +++++ .../actors/big_paddle/collision_header.h | 1 + .../big-paddle/actors/big_paddle/geo.inc.c | 10 + .../big-paddle/actors/big_paddle/geo_header.h | 10 + .../big-paddle/actors/big_paddle/model.inc.c | 252 ++++++++++++++++++ .../actors/big_paddle_collision.col | Bin 0 -> 409 bytes .../big-paddle/actors/big_paddle_geo.bin | Bin 0 -> 3014 bytes docs/lua/examples/big-paddle/main.lua | 43 +++ docs/lua/lua.md | 1 + 9 files changed, 386 insertions(+) create mode 100644 docs/lua/examples/big-paddle/actors/big_paddle/collision.inc.c create mode 100644 docs/lua/examples/big-paddle/actors/big_paddle/collision_header.h create mode 100644 docs/lua/examples/big-paddle/actors/big_paddle/geo.inc.c create mode 100644 docs/lua/examples/big-paddle/actors/big_paddle/geo_header.h create mode 100644 docs/lua/examples/big-paddle/actors/big_paddle/model.inc.c create mode 100644 docs/lua/examples/big-paddle/actors/big_paddle_collision.col create mode 100644 docs/lua/examples/big-paddle/actors/big_paddle_geo.bin create mode 100644 docs/lua/examples/big-paddle/main.lua diff --git a/docs/lua/examples/big-paddle/actors/big_paddle/collision.inc.c b/docs/lua/examples/big-paddle/actors/big_paddle/collision.inc.c new file mode 100644 index 00000000..e45fead8 --- /dev/null +++ b/docs/lua/examples/big-paddle/actors/big_paddle/collision.inc.c @@ -0,0 +1,69 @@ +const Collision big_paddle_collision[] = { + COL_INIT(), + COL_VERTEX_INIT(24), + COL_VERTEX(-40, -40, -400), + COL_VERTEX(-120, 40, -400), + COL_VERTEX(-120, 40, -800), + COL_VERTEX(-40, -40, -720), + COL_VERTEX(120, 40, -800), + COL_VERTEX(40, -40, -720), + COL_VERTEX(120, 40, -400), + COL_VERTEX(40, -40, -400), + COL_VERTEX(-40, -40, 40), + COL_VERTEX(-40, 40, 40), + COL_VERTEX(-40, 40, -40), + COL_VERTEX(-40, -40, -40), + COL_VERTEX(40, 40, -40), + COL_VERTEX(40, -40, -40), + COL_VERTEX(12, -12, -60), + COL_VERTEX(12, 12, -60), + COL_VERTEX(40, 40, 40), + COL_VERTEX(40, -40, 40), + COL_VERTEX(12, -12, -400), + COL_VERTEX(12, 12, -400), + COL_VERTEX(-12, -12, -60), + COL_VERTEX(-12, 12, -60), + COL_VERTEX(-12, -12, -400), + COL_VERTEX(-12, 12, -400), + COL_TRI_INIT(SURFACE_DEFAULT, 38), + COL_TRI(0, 1, 2), + COL_TRI(0, 2, 3), + COL_TRI(3, 2, 4), + COL_TRI(3, 4, 5), + COL_TRI(5, 4, 6), + COL_TRI(5, 6, 7), + COL_TRI(7, 6, 1), + COL_TRI(7, 1, 0), + COL_TRI(3, 5, 7), + COL_TRI(3, 7, 0), + COL_TRI(4, 2, 1), + COL_TRI(4, 1, 6), + COL_TRI(8, 9, 10), + COL_TRI(8, 10, 11), + COL_TRI(12, 13, 14), + COL_TRI(12, 14, 15), + COL_TRI(13, 12, 16), + COL_TRI(13, 16, 17), + COL_TRI(17, 16, 9), + COL_TRI(17, 9, 8), + COL_TRI(11, 13, 17), + COL_TRI(11, 17, 8), + COL_TRI(12, 10, 9), + COL_TRI(12, 9, 16), + COL_TRI(15, 14, 18), + COL_TRI(15, 18, 19), + COL_TRI(13, 11, 20), + COL_TRI(13, 20, 14), + COL_TRI(10, 12, 15), + COL_TRI(10, 15, 21), + COL_TRI(11, 10, 21), + COL_TRI(11, 21, 20), + COL_TRI(14, 20, 22), + COL_TRI(14, 22, 18), + COL_TRI(21, 15, 19), + COL_TRI(21, 19, 23), + COL_TRI(20, 21, 23), + COL_TRI(20, 23, 22), + COL_TRI_STOP(), + COL_END() +}; diff --git a/docs/lua/examples/big-paddle/actors/big_paddle/collision_header.h b/docs/lua/examples/big-paddle/actors/big_paddle/collision_header.h new file mode 100644 index 00000000..03d5ea60 --- /dev/null +++ b/docs/lua/examples/big-paddle/actors/big_paddle/collision_header.h @@ -0,0 +1 @@ +extern const Collision big_paddle_collision[]; diff --git a/docs/lua/examples/big-paddle/actors/big_paddle/geo.inc.c b/docs/lua/examples/big-paddle/actors/big_paddle/geo.inc.c new file mode 100644 index 00000000..a2acc99d --- /dev/null +++ b/docs/lua/examples/big-paddle/actors/big_paddle/geo.inc.c @@ -0,0 +1,10 @@ +#include "src/game/envfx_snow.h" + +const GeoLayout big_paddle_geo[] = { + GEO_NODE_START(), + GEO_OPEN_NODE(), + GEO_DISPLAY_LIST(LAYER_OPAQUE, big_paddle_paddle_mesh_layer_1), + GEO_DISPLAY_LIST(LAYER_OPAQUE, big_paddle_material_revert_render_settings), + GEO_CLOSE_NODE(), + GEO_END(), +}; diff --git a/docs/lua/examples/big-paddle/actors/big_paddle/geo_header.h b/docs/lua/examples/big-paddle/actors/big_paddle/geo_header.h new file mode 100644 index 00000000..aef1b61f --- /dev/null +++ b/docs/lua/examples/big-paddle/actors/big_paddle/geo_header.h @@ -0,0 +1,10 @@ +extern const GeoLayout big_paddle_geo[]; +extern Lights1 big_paddle_f3d_material_lights; +extern u8 big_paddle_custom_box_surface_rgba16_ci4[]; +extern u8 big_paddle_custom_box_surface_rgba16_ci4_pal_rgba16[]; +extern Vtx big_paddle_paddle_mesh_layer_1_vtx_0[76]; +extern Gfx big_paddle_paddle_mesh_layer_1_tri_0[]; +extern Gfx mat_big_paddle_f3d_material[]; +extern Gfx mat_revert_big_paddle_f3d_material[]; +extern Gfx big_paddle_paddle_mesh_layer_1[]; +extern Gfx big_paddle_material_revert_render_settings[]; diff --git a/docs/lua/examples/big-paddle/actors/big_paddle/model.inc.c b/docs/lua/examples/big-paddle/actors/big_paddle/model.inc.c new file mode 100644 index 00000000..43e045f4 --- /dev/null +++ b/docs/lua/examples/big-paddle/actors/big_paddle/model.inc.c @@ -0,0 +1,252 @@ +Lights1 big_paddle_f3d_material_lights = gdSPDefLights1( + 0x7F, 0x7F, 0x7F, + 0xFE, 0xFE, 0xFE, 0x28, 0x28, 0x28); + +Gfx big_paddle_custom_box_surface_rgba16_ci4_aligner[] = {gsSPEndDisplayList()}; +u8 big_paddle_custom_box_surface_rgba16_ci4[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + +}; + +Gfx big_paddle_custom_box_surface_rgba16_ci4_pal_rgba16_aligner[] = {gsSPEndDisplayList()}; +u8 big_paddle_custom_box_surface_rgba16_ci4_pal_rgba16[] = { + 0x00, 0x01, 0x00, 0xff, +}; + +Vtx big_paddle_paddle_mesh_layer_1_vtx_0[76] = { + {{{-40, -40, -400},0, {982, 982},{0xA6, 0xA6, 0x0, 0xFF}}}, + {{{-120, 40, -400},0, {982, 10},{0xA6, 0xA6, 0x0, 0xFF}}}, + {{{-120, 40, -800},0, {10, 10},{0xA6, 0xA6, 0x0, 0xFF}}}, + {{{-40, -40, -720},0, {10, 982},{0xA6, 0xA6, 0x0, 0xFF}}}, + {{{-40, -40, -720},0, {982, 982},{0x0, 0xA6, 0xA6, 0xFF}}}, + {{{-120, 40, -800},0, {982, 10},{0x0, 0xA6, 0xA6, 0xFF}}}, + {{{120, 40, -800},0, {10, 10},{0x0, 0xA6, 0xA6, 0xFF}}}, + {{{40, -40, -720},0, {10, 982},{0x0, 0xA6, 0xA6, 0xFF}}}, + {{{40, -40, -720},0, {10, 10},{0x5A, 0xA6, 0x0, 0xFF}}}, + {{{120, 40, -800},0, {10, 982},{0x5A, 0xA6, 0x0, 0xFF}}}, + {{{120, 40, -400},0, {982, 982},{0x5A, 0xA6, 0x0, 0xFF}}}, + {{{40, -40, -400},0, {982, 10},{0x5A, 0xA6, 0x0, 0xFF}}}, + {{{40, -40, -400},0, {22, 86},{0x0, 0x0, 0x7F, 0xFF}}}, + {{{120, 40, -400},0, {22, 906},{0x0, 0x0, 0x7F, 0xFF}}}, + {{{-120, 40, -400},0, {74, 906},{0x0, 0x0, 0x7F, 0xFF}}}, + {{{-40, -40, -400},0, {74, 86},{0x0, 0x0, 0x7F, 0xFF}}}, + {{{-40, -40, -720},0, {10, 982},{0x0, 0x81, 0x0, 0xFF}}}, + {{{40, -40, -720},0, {982, 982},{0x0, 0x81, 0x0, 0xFF}}}, + {{{40, -40, -400},0, {982, 10},{0x0, 0x81, 0x0, 0xFF}}}, + {{{-40, -40, -400},0, {10, 10},{0x0, 0x81, 0x0, 0xFF}}}, + {{{120, 40, -800},0, {10, 982},{0x0, 0x7F, 0x0, 0xFF}}}, + {{{-120, 40, -800},0, {982, 982},{0x0, 0x7F, 0x0, 0xFF}}}, + {{{-120, 40, -400},0, {982, 10},{0x0, 0x7F, 0x0, 0xFF}}}, + {{{120, 40, -400},0, {10, 10},{0x0, 0x7F, 0x0, 0xFF}}}, + {{{-40, -40, 40},0, {1008, 1008},{0x81, 0x0, 0x0, 0xFF}}}, + {{{-40, 40, 40},0, {1008, -16},{0x81, 0x0, 0x0, 0xFF}}}, + {{{-40, 40, -40},0, {-16, -16},{0x81, 0x0, 0x0, 0xFF}}}, + {{{-40, -40, -40},0, {-16, 1008},{0x81, 0x0, 0x0, 0xFF}}}, + {{{40, 40, -40},0, {-16, 240},{0x4A, 0x0, 0x99, 0xFF}}}, + {{{40, -40, -40},0, {-16, 752},{0x4A, 0x0, 0x99, 0xFF}}}, + {{{12, -12, -60},0, {1008, 573},{0x4A, 0x0, 0x99, 0xFF}}}, + {{{12, 12, -60},0, {1008, 419},{0x4A, 0x0, 0x99, 0xFF}}}, + {{{40, -40, -40},0, {-16, -16},{0x7F, 0x0, 0x0, 0xFF}}}, + {{{40, 40, -40},0, {-16, 1008},{0x7F, 0x0, 0x0, 0xFF}}}, + {{{40, 40, 40},0, {1008, 1008},{0x7F, 0x0, 0x0, 0xFF}}}, + {{{40, -40, 40},0, {1008, -16},{0x7F, 0x0, 0x0, 0xFF}}}, + {{{40, -40, 40},0, {-16, -16},{0x0, 0x0, 0x7F, 0xFF}}}, + {{{40, 40, 40},0, {-16, 1008},{0x0, 0x0, 0x7F, 0xFF}}}, + {{{-40, 40, 40},0, {1008, 1008},{0x0, 0x0, 0x7F, 0xFF}}}, + {{{-40, -40, 40},0, {1008, -16},{0x0, 0x0, 0x7F, 0xFF}}}, + {{{-40, -40, -40},0, {982, 10},{0x0, 0x81, 0x0, 0xFF}}}, + {{{40, -40, -40},0, {10, 10},{0x0, 0x81, 0x0, 0xFF}}}, + {{{40, -40, 40},0, {10, 982},{0x0, 0x81, 0x0, 0xFF}}}, + {{{-40, -40, 40},0, {982, 982},{0x0, 0x81, 0x0, 0xFF}}}, + {{{40, 40, -40},0, {-16, 1008},{0x0, 0x7F, 0x0, 0xFF}}}, + {{{-40, 40, -40},0, {1008, 1008},{0x0, 0x7F, 0x0, 0xFF}}}, + {{{-40, 40, 40},0, {1008, -16},{0x0, 0x7F, 0x0, 0xFF}}}, + {{{40, 40, 40},0, {-16, -16},{0x0, 0x7F, 0x0, 0xFF}}}, + {{{12, 12, -60},0, {189, -16},{0x7F, 0x0, 0x0, 0xFF}}}, + {{{12, -12, -60},0, {189, 1008},{0x7F, 0x0, 0x0, 0xFF}}}, + {{{12, -12, -400},0, {803, 1008},{0x7F, 0x0, 0x0, 0xFF}}}, + {{{12, 12, -400},0, {803, -16},{0x7F, 0x0, 0x0, 0xFF}}}, + {{{40, -40, -40},0, {752, 1008},{0x0, 0xB6, 0x99, 0xFF}}}, + {{{-40, -40, -40},0, {240, 1008},{0x0, 0xB6, 0x99, 0xFF}}}, + {{{-12, -12, -60},0, {419, -16},{0x0, 0xB6, 0x99, 0xFF}}}, + {{{12, -12, -60},0, {573, -16},{0x0, 0xB6, 0x99, 0xFF}}}, + {{{-40, 40, -40},0, {240, 1008},{0x0, 0x4A, 0x99, 0xFF}}}, + {{{40, 40, -40},0, {752, 1008},{0x0, 0x4A, 0x99, 0xFF}}}, + {{{12, 12, -60},0, {573, -16},{0x0, 0x4A, 0x99, 0xFF}}}, + {{{-12, 12, -60},0, {419, -16},{0x0, 0x4A, 0x99, 0xFF}}}, + {{{-40, -40, -40},0, {-16, 752},{0xB6, 0x0, 0x99, 0xFF}}}, + {{{-40, 40, -40},0, {-16, 240},{0xB6, 0x0, 0x99, 0xFF}}}, + {{{-12, 12, -60},0, {1008, 419},{0xB6, 0x0, 0x99, 0xFF}}}, + {{{-12, -12, -60},0, {1008, 573},{0xB6, 0x0, 0x99, 0xFF}}}, + {{{12, -12, -60},0, {1008, 803},{0x0, 0x81, 0x0, 0xFF}}}, + {{{-12, -12, -60},0, {-16, 803},{0x0, 0x81, 0x0, 0xFF}}}, + {{{-12, -12, -400},0, {-16, 189},{0x0, 0x81, 0x0, 0xFF}}}, + {{{12, -12, -400},0, {1008, 189},{0x0, 0x81, 0x0, 0xFF}}}, + {{{-12, 12, -60},0, {-16, 803},{0x0, 0x7F, 0x0, 0xFF}}}, + {{{12, 12, -60},0, {1008, 803},{0x0, 0x7F, 0x0, 0xFF}}}, + {{{12, 12, -400},0, {1008, 189},{0x0, 0x7F, 0x0, 0xFF}}}, + {{{-12, 12, -400},0, {-16, 189},{0x0, 0x7F, 0x0, 0xFF}}}, + {{{-12, -12, -60},0, {189, 1008},{0x81, 0x0, 0x0, 0xFF}}}, + {{{-12, 12, -60},0, {189, -16},{0x81, 0x0, 0x0, 0xFF}}}, + {{{-12, 12, -400},0, {803, -16},{0x81, 0x0, 0x0, 0xFF}}}, + {{{-12, -12, -400},0, {803, 1008},{0x81, 0x0, 0x0, 0xFF}}}, +}; + +Gfx big_paddle_paddle_mesh_layer_1_tri_0[] = { + gsSPVertex(big_paddle_paddle_mesh_layer_1_vtx_0 + 0, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 2, 3, 0), + gsSP1Triangle(4, 5, 6, 0), + gsSP1Triangle(4, 6, 7, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(8, 10, 11, 0), + gsSP1Triangle(12, 13, 14, 0), + gsSP1Triangle(12, 14, 15, 0), + gsSPVertex(big_paddle_paddle_mesh_layer_1_vtx_0 + 16, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 2, 3, 0), + gsSP1Triangle(4, 5, 6, 0), + gsSP1Triangle(4, 6, 7, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(8, 10, 11, 0), + gsSP1Triangle(12, 13, 14, 0), + gsSP1Triangle(12, 14, 15, 0), + gsSPVertex(big_paddle_paddle_mesh_layer_1_vtx_0 + 32, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 2, 3, 0), + gsSP1Triangle(4, 5, 6, 0), + gsSP1Triangle(4, 6, 7, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(8, 10, 11, 0), + gsSP1Triangle(12, 13, 14, 0), + gsSP1Triangle(12, 14, 15, 0), + gsSPVertex(big_paddle_paddle_mesh_layer_1_vtx_0 + 48, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 2, 3, 0), + gsSP1Triangle(4, 5, 6, 0), + gsSP1Triangle(4, 6, 7, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(8, 10, 11, 0), + gsSP1Triangle(12, 13, 14, 0), + gsSP1Triangle(12, 14, 15, 0), + gsSPVertex(big_paddle_paddle_mesh_layer_1_vtx_0 + 64, 12, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 2, 3, 0), + gsSP1Triangle(4, 5, 6, 0), + gsSP1Triangle(4, 6, 7, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(8, 10, 11, 0), + gsSPEndDisplayList(), +}; + + +Gfx mat_big_paddle_f3d_material[] = { + gsDPPipeSync(), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), + gsSPTexture(65535, 65535, 0, 0, 1), + gsDPSetTextureLUT(G_TT_RGBA16), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, big_paddle_custom_box_surface_rgba16_ci4_pal_rgba16), + gsDPTileSync(), + gsDPSetTile(0, 0, 0, 256, 7, 0, G_TX_WRAP | G_TX_NOMIRROR, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 0, 0), + gsDPLoadSync(), + gsDPLoadTLUTCmd(7, 1), + gsDPPipeSync(), + gsDPTileSync(), + gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, big_paddle_custom_box_surface_rgba16_ci4), + gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0), + gsDPLoadSync(), + gsDPLoadBlock(7, 0, 0, 255, 1024), + gsDPPipeSync(), + gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_4b, 2, 0, 0, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0), + gsDPSetTileSize(0, 0, 0, 124, 124), + gsSPSetLights1(big_paddle_f3d_material_lights), + gsSPEndDisplayList(), +}; + +Gfx mat_revert_big_paddle_f3d_material[] = { + gsDPPipeSync(), + gsDPSetTextureLUT(G_TT_NONE), + gsSPEndDisplayList(), +}; + +Gfx big_paddle_paddle_mesh_layer_1[] = { + gsSPDisplayList(mat_big_paddle_f3d_material), + gsSPDisplayList(big_paddle_paddle_mesh_layer_1_tri_0), + gsSPDisplayList(mat_revert_big_paddle_f3d_material), + gsSPEndDisplayList(), +}; + +Gfx big_paddle_material_revert_render_settings[] = { + gsDPPipeSync(), + gsSPSetGeometryMode(G_LIGHTING), + gsSPClearGeometryMode(G_TEXTURE_GEN), + gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT), + gsSPTexture(65535, 65535, 0, 0, 0), + gsDPSetEnvColor(255, 255, 255, 255), + gsDPSetAlphaCompare(G_AC_NONE), + gsSPEndDisplayList(), +}; + diff --git a/docs/lua/examples/big-paddle/actors/big_paddle_collision.col b/docs/lua/examples/big-paddle/actors/big_paddle_collision.col new file mode 100644 index 0000000000000000000000000000000000000000..4a76fd329fa80390f98a20836f5029d2c51a13ca GIT binary patch literal 409 zcmY+8K~95E7=%YkDFOvrp!EcXrAJUN(x^3tgxHt3@dzHvMGw(s55cm&=l38k%%Ax( z%nX70xqI80r~STv-Mt+8zWeA7@86Q{b)%CzIb*+EtBL1}Pwsv`)#`j{=_hZj_s06x zyOw@(KKcKgX>doEDbsP>{cU}2tj~=doZk$rJbmuHvC=JncBKFYnsI?b7;4UiieRJ# z7qMC((av!*Bo+Z#h$6+hRss{Hd~>NB<|=TRN?2;em8@1MX0^nnC}xq6WvJwhTx+;i m#UfP=YqEsCfQ1^;WMnfowKnt{-e_nmSZPbsjNH;Z=uy9J>0f;S literal 0 HcmV?d00001 diff --git a/docs/lua/examples/big-paddle/actors/big_paddle_geo.bin b/docs/lua/examples/big-paddle/actors/big_paddle_geo.bin new file mode 100644 index 0000000000000000000000000000000000000000..30b059dc8c9ac6ddcfc71b3e39abae3175b3f7aa GIT binary patch literal 3014 zcmchZPiP!f9LIk%vx(`tX_rvL8cPVa$RHlJRJ;Xajn)JSODP^aIN4;U+l8blv)i&p zaW|e?p%?K|ya<6J9z6C|XvMqaV2mhM6si|-uv-wC?DO~iz4vCv(3)+L&NB1%v-AD^ zeQ#%;du*Xr4bGJ-m8CFPJYR3DEC&lK&7gihI$d52gQ&VtKKfFySbLF0O9qJ#*YDS` z&FV{~xf8?Lu`GWbo_S;XB##p~hX(mtUtR6+aAIcql~c`k7Ay1fe}7YKw=b33H$V4Y zf3-bO9sA_7=yvnw#c#jZ@C(Ch8~NRrIA8eV>C4Z3wUHX}Bp)oKyWZnrC^@B1*P%rh(u9$-5v68a6pkq<_; zckU_W5`CxmaPsskwQ(oEQ<^(<@=@E&4t|Fha_BB!pWyR0kdK(Age5++)=^2~^*uY{ zib{7&$M>b3-=WR{uy&rA!hJ~pdjAG~c7G`FH9I);BZ}LjxelcJ`jT?{aNNShJCf?V zS)t2e{YShB{yfVzKg~(L zMsJw&L%(4!dKF9mQ}r0`*+Y+Nkgu#4({HftFRFt-J3qExz4=M%mwrPn^>aVb|5SVh zPUR<@Bi)bd++oyb`^7BvgE3!+*`L0jllfy#>X&#f$GdhVsV8Q8aECwW_qxOVVYdD! zUCl|p(9dH2O#bl4Z1WR6bBBLP{4v}9@%nJD@q8!#R7_y2kG*wAb8kI>Z9cJgSk}MI zHH{js_(>)rMv_B1E{q38bEe8rz(v4@@+`oy2G&IkR*dbj>CAC^u34fo~)_cMDv z=^9ZjD89feXo4IEPu#r>4FNAkj>2laSptROsoNRJN{ zkYB!!H{itM4p{sj0v2vi|8qF?2m#sT7N3-P7MqtSybwkY+{5tm42QhtWzV8n+o#{_ z_jv(lwDu<~$p6|WX&H%buZ1fsJ#ElO4MwhWem=EnNH%$<2T^#o!aIk0*l5(wR_jCB zP-^Eb+xNV!A*Jr|$p1;DwkO}~@ literal 0 HcmV?d00001 diff --git a/docs/lua/examples/big-paddle/main.lua b/docs/lua/examples/big-paddle/main.lua new file mode 100644 index 00000000..a77abfbe --- /dev/null +++ b/docs/lua/examples/big-paddle/main.lua @@ -0,0 +1,43 @@ +-- name: Big Paddle +-- description: Press DPAD+down to spawn a Big Paddle + +E_MODEL_BIG_PADDLE = smlua_model_util_get_id("big_paddle_geo") +COL_BIG_PADDLE = smlua_collision_util_get("big_paddle_collision") + +---------------------------------- + +function bhv_big_paddle_init(obj) + obj.oFlags = OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE + obj.oCollisionDistance = 1000 + obj.collisionData = COL_BIG_PADDLE + network_init_object(obj, false, nil) +end + +function bhv_big_paddle_loop(obj) + obj.oFaceAnglePitch = obj.oFaceAnglePitch + 0x100 + load_object_collision_model() +end + +id_bhvBigPaddle = hook_behavior(nil, OBJ_LIST_SURFACE, true, bhv_big_paddle_init, bhv_big_paddle_loop) + +---------------------------------- + +function mario_update_local(m) + if (m.controller.buttonPressed & D_JPAD) ~= 0 then + print('spawning paddle: ', id_bhvBigPaddle, E_MODEL_BIG_PADDLE, COL_BIG_PADDLE) + -- spawn paddle + spawn_sync_object( + id_bhvBigPaddle, + E_MODEL_BIG_PADDLE, + m.pos.x, m.pos.y, m.pos.z, + nil) + end +end + +function mario_update(m) + if m.playerIndex == 0 then + mario_update_local(m) + end +end + +hook_event(HOOK_MARIO_UPDATE, mario_update) diff --git a/docs/lua/lua.md b/docs/lua/lua.md index bef1358f..ebd30980 100644 --- a/docs/lua/lua.md +++ b/docs/lua/lua.md @@ -51,6 +51,7 @@ All of this is a holdover from when there were only two players. It was a reason - [Replace Goomba Behavior](examples/behavior-replace-goomba.lua) - [Add to Goomba Behavior](examples/behavior-add-to-goomba.lua) - [Behavior with Surface Collisions](examples/behavior-surface-collisions.lua) +- [Custom Surface Collisions](examples/big-paddle) - [Custom Box Model](examples/custom-box-model) - [Custom Player Model](examples/koopa-player-model) - [Moonjump](examples/Moonjump.lua)