Apply resolution and fullscreen changes immediately.
This commit is contained in:
parent
975ece4796
commit
2981fde2ec
|
@ -25,8 +25,8 @@ extern void drawText(int x, int y, int size, int align, SDL_Color c, const char
|
|||
extern void drawWidgets(char *groupName);
|
||||
extern AtlasImage *getAtlasImage(char *filename);
|
||||
extern char *getChallengeDescription(Challenge *c);
|
||||
extern char *timeToString(long millis, int showHours);
|
||||
extern void setAtlasColor(int r, int g, int b, int a);
|
||||
extern char *timeToString(long millis, int showHours);
|
||||
|
||||
extern App app;
|
||||
extern Battle battle;
|
||||
|
|
|
@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "starfield.h"
|
||||
|
||||
Star stars[MAX_STARS];
|
||||
static Star stars[MAX_STARS];
|
||||
|
||||
void initStars(void)
|
||||
{
|
||||
|
|
|
@ -162,6 +162,14 @@ static void changeWindowSize(char *value)
|
|||
|
||||
app.uiOffset.x = (app.winWidth / 2) - (UI_WIDTH / 2);
|
||||
app.uiOffset.y = (app.winHeight / 2) - (UI_HEIGHT / 2);
|
||||
|
||||
SDL_DestroyTexture(app.backBuffer);
|
||||
|
||||
app.backBuffer = SDL_CreateTexture(app.renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, app.winWidth, app.winHeight);
|
||||
|
||||
initGraphics();
|
||||
|
||||
initStars();
|
||||
}
|
||||
|
||||
static void changeSoundVolume(char *value)
|
||||
|
@ -181,6 +189,8 @@ static void changeMusicVolume(char *value)
|
|||
static void changeFullscreen(char *value)
|
||||
{
|
||||
app.fullscreen = strcmp(value, "On") == 0;
|
||||
|
||||
SDL_SetWindowFullscreen(app.window, app.fullscreen? SDL_WINDOW_FULLSCREEN : 0);
|
||||
}
|
||||
|
||||
static void ok(void)
|
||||
|
|
|
@ -30,6 +30,8 @@ extern void drawText(int x, int y, int size, int align, SDL_Color c, const char
|
|||
extern void drawWidgets(char *groupName);
|
||||
extern Widget *getWidget(const char *name, const char *group);
|
||||
extern void initControlsDisplay(void);
|
||||
extern void initGraphics(void);
|
||||
extern void initStars(void);
|
||||
extern void saveConfig(void);
|
||||
extern void selectWidget(const char *name, const char *group);
|
||||
extern void setWidgetOption(const char *name, const char *group, const char *value);
|
||||
|
|
Loading…
Reference in New Issue