Browse Source

Merge branch 'master' into piaf_integration

Eiyeron Fulmincendii 10 years ago
parent
commit
864eab2113

+ 3 - 0
.gitmodules

@@ -1,3 +1,6 @@
 [submodule "external/tinystl"]
 	path = external/tinystl
 	url = git://github.com/mendsley/tinystl.git
+[submodule "external/lodepng"]
+	path = external/platform/nspire/lodepng
+	url = https://github.com/lvandeve/lodepng.git

+ 1 - 0
external/platform/nspire/lodepng

@@ -0,0 +1 @@
+Subproject commit 9f3acec682697642ebccdf8659c8b53bf05001f1

+ 8 - 0
external/platform/nspire/rules.mk

@@ -0,0 +1,8 @@
+external_LOCAL_PATH := $(call whereami)
+
+CPPFLAGS += -DLODEPNG_NO_COMPILE_CPP
+
+INCLUDE_EXT += $(external_LOCAL_PATH)/lodepng
+
+SRCS_CPP += $(external_LOCAL_PATH)/lodepng/lodepng.cpp
+

+ 0 - 0
external/platform/sfml/rules.mk


+ 1 - 0
external/rules.mk

@@ -3,3 +3,4 @@ external_LOCAL_PATH := $(call whereami)
 include $(wildcard $(external_LOCAL_PATH)/*/rules.mk)
 
 INCLUDE_EXT += $(external_LOCAL_PATH)/tinystl/include
+

+ 1 - 0
mkconfig

@@ -6,6 +6,7 @@ create_configuration() {
 	echo "Creating $1 configuration"
 	rm config.mk -f
 	echo "include platform/$1/rules.mk" >> config.mk
+	echo "include external/platform/$1/rules.mk" >> config.mk
 }
 
 is_valid_target() {

+ 4 - 0
platform/nspire/CXfb.cpp

@@ -2,6 +2,7 @@
 #include <cstring>
 #include "CXfb.h"
 #include "utility/misc.h"
+#include "utility/minmax.h"
 
 #define GRAPHICS Nspire::CXfb
 
@@ -22,6 +23,9 @@ bool buffer_swap_ready;
  * Buffer management
  */
 
+#define min(a, b) (((a) < (b)) ? (a) : (b))
+#define max(a, b) (((a) > (b)) ? (a) : (b))
+
 void GRAPHICS::buffer_allocate()
 {
     buffer_screen = (uint16_t *) malloc(BUFFER_SIZE);

+ 1 - 0
platform/nspire/Graphics.cpp

@@ -2,6 +2,7 @@
 #include "CXfb.h"
 #include "stdio.h"
 #include "utility/misc.h"
+#include "utility/minmax.h"
 
 using namespace Nspire;
 using namespace WalrusRPG;

+ 10 - 0
src/utility/minmax.h

@@ -0,0 +1,10 @@
+#ifndef INCLUDE_MIMAX_H
+
+#ifndef min
+#define min(a, b) (((a) < (b)) ? (a) : (b))
+#endif
+#ifndef max
+#define max(a, b) (((a) > (b)) ? (a) : (b))
+#endif
+
+#endif

+ 0 - 2
src/utility/misc.h

@@ -6,8 +6,6 @@
 #define UNUSED(expr) (void)(expr)
 
 #define abs(x) ((x) < 0 ? -(x) : (x))
-#define min(a, b) (((a) < (b)) ? (a) : (b))
-#define max(a, b) (((a) > (b)) ? (a) : (b))
 
 #define in_range(x, a, b) (((x) >= (a)) && ((x) < (b)))