From 55718b1090083e1f5e9b1b1cc09ebcb329baa74f Mon Sep 17 00:00:00 2001 From: fig02 Date: Fri, 12 Mar 2021 15:51:39 -0500 Subject: 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 --- ZAPD/OutputFormatter.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 ZAPD/OutputFormatter.h (limited to 'ZAPD/OutputFormatter.h') 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 +#include +#include + +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 -- cgit v1.2.3