examples: Remove unneeded casts

They were needed in older versions of Nitro Engine, but now the functions
that take data arrays expect a void pointer, so casts are not needed.
This commit is contained in:
Antonio Niño Díaz 2024-01-27 19:33:56 +00:00
parent 9ce79478e0
commit 33f9bd4416
19 changed files with 32 additions and 34 deletions

View File

@ -54,9 +54,9 @@ int main(void)
0, 1, 0);
// Load models
NE_ModelLoadStaticMesh(Model, (u32 *)sphere_bin);
NE_ModelLoadStaticMesh(Model2, (u32 *)sphere_bin);
NE_ModelLoadStaticMesh(Model3, (u32 *)sphere_bin);
NE_ModelLoadStaticMesh(Model, sphere_bin);
NE_ModelLoadStaticMesh(Model2, sphere_bin);
NE_ModelLoadStaticMesh(Model3, sphere_bin);
// Load texture
NE_MaterialTexLoad(Material, NE_RGB5, 256, 256, NE_TEXGEN_TEXCOORD,

View File

@ -51,7 +51,7 @@ int main(void)
0, 1, 0);
// Load model
NE_ModelLoadStaticMesh(Model, (u32 *)teapot_bin);
NE_ModelLoadStaticMesh(Model, teapot_bin);
// Set light color and direction
NE_LightSet(0, NE_White, -0.5, -0.5, -0.5);

View File

@ -53,8 +53,8 @@ int main(void)
0, 1, 0);
// Load models
NE_ModelLoadStaticMesh(Teapot, (u32 *)teapot_bin);
NE_ModelLoadStaticMesh(Sphere, (u32 *)sphere_bin);
NE_ModelLoadStaticMesh(Teapot, teapot_bin);
NE_ModelLoadStaticMesh(Sphere, sphere_bin);
// Set light color and direction
NE_LightSet(0, NE_White, -0.5, -0.5, -0.5);

View File

@ -54,7 +54,7 @@ int main(void)
0, 1, 0);
// Load mesh from RAM and assign it to a model
NE_ModelLoadStaticMesh(Model, (u32 *)teapot_bin);
NE_ModelLoadStaticMesh(Model, teapot_bin);
// Load teapot from RAM and assign it to a material
NE_MaterialTexLoad(Material, NE_RGB5, 256, 256,
NE_TEXGEN_TEXCOORD | NE_TEXTURE_WRAP_S | NE_TEXTURE_WRAP_T,

View File

@ -61,7 +61,7 @@ int main(void)
0, 1, 0);
// Load model once
NE_ModelLoadStaticMesh(Model[0], (u32 *)sphere_bin);
NE_ModelLoadStaticMesh(Model[0], sphere_bin);
// Clone model to the test of the objects
for (int i = 1; i < NUM_MODELS; i++)

View File

@ -53,16 +53,14 @@ int main(void)
Palette2 = NE_PaletteCreate();
NE_MaterialTex4x4Load(Material1, 128, 128, NE_TEXGEN_TEXCOORD,
(u8 *)grill_tex_bin,
(u8 *)grill_idx_bin);
NE_PaletteLoadSize(Palette1, (u16 *)grill_pal_bin, grill_pal_bin_size,
grill_tex_bin, grill_idx_bin);
NE_PaletteLoadSize(Palette1, grill_pal_bin, grill_pal_bin_size,
NE_TEX4X4);
NE_MaterialSetPalette(Material1, Palette1);
NE_MaterialTex4x4Load(Material2, 128, 128, NE_TEXGEN_TEXCOORD,
(u8 *)landscape_tex_bin,
(u8 *)landscape_idx_bin);
NE_PaletteLoadSize(Palette2, (u16 *)landscape_pal_bin,
landscape_tex_bin, landscape_idx_bin);
NE_PaletteLoadSize(Palette2, landscape_pal_bin,
landscape_pal_bin_size, NE_TEX4X4);
NE_MaterialSetPalette(Material2, Palette2);

View File

@ -45,7 +45,7 @@ int main(void)
0, 1, 0); // Up direction
// Load mesh from RAM and assign it to the object "Model".
NE_ModelLoadStaticMesh(Model, (u32 *)sphere_vertex_colors_bin);
NE_ModelLoadStaticMesh(Model, sphere_vertex_colors_bin);
// Load a RGB texture from RAM and assign it to "Material".
NE_MaterialTexLoad(Material, NE_RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
textureBitmap);

View File

@ -52,7 +52,7 @@ int main(void)
// Load model
for (int i = 0; i < NUM_MODELS; i++)
NE_ModelLoadStaticMesh(Model[i], (u32 *)sphere_bin);
NE_ModelLoadStaticMesh(Model[i], sphere_bin);
// Setup light
NE_LightSet(0, NE_Yellow, 0, -0.5, -0.5);

View File

@ -14,7 +14,7 @@
// The name you will have to use is "binfilename_bin". For example, for loading
// "model.bin" you will have to use:
//
// NE_ModelLoadStaticMesh(Model, (u32 *)binfilename_bin);
// NE_ModelLoadStaticMesh(Model, binfilename_bin);
//
#include "robot_bin.h"
#include "texture.h"
@ -55,7 +55,7 @@ int main(void)
0, 1, 0); // Up direction
// Load mesh from RAM and assign it to the object "Model".
NE_ModelLoadStaticMesh(Model, (u32 *)robot_bin);
NE_ModelLoadStaticMesh(Model, robot_bin);
// Load a RGB texture from RAM and assign it to "Material".
NE_MaterialTexLoad(Material, NE_RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
textureBitmap);

