W3DMainMenu.cpp 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: W3DMainMenu.cpp /////////////////////////////////////////////////
  24. //-----------------------------------------------------------------------------
  25. //
  26. // Electronic Arts Pacific.
  27. //
  28. // Confidential Information
  29. // Copyright (C) 2002 - All Rights Reserved
  30. //
  31. //-----------------------------------------------------------------------------
  32. //
  33. // created: Apr 2002
  34. //
  35. // Filename: W3DMainMenu.cpp
  36. //
  37. // author: Chris Huybregts
  38. //
  39. // purpose: The Draw Routine for the main menu
  40. //
  41. //-----------------------------------------------------------------------------
  42. ///////////////////////////////////////////////////////////////////////////////
  43. //-----------------------------------------------------------------------------
  44. // SYSTEM INCLUDES ////////////////////////////////////////////////////////////
  45. //-----------------------------------------------------------------------------
  46. #define WIN32_LEAN_AND_MEAN
  47. #include <windows.h>
  48. #include <mmsystem.h>
  49. #include <time.h>
  50. //-----------------------------------------------------------------------------
  51. // USER INCLUDES //////////////////////////////////////////////////////////////
  52. //-----------------------------------------------------------------------------
  53. #include "GameClient/GameWindow.h"
  54. #include "Lib/BaseType.h"
  55. #include "W3DDevice/GameClient/W3DGameWindow.h"
  56. #include "GameClient/Display.h"
  57. #include "GameLogic/GameLogic.h"
  58. #include "GameClient/Shell.h"
  59. #include "GameClient/ShellMenuScheme.h"
  60. #include "GameClient/Credits.h"
  61. #include "GameClient/Gadget.h"
  62. #include "GameClient/GameWindowGlobal.h"
  63. #include "GameClient/GameWindowManager.h"
  64. #include "GameClient/GadgetPushButton.h"
  65. #include "W3DDevice/GameClient/W3DDisplay.h"
  66. #include "W3DDevice/GameClient/W3DGadget.h"
  67. #include "GameClient/GUICallbacks.h"
  68. //-----------------------------------------------------------------------------
  69. // DEFINES ////////////////////////////////////////////////////////////////////
  70. //-----------------------------------------------------------------------------
  71. void drawText( GameWindow *window, WinInstanceData *instData );
  72. static Color BrownishColor = GameMakeColor(167,134,94,255);
  73. static IRegion2D clipRegion;
  74. //-----------------------------------------------------------------------------
  75. // PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
  76. //-----------------------------------------------------------------------------
  77. //-----------------------------------------------------------------------------
  78. // PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
  79. //-----------------------------------------------------------------------------
  80. static void advancePosition(GameWindow *window, const Image *image, UnsignedInt posX, UnsignedInt posY, UnsignedInt sizeX, UnsignedInt sizeY)
  81. {
  82. if(!image)
  83. return;
  84. static Bool goingForward = TRUE;
  85. ICoord2D pos, size;
  86. if(!window)
  87. {
  88. pos.x = posX;
  89. pos.y = posY;
  90. size.x = sizeX;
  91. size.y = sizeY;
  92. }
  93. else
  94. {
  95. window->winGetScreenPosition(&pos.x, &pos.y);
  96. window->winGetSize(&size.x,&size.y);
  97. }
  98. static Int Width = size.x + image->getImageWidth();
  99. static Int x = -800;
  100. static Int y = pos.y - (image->getImageHeight()/2);
  101. static UnsignedInt m_startTime = timeGetTime();
  102. Int time = timeGetTime() - m_startTime;
  103. Real percentDone = INT_TO_REAL(time) / 10000;
  104. if(goingForward)
  105. {
  106. if(percentDone >= 1)
  107. {
  108. y = pos.y + size.y - (image->getImageHeight()/2);
  109. m_startTime = timeGetTime();
  110. goingForward = FALSE;
  111. }
  112. else
  113. {
  114. y = pos.y - (image->getImageHeight()/2);
  115. x = (percentDone * Width) - image->getImageWidth();
  116. }
  117. }
  118. else
  119. {
  120. if(percentDone >= 1)
  121. {
  122. y = pos.y - (image->getImageHeight()/2);
  123. m_startTime = timeGetTime();
  124. goingForward = TRUE;
  125. }
  126. else
  127. {
  128. y = pos.y + size.y - (image->getImageHeight()/2);
  129. x = size.x - (percentDone * Width);
  130. }
  131. }
  132. TheDisplay->drawImage(image,x, y, x + image->getImageWidth(), y + image->getImageHeight());
  133. }
  134. void W3DShellMenuSchemeDraw( GameWindow *window, WinInstanceData *instData )
  135. {
  136. if(TheShell && TheShell->isShellActive())
  137. TheShell->getShellMenuSchemeManager()->draw();
  138. }
  139. void W3DMainMenuDraw( GameWindow *window, WinInstanceData *instData )
  140. {
  141. //W3DGameWinDefaultDraw( window, instData );
  142. //R:83 G:78 B:52
  143. static UnsignedInt color = BrownishColor;
  144. static UnsignedInt colorDrop = GameMakeColor(38,30,21,255);
  145. ICoord2D pos, size;
  146. Int height = TheDisplay->getHeight();
  147. window->winGetScreenPosition(&pos.x, &pos.y);
  148. window->winGetSize(&size.x,&size.y);
  149. IRegion2D topHorizontal1 ={pos.x, pos.y, pos.x + size.x, pos.y };
  150. IRegion2D topHorizontal1drop ={pos.x, pos.y+1, pos.x + size.x, pos.y+1 };
  151. IRegion2D topHorizontal2 ={pos.x, pos.y + (size.y * .1) , pos.x + size.x, pos.y + (size.y * .1) };
  152. IRegion2D topHorizontal2drop ={pos.x, pos.y + (size.y * .12) , pos.x + size.x, pos.y + (size.y * .12) };
  153. IRegion2D bottomHorizontal1={pos.x, pos.y + (size.y * .9), pos.x + size.x, pos.y + (size.y * .9) };
  154. IRegion2D bottomHorizontal1drop={pos.x, pos.y + (size.y * .92), pos.x + size.x, pos.y + (size.y * .92) };
  155. IRegion2D bottomHorizontal2= {pos.x, pos.y + size.y, pos.x + size.x, pos.y + size.y };
  156. IRegion2D bottomHorizontal2drop= {pos.x, pos.y + size.y + 1, pos.x + size.x, pos.y + size.y + 1 };
  157. IRegion2D verticle1 ={pos.x + (size.x * .225), pos.y , pos.x + (size.x * .225), height };
  158. IRegion2D verticle2 ={pos.x + (size.x * .445), pos.y, pos.x + (size.x * .445), height };
  159. IRegion2D verticle3 ={pos.x + (size.x * .6662), pos.y, pos.x + (size.x * .6662), height };
  160. IRegion2D verticle4 ={pos.x + (size.x * .885), pos.y , pos.x + (size.x * .885), height };
  161. // static IRegion2D verticle5 ={pos.x + (size.x * .7250), pos.y + (size.y * .12), pos.x + (size.x * .7250), pos.y + (size.y * .86) };
  162. // static IRegion2D verticle6 ={pos.x + (size.x * .9062), pos.y + (size.y * .12), pos.x + (size.x * .9062), pos.y + (size.y * .86) };
  163. TheDisplay->drawLine(topHorizontal1.lo.x,topHorizontal1.lo.y,topHorizontal1.hi.x,topHorizontal1.hi.y,2,color);
  164. TheDisplay->drawLine(topHorizontal1drop.lo.x,topHorizontal1drop.lo.y,topHorizontal1drop.hi.x,topHorizontal1drop.hi.y,2,colorDrop);
  165. TheDisplay->drawLine(topHorizontal2.lo.x,topHorizontal2.lo.y,topHorizontal2.hi.x,topHorizontal2.hi.y,1,color);
  166. TheDisplay->drawLine(topHorizontal2drop.lo.x,topHorizontal2drop.lo.y,topHorizontal2drop.hi.x,topHorizontal2drop.hi.y,1,colorDrop);
  167. TheDisplay->drawLine(bottomHorizontal1.lo.x,bottomHorizontal1.lo.y,bottomHorizontal1.hi.x,bottomHorizontal1.hi.y,1,color);
  168. TheDisplay->drawLine(bottomHorizontal1drop.lo.x,bottomHorizontal1drop.lo.y,bottomHorizontal1drop.hi.x,bottomHorizontal1drop.hi.y,1,colorDrop);
  169. TheDisplay->drawLine(bottomHorizontal2.lo.x,bottomHorizontal2.lo.y,bottomHorizontal2.hi.x,bottomHorizontal2.hi.y,2,color);
  170. TheDisplay->drawLine(bottomHorizontal2drop.lo.x,bottomHorizontal2drop.lo.y,bottomHorizontal2drop.hi.x,bottomHorizontal2drop.hi.y,2,colorDrop);
  171. TheDisplay->drawLine(verticle1.lo.x,verticle1.lo.y,verticle1.hi.x,verticle1.hi.y,3,color);
  172. TheDisplay->drawLine(verticle2.lo.x,verticle2.lo.y,verticle2.hi.x,verticle2.hi.y,3,color);
  173. TheDisplay->drawLine(verticle3.lo.x,verticle3.lo.y,verticle3.hi.x,verticle3.hi.y,3,color);
  174. TheDisplay->drawLine(verticle4.lo.x,verticle4.lo.y,verticle4.hi.x,verticle4.hi.y,3,color);
  175. // TheDisplay->drawLine(verticle5.lo.x,verticle5.lo.y,verticle5.hi.x,verticle5.hi.y,3,color);
  176. // TheDisplay->drawLine(verticle6.lo.x,verticle6.lo.y,verticle6.hi.x,verticle6.hi.y,3,color);
  177. // TheDisplay->drawLine(m_rightLineFromButton.lo.x,m_rightLineFromButton.lo.y,m_rightLineFromButton.hi.x,m_rightLineFromButton.hi.y,3,color1,color2);
  178. advancePosition(NULL, TheMappedImageCollection->findImageByName("MainMenuPulse"),pos.x,pos.y,size.x, size.y);
  179. //TheDisplay->drawLine();
  180. }
  181. void W3DMainMenuFourDraw( GameWindow *window, WinInstanceData *instData )
  182. {
  183. //W3DGameWinDefaultDraw( window, instData );
  184. //R:83 G:78 B:52
  185. static UnsignedInt color = BrownishColor;
  186. static UnsignedInt colorDrop = GameMakeColor(38,30,21,255);
  187. ICoord2D pos, size;
  188. Int height = TheDisplay->getHeight();
  189. window->winGetScreenPosition(&pos.x, &pos.y);
  190. window->winGetSize(&size.x,&size.y);
  191. IRegion2D topHorizontal1 ={pos.x, pos.y, pos.x + size.x, pos.y };
  192. IRegion2D topHorizontal1drop ={pos.x, pos.y+1, pos.x + size.x, pos.y+1 };
  193. IRegion2D topHorizontal2 ={pos.x, pos.y + (size.y * .1) , pos.x + size.x, pos.y + (size.y * .1) };
  194. IRegion2D topHorizontal2drop ={pos.x, pos.y + (size.y * .12) , pos.x + size.x, pos.y + (size.y * .12) };
  195. IRegion2D bottomHorizontal1={pos.x, pos.y + (size.y * .9), pos.x + size.x, pos.y + (size.y * .9) };
  196. IRegion2D bottomHorizontal1drop={pos.x, pos.y + (size.y * .92), pos.x + size.x, pos.y + (size.y * .92) };
  197. IRegion2D bottomHorizontal2= {pos.x, pos.y + size.y, pos.x + size.x, pos.y + size.y };
  198. IRegion2D bottomHorizontal2drop= {pos.x, pos.y + size.y + 1, pos.x + size.x, pos.y + size.y + 1 };
  199. IRegion2D verticle1 ={pos.x + (size.x * .295), pos.y , pos.x + (size.x * .295), height };
  200. IRegion2D verticle2 ={pos.x + (size.x * .59), pos.y, pos.x + (size.x * .59), height };
  201. //IRegion2D verticle3 ={pos.x + (size.x * .6662), pos.y, pos.x + (size.x * .6662), height };
  202. IRegion2D verticle4 ={pos.x + (size.x * .885), pos.y , pos.x + (size.x * .885), height };
  203. // static IRegion2D verticle5 ={pos.x + (size.x * .7250), pos.y + (size.y * .12), pos.x + (size.x * .7250), pos.y + (size.y * .86) };
  204. // static IRegion2D verticle6 ={pos.x + (size.x * .9062), pos.y + (size.y * .12), pos.x + (size.x * .9062), pos.y + (size.y * .86) };
  205. TheDisplay->drawLine(topHorizontal1.lo.x,topHorizontal1.lo.y,topHorizontal1.hi.x,topHorizontal1.hi.y,2,color);
  206. TheDisplay->drawLine(topHorizontal1drop.lo.x,topHorizontal1drop.lo.y,topHorizontal1drop.hi.x,topHorizontal1drop.hi.y,2,colorDrop);
  207. TheDisplay->drawLine(topHorizontal2.lo.x,topHorizontal2.lo.y,topHorizontal2.hi.x,topHorizontal2.hi.y,1,color);
  208. TheDisplay->drawLine(topHorizontal2drop.lo.x,topHorizontal2drop.lo.y,topHorizontal2drop.hi.x,topHorizontal2drop.hi.y,1,colorDrop);
  209. TheDisplay->drawLine(bottomHorizontal1.lo.x,bottomHorizontal1.lo.y,bottomHorizontal1.hi.x,bottomHorizontal1.hi.y,1,color);
  210. TheDisplay->drawLine(bottomHorizontal1drop.lo.x,bottomHorizontal1drop.lo.y,bottomHorizontal1drop.hi.x,bottomHorizontal1drop.hi.y,1,colorDrop);
  211. TheDisplay->drawLine(bottomHorizontal2.lo.x,bottomHorizontal2.lo.y,bottomHorizontal2.hi.x,bottomHorizontal2.hi.y,2,color);
  212. TheDisplay->drawLine(bottomHorizontal2drop.lo.x,bottomHorizontal2drop.lo.y,bottomHorizontal2drop.hi.x,bottomHorizontal2drop.hi.y,2,colorDrop);
  213. TheDisplay->drawLine(verticle1.lo.x,verticle1.lo.y,verticle1.hi.x,verticle1.hi.y,3,color);
  214. TheDisplay->drawLine(verticle2.lo.x,verticle2.lo.y,verticle2.hi.x,verticle2.hi.y,3,color);
  215. //TheDisplay->drawLine(verticle3.lo.x,verticle3.lo.y,verticle3.hi.x,verticle3.hi.y,3,color);
  216. TheDisplay->drawLine(verticle4.lo.x,verticle4.lo.y,verticle4.hi.x,verticle4.hi.y,3,color);
  217. // TheDisplay->drawLine(verticle5.lo.x,verticle5.lo.y,verticle5.hi.x,verticle5.hi.y,3,color);
  218. // TheDisplay->drawLine(verticle6.lo.x,verticle6.lo.y,verticle6.hi.x,verticle6.hi.y,3,color);
  219. // TheDisplay->drawLine(m_rightLineFromButton.lo.x,m_rightLineFromButton.lo.y,m_rightLineFromButton.hi.x,m_rightLineFromButton.hi.y,3,color1,color2);
  220. advancePosition(NULL, TheMappedImageCollection->findImageByName("MainMenuPulse"),pos.x,pos.y,size.x, size.y);
  221. //TheDisplay->drawLine();
  222. }
  223. void W3DMetalBarMenuDraw( GameWindow *window, WinInstanceData *instData )
  224. {
  225. //ICoord2D original, size;
  226. // TheDisplay->setClipRegion(&clipRegion);
  227. window->winDrawBorder();
  228. //window->winGetScreenPosition(&original.x, &original.y);
  229. //window->winGetSize(&size.x, &size.y);
  230. //blitBorderRect( original.x, original.y, size.x, size.y );
  231. //W3DGameWinDefaultDraw( window, instData );
  232. // TheDisplay->enableClipping(FALSE);
  233. }
  234. //W3DGameWinDefaultDraw( window, instData );
  235. //
  236. // //R:83 G:78 B:52
  237. //
  238. //
  239. //// UnsignedInt color = GameMakeColor(113,108,82,212);
  240. // ICoord2D pos, size;
  241. //
  242. // window->winGetScreenPosition(&pos.x, &pos.y);
  243. // window->winGetSize(&size.x,&size.y);
  244. //
  245. // const Image *image = TheMappedImageCollection->findImageByName("LogoGlow");
  246. //
  247. // if(!image)
  248. // return;
  249. //
  250. // Int Width = size.x + image->getImageWidth();
  251. //
  252. // static Int x = pos.x - image->getImageWidth();
  253. // static Int y = pos.y - (image->getImageHeight()/2);
  254. //
  255. // static UnsignedInt m_startTime = timeGetTime();
  256. // Int time = timeGetTime() - m_startTime;
  257. // Real percentDone = INT_TO_REAL(time) / 15624;
  258. //
  259. // if(percentDone >= 1)
  260. // {
  261. //// y = pos.y + size.y - (image->getImageHeight()/2) - 2;
  262. // m_startTime = timeGetTime();
  263. // }
  264. // else
  265. // {
  266. // x = (percentDone * Width) - image->getImageWidth();
  267. // }
  268. //
  269. // IRegion2D clip;
  270. // clip.lo.x = pos.x;
  271. // clip.lo.y = pos.y - image->getImageHeight();
  272. // clip.hi.x = pos.x + size.x;
  273. // clip.hi.y = pos.y + size.y;
  274. // TheDisplay->setClipRegion(&clip);
  275. // Int alpha;
  276. // if(percentDone > .5)
  277. // alpha = ((1-percentDone) * 2) * 255;
  278. // else
  279. // alpha = ( percentDone * 2) * 255;
  280. //
  281. // TheDisplay->drawImage(image,x, y , x + image->getImageWidth(), y + image->getImageHeight(), GameMakeColor(255,255,255,alpha));
  282. // //TheDisplay->drawImage(image,x, y , x + image->getImageWidth(), y + image->getImageHeight(), GameMakeColor(255,200,250,alpha));
  283. // TheDisplay->enableClipping(FALSE );
  284. // //TheDisplay->drawLine();
  285. //
  286. void W3DClockDraw( GameWindow *window, WinInstanceData *instData )
  287. {
  288. W3DGameWinDefaultDraw( window, instData );
  289. ICoord2D pos, size;
  290. window->winGetScreenPosition(&pos.x, &pos.y);
  291. window->winGetSize(&size.x,&size.y);
  292. char datestr[256] = "";
  293. time_t longTime;
  294. struct tm *curtime;
  295. time(&longTime);
  296. curtime = localtime(&longTime);
  297. strftime(datestr, 256, "%H:%M:%S", curtime);
  298. UnicodeString temp;
  299. temp.translate(datestr);
  300. instData->setText(temp);
  301. DisplayString *dString;
  302. dString = instData->getTextDisplayString();
  303. dString->setFont(TheFontLibrary->getFont("Arial",16,0));
  304. Int textWidth, textHeight;
  305. ICoord2D textPos;
  306. IRegion2D clockClipRegion;
  307. // sanity
  308. // how much space will this text take up
  309. dString->getSize( &textWidth, &textHeight );
  310. //Init the clip region
  311. clockClipRegion.lo.x = pos.x + 1;
  312. clockClipRegion.lo.y = pos.y + 1;
  313. clockClipRegion.hi.x = pos.x + size.x - 1;
  314. clockClipRegion.hi.y = pos.y + size.y - 1;
  315. textPos.x = pos.x + (size.x / 2) - (textWidth / 2);
  316. textPos.y = pos.y + (size.y / 2) - (textHeight / 2);
  317. dString->setClipRegion(&clockClipRegion);
  318. dString->draw( textPos.x, textPos.y, GameMakeColor(255,255,255,255), GameMakeColor(0,0,0,255) );
  319. }
  320. void W3DMainMenuMapBorder( GameWindow *window, WinInstanceData *instData )
  321. {
  322. enum
  323. {
  324. BORDER_CORNER_SIZE = 10,
  325. BORDER_LINE_SIZE = 20,
  326. };
  327. //( Int x, Int y, Int width, Int height )
  328. // save original x, y
  329. Int x, y, width, height;
  330. window->winGetScreenPosition(&x, &y);
  331. window->winGetSize(&width,&height);
  332. // TheDisplay->setClipRegion(&clipRegion);
  333. Int originalX = x;
  334. Int originalY = y;
  335. Int maxX = x + width;
  336. Int maxY = y + height;
  337. Int x2, y2; // used for simultaneous drawing of line pairs
  338. Int size = 20;
  339. Int halfSize = size / 2;
  340. const Image *image = NULL;
  341. // Draw Horizontal Lines
  342. // All border pieces are based on a 10 pixel offset from the centerline
  343. y = originalY - 10;
  344. y2 = maxY - 10;
  345. x2 = maxX - (10 + BORDER_LINE_SIZE);
  346. image = TheMappedImageCollection->findImageByName("FrameCornerHorizontal");
  347. if(image)
  348. {
  349. for( x=(originalX + 10); x <= x2; x += BORDER_LINE_SIZE )
  350. {
  351. TheDisplay->drawImage( image,
  352. x, y, x + size, y + size );
  353. TheDisplay->drawImage( image,
  354. x, y2, x + size, y2 + size );
  355. }
  356. x2 = maxX - BORDER_CORNER_SIZE;
  357. // x == place to draw remainder if any
  358. if( (x2 - x) >= (BORDER_LINE_SIZE / 2) )
  359. {
  360. //Blit Half piece
  361. TheDisplay->drawImage( image,
  362. x, y, x + halfSize, y + size );
  363. TheDisplay->drawImage( image,
  364. x, y2, x + halfSize, y2 + size );
  365. x += (BORDER_LINE_SIZE / 2);
  366. }
  367. // x2 - x ... must now be less than a half piece
  368. // check for equals and if not blit an adjusted half piece border pieces have
  369. // a two pixel repeat so we will blit one pixel over if necessary to line up
  370. // the art, but we'll cover-up the overlap with the corners
  371. if( x < x2 )
  372. {
  373. x -= ((BORDER_LINE_SIZE / 2) - (((x2 - x) + 1) & ~1));
  374. //Blit Half piece
  375. TheDisplay->drawImage( image,
  376. x, y, x + halfSize, y + size );
  377. TheDisplay->drawImage( image,
  378. x, y2, x + halfSize, y2 + size );
  379. }
  380. }
  381. image = TheMappedImageCollection->findImageByName("FrameCornerVertical");
  382. if( image )
  383. {
  384. // Draw Vertical Lines
  385. // All border pieces are based on a 10 pixel offset from the centerline
  386. x = originalX - 10;
  387. x2 = maxX - 10;
  388. y2 = maxY - (10 + BORDER_LINE_SIZE);
  389. for( y=(originalY + 10); y <= y2; y += BORDER_LINE_SIZE )
  390. {
  391. TheDisplay->drawImage( image,
  392. x, y, x + size, y + size );
  393. TheDisplay->drawImage( image,
  394. x2, y, x2 + size, y + size );
  395. }
  396. y2 = maxY - BORDER_CORNER_SIZE;
  397. // y == place to draw remainder if any
  398. if( (y2 - y) >= (BORDER_LINE_SIZE / 2) )
  399. {
  400. //Blit Half piece
  401. TheDisplay->drawImage( image,
  402. x, y, x + size, y + halfSize );
  403. TheDisplay->drawImage( image,
  404. x2, y, x2 + size, y + halfSize );
  405. y += (BORDER_LINE_SIZE / 2);
  406. }
  407. // y2 - y ... must now be less than a half piece
  408. // check for equals and if not blit an adjusted half piece border pieces have
  409. // a two pixel repeat so we will blit one pixel over if necessary to line up
  410. // the art, but we'll cover-up the overlap with the corners
  411. if( y < y2 )
  412. {
  413. y -= ((BORDER_LINE_SIZE / 2) - (((y2 - y) + 1) & ~1));
  414. //Blit Half piece
  415. TheDisplay->drawImage( image,
  416. x, y, x + size, y + halfSize );
  417. TheDisplay->drawImage( image,
  418. x2, y, x2 + size, y + halfSize );
  419. }
  420. }
  421. // Draw Corners
  422. x = originalX - BORDER_CORNER_SIZE;
  423. y = originalY - BORDER_CORNER_SIZE;
  424. TheDisplay->drawImage( TheMappedImageCollection->findImageByName("FrameCornerUL"),
  425. x, y, x + size, y + size );
  426. x = maxX - BORDER_CORNER_SIZE;
  427. y = originalY - BORDER_CORNER_SIZE;
  428. TheDisplay->drawImage( TheMappedImageCollection->findImageByName("FrameCornerUR"),
  429. x, y, x + size, y + size );
  430. x = originalX - BORDER_CORNER_SIZE;
  431. y = maxY - BORDER_CORNER_SIZE;
  432. TheDisplay->drawImage( TheMappedImageCollection->findImageByName("FrameCornerLL"),
  433. x, y, x + size, y + size );
  434. x = maxX - BORDER_CORNER_SIZE;
  435. y = maxY - BORDER_CORNER_SIZE;
  436. TheDisplay->drawImage(TheMappedImageCollection->findImageByName("FrameCornerLR"),
  437. x, y, x + size, y + size );
  438. TheDisplay->enableClipping(FALSE);
  439. }
  440. //Specialized drawing function for the buttons with the weird drop shadow
  441. // W3DMainMenuButtonDropShadowDraw ===============================================
  442. /** Draw pushbutton with user supplied images */
  443. //=============================================================================
  444. void W3DMainMenuButtonDropShadowDraw( GameWindow *window,
  445. WinInstanceData *instData )
  446. {
  447. const Image *leftImage, *rightImage, *centerImage;
  448. ICoord2D origin, size, start, end;
  449. Int xOffset, yOffset;
  450. Int i;
  451. // get screen position and size
  452. window->winGetScreenPosition( &origin.x, &origin.y );
  453. window->winGetSize( &size.x, &size.y );
  454. // get image offset
  455. xOffset = instData->m_imageOffset.x;
  456. yOffset = instData->m_imageOffset.y;
  457. //
  458. // get pointer to image we want to draw depending on our state,
  459. // see GadgetPushButton.h for info
  460. //
  461. if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE )
  462. {
  463. if( BitTest( instData->getState(), WIN_STATE_SELECTED ) )
  464. {
  465. leftImage = GadgetButtonGetLeftDisabledSelectedImage( window );
  466. rightImage = GadgetButtonGetRightDisabledSelectedImage( window );
  467. centerImage = GadgetButtonGetMiddleDisabledSelectedImage( window );
  468. }
  469. else
  470. {
  471. leftImage = GadgetButtonGetLeftDisabledImage( window );
  472. rightImage = GadgetButtonGetRightDisabledImage( window );
  473. centerImage = GadgetButtonGetMiddleDisabledImage( window );
  474. }
  475. } // end if, disabled
  476. else if( BitTest( instData->getState(), WIN_STATE_HILITED ) )
  477. {
  478. if( BitTest( instData->getState(), WIN_STATE_SELECTED ) )
  479. {
  480. leftImage = GadgetButtonGetLeftHiliteSelectedImage( window );
  481. rightImage = GadgetButtonGetRightHiliteSelectedImage( window );
  482. centerImage = GadgetButtonGetMiddleHiliteSelectedImage( window );
  483. }
  484. else
  485. {
  486. leftImage = GadgetButtonGetLeftHiliteImage( window );
  487. rightImage = GadgetButtonGetRightHiliteImage( window );
  488. centerImage = GadgetButtonGetMiddleHiliteImage( window );
  489. }
  490. } // end else if, hilited and enabled
  491. else
  492. {
  493. if( BitTest( instData->getState(), WIN_STATE_SELECTED ) )
  494. {
  495. leftImage = GadgetButtonGetLeftEnabledSelectedImage( window );
  496. rightImage = GadgetButtonGetRightEnabledSelectedImage( window );
  497. centerImage = GadgetButtonGetMiddleEnabledSelectedImage( window );
  498. }
  499. else
  500. {
  501. leftImage = GadgetButtonGetLeftEnabledImage( window );
  502. rightImage = GadgetButtonGetRightEnabledImage( window );
  503. centerImage = GadgetButtonGetMiddleEnabledImage( window );
  504. }
  505. } // end else, enabled only
  506. // sanity, we need to have these images to make it look right
  507. if( leftImage == NULL || rightImage == NULL ||
  508. centerImage == NULL )
  509. return;
  510. // get image sizes for the ends
  511. ICoord2D leftSize, rightSize;
  512. leftSize.x = leftImage->getImageWidth();
  513. leftSize.y = leftImage->getImageHeight();
  514. rightSize.x = rightImage->getImageWidth();
  515. rightSize.y = rightImage->getImageHeight();
  516. // get two key points used in the end drawing
  517. ICoord2D leftEnd, rightStart;
  518. leftEnd.x = origin.x + leftSize.x + xOffset;
  519. leftEnd.y = origin.y + size.y + yOffset;
  520. rightStart.x = origin.x + size.x - rightSize.x + xOffset;
  521. rightStart.y = origin.y + yOffset;
  522. // draw the center repeating bar
  523. Int centerWidth, pieces;
  524. // get width we have to draw our repeating center in
  525. centerWidth = rightStart.x - leftEnd.x;
  526. if( centerWidth <= 0)
  527. {
  528. // TheDisplay->setClipRegion(&clipRegion);
  529. // draw left end
  530. start.x = origin.x + xOffset;
  531. start.y = origin.y + yOffset;
  532. end.y = leftEnd.y;
  533. end.x = origin.x + xOffset + size.x/2;
  534. TheWindowManager->winDrawImage(leftImage, start.x, start.y, end.x, end.y);
  535. // draw right end
  536. start.y = rightStart.y;
  537. start.x = end.x;
  538. end.x = origin.x + size.x;
  539. end.y = start.y + size.y;
  540. TheWindowManager->winDrawImage(rightImage, start.x, start.y, end.x, end.y);
  541. }
  542. else
  543. {
  544. // how many whole repeating pieces will fit in that width
  545. pieces = centerWidth / centerImage->getImageWidth();
  546. // draw the pieces
  547. start.x = leftEnd.x;
  548. start.y = origin.y + yOffset;
  549. end.y = start.y + size.y + yOffset; //centerImage->getImageHeight() + yOffset;
  550. // TheDisplay->setClipRegion(&clipRegion);
  551. for( i = 0; i < pieces; i++ )
  552. {
  553. end.x = start.x + centerImage->getImageWidth();
  554. TheWindowManager->winDrawImage( centerImage,
  555. start.x, start.y,
  556. end.x, end.y );
  557. start.x += centerImage->getImageWidth();
  558. } // end for i
  559. // we will draw the image but clip the parts we don't want to show
  560. IRegion2D reg;
  561. reg.lo.x = start.x;
  562. reg.lo.y = clipRegion.lo.y;
  563. reg.hi.x = rightStart.x;
  564. reg.hi.y = clipRegion.hi.y;
  565. centerWidth = rightStart.x - start.x;
  566. if( centerWidth > 0)
  567. {
  568. TheDisplay->setClipRegion(&reg);
  569. end.x = start.x + centerImage->getImageWidth();
  570. TheWindowManager->winDrawImage( centerImage,
  571. start.x, start.y,
  572. end.x, end.y );
  573. TheDisplay->enableClipping(FALSE);
  574. }
  575. // TheDisplay->setClipRegion(&clipRegion);
  576. // draw left end
  577. start.x = origin.x + xOffset;
  578. start.y = origin.y + yOffset;
  579. end = leftEnd;
  580. TheWindowManager->winDrawImage(leftImage, start.x, start.y, end.x, end.y);
  581. // draw right end
  582. start = rightStart;
  583. end.x = start.x + rightSize.x;
  584. end.y = start.y + size.y;
  585. TheWindowManager->winDrawImage(rightImage, start.x, start.y, end.x, end.y);
  586. }
  587. // draw the button text
  588. if( instData->getTextLength() )
  589. drawText( window, instData );
  590. // get window position
  591. window->winGetScreenPosition( &start.x, &start.y );
  592. window->winGetSize( &size.x, &size.y );
  593. // if we have a video buffer, draw the video buffer
  594. if ( instData->m_videoBuffer )
  595. {
  596. TheDisplay->drawVideoBuffer( instData->m_videoBuffer, start.x, start.y, start.x + size.x, start.y + size.y );
  597. }
  598. PushButtonData *pData = (PushButtonData *)window->winGetUserData();
  599. if( pData )
  600. {
  601. if( pData->overlayImage )
  602. {
  603. TheDisplay->drawImage( pData->overlayImage, start.x, start.y, start.x + size.x, start.y + size.y );
  604. }
  605. if( pData->drawClock )
  606. {
  607. if( pData->drawClock == NORMAL_CLOCK )
  608. {
  609. TheDisplay->drawRectClock(start.x, start.y, size.x, size.y, pData->percentClock,pData->colorClock);
  610. }
  611. else if( pData->drawClock == INVERSE_CLOCK )
  612. {
  613. TheDisplay->drawRemainingRectClock( start.x, start.y, size.x, size.y, pData->percentClock,pData->colorClock );
  614. }
  615. pData->drawClock = NO_CLOCK;
  616. window->winSetUserData(pData);
  617. }
  618. if( pData->drawBorder && pData->colorBorder != GAME_COLOR_UNDEFINED )
  619. {
  620. TheDisplay->drawOpenRect(start.x - 1, start.y - 1, size.x + 2, size.y + 2, 1, pData->colorBorder);
  621. }
  622. }
  623. // TheDisplay->enableClipping(FALSE);
  624. } // end W3DGadgetPushButtonImageDraw
  625. // drawButtonText =============================================================
  626. /** Draw button text to the screen */
  627. //=============================================================================
  628. static void drawText( GameWindow *window, WinInstanceData *instData )
  629. {
  630. ICoord2D origin, size, textPos;
  631. Int width, height;
  632. Color textColor, dropColor;
  633. DisplayString *text = instData->getTextDisplayString();
  634. // sanity
  635. if( text == NULL || text->getTextLength() == 0 )
  636. return;
  637. // get window position and size
  638. window->winGetScreenPosition( &origin.x, &origin.y );
  639. window->winGetSize( &size.x, &size.y );
  640. // set whether or not we center the wrapped text
  641. text->setWordWrapCentered( BitTest( instData->getStatus(), WIN_STATUS_WRAP_CENTERED ));
  642. text->setWordWrap(size.x);
  643. // get the right text color
  644. if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE )
  645. {
  646. textColor = window->winGetDisabledTextColor();
  647. dropColor = window->winGetDisabledTextBorderColor();
  648. } // end if, disabled
  649. else if( BitTest( instData->getState(), WIN_STATE_HILITED ) )
  650. {
  651. textColor = window->winGetHiliteTextColor();
  652. dropColor = window->winGetHiliteTextBorderColor();
  653. } // end else if, hilited
  654. else
  655. {
  656. textColor = window->winGetEnabledTextColor();
  657. dropColor = window->winGetEnabledTextBorderColor();
  658. } // end enabled only
  659. // set our font to that of our parent if not the same
  660. if( text->getFont() != window->winGetFont() )
  661. text->setFont( window->winGetFont() );
  662. // get text size
  663. text->getSize( &width, &height );
  664. // where to draw
  665. textPos.x = origin.x + (size.x / 2) - (width / 2);
  666. textPos.y = origin.y + (size.y / 2) - (height / 2);
  667. // text->setClipRegion(&clipRegion);
  668. // draw it
  669. text->draw( textPos.x, textPos.y, textColor, dropColor );
  670. } // end drawButtonText
  671. // W3DMainMenuRandomTextDraw ==================================================
  672. /** Specialized drawing function for the random text */
  673. //=============================================================================
  674. void W3DMainMenuRandomTextDraw( GameWindow *window, WinInstanceData *instData )
  675. {
  676. TextData *tData = (TextData *)window->winGetUserData();
  677. Color textColor, textOutlineColor;
  678. ICoord2D size, origin, textPos;
  679. Int textWidth, textHeight;
  680. IRegion2D textclipRegion;
  681. // get window position and size
  682. window->winGetScreenPosition( &origin.x, &origin.y );
  683. window->winGetSize( &size.x, &size.y );
  684. textColor = window->winGetDisabledTextColor();
  685. textOutlineColor = window->winGetDisabledTextBorderColor();
  686. // draw the text
  687. if( !(tData->text && (textColor != WIN_COLOR_UNDEFINED)) )
  688. return;
  689. DisplayString *text = tData->text;
  690. //Init the clip region
  691. textclipRegion.lo.x = origin.x + 1;
  692. textclipRegion.lo.y = origin.y + 1;
  693. textclipRegion.hi.x = origin.x + size.x - 1;
  694. textclipRegion.hi.y = origin.y + size.y - 1;
  695. // how much space will this text take up
  696. text->getSize( &textWidth, &textHeight );
  697. // draw the text
  698. textPos.x = origin.x;
  699. textPos.y = origin.y + (size.y / 2) - (textHeight / 2);
  700. text->setClipRegion(&textclipRegion);
  701. text->draw( textPos.x, textPos.y, textColor, textOutlineColor );
  702. }
  703. void W3DThinBorderDraw( GameWindow *window, WinInstanceData *instData )
  704. {
  705. ICoord2D start, size;
  706. const Image *image;
  707. //W3DGameWinDefaultDraw( window, instData );
  708. // TheDisplay->setClipRegion(&clipRegion);
  709. window->winGetScreenPosition( &start.x, &start.y );
  710. window->winGetSize( &size.x, &size.y );
  711. image = window->winGetEnabledImage( 0 );
  712. if( image )
  713. {
  714. ICoord2D begin, end;
  715. begin.x = start.x + instData->m_imageOffset.x;
  716. begin.y = start.y + instData->m_imageOffset.y;
  717. end.x = begin.x + size.x;
  718. end.y = begin.y + size.y;
  719. TheWindowManager->winDrawImage( image, begin.x, begin.y, end.x, end.y );
  720. } // end if
  721. // get window position
  722. // TheDisplay->drawOpenRect(start.x - 1, start.y - 1, size.x + 2, size.y + 2, 1, BrownishColor);
  723. TheDisplay->enableClipping(FALSE);
  724. }
  725. void W3DMainMenuInit( WindowLayout *layout, void *userData )
  726. {
  727. /*
  728. GameWindow *parent = layout->getFirstWindow();
  729. // NameKeyType buttonWorldBuilderID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:ButtonWorldBuilder" );
  730. // GameWindow *buttonWorldBuilder = TheWindowManager->winGetWindowFromId( parent, buttonWorldBuilderID );
  731. // if (buttonWorldBuilder)
  732. // buttonWorldBuilder->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  733. NameKeyType staticTextRandom1ID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:StaticTextRandom1" );
  734. NameKeyType staticTextRandom2ID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:StaticTextRandom2" );
  735. GameWindow *staticTextRandom1 = TheWindowManager->winGetWindowFromId( parent, staticTextRandom1ID);
  736. GameWindow *staticTextRandom2 = TheWindowManager->winGetWindowFromId( parent, staticTextRandom2ID);
  737. if (staticTextRandom1)
  738. staticTextRandom1->winSetDrawFunc(W3DMainMenuRandomTextDraw);
  739. if (staticTextRandom2)
  740. staticTextRandom2->winSetDrawFunc(W3DMainMenuRandomTextDraw);
  741. // //NameKeyType getUpdateID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:ButtonGetUpdate" );
  742. NameKeyType buttonUSAID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:ButtonUSA" );
  743. NameKeyType buttonGLAID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:ButtonGLA" );
  744. NameKeyType buttonChinaID = TheNameKeyGenerator->nameToKey( "MainMenu.wnd:ButtonChina" );
  745. NameKeyType skirmishID = TheNameKeyGenerator->nameToKey( AsciiString("MainMenu.wnd:ButtonSkirmish") );
  746. NameKeyType onlineID = TheNameKeyGenerator->nameToKey( AsciiString("MainMenu.wnd:ButtonOnline") );
  747. NameKeyType networkID = TheNameKeyGenerator->nameToKey( AsciiString("MainMenu.wnd:ButtonNetwork") );
  748. GameWindow *button = TheWindowManager->winGetWindowFromId( parent, skirmishID );
  749. if (button)
  750. button->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  751. button = TheWindowManager->winGetWindowFromId( parent, onlineID );
  752. if (button)
  753. button->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  754. button = TheWindowManager->winGetWindowFromId( parent, networkID );
  755. if (button)
  756. button->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  757. //GameWindow *getUpdate = TheWindowManager->winGetWindowFromId( parent, getUpdateID );
  758. // if (getUpdate)
  759. // getUpdate->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  760. GameWindow *buttonUSA = TheWindowManager->winGetWindowFromId( parent, buttonUSAID );
  761. if (buttonUSA)
  762. buttonUSA->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  763. GameWindow *buttonGLA = TheWindowManager->winGetWindowFromId( parent, buttonGLAID );
  764. if (buttonGLA)
  765. buttonGLA->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  766. GameWindow *buttonChina = TheWindowManager->winGetWindowFromId( parent, buttonChinaID );
  767. if (buttonChina)
  768. buttonChina->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  769. GameWindow *win = NULL;
  770. win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonMultiBack"));
  771. if(win)
  772. win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  773. win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonSingleBack"));
  774. if(win)
  775. win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  776. win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonExit"));
  777. if(win)
  778. win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  779. win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonOptions"));
  780. if(win)
  781. win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  782. win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonMultiplayer"));
  783. if(win)
  784. win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  785. win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonSinglePlayer"));
  786. if(win)
  787. win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  788. win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonReplay"));
  789. if(win)
  790. win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  791. win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonLoadGame"));
  792. if(win)
  793. win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  794. win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonLoadReplay"));
  795. if(win)
  796. win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  797. win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonLoadReplayBack"));
  798. if(win)
  799. win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  800. win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonTRAINING"));
  801. if(win)
  802. win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  803. win = TheWindowManager->winGetWindowFromId(parent, TheNameKeyGenerator->nameToKey("MainMenu.wnd:ButtonCredits"));
  804. if(win)
  805. win->winSetDrawFunc(W3DMainMenuButtonDropShadowDraw);
  806. GameWindow *clipRegionWin = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( AsciiString("MainMenu.wnd:MapBorder") ));
  807. Int x,y,width,height;
  808. clipRegionWin->winGetScreenPosition(&x, &y);
  809. clipRegionWin->winGetSize(&width, &height);
  810. clipRegion.lo.x = x - 10;
  811. clipRegion.lo.y = y ;
  812. clipRegion.hi.x = x + width + 10;
  813. clipRegion.hi.y = y + height + 10;
  814. */
  815. MainMenuInit( layout, userData );
  816. }
  817. void W3DCreditsMenuDraw( GameWindow *window, WinInstanceData *instData )
  818. {
  819. TheCredits->draw();
  820. }