Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Core/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ set(GAMEENGINE_SRC
# Include/GameClient/Image.h
Include/GameClient/IMEManager.h
# Include/GameClient/InGameUI.h
Include/GameClient/Intro.h
Include/GameClient/Keyboard.h
# Include/GameClient/KeyDefs.h
Include/GameClient/LanguageFilter.h
Expand Down Expand Up @@ -803,6 +804,7 @@ set(GAMEENGINE_SRC
# Source/GameClient/InGameUI.cpp
Source/GameClient/Input/Keyboard.cpp
Source/GameClient/Input/Mouse.cpp
Source/GameClient/Intro.cpp
Source/GameClient/LanguageFilter.cpp
Source/GameClient/Line2D.cpp
Source/GameClient/MapUtil.cpp
Expand Down
86 changes: 86 additions & 0 deletions Core/GameEngine/Include/GameClient/Intro.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2026 TheSuperHackers
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include <vector>

class DisplayString;
class Image;

class Intro
{
enum IntroState
{
IntroState_Start,
IntroState_EALogoMovie,
IntroState_TheSuperHackersWait,
IntroState_TheSuperHackers,
IntroState_SizzleMovieWait,
IntroState_SizzleMovie,
IntroState_Done,
};

struct DisplayEntity
{
DisplayEntity()
: displayString(nullptr)
, image(nullptr)
, sizeX(10)
, sizeY(10)
, screenHeightFactor(0.5f)
{}
~DisplayEntity();

DisplayString* displayString;
const Image* image;
Int sizeX;
Int sizeY;
Real screenHeightFactor; // 0..1
};

public:

Intro();

void update();
void draw();

void enterNextState();

Bool isDone() const { return m_currentState == IntroState_Done; }

private:

void doEALogoMovie();
void doTheSuperHackers();
void doSizzleMovie();
void doPostIntro();
void doAsyncWait(UnsignedInt milliseconds);

void drawDisplayEntities();

private:

IntroState m_currentState;
UnsignedInt m_allowedStateFlags;
UnsignedInt m_waitUntilMs;
UnicodeString m_unicodeStrings[1];
std::vector<DisplayEntity> m_displayEntities;
Real m_fadeValue;
};
Loading
Loading