World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Класс GUICredits

#include <UICredits.h>

+ Граф наследования:GUICredits:
+ Граф связей класса GUICredits:

Открытые члены

 GUICredits ()
 
virtual ~GUICredits ()
 
virtual void Update ()
 
void EventLoop ()
 
- Открытые члены унаследованные от GUIWindow
 GUIWindow ()
 
 GUIWindow (WindowType windowType, unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, int pButton, const String &hint=String())
 
virtual ~GUIWindow ()
 
GUIButtonCreateButton (int x, int y, int width, int height, int a6, int a7, UIMessageType msg, unsigned int msg_param, uint8_t hotkey, const String &label, const std::vector< Image * > &textures=std::vector< Image * >())
 
bool Contains (unsigned int x, unsigned int y)
 
void DrawFlashingInputCursor (int uX, int uY, GUIFont *a2)
 
int DrawTextInRect (GUIFont *font, unsigned int x, unsigned int y, unsigned int color, const char *text, int rect_width, int reverse_text)
 
int DrawTextInRect (GUIFont *font, unsigned int x, unsigned int y, unsigned int color, String &str, int rect_width, int reverse_text)
 
void DrawText (GUIFont *font, int x, int y, unsigned short uFontColor, const char *str, bool present_time_transparency=false, int max_text_height=0, int uFontShadowColor=0)
 
void DrawText (GUIFont *font, int x, int y, unsigned short uFontColor, const String &str, bool present_time_transparency=false, int max_text_height=0, int uFontShadowColor=0)
 
void DrawTitleText (GUIFont *font, int horizontal_margin, int vertical_margin, unsigned __int16 uDefaultColor, const char *pInString, int line_spacing)
 
void DrawTitleText (GUIFont *font, int horizontal_margin, int vertical_margin, unsigned __int16 uDefaultColor, const String &str, int line_spacing)
 
void DrawShops_next_generation_time_string (GameTime time)
 
void HouseDialogManager ()
 
void DrawMessageBox (bool inside_game_viewport)
 
GUIButtonGetControl (unsigned int uID)
 
void _41D08F_set_keyboard_control_group (int num_buttons, int a3, int a4, int a5)
 
void _41D73D_draw_buff_tooltip ()
 
virtual void Release ()
 
void DeleteButtons ()
 

Открытые статические члены

static void ExecuteCredits ()
 
- Открытые статические члены унаследованные от GUIWindow
static void InitializeGUI ()
 

Защищенные данные

GUIFontpFontQuick
 
GUIFontpFontCChar
 
Imagemm6title
 
int width
 
int height
 
Texturecred_texture
 
int move_Y
 
int tick
 

Дополнительные унаследованные члены

- Открытые атрибуты унаследованные от GUIWindow
unsigned int uFrameX
 
unsigned int uFrameY
 
unsigned int uFrameWidth
 
unsigned int uFrameHeight
 
unsigned int uFrameZ
 
unsigned int uFrameW
 
WindowType eWindowType
 
union {
   void *   ptr_1C
 
   unsigned int   par1C
 
}; 
 
int field_24
 
int pNumPresenceButton
 
int pCurrentPosActiveItem
 
int field_30
 
int field_34
 
int pStartingPosActiveItem
 
int receives_keyboard_input_2
 
bool receives_keyboard_input
 
String sHint
 
std::vector< GUIButton * > vButtons
 
Mousemouse = nullptr
 
Loglog = nullptr
 

Подробное описание

См. определение в файле UICredits.h строка 7

Конструктор(ы)

◆ GUICredits()

GUICredits::GUICredits ( )

См. определение в файле UICredits.cpp строка 15

