forked from cvet/fonline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphicLoader.h
53 lines (42 loc) · 1.92 KB
/
GraphicLoader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef __GRAPHIC_LOADER__
#define __GRAPHIC_LOADER__
#include "Common.h"
#include "FileManager.h"
#include "GraphicStructures.h"
class AnimSet;
class GraphicLoader
{
// Models
public:
static Bone* LoadModel( const string& fname );
static void DestroyModel( Bone* root_bone );
static AnimSet* LoadAnimation( const string& anim_fname, const string& anim_name );
private:
static StrVec processedFiles;
static BoneVec loadedModels;
static StrVec loadedModelNames;
static PtrVec loadedAnimations; // Pointers of AnimSet
// Textures
public:
static MeshTexture* LoadTexture( const string& texture_name, const string& model_path );
static void DestroyTextures();
private:
static MeshTextureVec loadedMeshTextures;
// Effects
public:
static Effect* LoadEffect( const string& effect_name, bool use_in_2d, const string& defines = "", const string& model_path = "", EffectDefault* defaults = nullptr, uint defaults_count = 0 );
static void EffectProcessVariables( EffectPass& effect_pass, bool start, float anim_proc = 0.0f, float anim_time = 0.0f, MeshTexture** textures = nullptr );
static bool LoadMinimalEffects();
static bool LoadDefaultEffects();
static bool Load3dEffects();
private:
static EffectVec loadedEffects;
static bool LoadEffectPass( Effect* effect, const string& fname, FileManager& file, uint pass, bool use_in_2d, const string& defines, EffectDefault* defaults, uint defaults_count );
// Images
// All input/output data is in RGBA format
public:
static uchar* LoadPNG( const uchar* data, uint data_size, uint& result_width, uint& result_height );
static void SavePNG( const string& fname, uchar* data, uint width, uint height );
static uchar* LoadTGA( const uchar* data, uint data_size, uint& result_width, uint& result_height );
};
#endif // __GRAPHIC_LOADER__