|
@@ -22,6 +22,8 @@
|
22
|
22
|
#include "utils/tga.h"
|
23
|
23
|
#include "Texture.h"
|
24
|
24
|
|
|
25
|
+#define TEXTURE_OFFSET -1
|
|
26
|
+
|
25
|
27
|
Texture::Texture() {
|
26
|
28
|
mTextureIds = NULL;
|
27
|
29
|
mFlags = 0;
|
|
@@ -124,11 +126,11 @@ void Texture::bindMultiTexture(int texture0, int texture1) {
|
124
|
126
|
|
125
|
127
|
glActiveTextureARB(GL_TEXTURE0_ARB);
|
126
|
128
|
glEnable(GL_TEXTURE_2D);
|
127
|
|
- glBindTexture(GL_TEXTURE_2D, mTextureIds[texture0]);
|
|
129
|
+ glBindTexture(GL_TEXTURE_2D, mTextureIds[texture0] + TEXTURE_OFFSET);
|
128
|
130
|
|
129
|
131
|
glActiveTextureARB(GL_TEXTURE1_ARB);
|
130
|
132
|
glEnable(GL_TEXTURE_2D);
|
131
|
|
- glBindTexture(GL_TEXTURE_2D, mTextureIds[texture1]);
|
|
133
|
+ glBindTexture(GL_TEXTURE_2D, mTextureIds[texture1] + TEXTURE_OFFSET);
|
132
|
134
|
}
|
133
|
135
|
|
134
|
136
|
void Texture::setMaxTextureCount(unsigned int n) {
|
|
@@ -241,7 +243,7 @@ int Texture::loadBufferSlot(unsigned char *image,
|
241
|
243
|
|
242
|
244
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
243
|
245
|
|
244
|
|
- glBindTexture(GL_TEXTURE_2D, mTextureIds[slot]);
|
|
246
|
+ glBindTexture(GL_TEXTURE_2D, mTextureIds[slot] + TEXTURE_OFFSET);
|
245
|
247
|
|
246
|
248
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
247
|
249
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
|
@@ -279,7 +281,7 @@ void Texture::bindTextureId(unsigned int n) {
|
279
|
281
|
glEnable(GL_TEXTURE_2D);
|
280
|
282
|
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
281
|
283
|
|
282
|
|
- glBindTexture(GL_TEXTURE_2D, mTextureIds[n]);
|
|
284
|
+ glBindTexture(GL_TEXTURE_2D, mTextureIds[n] + TEXTURE_OFFSET);
|
283
|
285
|
}
|
284
|
286
|
|
285
|
287
|
void Texture::glScreenShot(char *base, unsigned int width, unsigned int height) {
|