mirror of
https://github.com/AntonioND/nitro-engine.git
synced 2025-06-18 16:45:33 -04:00
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:
parent
9ce79478e0
commit
33f9bd4416
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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++)
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user