15  :
16  GUIWindow(WINDOW_Credits, 0, 0, window->GetWidth(), window->GetHeight(), 0) {
17  pFontQuick = GUIFont::LoadFont("quick.fnt", "FONTPAL", NULL);
18  pFontCChar = GUIFont::LoadFont("cchar.fnt", "FONTPAL", NULL);
19 
20  mm6title = assets->GetImage_PCXFromIconsLOD("mm6title.pcx");
21 
22  char *text = (char *)pEvents_LOD->LoadCompressedTexture("credits.txt");
23 
24  GUIWindow credit_window;
25  credit_window.uFrameWidth = 250;
26  credit_window.uFrameHeight = 440;
27  credit_window.uFrameX = 389;
28  credit_window.uFrameY = 19;
29 
30  width = 250;
31  height = pFontQuick->GetStringHeight2(pFontCChar, text, &credit_window, 0, 1) + 2 * credit_window.uFrameHeight;
32  // cred_texture = Image::Create(width, height, IMAGE_FORMAT_A8R8G8B8);
33  cred_texture = render->CreateTexture_Blank(width, height, IMAGE_FORMAT_A8R8G8B8);
34 
35  // дать шрифт и цвета тексту
37  Color16(0x70u, 0x8Fu, 0xFEu), Color16(0xECu, 0xE6u, 0x9Cu),
38  text, cred_texture);
39 
40  render->Update_Texture(cred_texture);
41  free(text);
42 
43  move_Y = 0;
44  tick = 0;
45 
46  CreateButton(0, 0, 0, 0, 1, 0, UIMSG_Escape, 0, 27, "");
47 }

Перекрестные ссылки assets, Color16(), GUIWindow::CreateButton(), cred_texture, GUIFont::DrawCreditsEntry(), AssetsManager::GetImage_PCXFromIconsLOD(), GUIFont::GetStringHeight2(), IMAGE_FORMAT_A8R8G8B8, LOD::File::LoadCompressedTexture(), GUIFont::LoadFont(), mm6title, move_Y, pEvents_LOD, pFontCChar, pFontQuick, render, tick, GUIWindow::uFrameHeight, GUIWindow::uFrameWidth, GUIWindow::uFrameX, GUIWindow::uFrameY и UIMSG_Escape.

Используется в ExecuteCredits().

+ Граф вызовов:
+ Граф вызова функции:

◆ ~GUICredits()

GUICredits::~GUICredits ( )
virtual

См. определение в файле UICredits.cpp строка 49

Перекрестные ссылки cred_texture, mm6title, pIcons_LOD, Image::Release() и LODFile_IconsBitmaps::RemoveTexturesPackFromTextureList().

+ Граф вызовов:

Методы

◆ Update()

void GUICredits::Update ( )
virtual

Переопределяет метод предка GUIWindow.

См. определение в файле UICredits.cpp строка 55

55  {
56  GUIWindow credit_window;
57  credit_window.uFrameWidth = 250;
58  credit_window.uFrameHeight = 440;
59  credit_window.uFrameX = 389;
60  credit_window.uFrameY = 19;
61 
62  render->DrawTextureNew(0, 0, mm6title);
63  render->SetUIClipRect(credit_window.uFrameX, credit_window.uFrameY,
64  credit_window.uFrameX + credit_window.uFrameWidth,
65  credit_window.uFrameY + credit_window.uFrameHeight);
66  render->DrawTextureOffset(credit_window.uFrameX, credit_window.uFrameY, 0, move_Y, cred_texture);
67  render->ResetUIClipRect();
68  tick++;
69  if (tick == 4) {
70  tick = 0;
71  ++move_Y;
72  }
73  if (move_Y >= cred_texture->GetHeight()) {
75  }
76 }

Перекрестные ссылки cred_texture, Image::GetHeight(), MENU_MAIN, mm6title, move_Y, render, SetCurrentMenuID(), tick, GUIWindow::uFrameHeight, GUIWindow::uFrameWidth, GUIWindow::uFrameX и GUIWindow::uFrameY.

+ Граф вызовов:

◆ ExecuteCredits()

void GUICredits::ExecuteCredits ( )
static

См. определение в файле UICredits.cpp строка 95

95  {
97 
99 
100  GUICredits *pWindow_Credits = new GUICredits();
103 
104  while (GetCurrentMenuID() == MENU_CREDITSPROC) {
105  window->PeekMessageLoop();
106  if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE) {
107  OS_WaitMessage();
108  continue;
109  }
110 
111  render->BeginScene();
112  {
113  pWindow_Credits->EventLoop();
115  }
116  render->EndScene();
117  render->Present();
118  }
119 
121  pAudioPlayer->StopAll(1);
122 
123  pWindow_Credits->Release();
124  delete pWindow_Credits;
125 }

