aboutsummaryrefslogtreecommitdiff
path: root/include/smanim.hpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2015-08-14 23:45:02 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2015-08-14 23:45:02 +0800
commit92f17580846c88108aab023092c23e6bcdcf2f75 (patch)
tree0b05ee9215e46c02482e545989a8f92041bcc4f6 /include/smanim.hpp
parentfff589be8d4a363c01c698c052fc43de806f5055 (diff)
downloadbullet-lab-remix-92f17580846c88108aab023092c23e6bcdcf2f75.tar.xz
SMELT is finally finished! Add the SMELT library for future use.
Add .gitignore.
Diffstat (limited to 'include/smanim.hpp')
-rw-r--r--include/smanim.hpp71
1 files changed, 71 insertions, 0 deletions
diff --git a/include/smanim.hpp b/include/smanim.hpp
new file mode 100644
index 0000000..b206d5e
--- /dev/null
+++ b/include/smanim.hpp
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+/*
+ * Simple MultimEdia LiTerator(SMELT)
+ * by Chris Xiong 2015
+ * api level 1
+ * Animation header
+ *
+ * WARNING: This library is in development and interfaces would be very
+ * unstable.
+ *
+ */
+#ifndef SMANIM_H
+#define SMANIM_H
+#include "smelt.hpp"
+#include "smentity.hpp"
+#include "smdatapack.hpp"
+#include <map>
+#include <string>
+
+class smTexInfo
+{
+public:
+ smTexRect rect;
+ char *name,*path;
+ SMTEX tex;
+};
+class smAnmInfo
+{
+public:
+ smTexInfo frames[256];
+ int framedur[256],mode,fc;
+ char* name;
+};
+class smAnmFile
+{
+private:
+ static SMELT *sm;
+ smDtpFileR anm;
+ void parseMeta(char* meta,DWORD size);
+ std::map<std::string,smTexInfo> tm;
+ std::map<std::string,smAnmInfo> am;
+ std::map<std::string,SMTEX> xm;
+public:
+ bool loadAnmFromMemory(char* ptr,DWORD size);
+ void close();
+ smTexInfo* getTextureInfo(const char* name);
+ smAnmInfo* getAnimationInfo(const char* name);
+};
+class smAnimation2D:public smEntity2D
+{
+private:
+ smAnmInfo ai;
+ smAnimation2D();
+ int cf,mf,r;
+public:
+ smAnimation2D(smAnmInfo a);
+ void updateAnim(int f=1);
+ void resetAnim();
+};
+class smAnimation3D:public smEntity3D
+{
+private:
+ smAnmInfo ai;
+ smAnimation3D();
+ int cf,mf,r;
+public:
+ smAnimation3D(smAnmInfo a);
+ void updateAnim(int f=1);
+ void resetAnim();
+};
+#endif