cleanup
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# _____ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2022, tyra - https://github.com/h4570/tyra
|
||||
# Licenced under Apache License 2.0
|
||||
# Licensed under Apache License 2.0
|
||||
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,13 @@ class Texture {
|
||||
Texture(TextureBuilderData* data);
|
||||
~Texture();
|
||||
|
||||
inline const u32& getId() const { return id; }
|
||||
u32 id;
|
||||
std::string name;
|
||||
TextureData* core;
|
||||
TextureData* clut;
|
||||
|
||||
/** Array of texture links with sprites/meshes */
|
||||
std::vector<TextureLink> links;
|
||||
|
||||
inline const int& getWidth() const { return core->width; }
|
||||
|
||||
@@ -39,23 +45,8 @@ class Texture {
|
||||
|
||||
float getSizeInMB() const;
|
||||
|
||||
inline u32 getTextureLinksCount() const {
|
||||
return static_cast<u32>(links.size());
|
||||
}
|
||||
|
||||
inline texwrap_t* getWrapSettings() { return &wrap; }
|
||||
|
||||
const TextureData& getCoreData() const { return *core; }
|
||||
|
||||
const TextureData* getClutData() const { return clut; }
|
||||
|
||||
/**
|
||||
* Get texture name.
|
||||
* For "textures/abc.bmp" result will be: "abc"
|
||||
*/
|
||||
inline const std::string& getName() const { return name; }
|
||||
|
||||
/** Array of texture links. Size of getTextureLinksCount() */
|
||||
inline const std::vector<TextureLink>& getTextureLinks() const {
|
||||
return links;
|
||||
}
|
||||
@@ -67,11 +58,7 @@ class Texture {
|
||||
* For 3D: MeshMaterial material id.
|
||||
* For 2D: Sprite id.
|
||||
*/
|
||||
const s32 getIndexOfLink(const u32& t_id) const {
|
||||
for (u32 i = 0; i < links.size(); i++)
|
||||
if (links[i].id == t_id) return i;
|
||||
return -1;
|
||||
}
|
||||
const s32 getIndexOfLink(const u32& t_id) const;
|
||||
|
||||
/** Set texture wrapping */
|
||||
void setWrapSettings(const TextureWrap t_horizontal,
|
||||
@@ -95,17 +82,9 @@ class Texture {
|
||||
* For 3D: MeshMaterial material id.
|
||||
* For 2D: Sprite id.
|
||||
*/
|
||||
const u8 isLinkedWith(const u32& t_id) const {
|
||||
s32 index = getIndexOfLink(t_id);
|
||||
if (index != -1)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
const u8 isLinkedWith(const u32& t_id) const;
|
||||
|
||||
void removeLinkByIndex(const u32& t_index) {
|
||||
links.erase(links.begin() + t_index);
|
||||
}
|
||||
void removeLinkByIndex(const u32& t_index);
|
||||
|
||||
/**
|
||||
* Remove texture link with given MeshMaterial/Sprite.
|
||||
@@ -113,11 +92,7 @@ class Texture {
|
||||
* For 3D: MeshMaterial material id.
|
||||
* For 2D: Sprite id.
|
||||
*/
|
||||
void removeLinkById(const u32& t_id) {
|
||||
s32 index = getIndexOfLink(t_id);
|
||||
TYRA_ASSERT(index != -1, "Cant remove link, because it was not found!");
|
||||
removeLinkByIndex(index);
|
||||
}
|
||||
void removeLinkById(const u32& t_id);
|
||||
|
||||
void print() const;
|
||||
void print(const char* name) const;
|
||||
@@ -128,13 +103,6 @@ class Texture {
|
||||
void setPsm();
|
||||
void setDefaultWrapSettings();
|
||||
|
||||
u32 id;
|
||||
std::string name;
|
||||
|
||||
TextureData* core;
|
||||
TextureData* clut;
|
||||
|
||||
texwrap_t wrap;
|
||||
std::vector<TextureLink> links;
|
||||
};
|
||||
} // namespace Tyra
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# _____ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2022, tyra - https://github.com/h4570/tyra
|
||||
# Licenced under Apache License 2.0
|
||||
# Licensed under Apache License 2.0
|
||||
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# _____ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2022, tyra - https://github.com/h4570/tyra
|
||||
# Licenced under Apache License 2.0
|
||||
# Licensed under Apache License 2.0
|
||||
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# _____ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2022, tyra - https://github.com/h4570/tyra
|
||||
# Licenced under Apache License 2.0
|
||||
# Licensed under Apache License 2.0
|
||||
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# _____ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2022, tyra - https://github.com/h4570/tyra
|
||||
# Licenced under Apache License 2.0
|
||||
# Licensed under Apache License 2.0
|
||||
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# _____ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2022, tyra - https://github.com/h4570/tyra
|
||||
# Licenced under Apache License 2.0
|
||||
# Licensed under Apache License 2.0
|
||||
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# _____ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2022, tyra - https://github.com/h4570/tyra
|
||||
# Licenced under Apache License 2.0
|
||||
# Licensed under Apache License 2.0
|
||||
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# _____ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2022, tyra - https://github.com/h4570/tyra
|
||||
# Licenced under Apache License 2.0
|
||||
# Licensed under Apache License 2.0
|
||||
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# _____ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2022, tyra - https://github.com/h4570/tyra
|
||||
# Licenced under Apache License 2.0
|
||||
# Licensed under Apache License 2.0
|
||||
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user