Lazy + CPU/GPU rendering toggle in script.
[ipdf/code.git] / src / debugscript.h
1 #ifndef _DEBUGSCRIPT_H
2 #define _DEBUGSCRIPT_H
3
4 #include "real.h"
5 #include "view.h"
6 #include "screen.h"
7 #include <iostream>
8 #include <fstream>
9
10 namespace IPDF
11 {
12
13 class DebugScript
14 {
15 public:
16         void Load(const char *filename)
17         {
18                 inp.open(filename);
19         }
20         bool Execute(View *view, Screen *scr);
21 private:
22         enum ActionType
23         {
24                 AT_WaitFrame,
25                 AT_Translate,
26                 AT_Zoom,
27                 AT_TranslatePx,
28                 AT_ZoomPx,
29                 AT_SetCPURendering,
30                 AT_SetGPURendering,
31                 AT_EnableLazyRendering,
32                 AT_DisableLazyRendering,
33                 AT_Quit
34         };
35
36         struct Action
37         {
38                 ActionType type;
39                 Real x, y;
40                 int ix, iy;
41                 Real z;
42                 int iz;
43                 int loops;
44                 Action() : type(AT_WaitFrame), x(0), y(0), ix(0), iy(0), z(0), loops(0) {}
45         };
46
47         std::ifstream inp;
48
49         Action currentAction;
50
51         void ParseAction();
52 };
53
54 }
55
56 #endif

UCC git Repository :: git.ucc.asn.au