/
BFGroundTextures.h
64 lines (49 loc) · 1.13 KB
/
BFGroundTextures.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
// BFGroundTextures.h
///////////////////////////////////////////////////////////////////////////
#ifndef __BF_GROUND_TEXTURES_H__
#define __BF_GROUND_TEXTURES_H__
#include "Rendering/GL/myGL.h"
class CFileHandler;
class CSmfReadMap;
class CBFGroundTextures
{
public:
CBFGroundTextures(CSmfReadMap* srm);
~CBFGroundTextures(void);
void SetTexture(int x, int y);
void DrawUpdate(void);
void LoadSquare(int x, int y, int level);
protected:
CSmfReadMap* map;
int bigSquareSize;
int numBigTexX;
int numBigTexY;
int* textureOffsets;
struct GroundSquare {
int texLevel;
GLuint texture;
int lastUsed;
};
GroundSquare* squares;
// variables controlling background reading of textures
bool inRead;
int readProgress;
int readX;
int readY;
GroundSquare* readSquare;
int readLevel;
unsigned char* readBuffer;
unsigned char* readTempLine;
int* tileMap;
int tileSize;
char* tiles;
int tileMapXSize;
int tileMapYSize;
// use Pixel Buffer Objects for async. uploading (DMA)?
bool usePBO;
GLuint pboIDs[30];
int currentPBO;
float anisotropy;
inline bool TexSquareInView(int, int);
};
#endif // __BF_GROUND_TEXTURES_H__