diff options
author | Treeki <treeki@gmail.com> | 2012-03-15 02:54:33 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-03-15 02:54:33 +0100 |
commit | e88fd1dcef52d4375fef655918886fc14bb1f40c (patch) | |
tree | f081b14a420331258665a58ad31be54b13b1c655 /include | |
parent | 18a6c3dbe01f484b346923ebc53f674c1e4a5101 (diff) | |
download | kamek-e88fd1dcef52d4375fef655918886fc14bb1f40c.tar.gz kamek-e88fd1dcef52d4375fef655918886fc14bb1f40c.zip |
optimisations to reduce code size
Diffstat (limited to '')
-rw-r--r-- | include/statelib.h | 45 |
1 files changed, 7 insertions, 38 deletions
diff --git a/include/statelib.h b/include/statelib.h index e65f33a..22e1de9 100644 --- a/include/statelib.h +++ b/include/statelib.h @@ -1,3 +1,6 @@ +// This is no longer totally accurate to Nintendo's version. +// Should still work for Newer, though. + /******************************************************************************/ // dStateBase_c class /******************************************************************************/ @@ -14,6 +17,10 @@ public: virtual bool isSameStateName(const char *name); virtual const char *getName(); virtual int getID(); + virtual void doBegin(void *owner); + virtual void doExecute(void *owner); + virtual void doEnd(void *owner); + static dStateBase_c mNoState; @@ -40,13 +47,6 @@ public: mEnd = end; } - ~dState_c(); - bool isSameStateName(const char *name); - - virtual void doBegin(TOwner *owner); - virtual void doExecute(TOwner *owner); - virtual void doEnd(TOwner *owner); - funcPtr mBegin; funcPtr mExecute; funcPtr mEnd; @@ -54,37 +54,6 @@ public: void *mBaseState; }; -template <class TOwner> -dState_c<TOwner>::~dState_c() { } - -template <class TOwner> -bool dState_c<TOwner>::isSameStateName(const char *name) { - const char *p = strrchr(name, ':'); - if (p) - name = p + 1; - - int cmp = strcmp(strrchr(getName(), ':')+1, name); - if (cmp == 0) - return true; - else - return false; -} - -template <class TOwner> -void dState_c<TOwner>::doBegin(TOwner *owner) { - (owner->*mBegin)(); -} - -template <class TOwner> -void dState_c<TOwner>::doExecute(TOwner *owner) { - (owner->*mExecute)(); -} - -template <class TOwner> -void dState_c<TOwner>::doEnd(TOwner *owner) { - (owner->*mEnd)(); -} - /******************************************************************************/ // A Very Useless Class /******************************************************************************/ |