-
Notifications
You must be signed in to change notification settings - Fork 8
Major update, add SDL ttf fonts and utf 8 support #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f06cf10
abb3e9c
16201f8
9cc0e40
cd18b51
5c23a3e
626ac34
123ada0
2a4d868
2e8b4ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to add in the readme the link on where this font comes from + its licence |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,7 @@ | |
| #include <SDL2/SDL_video.h> // for SDL_CreateWindow, SDL_DestroyWindow | ||
| #include <SDL2/SDL.h> | ||
| #include <SDL2/SDL_mixer.h> | ||
| #include <SDL2/SDL_ttf.h> | ||
|
|
||
| #include "config.h" | ||
| #include "preference.h" | ||
|
|
@@ -55,7 +56,7 @@ char Titre[] = "Li-ri V" VERSION; | |
|
|
||
| Sprite *Sprites = nullptr; // Sprites pointer | ||
| int NSprites = 0; // Number of sprites in memory | ||
| Screen Ec; // 2 Video buffer pointer | ||
| Screen *Ec; // 2 Video buffer pointer | ||
| sNewPreference Pref; // Preference table. | ||
| Level level; | ||
|
|
||
|
|
@@ -106,6 +107,10 @@ int main(int narg, char *argv[]) | |
| // Close the program properly when quitting | ||
| atexit(SDL_Quit); | ||
|
|
||
| TTF_Init(); | ||
|
|
||
| Ec = new Screen(); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it should be deleted at the end to avoid memory leak. (a future improvement will be to remove it as global variable, but that's outside this PR scope) |
||
|
|
||
| // Set resolution | ||
| int vOption = SDL_WINDOW_RESIZABLE; | ||
| if (Pref.FullScreen) { | ||
|
|
@@ -201,6 +206,7 @@ int main(int narg, char *argv[]) | |
| SDL_DestroyRenderer(sdlRenderer); | ||
| SDL_DestroyWindow(sdlWindow); | ||
|
|
||
| TTF_Quit(); | ||
| Mix_Quit(); | ||
| SDL_Quit(); | ||
| return 0; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some changes in parallel in both the main branch and in the sdl_ttf branch. Can you please rebase?
At the end, this file should be like https://github.com/petitlapin/Li-Ri/blob/work/sdl_ttf/conanfile.py
I also added the changes to compile for android in 6ecef05