Browse Source

make code of native_midi around within platform_specific macro; android gradle file specify main folder to avoid build problems; add UTIL_MsgBox for debug purpose

Pal Lockheart 7 years ago
parent
commit
b73c2023e8
7 changed files with 32 additions and 3 deletions
  1. 4 0
      android/app/build.gradle
  2. 5 0
      native_midi/native_midi_macosx.c
  3. 5 0
      native_midi/native_midi_win32.c
  4. 11 1
      util.c
  5. 5 0
      util.h
  6. 1 1
      win32/Makefile
  7. 1 1
      win32/Makefile.mingw

+ 4 - 0
android/app/build.gradle

@@ -27,4 +27,8 @@ android {
             path '../jni/Android.mk'
         }
     }
+
+    sourceSets {
+        main.java.srcDirs += 'src/main/java'
+    }
 }

+ 5 - 0
native_midi/native_midi_macosx.c

@@ -20,6 +20,8 @@
     icculus@icculus.org
 */
 
+#ifdef __APPLE__
+
 /* This is Mac OS X only, using Core MIDI.
    Mac OS 9 support via QuickTime is in native_midi_mac.c */
 
@@ -310,3 +312,6 @@ const char *native_midi_error(void)
 {
     return "";  /* !!! FIXME */
 }
+
+#endif
+

+ 5 - 0
native_midi/native_midi_win32.c

@@ -20,6 +20,8 @@
     florian.proff.schulze@gmx.net
 */
 
+#ifdef __WIN32__
+
 #include "SDL.h"
 
 /* everything below is currently one very big bad hack ;) Proff */
@@ -315,3 +317,6 @@ const char *native_midi_error(void)
 {
   return "";
 }
+
+#endif
+

+ 11 - 1
util.c

@@ -34,6 +34,16 @@
 #include "SDL_messagebox.h"
 #endif
 
+void UTIL_MsgBox(char *string){
+    extern SDL_Window *gpWindow;
+    char buffer[300];
+    SDL_MessageBoxButtonData buttons[] = { { 0, 0, "OK" } };
+    SDL_MessageBoxData mbd = { SDL_MESSAGEBOX_WARNING, gpWindow, "Alert",buffer, 1, buttons, NULL };
+    int btnid;
+    sprintf(buffer, "%s\n", string);
+    SDL_ShowMessageBox(&mbd, &btnid);
+}
+
 long
 flength(
    FILE *fp
@@ -488,7 +498,7 @@ UTIL_OpenFileForMode(
 	else
 		fp = fopen(va("%s%s", gConfig.pszGamePath, lpszFileName), szMode);
 
-#if !defined(PAL_FILESYSTEM_IGNORE_CASE)
+#if !defined(PAL_FILESYSTEM_IGNORE_CASE) || !PAL_FILESYSTEM_IGNORE_CASE
 	if (fp == NULL)
 	{
 		//

+ 5 - 0
util.h

@@ -32,6 +32,11 @@ extern "C"
 {
 #endif
 
+void
+UTIL_MsgBox(
+   char *string
+);
+
 long
 flength(
    FILE *fp

+ 1 - 1
win32/Makefile

@@ -8,7 +8,7 @@ TEST_CCFLAGS =
 
 GTEST_DIR = ../3rd/googletest/googletest
 
-CFILES = $(wildcard ../adplug/*.c) $(wildcard ../libmad/*.c) $(wildcard ../liboggvorbis/src/*.c) $(wildcard ../*.c) ../native_midi/native_midi_win32.c ../native_midi/native_midi_common.c
+CFILES = $(wildcard ../adplug/*.c) $(wildcard ../libmad/*.c) $(wildcard ../liboggvorbis/src/*.c) $(wildcard ../*.c) $(wildcard ../native_midi/*.c)
 CPPFILES = $(wildcard ../adplug/*.cpp) $(wildcard ../*.cpp) $(wildcard ./*.cpp)
 RCFILES = $(wildcard ./sdlpal.rc)
 OBJFILES = $(CFILES:.c=.o) $(CPPFILES:.cpp=.o) $(RCFILES:.rc=.o)

+ 1 - 1
win32/Makefile.mingw

@@ -8,7 +8,7 @@ TEST_CCFLAGS =
 
 GTEST_DIR = ../3rd/googletest/googletest
 
-CFILES = $(wildcard ../adplug/*.c) $(wildcard ../libmad/*.c) $(wildcard ../liboggvorbis/src/*.c) $(wildcard ../*.c) ../native_midi/native_midi_win32.c ../native_midi/native_midi_common.c
+CFILES = $(wildcard ../adplug/*.c) $(wildcard ../libmad/*.c) $(wildcard ../liboggvorbis/src/*.c) $(wildcard ../*.c) $(wildcard ../native_midi/*.c)
 CPPFILES = $(wildcard ../adplug/*.cpp) $(wildcard ../*.cpp) $(wildcard ./*.cpp)
 RCFILES = $(wildcard ./sdlpal.rc)
 OBJFILES = $(CFILES:.c=.o) $(CPPFILES:.cpp=.o) $(RCFILES:.rc=.o)