moving textures to textures repo #1

This commit is contained in:
Sandro Sobczyński
2020-10-31 10:53:20 +01:00
parent ebf2a9ac24
commit 3cfe7ba8f1
11 changed files with 127 additions and 76 deletions
+17 -20
View File
@@ -14,12 +14,12 @@
#include <tamtypes.h>
#include <draw_sampling.h>
#include "./texture_wrap_settings.hpp"
#include "./texture_link.hpp"
/**
* Class which contains texture data
* Textures are paired with material via material id.
* Additionaly, you can load two textures for single material
* and switch materialId here to change texture.
* Class which contains texture data.
* Textures are paired with meshes via addUsage(),
* removeUsage() functions which use meshId and materialId.
*/
class MeshTexture
{
@@ -40,17 +40,12 @@ public:
*/
const u32 &getId() const { return id; };
/**
* Core role of this variable is to assign texture to correct material.
* For example you can have two textures for single material.
* Example: Same player can have two textures (team A, team B)
*/
const u32 &getMaterialId() const { return materialId; };
const u8 &getWidth() const { return width; };
const u8 &getHeight() const { return height; };
const u32 &getTextureLinksCount() const { return texLinkCount; };
texwrap_t *getWrapSettings() { return &wrapSettings; };
/**
@@ -71,17 +66,13 @@ public:
*/
char *getName() const { return name; };
/** Array of texture links. Size of getTextureLinksCount() */
TextureLink *getTextureLinks() const { return texLinks; };
// ----
// Setters
// ----
/**
* Core role of this variable is to assign texture to correct material.
* For example you can have two textures for single material.
* Example: Same player can have two textures (team A, team B)
*/
void setMaterialId(const u32 &t_val) { materialId = t_val; }
/**
* Set texture size and allocate texture data
* Do not call this method unless you know what you do.
@@ -114,16 +105,22 @@ public:
// Other
// ----
/** Assign texture to mesh and mesh material */
void addLink(u32 t_meshId, u32 t_materialId);
/** Remove mesh and mesh material assignment */
void removeLink(u32 t_meshId, u32 t_materialId);
const u8 &isNameSet() const { return _isNameSet; };
const u8 &isSizeSet() const { return _isSizeSet; };
private:
void setDefaultWrapSettings();
texwrap_t wrapSettings;
char *name;
u32 id, materialId;
TextureLink *texLinks;
u32 id, texLinkCount;
u8 width, height, _isNameSet, _isSizeSet;
unsigned char *data;
};