2017-01-20 08:36:52 -05:00
|
|
|
#pragma once
|
|
|
|
|
2017-01-19 16:23:59 -05:00
|
|
|
namespace Components
|
|
|
|
{
|
|
|
|
class Materials : public Component
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Materials();
|
|
|
|
~Materials();
|
|
|
|
|
|
|
|
static int FormatImagePath(char* buffer, size_t size, int, int, const char* image);
|
|
|
|
|
2018-12-17 08:29:18 -05:00
|
|
|
static Game::Material* Create(const std::string& name, Game::GfxImage* image);
|
2017-06-05 06:53:26 -04:00
|
|
|
static void Delete(Game::Material* material, bool deleteImage = false);
|
|
|
|
|
2018-12-17 08:29:18 -05:00
|
|
|
static Game::GfxImage* CreateImage(const std::string& name, unsigned int width, unsigned int height, unsigned int depth, unsigned int flags, _D3DFORMAT format);
|
2017-06-05 06:53:26 -04:00
|
|
|
static void DeleteImage(Game::GfxImage* image);
|
2017-06-04 18:00:46 -04:00
|
|
|
|
2017-06-06 08:02:56 -04:00
|
|
|
static bool IsValid(Game::Material* material);
|
|
|
|
|
2017-01-19 16:23:59 -05:00
|
|
|
private:
|
2017-06-05 08:31:45 -04:00
|
|
|
static std::vector<Game::GfxImage*> ImageTable;
|
2017-06-04 18:00:46 -04:00
|
|
|
static std::vector<Game::Material*> MaterialTable;
|
2017-01-19 16:23:59 -05:00
|
|
|
static int ImageNameLength;
|
|
|
|
|
|
|
|
static Utils::Hook ImageVersionCheckHook;
|
|
|
|
static void ImageVersionCheck();
|
|
|
|
|
|
|
|
static Game::Material* ResolveMaterial(const char* stringPtr);
|
|
|
|
static void DrawMaterialStub();
|
|
|
|
static void PostDrawMaterialStub();
|
|
|
|
|
|
|
|
static int WriteDeathMessageIcon(char* string, int offset, Game::Material* material);
|
|
|
|
static void DeathMessageStub();
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
static void DumpImageCfg(int, const char*, const char* material);
|
|
|
|
static void DumpImageCfgPath(int, const char*, const char* material);
|
|
|
|
#endif
|
2017-05-28 12:13:48 -04:00
|
|
|
|
|
|
|
static int MaterialComparePrint(Game::Material* m1, Game::Material* m2);
|
2017-06-04 18:00:46 -04:00
|
|
|
|
|
|
|
static void DeleteAll();
|
2017-01-19 16:23:59 -05:00
|
|
|
};
|
|
|
|
}
|