mesh_texture -> texture

This commit is contained in:
h4570
2020-12-01 19:27:55 +01:00
parent ade89bbdd1
commit 389a5ee608
17 changed files with 48 additions and 48 deletions
+2 -2
View File
@@ -13,7 +13,7 @@
#include <stdio.h>
#include <tamtypes.h>
#include "../models/mesh_texture.hpp"
#include "../models/texture.hpp"
/** Class responsible for loading images in bmp format */
class BmpLoader
@@ -23,7 +23,7 @@ public:
BmpLoader();
~BmpLoader();
void load(MeshTexture &o_texture, char *t_subfolder, char *t_name, char *t_extension);
void load(Texture &o_texture, char *t_subfolder, char *t_name, char *t_extension);
};
#endif
+2 -2
View File
@@ -13,7 +13,7 @@
#include <stdio.h>
#include <tamtypes.h>
#include "../models/mesh_texture.hpp"
#include "../models/texture.hpp"
/** Class responsible for loading images in bmp format */
class PngLoader
@@ -23,7 +23,7 @@ public:
PngLoader();
~PngLoader();
void load(MeshTexture &o_texture, char *t_subfolder, char *t_name, char *t_extension);
void load(Texture &o_texture, char *t_subfolder, char *t_name, char *t_extension);
};
#endif
+1 -1
View File
@@ -13,7 +13,7 @@
#include "math/vector3.hpp"
#include "math/plane.hpp"
#include "./mesh_texture.hpp"
#include "./texture.hpp"
#include "./mesh_frame.hpp"
#include <tamtypes.h>
#include <draw_types.h>
@@ -8,8 +8,8 @@
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#ifndef _TYRA_MESH_TEXTURE_
#define _TYRA_MESH_TEXTURE_
#ifndef _TYRA_TEXTURE_
#define _TYRA_TEXTURE_
#include <tamtypes.h>
#include <draw_sampling.h>
@@ -27,15 +27,15 @@ enum TextureType
/**
* Class which contains texture data.
* Textures are paired with meshes via addLink() and
* removeLink() functions which use meshId and materialId.
* Textures are paired with meshes/sprites via addLink() and
* removeLink() functions which use meshId/spriteId and materialId (for mesh).
*/
class MeshTexture
class Texture
{
public:
MeshTexture();
~MeshTexture();
Texture();
~Texture();
// ----
// Getters
@@ -87,7 +87,7 @@ public:
const s32 getIndexOfLink(const u32 &t_meshId, const u32 &t_materialId) const
{
for (u32 i = 0; i < texLinks.size(); i++)
if (texLinks[i].materialId == t_materialId && texLinks[i].meshId == t_meshId)
if (texLinks[i].materialId == t_materialId && texLinks[i].meshOrSpriteId == t_meshId)
return i;
return -1;
};
+1 -1
View File
@@ -16,7 +16,7 @@
struct TextureLink
{
/** Mesh id or sprite id */
u32 meshId;
u32 meshOrSpriteId;
/** Mesh material id or 0 if is sprite */
u32 materialId;
};
+2 -2
View File
@@ -22,7 +22,7 @@
#include "../models/screen_settings.hpp"
#include "../models/light_bulb.hpp"
#include "../models/render_data.hpp"
#include "../models/mesh_texture.hpp"
#include "../models/texture.hpp"
/** Class responsible for sending data packets via GIF (PATH3) */
class GifSender
@@ -37,7 +37,7 @@ public:
void addClear(zbuffer_t *t_zBuffer);
void sendPacket();
void sendClear(zbuffer_t *t_zBuffer);
static void sendTexture(MeshTexture &texture, texbuffer_t *t_texBuffer);
static void sendTexture(Texture &texture, texbuffer_t *t_texBuffer);
private:
xyz_t *xyz;
+2 -2
View File
@@ -107,11 +107,11 @@ public:
TextureRepository *getTextureRepository() { return &textureRepo; };
private:
void changeTexture(MeshTexture *t_tex);
void changeTexture(Texture *t_tex);
u32 lastTextureId;
texbuffer_t textureBuffer;
u8 isTextureVRAMAllocated, isVSyncEnabled;
void allocateTextureBuffer(MeshTexture *t_texture);
void allocateTextureBuffer(Texture *t_texture);
void deallocateTextureBuffer();
void flipBuffers();
void beginFrameIfNeeded();
@@ -38,7 +38,7 @@ public:
// ----
/** Returns all repository textures. */
std::vector<MeshTexture *> *getAll() { return &textures; }
std::vector<Texture *> *getAll() { return &textures; }
u32 getTexturesCount() const { return static_cast<u32>(textures.size()); };
@@ -46,7 +46,7 @@ public:
* Returns single texture.
* NULL if not found.
*/
MeshTexture *getBySprite(const u32 &t_spriteId)
Texture *getBySprite(const u32 &t_spriteId)
{
for (u32 i = 0; i < textures.size(); i++)
if (textures[i]->isLinkedWith(t_spriteId))
@@ -58,7 +58,7 @@ public:
* Returns single texture.
* NULL if not found.
*/
MeshTexture *getByMesh(const u32 &t_meshId, const u32 &t_materialId)
Texture *getByMesh(const u32 &t_meshId, const u32 &t_materialId)
{
for (u32 i = 0; i < textures.size(); i++)
if (textures[i]->isLinkedWith(t_meshId, t_materialId))
@@ -70,7 +70,7 @@ public:
* Returns single texture.
* NULL if not found.
*/
MeshTexture *getByTextureId(const u32 &t_id) const
Texture *getByTextureId(const u32 &t_id) const
{
for (u32 i = 0; i < textures.size(); i++)
if (t_id == textures[i]->getId())
@@ -105,7 +105,7 @@ public:
* @param t_format if you want to use BMP, be sure that you have
* BMP with RGB 888 24bit, without color information.
*/
MeshTexture *add(char *t_subfolder, char *t_name, TextureFormat t_format);
Texture *add(char *t_subfolder, char *t_name, TextureFormat t_format);
/**
* Add linked textures in given subpath for mesh material names.
@@ -135,7 +135,7 @@ public:
}
private:
std::vector<MeshTexture *> textures;
std::vector<Texture *> textures;
BmpLoader bmpLoader;
PngLoader pngLoader;
};