ScummVM API documentation
title.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef ULTIMA1_VIEWS_TITLE_H
23#define ULTIMA1_VIEWS_TITLE_H
24
25#include "graphics/managed_surface.h"
26#include "graphics/palette.h"
27#include "ultima/shared/engine/view.h"
28#include "ultima/ultima1/gfx/render_mode.h"
29
30namespace Ultima {
31namespace Ultima1 {
32namespace Views {
33
34using namespace Graphics::Views;
35
40class Title : public Shared::View {
41private:
42 enum State {
43 PRESENTS, INTRO_A, INTRO_B, CASTLE, CREDITS
44 };
45 State _state = PRESENTS;
46 int _castleStep = 0;
47
48 // Logo pixel-reveal animation state (see revealLogoPixels)
49 int _logoPixelsDrawn = 0;
50 uint32 _logoLfsr = 1;
51 bool _logoTextShown = false;
52
53 // Credits screen's top/bottom logo slide-in state (see drawCreditsLogo)
54 int _creditsLine = 0;
55 bool _creditsTextShown = false;
56
57 // Assets loaded on msgFocus/freed on msgUnfocus: the Origin logo, the
58 // static castle picture, and its 3 animated flag frames
59 Graphics::ManagedSurface _logo, _castle;
61 Graphics::Palette _castlePalette;
62 Data::RenderMode _loadedMode = Data::RENDER_EGA;
63
67 void loadImages();
68
69 void showCredits();
70 void showMainMenu();
71 void drawCastleFlag(Graphics::Views::GfxSurface &s, int xp);
72 void resetLogoReveal();
73 void revealLogoPixels(Graphics::Views::GfxSurface &s);
74 void drawCreditsLogo(Graphics::Views::GfxSurface &s);
75
76public:
77 Title();
78 ~Title() override {}
79
80 bool msgFocus(const FocusMessage &msg) override;
81 bool msgUnfocus(const UnfocusMessage &msg) override;
82 void draw() override;
83 void timeout() override;
84
85 bool msgKeypress(const KeypressMessage &msg) override;
86 bool msgMouseDown(const MouseDownMessage &msg) override;
87 bool msgAction(const ActionMessage &msg) override;
88};
89
90} // namespace Views
91} // namespace Ultima1
92} // namespace Ultima
93
94#endif
Definition: managed_surface.h:51
Simple class for handling a palette data.
Definition: palette.h:61
Definition: gfx_surface.h:34
Definition: view.h:35
Definition: title.h:40
Definition: messages.h:118
Definition: messages.h:42
Definition: messages.h:54
Definition: messages.h:76
Definition: messages.h:50