annotate Engine/MMT.cpp @ 2544:c674d547cc7c

GUIWindow switch logic refactored into behaviour classes
author a.parshin
date Mon, 11 May 2015 09:51:04 +0200
parents a902abdfc7f2
children f9bdfe26d03d
rev   line source
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1 #define _CRTDBG_MAP_ALLOC
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2 #include <stdlib.h>
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3 #include <crtdbg.h>
2509
fc5e83bbafd1 FileExists
Ritor1
parents: 2508
diff changeset
4 #include <io.h>
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
6
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
7 #include "Engine/Engine.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
8
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
9 #include "MMT.h"
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2499
diff changeset
10 #include "GUI/GUIWindow.h"
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
11
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2499
diff changeset
12 #include "Media/Audio/AudioPlayer.h"
a77c34acdbc9 Media folder
Ritor1
parents: 2499
diff changeset
13 #include "IO/Mouse.h"
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
14 #include "LOD.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
15 #include "Engine/Graphics/Render.h"
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2499
diff changeset
16 #include "GUI/GUIFont.h"
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
17 #include "lib/libpng/png.h"
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2499
diff changeset
18 #include "Media/Video/Bink_Smacker.h"
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
19
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
20 #include "Game/MainMenu.h"
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
21
2509
fc5e83bbafd1 FileExists
Ritor1
parents: 2508
diff changeset
22 bool FileExists(const char *fname)
fc5e83bbafd1 FileExists
Ritor1
parents: 2508
diff changeset
23 {
fc5e83bbafd1 FileExists
Ritor1
parents: 2508
diff changeset
24 return access(fname, 0) != -1;
fc5e83bbafd1 FileExists
Ritor1
parents: 2508
diff changeset
25 }
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
26
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
27 void ShowLogoVideo()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
28 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
29 RGBTexture tex; // [sp+Ch] [bp-30h]@1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
30 unsigned int uTrackStartMS; // [sp+34h] [bp-8h]@8
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
31 unsigned int uTrackEndMS; // [sp+38h] [bp-4h]@8
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
32
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
33 pMediaPlayer->bStopBeforeSchedule = false;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
34
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
35 // pMediaPlayer->pResetflag = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
36 bGameoverLoop = 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
37 if (!bNoVideo)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
38 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
39 pRenderer->PresentBlackScreen();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
40 pMediaPlayer->PlayFullscreenMovie(MOVIE_3DOLogo, true);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
41 if ( !pMediaPlayer->bStopBeforeSchedule )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
42 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
43 pMediaPlayer->PlayFullscreenMovie(MOVIE_NWCLogo, true);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
44 if ( !pMediaPlayer->bStopBeforeSchedule )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
45 {
2520
9f7908a4d8e6 MOVIE_JVC not crash
Ritor1
parents: 2519
diff changeset
46 if ( !pMediaPlayer->bStopBeforeSchedule )
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
47 {
2520
9f7908a4d8e6 MOVIE_JVC not crash
Ritor1
parents: 2519
diff changeset
48 pMediaPlayer->PlayFullscreenMovie(MOVIE_JVC, true);
9f7908a4d8e6 MOVIE_JVC not crash
Ritor1
parents: 2519
diff changeset
49 if ( !pMediaPlayer->bStopBeforeSchedule )
9f7908a4d8e6 MOVIE_JVC not crash
Ritor1
parents: 2519
diff changeset
50 {
9f7908a4d8e6 MOVIE_JVC not crash
Ritor1
parents: 2519
diff changeset
51 if (!use_MMT)
9f7908a4d8e6 MOVIE_JVC not crash
Ritor1
parents: 2519
diff changeset
52 pMediaPlayer->PlayFullscreenMovie(MOVIE_Intro, true);
9f7908a4d8e6 MOVIE_JVC not crash
Ritor1
parents: 2519
diff changeset
53 }
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
54 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
55 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
56 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
57 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
58
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
59 if (use_MMT)
2518
3a1b56ab8749 d3d11 accepts RGBTexture
a.parshin
parents: 2511
diff changeset
60 tex.LoadPCXFile("data/New_Icons/MMTTITLE.pcx", 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
61 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
62 tex.Load("mm6title.pcx", 2);
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
63
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
64 pRenderer->ResetUIClipRect();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
65 pRenderer->BeginScene();
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
66 {
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
67 pRenderer->DrawTextureNew(0, 0, &tex);
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
68 }
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
69 pRenderer->EndScene();
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
70 pRenderer->Present();
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
71
2518
3a1b56ab8749 d3d11 accepts RGBTexture
a.parshin
parents: 2511
diff changeset
72 tex.Release();
3a1b56ab8749 d3d11 accepts RGBTexture
a.parshin
parents: 2511
diff changeset
73
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
74 MainMenuUI_LoadFontsAndSomeStuff();
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
75
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
76 pRenderer->BeginScene();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
77 if (use_MMT)
2518
3a1b56ab8749 d3d11 accepts RGBTexture
a.parshin
parents: 2511
diff changeset
78 DrawMMTCopyrightWindow();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
79 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
80 DrawMM7CopyrightWindow();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
81
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
82 pRenderer->EndScene();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
83 pRenderer->Present();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
84
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
85 #ifdef NDEBUG
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
86 Sleep(1500); // let the copyright window stay for a while
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
87 #endif
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
88
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
89 if (!use_MMT)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
90 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
91 if (!bNoSound && pAudioPlayer->hAILRedbook )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
92 {
2508
491f0babd563 use_music_folder
Ritor1
parents: 2506
diff changeset
93 if ( use_music_folder )
491f0babd563 use_music_folder
Ritor1
parents: 2506
diff changeset
94 {
2509
fc5e83bbafd1 FileExists
Ritor1
parents: 2508
diff changeset
95 if (!FileExists("Music\\14.mp3"))
fc5e83bbafd1 FileExists
Ritor1
parents: 2508
diff changeset
96 {
fc5e83bbafd1 FileExists
Ritor1
parents: 2508
diff changeset
97 Log::Warning(L"File 14.mp3 in Music\\ folder not found");
2511
fb1c61a82a55 uHouseID - 1
Ritor1
parents: 2509
diff changeset
98 //Error("File 14.mp3 in Music\\ folder not found");
2509
fc5e83bbafd1 FileExists
Ritor1
parents: 2508
diff changeset
99 return;
fc5e83bbafd1 FileExists
Ritor1
parents: 2508
diff changeset
100 }
2508
491f0babd563 use_music_folder
Ritor1
parents: 2506
diff changeset
101 PlayAudio(L"Music\\14.mp3");
491f0babd563 use_music_folder
Ritor1
parents: 2506
diff changeset
102 alSourcef (mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
491f0babd563 use_music_folder
Ritor1
parents: 2506
diff changeset
103 }
491f0babd563 use_music_folder
Ritor1
parents: 2506
diff changeset
104 else
491f0babd563 use_music_folder
Ritor1
parents: 2506
diff changeset
105 {
491f0babd563 use_music_folder
Ritor1
parents: 2506
diff changeset
106 pAudioPlayer->SetMusicVolume((signed __int64)(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0));
491f0babd563 use_music_folder
Ritor1
parents: 2506
diff changeset
107 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
491f0babd563 use_music_folder
Ritor1
parents: 2506
diff changeset
108 AIL_redbook_track_info(pAudioPlayer->hAILRedbook, 14, &uTrackStartMS, &uTrackEndMS);
491f0babd563 use_music_folder
Ritor1
parents: 2506
diff changeset
109 AIL_redbook_play(pAudioPlayer->hAILRedbook, uTrackStartMS + 1, uTrackEndMS);
491f0babd563 use_music_folder
Ritor1
parents: 2506
diff changeset
110 }
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
111 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
112 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
113 bGameoverLoop = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
114 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
115
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
116
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
117 Texture *LoadPNG(const char *name)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
118 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
119 int x, y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
120 int width, height;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
121 png_byte color_type;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
122 png_byte bit_depth;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
123 png_structp png_ptr;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
124 png_infop info_ptr;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
125 int number_of_passes;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
126 png_bytep * row_pointers;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
127 uint i = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
128 Texture *tex;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
129
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
130 char header[8]; // 8 is the maximum size that can be checked
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
131
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
132 /* open file and test for it being a png */
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
133 FILE *fp = fopen(name, "rb");
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
134 if (!fp)
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
135 Error("[read_png_file] File %s could not be opened for reading", name);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
136 fread(header, 1, 8, fp);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
137 if (png_sig_cmp((png_bytep)header, 0, 8))
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
138 Error("[read_png_file] File %s is not recognized as a PNG file", name);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
139 /* initialize stuff */
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
140 png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
141
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
142 if (!png_ptr)
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
143 Error("[read_png_file] png_create_read_struct failed");
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
144 info_ptr = png_create_info_struct(png_ptr);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
145 if (!info_ptr)
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
146 Error("[read_png_file] png_create_info_struct failed");
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
147
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
148 if (setjmp(png_jmpbuf(png_ptr)))
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
149 Error("[read_png_file] Error during init_io");
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
150
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
151 png_init_io(png_ptr, fp);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
152 png_set_sig_bytes(png_ptr, 8);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
153
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
154 png_read_info(png_ptr, info_ptr);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
155
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
156 width = png_get_image_width(png_ptr, info_ptr);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
157 height = png_get_image_height(png_ptr, info_ptr);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
158 color_type = png_get_color_type(png_ptr, info_ptr);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
159 bit_depth = png_get_bit_depth(png_ptr, info_ptr);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
160
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
161 number_of_passes = png_set_interlace_handling(png_ptr);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
162 png_read_update_info(png_ptr, info_ptr);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
163
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
164 /* read file */
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
165 if (setjmp(png_jmpbuf(png_ptr)))
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2523
diff changeset
166 Error("[read_png_file] Error during read_image");
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
167 row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * height);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
168 for (y=0; y<height; y++)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
169 row_pointers[y] = (png_byte*) malloc(png_get_rowbytes(png_ptr,info_ptr));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
170
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
171 png_read_image(png_ptr, row_pointers);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
172
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
173 fclose(fp);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
174
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
175 tex = new Texture;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
176 tex->uTextureHeight = height;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
177 tex->uTextureWidth = width;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
178 tex->uSizeOfMaxLevelOfDetail = png_get_rowbytes(png_ptr, info_ptr);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
179 tex->uTextureSize = png_get_rowbytes(png_ptr, info_ptr);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
180 tex->uDecompressedSize = png_get_rowbytes(png_ptr, info_ptr);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
181 tex->pPalette16 = (unsigned __int16 *) malloc(sizeof(unsigned __int16) * width * height);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
182 tex->pLevelOfDetail0_prolly_alpha_mask = (unsigned __int8 *) malloc(sizeof(unsigned __int8) * width * height);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
183
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
184 for (y=0; y<height; y++)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
185 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
186 png_byte* row = row_pointers[y];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
187 for (x=0; x<width; x++)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
188 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
189 png_byte* ptr = &(row[x*4]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
190 //Log::Warning(L"Pixel at position [ %d - %d ] has RGBA values: %d - %d - %d - %d\n",
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
191 // x, y, ptr[0], ptr[1], ptr[2], ptr[3]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
192 png_byte tmp = ptr[2];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
193 ptr[2] = ptr[0];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
194 ptr[0] = ptr[3];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
195 //ptr[3] = 255 - ptr[3]; // alpha mask gradient
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
196 ptr[3] = 255 - tmp;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
197 tex->pPalette16[i] = Color16(ptr[0], ptr[1], ptr[2]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
198 tex->pLevelOfDetail0_prolly_alpha_mask[i] = ptr[3];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
199 i++;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
200 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
201 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
202 //Ritor1: temporarily stopped, needed change RGBTexture structure
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
203 /*for (int i = 0; i < width * height; ++i)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
204 tex->pPalette16[i] = 0x7FF;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
205 memset(tex->pLevelOfDetail0_prolly_alpha_mask, 1, sizeof(unsigned __int8) * width * height);*/
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
206 return tex;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
207 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
208
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
209 void MMT_MainMenu_Loop()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
210 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
211 GUIButton *pButton; // eax@27
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
212 unsigned int pControlParam; // ecx@35
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
213 unsigned int pX;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
214 unsigned int pY; // [sp-18h] [bp-54h]@39
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
215 Texture *pTexture; // [sp-14h] [bp-50h]@39
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
216 char pContainerName[64];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
217 MSG msg;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
218
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
219 current_screen_type = SCREEN_GAME;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
220
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
221 pGUIWindow2 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
222 pAudioPlayer->StopChannels(-1, -1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
223
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
224 if (!bNoSound )
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
225 PlayAudio(L"Sounds\\New_Sounds/Stronghold_Theme.mp3");
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
226 //if (!bNoVideo )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
227 //pVideoPlayer->PlayMovie(L"Anims\\New_Video/3DOLOGO.smk");
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
228
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
229 pMouse->RemoveHoldingItem();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
230
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
231 pIcons_LOD->_inlined_sub2();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
232
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
233 //Create new window
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
234 //WINDOW_MainMenu included in GUIWindow.h
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
235 pWindow_MMT_MainMenu = new GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
236
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
237 //load buttons
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
238 //Texture* MMT_MM6 = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
239
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
240 sprintf(pContainerName, "data\\New_Icons/%s", "mm6_button_oval.png");
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
241 Texture* MMT_MM6 = LoadPNG(pContainerName);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
242
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
243 Texture* MMT_MM7 = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
244 Texture* MMT_MM8 = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
245 Texture* MMT_Continue = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
246 Texture* MMT_Exit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
247
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
248 pMMT_MainMenu_BtnMM6 = pWindow_MMT_MainMenu->CreateButton(0, 0, MMT_MM6->uTextureWidth, MMT_MM6->uTextureHeight, 1, 0, UIMSG_MMT_MainMenu_MM6, 0, 0, "", MMT_MM6, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
249 pMMT_MainMenu_BtnMM7 = pWindow_MMT_MainMenu->CreateButton(window->GetWidth() - (window->GetWidth() / 4), window->GetHeight() / 4, MMT_MM7->uTextureWidth, MMT_MM7->uTextureHeight, 1, 0, UIMSG_MMT_MainMenu_MM7, 1, 0, "", MMT_MM7, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
250 pMMT_MainMenu_BtnMM8 = pWindow_MMT_MainMenu->CreateButton(window->GetWidth() - (window->GetWidth() / 4), window->GetHeight() - ((window->GetHeight() / 4) + 50), MMT_MM8->uTextureWidth, MMT_MM8->uTextureHeight, 1, 0, UIMSG_MMT_MainMenu_MM8, 2, 0, "", MMT_MM8, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
251 pMMT_MainMenu_BtnContinue = pWindow_MMT_MainMenu->CreateButton((window->GetWidth() / 4) - 100, window->GetHeight() - ((window->GetHeight() / 4) + 50), MMT_Continue->uTextureWidth, MMT_Continue->uTextureHeight, 1, 0, UIMSG_MMT_MainMenu_Continue, 3, 0, "", MMT_Continue, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
252 pMMT_MainMenu_BtnExit = pWindow_MMT_MainMenu->CreateButton(window->GetWidth() - 130, window->GetHeight() - 35, MMT_Exit->uTextureWidth, MMT_Exit->uTextureHeight, 1, 0, UIMSG_ExitToWindows, 4, 0, "", MMT_Exit, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
253
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
254 main_menu_background.Release();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
255
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
256 sprintf(pContainerName, "data\\New_Icons/%s", "MMTTITLE.pcx");
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
257 if (main_menu_background.LoadPCXFile(pContainerName, 0) == 1)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
258 Error("File not found: %s", pContainerName);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
259
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
260 SetCurrentMenuID(MENU_MMT_MAIN_MENU);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
261 SetForegroundWindow(window->GetApiHandle());
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
262 SendMessageW(window->GetApiHandle(), WM_ACTIVATEAPP, 1, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
263 while (GetCurrentMenuID() == MENU_MMT_MAIN_MENU )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
264 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
265 POINT cursor;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
266 pMouse->GetCursorPos(&cursor);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
267
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
268 while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE))
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
269 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
270 if (msg.message == WM_QUIT)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
271 Engine_DeinitializeAndTerminate(0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
272 TranslateMessage(&msg);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
273 DispatchMessageW(&msg);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
274 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
275
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
276 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
277 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
278 WaitMessage();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
279 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
280 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
281
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
282 pRenderer->BeginScene();
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
283 pRenderer->DrawTextureRGB(0, 0, &main_menu_background);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
284
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
285 MMT_MenuMessageProc();//for ÌÌÒ menu
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
286 GUI_UpdateWindows();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
287
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
288 if ( !pModalWindow )// ???
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
289 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
290 pButton = pWindow_MMT_MainMenu->pControlsHead;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
291 for ( pButton = pWindow_MMT_MainMenu->pControlsHead; pButton; pButton = pButton->pNext )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
292 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
293 if ( cursor.x >= (signed int)pButton->uX && cursor.x <= (signed int)pButton->uZ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
294 && cursor.y >= (signed int)pButton->uY && cursor.y <= (signed int)pButton->uW )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
295 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
296 pControlParam = pButton->msg_param;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
297 switch (pControlParam) // backlight for buttons
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
298 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
299 case 0:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
300 pTexture = MMT_MM6;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
301 pX = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
302 pY = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
303 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
304 case 1:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
305 pTexture = MMT_MM7;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
306 pX = window->GetWidth() - (window->GetWidth() / 4);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
307 pY = window->GetHeight() / 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
308 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
309 case 2:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
310 pTexture = MMT_MM8;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
311 pX = window->GetWidth() - (window->GetWidth() / 4);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
312 pY = window->GetHeight() - ((window->GetHeight() / 4) + 50);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
313 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
314 case 3:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
315 pTexture = MMT_Continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
316 pX = (window->GetWidth() / 4) - 100;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
317 pY = window->GetHeight() - ((window->GetHeight() / 4) + 50);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
318 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
319 case 4:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
320 pTexture = MMT_Exit;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
321 pX = window->GetWidth() - 130;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
322 pY = window->GetHeight() - 35;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
323 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
324 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
325 pRenderer->DrawTextureIndexed(pX, pY, pTexture);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
326 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
327 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
328 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
329 //}
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
330 pRenderer->EndScene();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
331 pRenderer->Present();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
332 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
333 MMT_MenuMessageProc();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
334 pRenderer->BeginScene();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
335 GUI_UpdateWindows();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
336 pRenderer->EndScene();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
337 pRenderer->Present();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
338
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
339 //remove resource
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
340 main_menu_background.Release();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
341 if ( pGUIWindow2 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
342 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
343 pGUIWindow2->Release();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
344 pGUIWindow2 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
345 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
346 pWindow_MMT_MainMenu->Release();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
347 pIcons_LOD->RemoveTexturesPackFromTextureList();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
348 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
349
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
350 void MMT_MenuMessageProc()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
351 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
352 int pParam;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
353 int pParam2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
354 UIMessageType pUIMessageType;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
355
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
356 if ( pMessageQueue_50CBD0->uNumMessages )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
357 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
358 do
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
359 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
360 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &pParam, &pParam2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
361
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
362 switch (pUIMessageType)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
363 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
364 case UIMSG_MMT_MainMenu_MM6:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
365 //video
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
366 //SetCurrentMenuID(MENU_MAIN_MM6);
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
367 alSourcef (mSourceID, AL_GAIN, 0.5f);
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
368 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);//temporarily
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
369 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
370 case UIMSG_MMT_MainMenu_MM7: //new button for ÌÌ7
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
371 //GUIWindow::Create(495, 172, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
372 alSourceStop(mSourceID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
373 pMediaPlayer->ShowMM7IntroVideo_and_LoadingScreen();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
374 SetCurrentMenuID(MENU_MAIN);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
375 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
376 case UIMSG_MMT_MainMenu_MM8:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
377 //video
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
378 //SetCurrentMenuID(MENU_MAIN_MM8);
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
379 alSourcei (mSourceID, AL_LOOPING, 1);
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
380 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);//temporarily
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
381 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
382 case UIMSG_MMT_MainMenu_Continue:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
383 //video
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
384 //SetCurrentMenuID(MENU_MAIN_Continue);
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
385 alSourcef (mSourceID, AL_GAIN, 1.0f);
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
386 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);//temporarily
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
387 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
388 case UIMSG_ExitToWindows:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
389 extern GUIButton *pMainMenu_BtnExit;
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
390 new OnButtonClick2(495, 337, 0, 0, (int)pMainMenu_BtnExit, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
391 SetCurrentMenuID(MENU_EXIT_GAME);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
392
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
393 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
394 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
395 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
396 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
397 while ( pMessageQueue_50CBD0->uNumMessages );
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
398 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
399 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
400 void DrawMMTCopyrightWindow()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
401 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
402 GUIWindow Dst; // [sp+8h] [bp-54h]@1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
403
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
404 memset(&Dst, 0, 0x54u);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
405 Dst.uFrameWidth = 624;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
406 Dst.uFrameHeight = 256;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
407 Dst.uFrameX = 8;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
408 Dst.uFrameY = 30;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
409 Dst.uFrameHeight = pFontSmallnum->CalcTextHeight("Text Verification: Here we can write an explanation of the project", &Dst, 24, 0)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
410 + 2 * LOBYTE(pFontSmallnum->uFontHeight)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
411 + 24;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
412 Dst.uFrameY = 470 - Dst.uFrameHeight;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
413 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
414 Dst.uFrameW = 469;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
415 //Dst.Hint = "abcagfdsgsg ljsrengvlkjesnfkjwnef";
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
416 Dst.DrawMessageBox(0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
417
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
418 Dst.uFrameWidth -= 24;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
419 Dst.uFrameX += 12;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
420 Dst.uFrameY += 12;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
421 Dst.uFrameHeight -= 12;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
422 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
423 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
424 Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, ui_mainmenu_copyright_color, "Text Verification: Here we can write an explanation of the project", 3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
425 }