Fix startup splash
- No longer shows stone pattern before logo - Music no longer cuts off - Intro image properly centred in fullscreen
This commit is contained in:
@@ -155,6 +155,7 @@ void adjust_window_mode() {
|
||||
sf::VideoMode desktop = sf::VideoMode::getDesktopMode();
|
||||
hideMenuBar();
|
||||
int menubarHeight = getMenubarHeight();
|
||||
bool firstTime = !mainPtr.isOpen();
|
||||
|
||||
// TODO: Make display_mode an enum
|
||||
if(display_mode == 5) {
|
||||
@@ -181,7 +182,7 @@ void adjust_window_mode() {
|
||||
ImageRsrc& icon = *ResMgr::get<ImageRsrc>("icon");
|
||||
mainPtr.setIcon(icon.getSize().x, icon.getSize().y, icon.getPixelsPtr());
|
||||
#endif
|
||||
redraw_screen(REFRESH_NONE);
|
||||
if(!firstTime) redraw_screen(REFRESH_NONE);
|
||||
if(text_sbar) {
|
||||
text_sbar->relocate({ul.x + 546,ul.y + 283});
|
||||
item_sbar->relocate({ul.x + 546,ul.y + 146});
|
||||
@@ -204,7 +205,6 @@ void plop_fancy_startup() {
|
||||
|
||||
if(display_mode != 5) {
|
||||
hideMenuBar();
|
||||
mainPtr.setMouseCursorVisible(false);
|
||||
}
|
||||
|
||||
// for(i = 0;i < 8; i++)
|
||||
@@ -239,9 +239,9 @@ void plop_fancy_startup() {
|
||||
|
||||
int delay = 220;
|
||||
if(show_startup_splash){
|
||||
intro_from.offset((whole_window.right - intro_from.right) / 2,(whole_window.bottom - intro_from.bottom) / 2);
|
||||
for(int k = 0; k < 5; k++) {
|
||||
mainPtr.clear(sf::Color::Black);
|
||||
intro_from.offset((whole_window.right - intro_from.right) / 2,(whole_window.bottom - intro_from.bottom) / 2);
|
||||
pict_to_draw.loadFromImage(*ResMgr::get<ImageRsrc>("startsplash"));
|
||||
from_rect = rectangle(pict_to_draw);
|
||||
rect_draw_some_item(pict_to_draw, from_rect, mainPtr, intro_from);
|
||||
|
||||
@@ -118,7 +118,7 @@ int main(int argc, char* argv[]) {
|
||||
cUniverse::print_result = iLiving::print_result = add_string_to_buf;
|
||||
cPlayer::give_help = give_help;
|
||||
init_graph_tool();
|
||||
Initialize();
|
||||
init_snd_tool();
|
||||
init_fileio();
|
||||
|
||||
init_buf();
|
||||
@@ -126,11 +126,10 @@ int main(int argc, char* argv[]) {
|
||||
check_for_intel();
|
||||
set_up_apple_events(argc, argv);
|
||||
make_cursor_watch();
|
||||
Initialize();
|
||||
plop_fancy_startup();
|
||||
|
||||
init_screen_locs();
|
||||
|
||||
init_snd_tool();
|
||||
cDialog::init();
|
||||
|
||||
flushingInput = true;
|
||||
|
||||
@@ -90,7 +90,7 @@ void play_sound(short which, short how_many_times) { // if < 0, play asynch
|
||||
which *= -1;
|
||||
|
||||
if(sndhandle) {
|
||||
chan[channel].reset(new sf::Sound(*sndhandle));
|
||||
chan[channel]->setBuffer(*sndhandle);
|
||||
chan[channel]->play();
|
||||
|
||||
if(which > 0) {
|
||||
|
||||
Reference in New Issue
Block a user