mirror of
https://github.com/mwpenny/portal64-still-alive.git
synced 2024-11-26 22:00:25 +00:00
Add portal gun
This commit is contained in:
parent
930a4e4bcc
commit
ba6fb4ed2b
28
Makefile
28
Makefile
@ -111,18 +111,36 @@ portal_pak_modified/%.png: portal_pak_dir/%.png assets/%.ims
|
||||
## Materials
|
||||
####################
|
||||
|
||||
build/assets/materials/static.h: assets/materials/static.skm.yaml $(TEXTURE_IMAGES)
|
||||
build/assets/materials/static.h build/assets/materials/static_mat.c: assets/materials/static.skm.yaml $(TEXTURE_IMAGES)
|
||||
@mkdir -p $(@D)
|
||||
$(SKELATOOL64) -n static -m $< -M $@
|
||||
$(SKELATOOL64) -n static -m $< -M build/assets/materials/static.h
|
||||
|
||||
build/assets/materials/hud.h: assets/materials/hud.skm.yaml $(TEXTURE_IMAGES)
|
||||
build/assets/materials/hud.h build/assets/materials/hud_mat.c: assets/materials/hud.skm.yaml $(TEXTURE_IMAGES)
|
||||
@mkdir -p $(@D)
|
||||
$(SKELATOOL64) -n hud -m $< -M $@
|
||||
$(SKELATOOL64) -n hud -m $< -M build/assets/materials/hud.h
|
||||
|
||||
src/levels/level_def_gen.h: build/assets/materials/static.h
|
||||
|
||||
build/src/scene/hud.o: build/assets/materials/hud.h
|
||||
|
||||
####################
|
||||
## Models
|
||||
####################
|
||||
#
|
||||
# Source engine scale is 64x
|
||||
#
|
||||
|
||||
MODEL_LIST = assets/models/cube/cube.blend \
|
||||
assets/models/portal_gun/v_portalgun.blend
|
||||
|
||||
MODEL_HEADERS = $(MODEL_LIST:%.blend=build/%.h)
|
||||
MODEL_OBJECTS = $(MODEL_LIST:%.blend=build/%_geo.o)
|
||||
|
||||
build/assets/models/%.h build/assets/models/%_geo.c: build/assets/models/%.fbx assets/materials/objects.skm.yaml
|
||||
$(SKELATOOL64) -s 2.56 -n $(<:build/assets/models/%.fbx=%) -m assets/materials/objects.skm.yaml -o $(<:%.fbx=%.h) $<
|
||||
|
||||
build/src/models/models.o: $(MODEL_HEADERS)
|
||||
|
||||
####################
|
||||
## Test Chambers
|
||||
####################
|
||||
@ -169,7 +187,7 @@ $(BOOT_OBJ): $(BOOT)
|
||||
|
||||
# without debugger
|
||||
|
||||
CODEOBJECTS = $(patsubst %.c, build/%.o, $(CODEFILES)) $(TEST_CHAMBER_OBJECTS) build/assets/materials/static_mat.o build/assets/materials/hud_mat.o
|
||||
CODEOBJECTS = $(patsubst %.c, build/%.o, $(CODEFILES)) $(TEST_CHAMBER_OBJECTS) $(MODEL_OBJECTS) build/assets/materials/static_mat.o build/assets/materials/hud_mat.o
|
||||
|
||||
CODEOBJECTS_NO_DEBUG = $(CODEOBJECTS)
|
||||
|
||||
|
BIN
assets/images/cube.png
Executable file
BIN
assets/images/cube.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
36
assets/materials/objects.skm.yaml
Normal file
36
assets/materials/objects.skm.yaml
Normal file
@ -0,0 +1,36 @@
|
||||
materials:
|
||||
cube:
|
||||
gDPSetTile:
|
||||
filename:
|
||||
../images/cube.png
|
||||
siz: G_IM_SIZ_16b
|
||||
fmt: G_IM_FMT_RGBA
|
||||
s:
|
||||
mirror: true
|
||||
t:
|
||||
mirror: true
|
||||
gSPGeometryMode:
|
||||
set: [G_LIGHTING, G_SHADE]
|
||||
gDPSetCombineMode:
|
||||
color: ["SHADE", "0", "TEXEL0", "0"]
|
||||
|
||||
portal_gun_white:
|
||||
gDPSetPrimColor:
|
||||
r: 255
|
||||
g: 255
|
||||
b: 255
|
||||
gSPGeometryMode:
|
||||
set: [G_LIGHTING, G_SHADE]
|
||||
gDPSetCombineMode:
|
||||
color: ["PRIMITIVE", "0", "SHADE", "0"]
|
||||
|
||||
portal_gun_metal:
|
||||
gDPSetPrimColor:
|
||||
r: 32
|
||||
g: 32
|
||||
b: 32
|
||||
gSPGeometryMode:
|
||||
set: [G_LIGHTING, G_SHADE]
|
||||
gDPSetCombineMode:
|
||||
color: ["PRIMITIVE", "0", "SHADE", "0"]
|
||||
|
BIN
assets/models/cube/cube.blend
Normal file
BIN
assets/models/cube/cube.blend
Normal file
Binary file not shown.
BIN
assets/models/portal_gun/v_portalgun.blend
Normal file
BIN
assets/models/portal_gun/v_portalgun.blend
Normal file
Binary file not shown.
@ -1,222 +0,0 @@
|
||||
Lights1 cube_cube_lights = gdSPDefLights1(
|
||||
0x7F, 0x7F, 0x7F,
|
||||
0xFE, 0xFE, 0xFE, 0x28, 0x28, 0x28);
|
||||
|
||||
u64 cube_CubeTexture_rgba16[] = {
|
||||
0x94a394a394a394a3, 0x94a394a394a394a3, 0x94a394a394a394a3, 0x94a394a38ca38ca3, 0x8c63846184218421, 0x7c215ad74a535295, 0x8c638c638ca38ca3, 0x8ca394a394a394a3,
|
||||
0x94a394a394a394a3, 0x94a394a394a394a3, 0x94a394a394a394a3, 0x94a394a38ca38c63, 0x8c6384217c217c1f, 0x7c1f635b4a954253, 0x8c638c638ca38ca3, 0x8ca394a394a394a3,
|
||||
0x94a394a394a394a3, 0x94a394a394a394a3, 0x94a394a394a394a3, 0x94a394a38ca38ca3, 0x8c6384617c217c1f, 0x73df63194a954253, 0x8c638c638ca38ca3, 0x8ca394a394a394a3,
|
||||
0x94a394a394a394a3, 0x94a394a394a394a3, 0x94a394a394a394a3, 0x94a394a38ca38c63, 0x8ca384617c1f7c1f, 0x73df63194a954253, 0x8c638c638ca394a3, 0x94a394a394a394a3,
|
||||
0x94a394a394a394a3, 0x94a394a394a394a3, 0x94a394a394a394a3, 0x94a394a38ca38ca3, 0x8ca384617c217bdf, 0x73df63194a954213, 0x8c638c638ca38ca3, 0x8ca38ca394a394a3,
|
||||
0x94a394a394a394a3, 0x8c6394a394a394a3, 0x94a394a394a394a3, 0x94a394a38ca38ca3, 0x8ca384637c2173df, 0x73dd63194a954253, 0x8c638c638c638ca3, 0x8ca38ca38ca38ca3,
|
||||
0x94a394a394a394a3, 0x94a394a394a394a3, 0x94a394a394a394a3, 0x94a38ca38c638c63, 0x8ca384637c1f73df, 0x73dd63594ad74253, 0x7c218c638ca38ca3, 0x8c638ca38ca38c63,
|
||||
0x94a38ca38ca394a3, 0x94a394a394a394a3, 0x94a394a394a394a3, 0x94a38ca38ca38c63, 0x846184617c2173df, 0x73dd635b52d74a97, 0x5b1784618c638461, 0x842184217c217c21,
|
||||
0x94a38ca394a394a3, 0x94a394a394a394a3, 0x94a394a394a394a3, 0x8ca38ca38ca38461, 0x84617c217c2173df, 0x73df6b5b52d75319, 0x4a956b5b7c1f7c1f, 0x7bdf7bdf7bdf7bdf,
|
||||
0x8ca38ca394a394a3, 0x94a394a394a394a3, 0x94a394a38ca38ca3, 0x8ca38c6384618421, 0x7c217c217c217c1f, 0x73df6b5b53195b1b, 0x5b1952d773dd6b9b, 0x635b63595b193a55,
|
||||
0x8ca38ca394a394a3, 0x94a394a394a394a3, 0x94a394a394a38ca3, 0x8c63846184617c21, 0x7c217c217c1f741f, 0x7c1f6b9b5b19635b, 0x5b195b195b195b19, 0x5b19631963193ad9,
|
||||
0x94a38ca394a394a3, 0x94a394a394a394a3, 0x94a38ca38ca38c63, 0x846184617c217c21, 0x7c217c217c1f73df, 0x73df6b9d5b196319, 0x63195b195b195b19, 0x63196319635b3ad9,
|
||||
0x8ca38ca38ca38ca3, 0x94a394a394a394a3, 0x8ca38ca38c638461, 0x84617c217c217c21, 0x7c1f7c1f73df73dd, 0x635b5b195b195b19, 0x5b195b195b196319, 0x63196319635b3ad9,
|
||||
0x8ca38ca38ca38ca3, 0x8ca38ca394a38ca3, 0x8ca38c6384618461, 0x84217c217c217c1f, 0x7c1f7bdf6b9d5b19, 0x5b195b195b195b19, 0x5b195b195b195b19, 0x63195b19635b3ad9,
|
||||
0x8c638ca38ca38ca3, 0x8ca38ca38ca38ca3, 0x8ca3846184618421, 0x7c217c217c1f7c1f, 0x73df635b5b195b19, 0x5b195b195b195b19, 0x5b195b195b195b19, 0x5b195b1963193ad9,
|
||||
0x8c638ca38ca38ca3, 0x8ca38ca38ca38ca3, 0x8463846184617c21, 0x7c217c1f7c1f73df, 0x635b5b195b195b19, 0x5b195b195b195b19, 0x5b195b195b195b19, 0x5b195b195b193ad7,
|
||||
0x8c638ca38ca38ca3, 0x8ca38ca38ca38c63, 0x846184617c217c21, 0x7c1f7c1f73df635b, 0x5b195b195b195b19, 0x5b195b195b195b19, 0x5b195b195ad75ad7, 0x5ad752d752d73255,
|
||||
0x8c638c638c638c63, 0x8c6384638c638461, 0x84617c217c217c1f, 0x7c1f73df6b5b5b19, 0x5b195b195b195b19, 0x5b195b195b195b19, 0x5b1952d752d75295, 0x4a954a5342112211,
|
||||
0x8461842184218421, 0x7c217c217c217c21, 0x7c217c217c217c1f, 0x73df6b9d5b195b19, 0x5b195b195b195b19, 0x5b195b195b1952d7, 0x52d74a9542534211, 0x4a5352d56319635b,
|
||||
0x7c217c217c217c21, 0x7c1f7c1f73df73df, 0x741f7c217c1f741f, 0x73df63195b195b19, 0x5b195b195b195b19, 0x5b195ad752d75295, 0x425342115ad773dd, 0x846184638c638c63,
|
||||
0x7c217c1f7c1f73df, 0x73df73df73df73df, 0x73df73df7c1f73df, 0x6b5b5b195b195b19, 0x5b195b195b195b19, 0x5b1752d74a954211, 0x52957bdf8c638c63, 0x8c638c638c638ca3,
|
||||
0x5b17739d6b9b6b9b, 0x635b6b5b6b9b6b9b, 0x6b9b6b9d6b9d73dd, 0x6319631963196319, 0x5b195b195b195ad7, 0x52d74a9542116319, 0x7c218c638c638c63, 0x8c638c638ca38ca3,
|
||||
0x4a934a954a954a95, 0x4a954a954a954a97, 0x52d752d752d75b19, 0x631963195b195b19, 0x5b195b195ad752d7, 0x4a953a1163598461, 0x8c638c638c638c63, 0x8ca38ca38ca38ca3,
|
||||
0x4a934a5342534253, 0x3a53425342534ad7, 0x5b195b195b196319, 0x63195b195b195b19, 0x5b195b1952d74a95, 0x42115b1984618c63, 0x8c638c638c638c63, 0x8ca38ca38ca38ca3,
|
||||
0x7c217c1f7c1f7c1f, 0x7bdf7c1f73df52d7, 0x4a955b195b1b6319, 0x6319631963196319, 0x5b195b1952d74253, 0x4a937c218c638c63, 0x8c638c638ca38c63, 0x8c638c6184218421,
|
||||
0x8c638c638c638c63, 0x8c638c638c638421, 0x635b52d75b195b19, 0x6319631963195b19, 0x5b195ad74a953a11, 0x739d8c638c638c63, 0x8ca38ca38c638c61, 0x8c618c638c638421,
|
||||
0x8c638ca38c638c63, 0x8ca38c638c638c63, 0x7c217bdf5b195b19, 0x63195b195b195b19, 0x5b1952d74a535295, 0x84618c638c638ca3, 0x8ca38c6384618421, 0x842184218c618c63,
|
||||
0x8c638c638ca38ca3, 0x8ca38ca38c638c63, 0x7c2173dd5b196319, 0x63195b195b195b19, 0x5b1752d73a116b9b, 0x8c638c638c638ca3, 0x8ca38c6184218421, 0x842184218c618c63,
|
||||
0x8c638ca394a394a3, 0x94a38ca38ca38c63, 0x7c1f6b9d5b195b19, 0x631963195b195b19, 0x5ad74a953a117c1f, 0x8c638c638ca38ca3, 0x8c638c618c618c63, 0x8c6394a394a394a3,
|
||||
0x8c6394a394a394a3, 0x94a38c638ca38461, 0x7c1f6b9b63196319, 0x5b1963195b195b19, 0x52d74a954a538461, 0x8ca38c638ca38ca3, 0x8c638c618c618c61, 0x8c6394a394a394a3,
|
||||
0x8c6394a394a394a3, 0x94a394a38ca38461, 0x7c1f6b5b6319635b, 0x6319635b63195b19, 0x5ad74a5352d78c63, 0x8ca38c638ca38ca3, 0x8461842184218c63, 0x94a394a394a394a3,
|
||||
0x8ca394a394a394a3, 0x94a38ca38ca38421, 0x7c1f531942d74ad9, 0x4ad94ad942d942d7, 0x3a95321352d78c63, 0x8c638c638ca38ca3, 0x842184218c6194a3, 0x94a394a394a394a3,
|
||||
|
||||
};
|
||||
|
||||
Vtx cube_CubeSimpleBevel_mesh_vtx_0[98] = {
|
||||
{{{-73, -81, 73},0, {27, 1982},{0xB7, 0xB7, 0x49, 0xFF}}},
|
||||
{{{-73, -73, 81},0, {27, 2084},{0xB7, 0xB7, 0x49, 0xFF}}},
|
||||
{{{-81, -73, 73},0, {-75, 1982},{0xB7, 0xB7, 0x49, 0xFF}}},
|
||||
{{{-73, 73, 81},0, {27, 2084},{0xB7, 0x49, 0x49, 0xFF}}},
|
||||
{{{-73, 81, 73},0, {27, 1982},{0xB7, 0x49, 0x49, 0xFF}}},
|
||||
{{{-81, 73, 73},0, {-75, 1982},{0xB7, 0x49, 0x49, 0xFF}}},
|
||||
{{{-73, -81, -73},0, {27, 31},{0xB7, 0xB7, 0xB7, 0xFF}}},
|
||||
{{{-81, -73, -73},0, {-75, 31},{0xB7, 0xB7, 0xB7, 0xFF}}},
|
||||
{{{-73, -73, -81},0, {27, -71},{0xB7, 0xB7, 0xB7, 0xFF}}},
|
||||
{{{-73, 81, -73},0, {27, 31},{0xB7, 0x49, 0xB7, 0xFF}}},
|
||||
{{{-73, 73, -81},0, {27, -71},{0xB7, 0x49, 0xB7, 0xFF}}},
|
||||
{{{-81, 73, -73},0, {-75, 31},{0xB7, 0x49, 0xB7, 0xFF}}},
|
||||
{{{73, -81, 73},0, {1977, 1982},{0x49, 0xB7, 0x49, 0xFF}}},
|
||||
{{{81, -73, 73},0, {2079, 1982},{0x49, 0xB7, 0x49, 0xFF}}},
|
||||
{{{73, -73, 81},0, {1977, 2084},{0x49, 0xB7, 0x49, 0xFF}}},
|
||||
{{{73, 81, 73},0, {1977, 1982},{0x49, 0x49, 0x49, 0xFF}}},
|
||||
{{{73, 73, 81},0, {1977, 2084},{0x49, 0x49, 0x49, 0xFF}}},
|
||||
{{{81, 73, 73},0, {2079, 1982},{0x49, 0x49, 0x49, 0xFF}}},
|
||||
{{{73, -81, -73},0, {1977, 31},{0x49, 0xB7, 0xB7, 0xFF}}},
|
||||
{{{73, -73, -81},0, {1977, -71},{0x49, 0xB7, 0xB7, 0xFF}}},
|
||||
{{{81, -73, -73},0, {2079, 31},{0x49, 0xB7, 0xB7, 0xFF}}},
|
||||
{{{73, 81, -73},0, {1977, 31},{0x49, 0x49, 0xB7, 0xFF}}},
|
||||
{{{81, 73, -73},0, {2079, 31},{0x49, 0x49, 0xB7, 0xFF}}},
|
||||
{{{73, 73, -81},0, {1977, -71},{0x49, 0x49, 0xB7, 0xFF}}},
|
||||
{{{-73, 81, 73},0, {27, 1982},{0x0, 0x5A, 0x5A, 0xFF}}},
|
||||
{{{-73, 73, 81},0, {27, 2084},{0x0, 0x5A, 0x5A, 0xFF}}},
|
||||
{{{73, 73, 81},0, {1977, 2084},{0x0, 0x5A, 0x5A, 0xFF}}},
|
||||
{{{73, 81, 73},0, {1977, 1982},{0x0, 0x5A, 0x5A, 0xFF}}},
|
||||
{{{73, 73, 81},0, {1979, 33},{0x0, 0x0, 0x7F, 0xFF}}},
|
||||
{{{-73, 73, 81},0, {27, 33},{0x0, 0x0, 0x7F, 0xFF}}},
|
||||
{{{-73, -73, 81},0, {27, 1984},{0x0, 0x0, 0x7F, 0xFF}}},
|
||||
{{{73, 73, 81},0, {1979, 33},{0x0, 0x0, 0x7F, 0xFF}}},
|
||||
{{{-73, -73, 81},0, {27, 1984},{0x0, 0x0, 0x7F, 0xFF}}},
|
||||
{{{73, -73, 81},0, {1979, 1984},{0x0, 0x0, 0x7F, 0xFF}}},
|
||||
{{{81, 73, -73},0, {1979, 32},{0x7F, 0x0, 0x0, 0xFF}}},
|
||||
{{{81, 73, 73},0, {29, 32},{0x7F, 0x0, 0x0, 0xFF}}},
|
||||
{{{81, -73, 73},0, {29, 1982},{0x7F, 0x0, 0x0, 0xFF}}},
|
||||
{{{81, -73, -73},0, {1979, 1982},{0x7F, 0x0, 0x0, 0xFF}}},
|
||||
{{{-73, 81, -73},0, {27, 31},{0x0, 0x7F, 0x0, 0xFF}}},
|
||||
{{{-73, 81, 73},0, {27, 1982},{0x0, 0x7F, 0x0, 0xFF}}},
|
||||
{{{73, 81, 73},0, {1977, 1982},{0x0, 0x7F, 0x0, 0xFF}}},
|
||||
{{{73, 81, -73},0, {1977, 31},{0x0, 0x7F, 0x0, 0xFF}}},
|
||||
{{{-81, 73, 73},0, {29, 32},{0x81, 0x0, 0x0, 0xFF}}},
|
||||
{{{-81, 73, -73},0, {1979, 32},{0x81, 0x0, 0x0, 0xFF}}},
|
||||
{{{-81, -73, -73},0, {1979, 1982},{0x81, 0x0, 0x0, 0xFF}}},
|
||||
{{{-81, -73, 73},0, {29, 1982},{0x81, 0x0, 0x0, 0xFF}}},
|
||||
{{{73, -73, 81},0, {1979, 1984},{0x5A, 0x0, 0x5A, 0xFF}}},
|
||||
{{{81, -73, 73},0, {2081, 1984},{0x5A, 0x0, 0x5A, 0xFF}}},
|
||||
{{{81, 73, 73},0, {2081, 33},{0x5A, 0x0, 0x5A, 0xFF}}},
|
||||
{{{73, 73, 81},0, {1979, 33},{0x5A, 0x0, 0x5A, 0xFF}}},
|
||||
{{{-73, -81, 73},0, {27, 1982},{0xA6, 0xA6, 0x0, 0xFF}}},
|
||||
{{{-81, -73, 73},0, {-75, 1982},{0xA6, 0xA6, 0x0, 0xFF}}},
|
||||
{{{-81, -73, -73},0, {-75, 31},{0xA6, 0xA6, 0x0, 0xFF}}},
|
||||
{{{-73, -81, -73},0, {27, 31},{0xA6, 0xA6, 0x0, 0xFF}}},
|
||||
{{{81, -73, -73},0, {2081, 1984},{0x5A, 0x0, 0xA6, 0xFF}}},
|
||||
{{{73, -73, -81},0, {1979, 1984},{0x5A, 0x0, 0xA6, 0xFF}}},
|
||||
{{{73, 73, -81},0, {1979, 33},{0x5A, 0x0, 0xA6, 0xFF}}},
|
||||
{{{81, 73, -73},0, {2081, 33},{0x5A, 0x0, 0xA6, 0xFF}}},
|
||||
{{{73, 81, 73},0, {1977, 1982},{0x5A, 0x5A, 0x0, 0xFF}}},
|
||||
{{{81, 73, 73},0, {2079, 1982},{0x5A, 0x5A, 0x0, 0xFF}}},
|
||||
{{{81, 73, -73},0, {2079, 31},{0x5A, 0x5A, 0x0, 0xFF}}},
|
||||
{{{73, 81, -73},0, {1977, 31},{0x5A, 0x5A, 0x0, 0xFF}}},
|
||||
{{{-73, -73, -81},0, {27, 1984},{0xA6, 0x0, 0xA6, 0xFF}}},
|
||||
{{{-81, -73, -73},0, {-75, 1984},{0xA6, 0x0, 0xA6, 0xFF}}},
|
||||
{{{-81, 73, -73},0, {-75, 33},{0xA6, 0x0, 0xA6, 0xFF}}},
|
||||
{{{-73, 73, -81},0, {27, 33},{0xA6, 0x0, 0xA6, 0xFF}}},
|
||||
{{{73, -81, -73},0, {1977, 31},{0x5A, 0xA6, 0x0, 0xFF}}},
|
||||
{{{81, -73, -73},0, {2079, 31},{0x5A, 0xA6, 0x0, 0xFF}}},
|
||||
{{{81, -73, 73},0, {2079, 1982},{0x5A, 0xA6, 0x0, 0xFF}}},
|
||||
{{{73, -81, 73},0, {1977, 1982},{0x5A, 0xA6, 0x0, 0xFF}}},
|
||||
{{{-73, 73, 81},0, {27, 33},{0xA6, 0x0, 0x5A, 0xFF}}},
|
||||
{{{-81, 73, 73},0, {-75, 33},{0xA6, 0x0, 0x5A, 0xFF}}},
|
||||
{{{-81, -73, 73},0, {-75, 1984},{0xA6, 0x0, 0x5A, 0xFF}}},
|
||||
{{{-73, -73, 81},0, {27, 1984},{0xA6, 0x0, 0x5A, 0xFF}}},
|
||||
{{{73, 81, -73},0, {1977, 31},{0x0, 0x5A, 0xA6, 0xFF}}},
|
||||
{{{73, 73, -81},0, {1977, -71},{0x0, 0x5A, 0xA6, 0xFF}}},
|
||||
{{{-73, 73, -81},0, {27, -71},{0x0, 0x5A, 0xA6, 0xFF}}},
|
||||
{{{-73, 81, -73},0, {27, 31},{0x0, 0x5A, 0xA6, 0xFF}}},
|
||||
{{{-73, -81, -73},0, {27, 31},{0x0, 0xA6, 0xA6, 0xFF}}},
|
||||
{{{-73, -73, -81},0, {27, -71},{0x0, 0xA6, 0xA6, 0xFF}}},
|
||||
{{{73, -73, -81},0, {1977, -71},{0x0, 0xA6, 0xA6, 0xFF}}},
|
||||
{{{73, -81, -73},0, {1977, 31},{0x0, 0xA6, 0xA6, 0xFF}}},
|
||||
{{{-73, 81, -73},0, {27, 31},{0xA6, 0x5A, 0x0, 0xFF}}},
|
||||
{{{-81, 73, -73},0, {-75, 31},{0xA6, 0x5A, 0x0, 0xFF}}},
|
||||
{{{-81, 73, 73},0, {-75, 1982},{0xA6, 0x5A, 0x0, 0xFF}}},
|
||||
{{{-73, 81, 73},0, {27, 1982},{0xA6, 0x5A, 0x0, 0xFF}}},
|
||||
{{{73, -81, 73},0, {1977, 1982},{0x0, 0xA6, 0x5A, 0xFF}}},
|
||||
{{{73, -73, 81},0, {1977, 2084},{0x0, 0xA6, 0x5A, 0xFF}}},
|
||||
{{{-73, -73, 81},0, {27, 2084},{0x0, 0xA6, 0x5A, 0xFF}}},
|
||||
{{{-73, -81, 73},0, {27, 1982},{0x0, 0xA6, 0x5A, 0xFF}}},
|
||||
{{{-73, 73, -81},0, {27, 33},{0x0, 0x0, 0x81, 0xFF}}},
|
||||
{{{73, 73, -81},0, {1979, 33},{0x0, 0x0, 0x81, 0xFF}}},
|
||||
{{{73, -73, -81},0, {1979, 1984},{0x0, 0x0, 0x81, 0xFF}}},
|
||||
{{{-73, -73, -81},0, {27, 1984},{0x0, 0x0, 0x81, 0xFF}}},
|
||||
{{{73, -81, -73},0, {1977, 31},{0x0, 0x81, 0x0, 0xFF}}},
|
||||
{{{73, -81, 73},0, {1977, 1982},{0x0, 0x81, 0x0, 0xFF}}},
|
||||
{{{-73, -81, 73},0, {27, 1982},{0x0, 0x81, 0x0, 0xFF}}},
|
||||
{{{-73, -81, -73},0, {27, 31},{0x0, 0x81, 0x0, 0xFF}}},
|
||||
};
|
||||
|
||||
Gfx cube_CubeSimpleBevel_mesh_tri_0[] = {
|
||||
gsSPVertex(cube_CubeSimpleBevel_mesh_vtx_0 + 0, 15, 0),
|
||||
gsSP1Triangle(0, 1, 2, 0),
|
||||
gsSP1Triangle(3, 4, 5, 0),
|
||||
gsSP1Triangle(6, 7, 8, 0),
|
||||
gsSP1Triangle(9, 10, 11, 0),
|
||||
gsSP1Triangle(12, 13, 14, 0),
|
||||
gsSPVertex(cube_CubeSimpleBevel_mesh_vtx_0 + 15, 16, 0),
|
||||
gsSP1Triangle(0, 1, 2, 0),
|
||||
gsSP1Triangle(3, 4, 5, 0),
|
||||
gsSP1Triangle(6, 7, 8, 0),
|
||||
gsSP1Triangle(9, 10, 11, 0),
|
||||
gsSP1Triangle(9, 11, 12, 0),
|
||||
gsSP1Triangle(13, 14, 15, 0),
|
||||
gsSPVertex(cube_CubeSimpleBevel_mesh_vtx_0 + 31, 15, 0),
|
||||
gsSP1Triangle(0, 1, 2, 0),
|
||||
gsSP1Triangle(3, 4, 5, 0),
|
||||
gsSP1Triangle(3, 5, 6, 0),
|
||||
gsSP1Triangle(7, 8, 9, 0),
|
||||
gsSP1Triangle(7, 9, 10, 0),
|
||||
gsSP1Triangle(11, 12, 13, 0),
|
||||
gsSP1Triangle(11, 13, 14, 0),
|
||||
gsSPVertex(cube_CubeSimpleBevel_mesh_vtx_0 + 46, 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(cube_CubeSimpleBevel_mesh_vtx_0 + 62, 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(cube_CubeSimpleBevel_mesh_vtx_0 + 78, 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(cube_CubeSimpleBevel_mesh_vtx_0 + 94, 4, 0),
|
||||
gsSP1Triangle(0, 1, 2, 0),
|
||||
gsSP1Triangle(0, 2, 3, 0),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx mat_cube_cube[] = {
|
||||
gsDPPipeSync(),
|
||||
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT),
|
||||
gsSPTexture(65535, 65535, 0, 0, 1),
|
||||
gsDPTileSync(),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 1, cube_CubeTexture_rgba16),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 0, 0, 7, 0, G_TX_WRAP | G_TX_MIRROR, 5, 0, G_TX_WRAP | G_TX_MIRROR, 5, 0),
|
||||
gsDPLoadSync(),
|
||||
gsDPLoadBlock(7, 0, 0, 1023, 256),
|
||||
gsDPPipeSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, 0, 0, G_TX_WRAP | G_TX_MIRROR, 5, 0, G_TX_WRAP | G_TX_MIRROR, 5, 0),
|
||||
gsDPSetTileSize(0, 0, 0, 124, 124),
|
||||
gsSPSetLights1(cube_cube_lights),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx cube_CubeSimpleBevel_mesh[] = {
|
||||
gsSPDisplayList(mat_cube_cube),
|
||||
gsSPDisplayList(cube_CubeSimpleBevel_mesh_tri_0),
|
||||
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),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
@ -1,9 +0,0 @@
|
||||
#ifndef _ground_H
|
||||
#define _ground_H
|
||||
|
||||
#include <ultra64.h>
|
||||
|
||||
extern Vtx ground_Plane_normal[];
|
||||
extern Gfx ground_model_gfx[];
|
||||
|
||||
#endif
|
@ -1,15 +0,0 @@
|
||||
Vtx ground_Plane_normal[] = {
|
||||
{{{499, 0, 499}, 0, {0, 4096}, {0, 127, 0, 255}}},
|
||||
{{{499, 0, -499}, 0, {4096, 4096}, {0, 127, 0, 255}}},
|
||||
{{{-499, 0, -499}, 0, {4096, 0}, {0, 127, 0, 255}}},
|
||||
{{{-499, 0, 499}, 0, {0, 0}, {0, 127, 0, 255}}},
|
||||
};
|
||||
|
||||
|
||||
Gfx ground_model_gfx[] = {
|
||||
// Material DefaultMaterial
|
||||
// End Material DefaultMaterial
|
||||
gsSPVertex(&ground_Plane_normal[0], 4, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
@ -2,10 +2,11 @@
|
||||
|
||||
#include "sk64/skelatool_animator.h"
|
||||
|
||||
#include "shadow_caster_geo.inc.h"
|
||||
#include "ground_geo.inc.h"
|
||||
#include "subject_geo.inc.h"
|
||||
#include "sphere_geo.inc.h"
|
||||
#include "portal_mask.inc.h"
|
||||
#include "portal_outline.inc.h"
|
||||
#include "cube.inc.h"
|
||||
|
||||
#include "../../build/assets/models/cube/cube.h"
|
||||
#include "../../build/assets/models/portal_gun/v_portalgun.h"
|
||||
|
||||
Gfx* cube_gfx = &cube_cube_model_gfx[0];
|
||||
Gfx* v_portal_gun_gfx = &portal_gun_v_portalgun_model_gfx[0];
|
@ -1,9 +1,10 @@
|
||||
|
||||
#include "shadow_caster.h"
|
||||
#include "ground.h"
|
||||
#include "subject.h"
|
||||
#include "sphere.h"
|
||||
#ifndef __MODELS_H__
|
||||
#define __MODELS_H__
|
||||
|
||||
extern Gfx portal_mask_Circle_mesh[];
|
||||
extern Gfx portal_outline_portal_outline_mesh[];
|
||||
extern Gfx cube_CubeSimpleBevel_mesh[];
|
||||
|
||||
extern Gfx* cube_gfx;
|
||||
extern Gfx* v_portal_gun_gfx;
|
||||
|
||||
#endif
|
@ -1,9 +0,0 @@
|
||||
#ifndef _shadow_caster_H
|
||||
#define _shadow_caster_H
|
||||
|
||||
#include <ultra64.h>
|
||||
|
||||
extern Vtx shadow_caster_ShadowCaster_normal[];
|
||||
extern Gfx shadow_caster_model_gfx[];
|
||||
|
||||
#endif
|
@ -1,40 +0,0 @@
|
||||
Vtx shadow_caster_ShadowCaster_normal[] = {
|
||||
{{{-100, -10, -100}, 0, {768, 2048}, {-128, 0, 0, 255}}},
|
||||
{{{-100, -10, 100}, 0, {1280, 2048}, {-128, 0, 0, 255}}},
|
||||
{{{-100, 10, 100}, 0, {1280, 1536}, {-128, 0, 0, 255}}},
|
||||
{{{-100, 10, -100}, 0, {768, 1536}, {-128, 0, 0, 255}}},
|
||||
{{{-100, 10, -100}, 0, {768, 1536}, {0, 127, 0, 255}}},
|
||||
{{{-100, 10, 100}, 0, {1280, 1536}, {0, 127, 0, 255}}},
|
||||
{{{100, 10, 100}, 0, {1280, 1024}, {0, 127, 0, 255}}},
|
||||
{{{100, 10, -100}, 0, {768, 1024}, {0, 127, 0, 255}}},
|
||||
{{{100, 10, -100}, 0, {768, 1024}, {127, 0, 0, 255}}},
|
||||
{{{100, 10, 100}, 0, {1280, 1024}, {127, 0, 0, 255}}},
|
||||
{{{100, -10, 100}, 0, {1280, 512}, {127, 0, 0, 255}}},
|
||||
{{{100, -10, -100}, 0, {768, 512}, {127, 0, 0, 255}}},
|
||||
{{{100, -10, -100}, 0, {768, 512}, {0, -128, 0, 255}}},
|
||||
{{{100, -10, 100}, 0, {1280, 512}, {0, -128, 0, 255}}},
|
||||
{{{-100, -10, 100}, 0, {1280, 0}, {0, -128, 0, 255}}},
|
||||
{{{-100, -10, -100}, 0, {768, 0}, {0, -128, 0, 255}}},
|
||||
{{{-100, 10, -100}, 0, {256, 1024}, {0, 0, -128, 255}}},
|
||||
{{{100, 10, -100}, 0, {768, 1024}, {0, 0, -128, 255}}},
|
||||
{{{100, -10, -100}, 0, {768, 512}, {0, 0, -128, 255}}},
|
||||
{{{-100, -10, -100}, 0, {256, 512}, {0, 0, -128, 255}}},
|
||||
{{{100, 10, 100}, 0, {1280, 1024}, {0, 0, 127, 255}}},
|
||||
{{{-100, 10, 100}, 0, {1792, 1024}, {0, 0, 127, 255}}},
|
||||
{{{-100, -10, 100}, 0, {1792, 512}, {0, 0, 127, 255}}},
|
||||
{{{100, -10, 100}, 0, {1280, 512}, {0, 0, 127, 255}}},
|
||||
};
|
||||
|
||||
|
||||
Gfx shadow_caster_model_gfx[] = {
|
||||
// Material DefaultMaterial
|
||||
// End Material DefaultMaterial
|
||||
gsSPVertex(&shadow_caster_ShadowCaster_normal[0], 24, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0),
|
||||
gsSP2Triangles(8, 9, 10, 0, 8, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 12, 14, 15, 0),
|
||||
gsSP2Triangles(16, 17, 18, 0, 16, 18, 19, 0),
|
||||
gsSP2Triangles(20, 21, 22, 0, 20, 22, 23, 0),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
@ -1,8 +0,0 @@
|
||||
#ifndef _sphere_H
|
||||
#define _sphere_H
|
||||
|
||||
#include <ultra64.h>
|
||||
|
||||
extern Gfx sphere_model_gfx[];
|
||||
|
||||
#endif
|
@ -1,81 +0,0 @@
|
||||
Vtx sphere_Icosphere_normal[] = {
|
||||
{{{0, 0, -100}, 0, {372, 2048}, {24, -73, -101, 255}}},
|
||||
{{{72, -52, -44}, 0, {558, 1725}, {24, -73, -101, 255}}},
|
||||
{{{-27, -85, -44}, 0, {186, 1725}, {24, -73, -101, 255}}},
|
||||
{{{72, -52, -44}, 0, {558, 1725}, {77, 0, -101, 255}}},
|
||||
{{{0, 0, -100}, 0, {744, 2048}, {77, 0, -101, 255}}},
|
||||
{{{72, 52, -44}, 0, {930, 1725}, {77, 0, -101, 255}}},
|
||||
{{{0, 0, -100}, 0, {1861, 2048}, {-62, -45, -101, 255}}},
|
||||
{{{-27, -85, -44}, 0, {2048, 1725}, {-62, -45, -101, 255}}},
|
||||
{{{-89, 0, -44}, 0, {1675, 1725}, {-62, -45, -101, 255}}},
|
||||
{{{0, 0, -100}, 0, {1489, 2048}, {-62, 45, -101, 255}}},
|
||||
{{{-89, 0, -44}, 0, {1675, 1725}, {-62, 45, -101, 255}}},
|
||||
{{{-27, 85, -44}, 0, {1303, 1725}, {-62, 45, -101, 255}}},
|
||||
{{{0, 0, -100}, 0, {1117, 2048}, {24, 73, -101, 255}}},
|
||||
{{{-27, 85, -44}, 0, {1303, 1725}, {24, 73, -101, 255}}},
|
||||
{{{72, 52, -44}, 0, {930, 1725}, {24, 73, -101, 255}}},
|
||||
{{{72, -52, -44}, 0, {558, 1725}, {125, 0, -24, 255}}},
|
||||
{{{72, 52, -44}, 0, {930, 1725}, {125, 0, -24, 255}}},
|
||||
{{{89, 0, 44}, 0, {744, 1403}, {125, 0, -24, 255}}},
|
||||
{{{-27, -85, -44}, 0, {186, 1725}, {38, -119, -24, 255}}},
|
||||
{{{72, -52, -44}, 0, {558, 1725}, {38, -119, -24, 255}}},
|
||||
{{{27, -85, 44}, 0, {372, 1403}, {38, -119, -24, 255}}},
|
||||
{{{-89, 0, -44}, 0, {1675, 1725}, {-101, -73, -24, 255}}},
|
||||
{{{-27, -85, -44}, 0, {2048, 1725}, {-101, -73, -24, 255}}},
|
||||
{{{-72, -52, 44}, 0, {1861, 1403}, {-101, -73, -24, 255}}},
|
||||
{{{-27, 85, -44}, 0, {1303, 1725}, {-101, 73, -24, 255}}},
|
||||
{{{-89, 0, -44}, 0, {1675, 1725}, {-101, 73, -24, 255}}},
|
||||
{{{-72, 52, 44}, 0, {1489, 1403}, {-101, 73, -24, 255}}},
|
||||
{{{72, 52, -44}, 0, {930, 1725}, {38, 119, -24, 255}}},
|
||||
{{{-27, 85, -44}, 0, {1303, 1725}, {38, 119, -24, 255}}},
|
||||
{{{27, 85, 44}, 0, {1117, 1403}, {38, 119, -24, 255}}},
|
||||
{{{72, -52, -44}, 0, {558, 1725}, {101, -73, 24, 255}}},
|
||||
{{{89, 0, 44}, 0, {744, 1403}, {101, -73, 24, 255}}},
|
||||
{{{27, -85, 44}, 0, {372, 1403}, {101, -73, 24, 255}}},
|
||||
{{{-27, -85, -44}, 0, {186, 1725}, {-38, -119, 24, 255}}},
|
||||
{{{27, -85, 44}, 0, {372, 1403}, {-38, -119, 24, 255}}},
|
||||
{{{-72, -52, 44}, 0, {0, 1403}, {-38, -119, 24, 255}}},
|
||||
{{{-89, 0, -44}, 0, {1675, 1725}, {-125, 0, 24, 255}}},
|
||||
{{{-72, -52, 44}, 0, {1861, 1403}, {-125, 0, 24, 255}}},
|
||||
{{{-72, 52, 44}, 0, {1489, 1403}, {-125, 0, 24, 255}}},
|
||||
{{{-27, 85, -44}, 0, {1303, 1725}, {-38, 119, 24, 255}}},
|
||||
{{{-72, 52, 44}, 0, {1489, 1403}, {-38, 119, 24, 255}}},
|
||||
{{{27, 85, 44}, 0, {1117, 1403}, {-38, 119, 24, 255}}},
|
||||
{{{72, 52, -44}, 0, {930, 1725}, {101, 73, 24, 255}}},
|
||||
{{{27, 85, 44}, 0, {1117, 1403}, {101, 73, 24, 255}}},
|
||||
{{{89, 0, 44}, 0, {744, 1403}, {101, 73, 24, 255}}},
|
||||
{{{27, -85, 44}, 0, {372, 1403}, {62, -45, 101, 255}}},
|
||||
{{{89, 0, 44}, 0, {744, 1403}, {62, -45, 101, 255}}},
|
||||
{{{0, 0, 100}, 0, {558, 1080}, {62, -45, 101, 255}}},
|
||||
{{{-72, -52, 44}, 0, {0, 1403}, {-24, -73, 101, 255}}},
|
||||
{{{27, -85, 44}, 0, {372, 1403}, {-24, -73, 101, 255}}},
|
||||
{{{0, 0, 100}, 0, {186, 1080}, {-24, -73, 101, 255}}},
|
||||
{{{-72, 52, 44}, 0, {1489, 1403}, {-77, 0, 101, 255}}},
|
||||
{{{-72, -52, 44}, 0, {1861, 1403}, {-77, 0, 101, 255}}},
|
||||
{{{0, 0, 100}, 0, {1675, 1080}, {-77, 0, 101, 255}}},
|
||||
{{{27, 85, 44}, 0, {1117, 1403}, {-24, 73, 101, 255}}},
|
||||
{{{-72, 52, 44}, 0, {1489, 1403}, {-24, 73, 101, 255}}},
|
||||
{{{0, 0, 100}, 0, {1303, 1080}, {-24, 73, 101, 255}}},
|
||||
{{{89, 0, 44}, 0, {744, 1403}, {62, 45, 101, 255}}},
|
||||
{{{27, 85, 44}, 0, {1117, 1403}, {62, 45, 101, 255}}},
|
||||
{{{0, 0, 100}, 0, {930, 1080}, {62, 45, 101, 255}}},
|
||||
};
|
||||
|
||||
|
||||
Gfx sphere_model_gfx[] = {
|
||||
// Material DefaultMaterial
|
||||
// End Material DefaultMaterial
|
||||
gsSPVertex(&sphere_Icosphere_normal[0], 30, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
|
||||
gsSP2Triangles(6, 7, 8, 0, 9, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 15, 16, 17, 0),
|
||||
gsSP2Triangles(18, 19, 20, 0, 21, 22, 23, 0),
|
||||
gsSP2Triangles(24, 25, 26, 0, 27, 28, 29, 0),
|
||||
gsSPVertex(&sphere_Icosphere_normal[30], 30, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
|
||||
gsSP2Triangles(6, 7, 8, 0, 9, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 15, 16, 17, 0),
|
||||
gsSP2Triangles(18, 19, 20, 0, 21, 22, 23, 0),
|
||||
gsSP2Triangles(24, 25, 26, 0, 27, 28, 29, 0),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
@ -1,8 +0,0 @@
|
||||
#ifndef _subject_H
|
||||
#define _subject_H
|
||||
|
||||
#include <ultra64.h>
|
||||
|
||||
extern Gfx subject_model_gfx[];
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -64,7 +64,7 @@ void cubeRender(void* data, struct RenderState* renderState) {
|
||||
transformToMatrixL(&cube->rigidBody.transform, matrix, SCENE_SCALE);
|
||||
|
||||
gSPMatrix(renderState->dl++, matrix, G_MTX_MODELVIEW | G_MTX_PUSH | G_MTX_MUL);
|
||||
gSPDisplayList(renderState->dl++, cube_CubeSimpleBevel_mesh);
|
||||
gSPDisplayList(renderState->dl++, cube_gfx);
|
||||
gSPPopMatrix(renderState->dl++, G_MTX_MODELVIEW);
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,11 @@
|
||||
#include "dynamic_scene.h"
|
||||
|
||||
struct Vector3 gStartPosition = {5.0f, 1.2f, -5.0f};
|
||||
struct Vector3 gPortalGunOffset = {0.100957, -0.113587, -0.28916};
|
||||
struct Vector3 gPortalGunForward = {0.1f, -0.1f, 1.0f};
|
||||
struct Vector3 gPortalGunUp = {0.0f, 1.0f, 0.0f};
|
||||
|
||||
Lights1 gSceneLights = gdSPDefLights1(128, 128, 128, 128, 128, 128, 0, 127, 0);
|
||||
|
||||
void sceneInit(struct Scene* scene) {
|
||||
cameraInit(&scene->camera, 45.0f, 0.125f * SCENE_SCALE, 80.0f * SCENE_SCALE);
|
||||
@ -85,7 +90,24 @@ void sceneRenderPerformanceMetrics(struct Scene* scene, struct RenderState* rend
|
||||
gDPPipeSync(renderState->dl++);
|
||||
}
|
||||
|
||||
void sceneRenderPortalGun(struct Scene* scene, struct RenderState* renderState) {
|
||||
struct Transform gunTransform;
|
||||
transformPoint(&scene->player.body.transform, &gPortalGunOffset, &gunTransform.position);
|
||||
struct Quaternion relativeRotation;
|
||||
quatLook(&gPortalGunForward, &gPortalGunUp, &relativeRotation);
|
||||
quatMultiply(&scene->player.body.transform.rotation, &relativeRotation, &gunTransform.rotation);
|
||||
gunTransform.scale = gOneVec;
|
||||
Mtx* matrix = renderStateRequestMatrices(renderState, 1);
|
||||
transformToMatrixL(&gunTransform, matrix, SCENE_SCALE);
|
||||
|
||||
gSPMatrix(renderState->dl++, matrix, G_MTX_MODELVIEW | G_MTX_PUSH | G_MTX_MUL);
|
||||
gSPDisplayList(renderState->dl++, v_portal_gun_gfx);
|
||||
gSPPopMatrix(renderState->dl++, G_MTX_MODELVIEW);
|
||||
}
|
||||
|
||||
void sceneRender(struct Scene* scene, struct RenderState* renderState, struct GraphicsTask* task) {
|
||||
gSPSetLights1(renderState->dl++, gSceneLights);
|
||||
|
||||
struct RenderProps renderProperties;
|
||||
|
||||
renderPropsInit(&renderProperties, &scene->camera, (float)SCREEN_WD / (float)SCREEN_HT, renderState);
|
||||
@ -99,11 +121,13 @@ void sceneRender(struct Scene* scene, struct RenderState* renderState, struct Gr
|
||||
|
||||
sceneRenderWithProperties(scene, &renderProperties, renderState);
|
||||
|
||||
gDPPipeSync(renderState->dl++);
|
||||
sceneRenderPortalGun(scene, renderState);
|
||||
|
||||
gDPPipeSync(renderState->dl++);
|
||||
gDPSetRenderMode(renderState->dl++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
|
||||
gSPGeometryMode(renderState->dl++, G_ZBUFFER | G_LIGHTING | G_CULL_BOTH, G_SHADE);
|
||||
|
||||
|
||||
hudRender(renderState);
|
||||
|
||||
// sceneRenderPerformanceMetrics(scene, renderState, task);
|
||||
|
Loading…
Reference in New Issue
Block a user