-
Notifications
You must be signed in to change notification settings - Fork 5
/
texmanager.h
executable file
·75 lines (65 loc) · 1.53 KB
/
texmanager.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/******************************************************
g-Matrix3D Neo Engine
Copyright (c)2003 Kim Seong Wan (kaswan, Â𻧱ͽÅ)
E-mail: [email protected]
http://www.g-matrix.pe.kr
*******************************************************/
#ifndef TEXMANAGER_H
#define TEXMANAGER_H
#include "texture.h"
extern int TEXWIDTH;
extern int TEXHEIGHT;
extern BYTE *pTex;
extern int TEXWIDTHBOUND;
extern int TEXHEIGHTBOUND;
class CTexManager{
CTexture *TexList;
int TexIndex;
int CurrentTexIndex;
int NumTexIndex;
int MaxTexIndex;
public:
CTexManager()
{
TexList = NULL;
TexIndex = 0;
CurrentTexIndex = 0;
NumTexIndex = 0;
MaxTexIndex = 0;
}
~CTexManager()
{
if (TexList) delete [] TexList;
}
void Init(int num);
void DeInit(void);
int Load(char * name);
int Create(int, int);
int SetTexture(int index)
{
if (CurrentTexIndex == index) return CurrentTexIndex;
if (index < NumTexIndex && index >= 0)
{
CurrentTexIndex = index;
::pTex = TexList[CurrentTexIndex].pTex;
::TEXWIDTH = TexList[CurrentTexIndex].TextureWidth;
::TEXHEIGHT = TexList[CurrentTexIndex].TextureHeight;
::TEXWIDTHBOUND = TEXWIDTH - 1;
::TEXHEIGHTBOUND = TEXHEIGHT - 1;
}
return CurrentTexIndex;
}
BYTE *GetCurrentTexPointer(void)
{
return TexList[CurrentTexIndex].pTex;
}
int GetCurrentTexWidth(void)
{
return TexList[CurrentTexIndex].TextureWidth;
}
int GetCurrentTexHeight(void)
{
return TexList[CurrentTexIndex].TextureHeight;
}
};
#endif