Last change
on this file since 80 was
80,
checked in by Sam Hocevar, 14 years ago
|
- Adding the Golgotha source code. Not sure what's going to be interesting
in there, but since it's all public domain, there's certainly stuff to
pick up.
|
-
Property svn:keywords set to
Id
|
File size:
938 bytes
|
Line | |
---|
1 | #ifndef _STACK3_H_
|
---|
2 |
|
---|
3 | #define _STACK3_H_
|
---|
4 |
|
---|
5 | #include "matrix3.h"
|
---|
6 |
|
---|
7 | #define STACK_DEPTH 32 // default stack depth
|
---|
8 |
|
---|
9 | class Matrix3Stack {
|
---|
10 | public:
|
---|
11 | DllExport Matrix3Stack();
|
---|
12 | DllExport Matrix3Stack(int depth);
|
---|
13 | DllExport ~Matrix3Stack();
|
---|
14 |
|
---|
15 | BOOL replace(const Matrix3 &m)
|
---|
16 | { stk[index] = m; return TRUE; }
|
---|
17 | BOOL push(const Matrix3 &m)
|
---|
18 | { stk[index++] = m; return index < maxDepth; }
|
---|
19 | BOOL dup(void)
|
---|
20 | { stk[index+1] = stk[index]; return ++index < maxDepth; }
|
---|
21 | BOOL concat(const Matrix3 &m)
|
---|
22 | { stk[index] = m * stk[index]; return TRUE; }
|
---|
23 | Matrix3 & get(void)
|
---|
24 | { return stk[index]; }
|
---|
25 | Matrix3 & pop(void)
|
---|
26 | { return stk[index--]; }
|
---|
27 | BOOL remove(void)
|
---|
28 | { return --index >= 0; }
|
---|
29 | BOOL reset(void)
|
---|
30 | { index = 0; stk[0].IdentityMatrix(); return TRUE; }
|
---|
31 |
|
---|
32 | private:
|
---|
33 | int maxDepth;
|
---|
34 | int index;
|
---|
35 | Matrix3 * stk;
|
---|
36 | };
|
---|
37 |
|
---|
38 |
|
---|
39 | #endif // _STACK3_H_
|
---|
Note: See
TracBrowser
for help on using the repository browser.