mesh_texture refactoring #1
This commit is contained in:
@@ -16,6 +16,12 @@
|
||||
#include "math/vector3.hpp"
|
||||
#include "./mesh_material.hpp"
|
||||
|
||||
/**
|
||||
* Class which contains core mesh data
|
||||
* which are needed for drawing.
|
||||
* Static object (not animated), will have
|
||||
* only one instance of this class.
|
||||
*/
|
||||
class MeshFrame
|
||||
{
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
|
||||
#include <tamtypes.h>
|
||||
|
||||
/** Class which contains draw data for mesh part.
|
||||
/** Class which contains draw instructions for part mesh of mesh.
|
||||
* Mesh can have many materials.
|
||||
* For example, car can have three materials:
|
||||
* For example, car mesh can have three materials:
|
||||
* body, tires and windows.
|
||||
*/
|
||||
class MeshMaterial
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#define _TYRA_OBJECT3D_SPEC_
|
||||
|
||||
#include "math/vector3.hpp"
|
||||
#include "./texture.hpp"
|
||||
#include "./mesh_texture.hpp"
|
||||
#include <tamtypes.h>
|
||||
#include <draw_buffers.h>
|
||||
#include <draw_sampling.h>
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
|
||||
void allocateMemory();
|
||||
void setupLodAndClut();
|
||||
Texture *textures;
|
||||
MeshTexture *textures;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2020, tyra - https://github.com/h4570/tyra
|
||||
# Licenced under Apache License 2.0
|
||||
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef _TYRA_MESH_TEXTURE_
|
||||
#define _TYRA_MESH_TEXTURE_
|
||||
|
||||
#include <tamtypes.h>
|
||||
#include <draw_sampling.h>
|
||||
|
||||
/**
|
||||
* 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 MeshTexture
|
||||
{
|
||||
|
||||
public:
|
||||
MeshTexture();
|
||||
~MeshTexture();
|
||||
|
||||
// ----
|
||||
// Getters
|
||||
// ----
|
||||
|
||||
// ----
|
||||
// Setters
|
||||
// ----
|
||||
|
||||
// ----
|
||||
// Other
|
||||
// ----
|
||||
|
||||
// TODO
|
||||
|
||||
u32 id;
|
||||
unsigned char *data;
|
||||
texwrap_t wrapSettings;
|
||||
char *name;
|
||||
u8 width, height;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -11,16 +11,6 @@
|
||||
#ifndef _TYRA_TEXTURE_
|
||||
#define _TYRA_TEXTURE_
|
||||
|
||||
#include <tamtypes.h>
|
||||
#include <draw_sampling.h>
|
||||
|
||||
struct Texture
|
||||
{
|
||||
u32 id;
|
||||
unsigned char *data;
|
||||
texwrap_t wrapSettings;
|
||||
char *name;
|
||||
u8 width, height;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user