library: Rename some functions for consistency

NE_MaterialClone() clones everything, not just the texture.

NE_MaterialSetPalette() sets the palette of the material, not the
palette of the texture (different materials may use the same texture but
different palettes.
This commit is contained in:
Antonio Niño Díaz 2022-10-25 23:45:03 +01:00
parent ae650b6bab
commit b3440e9526
3 changed files with 18 additions and 6 deletions

View File

@ -128,13 +128,25 @@ int NE_MaterialTexLoad(NE_Material *tex, NE_TextureFormat fmt,
/// ///
/// @param source Source. /// @param source Source.
/// @param dest Destination. /// @param dest Destination.
void NE_MaterialTexClone(NE_Material *source, NE_Material *dest); void NE_MaterialClone(NE_Material *source, NE_Material *dest);
/// Assign a palette to a material. /// Alias of NE_MaterialClone
///
/// @deprecated This definition is only present for backwards compatibility and
/// it will be removed.
#define NE_MaterialTexClone NE_MaterialClone
/// Assigns a palette to a material.
/// ///
/// @param tex Material. /// @param tex Material.
/// @param pal Palette. /// @param pal Palette.
void NE_MaterialTexSetPal(NE_Material *tex, NE_Palette *pal); void NE_MaterialSetPalette(NE_Material *tex, NE_Palette *pal);
/// Alias of NE_MaterialSetPalette().
///
/// @deprecated This definition is only present for backwards compatibility and
/// it will be removed.
#define NE_MaterialTexSetPal NE_MaterialSetPalette
/// Set active material to use when drawing polygons. /// Set active material to use when drawing polygons.
/// ///

View File

@ -370,6 +370,6 @@ int NE_MaterialTexLoadBMPtoRGB256(NE_Material *tex, NE_Palette *pal,
return 0; return 0;
} }
NE_MaterialTexSetPal(tex, pal); NE_MaterialSetPalette(tex, pal);
return 1; return 1;
} }

View File

@ -398,7 +398,7 @@ int NE_MaterialTexLoad(NE_Material *tex, NE_TextureFormat fmt,
return 1; return 1;
} }
void NE_MaterialTexClone(NE_Material *source, NE_Material *dest) void NE_MaterialClone(NE_Material *source, NE_Material *dest)
{ {
NE_AssertPointer(source, "NULL source pointer"); NE_AssertPointer(source, "NULL source pointer");
NE_AssertPointer(dest, "NULL dest pointer"); NE_AssertPointer(dest, "NULL dest pointer");
@ -409,7 +409,7 @@ void NE_MaterialTexClone(NE_Material *source, NE_Material *dest)
memcpy(dest, source, sizeof(NE_Material)); memcpy(dest, source, sizeof(NE_Material));
} }
void NE_MaterialTexSetPal(NE_Material *tex, NE_Palette *pal) void NE_MaterialSetPalette(NE_Material *tex, NE_Palette *pal)
{ {
NE_AssertPointer(tex, "NULL material pointer"); NE_AssertPointer(tex, "NULL material pointer");
NE_AssertPointer(pal, "NULL palette pointer"); NE_AssertPointer(pal, "NULL palette pointer");