mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-15 03:20:35 +00:00
Remove submodule and use subrepo for ZAPD (#591)
* remove zap * git subrepo clone https://github.com/zeldaret/ZAPD.git tools/ZAPD subrepo: subdir: "tools/ZAPD" merged: "cd4a8760b" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "cd4a8760b" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * remove thanks.md * zap2 -> zapd and spec changes * remove submodule init
This commit is contained in:
parent
ae5a8f2700
commit
ba0c6965ca
220 changed files with 85641 additions and 554 deletions
81
tools/ZAPD/ZAPD/ZTexture.h
Normal file
81
tools/ZAPD/ZAPD/ZTexture.h
Normal file
|
@ -0,0 +1,81 @@
|
|||
#pragma once
|
||||
|
||||
#include "ZResource.h"
|
||||
#include "HighLevel/HLTexture.h"
|
||||
#include "tinyxml2.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
enum class TextureType
|
||||
{
|
||||
RGBA32bpp,
|
||||
RGBA16bpp,
|
||||
Palette4bpp,
|
||||
Palette8bpp,
|
||||
Grayscale4bpp,
|
||||
Grayscale8bpp,
|
||||
GrayscaleAlpha4bpp,
|
||||
GrayscaleAlpha8bpp,
|
||||
GrayscaleAlpha16bpp,
|
||||
Error
|
||||
};
|
||||
|
||||
class ZTexture : public ZResource
|
||||
{
|
||||
protected:
|
||||
TextureType type;
|
||||
int width, height;
|
||||
|
||||
uint8_t* bmpRgb;
|
||||
uint8_t* bmpRgba;
|
||||
|
||||
virtual void ParseXML(tinyxml2::XMLElement* reader);
|
||||
void FixRawData();
|
||||
void PrepareBitmap();
|
||||
void PrepareBitmapRGBA16();
|
||||
void PrepareBitmapRGBA32();
|
||||
void PrepareBitmapGrayscale8();
|
||||
void PrepareBitmapGrayscaleAlpha8();
|
||||
void PrepareBitmapGrayscale4();
|
||||
void PrepareBitmapGrayscaleAlpha4();
|
||||
void PrepareBitmapGrayscaleAlpha16();
|
||||
void PrepareBitmapPalette4();
|
||||
void PrepareBitmapPalette8();
|
||||
void PrepareRawData(std::string inFolder);
|
||||
void PrepareRawDataRGBA16(std::string rgbaPath);
|
||||
void PrepareRawDataRGBA32(std::string rgbaPath);
|
||||
void PrepareRawDataGrayscale4(std::string grayPath);
|
||||
void PrepareRawDataGrayscale8(std::string grayPath);
|
||||
void PrepareRawDataGrayscaleAlpha4(std::string grayAlphaPath);
|
||||
void PrepareRawDataGrayscaleAlpha8(std::string grayAlphaPath);
|
||||
void PrepareRawDataGrayscaleAlpha16(std::string grayAlphaPath);
|
||||
void PrepareRawDataPalette4(std::string palPath);
|
||||
void PrepareRawDataPalette8(std::string palPath);
|
||||
float GetPixelMultiplyer();
|
||||
bool IsExternalResource();
|
||||
ZResourceType GetResourceType();
|
||||
void CalcHash();
|
||||
|
||||
public:
|
||||
ZTexture();
|
||||
~ZTexture();
|
||||
|
||||
static ZTexture* BuildFromXML(tinyxml2::XMLElement* reader, std::string inFolder, bool readFile);
|
||||
static ZTexture* ExtractFromXML(tinyxml2::XMLElement* reader, std::vector<uint8_t> nRawData, int rawDataIndex, std::string nRelPath);
|
||||
static ZTexture* FromBinary(TextureType nType, std::vector<uint8_t> nRawData, int rawDataIndex, std::string nName, int nWidth, int nHeight);
|
||||
static ZTexture* FromPNG(std::string pngFilePath, TextureType texType);
|
||||
static ZTexture* FromHLTexture(HLTexture* hlTex);
|
||||
static TextureType GetTextureTypeFromString(std::string str);
|
||||
|
||||
std::string GetSourceOutputCode(std::string prefix);
|
||||
std::string GetSourceOutputHeader(std::string prefix);
|
||||
|
||||
std::vector<uint8_t> GetRawData();
|
||||
int GetRawDataSize();
|
||||
std::string GetIMFmtFromType();
|
||||
std::string GetIMSizFromType();
|
||||
int GetWidth();
|
||||
int GetHeight();
|
||||
void Save(std::string outFolder);
|
||||
std::string GetExternalExtension();
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue