X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Fdebugscript.h;fp=src%2Fdebugscript.h;h=822819ae5d14b8bfb10cf19169430c748215923e;hb=35bc799125eec0d0c839af56fd136c8e85793a56;hp=0000000000000000000000000000000000000000;hpb=5f600e9c0d22c09bd60ef3c7245dbecc8d35d576;p=ipdf%2Fcode.git diff --git a/src/debugscript.h b/src/debugscript.h new file mode 100644 index 0000000..822819a --- /dev/null +++ b/src/debugscript.h @@ -0,0 +1,52 @@ +#ifndef _DEBUGSCRIPT_H +#define _DEBUGSCRIPT_H + +#include "real.h" +#include "view.h" +#include "screen.h" +#include +#include + +namespace IPDF +{ + +class DebugScript +{ +public: + void Load(const char *filename) + { + inp.open(filename); + } + bool Execute(View *view, Screen *scr); +private: + enum ActionType + { + AT_WaitFrame, + AT_Translate, + AT_Zoom, + AT_TranslatePx, + AT_ZoomPx, + AT_Quit + }; + + struct Action + { + ActionType type; + Real x, y; + int ix, iy; + Real z; + int iz; + int loops; + Action() : type(AT_WaitFrame), x(0), y(0), ix(0), iy(0), z(0), loops(0) {} + }; + + std::ifstream inp; + + Action currentAction; + + void ParseAction(); +}; + +} + +#endif