shithub: cstory

Download patch

ref: b325efd981a809493682dceacd519a6be3c4b3bb
parent: 414fe76abcd02818dbf7e8540d256bef3f5db575
author: Clownacy <Clownacy@users.noreply.github.com>
date: Fri Jan 25 07:01:18 EST 2019

Improved Japanese build a little

--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,20 @@
 RELEASE = 0
 
+ifeq ($(RELEASE), 0)
+CXXFLAGS := -O0 -g -static -mconsole
+FILENAME := debug
+else
+CXXFLAGS := -O3 -s -static
+FILENAME := release
+endif
+
 ifeq ($(JAPANESE), 1)
+CXXFLAGS += -DJAPANESE
 	ifeq ($(RELEASE), 0)
-	CXXFLAGS := -DJAPANESE -O0 -g -static -mconsole
 	FILENAME := debugjp
 	else
-	CXXFLAGS := -DJAPANESE -O3 -s -static
 	FILENAME := releasejp
 	endif
-
-else
-	ifeq ($(RELEASE), 0)
-	CXXFLAGS := -O0 -g -static -mconsole
-	FILENAME := debug
-	else
-	CXXFLAGS := -O3 -s -static
-	FILENAME := release
-	endif
 endif
 
 ifeq ($(FIX_BUGS), 1)
@@ -76,8 +74,6 @@
 	BITMAP/CREDIT16.bmp \
 	BITMAP/CREDIT17.bmp \
 	BITMAP/CREDIT18.bmp \
-	BITMAP/PIXEL.bmp \
-	BITMAP/PIXEL_JP.bmp \
 	ICON/4.bmp \
 	ORG/ACCESS \
 	ORG/ANZEN \
@@ -122,6 +118,12 @@
 	ORG/XXXX \
 	ORG/ZONBIE \
 	WAVE/WAVE100
+
+ifeq ($(JAPANESE), 1)
+	RESOURCES += BITMAP/PIXEL_JP.bmp
+else
+	RESOURCES += BITMAP/PIXEL.bmp
+endif
 
 OBJECTS = $(addprefix obj/$(FILENAME)/, $(addsuffix .o, $(SOURCES)))
 
--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -4,7 +4,9 @@
 #include <stddef.h>
 #include <stdlib.h>
 
+#ifdef JAPANESE
 #include <iconv.h>
+#endif
 
 #include <ft2build.h>
 #include FT_FREETYPE_H
--- a/src/GenericLoad.cpp
+++ b/src/GenericLoad.cpp
@@ -3,11 +3,7 @@
 
 bool LoadGenericData()
 {
-#ifdef JAPANESE
-	MakeSurface_Resource("PIXEL_JP", 1);
-#else
 	MakeSurface_Resource("PIXEL", 1);
-#endif
 	
 	bool bError = false;
 	if (!MakeSurface_File("MyChar", 16))
--- a/src/Resource.cpp
+++ b/src/Resource.cpp
@@ -64,8 +64,11 @@
 #include "Resource/BITMAP/CREDIT16.bmp.h"
 #include "Resource/BITMAP/CREDIT17.bmp.h"
 #include "Resource/BITMAP/CREDIT18.bmp.h"
-#include "Resource/BITMAP/PIXEL.bmp.h"
+#ifdef JAPANESE
 #include "Resource/BITMAP/PIXEL_JP.bmp.h"
+#else
+#include "Resource/BITMAP/PIXEL.bmp.h"
+#endif
 #include "Resource/ICON/4.bmp.h"
 
 const unsigned char* GetResource(const char *name, size_t *size)
@@ -377,13 +380,13 @@
 	}
 	if (!strcmp(name, "PIXEL"))
 	{
-		*size = sizeof(rPIXEL);
-		return rPIXEL;
-	}
-	if (!strcmp(name, "PIXEL_JP"))
-	{
+#ifdef JAPANESE
 		*size = sizeof(rPIXEL_JP);
 		return rPIXEL_JP;
+#else
+		*size = sizeof(rPIXEL);
+		return rPIXEL;
+#endif
 	}
 	
 	//ICON