From ec33e7d705e301eb2b74a841e823907295caa37a Mon Sep 17 00:00:00 2001 From: Ray San Date: Fri, 4 May 2018 16:59:48 +0200 Subject: BREAKING CHANGE: Renamed SpriteFont type to Font - Preparing MP3 files support - Jumped version to raylib 2.0-dev (too many breaking changes...) --- games/drturtle/04_drturtle_gui.c | 4 ++-- games/drturtle/05_drturtle_audio.c | 4 ++-- games/drturtle/06_drturtle_final.c | 4 ++-- games/drturtle/drturtle_final_web.c | 6 +++--- games/koala_seasons/koala_seasons.c | 4 ++-- games/koala_seasons/screens/screens.h | 2 +- games/light_my_ritual/light_my_ritual.c | 4 ++-- games/light_my_ritual/screens/screens.h | 2 +- games/skully_escape/screens/screens.h | 2 +- games/skully_escape/skully_escape.c | 4 ++-- games/transmission/screens/screen_ending.c | 6 +++--- games/transmission/screens/screen_gameplay.c | 4 ++-- games/transmission/screens/screen_title.c | 6 +++--- games/transmission/screens/screens.h | 2 +- games/transmission/transmission.c | 4 ++-- games/wave_collector/screens/screens.h | 2 +- games/wave_collector/wave_collector.c | 4 ++-- 17 files changed, 32 insertions(+), 32 deletions(-) (limited to 'games') diff --git a/games/drturtle/04_drturtle_gui.c b/games/drturtle/04_drturtle_gui.c index 5be8f1f1..0ec06fb6 100644 --- a/games/drturtle/04_drturtle_gui.c +++ b/games/drturtle/04_drturtle_gui.c @@ -49,7 +49,7 @@ int main() Texture2D gframe = LoadTexture("resources/gframe.png"); // Load game resources: fonts - SpriteFont font = LoadSpriteFont("resources/komika.png"); + Font font = LoadFont("resources/komika.png"); // Define scrolling variables int backScrolling = 0; @@ -438,7 +438,7 @@ int main() UnloadTexture(gamera); // Unload font texture - UnloadSpriteFont(font); + UnloadFont(font); CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/games/drturtle/05_drturtle_audio.c b/games/drturtle/05_drturtle_audio.c index 3645c657..4c3ce4ad 100644 --- a/games/drturtle/05_drturtle_audio.c +++ b/games/drturtle/05_drturtle_audio.c @@ -52,7 +52,7 @@ int main() Texture2D gframe = LoadTexture("resources/gframe.png"); // Load game resources: fonts - SpriteFont font = LoadSpriteFont("resources/komika.png"); + Font font = LoadFont("resources/komika.png"); // Load game resources: sounds Sound eat = LoadSound("resources/eat.wav"); @@ -454,7 +454,7 @@ int main() UnloadTexture(gamera); // Unload font texture - UnloadSpriteFont(font); + UnloadFont(font); // Unload sounds UnloadSound(eat); diff --git a/games/drturtle/06_drturtle_final.c b/games/drturtle/06_drturtle_final.c index 2edebe87..a74d4f7e 100644 --- a/games/drturtle/06_drturtle_final.c +++ b/games/drturtle/06_drturtle_final.c @@ -55,7 +55,7 @@ int main() Texture2D gframe = LoadTexture("resources/gframe.png"); // Load game resources: fonts - SpriteFont font = LoadSpriteFont("resources/komika.png"); + Font font = LoadFont("resources/komika.png"); // Load game resources: sounds Sound eat = LoadSound("resources/eat.wav"); @@ -479,7 +479,7 @@ int main() UnloadTexture(gamera); // Unload font texture - UnloadSpriteFont(font); + UnloadFont(font); // Unload sounds UnloadSound(eat); diff --git a/games/drturtle/drturtle_final_web.c b/games/drturtle/drturtle_final_web.c index 84f3b1c2..0b639e38 100644 --- a/games/drturtle/drturtle_final_web.c +++ b/games/drturtle/drturtle_final_web.c @@ -48,7 +48,7 @@ Texture2D swhale; Texture2D fish; Texture2D gframe; -SpriteFont font; +Font font; Sound eat; Sound die; @@ -119,7 +119,7 @@ int main() gframe = LoadTexture("resources/gframe.png"); // Load game resources: fonts - font = LoadSpriteFont("resources/komika.png"); + font = LoadFont("resources/komika.png"); // Load game resources: sounds eat = LoadSound("resources/eat.wav"); @@ -186,7 +186,7 @@ int main() UnloadTexture(gamera); // Unload font texture - UnloadSpriteFont(font); + UnloadFont(font); // Unload sounds UnloadSound(eat); diff --git a/games/koala_seasons/koala_seasons.c b/games/koala_seasons/koala_seasons.c index 8657d3d5..479fab85 100644 --- a/games/koala_seasons/koala_seasons.c +++ b/games/koala_seasons/koala_seasons.c @@ -57,7 +57,7 @@ int main(void) { InitWindow(screenWidth, screenHeight, windowTitle); // Load global data here (assets that must be available in all screens, i.e. fonts) - font = LoadSpriteFont("resources/graphics/mainfont.png"); + font = LoadFont("resources/graphics/mainfont.png"); atlas01 = LoadTexture("resources/graphics/atlas01.png"); atlas02 = LoadTexture("resources/graphics/atlas02.png"); @@ -114,7 +114,7 @@ int main(void) { UnloadTexture(atlas01); UnloadTexture(atlas02); - UnloadSpriteFont(font); + UnloadFont(font); UnloadShader(colorBlend); // Unload color overlay blending shader diff --git a/games/koala_seasons/screens/screens.h b/games/koala_seasons/screens/screens.h index ba62aa27..36d30840 100644 --- a/games/koala_seasons/screens/screens.h +++ b/games/koala_seasons/screens/screens.h @@ -42,7 +42,7 @@ typedef enum GameScreen { LOGO, TITLE, OPTIONS, GAMEPLAY, ENDING } GameScreen; GameScreen currentScreen; // NOTE: This is all the data used in the game -SpriteFont font; +Font font; Shader colorBlend; Texture2D atlas01; Texture2D atlas02; diff --git a/games/light_my_ritual/light_my_ritual.c b/games/light_my_ritual/light_my_ritual.c index 985baa04..ece51997 100644 --- a/games/light_my_ritual/light_my_ritual.c +++ b/games/light_my_ritual/light_my_ritual.c @@ -68,7 +68,7 @@ int main(void) UnloadImage(image); // Unload image from CPU memory (RAM) - font = LoadSpriteFont("resources/font_arcadian.png"); + font = LoadFont("resources/font_arcadian.png"); //doors = LoadTexture("resources/textures/doors.png"); //sndDoor = LoadSound("resources/audio/door.ogg"); @@ -106,7 +106,7 @@ int main(void) } // Unload all global loaded data (i.e. fonts) here! - UnloadSpriteFont(font); + UnloadFont(font); //UnloadSound(sndDoor); UnloadMusicStream(music); diff --git a/games/light_my_ritual/screens/screens.h b/games/light_my_ritual/screens/screens.h index ff12a01c..fc17c268 100644 --- a/games/light_my_ritual/screens/screens.h +++ b/games/light_my_ritual/screens/screens.h @@ -35,7 +35,7 @@ typedef enum GameScreen { LOGO_RL = 0, TITLE, GAMEPLAY } GameScreen; // Global Variables Definition //---------------------------------------------------------------------------------- GameScreen currentScreen; -SpriteFont font; +Font font; Color *lightsMap; int lightsMapWidth, lightsMapHeight; diff --git a/games/skully_escape/screens/screens.h b/games/skully_escape/screens/screens.h index ce35ae70..eed0138c 100644 --- a/games/skully_escape/screens/screens.h +++ b/games/skully_escape/screens/screens.h @@ -47,7 +47,7 @@ typedef struct Door { // Global Variables Definition //---------------------------------------------------------------------------------- GameScreen currentScreen; -SpriteFont font; +Font font; Texture2D doors; Sound sndDoor; diff --git a/games/skully_escape/skully_escape.c b/games/skully_escape/skully_escape.c index dc545117..e2e7007b 100644 --- a/games/skully_escape/skully_escape.c +++ b/games/skully_escape/skully_escape.c @@ -60,7 +60,7 @@ int main(void) music = LoadMusicStream("resources/audio/come_play_with_me.ogg"); PlayMusicStream(music); - font = LoadSpriteFont("resources/textures/alagard.png"); + font = LoadFont("resources/textures/alagard.png"); doors = LoadTexture("resources/textures/doors.png"); sndDoor = LoadSound("resources/audio/door.ogg"); sndScream = LoadSound("resources/audio/scream.ogg"); @@ -89,7 +89,7 @@ int main(void) // Unload all global loaded data (i.e. fonts) here! UnloadPlayer(); - UnloadSpriteFont(font); + UnloadFont(font); UnloadTexture(doors); UnloadSound(sndDoor); UnloadSound(sndScream); diff --git a/games/transmission/screens/screen_ending.c b/games/transmission/screens/screen_ending.c index e6ab3518..0aba5f01 100644 --- a/games/transmission/screens/screen_ending.c +++ b/games/transmission/screens/screen_ending.c @@ -68,7 +68,7 @@ static Mission *missions = NULL; static char headline[MAX_TITLE_CHAR] = "\0"; -SpriteFont fontNews; +Font fontNews; // String (const char *) replacement function static char *StringReplace(char *orig, char *rep, char *with); @@ -121,11 +121,11 @@ void InitEndingScreen(void) // Generate newspaper with title and subtitle Image imNewspaper = LoadImage("resources/textures/ending_newspaper.png"); - fontNews = LoadSpriteFontEx("resources/fonts/Lora-Bold.ttf", 32, 250, 0); + fontNews = LoadFontEx("resources/fonts/Lora-Bold.ttf", 32, 250, 0); ImageDrawTextEx(&imNewspaper, (Vector2){ 50, 220 }, fontNews, headline, fontNews.baseSize, 0, DARKGRAY); texNewspaper = LoadTextureFromImage(imNewspaper); - //UnloadSpriteFont(fontNews); + //UnloadFont(fontNews); UnloadImage(imNewspaper); } diff --git a/games/transmission/screens/screen_gameplay.c b/games/transmission/screens/screen_gameplay.c index 00c451fc..0594e10f 100644 --- a/games/transmission/screens/screen_gameplay.c +++ b/games/transmission/screens/screen_gameplay.c @@ -95,7 +95,7 @@ static int framesCounter; static int finishScreen; static Texture2D texBackground; -static SpriteFont fontMessage; +static Font fontMessage; static Texture2D texWordsAtlas; static Texture2D texVignette; @@ -126,7 +126,7 @@ void InitGameplayScreen(void) framesCounter = 0; finishScreen = 0; - fontMessage = LoadSpriteFontEx("resources/fonts/traveling_typewriter.ttf", 30, 250, 0); + fontMessage = LoadFontEx("resources/fonts/traveling_typewriter.ttf", 30, 250, 0); texBackground = LoadTexture("resources/textures/message_background.png"); texVignette = LoadTexture("resources/textures/message_vignette.png"); diff --git a/games/transmission/screens/screen_title.c b/games/transmission/screens/screen_title.c index a5ad0a84..22efadb1 100644 --- a/games/transmission/screens/screen_title.c +++ b/games/transmission/screens/screen_title.c @@ -36,7 +36,7 @@ static int framesCounter; static int finishScreen; static Texture2D texBackground; -static SpriteFont fontTitle; +static Font fontTitle; static Sound fxTyping; static float titleSize; @@ -71,7 +71,7 @@ void InitTitleScreen(void) texBackground = LoadTexture("resources/textures/title_background.png"); fxTyping = LoadSound("resources/audio/fx_typing.ogg"); - fontTitle = LoadSpriteFontEx("resources/fonts/mom_typewritter.ttf", 96, 0, 0); + fontTitle = LoadFontEx("resources/fonts/mom_typewritter.ttf", 96, 0, 0); titleSize = 44; transmissionPosition = (Vector2){519, 221}; @@ -148,7 +148,7 @@ void UnloadTitleScreen(void) { UnloadTexture(texBackground); UnloadSound(fxTyping); - UnloadSpriteFont(fontTitle); + UnloadFont(fontTitle); } // Title Screen should finish? diff --git a/games/transmission/screens/screens.h b/games/transmission/screens/screens.h index 27560d8b..be5e31d9 100644 --- a/games/transmission/screens/screens.h +++ b/games/transmission/screens/screens.h @@ -76,7 +76,7 @@ Color textColorButton; int currentMission; int totalMissions; -SpriteFont fontMission; +Font fontMission; Word messageWords[MAX_MISSION_WORDS]; diff --git a/games/transmission/transmission.c b/games/transmission/transmission.c index 37824a7b..d4298e34 100644 --- a/games/transmission/transmission.c +++ b/games/transmission/transmission.c @@ -70,7 +70,7 @@ int main(void) SetMusicVolume(music, 1.0f); PlayMusicStream(music); - fontMission = LoadSpriteFontEx("resources/fonts/traveling_typewriter.ttf", 64, 250, 0); + fontMission = LoadFontEx("resources/fonts/traveling_typewriter.ttf", 64, 250, 0); texButton = LoadTexture("resources/textures/title_ribbon.png"); // UI BUTTON @@ -122,7 +122,7 @@ int main(void) UnloadMusicStream(music); UnloadSound(fxButton); - UnloadSpriteFont(fontMission); + UnloadFont(fontMission); UnloadTexture(texButton); CloseAudioDevice(); // Close audio context diff --git a/games/wave_collector/screens/screens.h b/games/wave_collector/screens/screens.h index 3e4d062f..6e896d58 100644 --- a/games/wave_collector/screens/screens.h +++ b/games/wave_collector/screens/screens.h @@ -35,7 +35,7 @@ typedef enum GameScreen { LOGO = 0, TITLE, GAMEPLAY, ENDING } GameScreen; // Global Variables Definition //---------------------------------------------------------------------------------- GameScreen currentScreen; -SpriteFont font; +Font font; Music music; int endingStatus; // 1 - Win, 2 - Lose diff --git a/games/wave_collector/wave_collector.c b/games/wave_collector/wave_collector.c index 2099b74c..0a04310d 100644 --- a/games/wave_collector/wave_collector.c +++ b/games/wave_collector/wave_collector.c @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) // Global data loading (assets that must be available in all screens, i.e. fonts) InitAudioDevice(); - font = LoadSpriteFont("resources/font.fnt"); + font = LoadFont("resources/font.fnt"); music = LoadMusicStream("resources/audio/wave.ogg"); SetMusicVolume(music, 1.0f); @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) } // Unload all global loaded data (i.e. fonts) here! - UnloadSpriteFont(font); + UnloadFont(font); UnloadMusicStream(music); CloseAudioDevice(); // Close audio context -- cgit v1.2.3 From 07901711250dff5eceac27f0a4e802833fe24b6f Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 11 May 2018 18:14:42 +0200 Subject: Updated raylib_icon resource --- games/Makefile | 2 +- games/drturtle/Makefile | 2 +- games/just_do/Makefile | 2 +- games/koala_seasons/Makefile | 2 +- games/light_my_ritual/Makefile | 2 +- games/skully_escape/Makefile | 2 +- games/transmission/Makefile | 2 +- games/wave_collector/Makefile | 2 +- projects/Notepad++/npes_saved.txt | Bin 11872 -> 11884 bytes 9 files changed, 8 insertions(+), 8 deletions(-) (limited to 'games') diff --git a/games/Makefile b/games/Makefile index c299e065..b00f4382 100644 --- a/games/Makefile +++ b/games/Makefile @@ -160,7 +160,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # resources file contains windows exe icon # -Wl,--subsystem,windows hides the console window - CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows + CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) CFLAGS += -no-pie -D_DEFAULT_SOURCE diff --git a/games/drturtle/Makefile b/games/drturtle/Makefile index 9a2486fe..bbc71eb9 100644 --- a/games/drturtle/Makefile +++ b/games/drturtle/Makefile @@ -160,7 +160,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # resources file contains windows exe icon # -Wl,--subsystem,windows hides the console window - CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows + CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) CFLAGS += -no-pie -D_DEFAULT_SOURCE diff --git a/games/just_do/Makefile b/games/just_do/Makefile index 3f764abc..0237f4f9 100644 --- a/games/just_do/Makefile +++ b/games/just_do/Makefile @@ -160,7 +160,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # resources file contains windows exe icon # -Wl,--subsystem,windows hides the console window - CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows + CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) CFLAGS += -no-pie -D_DEFAULT_SOURCE diff --git a/games/koala_seasons/Makefile b/games/koala_seasons/Makefile index 3f1e4561..25e6dcbe 100644 --- a/games/koala_seasons/Makefile +++ b/games/koala_seasons/Makefile @@ -160,7 +160,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # resources file contains windows exe icon # -Wl,--subsystem,windows hides the console window - CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows + CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) CFLAGS += -no-pie -D_DEFAULT_SOURCE diff --git a/games/light_my_ritual/Makefile b/games/light_my_ritual/Makefile index 43738ac0..f6fd4533 100644 --- a/games/light_my_ritual/Makefile +++ b/games/light_my_ritual/Makefile @@ -160,7 +160,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # resources file contains windows exe icon # -Wl,--subsystem,windows hides the console window - CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows + CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) CFLAGS += -no-pie -D_DEFAULT_SOURCE diff --git a/games/skully_escape/Makefile b/games/skully_escape/Makefile index 2191114b..98d4696a 100644 --- a/games/skully_escape/Makefile +++ b/games/skully_escape/Makefile @@ -160,7 +160,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # resources file contains windows exe icon # -Wl,--subsystem,windows hides the console window - CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows + CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) CFLAGS += -no-pie -D_DEFAULT_SOURCE diff --git a/games/transmission/Makefile b/games/transmission/Makefile index 60ab1d0a..4e998f0f 100644 --- a/games/transmission/Makefile +++ b/games/transmission/Makefile @@ -160,7 +160,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # resources file contains windows exe icon # -Wl,--subsystem,windows hides the console window - CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows + CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) CFLAGS += -no-pie -D_DEFAULT_SOURCE diff --git a/games/wave_collector/Makefile b/games/wave_collector/Makefile index 035ce101..78b2bbe5 100644 --- a/games/wave_collector/Makefile +++ b/games/wave_collector/Makefile @@ -160,7 +160,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # resources file contains windows exe icon # -Wl,--subsystem,windows hides the console window - CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows + CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) CFLAGS += -no-pie -D_DEFAULT_SOURCE diff --git a/projects/Notepad++/npes_saved.txt b/projects/Notepad++/npes_saved.txt index ecc5c524..89cca10c 100644 Binary files a/projects/Notepad++/npes_saved.txt and b/projects/Notepad++/npes_saved.txt differ -- cgit v1.2.3 From c1b9104d54814b4084e0d7b113918a6d014e807e Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sat, 12 May 2018 11:41:12 +0200 Subject: Makefile: Remove unnecessary -no-pie for older GCC support Currently, if: * GCC doesn't supports -no-pie: Build error * GCC supports -no-pie * GCC is not configured with --enable-default-pie: No-op * GCC is configured with --enable-default-pie: Slightly worse performance because we still generate -fpie code (-pie affects linker, -fpie affects compiler) So instead of probing for existence of -fno-pie -no-pie, remove it altogether. Fixes #540: Build breakage on Debian 8 with gcc 4.9. --- examples/Makefile | 2 +- games/Makefile | 2 +- games/drturtle/Makefile | 2 +- games/just_do/Makefile | 2 +- games/koala_seasons/Makefile | 2 +- games/light_my_ritual/Makefile | 2 +- games/skully_escape/Makefile | 2 +- games/transmission/Makefile | 2 +- games/wave_collector/Makefile | 2 +- templates/advance_game/Makefile | 2 +- templates/simple_game/Makefile | 2 +- templates/standard_game/Makefile | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) (limited to 'games') diff --git a/examples/Makefile b/examples/Makefile index d283e807..64cec3d1 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -215,7 +215,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) #CC = clang endif ifeq ($(RAYLIB_LIBTYPE),STATIC) - CFLAGS += -no-pie -D_DEFAULT_SOURCE + CFLAGS += -D_DEFAULT_SOURCE endif ifeq ($(RAYLIB_LIBTYPE),SHARED) # Explicitly enable runtime link to libraylib.so diff --git a/games/Makefile b/games/Makefile index b00f4382..c14ff36c 100644 --- a/games/Makefile +++ b/games/Makefile @@ -163,7 +163,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) - CFLAGS += -no-pie -D_DEFAULT_SOURCE + CFLAGS += -D_DEFAULT_SOURCE endif endif ifeq ($(PLATFORM),PLATFORM_RPI) diff --git a/games/drturtle/Makefile b/games/drturtle/Makefile index bbc71eb9..242d0c5c 100644 --- a/games/drturtle/Makefile +++ b/games/drturtle/Makefile @@ -163,7 +163,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) - CFLAGS += -no-pie -D_DEFAULT_SOURCE + CFLAGS += -D_DEFAULT_SOURCE endif endif ifeq ($(PLATFORM),PLATFORM_RPI) diff --git a/games/just_do/Makefile b/games/just_do/Makefile index 0237f4f9..d5481e51 100644 --- a/games/just_do/Makefile +++ b/games/just_do/Makefile @@ -163,7 +163,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) - CFLAGS += -no-pie -D_DEFAULT_SOURCE + CFLAGS += -D_DEFAULT_SOURCE endif endif ifeq ($(PLATFORM),PLATFORM_RPI) diff --git a/games/koala_seasons/Makefile b/games/koala_seasons/Makefile index 25e6dcbe..3dd299fd 100644 --- a/games/koala_seasons/Makefile +++ b/games/koala_seasons/Makefile @@ -163,7 +163,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) - CFLAGS += -no-pie -D_DEFAULT_SOURCE + CFLAGS += -D_DEFAULT_SOURCE endif endif ifeq ($(PLATFORM),PLATFORM_RPI) diff --git a/games/light_my_ritual/Makefile b/games/light_my_ritual/Makefile index f6fd4533..cdd96129 100644 --- a/games/light_my_ritual/Makefile +++ b/games/light_my_ritual/Makefile @@ -163,7 +163,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) - CFLAGS += -no-pie -D_DEFAULT_SOURCE + CFLAGS += -D_DEFAULT_SOURCE endif endif ifeq ($(PLATFORM),PLATFORM_RPI) diff --git a/games/skully_escape/Makefile b/games/skully_escape/Makefile index 98d4696a..74521e7b 100644 --- a/games/skully_escape/Makefile +++ b/games/skully_escape/Makefile @@ -163,7 +163,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) - CFLAGS += -no-pie -D_DEFAULT_SOURCE + CFLAGS += -D_DEFAULT_SOURCE endif endif ifeq ($(PLATFORM),PLATFORM_RPI) diff --git a/games/transmission/Makefile b/games/transmission/Makefile index 4e998f0f..2ba9afd9 100644 --- a/games/transmission/Makefile +++ b/games/transmission/Makefile @@ -163,7 +163,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) - CFLAGS += -no-pie -D_DEFAULT_SOURCE + CFLAGS += -D_DEFAULT_SOURCE endif endif ifeq ($(PLATFORM),PLATFORM_RPI) diff --git a/games/wave_collector/Makefile b/games/wave_collector/Makefile index 78b2bbe5..9f03e62e 100644 --- a/games/wave_collector/Makefile +++ b/games/wave_collector/Makefile @@ -163,7 +163,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) - CFLAGS += -no-pie -D_DEFAULT_SOURCE + CFLAGS += -D_DEFAULT_SOURCE endif endif ifeq ($(PLATFORM),PLATFORM_RPI) diff --git a/templates/advance_game/Makefile b/templates/advance_game/Makefile index 181f9dfb..61a59bc2 100644 --- a/templates/advance_game/Makefile +++ b/templates/advance_game/Makefile @@ -163,7 +163,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) - CFLAGS += -no-pie -D_DEFAULT_SOURCE + CFLAGS += -D_DEFAULT_SOURCE endif endif ifeq ($(PLATFORM),PLATFORM_RPI) diff --git a/templates/simple_game/Makefile b/templates/simple_game/Makefile index 4cd435ea..1b512670 100644 --- a/templates/simple_game/Makefile +++ b/templates/simple_game/Makefile @@ -163,7 +163,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) - CFLAGS += -no-pie -D_DEFAULT_SOURCE + CFLAGS += -D_DEFAULT_SOURCE endif endif ifeq ($(PLATFORM),PLATFORM_RPI) diff --git a/templates/standard_game/Makefile b/templates/standard_game/Makefile index e18703b2..7046233c 100644 --- a/templates/standard_game/Makefile +++ b/templates/standard_game/Makefile @@ -163,7 +163,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) - CFLAGS += -no-pie -D_DEFAULT_SOURCE + CFLAGS += -D_DEFAULT_SOURCE endif endif ifeq ($(PLATFORM),PLATFORM_RPI) -- cgit v1.2.3 From 20ddc6a2bb4cbd39c460d8fa5d1f7175095bba2f Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sun, 20 May 2018 19:47:19 +0200 Subject: Move utils.cmake to separate cmake/ directory --- cmake/utils.cmake | 88 ++++++++++++++++++++++++++++++++++++ examples/CMakeLists.txt | 2 +- games/CMakeLists.txt | 2 +- games/drturtle/CMakeLists.txt | 2 +- games/just_do/CMakeLists.txt | 2 +- games/koala_seasons/CMakeLists.txt | 2 +- games/light_my_ritual/CMakeLists.txt | 2 +- games/skully_escape/CMakeLists.txt | 2 +- games/wave_collector/CMakeLists.txt | 2 +- src/CMakeLists.txt | 2 +- utils.cmake | 88 ------------------------------------ 11 files changed, 97 insertions(+), 97 deletions(-) create mode 100755 cmake/utils.cmake delete mode 100755 utils.cmake (limited to 'games') diff --git a/cmake/utils.cmake b/cmake/utils.cmake new file mode 100755 index 00000000..27f74e68 --- /dev/null +++ b/cmake/utils.cmake @@ -0,0 +1,88 @@ +# All sorts of things that we need cross project +cmake_minimum_required(VERSION 2.8.0) + +add_definitions("-DRAYLIB_CMAKE=1") + +# Linking for OS X -framework options +# Will do nothing on other OSes +if(APPLE) + find_library(OPENGL_LIBRARY OpenGL) + find_library(COCOA_LIBRARY Cocoa) + find_library(IOKIT_LIBRARY IOKit) + find_library(COREFOUNDATION_LIBRARY CoreFoundation) + find_library(COREVIDEO_LIBRARY CoreVideo) + + set(LIBS_PRIVATE ${OPENGL_LIBRARY} ${COCOA_LIBRARY} + ${IOKIT_LIBRARY} ${COREFOUNDATION_LIBRARY} ${COREVIDEO_LIBRARY}) +elseif(WIN32) + # no pkg-config --static on Windows yet... +else() + find_library(pthread NAMES pthread) + find_package(OpenGL QUIET) + if ("${OPENGL_LIBRARIES}" STREQUAL "") + set(OPENGL_LIBRARIES "GL") + endif() + + include_directories(${OPENGL_INCLUDE_DIR}) + + if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD") + find_library(OSS_LIBRARY ossaudio) + endif() + + set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY}) + # TODO: maybe read those out of glfw's cmake config? + if(USE_WAYLAND) + set(LIBS_PRIVATE ${LIBS_PRIVATE} wayland-client wayland-cursor wayland-egl) + else() + set(LIBS_PRIVATE ${LIBS_PRIVATE} X11 Xrandr Xinerama Xi Xxf86vm Xcursor) + endif() +endif() + +if(USE_EXTERNAL_GLFW STREQUAL "ON") + find_package(glfw3 3.2.1 REQUIRED) +elseif(USE_EXTERNAL_GLFW STREQUAL "IF_POSSIBLE") + find_package(glfw3 3.2.1 QUIET) +endif() +if (glfw3_FOUND) + set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw) +endif() + +if(CMAKE_SYSTEM_NAME STREQUAL Linux) + set(LINUX TRUE) + set(LIBS_PRIVATE dl ${LIBS_PRIVATE}) +endif() + +foreach(L ${LIBS_PRIVATE}) + get_filename_component(DIR ${L} PATH) + get_filename_component(LIBFILE ${L} NAME_WE) + STRING(REGEX REPLACE "^lib" "" FILE ${LIBFILE}) + + if (${L} MATCHES "[.]framework$") + set(FILE_OPT "-framework ${FILE}") + set(DIR_OPT "-F${DIR}") + else() + set(FILE_OPT "-l${FILE}") + set(DIR_OPT "-L${DIR}") + endif() + + if ("${DIR}" STREQUAL "" OR "${DIR}" STREQUAL "${LASTDIR}") + set (DIR_OPT "") + endif() + + set(LASTDIR ${DIR}) + + set(__PKG_CONFIG_LIBS_PRIVATE ${__PKG_CONFIG_LIBS_PRIVATE} ${DIR_OPT} ${FILE_OPT}) + string (REPLACE ";" " " __PKG_CONFIG_LIBS_PRIVATE "${__PKG_CONFIG_LIBS_PRIVATE}") +endforeach(L) + + + +# Do the linking for executables that are meant to link raylib +function(link_libraries_to_executable executable) + # Link raylib + if (TARGET raylib_shared) + target_link_libraries(${executable} raylib_shared) + else() + target_link_libraries(${executable} raylib ${__PKG_CONFIG_LIBS_PRIVATE}) + endif() +endfunction() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 1f05d529..ae882444 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,7 +1,7 @@ # Setup the project and settings project(examples) -include("../utils.cmake") +include("../cmake/utils.cmake") # Make sure raylib has been built # TODO `build` directory should maybe be something else... diff --git a/games/CMakeLists.txt b/games/CMakeLists.txt index 278d1330..35c99139 100644 --- a/games/CMakeLists.txt +++ b/games/CMakeLists.txt @@ -1,7 +1,7 @@ # Setup the project and settings project(games) -include("../utils.cmake") +include("../cmake/utils.cmake") # Make sure raylib has been built # TODO `build` directory should maybe be something else... diff --git a/games/drturtle/CMakeLists.txt b/games/drturtle/CMakeLists.txt index 59813fb3..bdd91970 100644 --- a/games/drturtle/CMakeLists.txt +++ b/games/drturtle/CMakeLists.txt @@ -1,7 +1,7 @@ # Setup the project and settings project(drturtle) -include("../../utils.cmake") +include("../../cmake/utils.cmake") # Make sure raylib has been built diff --git a/games/just_do/CMakeLists.txt b/games/just_do/CMakeLists.txt index 11644008..4c5e1ee4 100644 --- a/games/just_do/CMakeLists.txt +++ b/games/just_do/CMakeLists.txt @@ -1,7 +1,7 @@ # Setup the project and settings project(just_do) -include("../../utils.cmake") +include("../../cmake/utils.cmake") # Make sure raylib has been built diff --git a/games/koala_seasons/CMakeLists.txt b/games/koala_seasons/CMakeLists.txt index 16069a7e..f79ab911 100644 --- a/games/koala_seasons/CMakeLists.txt +++ b/games/koala_seasons/CMakeLists.txt @@ -1,7 +1,7 @@ # Setup the project and settings project(koala_seasons) -include("../../utils.cmake") +include("../../cmake/utils.cmake") # Make sure raylib has been built diff --git a/games/light_my_ritual/CMakeLists.txt b/games/light_my_ritual/CMakeLists.txt index 1e2cafe1..11d2e4f4 100644 --- a/games/light_my_ritual/CMakeLists.txt +++ b/games/light_my_ritual/CMakeLists.txt @@ -1,7 +1,7 @@ # Setup the project and settings project(light_my_ritual) -include("../../utils.cmake") +include("../../cmake/utils.cmake") # Make sure raylib has been built diff --git a/games/skully_escape/CMakeLists.txt b/games/skully_escape/CMakeLists.txt index d14f52d9..337e1db5 100644 --- a/games/skully_escape/CMakeLists.txt +++ b/games/skully_escape/CMakeLists.txt @@ -1,7 +1,7 @@ # Setup the project and settings project(skully_escape) -include("../../utils.cmake") +include("../../cmake/utils.cmake") # Make sure raylib has been built diff --git a/games/wave_collector/CMakeLists.txt b/games/wave_collector/CMakeLists.txt index c16bd426..ca6c37b8 100644 --- a/games/wave_collector/CMakeLists.txt +++ b/games/wave_collector/CMakeLists.txt @@ -1,7 +1,7 @@ # Setup the project and settings project(wave_collector) -include("../../utils.cmake") +include("../../cmake/utils.cmake") # Make sure raylib has been built diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 458b9606..4b32de10 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -39,7 +39,7 @@ if(NOT glfw3_FOUND) list(APPEND raylib_sources $) endif() -include("../utils.cmake") +include("../cmake/utils.cmake") if(USE_AUDIO) file(GLOB stb_vorbis external/stb_vorbis.c) diff --git a/utils.cmake b/utils.cmake deleted file mode 100755 index 27f74e68..00000000 --- a/utils.cmake +++ /dev/null @@ -1,88 +0,0 @@ -# All sorts of things that we need cross project -cmake_minimum_required(VERSION 2.8.0) - -add_definitions("-DRAYLIB_CMAKE=1") - -# Linking for OS X -framework options -# Will do nothing on other OSes -if(APPLE) - find_library(OPENGL_LIBRARY OpenGL) - find_library(COCOA_LIBRARY Cocoa) - find_library(IOKIT_LIBRARY IOKit) - find_library(COREFOUNDATION_LIBRARY CoreFoundation) - find_library(COREVIDEO_LIBRARY CoreVideo) - - set(LIBS_PRIVATE ${OPENGL_LIBRARY} ${COCOA_LIBRARY} - ${IOKIT_LIBRARY} ${COREFOUNDATION_LIBRARY} ${COREVIDEO_LIBRARY}) -elseif(WIN32) - # no pkg-config --static on Windows yet... -else() - find_library(pthread NAMES pthread) - find_package(OpenGL QUIET) - if ("${OPENGL_LIBRARIES}" STREQUAL "") - set(OPENGL_LIBRARIES "GL") - endif() - - include_directories(${OPENGL_INCLUDE_DIR}) - - if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD") - find_library(OSS_LIBRARY ossaudio) - endif() - - set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY}) - # TODO: maybe read those out of glfw's cmake config? - if(USE_WAYLAND) - set(LIBS_PRIVATE ${LIBS_PRIVATE} wayland-client wayland-cursor wayland-egl) - else() - set(LIBS_PRIVATE ${LIBS_PRIVATE} X11 Xrandr Xinerama Xi Xxf86vm Xcursor) - endif() -endif() - -if(USE_EXTERNAL_GLFW STREQUAL "ON") - find_package(glfw3 3.2.1 REQUIRED) -elseif(USE_EXTERNAL_GLFW STREQUAL "IF_POSSIBLE") - find_package(glfw3 3.2.1 QUIET) -endif() -if (glfw3_FOUND) - set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw) -endif() - -if(CMAKE_SYSTEM_NAME STREQUAL Linux) - set(LINUX TRUE) - set(LIBS_PRIVATE dl ${LIBS_PRIVATE}) -endif() - -foreach(L ${LIBS_PRIVATE}) - get_filename_component(DIR ${L} PATH) - get_filename_component(LIBFILE ${L} NAME_WE) - STRING(REGEX REPLACE "^lib" "" FILE ${LIBFILE}) - - if (${L} MATCHES "[.]framework$") - set(FILE_OPT "-framework ${FILE}") - set(DIR_OPT "-F${DIR}") - else() - set(FILE_OPT "-l${FILE}") - set(DIR_OPT "-L${DIR}") - endif() - - if ("${DIR}" STREQUAL "" OR "${DIR}" STREQUAL "${LASTDIR}") - set (DIR_OPT "") - endif() - - set(LASTDIR ${DIR}) - - set(__PKG_CONFIG_LIBS_PRIVATE ${__PKG_CONFIG_LIBS_PRIVATE} ${DIR_OPT} ${FILE_OPT}) - string (REPLACE ";" " " __PKG_CONFIG_LIBS_PRIVATE "${__PKG_CONFIG_LIBS_PRIVATE}") -endforeach(L) - - - -# Do the linking for executables that are meant to link raylib -function(link_libraries_to_executable executable) - # Link raylib - if (TARGET raylib_shared) - target_link_libraries(${executable} raylib_shared) - else() - target_link_libraries(${executable} raylib ${__PKG_CONFIG_LIBS_PRIVATE}) - endif() -endfunction() -- cgit v1.2.3