Перекрестные ссылки current_screen_type, dword_6BE364_game_settings_1, EventLoop(), GUIMessageQueue::Flush(), GetCurrentMenuID(), GUI_UpdateWindows(), GUICredits(), MENU_CREDITSPROC, MUSIC_Credits, AudioPlayer::MusicPlayTrack(), AudioPlayer::MusicStop(), OS_WaitMessage(), pAudioPlayer, pMessageQueue_50CBD0, GUIWindow::Release(), render, SCREEN_CREATORS, SetCurrentMenuID() и AudioPlayer::StopAll().

Используется в Application::Game::Loop().

+ Граф вызовов:
+ Граф вызова функции:

◆ EventLoop()

void GUICredits::EventLoop ( )

См. определение в файле UICredits.cpp строка 78

78  {
79  while (!pMessageQueue_50CBD0->Empty()) {
80  UIMessageType pUIMessageType;
81  int pParam;
82  int param2;
83  pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &pParam, &param2);
84 
85  switch (pUIMessageType) { // For buttons of window MainMenu
86  case UIMSG_Escape:
88  break;
89  default:
90  break;
91  }
92  }
93 }

Перекрестные ссылки GUIMessageQueue::Empty(), MENU_MAIN, pMessageQueue_50CBD0, GUIMessageQueue::PopMessage(), SetCurrentMenuID() и UIMSG_Escape.

Используется в ExecuteCredits().

+ Граф вызовов:
+ Граф вызова функции:

Данные класса

◆ pFontQuick

GUIFont* GUICredits::pFontQuick
protected

См. определение в файле UICredits.h строка 18

Используется в GUICredits().

◆ pFontCChar

GUIFont* GUICredits::pFontCChar
protected

См. определение в файле UICredits.h строка 19

Используется в GUICredits().

◆ mm6title

Image* GUICredits::mm6title
protected

См. определение в файле UICredits.h строка 21

Используется в GUICredits(), Update() и ~GUICredits().

◆ width

int GUICredits::width
protected

См. определение в файле UICredits.h строка 23

◆ height

int GUICredits::height
protected

См. определение в файле UICredits.h строка 24

◆ cred_texture

Texture* GUICredits::cred_texture
protected

См. определение в файле UICredits.h строка 25

Используется в GUICredits(), Update() и ~GUICredits().

◆ move_Y

int GUICredits::move_Y
protected

См. определение в файле UICredits.h строка 26

Используется в GUICredits() и Update().

◆ tick

int GUICredits::tick
protected

См. определение в файле UICredits.h строка 27

Используется в GUICredits() и Update().


