ENDING.CPP 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. ** Command & Conquer Red Alert(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. /* $Header: /CounterStrike/ENDING.CPP 1 3/03/97 10:24a Joe_bostic $ */
  19. /***********************************************************************************************
  20. *** 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 ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Command & Conquer *
  24. * *
  25. * File Name : ENDING.H *
  26. * *
  27. * Programmer : Barry W. Green *
  28. * *
  29. * Start Date : July 10, 1995 *
  30. * *
  31. * Last Update : July 10, 1995 [BWG] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #include "function.h"
  37. void GDI_Ending(void)
  38. {
  39. #ifdef NEVER
  40. if (TempleIoned) {
  41. Play_Movie("GDIFINB");
  42. } else {
  43. Play_Movie("GDIFINA");
  44. }
  45. Score.Presentation();
  46. if (TempleIoned) {
  47. Play_Movie("GDIEND2");
  48. } else {
  49. Play_Movie("GDIEND1");
  50. }
  51. Play_Movie("CC2TEASE");
  52. #endif
  53. }
  54. /***********************************************************************************************
  55. * Nod_Ending -- play ending movies for Nod players *
  56. * *
  57. * INPUT: none *
  58. * *
  59. * OUTPUT: none *
  60. * *
  61. * WARNINGS: *
  62. * *
  63. * HISTORY: *
  64. * 7/10/1995 BWG : Created. *
  65. *=============================================================================================*/
  66. void Nod_Ending(void)
  67. {
  68. #ifdef NEVER
  69. static char const _tanpal[]={0x0,0x0,0xED,0x0,0x2C,0x0,0xFB,0x0,0xFD,0x0,0x0,0x0,0x0,0x0,0x52,0x0};
  70. char fname[12];
  71. char * satpic = new char[64000];
  72. int oldfontxspacing = FontXSpacing;
  73. void const * oldfont;
  74. Score.Presentation();
  75. oldfont = Set_Font(ScoreFontPtr);
  76. void * localpal = Load_Alloc_Data(CCFileClass("SATSEL.PAL"));
  77. Load_Uncompress(CCFileClass("SATSEL.CPS"), HidPage, HidPage);
  78. memcpy(satpic, HidPage.Get_Buffer(), 64000);
  79. void * kanefinl = Load_Sample("KANEFINL.AUD");
  80. void * loopie6m = Load_Sample("LOOPIE6M.AUD");
  81. Play_Movie("NODFINAL", THEME_NONE, false);
  82. Hide_Mouse();
  83. Wait_Vert_Blank(VertBlank);
  84. Set_Palette(localpal);
  85. memcpy(SeenBuff.Get_Buffer(), satpic, 64000);
  86. Show_Mouse();
  87. Keyboard->Clear();
  88. Play_Sample(kanefinl, 255, 128);
  89. Play_Sample(loopie6m, 255, 128);
  90. bool mouseshown = false;
  91. bool done = false;
  92. int selection = 1;
  93. bool printedtext = false;
  94. while (!done) {
  95. if (!printedtext && !Is_Sample_Playing(kanefinl)) {
  96. printedtext++;
  97. Alloc_Object(new ScorePrintClass(Text_String(TXT_SEL_TARGET), 0, 180, _tanpal));
  98. mouseshown = true;
  99. Show_Mouse();
  100. }
  101. Call_Back_Delay(1);
  102. if (!Keyboard->Check()) {
  103. if (!Is_Sample_Playing(loopie6m)) Play_Sample(loopie6m, 255, 128);
  104. } else {
  105. if (Is_Sample_Playing(kanefinl)) {
  106. Clear_KeyBuffer();
  107. } else {
  108. int key = Keyboard->Get();
  109. if ((key & 0xFF) == KN_LMOUSE && !(key & KN_RLSE_BIT)) {
  110. int mousex = MouseQX;
  111. int mousey = MouseQY;
  112. if (mousey >= 22 && mousey <= 177) {
  113. done++;
  114. if (mousex < 160 && mousey < 100) selection = 2;
  115. if (mousex < 160 && mousey >= 100) selection = 3;
  116. if (mousex >= 160 && mousey >= 100) selection = 4;
  117. }
  118. }
  119. }
  120. }
  121. }
  122. if (mouseshown) Hide_Mouse();
  123. delete satpic;
  124. /* get rid of all the animating objects */
  125. for (int i = 0; i < MAXSCOREOBJS; i++) if (ScoreObjs[i]) {
  126. delete ScoreObjs[i];
  127. ScoreObjs[i] = 0;
  128. }
  129. // erase the "choose a target" text
  130. SeenBuff.Fill_Rect(0, 180, 319, 199, 0);
  131. Hide_Mouse();
  132. Keyboard->Clear();
  133. Set_Font(oldfont);
  134. FontXSpacing = oldfontxspacing;
  135. Free_Sample(kanefinl);
  136. Free_Sample(loopie6m);
  137. sprintf(fname, "NODEND%d", selection);
  138. PreserveVQAScreen = 1;
  139. Play_Movie(fname);
  140. Play_Movie("CC2TEASE");
  141. #endif
  142. }