* Adds a new child surface for the state to take care of, * giving it the game's display palette. Once associated, * the state handles all of the surface's behaviour * and management automatically. * @param surface Child surface. * @note Since visible elements can overlap one another, * they have to be added in ascending Z-Order to be blitted * correctly onto the screen. */
| 73 | * correctly onto the screen. |
| 74 | */ |
| 75 | void State::add(Surface *surface) |
| 76 | { |
| 77 | // Set palette |
| 78 | surface->setPalette(_palette); |
| 79 | |
| 80 | // Set default text resources |
| 81 | if (_game->getLanguage() && _game->getResourcePack()) |
| 82 | surface->initText(_game->getResourcePack()->getFont("FONT_BIG"), _game->getResourcePack()->getFont("FONT_SMALL"), _game->getLanguage()); |
| 83 | |
| 84 | _surfaces.push_back(surface); |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Returns whether this is a full-screen state. |
nothing calls this directly
no test coverage detected