summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-10-31 20:47:42 -0700
committer3gg <3gg@shellblade.net>2025-10-31 20:47:42 -0700
commit840755ea4559a71f78360701dd046f7944d76aaf (patch)
treeff591030740e9ea5ba2f9b82a7e9b7aef22c6c8b /src/plugins
parent7fd82e83988a283694dfa76b9aec27fb96a83da9 (diff)
Tidy
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/viewer.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/plugins/viewer.c b/src/plugins/viewer.c
index fec8424..ba699cc 100644
--- a/src/plugins/viewer.c
+++ b/src/plugins/viewer.c
@@ -107,14 +107,17 @@ static SceneNode* load_skyquad(Gfx* gfx, SceneNode* root) {
107 return gfx_setup_skyquad(gfxcore, root, environment_map); 107 return gfx_setup_skyquad(gfxcore, root, environment_map);
108} 108}
109 109
110/// Load the model. 110static Model* make_scene(Game* game, State* state, const char* scene_filepath) {
111static Model* load_model(Game* game, State* state, const char* scene_filepath) {
112 assert(game); 111 assert(game);
113 assert(game->gfx); 112 assert(game->gfx);
114 assert(state); 113 assert(state);
115 assert(state->scene);
116 114
117 SceneNode* root = gfx_get_scene_root_mut(state->scene); 115 if (!((state->scene = gfx_make_scene()))) {
116 return nullptr;
117 }
118
119 SceneNode* root = gfx_get_scene_root_mut(state->scene);
120
118 SceneNode* sky_light_node = load_skyquad(game->gfx, root); 121 SceneNode* sky_light_node = load_skyquad(game->gfx, root);
119 if (!sky_light_node) { 122 if (!sky_light_node) {
120 return nullptr; 123 return nullptr;
@@ -149,11 +152,7 @@ bool init(Game* game, State** pp_state) {
149 goto cleanup; 152 goto cleanup;
150 } 153 }
151 154
152 if (!((state->scene = gfx_make_scene()))) { 155 state->model = make_scene(game, state, scene_filepath);
153 goto cleanup;
154 }
155
156 state->model = load_model(game, state, scene_filepath);
157 if (!state->model) { 156 if (!state->model) {
158 goto cleanup; 157 goto cleanup;
159 } 158 }