summaryrefslogtreecommitdiff
path: root/ZAPD/OutputFormatter.h
diff options
context:
space:
mode:
authorfig02 <fig02srl@gmail.com>2021-03-12 15:51:39 -0500
committerGitHub <noreply@github.com>2021-03-12 15:51:39 -0500
commit55718b1090083e1f5e9b1b1cc09ebcb329baa74f (patch)
treeae890ccd6bfeded507518d227a0002f8fc136bcf /ZAPD/OutputFormatter.h
parent1e67767cf988af08e79d8cea4ee1e4d47658fe29 (diff)
Use libgfxd (gfxdis) for display lists (#84)
* start * dlists work * progress * vtx works * texture wip * debugging * palletes sorta working * pal issue sort of fixed * progress * fiix * switching to master * progress * OK * fixes * whitespace * libgfxd update * prep for merge * use new seg2filespace function * vtx
Diffstat (limited to 'ZAPD/OutputFormatter.h')
-rw-r--r--ZAPD/OutputFormatter.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/ZAPD/OutputFormatter.h b/ZAPD/OutputFormatter.h
new file mode 100644
index 0000000..d1cdc68
--- /dev/null
+++ b/ZAPD/OutputFormatter.h
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <vector>
+#include <map>
+#include <string>
+
+class OutputFormatter
+{
+private:
+ const int tab_size;
+ const int default_indent;
+ const int line_limit;
+
+ int col;
+ int nest;
+ int nest_indent[8];
+ int current_indent;
+
+ char word[128];
+ char space[128];
+ char *word_p;
+ char *space_p;
+
+ std::string str;
+
+ int write(const char *buf, int count);
+
+ static OutputFormatter *static_instance;
+ static int write_static(const char *buf, int count);
+
+public:
+ OutputFormatter(int tab_size = 4, int default_indent = 4,
+ int line_limit = 120);
+
+ int (*static_writer())(const char *buf, int count);
+
+ std::string get_output();
+}; \ No newline at end of file