aboutsummaryrefslogtreecommitdiff
path: root/archive/include/hgeanim.h
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2015-10-26 22:52:36 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2015-10-26 22:52:36 +0800
commit3bd383baf6a17e734329e1fc677c7e86283db772 (patch)
tree69a9148087577f797624ceb9c71323a2563d6bb4 /archive/include/hgeanim.h
parent543e4f570be9b279ba558ca61cc02cda251af384 (diff)
downloadbullet-lab-remix-3bd383baf6a17e734329e1fc677c7e86283db772.tar.xz
Added support for relative line numbers.
Added instructions for, brk and cont. (They are still untested...) Parser code cleanup. Removed garbage output to stderr. Reorganize the repository structure. Updated BLR2 code move it into archive. Added BLR1 files.
Diffstat (limited to 'archive/include/hgeanim.h')
-rw-r--r--archive/include/hgeanim.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/archive/include/hgeanim.h b/archive/include/hgeanim.h
new file mode 100644
index 0000000..7c5f237
--- /dev/null
+++ b/archive/include/hgeanim.h
@@ -0,0 +1,69 @@
+/*
+** Haaf's Game Engine 1.7
+** Copyright (C) 2003-2007, Relish Games
+** hge.relishgames.com
+**
+** hgeAnimation helper class header
+*/
+
+
+#ifndef HGEANIM_H
+#define HGEANIM_H
+
+
+#include "hgesprite.h"
+
+
+#define HGEANIM_FWD 0
+#define HGEANIM_REV 1
+#define HGEANIM_PINGPONG 2
+#define HGEANIM_NOPINGPONG 0
+#define HGEANIM_LOOP 4
+#define HGEANIM_NOLOOP 0
+
+
+/*
+** HGE Animation class
+*/
+class hgeAnimation : public hgeSprite
+{
+public:
+ hgeAnimation(HTEXTURE tex, int nframes, float FPS, float x, float y, float w, float h);
+ hgeAnimation(const hgeAnimation &anim);
+
+ void Play();
+ void Stop() { bPlaying=false; }
+ void Resume() { bPlaying=true; }
+ void Update(float fDeltaTime);
+ bool IsPlaying() const { return bPlaying; }
+
+ void SetTexture(HTEXTURE tex) { hgeSprite::SetTexture(tex); orig_width = hge->Texture_GetWidth(tex, true); }
+ void SetTextureRect(float x1, float y1, float x2, float y2) { hgeSprite::SetTextureRect(x1,y1,x2,y2); SetFrame(nCurFrame); }
+ void SetMode(int mode);
+ void SetSpeed(float FPS) { fSpeed=1.0f/FPS; }
+ void SetFrame(int n);
+ void SetFrames(int n) { nFrames=n; }
+
+ int GetMode() const { return Mode; }
+ float GetSpeed() const { return 1.0f/fSpeed; }
+ int GetFrame() const { return nCurFrame; }
+ int GetFrames() const { return nFrames; }
+
+private:
+ hgeAnimation();
+
+ int orig_width;
+
+ bool bPlaying;
+
+ float fSpeed;
+ float fSinceLastFrame;
+
+ int Mode;
+ int nDelta;
+ int nFrames;
+ int nCurFrame;
+};
+
+
+#endif