Menu

#3 Splash screen

open
nobody
None
5
2004-04-29
2004-04-29
Eric Munson
No

Add the capability to draw a splash screen when
entering and/or exiting the game.

Proposed code below (tested satisfactorily on FreeCiv,
but may not fit the framework model):

-- in Presentation.cpp, ~Presentation --

+ actionEngine.exitScreen(display.getDisplayCanvas());

delete currentScreen;

-- in Presentation.cpp, Presentation::begin --

display.captureScreen();

+ actionEngine.splashScreen(display.getDisplayCanvas());

-- in ActionEngine.h, class ActionEngine --

virtual Boolean getPreventAutoOff() const;

+ virtual void splashScreen(const Canvas *displayCanvas);
+ virtual void exitScreen(const Canvas *displayCanvas);

-- in ActionEngine.cpp, at end --

void
ActionEngine::splashScreen(const Canvas *displayCanvas)
{

}

void
ActionEngine::exitScreen(const Canvas *displayCanvas)
{

}

-- in MyActionEngine.h, class MyActionEngine --

static StateDescriptor *createStateDescriptor();
+ void splashScreen(const Canvas *displayCanvas);
+ void exitScreen(const Canvas *displayCanvas);

-- in MyActionEngine.cpp, at end --

void
MyActionEngine::splashScreen(const Canvas *displayCanvas) {

// Do splash-screen stuff here
// Displayed when game is opened

}

void
MyActionEngine::exitScreen(const Canvas *displayCanvas) {

// Do splash-screen stuff here
// Displayed when leaving game

}

Discussion


Log in to post a comment.

Auth0 Logo