1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// rendermd2.cpp: loader code adapted from a nehe tutorial
#include "cube.h"
#import "DynamicEntity.h"
#import "MD2.h"
#import "MapModelInfo.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
|
// rendermd2.cpp: loader code adapted from a nehe tutorial
#include "cube.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
|
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
}
}
void
mapmodel(
OFString *rad, OFString *h, OFString *zoff, OFString *snap, OFString *name)
{
MD2 *m = loadmodel(name);
m.mmi = [[MapModelInfo alloc] initWithRad:rad.intValue
h:h.intValue
zoff:zoff.intValue
snap:snap.intValue
name:m.loadname];
if (mapmodels == nil)
mapmodels = [[OFMutableArray alloc] init];
[mapmodels addObject:m];
}
|
|
>
|
|
|
|
|
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
}
}
void
mapmodel(
OFString *rad, OFString *h, OFString *zoff, OFString *snap, OFString *name)
{
MD2 *m = loadmodel([name stringByReplacingOccurrencesOfString:@"\\"
withString:@"/"]);
m.mmi = [[MapModelInfo alloc] initWithRad:rad.cube_intValue
h:h.cube_intValue
zoff:zoff.cube_intValue
snap:snap.cube_intValue
name:m.loadname];
if (mapmodels == nil)
mapmodels = [[OFMutableArray alloc] init];
[mapmodels addObject:m];
}
|