author | truelight |
Wed, 18 Jul 2007 14:58:37 +0000 | |
branch | noai |
changeset 9673 | ee4f133c84ec |
parent 9591 | cd88f4b7cba0 |
child 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 |
/** |
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
27 |
* 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
|
28 |
* @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
|
29 |
* @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
|
30 |
*/ |
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
31 |
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
|
32 |
}; |
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
|
33 |
|
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
|
34 |
/** |
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
|
35 |
* 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
|
36 |
*/ |
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
|
37 |
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
|
38 |
|
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
|
39 |
/** |
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 |
* 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
|
41 |
* @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
|
42 |
*/ |
8e93be390b45
(svn r9594) [NoAI] -Add: added 'require()' for Squirrel, which allows you to include other files in your .nut
truelight
parents:
9487
diff
changeset
|
43 |
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
|
44 |
|
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
|
45 |
#endif /* SQUIRREL_STD_HPP */ |