author | truebrain |
Mon, 16 Jun 2008 00:07:49 +0000 | |
branch | noai |
changeset 10977 | 6c1a6657c7db |
parent 10938 | df6235dd2b7a |
permissions | -rw-r--r-- |
9487
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
1 |
/* $Id$ */ |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
2 |
|
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
3 |
/** @file squirrel_std.hpp defines the Squirrel Standard Function class */ |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
4 |
|
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
5 |
#ifndef SQUIRREL_STD_HPP |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
6 |
#define SQUIRREL_STD_HPP |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
7 |
|
9591
cd88f4b7cba0
(svn r9624) [NoAI] -Fix: stupid OSX defines 'require' as macro... which sane system does that?!
truelight
parents:
9577
diff
changeset
|
8 |
#if defined(__APPLE__) |
cd88f4b7cba0
(svn r9624) [NoAI] -Fix: stupid OSX defines 'require' as macro... which sane system does that?!
truelight
parents:
9577
diff
changeset
|
9 |
/* Which idiotic system makes 'require' a macro? :s Oh well.... */ |
cd88f4b7cba0
(svn r9624) [NoAI] -Fix: stupid OSX defines 'require' as macro... which sane system does that?!
truelight
parents:
9577
diff
changeset
|
10 |
#undef require |
cd88f4b7cba0
(svn r9624) [NoAI] -Fix: stupid OSX defines 'require' as macro... which sane system does that?!
truelight
parents:
9577
diff
changeset
|
11 |
#endif /* __APPLE__ */ |
cd88f4b7cba0
(svn r9624) [NoAI] -Fix: stupid OSX defines 'require' as macro... which sane system does that?!
truelight
parents:
9577
diff
changeset
|
12 |
|
9487
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
13 |
/** |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
14 |
* By default we want to give a set of standard commands to a SQ script. |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
15 |
* Most of them are easy wrappers around internal functions. Of course we |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
16 |
* could just as easy include things like the stdmath of SQ, but of those |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
17 |
* functions we are sure they work on all our supported targets. |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
18 |
*/ |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
19 |
class SquirrelStd { |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
20 |
public: |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
21 |
/** |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
22 |
* Make an integer absolute. |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
23 |
*/ |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
24 |
static SQInteger abs(HSQUIRRELVM vm); |
9577
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
25 |
|
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
26 |
/** |
10938
df6235dd2b7a
(svn r13492) [NoAI] -Add: added the 'standard' functions max() and min() in global scope
truebrain
parents:
9591
diff
changeset
|
27 |
* Get the lowest of two integers. |
df6235dd2b7a
(svn r13492) [NoAI] -Add: added the 'standard' functions max() and min() in global scope
truebrain
parents:
9591
diff
changeset
|
28 |
*/ |
df6235dd2b7a
(svn r13492) [NoAI] -Add: added the 'standard' functions max() and min() in global scope
truebrain
parents:
9591
diff
changeset
|
29 |
static SQInteger min(HSQUIRRELVM vm); |
df6235dd2b7a
(svn r13492) [NoAI] -Add: added the 'standard' functions max() and min() in global scope
truebrain
parents:
9591
diff
changeset
|
30 |
|
df6235dd2b7a
(svn r13492) [NoAI] -Add: added the 'standard' functions max() and min() in global scope
truebrain
parents:
9591
diff
changeset
|
31 |
/** |
df6235dd2b7a
(svn r13492) [NoAI] -Add: added the 'standard' functions max() and min() in global scope
truebrain
parents:
9591
diff
changeset
|
32 |
* Get the highest of two integers. |
df6235dd2b7a
(svn r13492) [NoAI] -Add: added the 'standard' functions max() and min() in global scope
truebrain
parents:
9591
diff
changeset
|
33 |
*/ |
df6235dd2b7a
(svn r13492) [NoAI] -Add: added the 'standard' functions max() and min() in global scope
truebrain
parents:
9591
diff
changeset
|
34 |
static SQInteger max(HSQUIRRELVM vm); |
df6235dd2b7a
(svn r13492) [NoAI] -Add: added the 'standard' functions max() and min() in global scope
truebrain
parents:
9591
diff
changeset
|
35 |
|
df6235dd2b7a
(svn r13492) [NoAI] -Add: added the 'standard' functions max() and min() in global scope
truebrain
parents:
9591
diff
changeset
|
36 |
/** |
9577
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
37 |
* Load an other file on runtime. |
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
38 |
* @note This is always loaded on the root-level, no matter where you call this. |
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
39 |
* @note The filename is always relative from the script it is called from. Absolute calls are NOT allowed! |
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
40 |
*/ |
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
41 |
static SQInteger require(HSQUIRRELVM vm); |
9487
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
42 |
}; |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
43 |
|
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
44 |
/** |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
45 |
* Register all standard functions we want to give to a script. |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
46 |
*/ |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
47 |
void squirrel_register_std(Squirrel *engine); |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
48 |
|
9577
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
49 |
/** |
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
50 |
* Register all standard functions that are available on first startup. |
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
51 |
* @note this set is very limited, and is only ment to load other scripts and things like that. |
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
52 |
*/ |
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
53 |
void squirrel_register_global_std(Squirrel *engine); |
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
54 |
|
9487
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
diff
changeset
|
55 |
#endif /* SQUIRREL_STD_HPP */ |