ENDING.CPP 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. //
  2. // Copyright 2020 Electronic Arts Inc.
  3. //
  4. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free
  5. // software: you can redistribute it and/or modify it under the terms of
  6. // the GNU General Public License as published by the Free Software Foundation,
  7. // either version 3 of the License, or (at your option) any later version.
  8. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed
  9. // in the hope that it will be useful, but with permitted additional restrictions
  10. // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
  11. // distributed with this program. You should have received a copy of the
  12. // GNU General Public License along with permitted additional restrictions
  13. // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
  14. /* $Header: /CounterStrike/ENDING.CPP 1 3/03/97 10:24a Joe_bostic $ */
  15. /***********************************************************************************************
  16. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  17. ***********************************************************************************************
  18. * *
  19. * Project Name : Command & Conquer *
  20. * *
  21. * File Name : ENDING.H *
  22. * *
  23. * Programmer : Barry W. Green *
  24. * *
  25. * Start Date : July 10, 1995 *
  26. * *
  27. * Last Update : July 10, 1995 [BWG] *
  28. * *
  29. *---------------------------------------------------------------------------------------------*
  30. * Functions: *
  31. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  32. #include "function.h"
  33. void GDI_Ending(void)
  34. {
  35. #ifdef NEVER
  36. if (TempleIoned) {
  37. Play_Movie("GDIFINB");
  38. } else {
  39. Play_Movie("GDIFINA");
  40. }
  41. Score.Presentation();
  42. if (TempleIoned) {
  43. Play_Movie("GDIEND2");
  44. } else {
  45. Play_Movie("GDIEND1");
  46. }
  47. Play_Movie("CC2TEASE");
  48. #endif
  49. }
  50. /***********************************************************************************************
  51. * Nod_Ending -- play ending movies for Nod players *
  52. * *
  53. * INPUT: none *
  54. * *
  55. * OUTPUT: none *
  56. * *
  57. * WARNINGS: *
  58. * *
  59. * HISTORY: *
  60. * 7/10/1995 BWG : Created. *
  61. *=============================================================================================*/
  62. void Nod_Ending(void)
  63. {
  64. #ifdef NEVER
  65. static char const _tanpal[]={0x0,0x0,0xED,0x0,0x2C,0x0,0xFB,0x0,0xFD,0x0,0x0,0x0,0x0,0x0,0x52,0x0};
  66. char fname[12];
  67. char * satpic = new char[64000];
  68. int oldfontxspacing = FontXSpacing;
  69. void const * oldfont;
  70. Score.Presentation();
  71. oldfont = Set_Font(ScoreFontPtr);
  72. void * localpal = Load_Alloc_Data(CCFileClass("SATSEL.PAL"));
  73. Load_Uncompress(CCFileClass("SATSEL.CPS"), HidPage, HidPage);
  74. memcpy(satpic, HidPage.Get_Buffer(), 64000);
  75. void * kanefinl = Load_Sample("KANEFINL.AUD");
  76. void * loopie6m = Load_Sample("LOOPIE6M.AUD");
  77. Play_Movie("NODFINAL", THEME_NONE, false);
  78. Hide_Mouse();
  79. Wait_Vert_Blank(VertBlank);
  80. Set_Palette(localpal);
  81. memcpy(SeenBuff.Get_Buffer(), satpic, 64000);
  82. Show_Mouse();
  83. Keyboard->Clear();
  84. Play_Sample(kanefinl, 255, 128);
  85. Play_Sample(loopie6m, 255, 128);
  86. bool mouseshown = false;
  87. bool done = false;
  88. int selection = 1;
  89. bool printedtext = false;
  90. while (!done) {
  91. if (!printedtext && !Is_Sample_Playing(kanefinl)) {
  92. printedtext++;
  93. Alloc_Object(new ScorePrintClass(Text_String(TXT_SEL_TARGET), 0, 180, _tanpal));
  94. mouseshown = true;
  95. Show_Mouse();
  96. }
  97. Call_Back_Delay(1);
  98. if (!Keyboard->Check()) {
  99. if (!Is_Sample_Playing(loopie6m)) Play_Sample(loopie6m, 255, 128);
  100. } else {
  101. if (Is_Sample_Playing(kanefinl)) {
  102. Clear_KeyBuffer();
  103. } else {
  104. int key = Keyboard->Get();
  105. if ((key & 0xFF) == KN_LMOUSE && !(key & KN_RLSE_BIT)) {
  106. int mousex = MouseQX;
  107. int mousey = MouseQY;
  108. if (mousey >= 22 && mousey <= 177) {
  109. done++;
  110. if (mousex < 160 && mousey < 100) selection = 2;
  111. if (mousex < 160 && mousey >= 100) selection = 3;
  112. if (mousex >= 160 && mousey >= 100) selection = 4;
  113. }
  114. }
  115. }
  116. }
  117. }
  118. if (mouseshown) Hide_Mouse();
  119. delete satpic;
  120. /* get rid of all the animating objects */
  121. for (int i = 0; i < MAXSCOREOBJS; i++) if (ScoreObjs[i]) {
  122. delete ScoreObjs[i];
  123. ScoreObjs[i] = 0;
  124. }
  125. // erase the "choose a target" text
  126. SeenBuff.Fill_Rect(0, 180, 319, 199, 0);
  127. Hide_Mouse();
  128. Keyboard->Clear();
  129. Set_Font(oldfont);
  130. FontXSpacing = oldfontxspacing;
  131. Free_Sample(kanefinl);
  132. Free_Sample(loopie6m);
  133. sprintf(fname, "NODEND%d", selection);
  134. PreserveVQAScreen = 1;
  135. Play_Movie(fname);
  136. Play_Movie("CC2TEASE");
  137. #endif
  138. }