Skip to content

Commit 19b618c

Browse files
committed
demo_vox: fixed compiler warning about unused var
and removed trailing whitespaces
1 parent cc183d6 commit 19b618c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

demo/demo_vox.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
A demonstration program to show you how to use the MagicaVoxel scene reader,
55
writer, and merger from the open game tools project: https://github.com/jpaver/opengametools.
66
7-
Please see the MIT license information at the end of this file, and please consider
7+
Please see the MIT license information at the end of this file, and please consider
88
sharing any improvements you make.
99
*/
1010

@@ -55,9 +55,9 @@ const ogt_vox_scene* load_vox_scene_with_groups(const char* filename)
5555
}
5656

5757
// a helper function to save a magica voxel scene to disk.
58-
void save_vox_scene(const char* pcFilename, const ogt_vox_scene* scene)
58+
void save_vox_scene(const char* pcFilename, const ogt_vox_scene* scene)
5959
{
60-
// save the scene back out.
60+
// save the scene back out.
6161
uint32_t buffersize = 0;
6262
uint8_t* buffer = ogt_vox_write_scene(scene, &buffersize);
6363
if (!buffer)
@@ -81,7 +81,7 @@ void save_vox_scene(const char* pcFilename, const ogt_vox_scene* scene)
8181
ogt_vox_free(buffer);
8282
}
8383

84-
// this example just counts the number of solid voxels in this model, but an importer
84+
// this example just counts the number of solid voxels in this model, but an importer
8585
// would probably do something like convert the model into a triangle mesh.
8686
uint32_t count_solid_voxels_in_model(const ogt_vox_model* model)
8787
{
@@ -120,24 +120,24 @@ bool demo_load_and_save(const char *filename)
120120
{
121121
const ogt_vox_group* group = &scene->groups[group_index];
122122
const ogt_vox_layer* group_layer = group->layer_index != UINT32_MAX ? &scene->layers[group->layer_index] : NULL;
123-
printf("group[%u] has parent group %u, is part of layer[%u,name=%s] and is %s\n",
124-
group_index,
123+
printf("group[%u] has parent group %u, is part of layer[%u,name=%s] and is %s\n",
124+
group_index,
125125
group->parent_group_index,
126126
group->layer_index,
127127
group_layer && group_layer->name ? group_layer->name : "",
128128
group->hidden ? "hidden" : "shown");
129129
}
130-
130+
131131
// iterate over all instances - and print basic information about the instance and the model that it references
132132
printf("# instances: %u\n", scene->num_instances);
133133
for (uint32_t instance_index = 0; instance_index < scene->num_instances; instance_index++)
134134
{
135135
const ogt_vox_instance* instance = &scene->instances[instance_index];
136-
const ogt_vox_model* model = scene->models[instance->model_index];
137-
136+
// const ogt_vox_model* model = scene->models[instance->model_index];
137+
138138
const char* layer_name =
139139
instance->layer_index == UINT32_MAX ? "(no layer)":
140-
scene->layers[instance->layer_index].name ? scene->layers[instance->layer_index].name :
140+
scene->layers[instance->layer_index].name ? scene->layers[instance->layer_index].name :
141141
"";
142142

143143
printf("instance[%u,name=%s] at position (%.0f,%.0f,%.0f) uses model %u and is in layer[%u, name='%s'], group %u, and is %s\n",
@@ -167,7 +167,7 @@ bool demo_load_and_save(const char *filename)
167167
model->voxel_hash);
168168
}
169169

170-
save_vox_scene("saved.vox", scene);
170+
save_vox_scene("saved.vox", scene);
171171

172172
ogt_vox_destroy_scene(scene);
173173
return true;

0 commit comments

Comments
 (0)