Объявления и описания членов классов находятся в файлах:
GUICredits::move_Y
int move_Y
Definition: UICredits.h:26
UIMessageType
UIMessageType
Definition: GUIWindow.h:13
GUIMessageQueue::Empty
bool Empty()
Definition: GUIWindow.h:659
UIMSG_Escape
@ UIMSG_Escape
Definition: GUIWindow.h:96
Image::GetHeight
unsigned int GetHeight()
Definition: Image.cpp:230
GUIWindow
Definition: GUIWindow.h:433
GUIFont::DrawCreditsEntry
void DrawCreditsEntry(GUIFont *pSecondFont, int uFrameX, int uFrameY, unsigned int w, unsigned int h, uint16_t firstColor, uint16_t secondColor, const String &pString, Image *image)
Definition: GUIFont.cpp:611
GUICredits::mm6title
Image * mm6title
Definition: UICredits.h:21
GUIWindow::CreateButton
GUIButton * CreateButton(int x, int y, int width, int height, int a6, int a7, UIMessageType msg, unsigned int msg_param, uint8_t hotkey, const String &label, const std::vector< Image * > &textures=std::vector< Image * >())
Definition: GUIWindow.cpp:717
LOD::File::LoadCompressedTexture
void * LoadCompressedTexture(const String &pContainer, size_t *data_size=nullptr)
Definition: LOD.cpp:921
SetCurrentMenuID
void SetCurrentMenuID(MENU_STATE uMenu)
Definition: GUIWindow.cpp:128
GUICredits::GUICredits
GUICredits()
Definition: UICredits.cpp:15
height
EGLSurface EGLint EGLint EGLint EGLint height
Definition: SDL_egl.h:1596
GUIMessageQueue::Flush
void Flush()
Definition: GUIWindow.cpp:159
GUICredits::pFontQuick
GUIFont * pFontQuick
Definition: UICredits.h:18
GUIWindow::GUIWindow
GUIWindow()
Definition: GUIWindow.cpp:765
AudioPlayer::MusicPlayTrack
void MusicPlayTrack(enum MusicID eTrack)
Definition: AudioPlayer.cpp:109
MENU_MAIN
@ MENU_MAIN
Definition: GUIWindow.h:251
AssetsManager::GetImage_PCXFromIconsLOD
Texture * GetImage_PCXFromIconsLOD(const String &name)
Definition: AssetsManager.cpp:81
GUIWindow::Release
virtual void Release()
Definition: GUIWindow.cpp:292
GUIFont::GetStringHeight2
int GetStringHeight2(GUIFont *secondFont, const String &text_str, GUIWindow *pWindow, int startX, int a6)
Definition: GUIFont.cpp:747
GUIWindow::uFrameWidth
unsigned int uFrameWidth
Definition: GUIWindow.h:470
current_screen_type
enum CURRENT_SCREEN current_screen_type
Definition: GUIWindow.cpp:83
AudioPlayer::StopAll
void StopAll(int sample_id)
Definition: AudioPlayer.cpp:189
GetCurrentMenuID
MENU_STATE GetCurrentMenuID()
Definition: GUIWindow.cpp:133
IMAGE_FORMAT_A8R8G8B8
@ IMAGE_FORMAT_A8R8G8B8
Definition: Image.h:7
AudioPlayer::MusicStop
void MusicStop()
Definition: AudioPlayer.cpp:140
GUICredits
Definition: UICredits.h:7
CURRENT_SCREEN::SCREEN_CREATORS
@ SCREEN_CREATORS
GUIWindow::uFrameHeight
unsigned int uFrameHeight
Definition: GUIWindow.h:471
GUIFont::LoadFont
static GUIFont * LoadFont(const char *pFontFile, const char *pFontPalette,...)
Definition: GUIFont.cpp:56
width
EGLSurface EGLint EGLint EGLint width
Definition: SDL_egl.h:1596
pIcons_LOD
LODFile_IconsBitmaps * pIcons_LOD
Definition: LOD.cpp:12
window
EGLSurface EGLNativeWindowType * window
Definition: SDL_egl.h:1580
MUSIC_Credits
@ MUSIC_Credits
Definition: AudioPlayer.h:109
GUI_UpdateWindows
void GUI_UpdateWindows()
Definition: GUIWindow.cpp:956
GUIMessageQueue::PopMessage
void PopMessage(UIMessageType *pMsg, int *pParam, int *a4)
Definition: GUIWindow.cpp:174
GUICredits::tick
int tick
Definition: UICredits.h:27
GUICredits::cred_texture
Texture * cred_texture
Definition: UICredits.h:25
GUIWindow::uFrameY
unsigned int uFrameY
Definition: GUIWindow.h:469
pEvents_LOD
LODFile_IconsBitmaps * pEvents_LOD
Definition: LOD.cpp:10
MENU_CREDITSPROC
@ MENU_CREDITSPROC
Definition: GUIWindow.h:259
LODFile_IconsBitmaps::RemoveTexturesPackFromTextureList
void RemoveTexturesPackFromTextureList()
Definition: LOD.cpp:74
GUICredits::pFontCChar
GUIFont * pFontCChar
Definition: UICredits.h:19
assets
AssetsManager * assets
Definition: AssetsManager.cpp:12
WINDOW_Credits
@ WINDOW_Credits
Definition: GUIWindow.h:347
dword_6BE364_game_settings_1
int dword_6BE364_game_settings_1
Definition: mm7_data.cpp:714
GUIWindow::uFrameX
unsigned int uFrameX
Definition: GUIWindow.h:468
pAudioPlayer
AudioPlayer * pAudioPlayer
Definition: AudioPlayer.cpp:20
pMessageQueue_50CBD0
struct GUIMessageQueue * pMessageQueue_50CBD0
Definition: GUIWindow.cpp:86
Color16
uint16_t Color16(uint32_t r, uint32_t g, uint32_t b)
Definition: Engine.cpp:148
GUICredits::EventLoop
void EventLoop()
Definition: UICredits.cpp:78
OS_WaitMessage
void OS_WaitMessage()
Definition: Lin.cpp:32
Image::Release
bool Release()
Definition: Image.cpp:335
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52