BREAKING CHANGE: Renamed SpriteFont type to Font

- Preparing MP3 files support
- Jumped version to raylib 2.0-dev (too many breaking changes...)
This commit is contained in:
Ray San
2018-05-04 16:59:48 +02:00
parent 6045062a05
commit ec33e7d705
34 changed files with 3027 additions and 179 deletions

View File

@ -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
//--------------------------------------------------------------------------------------

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -47,7 +47,7 @@ typedef struct Door {
// Global Variables Definition
//----------------------------------------------------------------------------------
GameScreen currentScreen;
SpriteFont font;
Font font;
Texture2D doors;
Sound sndDoor;

View File

@ -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);

View File

@ -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);
}

View File

@ -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");

View File

@ -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?

View File

@ -76,7 +76,7 @@ Color textColorButton;
int currentMission;
int totalMissions;
SpriteFont fontMission;
Font fontMission;
Word messageWords[MAX_MISSION_WORDS];

View File

@ -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

View File

@ -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

View File

@ -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