Commits

Sylvain Rouquette committed bd13d33

reverted main to pack and text example

  • Participants
  • Parent commits 4a521cb
  • Branches input

Comments (0)

Files changed (2)

File game/game/main_win32.cpp

 #include <windows.h>
 
 #include "common/log.h"
+#include "text/string.h"
+#include "text/pack.h"
+#include "text/language.h"
 
-#include "common/intrusive_list.h"
-class Test {
-public:
-    Test(int value) : value_(value) {}
+#include "texts/test.h"
 
-    int value_;
-    common::ListNode    node_;
-};
 
 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
     LPSTR lpCmdLine, int nCmdShow)
 #endif
     LOG("starting game...\n");
 
-    Test* test[10];
-    for (int i = 0; i < 10; ++i)
-        test[i] = new Test(i);
+    using namespace ::text;
+    Language* language = new Language();
+    language->open("assets/common/texts/test.csv", "fr");
+    String* str = language->create_string(TEXT_TEST_TITLE);
+    str->print();
+    delete str;
+    delete language;
 
-    common::List<Test>* list = new INTRUSIVE_LIST(Test, node_);
-
-    for (int i = 0; i < 10; ++i)
-        list->push_back(test[i]);
-
-    delete test[5]; test[5] = 0;
-    delete test[8]; test[8] = 0;
-
-    Test* current = list->first();
-    if (current)
-    do {
-        if (current)
-            LOG("%X : %d\n", current, current->value_);
-    } while (current = list->next(current));
-
-    for (int i = 0; i < 10; ++i)
-        if (test[i])
-            delete test[i];
-    delete list;
 
 #if defined(DEBUG)
     common::Log::clear();

File game/tools/compilers/csv_text.py

 
 
 def _include_filename(filename):
-    return '%(sep)sres%(sep)sinc%(sep)stexts%(sep)s%(name)s.h' % {
+    return '%(sep)sassets%(sep)sinc%(sep)stexts%(sep)s%(name)s.h' % {
         'name': filename.split('.')[0],
         'sep': os.sep}