1
2
3
4
5
6
7
8
9
10
11
|
// rendergl.cpp: core opengl rendering stuff
#include "cube.h"
#import "DynamicEntity.h"
#import "Monster.h"
#import "OFString+Cube.h"
#ifdef DARWIN
# define GL_COMBINE_EXT GL_COMBINE_ARB
# define GL_COMBINE_RGB_EXT GL_COMBINE_RGB_ARB
|
>
|
1
2
3
4
5
6
7
8
9
10
11
12
|
// rendergl.cpp: core opengl rendering stuff
#include "cube.h"
#import "Command.h"
#import "DynamicEntity.h"
#import "Monster.h"
#import "OFString+Cube.h"
#ifdef DARWIN
# define GL_COMBINE_EXT GL_COMBINE_ARB
# define GL_COMBINE_RGB_EXT GL_COMBINE_RGB_ARB
|
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
for (int i = 0; i < 256; i++)
for (int j = 0; j < MAXFRAMES; j++)
mapping[i][j] = 0;
}
int curtexnum = 0;
void
texturereset()
{
curtexnum = 0;
}
COMMAND(texturereset, ARG_NONE)
void
texture(OFString *aframe, OFString *name)
{
int num = curtexnum++, frame = aframe.cube_intValue;
if (num < 0 || num >= 256 || frame < 0 || frame >= MAXFRAMES)
return;
mapping[num][frame] = 1;
mapname[num][frame] = [name stringByReplacingOccurrencesOfString:@"\\"
withString:@"/"];
}
COMMAND(texture, ARG_2STR)
int
lookuptexture(int tex, int *xs, int *ys)
{
int frame = 0; // other frames?
int tid = mapping[tex][frame];
|
<
|
<
|
<
<
|
<
|
<
|
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
for (int i = 0; i < 256; i++)
for (int j = 0; j < MAXFRAMES; j++)
mapping[i][j] = 0;
}
int curtexnum = 0;
COMMAND(texturereset, ARG_NONE, ^{
curtexnum = 0;
})
COMMAND(texture, ARG_2STR, (^(OFString *aframe, OFString *name) {
int num = curtexnum++, frame = aframe.cube_intValue;
if (num < 0 || num >= 256 || frame < 0 || frame >= MAXFRAMES)
return;
mapping[num][frame] = 1;
mapname[num][frame] = [name stringByReplacingOccurrencesOfString:@"\\"
withString:@"/"];
}))
int
lookuptexture(int tex, int *xs, int *ys)
{
int frame = 0; // other frames?
int tid = mapping[tex][frame];
|