diff --git a/src/base/cyoa.h b/src/base/cyoa.h index d2874d7..5fecb5c 100644 --- a/src/base/cyoa.h +++ b/src/base/cyoa.h @@ -7,6 +7,7 @@ #define STATCHECK_GT 1 #define STATCHECK_LT 2 +namespace storybook { struct statcheck_t { char *stat; int value; @@ -57,6 +58,7 @@ struct Page { }; std::vector CyoaParse(FILE *); +} #endif /* CYOA_H */ diff --git a/src/base/cyoa.leg b/src/base/cyoa.leg index 6187b41..d05fcea 100644 --- a/src/base/cyoa.leg +++ b/src/base/cyoa.leg @@ -5,6 +5,8 @@ #include #include "cyoa.h" +using namespace storybook; + FILE* yyin = stdin; #define YY_INPUT(buf, result, max_size) { \ @@ -153,7 +155,7 @@ void append_body(Page *page, char *str) { } } -std::vector CyoaParse(FILE *file) { +std::vector storybook::CyoaParse(FILE *file) { yyin = file; yyparse(); yyin = stdin; diff --git a/src/base/storybook.cpp b/src/base/storybook.cpp index a2cf42a..f736b8d 100644 --- a/src/base/storybook.cpp +++ b/src/base/storybook.cpp @@ -4,6 +4,8 @@ #include "storybook.h" +using namespace storybook; + Storybook::Storybook() { // TODO } diff --git a/src/base/storybook.h b/src/base/storybook.h index 73cf681..2119665 100644 --- a/src/base/storybook.h +++ b/src/base/storybook.h @@ -7,6 +7,8 @@ #include #include "cyoa.h" +namespace storybook { + class Storybook { private: std::vector pages; @@ -39,5 +41,5 @@ public: } }; }; - +} #endif /* STORYBOOK_H */ diff --git a/src/cli/storybook_cli.cpp b/src/cli/storybook_cli.cpp index 2651fad..77c0769 100644 --- a/src/cli/storybook_cli.cpp +++ b/src/cli/storybook_cli.cpp @@ -18,7 +18,7 @@ int main(int argc, const char *argv[]) { fprintf(stderr, "Error: could not read %s", argv[1]); return 2; } - Storybook sb(fin); + storybook::Storybook sb(fin); fclose(fin); sb.Find("START"); diff --git a/src/godot/.gitignore b/src/godot/.gitignore index c0b5f3e..ff568d5 100644 --- a/src/godot/.gitignore +++ b/src/godot/.gitignore @@ -1,2 +1,3 @@ .sconsign.dblite -bin/ \ No newline at end of file +bin/ +*.os \ No newline at end of file diff --git a/src/godot/SConstruct b/src/godot/SConstruct index 10d97e1..8def9a2 100644 --- a/src/godot/SConstruct +++ b/src/godot/SConstruct @@ -12,7 +12,7 @@ opts.Add(EnumVariable('platform', "Compilation platform", '', ['', 'windows', 'x opts.Add(EnumVariable('p', "Compilation target, alias for 'platform'", '', ['', 'windows', 'x11', 'linux', 'osx'])) opts.Add(BoolVariable('use_llvm', "Use the LLVM / Clang compiler", 'no')) opts.Add(PathVariable('target_path', 'The path where the lib is installed.', 'bin/')) -opts.Add(PathVariable('target_name', 'The library name.', 'libgdexample', PathVariable.PathAccept)) +opts.Add(PathVariable('target_name', 'The library name.', 'libgdstorybook', PathVariable.PathAccept)) # Local dependency paths, adapt them to your setup godot_headers_path = "godot-cpp/godot-headers/" diff --git a/src/godot/src/gdlibrary.cpp b/src/godot/src/gdlibrary.cpp index c7bde96..de232b4 100644 --- a/src/godot/src/gdlibrary.cpp +++ b/src/godot/src/gdlibrary.cpp @@ -12,5 +12,5 @@ extern "C" void GDN_EXPORT godot_gdnative_terminate(godot_gdnative_terminate_opt extern "C" void GDN_EXPORT godot_nativescript_init(void *handle) { godot::Godot::nativescript_init(handle); - godot::register_class(); + godot::register_class(); } diff --git a/src/godot/src/gdlibrary.os b/src/godot/src/gdlibrary.os deleted file mode 100644 index 0f74e7b..0000000 Binary files a/src/godot/src/gdlibrary.os and /dev/null differ diff --git a/src/godot/src/storybook_godot.cpp b/src/godot/src/storybook_godot.cpp index 09eeb43..8ab3dbe 100644 --- a/src/godot/src/storybook_godot.cpp +++ b/src/godot/src/storybook_godot.cpp @@ -2,12 +2,12 @@ using namespace godot; -void Story::_register_methods() { +void Storybook::_register_methods() { // TODO // e.g. register_method("_process", &Story::_process); } -Story::Story(){} -Story::~Story(){} +Storybook::Storybook(){} +Storybook::~Storybook(){} diff --git a/src/godot/src/storybook_godot.h b/src/godot/src/storybook_godot.h index c664049..04b1b95 100644 --- a/src/godot/src/storybook_godot.h +++ b/src/godot/src/storybook_godot.h @@ -7,14 +7,14 @@ #include namespace godot { - class Story : public Node { - GODOT_CLASS(Story, Node) + class Storybook : public Node { + GODOT_CLASS(Storybook, Node) private: - Storybook storybook; + storybook::Storybook storybook; public: static void _register_methods(); - Story(); - ~Story(); + Storybook(); + ~Storybook(); void _init(); }; diff --git a/src/godot/src/storybook_godot.os b/src/godot/src/storybook_godot.os deleted file mode 100644 index 98c1dd3..0000000 Binary files a/src/godot/src/storybook_godot.os and /dev/null differ