the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 93 lines 2.5 kB view raw
1#pragma once 2using namespace std; 3 4#include "TexturePack.h" 5 6class BufferedImage; 7 8class AbstractTexturePack : public TexturePack 9{ 10private: 11 const DWORD id; 12 const wstring name; 13 14protected: 15 File *file; 16 wstring texname; 17 wstring m_wsWorldName; 18 19 wstring desc1; 20 wstring desc2; 21 22 PBYTE m_iconData; 23 DWORD m_iconSize; 24 25 PBYTE m_comparisonData; 26 DWORD m_comparisonSize; 27 28 TexturePack *fallback; 29 30 ColourTable *m_colourTable; 31 32protected: 33 BufferedImage *iconImage; 34 35private: 36 int textureId; 37 38protected: 39 AbstractTexturePack(DWORD id, File *file, const wstring &name, TexturePack *fallback); 40 41private: 42 static wstring trim(wstring line); 43 44protected: 45 virtual void loadIcon(); 46 virtual void loadComparison(); 47 virtual void loadDescription(); 48 virtual void loadName(); 49 50public: 51 virtual InputStream *getResource(const wstring &name, bool allowFallback); //throws IOException 52 // 4J Removed do to current override in TexturePack class 53 //virtual InputStream *getResource(const wstring &name); //throws IOException 54 virtual DLCPack * getDLCPack() =0; 55 56 57protected: 58 virtual InputStream *getResourceImplementation(const wstring &name) = 0; // throws IOException; 59public: 60 virtual void unload(Textures *textures); 61 virtual void load(Textures *textures); 62 virtual bool hasFile(const wstring &name, bool allowFallback); 63 virtual bool hasFile(const wstring &name) = 0; 64 virtual DWORD getId(); 65 virtual wstring getName(); 66 virtual wstring getDesc1(); 67 virtual wstring getDesc2(); 68 virtual wstring getWorldName(); 69 70 virtual wstring getAnimationString(const wstring &textureName, const wstring &path, bool allowFallback); 71 72protected: 73 virtual wstring getAnimationString(const wstring &textureName, const wstring &path); 74 void loadDefaultUI(); 75 void loadDefaultColourTable(); 76 void loadDefaultHTMLColourTable(); 77#ifdef _XBOX 78 void loadHTMLColourTableFromXuiScene(HXUIOBJ hObj); 79#endif 80 81public: 82 virtual BufferedImage *getImageResource(const wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const wstring &drive =L""); 83 virtual void loadColourTable(); 84 virtual void loadUI(); 85 virtual void unloadUI(); 86 virtual wstring getXuiRootPath(); 87 virtual PBYTE getPackIcon(DWORD &dwImageBytes); 88 virtual PBYTE getPackComparison(DWORD &dwImageBytes); 89 virtual unsigned int getDLCParentPackId(); 90 virtual unsigned char getDLCSubPackId(); 91 virtual ColourTable *getColourTable() { return m_colourTable; } 92 virtual ArchiveFile *getArchiveFile() { return NULL; } 93};