Eiyeron Fulmincendii 9 år sedan
förälder
incheckning
c6d3ffe86d
5 ändrade filer med 9 tillägg och 10 borttagningar
  1. 1 1
      platform/nspire/rules.mk
  2. 1 1
      platform/sfml/rules.mk
  3. 2 2
      src/input/Input.cpp
  4. 0 1
      src/map/StateMap.cpp
  5. 5 5
      src/piaf/Archive.cpp

+ 1 - 1
platform/nspire/rules.mk

@@ -4,7 +4,7 @@ SRCS_C += $(wildcard $(nspire_LOCAL_PATH)/platform/*.c)
 SRCS_CPP += $(wildcard $(nspire_LOCAL_PATH)/*.cpp)
 INCLUDE += $(nspire_LOCAL_PATH)/public
 
-CFLAGS_COMMON += -marm -DNSPIRE=1
+CFLAGS_COMMON += -marm -DTARGET_NSPIRE=TRUE
 YCM_EXTRA_CFLAGS := -m32 -I$(NDLESS_GIT)/ndless-sdk/include -I$(HOME)/.ndless/include
 
 CC = nspire-gcc

+ 1 - 1
platform/sfml/rules.mk

@@ -6,7 +6,7 @@ INCLUDE += $(sfml_LOCAL_PATH)/public
 
 LDFLAGS += -lstdc++ -lsfml-window -lsfml-graphics -lsfml-system
 
-CFLAGS_COMMON += -DSFML=1
+CFLAGS_COMMON += -DTARGET_SFML=TRUE
 
 CC = clang
 CPP = clang++

+ 2 - 2
src/input/Input.cpp

@@ -20,7 +20,7 @@ struct KeyBuffer
 struct KeyBuffer key_states[Key::K_SIZE] = {{false, false}};
 
 // TODO: make these software-mappable
-#ifdef SFML
+#ifdef TARGET_SFML
 using sf::Keyboard;
 InputMap key_map[] = {
     {Key::K_A, Keyboard::W},          {Key::K_B, Keyboard::X},
@@ -32,7 +32,7 @@ InputMap key_map[] = {
     {Key::K_START, Keyboard::Return}, {Key::K_SELECT, Keyboard::BackSpace},
 };
 #endif
-#ifdef NSPIRE
+#ifdef TARGET_NSPIRE
 static InputMap key_map[] = {
     {Key::K_A, KEY_NSPIRE_CTRL},    {Key::K_B, KEY_NSPIRE_SHIFT},
     {Key::K_L, KEY_NSPIRE_TAB},     {Key::K_R, KEY_NSPIRE_MENU},

+ 0 - 1
src/map/StateMap.cpp

@@ -3,7 +3,6 @@
 #include "render/Text.h"
 #include "piaf/Archive.h"
 
-
 using WalrusRPG::States::StateMap;
 using namespace WalrusRPG;
 using namespace WalrusRPG::Graphics;

+ 5 - 5
src/piaf/Archive.cpp

@@ -17,7 +17,7 @@ using WalrusRPG::PIAF::FileType;
 using WalrusRPG::PIAF::CompressionType;
 using namespace WalrusRPG::PIAF;
 
-#if NSPIRE
+#if TARGET_NSPIRE
 using namespace Nspire;
 #endif
 namespace
@@ -67,7 +67,7 @@ Archive::Archive(string &filepath) : Archive(filepath.c_str())
 Archive::Archive(const char *filepath)
     : file(nullptr), entries(nullptr), files_data(nullptr), files_loaded(nullptr)
 {
-#if NSPIRE
+#if TARGET_NSPIRE
     Interrupts::off();
 #endif
     // Null pointer exception trigger
@@ -189,7 +189,7 @@ Archive::Archive(const char *filepath)
         load_file_table(entries, files_data_offset, file_entry_data, nb_files);
         delete[] file_entry_data;
     }
-#if NSPIRE
+#if TARGET_NSPIRE
     Interrupts::init();
 #endif
 }
@@ -236,7 +236,7 @@ File Archive::get(const char *filename)
             // On demand load
             if (!files_loaded[index])
             {
-#if NSPIRE
+#if TARGET_NSPIRE
                 Interrupts::off();
 #endif
                 uint8_t *data = new uint8_t[entries[index].file_size];
@@ -253,7 +253,7 @@ File Archive::get(const char *filename)
                     entries[index].data = data;
                 }
                 files_loaded[index] = true;
-#if NSPIRE
+#if TARGET_NSPIRE
                 Interrupts::init();
 #endif
             }