View File

@ -64,7 +64,7 @@ int main(void)
0, 1, 0);
Model = NE_ModelCreate(NE_Static);
NE_ModelLoadStaticMesh(Model, (u32 *)cube_bin);
NE_ModelLoadStaticMesh(Model, cube_bin);
NE_LightSet(0, NE_Yellow, -1, -1, 0);
NE_LightSet(1, NE_Red, -1, 1, 0);

View File

@ -56,8 +56,8 @@ int main(void)
0, 1, 0);
// Load models
NE_ModelLoadStaticMesh(Teapot, (u32 *)teapot_bin);
NE_ModelLoadStaticMesh(Sphere, (u32 *)sphere_bin);
NE_ModelLoadStaticMesh(Teapot, teapot_bin);
NE_ModelLoadStaticMesh(Sphere, sphere_bin);
// Set light color and direction
NE_LightSet(0, NE_White, -0.5, -0.5, -0.5);

View File

@ -61,8 +61,8 @@ void init_all(void)
0, 1, 0);
// Load models
NE_ModelLoadStaticMesh(Teapot, (u32 *)teapot_bin);
NE_ModelLoadStaticMesh(Sphere, (u32 *)sphere_bin);
NE_ModelLoadStaticMesh(Teapot, teapot_bin);
NE_ModelLoadStaticMesh(Sphere, sphere_bin);
// Set light color and direction
NE_LightSet(0, NE_White, -0.5, -0.5, -0.5);

View File

@ -47,8 +47,8 @@ void init_all(void)
0, 1, 0);
// Load models
NE_ModelLoadStaticMesh(Teapot, (u32 *)teapot_bin);
NE_ModelLoadStaticMesh(Sphere, (u32 *)sphere_bin);
NE_ModelLoadStaticMesh(Teapot, teapot_bin);
NE_ModelLoadStaticMesh(Sphere, sphere_bin);
// Set light color and direction
NE_LightSet(0, NE_White, -0.5, -0.5, -0.5);

View File

@ -49,7 +49,7 @@ int main(void)
0, 1, 0); // Up direction
// Load mesh from RAM and assign it to the object "Model".
NE_ModelLoadStaticMesh(Model, (u32 *)teapot_bin);
NE_ModelLoadStaticMesh(Model, teapot_bin);
// Load a RGB texture from RAM and assign it to "Material".
NE_MaterialTexLoad(Material, NE_RGB5, 256, 256,

View File

@ -44,7 +44,7 @@ int main(void)
0, 1, 0); // Up direction
// Load mesh from RAM and assign it to the object "Model".
NE_ModelLoadStaticMesh(Model, (u32 *)robot_bin);
NE_ModelLoadStaticMesh(Model, robot_bin);
// Load a RGB texture from RAM and assign it to "Material".
NE_MaterialTexLoad(Material, NE_RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
textureBitmap);

View File

@ -79,7 +79,7 @@ int main(void)
// Load model
for (int i = 0; i < 10; i++)
NE_ModelLoadStaticMesh(Model[i], (u32 *)sphere_bin);
NE_ModelLoadStaticMesh(Model[i], sphere_bin);
// Set up lights
NE_LightSet(0, NE_Yellow, 0, -0.5, -0.5);

View File

@ -47,10 +47,10 @@ int main(void)
Model[i] = NE_ModelCreate(NE_Static);
Physics[i] = NE_PhysicsCreate(NE_BoundingBox);
NE_ModelLoadStaticMesh(Model[i], (u32 *)cube_bin);
NE_ModelLoadStaticMesh(Model[i], cube_bin);
NE_PhysicsSetModel(Physics[i], // Physics object
(void *)Model[i]); // Model assigned to it
Model[i]); // Model assigned to it
NE_PhysicsEnable(Physics[i], false);
NE_PhysicsSetSize(Physics[i], 1, 1, 1);

View File

@ -44,9 +44,9 @@ int main(void)
Model[i] = NE_ModelCreate(NE_Static);
Physics[i] = NE_PhysicsCreate(NE_BoundingBox);
NE_ModelLoadStaticMesh(Model[i], (u32 *)cube_bin);
NE_ModelLoadStaticMesh(Model[i], cube_bin);
NE_PhysicsSetModel(Physics[i], (void *)Model[i]);
NE_PhysicsSetModel(Physics[i], Model[i]);
NE_PhysicsSetSize(Physics[i], 1, 1, 1);
}

View File

@ -48,10 +48,10 @@ int main(void)
Model[i] = NE_ModelCreate(NE_Static);
Physics[i] = NE_PhysicsCreate(NE_BoundingBox);
NE_ModelLoadStaticMesh(Model[i], (u32 *)cube_bin);
NE_ModelLoadStaticMesh(Model[i], cube_bin);
NE_PhysicsSetModel(Physics[i], // Physics object
(void *)Model[i]); // Model assigned to it
Model[i]); // Model assigned to it
NE_PhysicsEnable(Physics[i], false);
NE_PhysicsSetSize(Physics[i], 1, 1, 1);