summaryrefslogtreecommitdiff
path: root/ZAPD/ZDisplayList.h
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2021-05-07 17:35:00 -0400
committerGitHub <noreply@github.com>2021-05-07 17:35:00 -0400
commit547c9b200d1dff745dee694c20a9f9e8e409a11d (patch)
tree4eb2ec3fe46fb5709a43d268a2de74668839f2f1 /ZAPD/ZDisplayList.h
parent5a721d58d4b28f4797d6fdf29d9926e5e968a939 (diff)
Change image library to `libpng` and improve how palettized textures are extracted (#133)
* trying to change to libpng * It works again! * move the libpng abstraction to another file * GetBytesPerPixel * I'm dumb * fix warnings and remove dead code * Fix CRC being called multiples times and clean up code * textureDataRaw * code clean * Optimizations and removal of redundant data moves * ups * run format * use fs::path more * i'm dumb again * Add a Readme * remove texDeclarations * handle tluts better * vtx change and set segment file * small changes * Fix ZAPD ignoring textures declared in a scene in the XML * small cleanup before tluts * paletted images are broken * kinda works for automatic textures * fix automatic ci * TEXTURE_DEBUG * Remove extra `-j` * Fix extraction of ci4 * Finally palettes OK * ups * Move textures map to ZFile * Fix intersection warnings * Add `TlutOffset` attribute * Move Tlut declaration to a later step * Hopefully the last cleanup of this branch * Run format * Always calc hash * run format * Delete stb * fix merge issues * run format
Diffstat (limited to 'ZAPD/ZDisplayList.h')
-rw-r--r--ZAPD/ZDisplayList.h37
1 files changed, 9 insertions, 28 deletions
diff --git a/ZAPD/ZDisplayList.h b/ZAPD/ZDisplayList.h
index 41166ba..d53626e 100644
--- a/ZAPD/ZDisplayList.h
+++ b/ZAPD/ZDisplayList.h
@@ -4,6 +4,7 @@
#include "ZResource.h"
#include "ZRoom/ZRoom.h"
#include "ZTexture.h"
+#include "ZVtx.h"
#include "tinyxml2.h"
#include <map>
@@ -282,20 +283,6 @@ enum class OoTSegments
#define FORCE_BL 0x4000
#define TEX_EDGE 0x0000
-class Vertex
-{
-public:
- int16_t x, y, z;
- uint16_t flag;
- int16_t s, t;
- uint8_t r, g, b, a;
-
- Vertex();
- Vertex(int16_t nX, int16_t nY, int16_t nZ, uint16_t nFlag, int16_t nS, int16_t nT, uint8_t nR,
- uint8_t nG, uint8_t nB, uint8_t nA);
- Vertex(std::vector<uint8_t> rawData, uint32_t rawDataIndex);
-};
-
class ZDisplayList : public ZResource
{
protected:
@@ -350,14 +337,12 @@ public:
DListType dListType;
- // int32_t dListAddress;
-
- std::map<uint32_t, std::vector<Vertex>> vertices;
+ std::map<uint32_t, std::vector<ZVtx>> vertices;
std::map<uint32_t, std::string> vtxDeclarations;
std::vector<ZDisplayList*> otherDLists;
- std::map<uint32_t, ZTexture*> textures;
- std::map<uint32_t, std::string> texDeclarations;
+ ZTexture* lastTexture = nullptr;
+ ZTexture* lastTlut = nullptr;
std::vector<uint32_t> references;
@@ -372,16 +357,13 @@ public:
void ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector<uint8_t>& nRawData,
const uint32_t nRawDataIndex) override;
- // static ZDisplayList* BuildFromXML(tinyxml2::XMLElement* reader, std::string inFolder, bool
- // readFile, ZFile* nParent);
void TextureGenCheck(std::string prefix);
- static bool TextureGenCheck(std::vector<uint8_t> fileData,
- std::map<uint32_t, ZTexture*>& textures, ZRoom* scene,
- ZFile* parent, std::string prefix, int32_t texWidth,
- int32_t texHeight, uint32_t texAddr, uint32_t texSeg,
- F3DZEXTexFormats texFmt, F3DZEXTexSizes texSiz, bool texLoaded,
- bool texIsPalette);
+ static bool TextureGenCheck(std::vector<uint8_t> fileData, ZRoom* scene, ZFile* parent,
+ std::string prefix, int32_t texWidth, int32_t texHeight,
+ uint32_t texAddr, uint32_t texSeg, F3DZEXTexFormats texFmt,
+ F3DZEXTexSizes texSiz, bool texLoaded, bool texIsPalette,
+ ZDisplayList* self);
static int32_t GetDListLength(std::vector<uint8_t> rawData, uint32_t rawDataIndex,
DListType dListType);
@@ -391,7 +373,6 @@ public:
std::string ProcessLegacy(const std::string& prefix);
std::string ProcessGfxDis(const std::string& prefix);
- void Save(const std::string& outFolder) override;
virtual void GenerateHLIntermediette(HLFileIntermediette& hlFile) override;
bool IsExternalResource() override;
virtual std::string GetExternalExtension() override;