annotate MMT.cpp @ 2470:94cf712fc780

for_refactoring
author Ritor1
date Mon, 18 Aug 2014 18:28:53 +0600
parents 8516bb27d7f0
children acac52e9e36a
rev   line source
2415
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2375
diff changeset
1 #define _CRTDBG_MAP_ALLOC
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2375
diff changeset
2 #include <stdlib.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2375
diff changeset
3 #include <crtdbg.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2375
diff changeset
4
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
6
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
7 #include "MMT.h"
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
8 #include "GUIWindow.h"
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
9
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
10 #include "mm7_data.h"
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
11 #include "AudioPlayer.h"
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
12 #include "Mouse.h"
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
13 #include "LOD.h"
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
14 #include "Render.h"
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
15 #include "GUIFont.h"
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
16 #include "lib/libpng/png.h"
2454
16f0278279a5 removed CShow.cpp/.h files
Ritor1
parents: 2450
diff changeset
17 #include "ErrorHandling.h"
2469
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
18 #include "Bink_Smacker.h"
2463
0f17a30149ec cleaning project part 1
zipi
parents: 2459
diff changeset
19 #include "Game.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2459
diff changeset
20
0f17a30149ec cleaning project part 1
zipi
parents: 2459
diff changeset
21
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
22 void ShowLogoVideo()
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
23 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
24 RGBTexture tex; // [sp+Ch] [bp-30h]@1
2469
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
25 unsigned int uTrackStartMS; // [sp+34h] [bp-8h]@8
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
26 unsigned int uTrackEndMS; // [sp+38h] [bp-4h]@8
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
27
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
28 pMediaPlayer->bStopBeforeSchedule = false;
2469
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
29
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
30 // pMediaPlayer->pResetflag = 0;
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
31 bGameoverLoop = 1;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
32 if (!bNoVideo)
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
33 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
34 pRenderer->PresentBlackScreen();
2454
16f0278279a5 removed CShow.cpp/.h files
Ritor1
parents: 2450
diff changeset
35 pMediaPlayer->PlayFullscreenMovie(MOVIE_3DOLogo, true);
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
36 if ( !pMediaPlayer->bStopBeforeSchedule )
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
37 {
2454
16f0278279a5 removed CShow.cpp/.h files
Ritor1
parents: 2450
diff changeset
38 pMediaPlayer->PlayFullscreenMovie(MOVIE_NWCLogo, true);
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
39 if ( !pMediaPlayer->bStopBeforeSchedule )
2470
94cf712fc780 for_refactoring
Ritor1
parents: 2469
diff changeset
40 {
94cf712fc780 for_refactoring
Ritor1
parents: 2469
diff changeset
41
94cf712fc780 for_refactoring
Ritor1
parents: 2469
diff changeset
42 if (for_refactoring)
94cf712fc780 for_refactoring
Ritor1
parents: 2469
diff changeset
43 {
94cf712fc780 for_refactoring
Ritor1
parents: 2469
diff changeset
44 MessageBoxA(nullptr, "Ritor1: MOVIE_JVC crash", "", 0);
94cf712fc780 for_refactoring
Ritor1
parents: 2469
diff changeset
45 __debugbreak();
94cf712fc780 for_refactoring
Ritor1
parents: 2469
diff changeset
46 }
94cf712fc780 for_refactoring
Ritor1
parents: 2469
diff changeset
47
94cf712fc780 for_refactoring
Ritor1
parents: 2469
diff changeset
48 //pMediaPlayer->PlayFullscreenMovie(MOVIE_JVC, true);
2469
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
49 //if ( !pMediaPlayer->bStopBeforeSchedule )
2470
94cf712fc780 for_refactoring
Ritor1
parents: 2469
diff changeset
50 if (!use_MMT)
94cf712fc780 for_refactoring
Ritor1
parents: 2469
diff changeset
51 pMediaPlayer->PlayFullscreenMovie(MOVIE_Intro, true);
94cf712fc780 for_refactoring
Ritor1
parents: 2469
diff changeset
52 }
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
53 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
54 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
55 char pContainerName[64];
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
56
2469
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
57 if (use_MMT)
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
58 {
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
59 sprintf(pContainerName, "data\\New_Icons/%s", "MMTTITLE.pcx");
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
60 tex.LoadPCXFile(pContainerName, 0);
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
61 }
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
62 else
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
63 tex.Load("mm6title.pcx", 2);
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
64
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
65 pRenderer->BeginScene();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
66 pRenderer->DrawTextureRGB(0, 0, &tex);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
67 free(tex.pPixels);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
68 tex.pPixels = 0;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
69 MainMenuUI_LoadFontsAndSomeStuff();
2469
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
70
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
71 if (use_MMT)
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
72 DrawMMTCopyrightWindow();//Text message in ÌÌÒ menu
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
73 else
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
74 DrawMM7CopyrightWindow();
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
75
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
76 pRenderer->EndScene();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
77 pRenderer->Present();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
78
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
79 #ifndef _DEBUG
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
80 Sleep(1500); // let the copyright window stay for a while
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
81 #endif
2469
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
82 if (!use_MMT)
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
83 {
2469
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
84 if (!bNoSound && pAudioPlayer->hAILRedbook )
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
85 {
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
86 pAudioPlayer->SetMusicVolume((signed __int64)(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0));
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
87 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
88 AIL_redbook_track_info(pAudioPlayer->hAILRedbook, 14, &uTrackStartMS, &uTrackEndMS);
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
89 AIL_redbook_play(pAudioPlayer->hAILRedbook, uTrackStartMS + 1, uTrackEndMS);
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
90 }
8516bb27d7f0 use_MMT
Ritor1
parents: 2465
diff changeset
91 }
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
92 bGameoverLoop = 0;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
93 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
94
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
95 void abort_(const char * s, ...)
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
96 {
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
97 va_list args;
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
98 va_start(args, s);
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
99 vfprintf(stderr, s, args);
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
100 fprintf(stderr, "\n");
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
101 va_end(args);
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
102 abort();
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
103 }
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
104
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
105 Texture *LoadPNG(const char *name)
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
106 {
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
107 int x, y;
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
108 int width, height;
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
109 png_byte color_type;
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
110 png_byte bit_depth;
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
111 png_structp png_ptr;
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
112 png_infop info_ptr;
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
113 int number_of_passes;
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
114 png_bytep * row_pointers;
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
115 uint i = 0;
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
116 Texture *tex;
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
117
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
118 char header[8]; // 8 is the maximum size that can be checked
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
119
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
120 /* open file and test for it being a png */
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
121 FILE *fp = fopen(name, "rb");
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
122 if (!fp)
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
123 abort_("[read_png_file] File %s could not be opened for reading", name);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
124 fread(header, 1, 8, fp);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
125 if (png_sig_cmp((png_bytep)header, 0, 8))
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
126 abort_("[read_png_file] File %s is not recognized as a PNG file", name);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
127 /* initialize stuff */
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
128 png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
129
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
130 if (!png_ptr)
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
131 abort_("[read_png_file] png_create_read_struct failed");
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
132 info_ptr = png_create_info_struct(png_ptr);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
133 if (!info_ptr)
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
134 abort_("[read_png_file] png_create_info_struct failed");
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
135
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
136 if (setjmp(png_jmpbuf(png_ptr)))
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
137 abort_("[read_png_file] Error during init_io");
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
138
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
139 png_init_io(png_ptr, fp);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
140 png_set_sig_bytes(png_ptr, 8);
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
141
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
142 png_read_info(png_ptr, info_ptr);
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
143
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
144 width = png_get_image_width(png_ptr, info_ptr);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
145 height = png_get_image_height(png_ptr, info_ptr);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
146 color_type = png_get_color_type(png_ptr, info_ptr);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
147 bit_depth = png_get_bit_depth(png_ptr, info_ptr);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
148
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
149 number_of_passes = png_set_interlace_handling(png_ptr);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
150 png_read_update_info(png_ptr, info_ptr);
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
151
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
152 /* read file */
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
153 if (setjmp(png_jmpbuf(png_ptr)))
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
154 abort_("[read_png_file] Error during read_image");
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
155 row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * height);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
156 for (y=0; y<height; y++)
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
157 row_pointers[y] = (png_byte*) malloc(png_get_rowbytes(png_ptr,info_ptr));
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
158
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
159 png_read_image(png_ptr, row_pointers);
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
160
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
161 fclose(fp);
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
162
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
163 tex = new Texture;
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
164 tex->uTextureHeight = height;
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
165 tex->uTextureWidth = width;
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
166 tex->uSizeOfMaxLevelOfDetail = png_get_rowbytes(png_ptr, info_ptr);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
167 tex->uTextureSize = png_get_rowbytes(png_ptr, info_ptr);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
168 tex->uDecompressedSize = png_get_rowbytes(png_ptr, info_ptr);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
169 tex->pPalette16 = (unsigned __int16 *) malloc(sizeof(unsigned __int16) * width * height);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
170 tex->pLevelOfDetail0_prolly_alpha_mask = (unsigned __int8 *) malloc(sizeof(unsigned __int8) * width * height);
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
171
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
172 for (y=0; y<height; y++)
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
173 {
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
174 png_byte* row = row_pointers[y];
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
175 for (x=0; x<width; x++)
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
176 {
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
177 png_byte* ptr = &(row[x*4]);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
178 //Log::Warning(L"Pixel at position [ %d - %d ] has RGBA values: %d - %d - %d - %d\n",
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
179 // x, y, ptr[0], ptr[1], ptr[2], ptr[3]);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
180 png_byte tmp = ptr[2];
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
181 ptr[2] = ptr[0];
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
182 ptr[0] = ptr[3];
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
183 ptr[3] = 255 - tmp;
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
184 tex->pPalette16[i] = Color16(ptr[0], ptr[1], ptr[2]);
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
185 tex->pLevelOfDetail0_prolly_alpha_mask[i] = ptr[3];
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
186 i++;
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
187 }
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
188 }
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
189 //Ritor1: temporarily stopped, needed change RGBTexture structure
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
190 /*for (int i = 0; i < width * height; ++i)
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
191 tex->pPalette16[i] = 0x7FF;
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
192 memset(tex->pLevelOfDetail0_prolly_alpha_mask, 1, sizeof(unsigned __int8) * width * height);*/
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
193 return tex;
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
194 }
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
195
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
196 void MMT_MainMenu_Loop()
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
197 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
198 GUIButton *pButton; // eax@27
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
199 unsigned int pControlParam; // ecx@35
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
200 unsigned int pX;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
201 unsigned int pY; // [sp-18h] [bp-54h]@39
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
202 Texture *pTexture; // [sp-14h] [bp-50h]@39
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
203 char pContainerName[64];
2459
e5c88c2b02ab Audio_GetFirstHardwareDigitalDriver
Ritor1
parents: 2454
diff changeset
204 MSG msg;
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
205
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
206 pCurrentScreen = SCREEN_GAME;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
207
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
208 pGUIWindow2 = 0;
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
209 pAudioPlayer->StopChannels(-1, -1);
2312
4b052671da98 MediaPlayer.cpp
Ritor1
parents: 2308
diff changeset
210
2425
d922225a6081 Hot key for mm7 main menu
Ritor1
parents: 2415
diff changeset
211 //if (!bNoSound )
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
212 //PlayAudio(L"Sounds\\New_Sounds/Stronghold_Theme.mp3");
2345
182effc4b0ee for MultimediaPlayer
Ritor1
parents: 2334
diff changeset
213 //if (!bNoVideo )
182effc4b0ee for MultimediaPlayer
Ritor1
parents: 2334
diff changeset
214 //pVideoPlayer->PlayMovie(L"Anims\\New_Video/3DOLOGO.smk");
2312
4b052671da98 MediaPlayer.cpp
Ritor1
parents: 2308
diff changeset
215
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
216 pMouse->RemoveHoldingItem();
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
217
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
218 pIcons_LOD->_inlined_sub2();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
219
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
220 //Create new window
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
221 //WINDOW_MainMenu included in GUIWindow.h
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
222 pWindow_MMT_MainMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0);
2375
14c05b876218 sqrt(float, double)
Ritor1
parents: 2359
diff changeset
223
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
224 //load buttons
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
225 //Texture* MMT_MM6 = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE);
2295
6fd03869f65c LoadTexture cleaned and add ConvertPNG function
Ritor1
parents: 2290
diff changeset
226
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
227 sprintf(pContainerName, "data\\New_Icons/%s", "mm6_button_oval.png");
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
228 Texture* MMT_MM6 = LoadPNG(pContainerName);
2347
d57505d3c70c VideoPlayer cleaning
Ritor1
parents: 2345
diff changeset
229
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
230 Texture* MMT_MM7 = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
231 Texture* MMT_MM8 = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
232 Texture* MMT_Continue = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
233 Texture* MMT_Exit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
234
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
235 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);
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
236 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);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
237 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);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
238 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);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
239 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);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
240
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
241 pTexture_PCX.Release();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
242
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
243 sprintf(pContainerName, "data\\New_Icons/%s", "MMTTITLE.pcx");
2427
94393b73d333 * Some initialization stuff
a.parshin
parents: 2415
diff changeset
244 if (pTexture_PCX.LoadPCXFile(pContainerName, 0) == 1)
2454
16f0278279a5 removed CShow.cpp/.h files
Ritor1
parents: 2450
diff changeset
245 Error("File not found: %s", pContainerName);
2427
94393b73d333 * Some initialization stuff
a.parshin
parents: 2415
diff changeset
246
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
247 SetCurrentMenuID(MENU_MMT_MAIN_MENU);//included in enum MENU_STATE in GUIWindows.h
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
248 SetForegroundWindow(window->GetApiHandle());
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
249 SendMessageW(window->GetApiHandle(), WM_ACTIVATEAPP, 1, 0);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
250 while (GetCurrentMenuID() == MENU_MMT_MAIN_MENU )
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
251 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
252 POINT cursor;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
253 pMouse->GetCursorPos(&cursor);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
254
2459
e5c88c2b02ab Audio_GetFirstHardwareDigitalDriver
Ritor1
parents: 2454
diff changeset
255 while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE))
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
256 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
257 if (msg.message == WM_QUIT)
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
258 Game_DeinitializeAndTerminate(0);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
259 TranslateMessage(&msg);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
260 DispatchMessageW(&msg);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
261 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
262
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
263 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
264 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
265 WaitMessage();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
266 continue;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
267 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
268
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
269 pRenderer->BeginScene();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
270 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
271
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
272 MMT_MenuMessageProc();//for ÌÌÒ menu
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
273 GUI_UpdateWindows();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
274
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
275 if ( !pModalWindow )// ???
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
276 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
277 pButton = pWindow_MMT_MainMenu->pControlsHead;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
278 for ( pButton = pWindow_MMT_MainMenu->pControlsHead; pButton; pButton = pButton->pNext )
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
279 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
280 if ( cursor.x >= (signed int)pButton->uX && cursor.x <= (signed int)pButton->uZ
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
281 && cursor.y >= (signed int)pButton->uY && cursor.y <= (signed int)pButton->uW )
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
282 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
283 pControlParam = pButton->msg_param;
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
284 switch (pControlParam) // backlight for buttons
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
285 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
286 case 0:
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
287 pTexture = MMT_MM6;
2308
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
288 pX = 0;
8a62bd4d51e2 button for MMT_Menu
Ritor1
parents: 2299
diff changeset
289 pY = 0;
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
290 break;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
291 case 1:
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
292 pTexture = MMT_MM7;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
293 pX = window->GetWidth() - (window->GetWidth() / 4);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
294 pY = window->GetHeight() / 4;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
295 break;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
296 case 2:
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
297 pTexture = MMT_MM8;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
298 pX = window->GetWidth() - (window->GetWidth() / 4);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
299 pY = window->GetHeight() - ((window->GetHeight() / 4) + 50);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
300 break;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
301 case 3:
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
302 pTexture = MMT_Continue;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
303 pX = (window->GetWidth() / 4) - 100;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
304 pY = window->GetHeight() - ((window->GetHeight() / 4) + 50);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
305 break;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
306 case 4:
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
307 pTexture = MMT_Exit;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
308 pX = window->GetWidth() - 130;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
309 pY = window->GetHeight() - 35;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
310 break;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
311 }
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
312 pRenderer->DrawTextureIndexed(pX, pY, pTexture);
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
313 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
314 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
315 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
316 //}
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
317 pRenderer->EndScene();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
318 pRenderer->Present();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
319 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
320 MMT_MenuMessageProc();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
321 pRenderer->BeginScene();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
322 GUI_UpdateWindows();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
323 pRenderer->EndScene();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
324 pRenderer->Present();
2375
14c05b876218 sqrt(float, double)
Ritor1
parents: 2359
diff changeset
325
2459
e5c88c2b02ab Audio_GetFirstHardwareDigitalDriver
Ritor1
parents: 2454
diff changeset
326 //remove resource
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
327 pTexture_PCX.Release();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
328 if ( pGUIWindow2 )
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
329 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
330 pGUIWindow2->Release();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
331 pGUIWindow2 = 0;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
332 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
333 pWindow_MMT_MainMenu->Release();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
334 pIcons_LOD->RemoveTexturesPackFromTextureList();
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
335 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
336
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
337 void MMT_MenuMessageProc()
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
338 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
339 int pParam;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
340 int pParam2;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
341 UIMessageType pUIMessageType;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
342
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
343 if ( pMessageQueue_50CBD0->uNumMessages )
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
344 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
345 do
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
346 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
347
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
348 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &pParam, &pParam2);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
349
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
350 switch (pUIMessageType)
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
351 {
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
352 case UIMSG_MMT_MainMenu_MM6:
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
353 //video
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
354 //SetCurrentMenuID(MENU_MAIN_MM6);
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
355 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);//temporarily
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
356 break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
357 case UIMSG_MMT_MainMenu_MM7: //new button for ÌÌ7
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
358 //GUIWindow::Create(495, 172, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0);
2359
5b9fb75b6f54 alSourceStop(mSourceID);
Ritor1
parents: 2356
diff changeset
359 alSourceStop(mSourceID);
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
360 pMediaPlayer->ShowMM7IntroVideo_and_LoadingScreen();
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
361 SetCurrentMenuID(MENU_MAIN);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
362 break;
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
363 case UIMSG_MMT_MainMenu_MM8:
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
364 //video
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
365 //SetCurrentMenuID(MENU_MAIN_MM8);
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
366 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);//temporarily
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
367 break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
368 case UIMSG_MMT_MainMenu_Continue:
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
369 //video
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
370 //SetCurrentMenuID(MENU_MAIN_Continue);
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
371 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);//temporarily
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
372 break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
373 case UIMSG_ExitToWindows:
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
374 GUIWindow::Create(495, 337, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0);
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2428
diff changeset
375 SetCurrentMenuID(MENU_EXIT_GAME);
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
376
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
377 default:
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
378 break;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
379 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
380 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
381 while ( pMessageQueue_50CBD0->uNumMessages );
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
382 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
383 }
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
384 void DrawMMTCopyrightWindow()
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
385 {
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
386 GUIWindow Dst; // [sp+8h] [bp-54h]@1
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
387
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
388 memset(&Dst, 0, 0x54u);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
389 Dst.uFrameWidth = 624;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
390 Dst.uFrameHeight = 256;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
391 Dst.uFrameX = 8;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
392 Dst.uFrameY = 30;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
393 Dst.uFrameHeight = pFontSmallnum->CalcTextHeight("Text Verification: Here we can write an explanation of the project", &Dst, 24, 0)
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
394 + 2 * LOBYTE(pFontSmallnum->uFontHeight)
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
395 + 24;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
396 Dst.uFrameY = 470 - Dst.uFrameHeight;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
397 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
398 Dst.uFrameW = 469;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
399 //Dst.Hint = "abcagfdsgsg ljsrengvlkjesnfkjwnef";
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
400 Dst.DrawMessageBox(0);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
401
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
402 Dst.uFrameWidth -= 24;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
403 Dst.uFrameX += 12;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
404 Dst.uFrameY += 12;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
405 Dst.uFrameHeight -= 12;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
406 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
407 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1;
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
408 Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, ui_mainmenu_copyright_color, "Text Verification: Here we can write an explanation of the project", 3);
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents:
diff changeset
409 }