EURO_FIX.CPP 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4. #include <conio.h>
  5. #include "eurodefs.h"
  6. #include "euro_fxd.h"
  7. #include "euro.equ"
  8. #include "euro_sym.h"
  9. #include "euro_def.h"
  10. #include "euro_var.h"
  11. #include "euro_grf.h"
  12. #include "euro_dsk.h"
  13. #include "euro_cnt.h"
  14. #include "euro_gen.h"
  15. #include "euro_rnd.h"
  16. #include "euro_int.h"
  17. #include "defines.h"
  18. //********************************************************************************************************************************
  19. void DisplayRedrawButton( char Match )
  20. {
  21. if ( Match == 0 )
  22. {
  23. RedrawHandle = AddAnimation( 507, 180,
  24. ( (float)BUTN_WHBL ), ( (float)BUTN_WHBL+11.9 ),
  25. 0.0, REDRAW_BOX, CONT_ANIM );
  26. RedrawHighlight = ControlOptionHighlight( -1, REDRAW_BOX, REDRAWdisp_BOX,
  27. -1, RedrawHandle, BUTN_LBLS+Redraw );
  28. }
  29. }
  30. //********************************************************************************************************************************
  31. char FindNextFixtureTeam( char drawcode )
  32. {
  33. char team = 0;
  34. for ( char t=0; t < 16 ; t++ )
  35. {
  36. if ( GroupDrawInfo[t] == drawcode )
  37. {
  38. team = t;
  39. break;
  40. }
  41. }
  42. return (team);
  43. }
  44. //********************************************************************************************************************************
  45. char FindTeamInLeague( char posn )
  46. {
  47. char team = 0;
  48. for ( char t=0; t < 16 ; t++ )
  49. {
  50. if ( LeaguePositions[t] == posn )
  51. {
  52. team = t;
  53. break;
  54. }
  55. }
  56. return (team);
  57. }
  58. //********************************************************************************************************************************
  59. void GroupFixturesPage( char MENU, signed char BOX )
  60. {
  61. if ( MENU == GROUP_FIXTURES && LogicState == RUN_FRONTEND )
  62. {
  63. if ( BOX == REDRAW_BOX && ButtonState != 0 )
  64. {
  65. Animation_table[RedrawHandle].AnimationSpeed =
  66. WhichButton( ButtonState, 0.85);
  67. ChangeMenu = EURO_REDRAW;
  68. DeBounce = TRUE;
  69. }
  70. if ( BOX == NXT_MTCH_BOX && ButtonState != 0 )
  71. {
  72. /// tempory transfer to next match....
  73. EUROteamA = FindNextFixtureTeam( Fixtures[MatchNumber].HomeTeam );
  74. EUROteamB = FindNextFixtureTeam( Fixtures[MatchNumber].AwayTeam );
  75. ///
  76. Animation_table[NextMatchHandle].AnimationSpeed =
  77. WhichButton( ButtonState, 0.85);
  78. if ( MatchNumber<24 )
  79. ChangeMenu = NEXT_MATCH;
  80. else
  81. ChangeMenu = QUALIFIERS;
  82. DeBounce = TRUE;
  83. }
  84. RedrawHighlight = ControlOptionHighlight( BOX, REDRAW_BOX, REDRAWdisp_BOX, RedrawHighlight,
  85. RedrawHandle, BUTN_LBLS+Redraw );
  86. NextMatchHighlight = ControlOptionHighlight( BOX, NXT_MTCH_BOX, NXT_MTCHdisp_BOX, NextMatchHighlight,
  87. NextMatchHandle, BUTN_LBLS+NextMatch );
  88. }
  89. }
  90. //********************************************************************************************************************************
  91. void CalculateLeagueTables()
  92. {
  93. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  94. //º º
  95. //º VERBOSE INFORMATION, DISPLAYS LEAGUE TABLE DATA IF REQUESTED º
  96. //º º
  97. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  98. if ( EUROverbose != 0 )
  99. {
  100. printf("\n LEAGUE TABLE CALCULATION DATA:\n\n");
  101. fflush(stdout);
  102. printf("  Points for a win: %d\n", WinPts);
  103. fflush(stdout);
  104. printf("  Points for a draw: %d\n", DrawPts);
  105. fflush(stdout);
  106. }
  107. for ( char t=0; t < 16 ; t++ )
  108. {
  109. LeaguePositions[t] = GroupDrawInfo[t]; //t;
  110. LeagueTable[t].points =
  111. ((LeagueTable[t].won*WinPts) + (LeagueTable[t].drew*DrawPts));
  112. LeagueTable[t].goalDiff =
  113. (LeagueTable[t].goalsFor-LeagueTable[t].goalsAgainst);
  114. if ( EUROverbose != 0 )
  115. printf(" (%d)  W: %d D: %d L: %d Gf: %d Ga: %d Pts: %d %s\n",
  116. LeaguePositions[t],
  117. LeagueTable[t].won, LeagueTable[t].drew, LeagueTable[t].lost,
  118. LeagueTable[t].goalsFor, LeagueTable[t].goalsAgainst,
  119. LeagueTable[t].points, GetTEXT(TEAM_NMES+t ) );
  120. fflush(stdout);
  121. }
  122. char SwapTemp;
  123. for ( char scans = 0; scans < 16; scans++ )
  124. {
  125. for ( char teama = 0; teama < 16; teama++ )
  126. {
  127. for ( char teamb = 0; teamb < 16; teamb++ )
  128. {
  129. if ( teama != teamb &&
  130. ( (GroupDrawInfo[teama] & 12) == (GroupDrawInfo[teamb] & 12)) )
  131. {
  132. if (
  133. ( LeagueTable[ teama ].points < LeagueTable[ teamb ].points &&
  134. LeaguePositions[ teama ] < LeaguePositions[ teamb ] )
  135. || ( LeagueTable[ teama ].points == LeagueTable[ teamb ].points &&
  136. LeagueTable[ teama ].won < LeagueTable[ teamb ].won &&
  137. LeaguePositions[ teama ] < LeaguePositions[ teamb ] )
  138. || ( LeagueTable[ teama ].points == LeagueTable[ teamb ].points &&
  139. LeagueTable[ teama ].won == LeagueTable[ teamb ].won &&
  140. LeagueTable[ teama ].goalDiff < LeagueTable[ teamb ].goalDiff &&
  141. LeaguePositions[ teama ] < LeaguePositions[ teamb ] )
  142. )
  143. {
  144. SwapTemp = LeaguePositions[ teamb ];
  145. LeaguePositions[ teamb ] =
  146. LeaguePositions[ teama ];
  147. LeaguePositions[ teama ] =
  148. SwapTemp;
  149. }
  150. }
  151. }
  152. }
  153. }
  154. }
  155. //********************************************************************************************************************************
  156. void DisplayLeagueTables()
  157. {
  158. char PAL, PAL2;
  159. short team;
  160. char *ammount;
  161. for ( char h=0; h < 16 ; h++ )
  162. {
  163. DisplayString(
  164. (GroupFixtureDEFN[h].xposn)-
  165. (PixelLengthOfString(GetTEXT( GroupFixtureDEFN[h].string), SMALL_FONT ) /2 ),
  166. GroupFixtureDEFN[h].yposn,
  167. GetTEXT( GroupFixtureDEFN[h].string ),
  168. SMALL_FONT, 22, NO_BOX,
  169. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  170. team = (short)FindTeamInLeague(h);
  171. PAL = LeagueColourOffsets[team];
  172. PAL2 = 15;
  173. if ( MatchNumber > 23 && (h & 2) )
  174. {
  175. PAL = 22;
  176. PAL2 = 22;
  177. }
  178. DisplayString(
  179. LeaguePosnDEFN[h].xposn,
  180. LeaguePosnDEFN[h].yposn,
  181. GetTEAMname( team, 11 ),
  182. SMALL_FONT, PAL, NO_BOX,
  183. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  184. itoa( LeagueTable[team].won, ammount, 10);
  185. DisplayString(
  186. WinPosnDEFN[h].xposn -
  187. (PixelLengthOfString( ammount, SMALL_FONT ) /2 ),
  188. WinPosnDEFN[h].yposn,
  189. ammount,
  190. SMALL_FONT, PAL2, NO_BOX,
  191. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  192. itoa( LeagueTable[team].drew, ammount, 10);
  193. DisplayString(
  194. DrawPosnDEFN[h].xposn -
  195. (PixelLengthOfString( ammount, SMALL_FONT ) /2 ),
  196. DrawPosnDEFN[h].yposn,
  197. ammount,
  198. SMALL_FONT, PAL2, NO_BOX,
  199. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  200. itoa( LeagueTable[team].lost, ammount, 10);
  201. DisplayString(
  202. LosePosnDEFN[h].xposn -
  203. (PixelLengthOfString( ammount, SMALL_FONT ) /2 ),
  204. LosePosnDEFN[h].yposn,
  205. ammount,
  206. SMALL_FONT, PAL2, NO_BOX,
  207. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  208. itoa( LeagueTable[team].points, ammount, 10);
  209. DisplayString(
  210. PointsPosnDEFN[h].xposn -
  211. (PixelLengthOfString( ammount, SMALL_FONT ) /2 ),
  212. PointsPosnDEFN[h].yposn,
  213. ammount,
  214. SMALL_FONT, PAL2, NO_BOX,
  215. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  216. }
  217. }
  218. //********************************************************************************************************************************
  219. void DisplayLeagueFixtures( char Match )
  220. {
  221. char NextMtch = Match;
  222. char PAL;
  223. char ammount[5];
  224. if ( Match>23) // if displaying final tables then make slight alteration
  225. Match = 16; // so fixtures don't zoom ahead....
  226. Match&= (31-7);
  227. for ( char f=0; f < 8 ; f++ )
  228. {
  229. PAL = 22;
  230. if ( Match == NextMtch )
  231. PAL = 15;
  232. if ( Match<NextMtch )
  233. {
  234. char ResText[128];
  235. strcpy(ResText, GetTEAMname( FindNextFixtureTeam( Fixtures[Match].HomeTeam ), 11) );
  236. strcat(ResText, " ");
  237. itoa( (int)Results[Match].HomeScore, EUROammount, 10);
  238. strcat(ResText, EUROammount);
  239. DisplayString(
  240. Fixtures[Match].fixXposn-
  241. (PixelLengthOfString( ResText,SMALL_FONT) /2 ),
  242. Fixtures[Match].fixYposn,
  243. ResText,
  244. SMALL_FONT, 29, NO_BOX,
  245. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  246. strcpy(ResText, GetTEAMname( FindNextFixtureTeam( Fixtures[Match].AwayTeam ), 11) );
  247. strcat(ResText, " ");
  248. itoa( (int)Results[Match].AwayScore, EUROammount, 10);
  249. strcat(ResText, EUROammount);
  250. DisplayString(
  251. (Fixtures[Match].fixXposn+116)-
  252. (PixelLengthOfString( ResText,SMALL_FONT) /2 ),
  253. Fixtures[Match].fixYposn,
  254. ResText,
  255. SMALL_FONT, 29, NO_BOX,
  256. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  257. }
  258. else
  259. {
  260. DisplayString(
  261. Fixtures[Match].fixXposn-
  262. (PixelLengthOfString(
  263. GetTEAMname( FindNextFixtureTeam( Fixtures[Match].HomeTeam ), 11), SMALL_FONT ) /2 ),
  264. Fixtures[Match].fixYposn,
  265. GetTEAMname( FindNextFixtureTeam( Fixtures[Match].HomeTeam ), 11), SMALL_FONT,
  266. PAL, NO_BOX,
  267. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  268. DisplayString(
  269. (Fixtures[Match].fixXposn+116)-
  270. (PixelLengthOfString(
  271. GetTEAMname( FindNextFixtureTeam( Fixtures[Match].AwayTeam), 11), SMALL_FONT ) /2 ),
  272. Fixtures[Match].fixYposn,
  273. GetTEAMname( FindNextFixtureTeam( Fixtures[Match].AwayTeam), 11), SMALL_FONT,
  274. PAL, NO_BOX,
  275. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  276. DisplayString(
  277. (Fixtures[Match].fixXposn+58)-
  278. (PixelLengthOfString(GetTEXT( VRUS_LBLE ), SMALL_FONT ) /2 ),
  279. Fixtures[Match].fixYposn,
  280. GetTEXT( VRUS_LBLE ),
  281. SMALL_FONT, PAL, NO_BOX,
  282. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  283. }
  284. Match++;
  285. }
  286. }
  287. //********************************************************************************************************************************
  288. //
  289. //void DisplayVersusList( char Match )
  290. // {
  291. //
  292. // char NextMtch = Match;
  293. // Match&= (31-7);
  294. //
  295. // for ( char v=0; v < 8 ; v++ )
  296. // {
  297. //
  298. // if ( Match >= NextMtch )
  299. // {
  300. //
  301. // DisplayString( VersusPosnDEFN[v].xposn - (PixelLengthOfString(GetTEXT( VRUS_LBLE ), SMALL_FONT ) /2 ),
  302. // VersusPosnDEFN[v].yposn,
  303. // GetTEXT( VRUS_LBLE ),
  304. // SMALL_FONT, 22, NO_BOX,
  305. // &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  306. // }
  307. //
  308. // Match++;
  309. //
  310. // }
  311. // }
  312. //
  313. //********************************************************************************************************************************
  314. void EuroReDraw( char MENU, signed char BOX )
  315. {
  316. signed char DrawnTeam, venue;
  317. if ( MENU == EURO_REDRAW )
  318. {
  319. DefaultdrawHighlight = ControlOptionHighlight( BOX, DEFAULT_BOX,
  320. DEFAULTdisp_BOX, DefaultdrawHighlight,
  321. DefaultHandle, BUTN_LBLS+Default );
  322. if ( BOX == DEFAULT_BOX && ButtonState != 0 && LogicState == RUN_FRONTEND )
  323. {
  324. memcpy( &GroupDrawInfo[0], &GroupDrawDefaultInfo[0], 16 );
  325. Animation_table[DefaultHandle].AnimationSpeed =
  326. WhichButton( ButtonState, 0.85);
  327. ChangeMenu = GROUP_FIXTURES;
  328. DeBounce = TRUE;
  329. }
  330. if ( EuroReDrawCounter <= 0.0 )
  331. {
  332. if ( EuroReDrawFlag == 22 )
  333. {
  334. if ( BOX == GRP_FIX_BOX && ButtonState == LEFT_BUTTON && LogicState == RUN_FRONTEND )
  335. {
  336. Animation_table[GrpFixHandle].AnimationSpeed =
  337. WhichButton( ButtonState, 0.85);
  338. ChangeMenu = GROUP_FIXTURES;
  339. DeBounce = TRUE;
  340. }
  341. RedrawdoneHighlight = ControlOptionHighlight( BOX, GRP_FIX_BOX,
  342. GRP_FIXdisp_BOX, RedrawdoneHighlight,
  343. GrpFixHandle, BUTN_LBLS+Done );
  344. }
  345. if ( EuroReDrawFlag == 21 )
  346. {
  347. char c;
  348. for ( char t=0; t < 16 ; t++ )
  349. {
  350. c = GroupDrawInfo[t] / 4;
  351. GroupDrawInfo[t] = (GroupDrawInfo[t] & 3) + (GroupVenues[c]*4);
  352. }
  353. EuroReDrawFlag++;
  354. GrpFixHandle = AddAnimation( 446, 425,
  355. ( (float)BUTN_WHBL ), ( (float)BUTN_WHBL+11.9 ),
  356. 0.0, GRP_FIX_BOX, RUN_ONCE );
  357. Animation_table[GrpFixHandle].Counter = 6.0;
  358. Animation_table[GrpFixHandle].AnimationSpeed = 0.85;
  359. RedrawdoneHighlight = ControlOptionHighlight( -1, GRP_FIX_BOX,
  360. GRP_FIXdisp_BOX, -1,
  361. GrpFixHandle, BUTN_LBLS+Done );
  362. }
  363. if ( EuroReDrawFlag > 16 && EuroReDrawFlag < 21 )
  364. {
  365. if ( GroupVenues[ (EuroReDrawFlag-17) ] != -1 )
  366. EuroReDrawFlag++;
  367. else
  368. {
  369. venue = (char)( GetRnd2() & 3 );
  370. if ( GroupVenues[0] != venue &&
  371. GroupVenues[1] != venue &&
  372. GroupVenues[2] != venue &&
  373. GroupVenues[3] != venue )
  374. {
  375. char v = (EuroReDrawFlag-17);
  376. GroupVenues[v] = venue;
  377. CopyFromBACKtoPSEUDObuffer(
  378. &FrontendPseudoDEFN, &FrontendBackgroundDEFN,
  379. ReDrawHeadPosnDEFN[v].xposn-84,
  380. ReDrawHeadPosnDEFN[v].yposn-5,
  381. 168, 28 );
  382. DisplayString(
  383. ReDrawHeadPosnDEFN[v].xposn-
  384. ((PixelLengthOfString( GetTEXT( VNUE_NMES+(venue*2) ),
  385. SMALL_FONT )) /2),
  386. ReDrawHeadPosnDEFN[v].yposn-7,
  387. GetTEXT( VNUE_NMES+(venue*2) ),
  388. SMALL_FONT,
  389. 15,
  390. NO_BOX,
  391. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  392. DisplayString(
  393. ReDrawHeadPosnDEFN[v].xposn-
  394. ((PixelLengthOfString( GetTEXT( VNUE_NMES+Birmingham+(venue*2) ),
  395. SMALL_FONT )) /2),
  396. ReDrawHeadPosnDEFN[v].yposn+8,
  397. GetTEXT( VNUE_NMES+Birmingham+(venue*2) ),
  398. SMALL_FONT,
  399. 15,
  400. NO_BOX,
  401. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  402. AddToDumpList(
  403. ReDrawHeadPosnDEFN[v].xposn-84,
  404. ReDrawHeadPosnDEFN[v].yposn-7,
  405. 168, 32 );
  406. EuroReDrawFlag++;
  407. EuroReDrawCounter = 25;
  408. }
  409. }
  410. }
  411. if ( EuroReDrawFlag==16 )
  412. {
  413. venue = GroupDrawInfo[England] /4;
  414. EuroReDrawFlag = 17;
  415. for ( char v=0; v < 4 ; v++ )
  416. {GroupVenues[v] = -1;}
  417. GroupVenues[venue] = 0;
  418. CopyFromBACKtoPSEUDObuffer(
  419. &FrontendPseudoDEFN, &FrontendBackgroundDEFN,
  420. ReDrawHeadPosnDEFN[venue].xposn-84,
  421. ReDrawHeadPosnDEFN[venue].yposn-5,
  422. 168, 28 );
  423. DisplayString(
  424. ReDrawHeadPosnDEFN[venue].xposn-
  425. ((PixelLengthOfString( GetTEXT( VNUE_NMES ),
  426. SMALL_FONT )) /2),
  427. ReDrawHeadPosnDEFN[venue].yposn-7,
  428. GetTEXT( VNUE_NMES ),
  429. SMALL_FONT,
  430. 15,
  431. NO_BOX,
  432. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  433. DisplayString(
  434. ReDrawHeadPosnDEFN[venue].xposn-
  435. ((PixelLengthOfString( GetTEXT( VNUE_NMES+Birmingham ),
  436. SMALL_FONT )) /2),
  437. ReDrawHeadPosnDEFN[venue].yposn+8,
  438. GetTEXT( VNUE_NMES+Birmingham ),
  439. SMALL_FONT,
  440. 15,
  441. NO_BOX,
  442. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  443. AddToDumpList(
  444. ReDrawHeadPosnDEFN[venue].xposn-84,
  445. ReDrawHeadPosnDEFN[venue].yposn-7,
  446. 168, 32 );
  447. EuroReDrawCounter = 25;
  448. }
  449. if ( EuroReDrawFlag > 11 && EuroReDrawFlag < 16 )
  450. {
  451. DrawnTeam = (char)( GetRnd2() & 15);
  452. if ( (DrawnTeam == England ||
  453. DrawnTeam == Spain ||
  454. DrawnTeam == Denmark ||
  455. DrawnTeam == Germany) &&
  456. GroupDrawInfo[DrawnTeam] == -1 )
  457. {
  458. GroupDrawInfo[DrawnTeam] = GroupDrawCode[EuroReDrawFlag];
  459. DisplayString(
  460. ReDrawPosnDEFN[EuroReDrawFlag].xposn-
  461. ((PixelLengthOfString( GetTEAMname( DrawnTeam, 11 ),
  462. MEDIUM_FONT )) /2),
  463. ReDrawPosnDEFN[EuroReDrawFlag].yposn,
  464. GetTEAMname( DrawnTeam, 11 ),
  465. MEDIUM_FONT,
  466. LeagueColourOffsets[DrawnTeam],
  467. NO_BOX,
  468. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  469. DisplayString(
  470. ReDrawPosnDEFN[EuroReDrawFlag].xposn-
  471. ((PixelLengthOfString( GetTEAMname( DrawnTeam, 11 ),
  472. MEDIUM_FONT )) /2),
  473. ReDrawPosnDEFN[EuroReDrawFlag].yposn,
  474. GetTEAMname( DrawnTeam, 11 ),
  475. MEDIUM_FONT,
  476. LeagueColourOffsets[DrawnTeam],
  477. NO_BOX,
  478. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  479. AddToDumpList(
  480. ReDrawPosnDEFN[EuroReDrawFlag].xposn-84,
  481. ReDrawPosnDEFN[EuroReDrawFlag].yposn,
  482. 168, 20 );
  483. EuroReDrawFlag++;
  484. EuroReDrawCounter = 25;
  485. }
  486. }
  487. if ( EuroReDrawFlag > -1 && EuroReDrawFlag < 12 )
  488. {
  489. DrawnTeam = (char)( GetRnd2() & 15);
  490. if ( DrawnTeam != England &&
  491. DrawnTeam != Spain &&
  492. DrawnTeam != Denmark &&
  493. DrawnTeam != Germany &&
  494. GroupDrawInfo[DrawnTeam] == -1 )
  495. {
  496. GroupDrawInfo[DrawnTeam] = GroupDrawCode[EuroReDrawFlag];
  497. DisplayString(
  498. ReDrawPosnDEFN[EuroReDrawFlag].xposn-
  499. ((PixelLengthOfString( GetTEAMname( DrawnTeam, 11 ),
  500. MEDIUM_FONT )) /2),
  501. ReDrawPosnDEFN[EuroReDrawFlag].yposn,
  502. GetTEAMname( DrawnTeam, 11 ),
  503. MEDIUM_FONT,
  504. LeagueColourOffsets[DrawnTeam],
  505. NO_BOX,
  506. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  507. DisplayString(
  508. ReDrawPosnDEFN[EuroReDrawFlag].xposn-
  509. ((PixelLengthOfString( GetTEAMname( DrawnTeam, 11 ),
  510. MEDIUM_FONT )) /2),
  511. ReDrawPosnDEFN[EuroReDrawFlag].yposn,
  512. GetTEAMname( DrawnTeam, 11 ),
  513. MEDIUM_FONT,
  514. LeagueColourOffsets[DrawnTeam],
  515. NO_BOX,
  516. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  517. AddToDumpList(
  518. ReDrawPosnDEFN[EuroReDrawFlag].xposn-84,
  519. ReDrawPosnDEFN[EuroReDrawFlag].yposn,
  520. 168, 20 );
  521. EuroReDrawFlag++;
  522. EuroReDrawCounter = 25;
  523. }
  524. }
  525. if ( EuroReDrawFlag == -1 )
  526. {
  527. for ( char r=0; r < 16 ; r++ )
  528. {GroupDrawInfo[r] = -1;}
  529. EuroReDrawFlag = 0;
  530. EuroReDrawCounter = 25;
  531. }
  532. }
  533. if ( EuroReDrawCounter > 0.0 )
  534. EuroReDrawCounter-= 1.85;
  535. }
  536. }
  537. //********************************************************************************************************************************
  538. void DisplayGroupHeadings()
  539. {
  540. for ( char h=0; h < 4 ; h++ )
  541. {
  542. DisplayString(
  543. ReDrawHeadPosnDEFN[h].xposn-
  544. ((PixelLengthOfString( GetTEXT( DRGR_LBLE+h ),
  545. MEDIUM_FONT )) /2),
  546. ReDrawHeadPosnDEFN[h].yposn,
  547. GetTEXT( DRGR_LBLE+h ),
  548. MEDIUM_FONT,
  549. 29,
  550. NO_BOX,
  551. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  552. AddToDumpList(
  553. ReDrawHeadPosnDEFN[h].xposn-84,
  554. ReDrawHeadPosnDEFN[h].yposn,
  555. 168, 20 );
  556. }
  557. }
  558. //********************************************************************************************************************************
  559. void DisplayQualifierGroupHeadings()
  560. {
  561. for ( char h=0; h < 4 ; h++ )
  562. {
  563. DisplayString(
  564. QualifierHeadPosnDEFN[h].xposn,
  565. QualifierHeadPosnDEFN[h].yposn,
  566. GetTEXT( GRQU_LBLS+h ),
  567. MEDIUM_FONT,
  568. 29,
  569. NO_BOX,
  570. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  571. }
  572. }
  573. //********************************************************************************************************************************
  574. void DisplayQualifyingTeams()
  575. {
  576. short team;
  577. DisplayString( 12, 92,
  578. GetTEXT (QULY_LBLE),
  579. LARGE_FONT, 36, NO_BOX, &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  580. for ( char q=0; q < 8 ; q++ )
  581. {
  582. team = (short)FindTeamInLeague( qualifiers[q].team );
  583. DisplayString( qualifiers[q].xposn-
  584. (PixelLengthOfString(GetTEAMname( team, 11), LARGE_FONT ) /2 ),
  585. qualifiers[q].yposn,
  586. GetTEAMname( team, 11),
  587. LARGE_FONT, 43+(7*q), NO_BOX,
  588. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  589. LoadPalette( BIN_TBUL_PAL+( 8*team ),
  590. &EuroDATfile[0], (44+(7*q)) );
  591. }
  592. }
  593. //********************************************************************************************************************************
  594. void DoFinalRoundFixtures( char MENU, signed char BOX )
  595. {
  596. if ( MENU == QUALIFIERS && LogicState == RUN_FRONTEND )
  597. {
  598. if ( BOX == NXT_MTCH_BOX && ButtonState != 0 )
  599. {
  600. Animation_table[NextMatchHandle].AnimationSpeed =
  601. WhichButton( ButtonState, 0.85);
  602. ChangeMenu = QUARTER_FINALS;
  603. DeBounce = TRUE;
  604. }
  605. NextMatchHighlight = ControlOptionHighlight( BOX, NXT_MTCH_BOX, NXT_MTCHdisp_BOX, NextMatchHighlight,
  606. NextMatchHandle, BUTN_LBLS+NextMatch );
  607. }
  608. if ( ( MENU == QUARTER_FINALS || MENU == SEMI_FINALS || MENU == FINAL_MATCH )
  609. && LogicState == RUN_FRONTEND )
  610. {
  611. if ( BOX == NXT_MTCH_BOX && ButtonState != 0 )
  612. {
  613. EUROteamA = FindNextFixtureTeam( Fixtures[MatchNumber].HomeTeam );
  614. EUROteamB = FindNextFixtureTeam( Fixtures[MatchNumber].AwayTeam );
  615. Animation_table[NextMatchHandle].AnimationSpeed =
  616. WhichButton( ButtonState, 0.85);
  617. if ( MatchNumber==28 && MENU==QUARTER_FINALS )
  618. {
  619. ChangeMenu = SEMI_FINALS;
  620. GroupDrawInfo[Results[24].WinningTeam] = TEAM_1q;
  621. GroupDrawInfo[Results[25].WinningTeam] = TEAM_2q;
  622. GroupDrawInfo[Results[26].WinningTeam] = TEAM_3q;
  623. GroupDrawInfo[Results[27].WinningTeam] = TEAM_4q;
  624. }
  625. else
  626. if ( MatchNumber==30 && MENU==SEMI_FINALS)
  627. {
  628. ChangeMenu = FINAL_MATCH;
  629. GroupDrawInfo[Results[28].WinningTeam] = TEAM_1s;
  630. GroupDrawInfo[Results[29].WinningTeam] = TEAM_2s;
  631. }
  632. else
  633. ChangeMenu = NEXT_MATCH;
  634. DeBounce = TRUE;
  635. }
  636. NextMatchHighlight = ControlOptionHighlight( BOX, NXT_MTCH_BOX, NXT_MTCHdisp_BOX, NextMatchHighlight,
  637. NextMatchHandle, BUTN_LBLS+NextMatch );
  638. }
  639. }
  640. //********************************************************************************************************************************
  641. void DisplayFinalRoundFixtures( char Match, char MENU )
  642. {
  643. char n;
  644. char ammount[5];
  645. char NextMtch;
  646. char *Outcome;
  647. NextMtch = Match;
  648. if ( MENU == QUARTER_FINALS )
  649. {
  650. Match = 24;
  651. n = 4;
  652. }
  653. else
  654. if ( MENU == SEMI_FINALS )
  655. {
  656. Match = 28;
  657. n = 2;
  658. }
  659. else
  660. n = 1;
  661. for ( char f=0; f < n ; f++ )
  662. {
  663. LoadPalette( BIN_TBUL_PAL+( 8*FindNextFixtureTeam( Fixtures[Match].HomeTeam ) ),
  664. &EuroDATfile[0], (44+(14*f)) );
  665. LoadPalette( BIN_TBUL_PAL+( 8*FindNextFixtureTeam( Fixtures[Match].AwayTeam ) ),
  666. &EuroDATfile[0], (44+7+(14*f)) );
  667. if ( Match<NextMtch )
  668. {
  669. char ResText[128];
  670. strcpy(ResText, GetTEAMname( FindNextFixtureTeam( Fixtures[Match].HomeTeam ), 11) );
  671. strcat(ResText, " ");
  672. itoa( (int)Results[Match].HomeScore, EUROammount, 10);
  673. strcat(ResText, EUROammount);
  674. DisplayString(
  675. Fixtures[Match].fixXposn-
  676. (PixelLengthOfString(
  677. ResText, LARGE_FONT ) /2 ),
  678. Fixtures[Match].fixYposn,
  679. ResText, LARGE_FONT,
  680. (43+(14*f)), NO_BOX,
  681. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  682. strcpy(ResText, GetTEAMname( FindNextFixtureTeam( Fixtures[Match].AwayTeam ), 11) );
  683. strcat(ResText, " ");
  684. itoa( (int)Results[Match].AwayScore, EUROammount, 10);
  685. strcat(ResText, EUROammount);
  686. DisplayString(
  687. (Fixtures[Match].fixXposn+188)-
  688. (PixelLengthOfString(
  689. ResText, LARGE_FONT ) /2 ),
  690. Fixtures[Match].fixYposn,
  691. ResText, LARGE_FONT,
  692. (50+(14*f)), NO_BOX,
  693. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  694. Outcome = StringTemplete( RSLT_TEXT+Results[Match].Message, Match );
  695. DisplayString( 226-(PixelLengthOfString( Outcome, SMALL_FONT ) /2 ),
  696. Fixtures[Match].fixYposn+39,
  697. Outcome, SMALL_FONT, 15, NO_BOX,
  698. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  699. }
  700. else
  701. {
  702. DisplayString(
  703. Fixtures[Match].fixXposn-
  704. (PixelLengthOfString(
  705. GetTEAMname( FindNextFixtureTeam( Fixtures[Match].HomeTeam ), 11), LARGE_FONT ) /2 ),
  706. Fixtures[Match].fixYposn,
  707. GetTEAMname( FindNextFixtureTeam( Fixtures[Match].HomeTeam ), 11), LARGE_FONT,
  708. (43+(14*f)), NO_BOX,
  709. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  710. DisplayString(
  711. (Fixtures[Match].fixXposn+188)-
  712. (PixelLengthOfString(
  713. GetTEAMname( FindNextFixtureTeam( Fixtures[Match].AwayTeam), 11), LARGE_FONT ) /2 ),
  714. Fixtures[Match].fixYposn,
  715. GetTEAMname( FindNextFixtureTeam( Fixtures[Match].AwayTeam), 11), LARGE_FONT,
  716. (50+(14*f)), NO_BOX,
  717. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  718. // date of match
  719. DisplayString(
  720. Fixtures[Match].fixXposn-74,
  721. Fixtures[Match].fixYposn+39,
  722. GetTEXT( DATE_LBLS+Match ),
  723. SMALL_FONT, 15, NO_BOX,
  724. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  725. // venue of match
  726. DisplayString(
  727. Fixtures[Match].fixXposn+260-
  728. (PixelLengthOfString(GetTEXT( VNUE_NMES+MatchVenues[Match] ), SMALL_FONT ) ),
  729. Fixtures[Match].fixYposn+39,
  730. GetTEXT( VNUE_NMES+MatchVenues[Match] ),
  731. SMALL_FONT, 15, NO_BOX,
  732. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  733. // versus symbol
  734. DisplayString(
  735. 226-
  736. (PixelLengthOfString(GetTEXT( VRUS_LBLE ), LARGE_FONT ) /2 ),
  737. Fixtures[Match].fixYposn,
  738. GetTEXT( VRUS_LBLE ),
  739. LARGE_FONT, 22, NO_BOX,
  740. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  741. }
  742. Match++;
  743. }
  744. }
  745. //********************************************************************************************************************************