diff options
| author | Ahmad Fatoum <[email protected]> | 2018-03-16 21:31:10 +0100 |
|---|---|---|
| committer | Ahmad Fatoum <[email protected]> | 2018-03-16 21:37:22 +0100 |
| commit | 2c219fb81458b855c9383cd38885993192d856cd (patch) | |
| tree | 66c87e91fc6395500acde4a995e9a9d3293ce272 /games | |
| parent | 61e0e4b4f37cc66135445bc87af7c92399fa69ee (diff) | |
| download | raylib-2c219fb81458b855c9383cd38885993192d856cd.tar.gz raylib-2c219fb81458b855c9383cd38885993192d856cd.zip | |
Allow use of main instead of android_main
Inspired by #504.
Instead of requiring the user to do PLATFORM_ANDROID #ifdefery,
have the android_main entry point exported by raylib and call
the user-defined main. This way many games could (in theory)
run unmodified on Android and elsewhere.
This is untested!
Diffstat (limited to 'games')
| -rw-r--r-- | games/arkanoid.c | 19 | ||||
| -rw-r--r-- | games/asteroids.c | 19 | ||||
| -rw-r--r-- | games/asteroids_survival.c | 19 | ||||
| -rw-r--r-- | games/floppy.c | 17 | ||||
| -rw-r--r-- | games/gold_fever.c | 19 | ||||
| -rw-r--r-- | games/gorilas.c | 19 | ||||
| -rw-r--r-- | games/just_do/just_do.c | 19 | ||||
| -rw-r--r-- | games/koala_seasons/koala_seasons.c | 21 | ||||
| -rw-r--r-- | games/light_my_ritual/light_my_ritual.c | 17 | ||||
| -rw-r--r-- | games/missile_commander.c | 19 | ||||
| -rw-r--r-- | games/pang.c | 19 | ||||
| -rw-r--r-- | games/skully_escape/skully_escape.c | 17 | ||||
| -rw-r--r-- | games/snake.c | 19 | ||||
| -rw-r--r-- | games/space_invaders.c | 19 | ||||
| -rw-r--r-- | games/tetris.c | 19 | ||||
| -rw-r--r-- | games/transmission/transmission.c | 20 | ||||
| -rw-r--r-- | games/wave_collector/wave_collector.c | 18 |
17 files changed, 52 insertions, 267 deletions
diff --git a/games/arkanoid.c b/games/arkanoid.c index 1da80a1e..2a4a2e53 100644 --- a/games/arkanoid.c +++ b/games/arkanoid.c @@ -18,10 +18,6 @@ #include <time.h> #include <math.h> -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -83,19 +79,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame) //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { - // Initialization + // Initialization (Note windowTitle is unused on Android) //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else InitWindow(screenWidth, screenHeight, "sample game: arkanoid"); -#endif InitGame(); @@ -122,9 +110,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } //------------------------------------------------------------------------------------ @@ -338,4 +325,4 @@ void UpdateDrawFrame(void) { UpdateGame(); DrawGame(); -}
\ No newline at end of file +} diff --git a/games/asteroids.c b/games/asteroids.c index dc8a9e07..80096de6 100644 --- a/games/asteroids.c +++ b/games/asteroids.c @@ -15,10 +15,6 @@ #include <math.h> -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -101,19 +97,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame) //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { - // Initialization + // Initialization (Note windowTitle is unused on Android) //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else InitWindow(screenWidth, screenHeight, "sample game: asteroids"); -#endif InitGame(); @@ -140,9 +128,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } //------------------------------------------------------------------------------------ @@ -578,4 +565,4 @@ void UpdateDrawFrame(void) { UpdateGame(); DrawGame(); -}
\ No newline at end of file +} diff --git a/games/asteroids_survival.c b/games/asteroids_survival.c index 12759606..8086433e 100644 --- a/games/asteroids_survival.c +++ b/games/asteroids_survival.c @@ -15,10 +15,6 @@ #include <math.h> -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -84,19 +80,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame) //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { - // Initialization + // Initialization (Note windowTitle is unused on Android) //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else InitWindow(screenWidth, screenHeight, "sample game: asteroids survival"); -#endif InitGame(); @@ -123,9 +111,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } //------------------------------------------------------------------------------------ @@ -388,4 +375,4 @@ void UpdateDrawFrame(void) { UpdateGame(); DrawGame(); -}
\ No newline at end of file +} diff --git a/games/floppy.c b/games/floppy.c index d7c4f129..2ca91a14 100644 --- a/games/floppy.c +++ b/games/floppy.c @@ -13,10 +13,6 @@ #include "raylib.h" -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -72,19 +68,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame) //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { // Initialization //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else InitWindow(screenWidth, screenHeight, "sample game: floppy"); -#endif InitGame(); @@ -111,9 +99,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } //------------------------------------------------------------------------------------ // Module Functions Definitions (local) @@ -250,4 +237,4 @@ void UpdateDrawFrame(void) { UpdateGame(); DrawGame(); -}
\ No newline at end of file +} diff --git a/games/gold_fever.c b/games/gold_fever.c index 1d8b6b7c..c5f36efa 100644 --- a/games/gold_fever.c +++ b/games/gold_fever.c @@ -13,10 +13,6 @@ #include "raylib.h" -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -81,19 +77,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame) //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { - // Initialization + // Initialization (Note windowTitle is unused on Android) //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else InitWindow(screenWidth, screenHeight, "sample game: gold fever"); -#endif InitGame(); @@ -120,9 +108,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } //------------------------------------------------------------------------------------ @@ -291,4 +278,4 @@ void UpdateDrawFrame(void) { UpdateGame(); DrawGame(); -}
\ No newline at end of file +} diff --git a/games/gorilas.c b/games/gorilas.c index 75decd96..9ef71b55 100644 --- a/games/gorilas.c +++ b/games/gorilas.c @@ -18,10 +18,6 @@ #include <time.h> #include <math.h> -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -120,19 +116,11 @@ static bool UpdateBall(int playerTurn); //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { - // Initialization + // Initialization (Note windowTitle is unused on Android) //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else InitWindow(screenWidth, screenHeight, "sample game: gorilas"); -#endif InitGame(); @@ -159,9 +147,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } //------------------------------------------------------------------------------------ @@ -576,4 +563,4 @@ static bool UpdateBall(int playerTurn) } return false; -}
\ No newline at end of file +} diff --git a/games/just_do/just_do.c b/games/just_do/just_do.c index a9fef18c..c7c76af9 100644 --- a/games/just_do/just_do.c +++ b/games/just_do/just_do.c @@ -16,10 +16,6 @@ #include "raylib.h" #include "screens/screens.h" // NOTE: Defines currentScreen -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -53,19 +49,11 @@ void UpdateDrawFrame(void); // Update and Draw one frame //---------------------------------------------------------------------------------- // Main entry point //---------------------------------------------------------------------------------- -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { - // Initialization + // Initialization (Note windowTitle is unused on Android) //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else InitWindow(screenWidth, screenHeight, "GGJ15 - JUST DO"); -#endif // Load global data here (assets that must be available in all screens, i.e. fonts) InitAudioDevice(); @@ -104,9 +92,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } //---------------------------------------------------------------------------------- @@ -370,4 +357,4 @@ void UpdateDrawFrame(void) EndDrawing(); //---------------------------------------------------------------------------------- -}
\ No newline at end of file +} diff --git a/games/koala_seasons/koala_seasons.c b/games/koala_seasons/koala_seasons.c index 770cf3de..8657d3d5 100644 --- a/games/koala_seasons/koala_seasons.c +++ b/games/koala_seasons/koala_seasons.c @@ -15,10 +15,6 @@ #include "raylib.h" #include "screens/screens.h" // NOTE: Defines currentScreen -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -47,12 +43,7 @@ void UpdateDrawFrame(void); // Update and Draw one frame //---------------------------------------------------------------------------------- // Main entry point //---------------------------------------------------------------------------------- -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else -int main(void) -#endif -{ +int main(void) { // Initialization //--------------------------------------------------------- const int screenWidth = 1280; @@ -62,11 +53,8 @@ int main(void) //ShowLogo(); //SetConfigFlags(FLAG_FULLSCREEN_MODE); -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else + // Note that windowTitle is ignored on Android InitWindow(screenWidth, screenHeight, windowTitle); -#endif // Load global data here (assets that must be available in all screens, i.e. fonts) font = LoadSpriteFont("resources/graphics/mainfont.png"); @@ -145,9 +133,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } void TransitionToScreen(int screen) @@ -282,4 +269,4 @@ void UpdateDrawFrame(void) EndDrawing(); //---------------------------------------------------------------------------------- -}
\ No newline at end of file +} diff --git a/games/light_my_ritual/light_my_ritual.c b/games/light_my_ritual/light_my_ritual.c index bc5a4623..985baa04 100644 --- a/games/light_my_ritual/light_my_ritual.c +++ b/games/light_my_ritual/light_my_ritual.c @@ -19,10 +19,6 @@ #include <stdlib.h> -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -55,19 +51,11 @@ void UpdateDrawFrame(void); // Update and Draw one frame //---------------------------------------------------------------------------------- // Main entry point //---------------------------------------------------------------------------------- -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { - // Initialization + // Initialization (Note windowTitle is unused on Android) //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else InitWindow(screenWidth, screenHeight, "GGJ16 - LIGHT MY RITUAL!"); -#endif // Global data loading (assets that must be available in all screens, i.e. fonts) InitAudioDevice(); @@ -129,9 +117,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } void TransitionToScreen(int screen) diff --git a/games/missile_commander.c b/games/missile_commander.c index 245cefd1..15e06f6d 100644 --- a/games/missile_commander.c +++ b/games/missile_commander.c @@ -18,10 +18,6 @@ #include <time.h> #include <math.h> -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -119,19 +115,11 @@ static void UpdateIncomingFire(); //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { - // Initialization + // Initialization (Note windowTitle is unused on Android) //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else InitWindow(screenWidth, screenHeight, "sample game: missile commander"); -#endif InitGame(); @@ -158,9 +146,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } //-------------------------------------------------------------------------------------- @@ -544,4 +531,4 @@ static void UpdateIncomingFire() missileIndex++; if (missileIndex == MAX_MISSILES) missileIndex = 0; } -}
\ No newline at end of file +} diff --git a/games/pang.c b/games/pang.c index 731234ae..a81f32f0 100644 --- a/games/pang.c +++ b/games/pang.c @@ -15,10 +15,6 @@ #include <math.h> -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -110,19 +106,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame) //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { - // Initialization + // Initialization (Note windowTitle is unused on Android) //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else InitWindow(screenWidth, screenHeight, "sample game: pang"); -#endif InitGame(); @@ -149,9 +137,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } //------------------------------------------------------------------------------------ @@ -637,4 +624,4 @@ void UpdateDrawFrame(void) { UpdateGame(); DrawGame(); -}
\ No newline at end of file +} diff --git a/games/skully_escape/skully_escape.c b/games/skully_escape/skully_escape.c index 3a0e4cb0..dc545117 100644 --- a/games/skully_escape/skully_escape.c +++ b/games/skully_escape/skully_escape.c @@ -14,10 +14,6 @@ #include "player.h" -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -52,19 +48,11 @@ void UpdateDrawFrame(void); // Update and Draw one frame //---------------------------------------------------------------------------------- // Main entry point //---------------------------------------------------------------------------------- -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { - // Initialization + // Initialization (Note windowTitle is unused on Android) //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else InitWindow(screenWidth, screenHeight, "SKULLY ESCAPE [KING GAMEJAM]"); -#endif // Global data loading (assets that must be available in all screens, i.e. fonts) InitAudioDevice(); @@ -112,9 +100,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } void TransitionToScreen(int screen) diff --git a/games/snake.c b/games/snake.c index c971ce15..40d66da8 100644 --- a/games/snake.c +++ b/games/snake.c @@ -13,10 +13,6 @@ #include "raylib.h" -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -73,19 +69,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame) //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { - // Initialization + // Initialization (Note windowTitle is unused on Android) //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else InitWindow(screenWidth, screenHeight, "sample game: snake"); -#endif InitGame(); @@ -112,9 +100,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } //------------------------------------------------------------------------------------ @@ -298,4 +285,4 @@ void UpdateDrawFrame(void) { UpdateGame(); DrawGame(); -}
\ No newline at end of file +} diff --git a/games/space_invaders.c b/games/space_invaders.c index b80de050..97f14547 100644 --- a/games/space_invaders.c +++ b/games/space_invaders.c @@ -13,10 +13,6 @@ #include "raylib.h" -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -90,19 +86,11 @@ static void UpdateDrawFrame(void); // Update and Draw (one frame) //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { - // Initialization + // Initialization (Note windowTitle is unused on Android) //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else InitWindow(screenWidth, screenHeight, "sample game: space invaders"); -#endif InitGame(); @@ -129,9 +117,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } //------------------------------------------------------------------------------------ @@ -410,4 +397,4 @@ void UpdateDrawFrame(void) { UpdateGame(); DrawGame(); -}
\ No newline at end of file +} diff --git a/games/tetris.c b/games/tetris.c index e02d7f18..3c9d5c5c 100644 --- a/games/tetris.c +++ b/games/tetris.c @@ -18,10 +18,6 @@ #include <time.h> #include <math.h> -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -109,19 +105,11 @@ static void DeleteCompleteLines(); //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { - // Initialization + // Initialization (Note windowTitle is unused on Android) //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else InitWindow(screenWidth, screenHeight, "sample game: tetris"); -#endif InitGame(); @@ -148,9 +136,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } //-------------------------------------------------------------------------------------- @@ -841,4 +828,4 @@ static void DeleteCompleteLines() } } } -}
\ No newline at end of file +} diff --git a/games/transmission/transmission.c b/games/transmission/transmission.c index a508b5d2..37824a7b 100644 --- a/games/transmission/transmission.c +++ b/games/transmission/transmission.c @@ -17,10 +17,6 @@ #include <stdlib.h> #include <stdio.h> -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -55,20 +51,15 @@ static void UpdateDrawFrame(void); // Update and Draw one frame //---------------------------------------------------------------------------------- // Main entry point //---------------------------------------------------------------------------------- -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(void) -#endif { // Initialization //--------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else +#ifndef PLATFORM_ANDROID SetConfigFlags(FLAG_SHOW_LOGO); // | FLAG_FULLSCREEN_MODE); - InitWindow(screenWidth, screenHeight, "raylib game - transmission mission"); #endif + // Note windowTitle is unused on Android + InitWindow(screenWidth, screenHeight, "raylib game - transmission mission"); // Global data loading (assets that must be available in all screens, i.e. fonts) InitAudioDevice(); @@ -138,9 +129,8 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } //---------------------------------------------------------------------------------- @@ -462,4 +452,4 @@ void DrawButton(const char *text) Vector2 measure = MeasureTextEx(fontMission, text, fontSizeButton, 0); Vector2 textPos = {textPositionButton.x - measure.x/2 + 10, textPositionButton.y - measure.y/2 - 10}; DrawTextEx(fontMission, text, textPos , fontSizeButton, 0, textColorButton); -}
\ No newline at end of file +} diff --git a/games/wave_collector/wave_collector.c b/games/wave_collector/wave_collector.c index e28c0b84..2099b74c 100644 --- a/games/wave_collector/wave_collector.c +++ b/games/wave_collector/wave_collector.c @@ -22,10 +22,6 @@ #include <stdio.h> // Required for: printf() #include <string.h> // Required for: strcpy() -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -60,11 +56,7 @@ static void UpdateDrawFrame(void); // Update and Draw one frame //---------------------------------------------------------------------------------- // Main entry point //---------------------------------------------------------------------------------- -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else int main(int argc, char *argv[]) -#endif { // Initialization //--------------------------------------------------------- @@ -89,12 +81,11 @@ int main(int argc, char *argv[]) } #endif -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else +#ifndef PLATFORM_ANDROID SetConfigFlags(FLAG_MSAA_4X_HINT); - InitWindow(screenWidth, screenHeight, "GGJ17 - WAVE COLLECTOR"); #endif + // Note windowTitle is unused on Android + InitWindow(screenWidth, screenHeight, "GGJ17 - WAVE COLLECTOR"); // Global data loading (assets that must be available in all screens, i.e. fonts) InitAudioDevice(); @@ -143,9 +134,8 @@ int main(int argc, char *argv[]) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) + return 0; -#endif } //---------------------------------------------------------------------------------- |
