comparison Engine/AssetsManager.cpp @ 2572:d87bfbd3bb3b

Step towards unification of Texture and RGBTexture (class Image)
author a.parshin
date Sat, 05 Mar 2016 01:51:54 +0200
parents
children dd36326a9994
comparison
equal deleted inserted replaced
2571:cf29f444ddd7 2572:d87bfbd3bb3b
1 #include "Engine/Engine.h"
2 #include "Engine/AssetsManager.h"
3 #include "Engine/LOD.h"
4
5 AssetsManager *assets = new AssetsManager();
6
7
8
9 Texture *AssetsManager::GetTexture(const char *name)
10 {
11 //wchar_t wname[1024];
12 //swprintf(wname, L"%S", name);
13
14 return pIcons_LOD->LoadTexturePtr(name);
15 }
16
17
18 Texture *AssetsManager::GetTexture(const wchar_t *wname)
19 {
20 char name[1024];
21 sprintf(name, "%S", name);
22
23 return this->GetTexture(name);
24 }
25
26
27
28 Image *AssetsManager::GetImage_16BitColorKey(const wchar_t *name, unsigned __int16 colorkey)
29 {
30 Image *img = new Image();
31 if (!img->ColorKey_From_LOD(name, colorkey))
32 {
33 delete img;
34 img = nullptr;
35 }
36
37 return img;
38 }
39
40 Image *AssetsManager::GetImage_16BitAlpha(const wchar_t *name)
41 {
42 Image *img = new Image();
43 if (!img->Alpha_From_LOD(name))
44 {
45 delete img;
46 img = nullptr;
47 }
48
49 return img;
50 }
51
52 Image *AssetsManager::GetImage_PCXFromIconsLOD(const wchar_t *name)
53 {
54 Image *img = new Image();
55 if (!img->PCX_From_IconsLOD(name))
56 {
57 delete img;
58 img = nullptr;
59 }
60
61 return img;
62 }
63
64 Image *AssetsManager::GetImage_PCXFromNewLOD(const wchar_t *name)
65 {
66 Image *img = new Image();
67 if (!img->PCX_From_NewLOD(name))
68 {
69 delete img;
70 img = nullptr;
71 }
72
73 return img;
74 }
75
76
77 Image *AssetsManager::GetImage_PCXFromFile(const wchar_t *name)
78 {
79 Image *img = new Image();
80 if (!img->PCX_From_File(name))
81 {
82 delete img;
83 img = nullptr;
84 }
85
86 return img;
87 }