forked from kungfooman/libcod
-
Notifications
You must be signed in to change notification settings - Fork 13
/
gsc_level.cpp
52 lines (41 loc) · 1 KB
/
gsc_level.cpp
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
#include "gsc_level.hpp"
#if COMPILE_LEVEL == 1
void gsc_level_getnumberofstaticmodels()
{
stackPushInt(cm.numStaticModels);
}
void gsc_level_getstaticmodelname()
{
int index;
if ( ! stackGetParams("i", &index))
{
stackError("gsc_level_getstaticmodelname() argument is undefined or has a wrong type");
stackPushUndefined();
return;
}
if (index < 0 || index >= (int)cm.numStaticModels)
{
stackError("gsc_level_getstaticmodelname() index is out of range");
stackPushUndefined();
return;
}
stackPushString(cm.staticModelList[index].xmodel->name);
}
void gsc_level_getstaticmodelorigin()
{
int index;
if ( ! stackGetParams("i", &index))
{
stackError("gsc_level_getstaticmodelorigin() argument is undefined or has a wrong type");
stackPushUndefined();
return;
}
if (index < 0 || index >= (int)cm.numStaticModels)
{
stackError("gsc_level_getstaticmodelorigin() index is out of range");
stackPushUndefined();
return;
}
stackPushVector(cm.staticModelList[index].origin);
}
#endif