Fix #344 initial black screen on Mac OS X and small initial window size on Linux when .asepriterc is not present

This commit is contained in:
David Capello 2014-08-20 08:27:11 -03:00
parent 44c6f9400e
commit daa7adde14
2 changed files with 10 additions and 6 deletions

View File

@ -153,19 +153,22 @@ static void save_gui_config();
// Initializes GUI.
int init_module_gui()
{
int c, w, h, min_possible_dsk_res = 0;
bool maximized;
shortcuts = new std::vector<Shortcut*>;
// Set the graphics mode...
int w, h;
bool maximized;
load_gui_config(w, h, maximized);
try {
main_display = she::instance()->createDisplay(w, h, screen_scaling);
if (w > 0 && h > 0)
main_display = she::instance()->createDisplay(w, h, screen_scaling);
}
catch (const she::DisplayCreationException&) {
for (c=min_possible_dsk_res; try_resolutions[c].width; ++c) {
// Do nothing, the display wasn't created.
}
if (!main_display) {
for (int c=0; try_resolutions[c].width; ++c) {
try {
main_display =
she::instance()->createDisplay(try_resolutions[c].width,

View File

@ -679,6 +679,7 @@ public:
}
Display* createDisplay(int width, int height, int scale) override {
PRINTF("Creating display %dx%d (scale = %d)\n", width, height, scale);
return new Alleg4Display(width, height, scale);
}