1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// rendermd2.cpp: loader code adapted from a nehe tutorial
#include "cube.h"
#import "Command.h"
#import "DynamicEntity.h"
#import "MD2.h"
#import "MapModelInfo.h"
#import "OFString+Cube.h"
static OFMutableDictionary<OFString *, MD2 *> *mdllookup = nil;
static OFMutableArray<MD2 *> *mapmodels = nil;
static const int FIRSTMDL = 20;
void
|
<
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// rendermd2.cpp: loader code adapted from a nehe tutorial
#include "cube.h"
#import "Command.h"
#import "MD2.h"
#import "MapModelInfo.h"
#import "OFString+Cube.h"
#import "Player.h"
static OFMutableDictionary<OFString *, MD2 *> *mdllookup = nil;
static OFMutableArray<MD2 *> *mapmodels = nil;
static const int FIRSTMDL = 20;
void
|
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
void
rendermodel(OFString *mdl, int frame, int range, int tex, float rad,
OFVector3D position, float yaw, float pitch, bool teammate, float scale,
float speed, int snap, int basetime)
{
MD2 *m = loadmodel(mdl);
if (isoccluded(player1.origin.x, player1.origin.y, position.x - rad,
position.z - rad, rad * 2))
return;
delayedload(m);
int xs, ys;
glBindTexture(GL_TEXTURE_2D,
tex ? lookuptexture(tex, &xs, &ys) : FIRSTMDL + m.mdlnum);
|
|
|
|
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
void
rendermodel(OFString *mdl, int frame, int range, int tex, float rad,
OFVector3D position, float yaw, float pitch, bool teammate, float scale,
float speed, int snap, int basetime)
{
MD2 *m = loadmodel(mdl);
if (isoccluded(Player.player1.origin.x, Player.player1.origin.y,
position.x - rad, position.z - rad, rad * 2))
return;
delayedload(m);
int xs, ys;
glBindTexture(GL_TEXTURE_2D,
tex ? lookuptexture(tex, &xs, &ys) : FIRSTMDL + m.mdlnum);
|