PageRenderTime 27ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/engine/src/f_finale.c

https://bitbucket.org/zturtleman/srb2ztm1094
C | 2962 lines | 2566 code | 291 blank | 105 comment | 573 complexity | e068ffe75f125bd30a08b7eb948066ef MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, LGPL-3.0

Large files files are truncated, but you can click here to view the full file

  1. // Emacs style mode select -*- C++ -*-
  2. //-----------------------------------------------------------------------------
  3. //
  4. // Copyright (C) 1993-1996 by id Software, Inc.
  5. // Copyright (C) 1998-2000 by DooM Legacy Team.
  6. //
  7. // This program is free software; you can redistribute it and/or
  8. // modify it under the terms of the GNU General Public License
  9. // as published by the Free Software Foundation; either version 2
  10. // of the License, or (at your option) any later version.
  11. //
  12. // This program is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. // GNU General Public License for more details.
  16. //-----------------------------------------------------------------------------
  17. /// \file
  18. /// \brief Title screen, intro, game evaluation, and credits.
  19. #include "doomdef.h"
  20. #include "doomstat.h"
  21. #include "am_map.h"
  22. #include "dstrings.h"
  23. #include "d_main.h"
  24. #include "f_finale.h"
  25. #include "g_game.h"
  26. #include "hu_stuff.h"
  27. #include "r_local.h"
  28. #include "s_sound.h"
  29. #include "i_video.h"
  30. #include "v_video.h"
  31. #include "w_wad.h"
  32. #include "z_zone.h"
  33. #include "i_system.h"
  34. #include "m_menu.h"
  35. #include "dehacked.h"
  36. #include "g_input.h"
  37. #include "console.h"
  38. #include "m_random.h"
  39. #include "y_inter.h"
  40. credit_t credits[19];
  41. // Stage of animation:
  42. // 0 = text, 1 = art screen
  43. static int finalestage;
  44. static int finalecount;
  45. int titlescrollspeed = 80;
  46. static tic_t timetonext; // Delay between screen changes
  47. static int finaletextcount;
  48. static tic_t animtimer; // Used for some animation timings
  49. #ifndef TMNTINTRO
  50. static int deplete;
  51. #endif
  52. static tic_t stoptimer;
  53. #define TEXTSPEED 3
  54. #define TEXTWAIT 250
  55. static const char *finaletext = NULL;
  56. static boolean keypressed = false;
  57. static patch_t *background;
  58. #ifndef TMNTINTRO
  59. static patch_t *currentanim;
  60. static patch_t *nextanim;
  61. static patch_t *first;
  62. static patch_t *second;
  63. static patch_t *third;
  64. #endif
  65. // Demo end stuff
  66. static patch_t *desonic;
  67. static patch_t *dehand1;
  68. static patch_t *dehand2;
  69. static patch_t *dehand3;
  70. static patch_t *deblink1;
  71. static patch_t *deblink2;
  72. // De-Demo'd Title Screen
  73. static patch_t *ttbanner; // white banner with "robo blast" and "2"
  74. static patch_t *ttwing; // wing background
  75. #ifndef TMNTMAIN // INTRO
  76. static patch_t *ttsonic; // "SONIC"
  77. static patch_t *ttswave1; // Title Sonics
  78. static patch_t *ttswave2;
  79. static patch_t *ttswip1;
  80. static patch_t *ttsprep1;
  81. static patch_t *ttsprep2;
  82. static patch_t *ttspop1;
  83. static patch_t *ttspop2;
  84. static patch_t *ttspop3;
  85. static patch_t *ttspop4;
  86. static patch_t *ttspop5;
  87. static patch_t *ttspop6;
  88. static patch_t *ttspop7;
  89. #endif
  90. #ifdef HEROMODE
  91. static patch_t *herottwing; // Teenage Mutant Hero Turtles
  92. static patch_t *herottbanner; // Currently the same as ttbanner.
  93. #endif
  94. static void F_SkyScroll(void);
  95. static boolean drawemblem = false, drawchaosemblem = false, runningprecutscene = false, precutresetplayer = false;
  96. typedef struct
  97. {
  98. USHORT frame;
  99. int tics;
  100. } mouth_t;
  101. static mouth_t *mouthframe;
  102. static int mouthtics;
  103. #define NUMMOUTHSTATES 530
  104. // Talking mouth on demo end screen
  105. static mouth_t mouthstates[NUMMOUTHSTATES] =
  106. {
  107. // 1st 'finalstage'
  108. {2,3},
  109. {1,3},
  110. {0,4},
  111. {3,2},
  112. {1,1},
  113. {2,4},
  114. {1,2},
  115. {2,5},
  116. {1,2},
  117. {0,2},
  118. {2,3},
  119. {1,1},
  120. {2,5},
  121. {1,2},
  122. {3,6},
  123. {0,1},
  124. {1,1},
  125. {2,2},
  126. {1,1},
  127. {0,2},
  128. {3,9},
  129. {0,10},
  130. {1,1},
  131. {2,2},
  132. {1,4},
  133. {2,3},
  134. {1,3},
  135. {4,3},
  136. {2,1},
  137. {1,1},
  138. {0,3},
  139. {1,1},
  140. {2,3},
  141. {1,1},
  142. {2,3},
  143. {1,2},
  144. {0,2},
  145. {1,3},
  146. {0,3},
  147. {1,2},
  148. {3,3},
  149. {0,3},
  150. {1,1},
  151. {2,2},
  152. {0,1},
  153. {2,1},
  154. {1,2},
  155. {0,3},
  156. {1,1},
  157. {2,2},
  158. {0,5},
  159. {1,1},
  160. {4,3},
  161. {1,1},
  162. {0,3},
  163. {1,1},
  164. {3,4},
  165. {0,20},
  166. {1,1},
  167. {2,2},
  168. {1,1},
  169. {0,1},
  170. {1,4},
  171. {2,2},
  172. {1,2},
  173. {0,1},
  174. {1,3},
  175. {0,1},
  176. {2,1},
  177. {1,1},
  178. {0,2},
  179. {1,3},
  180. {0,3},
  181. {1,6},
  182. {0,1},
  183. {3,3},
  184. {0,1},
  185. {1,4},
  186. {0,1},
  187. {3,5},
  188. {0,1},
  189. {3,2},
  190. {0,2},
  191. {1,7},
  192. {0,2},
  193. {3,3},
  194. {1,1},
  195. {2,1},
  196. {4,2},
  197. {2,1},
  198. {1,1},
  199. {0,2},
  200. {1,4},
  201. {0,140},
  202. // 2nd 'finalstage'
  203. {0,1},
  204. {1,1},
  205. {0,1},
  206. {2,1},
  207. {1,1},
  208. {0,1},
  209. {1,2},
  210. {0,3},
  211. {1,1},
  212. {0,1},
  213. {1,1},
  214. {2,3},
  215. {1,1},
  216. {0,1},
  217. {1,2},
  218. {2,3},
  219. {1,1},
  220. {0,2},
  221. {1,3},
  222. {0,3},
  223. {3,3},
  224. {1,1},
  225. {2,1},
  226. {1,1},
  227. {0,1},
  228. {2,3},
  229. {1,1},
  230. {0,3},
  231. {1,3},
  232. {2,4},
  233. {1,1},
  234. {0,1},
  235. {1,5},
  236. {0,7},
  237. {3,2},
  238. {0,1},
  239. {1,2},
  240. {3,5},
  241. {0,1},
  242. {3,2},
  243. {0,1},
  244. {1,2},
  245. {3,4},
  246. {0,1},
  247. {1,1},
  248. {2,2},
  249. {0,1},
  250. {1,2},
  251. {3,4},
  252. {0,2},
  253. {1,1},
  254. {2,3},
  255. {1,2},
  256. {0,5},
  257. {1,3},
  258. {1,1},
  259. {2,1},
  260. {1,3},
  261. {0,2},
  262. {2,2},
  263. {1,2},
  264. {0,2},
  265. {1,3},
  266. {0,3},
  267. {3,7},
  268. {0,1},
  269. {2,2},
  270. {1,3},
  271. {0,3},
  272. {3,6},
  273. {1,3},
  274. {0,14},
  275. {3,5},
  276. {1,4},
  277. {0,3},
  278. {2,2},
  279. {1,3},
  280. {0,5},
  281. {1,1},
  282. {2,2},
  283. {1,3},
  284. {0,140},
  285. // 3rd 'finalstage'
  286. {0,1},
  287. {1,1},
  288. {3,2},
  289. {1,1},
  290. {0,3},
  291. {1,1},
  292. {0,1},
  293. {2,2},
  294. {1,1},
  295. {0,1},
  296. {1,2},
  297. {0,1},
  298. {1,1},
  299. {2,4},
  300. {1,1},
  301. {0,1},
  302. {2,3},
  303. {1,1},
  304. {2,2},
  305. {1,1},
  306. {2,3},
  307. {1,2},
  308. {0,3},
  309. {1,2},
  310. {0,2},
  311. {2,2},
  312. {1,1},
  313. {0,1},
  314. {1,3},
  315. {0,2},
  316. {1,2},
  317. {0,1},
  318. {1,1},
  319. {2,2},
  320. {1,1},
  321. {0,1},
  322. {1,5},
  323. {0,28},
  324. {2,3},
  325. {1,2},
  326. {3,4},
  327. {2,1},
  328. {1,2},
  329. {0,1},
  330. {2,4},
  331. {1,1},
  332. {0,3},
  333. {3,4},
  334. {1,1},
  335. {0,3},
  336. {1,1},
  337. {4,4},
  338. {1,2},
  339. {0,3},
  340. {1,1},
  341. {3,6},
  342. {1,5},
  343. {2,2},
  344. {0,2},
  345. {1,6},
  346. {0,14},
  347. {1,1},
  348. {2,2},
  349. {1,1},
  350. {2,2},
  351. {0,3},
  352. {1,6},
  353. {0,7},
  354. {1,1},
  355. {2,4},
  356. {1,1},
  357. {0,3},
  358. {4,4},
  359. {7,7},
  360. {1,5},
  361. {0,140},
  362. // 4th 'finalstage'
  363. {0,2},
  364. {1,5},
  365. {4,3},
  366. {1,1},
  367. {0,3},
  368. {2,3},
  369. {1,2},
  370. {0,1},
  371. {1,2},
  372. {0,2},
  373. {1,1},
  374. {3,3},
  375. {1,1},
  376. {0,2},
  377. {1,3},
  378. {0,2},
  379. {2,2},
  380. {1,2},
  381. {0,2},
  382. {1,4},
  383. {0,2},
  384. {3,6},
  385. {0,2},
  386. {1,2},
  387. {2,3},
  388. {1,2},
  389. {0,2},
  390. {1,1},
  391. {3,8},
  392. {0,25},
  393. {1,2},
  394. {0,2},
  395. {1,2},
  396. {2,3},
  397. {1,2},
  398. {0,2},
  399. {1,4},
  400. {0,2},
  401. {1,1},
  402. {2,5},
  403. {1,1},
  404. {2,6},
  405. {1,3},
  406. {0,2},
  407. {1,7},
  408. {0,8},
  409. {1,1},
  410. {2,2},
  411. {1,1},
  412. {0,1},
  413. {1,2},
  414. {0,1},
  415. {2,3},
  416. {1,3},
  417. {0,2},
  418. {3,4},
  419. {1,2},
  420. {0,2},
  421. {1,2},
  422. {2,3},
  423. {1,1},
  424. {0,2},
  425. {3,1},
  426. {2,2},
  427. {1,3},
  428. {0,4},
  429. {1,1},
  430. {2,2},
  431. {1,2},
  432. {0,3},
  433. {1,1},
  434. {2,1},
  435. {1,1},
  436. {0,1},
  437. {1,2},
  438. {0,2},
  439. {3,2},
  440. {0,3},
  441. {1,2},
  442. {2,4},
  443. {1,1},
  444. {2,1},
  445. {1,1},
  446. {0,2},
  447. {1,1},
  448. {2,2},
  449. {1,1},
  450. {0,4},
  451. {1,1},
  452. {2,2},
  453. {1,2},
  454. {0,2},
  455. {3,3},
  456. {1,3},
  457. {0,240},
  458. // 5th 'finalstage'
  459. {0,1},
  460. {1,1},
  461. {2,6},
  462. {1,4},
  463. {0,11},
  464. {2,1},
  465. {4,2},
  466. {2,1},
  467. {1,1},
  468. {3,4},
  469. {0,3},
  470. {1,2},
  471. {0,1},
  472. {1,3},
  473. {0,1},
  474. {1,3},
  475. {2,2},
  476. {1,2},
  477. {0,2},
  478. {1,1},
  479. {2,2},
  480. {1,2},
  481. {0,3},
  482. {3,3},
  483. {1,2},
  484. {0,2},
  485. {1,1},
  486. {2,4},
  487. {1,1},
  488. {0,1},
  489. {1,2},
  490. {0,1},
  491. {1,2},
  492. {0,3},
  493. {1,6},
  494. {0,19},
  495. {1,2},
  496. {0,2},
  497. {3,4},
  498. {1,1},
  499. {2,3},
  500. {0,2},
  501. {1,1},
  502. {0,1},
  503. {1,1},
  504. {2,3},
  505. {1,1},
  506. {0,1},
  507. {1,4},
  508. {0,1},
  509. {1,5},
  510. {0,16},
  511. {1,1},
  512. {2,3},
  513. {1,1},
  514. {0,2},
  515. {1,1},
  516. {2,2},
  517. {1,1},
  518. {0,1},
  519. {1,2},
  520. {0,1},
  521. {1,1},
  522. {2,1},
  523. {1,2},
  524. {2,1},
  525. {1,1},
  526. {0,2},
  527. {1,1},
  528. {2,1},
  529. {1,1},
  530. {0,2},
  531. {1,3},
  532. {0,4},
  533. {1,1},
  534. {2,3},
  535. {1,1},
  536. {0,3},
  537. {1,3},
  538. {0,3},
  539. {2,4},
  540. {1,3},
  541. {0,3},
  542. {2,1},
  543. {4,1},
  544. {2,1},
  545. {1,1},
  546. {0,1},
  547. {1,2},
  548. {0,3},
  549. {1,2},
  550. {2,2},
  551. {4,6},
  552. {2,1},
  553. {1,1},
  554. {0,2},
  555. {1,4},
  556. {0,4},
  557. {1,2},
  558. {0,2},
  559. {1,2},
  560. {0,1},
  561. {2,2},
  562. {1,1},
  563. {0,2},
  564. {1,2},
  565. {2,3},
  566. {1,1},
  567. {0,1},
  568. {1,2},
  569. {0,1},
  570. {2,3},
  571. {1,1},
  572. {0,1},
  573. {1,5},
  574. {0,4},
  575. {1,4},
  576. {0,20},
  577. {1,1},
  578. {2,2},
  579. {1,1},
  580. {0,2},
  581. {3,3},
  582. {1,2},
  583. {0,2},
  584. {1,1},
  585. {2,2},
  586. {1,1},
  587. {2,4},
  588. {1,1},
  589. {0,2},
  590. {3,6},
  591. {1,1},
  592. {0,3},
  593. {1,2},
  594. {2,2},
  595. {1,1},
  596. {2,3},
  597. {1,2},
  598. {0,2},
  599. {1,2},
  600. {0,1},
  601. {2,3},
  602. {1,2},
  603. {0,1},
  604. {1,3},
  605. {2,5},
  606. {1,2},
  607. {0,3},
  608. {1,5},
  609. {0,420},
  610. };
  611. // De-Demo'd Title Screen
  612. void F_StartTitleScreen(void)
  613. {
  614. G_SetGamestate(GS_TITLESCREEN);
  615. CON_ClearHUD();
  616. #ifdef CHEATEDGAME // when you are at the title screen cheats from last game don't matter.
  617. cheatedgame = false;
  618. #endif
  619. // IWAD dependent stuff.
  620. S_ChangeMusic(mus_titles, looptitle);
  621. finalecount = 0;
  622. finalestage = 0;
  623. animtimer = 0;
  624. ttbanner = W_CachePatchName("TTBANNER", PU_LEVEL);
  625. ttwing = W_CachePatchName("TTWING", PU_LEVEL);
  626. #ifndef TMNTMAIN // INTRO
  627. ttsonic = W_CachePatchName("TTSONIC", PU_LEVEL);
  628. ttswave1 = W_CachePatchName("TTSWAVE1", PU_LEVEL);
  629. ttswave2 = W_CachePatchName("TTSWAVE2", PU_LEVEL);
  630. ttswip1 = W_CachePatchName("TTSWIP1", PU_LEVEL);
  631. ttsprep1 = W_CachePatchName("TTSPREP1", PU_LEVEL);
  632. ttsprep2 = W_CachePatchName("TTSPREP2", PU_LEVEL);
  633. ttspop1 = W_CachePatchName("TTSPOP1", PU_LEVEL);
  634. ttspop2 = W_CachePatchName("TTSPOP2", PU_LEVEL);
  635. ttspop3 = W_CachePatchName("TTSPOP3", PU_LEVEL);
  636. ttspop4 = W_CachePatchName("TTSPOP4", PU_LEVEL);
  637. ttspop5 = W_CachePatchName("TTSPOP5", PU_LEVEL);
  638. ttspop6 = W_CachePatchName("TTSPOP6", PU_LEVEL);
  639. ttspop7 = W_CachePatchName("TTSPOP7", PU_LEVEL);
  640. #endif
  641. #ifdef HEROMODE
  642. herottbanner = W_CachePatchName("HEROBANR", PU_LEVEL);
  643. herottwing = W_CachePatchName("HEROWING", PU_LEVEL);
  644. #endif
  645. }
  646. // Demo end thingy
  647. void F_StartDemoEnd(void)
  648. {
  649. size_t i;
  650. if (modifiedgame
  651. #if 0 //#ifdef CHEATEDGAME
  652. || cheatedgame
  653. #endif
  654. )
  655. D_StartTitle();
  656. G_SetGamestate(GS_DEMOEND);
  657. gameaction = ga_nothing;
  658. playerdeadview = false;
  659. paused = false;
  660. CON_ToggleOff();
  661. CON_ClearHUD();
  662. S_StopMusic();
  663. finalestage = 1;
  664. finalecount = 0;
  665. timetonext = 8*TICRATE;
  666. // Patch the animation array to keep in-sync if the framerate has been changed.
  667. for (i = 0; i < NUMMOUTHSTATES; i++)
  668. mouthstates[i].tics *= NEWTICRATERATIO;
  669. mouthframe = &mouthstates[0];
  670. mouthtics = mouthframe->tics;
  671. // load all the graphics
  672. desonic = W_CachePatchName("SONCDEND", PU_CACHE);
  673. dehand1 = W_CachePatchName("DEHAND1", PU_CACHE);
  674. dehand2 = W_CachePatchName("DEHAND2", PU_CACHE);
  675. dehand3 = W_CachePatchName("DEHAND3", PU_CACHE);
  676. deblink1 = W_CachePatchName("DEBLINK1", PU_CACHE);
  677. deblink2 = W_CachePatchName("DEBLINK2", PU_CACHE);
  678. }
  679. void F_StartGameEvaluation(void)
  680. {
  681. G_SetGamestate(GS_EVALUATION);
  682. gameaction = ga_nothing;
  683. playerdeadview = false;
  684. paused = false;
  685. CON_ToggleOff();
  686. CON_ClearHUD();
  687. #ifndef NOEMERALDS
  688. if (ALL7EMERALDS)
  689. animtimer = 64;
  690. #endif
  691. finalecount = 0;
  692. }
  693. void F_StartCredits(void)
  694. {
  695. size_t i = 0;
  696. if (creditscutscene)
  697. {
  698. F_StartCustomCutscene(creditscutscene - 1, false, false);
  699. return;
  700. }
  701. G_SetGamestate(GS_CREDITS);
  702. gameaction = ga_nothing;
  703. playerdeadview = false;
  704. paused = false;
  705. CON_ToggleOff();
  706. CON_ClearHUD();
  707. S_StopMusic();
  708. S_ChangeMusic(mus_credit, false);
  709. finalecount = 0;
  710. animtimer = 0;
  711. // "Modification By" - see dehacked.c
  712. if (modcredits)
  713. timetonext = 165*NEWTICRATERATIO;
  714. else
  715. timetonext = 5*TICRATE-1;
  716. // Initalize the credits table
  717. strcpy(credits[i].header, "Sonic Team Junior\n");
  718. strcpy(credits[i].fakenames[0], "Staff\n");
  719. strcpy(credits[i].realnames[0], "Staff\n");
  720. credits[i].numnames = 1;
  721. i++;
  722. strcpy(credits[i].header, "Producer\n");
  723. strcpy(credits[i].fakenames[0], "SSNTails\n");
  724. strcpy(credits[i].realnames[0], "Art Freda\n");
  725. strcpy(credits[i].fakenames[1], "\n");
  726. strcpy(credits[i].realnames[1], "\n");
  727. strcpy(credits[i].fakenames[2], "Director\n");
  728. strcpy(credits[i].realnames[2], "Director\n");
  729. strcpy(credits[i].fakenames[3], "Sonikku\n");
  730. strcpy(credits[i].realnames[3], "Johnny Wallbank\n");
  731. credits[i].numnames = 4;
  732. i++;
  733. strcpy(credits[i].header, "Game Designers\n");
  734. strcpy(credits[i].fakenames[0], "Sonikku\n");
  735. strcpy(credits[i].fakenames[1], "SSNTails\n");
  736. strcpy(credits[i].fakenames[2], "Mystic\n");
  737. strcpy(credits[i].realnames[0], "Johnny Wallbank\n");
  738. strcpy(credits[i].realnames[1], "Art Freda\n");
  739. strcpy(credits[i].realnames[2], "Ben Geyer\n");
  740. credits[i].numnames = 3;
  741. i++;
  742. strcpy(credits[i].header, "Character Designers\n");
  743. strcpy(credits[i].fakenames[0], "Sonikku\n");
  744. strcpy(credits[i].fakenames[1], "Instant Sonic\n");
  745. strcpy(credits[i].realnames[0], "Johnny Wallbank\n");
  746. strcpy(credits[i].realnames[1], "David Spencer Jr\n");
  747. credits[i].numnames = 2;
  748. i++;
  749. strcpy(credits[i].header, "Visual Design\n");
  750. strcpy(credits[i].fakenames[0], "SSNTails\n");
  751. strcpy(credits[i].realnames[0], "Art Freda\n");
  752. credits[i].numnames = 1;
  753. i++;
  754. strcpy(credits[i].header, "Landscape Design\n");
  755. strcpy(credits[i].fakenames[0], "Sonikku\n");
  756. strcpy(credits[i].realnames[0], "Johnny Wallbank\n");
  757. credits[i].numnames = 1;
  758. i++;
  759. strcpy(credits[i].header, "Chief Programmer\n");
  760. strcpy(credits[i].fakenames[0], "SSNTails\n");
  761. strcpy(credits[i].realnames[0], "Art Freda\n");
  762. credits[i].numnames = 1;
  763. i++;
  764. strcpy(credits[i].header, "Programmers\n");
  765. strcpy(credits[i].fakenames[0], "Alam_GBC\n");
  766. strcpy(credits[i].fakenames[1], "Graue\n");
  767. strcpy(credits[i].fakenames[2], "Orospakr\n");
  768. strcpy(credits[i].fakenames[3], "Jason the Echidna\n");
  769. strcpy(credits[i].realnames[0], "Alam Arias\n");
  770. strcpy(credits[i].realnames[1], "Scott Feeney\n");
  771. strcpy(credits[i].realnames[2], "Andrew Clunis\n");
  772. strcpy(credits[i].realnames[3], "John J. Muniz\n");
  773. #if defined SRB2ZTM || defined TMNTCREDITS // Turtle Man: My game mod so I'm in the credits...
  774. strcpy(credits[i].fakenames[4], "ZTurtleMan\n");
  775. strcpy(credits[i].realnames[4], "Zack Middleton\n");
  776. credits[i].numnames = 5;
  777. #else
  778. credits[i].numnames = 4;
  779. #endif
  780. i++;
  781. strcpy(credits[i].header, "Coding Assistants\n");
  782. strcpy(credits[i].fakenames[0], "StroggOnMeth\n");
  783. strcpy(credits[i].fakenames[1], "Cyan Helkaraxe\n");
  784. strcpy(credits[i].fakenames[2], "Logan_GBA\n");
  785. strcpy(credits[i].fakenames[3], "Shuffle\n");
  786. strcpy(credits[i].fakenames[4], "Oogaland\n");
  787. strcpy(credits[i].realnames[0], "Steven McGranahan\n");
  788. strcpy(credits[i].realnames[1], "Cyan Helkaraxe\n");
  789. strcpy(credits[i].realnames[2], "Logan Arias\n");
  790. strcpy(credits[i].realnames[3], "Matt Marsalko\n");
  791. strcpy(credits[i].realnames[4], "Gregor Dick\n");
  792. credits[i].numnames = 5;
  793. i++;
  794. strcpy(credits[i].header, "Multiplayer Levels\n");
  795. strcpy(credits[i].fakenames[0], "Mystic\n");
  796. strcpy(credits[i].fakenames[1], "SSNTails\n");
  797. strcpy(credits[i].fakenames[2], "Digiku\n");
  798. strcpy(credits[i].fakenames[3], "Furious Fox\n");
  799. strcpy(credits[i].fakenames[4], "Neo Chaotikal\n");
  800. strcpy(credits[i].fakenames[5], "Some Guy\n");
  801. strcpy(credits[i].realnames[0], "Ben Geyer\n");
  802. strcpy(credits[i].realnames[1], "Art Freda\n");
  803. strcpy(credits[i].realnames[2], "Marco Zafra\n");
  804. strcpy(credits[i].realnames[3], "Hank Brannock\n");
  805. strcpy(credits[i].realnames[4], "Fred Bronze\n");
  806. strcpy(credits[i].realnames[5], "Anonymous\n");
  807. #ifdef TMNTCREDITS
  808. strcpy(credits[i].fakenames[6], "ZTurtleMan\n");
  809. strcpy(credits[i].realnames[6], "Zack Middleton\n");
  810. credits[i].numnames = 7;
  811. #else
  812. credits[i].numnames = 6;
  813. #endif
  814. i++;
  815. strcpy(credits[i].header, "Texture Artists\n");
  816. strcpy(credits[i].fakenames[0], "KinkaJoy\n");
  817. strcpy(credits[i].fakenames[1], "SSNTails\n");
  818. strcpy(credits[i].fakenames[2], "Blaze Hedgehog\n");
  819. strcpy(credits[i].realnames[0], "Buddy Fischer\n");
  820. strcpy(credits[i].realnames[1], "Art Freda\n");
  821. strcpy(credits[i].realnames[2], "Ryan Bloom\n");
  822. #ifdef TMNTCREDITS
  823. strcpy(credits[i].fakenames[3], "ZTurtleMan\n");
  824. strcpy(credits[i].realnames[3], "Zack Middleton\n");
  825. credits[i].numnames = 4;
  826. #else
  827. credits[i].numnames = 3;
  828. #endif
  829. i++;
  830. strcpy(credits[i].header, "Music Production\n");
  831. strcpy(credits[i].fakenames[0], "Bulmybag\n");
  832. strcpy(credits[i].fakenames[1], "Arrow\n");
  833. strcpy(credits[i].fakenames[2], "Stuf\n");
  834. strcpy(credits[i].fakenames[3], "SSNTails\n");
  835. strcpy(credits[i].fakenames[4], "Cyan Helkaraxe\n");
  836. strcpy(credits[i].fakenames[5], "Red XVI\n");
  837. strcpy(credits[i].realnames[0], "David Bulmer\n");
  838. strcpy(credits[i].realnames[1], "Jarel Jones\n");
  839. strcpy(credits[i].realnames[2], "Stefan Rimalia\n");
  840. strcpy(credits[i].realnames[3], "Art Freda\n");
  841. strcpy(credits[i].realnames[4], "Cyan Helkaraxe\n");
  842. strcpy(credits[i].realnames[5], "Malcolm Brown\n");
  843. credits[i].numnames = 6;
  844. i++;
  845. strcpy(credits[i].header, "Lead Guitar\n");
  846. strcpy(credits[i].fakenames[0], "Big Wave Dave\n");
  847. strcpy(credits[i].realnames[0], "David Spencer Sr\n");
  848. credits[i].numnames = 1;
  849. i++;
  850. strcpy(credits[i].header, "Sound Effects\n");
  851. strcpy(credits[i].fakenames[0], "Sega\n");
  852. strcpy(credits[i].fakenames[1], "Instant Sonic\n");
  853. strcpy(credits[i].fakenames[2], "Various Sources\n");
  854. strcpy(credits[i].realnames[0], "Sega\n");
  855. strcpy(credits[i].realnames[1], "David Spencer Jr\n");
  856. strcpy(credits[i].realnames[2], "Various Sources\n");
  857. credits[i].numnames = 3;
  858. i++;
  859. strcpy(credits[i].header, "Official Mascot\n");
  860. strcpy(credits[i].fakenames[0], "Mr Encyclopedia\n");
  861. strcpy(credits[i].realnames[0], "Jason Butz\n");
  862. credits[i].numnames = 1;
  863. i++;
  864. strcpy(credits[i].header, "Beta Testing\n");
  865. strcpy(credits[i].fakenames[0], "Tets\n");
  866. strcpy(credits[i].fakenames[1], "Mystic\n");
  867. strcpy(credits[i].fakenames[2], "Digiku\n");
  868. strcpy(credits[i].fakenames[3], "Omega Hedgehog\n");
  869. strcpy(credits[i].fakenames[4], "Furious Fox\n");
  870. strcpy(credits[i].fakenames[5], "Sonict\n");
  871. strcpy(credits[i].realnames[0], "Bill Reed\n");
  872. strcpy(credits[i].realnames[1], "Ben Geyer\n");
  873. strcpy(credits[i].realnames[2], "Marco Zafra\n");
  874. strcpy(credits[i].realnames[3], "Mike Meredith\n");
  875. strcpy(credits[i].realnames[4], "Hank Brannock\n");
  876. strcpy(credits[i].realnames[5], "Colin Pfaff\n");
  877. credits[i].numnames = 6;
  878. i++;
  879. strcpy(credits[i].header, "Special Thanks\n");
  880. #ifdef TMNTCREDITS
  881. strcpy(credits[i].realnames[0], "Sonic Team Junior\n");
  882. strcpy(credits[i].fakenames[1], "Doom Legacy Project\n");
  883. strcpy(credits[i].fakenames[2], "iD Software\n");
  884. strcpy(credits[i].fakenames[3], "Dave Perry\n");
  885. strcpy(credits[i].fakenames[4], "MistaED\n");
  886. strcpy(credits[i].realnames[0], "Sonic Team Junior\n");
  887. strcpy(credits[i].realnames[1], "Doom Legacy Project\n");
  888. strcpy(credits[i].realnames[2], "iD Software\n");
  889. strcpy(credits[i].realnames[3], "Dave Perry\n");
  890. strcpy(credits[i].realnames[4], "Alex Fuller\n");
  891. credits[i].numnames = 5;
  892. #else
  893. strcpy(credits[i].fakenames[0], "Doom Legacy Project\n");
  894. strcpy(credits[i].fakenames[1], "iD Software\n");
  895. strcpy(credits[i].fakenames[2], "Dave Perry\n");
  896. strcpy(credits[i].fakenames[3], "MistaED\n");
  897. strcpy(credits[i].realnames[0], "Doom Legacy Project\n");
  898. strcpy(credits[i].realnames[1], "iD Software\n");
  899. strcpy(credits[i].realnames[2], "Dave Perry\n");
  900. strcpy(credits[i].realnames[3], "Alex Fuller\n");
  901. credits[i].numnames = 4;
  902. #endif
  903. i++;
  904. strcpy(credits[i].header, "In Fond Memory Of\n");
  905. #ifdef TMNTCREDITS // Umm... I think that the 'In Fond Memory Of' page should be removed...
  906. strcpy(credits[i].fakenames[0], "Peter Laird\n");
  907. strcpy(credits[i].fakenames[1], "Kevin Eastman\n");
  908. strcpy(credits[i].fakenames[2], "\n");
  909. strcpy(credits[i].fakenames[3], "\n");
  910. strcpy(credits[i].realnames[0], "Peter Laird\n");
  911. strcpy(credits[i].realnames[1], "Kevin Eastman\n");
  912. strcpy(credits[i].realnames[2], "\n");
  913. strcpy(credits[i].realnames[3], "\n");
  914. #else
  915. strcpy(credits[i].fakenames[0], "Naoto Oshima\n");
  916. strcpy(credits[i].fakenames[1], "Howard Drossin\n");
  917. strcpy(credits[i].fakenames[2], "\n");
  918. strcpy(credits[i].fakenames[3], "\n");
  919. strcpy(credits[i].realnames[0], "Naoto Oshima\n");
  920. strcpy(credits[i].realnames[1], "Howard Drossin\n");
  921. strcpy(credits[i].realnames[2], "\n");
  922. strcpy(credits[i].realnames[3], "\n");
  923. #endif
  924. credits[i].numnames = 4;
  925. i++;
  926. }
  927. static int scenenum, cutnum;
  928. static int picxpos, picypos, picnum, pictime;
  929. static int textxpos, textypos;
  930. void F_StartCustomCutscene(int cutscenenum, boolean precutscene, boolean resetplayer)
  931. {
  932. G_SetGamestate(GS_CUTSCENE);
  933. gameaction = ga_nothing;
  934. playerdeadview = false;
  935. paused = false;
  936. CON_ToggleOff();
  937. finaletext = cutscenes[cutscenenum].scene[0].text;
  938. CON_ClearHUD();
  939. runningprecutscene = precutscene;
  940. if (runningprecutscene)
  941. precutresetplayer = resetplayer;
  942. scenenum = picnum = 0;
  943. cutnum = cutscenenum;
  944. picxpos = cutscenes[cutnum].scene[0].xcoord[0];
  945. picypos = cutscenes[cutnum].scene[0].ycoord[0];
  946. textxpos = cutscenes[cutnum].scene[0].textxpos;
  947. textypos = cutscenes[cutnum].scene[0].textypos;
  948. pictime = cutscenes[cutnum].scene[0].picduration[0];
  949. keypressed = false;
  950. finalestage = 0;
  951. finalecount = 0;
  952. finaletextcount = 0;
  953. timetonext = 0;
  954. animtimer = cutscenes[cutnum].scene[0].picduration[0]; // Picture duration
  955. stoptimer = 0;
  956. mouthtics = BASEVIDWIDTH - 64; // Crap.. I forgot what this is for! I'd better not touch it...
  957. if (cutscenes[cutnum].scene[scenenum].musicslot != 0)
  958. S_ChangeMusic(cutscenes[cutnum].scene[scenenum].musicslot, cutscenes[cutnum].scene[scenenum].musicloop);
  959. }
  960. static void F_IntroTextWrite(void);
  961. // Introduction
  962. void F_StartIntro(void)
  963. {
  964. if (introtoplay)
  965. {
  966. F_StartCustomCutscene(introtoplay - 1, false, false);
  967. return;
  968. }
  969. G_SetGamestate(GS_INTRO);
  970. gameaction = ga_nothing;
  971. playerdeadview = false;
  972. paused = false;
  973. CON_ToggleOff();
  974. CON_ClearHUD();
  975. finaletext = INTRO01TEXT;
  976. finalestage = finaletextcount = finalecount = timetonext = animtimer = stoptimer = 0;
  977. mouthtics = BASEVIDWIDTH - 64;
  978. }
  979. // Intro
  980. boolean F_IntroResponder(event_t *event)
  981. {
  982. int key = event->data1;
  983. // remap virtual keys (mouse & joystick buttons)
  984. switch (key)
  985. {
  986. case KEY_MOUSE1:
  987. key = KEY_ENTER;
  988. break;
  989. case KEY_MOUSE1 + 1:
  990. key = KEY_BACKSPACE;
  991. break;
  992. case KEY_JOY1:
  993. case KEY_JOY1 + 2:
  994. key = KEY_ENTER;
  995. break;
  996. case KEY_JOY1 + 3:
  997. key = 'n';
  998. break;
  999. case KEY_JOY1 + 1:
  1000. key = KEY_BACKSPACE;
  1001. break;
  1002. case KEY_HAT1:
  1003. key = KEY_UPARROW;
  1004. break;
  1005. case KEY_HAT1 + 1:
  1006. key = KEY_DOWNARROW;
  1007. break;
  1008. case KEY_HAT1 + 2:
  1009. key = KEY_LEFTARROW;
  1010. break;
  1011. case KEY_HAT1 + 3:
  1012. key = KEY_RIGHTARROW;
  1013. break;
  1014. }
  1015. if (event->type != ev_keydown && key != 301)
  1016. return false;
  1017. if (key != 27 && key != KEY_ENTER && key != KEY_SPACE && key != KEY_BACKSPACE)
  1018. return false;
  1019. if (keypressed)
  1020. return false;
  1021. keypressed = true;
  1022. return true;
  1023. }
  1024. boolean F_CutsceneResponder(event_t *event)
  1025. {
  1026. if (cutnum == introtoplay-1)
  1027. return F_IntroResponder(event);
  1028. return false;
  1029. }
  1030. boolean F_CreditResponder(event_t *event)
  1031. {
  1032. int key = event->data1;
  1033. // remap virtual keys (mouse & joystick buttons)
  1034. switch (key)
  1035. {
  1036. case KEY_MOUSE1:
  1037. key = KEY_ENTER;
  1038. break;
  1039. case KEY_MOUSE1 + 1:
  1040. key = KEY_BACKSPACE;
  1041. break;
  1042. case KEY_JOY1:
  1043. case KEY_JOY1 + 2:
  1044. key = KEY_ENTER;
  1045. break;
  1046. case KEY_JOY1 + 3:
  1047. key = 'n';
  1048. break;
  1049. case KEY_JOY1 + 1:
  1050. key = KEY_BACKSPACE;
  1051. break;
  1052. case KEY_HAT1:
  1053. key = KEY_UPARROW;
  1054. break;
  1055. case KEY_HAT1 + 1:
  1056. key = KEY_DOWNARROW;
  1057. break;
  1058. case KEY_HAT1 + 2:
  1059. key = KEY_LEFTARROW;
  1060. break;
  1061. case KEY_HAT1 + 3:
  1062. key = KEY_RIGHTARROW;
  1063. break;
  1064. }
  1065. if (!(grade & 1))
  1066. return false;
  1067. if (event->type != ev_keydown)
  1068. return false;
  1069. if (key != 27 && key != KEY_ENTER && key != KEY_SPACE && key != KEY_BACKSPACE)
  1070. return false;
  1071. if (keypressed)
  1072. return true;
  1073. keypressed = true;
  1074. return true;
  1075. }
  1076. // De-Demo'd Title Screen
  1077. void F_TitleScreenTicker(void)
  1078. {
  1079. finalecount++;
  1080. finalestage += 8;
  1081. }
  1082. // Demo end thingy
  1083. //
  1084. // F_DemoEndTicker
  1085. //
  1086. void F_DemoEndTicker(void)
  1087. {
  1088. if (timetonext > 0)
  1089. timetonext--;
  1090. else // Switch finalestages
  1091. {
  1092. finalestage++;
  1093. switch (finalestage)
  1094. {
  1095. case 2:
  1096. finalecount = 0;
  1097. timetonext = 7*TICRATE;
  1098. mouthframe++;
  1099. mouthtics = mouthframe->tics;
  1100. S_StartSound(NULL, sfx_annon2);
  1101. break;
  1102. case 3:
  1103. finalecount = 0;
  1104. timetonext = 7*TICRATE;
  1105. mouthframe++;
  1106. mouthtics = mouthframe->tics;
  1107. S_StartSound(NULL, sfx_annon3);
  1108. break;
  1109. case 4:
  1110. finalecount = 0;
  1111. timetonext = (9*TICRATE);
  1112. mouthframe++;
  1113. mouthtics = mouthframe->tics;
  1114. S_StartSound(NULL, sfx_annon4);
  1115. break;
  1116. case 5:
  1117. finalecount = 0;
  1118. timetonext = 11*TICRATE;
  1119. mouthframe++;
  1120. mouthtics = mouthframe->tics;
  1121. S_StartSound(NULL, sfx_annon5);
  1122. break;
  1123. case 6:
  1124. finalecount = 0;
  1125. timetonext = 5*TICRATE;
  1126. break;
  1127. case 7:
  1128. D_StartTitle();
  1129. break;
  1130. default:
  1131. break;
  1132. }
  1133. }
  1134. }
  1135. void F_GameEvaluationTicker(void)
  1136. {
  1137. finalecount++;
  1138. if (finalecount > 10*TICRATE)
  1139. F_StartDemoEnd();
  1140. }
  1141. void F_CreditTicker(void)
  1142. {
  1143. finalecount++;
  1144. if (finalecount > 90*TICRATE)
  1145. F_StartGameEvaluation();
  1146. }
  1147. //
  1148. // F_IntroTicker
  1149. //
  1150. void F_IntroTicker(void)
  1151. {
  1152. // advance animation
  1153. finalecount++;
  1154. finaletextcount++;
  1155. if (finalecount % 3 == 0)
  1156. mouthtics--;
  1157. // check for skipping
  1158. if (keypressed)
  1159. {
  1160. keypressed = false;
  1161. finaletextcount += 64;
  1162. if (timetonext)
  1163. timetonext = 2;
  1164. }
  1165. }
  1166. void F_CutsceneTicker(void)
  1167. {
  1168. int i;
  1169. // advance animation
  1170. finalecount++;
  1171. finaletextcount++;
  1172. for (i = 0; i < MAXPLAYERS; i++)
  1173. {
  1174. if (netgame && i != serverplayer && i != adminplayer)
  1175. continue;
  1176. if (players[i].cmd.buttons & BT_USE)
  1177. {
  1178. keypressed = false;
  1179. finaletextcount += 64;
  1180. if (timetonext)
  1181. timetonext = 2;
  1182. }
  1183. }
  1184. }
  1185. //
  1186. // F_WriteText
  1187. //
  1188. static void F_WriteText(int cx, int cy)
  1189. {
  1190. int count, c, w, originalx = cx;
  1191. const char *ch = finaletext; // draw some of the text onto the screen
  1192. count = (finaletextcount - 10)/2;
  1193. if (count < 0)
  1194. count = 0;
  1195. if (timetonext == 1 || !ch)
  1196. {
  1197. finaletextcount = 0;
  1198. timetonext = 0;
  1199. mouthtics = BASEVIDWIDTH - 64;
  1200. return;
  1201. }
  1202. for (; count; count--)
  1203. {
  1204. c = *ch++;
  1205. if (!c)
  1206. break;
  1207. if (c == '#')
  1208. {
  1209. if (!timetonext)
  1210. {
  1211. #ifndef TMNTINTRO
  1212. if (finaletext == INTRO16TEXT)
  1213. timetonext = 12*TICRATE + 1;
  1214. else
  1215. #endif
  1216. timetonext = 5*TICRATE + 1;
  1217. }
  1218. break;
  1219. }
  1220. if (c == '\n')
  1221. {
  1222. cx = originalx;
  1223. cy += 12;
  1224. continue;
  1225. }
  1226. c = toupper(c) - HU_FONTSTART;
  1227. if (c < 0 || (c >= HU_REALFONTSIZE && c != '~' - HU_FONTSTART && c != '`' - HU_FONTSTART)) /// \note font end hack
  1228. {
  1229. cx += 4;
  1230. continue;
  1231. }
  1232. w = hu_font[c]->width;
  1233. if (cx + w > vid.width)
  1234. break;
  1235. V_DrawScaledPatch(cx, cy, 0, hu_font[c]);
  1236. cx += w;
  1237. }
  1238. }
  1239. static void F_WriteCutsceneText(void)
  1240. {
  1241. int count, c, w, originalx = textxpos, cx = textxpos, cy = textypos;
  1242. const char *ch = finaletext; // draw some of the text onto the screen
  1243. count = (finaletextcount - 10)/2;
  1244. if (count < 0)
  1245. count = 0;
  1246. if (timetonext == 1 || !ch)
  1247. {
  1248. finaletextcount = 0;
  1249. timetonext = 0;
  1250. mouthtics = BASEVIDWIDTH - 64;
  1251. return;
  1252. }
  1253. for (; count; count--)
  1254. {
  1255. c = *ch++;
  1256. if (!c)
  1257. break;
  1258. if (c == '#')
  1259. {
  1260. if (!timetonext)
  1261. timetonext = 5*TICRATE + 1;
  1262. break;
  1263. }
  1264. if (c == '\n')
  1265. {
  1266. cx = originalx;
  1267. cy += 12;
  1268. continue;
  1269. }
  1270. c = toupper(c) - HU_FONTSTART;
  1271. if (c < 0 || (c >= HU_REALFONTSIZE && c != '~' - HU_FONTSTART && c != '`' - HU_FONTSTART))
  1272. { /// \note font end hack
  1273. cx += 4;
  1274. continue;
  1275. }
  1276. w = hu_font[c]->width;
  1277. if (cx + w > vid.width)
  1278. break;
  1279. V_DrawScaledPatch(cx, cy, 0, hu_font[c]);
  1280. cx += w;
  1281. }
  1282. }
  1283. //
  1284. // F_IntroTextWrite
  1285. //
  1286. static void F_IntroTextWrite(void)
  1287. {
  1288. boolean nobg = false, highres = false;
  1289. #ifdef TMNTINTRO
  1290. int cx = 8, cy = 192;
  1291. #else
  1292. int cx = 8, cy = 128;
  1293. #endif
  1294. // DRAW A FULL PIC INSTEAD OF FLAT!
  1295. if (finaletext == INTRO01TEXT)
  1296. nobg = true;
  1297. else if (finaletext == INTRO02TEXT)
  1298. background = W_CachePatchName("INTRO1", PU_CACHE);
  1299. else if (finaletext == INTRO03TEXT)
  1300. #ifdef TMNTINTRO
  1301. background = W_CachePatchName("INTRO2", PU_CACHE);
  1302. #else
  1303. {
  1304. background = W_CachePatchName("INTRO2", PU_CACHE);
  1305. highres = true;
  1306. }
  1307. #endif
  1308. else if (finaletext == INTRO04TEXT)
  1309. background = W_CachePatchName("INTRO3", PU_CACHE);
  1310. else if (finaletext == INTRO05TEXT)
  1311. background = W_CachePatchName("INTRO4", PU_CACHE);
  1312. else if (finaletext == INTRO06TEXT)
  1313. #ifdef TMNTINTRO
  1314. background = W_CachePatchName("INTRO5", PU_CACHE);
  1315. #else
  1316. {
  1317. background = W_CachePatchName("DRAT", PU_CACHE);
  1318. highres = true;
  1319. }
  1320. else if (finaletext == INTRO07TEXT)
  1321. {
  1322. background = W_CachePatchName("INTRO6", PU_CACHE);
  1323. cx = 180;
  1324. cy = 8;
  1325. }
  1326. else if (finaletext == INTRO08TEXT)
  1327. background = W_CachePatchName("SGRASS1", PU_CACHE);
  1328. else if (finaletext == INTRO09TEXT)
  1329. {
  1330. background = W_CachePatchName("WATCHING", PU_CACHE);
  1331. highres = true;
  1332. }
  1333. else if (finaletext == INTRO10TEXT)
  1334. {
  1335. background = W_CachePatchName("ZOOMING", PU_CACHE);
  1336. highres = true;
  1337. }
  1338. else if (finaletext == INTRO11TEXT)
  1339. nobg = true;
  1340. else if (finaletext == INTRO12TEXT)
  1341. background = W_CachePatchName("INTRO5", PU_CACHE);
  1342. else if (finaletext == INTRO13TEXT)
  1343. {
  1344. background = W_CachePatchName("REVENGE", PU_CACHE);
  1345. highres = true;
  1346. }
  1347. else if (finaletext == INTRO14TEXT)
  1348. {
  1349. nobg = true;
  1350. cx = 8;
  1351. cy = 8;
  1352. }
  1353. else if (finaletext == INTRO15TEXT)
  1354. {
  1355. background = W_CachePatchName("SONICDO1", PU_CACHE);
  1356. highres = true;
  1357. cx = 224;
  1358. cy = 8;
  1359. }
  1360. else if (finaletext == INTRO16TEXT)
  1361. {
  1362. background = W_CachePatchName("INTRO7", PU_CACHE);
  1363. highres = true;
  1364. }
  1365. #endif
  1366. V_DrawFill(0, 0, vid.width, vid.height, 0);
  1367. if (finaletext == INTRO01TEXT)
  1368. {
  1369. #ifdef TMNTMAIN // TMNTINTRO
  1370. #ifdef TMNTFONT
  1371. // TODO (Turtle Man#1#): Should this be Turtle Team? Also Sonic Team Jr. may not want their name here...
  1372. V_DrawLevelTitle(160 - (V_LevelNameWidth("SONIC TEAM JR")/2), 66, 0, "SONIC TEAM JR");
  1373. V_DrawLevelTitle(160 - (V_LevelNameWidth("AND")/2), 80, 0, "AND");
  1374. V_DrawLevelTitle(160 - (V_LevelNameWidth("TURTLE MAN")/2), 96, 0, "TURTLE MAN");
  1375. V_DrawLevelTitle(160 - (V_LevelNameWidth("PRESENT")/2), 112, 0, "PRESENT");
  1376. #else
  1377. V_DrawCreditString(160 - (V_CreditStringWidth("SONIC TEAM JR")/2), 66, 0, "SONIC TEAM JR");
  1378. V_DrawCreditString(160 - (V_CreditStringWidth("AND")/2), 80, 0, "AND");
  1379. V_DrawCreditString(160 - (V_CreditStringWidth("TURTLE MAN")/2), 96, 0, "TURTLE MAN");
  1380. V_DrawCreditString(160 - (V_CreditStringWidth("PRESENT")/2), 112, 0, "PRESENT");
  1381. #endif
  1382. #else
  1383. V_DrawCreditString(160 - (V_CreditStringWidth("SONIC TEAM JR")/2), 80, 0, "SONIC TEAM JR");
  1384. V_DrawCreditString(160 - (V_CreditStringWidth("PRESENTS")/2), 96, 0, "PRESENTS");
  1385. #endif
  1386. }
  1387. #ifndef TMNTINTRO
  1388. else if (finaletext == INTRO11TEXT)
  1389. {
  1390. if (finaletextcount > 8*TICRATE && finaletextcount < 9*TICRATE)
  1391. {
  1392. if (!(finalecount & 3))
  1393. background = W_CachePatchName("BRITEGG1", PU_CACHE);
  1394. else
  1395. background = W_CachePatchName("DARKEGG1", PU_CACHE);
  1396. V_DrawScaledPatch(0, 0, 0, background);
  1397. }
  1398. else if (finaletextcount > 10*TICRATE && finaletextcount < 11*TICRATE)
  1399. {
  1400. if (!(finalecount & 3))
  1401. background = W_CachePatchName("BRITEGG2", PU_CACHE);
  1402. else
  1403. background = W_CachePatchName("DARKEGG2", PU_CACHE);
  1404. V_DrawScaledPatch(0, 0, 0, background);
  1405. }
  1406. else if (finaletextcount > 12*TICRATE && finaletextcount < 13*TICRATE)
  1407. {
  1408. if (!(finalecount & 3))
  1409. background = W_CachePatchName("BRITEGG3", PU_CACHE);
  1410. else
  1411. background = W_CachePatchName("DARKEGG3", PU_CACHE);
  1412. V_DrawScaledPatch(0, 0, 0, background);
  1413. }
  1414. else
  1415. {
  1416. F_SkyScroll();
  1417. if (timetonext == 7)
  1418. {
  1419. stoptimer = finalecount;
  1420. animtimer = finalecount % 16;
  1421. }
  1422. else if (timetonext > 1 && timetonext < 7)
  1423. {
  1424. animtimer = stoptimer;
  1425. deplete -= 32;
  1426. }
  1427. else
  1428. {
  1429. animtimer = finalecount % 16;
  1430. deplete = 160;
  1431. }
  1432. if (finalecount & 1)
  1433. {
  1434. V_DrawScaledPatch(deplete, 8, 0, W_CachePatchName("RUN2", PU_CACHE));
  1435. V_DrawScaledPatch(deplete, 72, 0, W_CachePatchName("PEELOUT2", PU_CACHE));
  1436. }
  1437. else
  1438. {
  1439. V_DrawScaledPatch(deplete, 8, 0, W_CachePatchName("RUN1", PU_CACHE));
  1440. V_DrawScaledPatch(deplete, 72, 0, W_CachePatchName("PEELOUT1", PU_CACHE));
  1441. }
  1442. V_DrawFill(0, 112, vid.width, (int)(vid.height - 128*vid.fdupy), 0);
  1443. }
  1444. }
  1445. else if (finaletext == INTRO08TEXT && timetonext > 0 && timetonext <= 4*TICRATE
  1446. && finaletextcount > 0)
  1447. {
  1448. background = W_CachePatchName("SGRASS5", PU_CACHE);
  1449. }
  1450. #endif
  1451. if (!nobg)
  1452. {
  1453. if (highres)
  1454. V_DrawSmallScaledPatch(0, 0, 0, background);
  1455. else
  1456. V_DrawScaledPatch(0, 0, 0, background);
  1457. }
  1458. #ifndef TMNTINTRO
  1459. if (finaletext == INTRO14TEXT)
  1460. {
  1461. V_DrawFill(0, 0, vid.width, vid.height, 0);
  1462. V_DrawSmallScaledPatch(144, 0, 0, W_CachePatchName("TAILSSAD", PU_CACHE));
  1463. }
  1464. else if (finaletext == INTRO05TEXT) // The asteroid SPINS!
  1465. {
  1466. if (mouthtics >= 0)
  1467. V_DrawScaledPatch(mouthtics, 24, 0,
  1468. W_CachePatchName(va("ROID00%.2ld", stoptimer%35), PU_CACHE));
  1469. }
  1470. else if (finaletext == INTRO06TEXT)
  1471. {
  1472. if (stoptimer == 5*TICRATE + (TICRATE/5)*3)
  1473. {
  1474. if (rendermode == render_soft)
  1475. {
  1476. tic_t nowtime, tics, wipestart, y;
  1477. boolean done;
  1478. F_WriteText(cx, cy);
  1479. F_WipeStartScreen();
  1480. V_DrawScaledPatch(0, 0, 0, W_CachePatchName("RADAR", PU_CACHE));
  1481. // draw some of the text onto the screen
  1482. F_WriteText(cx, cy);
  1483. F_WipeEndScreen(0, 0, vid.width, vid.height);
  1484. wipestart = I_GetTime() - 1;
  1485. y = wipestart + TICRATE; // init a timeout
  1486. do
  1487. {
  1488. do
  1489. {
  1490. nowtime = I_GetTime();
  1491. tics = nowtime - wipestart;
  1492. if (!tics) I_Sleep();
  1493. } while (!tics);
  1494. wipestart = nowtime;
  1495. done = F_ScreenWipe(0, 0, vid.width, vid.height, tics);
  1496. I_OsPolling();
  1497. I_UpdateNoBlit();
  1498. M_Drawer(); // menu is drawn even on top of wipes
  1499. I_FinishUpdate(); // page flip or blit buffer
  1500. } while (!done && I_GetTime() < y);
  1501. }
  1502. #ifdef HWRENDER
  1503. else if (rendermode != render_none) // Delay the hardware modes as well
  1504. {
  1505. tic_t nowtime, tics, wipestart, y;
  1506. wipestart = I_GetTime() - 1;
  1507. y = wipestart + 32; // init a timeout
  1508. do
  1509. {
  1510. do
  1511. {
  1512. nowtime = I_GetTime();
  1513. tics = nowtime - wipestart;
  1514. if (!tics) I_Sleep();
  1515. } while (!tics);
  1516. I_OsPolling();
  1517. I_UpdateNoBlit();
  1518. M_Drawer(); // menu is drawn even on top of wipes
  1519. // I_FinishUpdate(); // page flip or blit buffer
  1520. } while (I_GetTime() < y);
  1521. }
  1522. #endif
  1523. }
  1524. else if (stoptimer > 5*TICRATE+(TICRATE/5)*3)
  1525. V_DrawScaledPatch(0, 0, 0, W_CachePatchName("RADAR", PU_CACHE));
  1526. }
  1527. else if (finaletext == INTRO13TEXT)
  1528. {
  1529. if (stoptimer == 9*TICRATE)
  1530. {
  1531. if (rendermode == render_soft)
  1532. {
  1533. tic_t nowtime, tics, wipestart, y;
  1534. boolean done;
  1535. F_WriteText(cx, cy);
  1536. F_WipeStartScreen();
  1537. V_DrawSmallScaledPatch(0, 0, 0, W_CachePatchName("CONFRONT", PU_CACHE));
  1538. // draw some of the text onto the screen
  1539. F_WriteText(cx, cy);
  1540. F_WipeEndScreen(0, 0, vid.width, vid.height);
  1541. wipestart = I_GetTime() - 1;
  1542. y = wipestart + TICRATE; // init a timeout
  1543. do
  1544. {
  1545. do
  1546. {
  1547. nowtime = I_GetTime();
  1548. tics = nowtime - wipestart;
  1549. if (!tics) I_Sleep();
  1550. } while (!tics);
  1551. wipestart = nowtime;
  1552. done = F_ScreenWipe(0, 0, vid.width, vid.height, tics);
  1553. I_OsPolling();
  1554. I_UpdateNoBlit();
  1555. M_Drawer(); // menu is drawn even on top of wipes
  1556. I_FinishUpdate(); // page flip or blit buffer
  1557. } while (!done && I_GetTime() < y);
  1558. }
  1559. #ifdef HWRENDER
  1560. else if (rendermode != render_none) // Delay the hardware modes as well
  1561. {
  1562. tic_t nowtime, tics, wipestart, y;
  1563. wipestart = I_GetTime() - 1;
  1564. y = wipestart + 32; // init a timeout
  1565. do
  1566. {
  1567. do
  1568. {
  1569. nowtime = I_GetTime();
  1570. tics = nowtime - wipestart;
  1571. if (!tics) I_Sleep();
  1572. } while (!tics);
  1573. I_OsPolling();
  1574. I_UpdateNoBlit();
  1575. M_Drawer(); // menu is drawn even on top of wipes
  1576. // I_FinishUpdate(); // page flip or blit buffer
  1577. } while (I_GetTime() < y);
  1578. }
  1579. #endif
  1580. }
  1581. else if (stoptimer > 9*TICRATE)
  1582. V_DrawSmallScaledPatch(0, 0, 0, W_CachePatchName("CONFRONT", PU_CACHE));
  1583. }
  1584. else if (finaletext == INTRO15TEXT)
  1585. {
  1586. if (stoptimer == 7*TICRATE)
  1587. {
  1588. if (rendermode == render_soft)
  1589. {
  1590. tic_t nowtime, tics, wipestart, y;
  1591. boolean done;
  1592. F_WriteText(cx, cy);
  1593. F_WipeStartScreen();
  1594. V_DrawSmallScaledPatch(0, 0, 0, W_CachePatchName("SONICDO2", PU_CACHE));
  1595. // draw some of the text onto the screen
  1596. F_WriteText(cx, cy);
  1597. F_WipeEndScreen(0, 0, vid.width, vid.height);
  1598. wipestart = I_GetTime() - 1;
  1599. y = wipestart + TICRATE; // init a timeout
  1600. do
  1601. {
  1602. do
  1603. {
  1604. nowtime = I_GetTime();
  1605. tics = nowtime - wipestart;
  1606. if (!tics) I_Sleep();
  1607. } while (!tics);
  1608. wipestart = nowtime;
  1609. done = F_ScreenWipe(0, 0, vid.width, vid.height, tics);
  1610. I_OsPolling();
  1611. I_UpdateNoBlit();
  1612. M_Drawer(); // menu is drawn even on top of wipes
  1613. I_FinishUpdate(); // page flip or blit buffer
  1614. } while (!done && I_GetTime() < y);
  1615. }
  1616. #ifdef HWRENDER
  1617. else if (rendermode != render_none) // Delay the hardware modes as well
  1618. {
  1619. tic_t nowtime, tics, wipestart, y;
  1620. wipestart = I_GetTime() - 1;
  1621. y = wipestart+32; // init a timeout
  1622. do
  1623. {
  1624. do
  1625. {
  1626. nowtime = I_GetTime();
  1627. tics = nowtime - wipestart;
  1628. if (!tics) I_Sleep();
  1629. } while (!tics);
  1630. I_OsPolling();
  1631. I_UpdateNoBlit();
  1632. M_Drawer(); // menu is drawn even on top of wipes
  1633. // I_FinishUpdate(); // page flip or blit buffer
  1634. } while (I_GetTime() < y);
  1635. }
  1636. #endif
  1637. }
  1638. else if (stoptimer > 7*TICRATE)
  1639. V_DrawSmallScaledPatch(0, 0, 0, W_CachePatchName("SONICDO2", PU_CACHE));
  1640. }
  1641. #endif
  1642. if (animtimer)
  1643. animtimer--;
  1644. #ifndef TMNTINTRO
  1645. if (finaletext == INTRO08TEXT && timetonext && finaletextcount > 0)
  1646. {
  1647. first = W_CachePatchName("SGRASS2", PU_CACHE);
  1648. second = W_CachePatchName("SGRASS3", PU_CACHE);
  1649. third = W_CachePatchName("SGRASS4", PU_CACHE);
  1650. if (timetonext == 3*TICRATE)
  1651. {
  1652. currentanim = first;
  1653. nextanim = second;
  1654. animtimer = TICRATE/7 + 1;
  1655. }
  1656. else if (animtimer == 1 && currentanim == first)
  1657. {
  1658. currentanim = second;
  1659. nextanim = third;
  1660. animtimer = TICRATE/7 + 1;
  1661. }
  1662. else if (animtimer == 1 && currentanim == second)
  1663. currentanim = third;
  1664. if (currentanim)
  1665. V_DrawScaledPatch(123, 4, 0, currentanim);
  1666. }
  1667. #endif
  1668. F_WriteText(cx, cy);
  1669. }
  1670. //
  1671. // F_DrawPatchCol
  1672. //
  1673. static void F_DrawPatchCol(int x, patch_t *patch, int col, int yrepeat)
  1674. {
  1675. const column_t *column;
  1676. const byte *source;
  1677. byte *desttop, *dest = NULL;
  1678. const byte *deststop;
  1679. size_t count;
  1680. column = (column_t *)((byte *)patch + LONG(patch->columnofs[col]));
  1681. desttop = screens[0] + x*vid.dupx;
  1682. deststop = screens[0] + vid.width * vid.height * vid.bpp;
  1683. // step through the posts in a column
  1684. while (column->topdelta != 0xff)
  1685. {
  1686. source = (const byte *)column + 3;
  1687. dest = desttop + column->topdelta*vid.width;
  1688. count = column->length;
  1689. while (count--)
  1690. {
  1691. int dupycount = vid.dupy;
  1692. while (dupycount--)
  1693. {
  1694. int dupxcount = vid.dupx;
  1695. while (dupxcount-- && dest <= deststop)
  1696. *dest++ = *source;
  1697. dest += (vid.width - vid.dupx);
  1698. }
  1699. source++;
  1700. }
  1701. column = (const column_t *)((const byte *)column + column->length + 4);
  1702. }
  1703. // repeat a second time, for yrepeat number of pixels
  1704. if (yrepeat)
  1705. {
  1706. column = (column_t *)((byte *)patch + LONG(patch->columnofs[col]));
  1707. while (column->topdelta != 0xff)
  1708. {
  1709. source = (const byte *)column + 3;
  1710. count = column->length;
  1711. while (count--)
  1712. {
  1713. int dupycount = vid.dupy;
  1714. while (dupycount--)
  1715. {
  1716. int dupxcount = vid.dupx;
  1717. while (dupxcount-- && dest <= deststop)
  1718. *dest++ = *source;
  1719. dest += (vid.width - vid.dupx);
  1720. }
  1721. source++;
  1722. }
  1723. if (!--yrepeat)
  1724. break;
  1725. column = (const column_t *)((const byte *)column + column->length + 4);
  1726. }
  1727. }
  1728. }
  1729. //
  1730. // F_SkyScroll
  1731. //
  1732. static void F_SkyScroll(void)
  1733. {
  1734. int scrolled, x, mx, fakedwidth;
  1735. patch_t *pat;
  1736. pat = W_CachePatchName("TITLESKY", PU_CACHE);
  1737. #ifdef TMNTMAIN // scroll slower
  1738. animtimer = ((finalecount*((gamestate == GS_INTRO || gamestate == GS_INTRO2) ? titlescrollspeed*4 : titlescrollspeed))/80) % pat->width;
  1739. #else
  1740. animtimer = ((finalecount*((gamestate == GS_INTRO || gamestate == GS_INTRO2) ? titlescrollspeed*4 : titlescrollspeed))/16) % pat->width;
  1741. #endif
  1742. fakedwidth = vid.width / vid.dupx;
  1743. if (rendermode == render_soft)
  1744. {
  1745. int yr = 0;
  1746. if (vid.fdupy > vid.dupy)
  1747. yr = vid.height - vid.dupy*pat->height;
  1748. #if 0 // #ifdef TMNTMAIN // Scroll other way. Like in Turtles in Time.
  1749. scrolled = animtimer;
  1750. #else
  1751. scrolled = BASEVIDWIDTH - animtimer;
  1752. #endif
  1753. if (scrolled > BASEVIDWIDTH)
  1754. scrolled = BASEVIDWIDTH;
  1755. if (scrolled < 0)
  1756. scrolled = 0;
  1757. for (x = 0, mx = 0; x < fakedwidth; x++, mx++)
  1758. {
  1759. if (mx >= pat->width)
  1760. mx = 0;
  1761. if (mx + scrolled < pat->width)
  1762. F_DrawPatchCol(x, pat, mx + scrolled, yr);
  1763. else
  1764. F_DrawPatchCol(x, pat, mx + scrolled - pat->width, yr);
  1765. }
  1766. }
  1767. #ifdef HWRENDER
  1768. else if (rendermode != render_none)
  1769. { // I wish it were as easy as this for software. I really do.
  1770. scrolled = animtimer;
  1771. if (scrolled > 0)
  1772. V_DrawScaledPatch(scrolled - pat->width, 0, 0, pat);
  1773. while(scrolled < BASEVIDWIDTH)
  1774. {
  1775. V_DrawScaledPatch(scrolled, 0, 0, pat);
  1776. scrolled += pat->width;
  1777. }
  1778. }
  1779. #endif
  1780. }
  1781. // De-Demo'd Title Screen
  1782. void F_TitleScreenDrawer(void)
  1783. {
  1784. // Draw that sky!
  1785. F_SkyScroll();
  1786. #ifdef TMNTMAIN // INTRO
  1787. #if 0 // Banner Scrolling. Don't like.
  1788. patch_t *tmnt = NULL;
  1789. patch_t *banner = NULL;
  1790. int count = finalecount << 1; // count is finalecount doubled.
  1791. #ifdef HEROMODE
  1792. if (heromode)
  1793. {
  1794. tmnt = herottwing;
  1795. banner = herottbanner;
  1796. }
  1797. else
  1798. #endif
  1799. {
  1800. tmnt = ttwing;
  1801. banner = ttbanner;
  1802. }
  1803. // Scroll the banner to 142 y
  1804. // Yay? for confusing code.
  1805. if (count > (15 << 1) && count < ((15+(58 >> 1)) << 1))
  1806. {
  1807. int y = -(count-(15 << 1))+200;
  1808. V_DrawScaledPatch(30, 14, 0, tmnt);
  1809. V_DrawScaledPatch(48, y, 0,banner);
  1810. }
  1811. else
  1812. {
  1813. V_DrawScaledPatch(30, 14, 0, tmnt);
  1814. if (count > (15 << 1))
  1815. V_DrawScaledPatch(48, 142, 0,banner);
  1816. }
  1817. #else // No banner scrolling
  1818. #ifdef HEROMODE
  1819. if (heromode)
  1820. {
  1821. V_DrawScaledPatch(30, 14, 0, herottwing);
  1822. V_DrawScaledPatch(48, 142, 0,herottbanner);
  1823. }
  1824. else
  1825. #endif
  1826. {
  1827. V_DrawScaledPatch(30, 14, 0, ttwing);
  1828. V_DrawScaledPatch(48, 142, 0,ttbanner);
  1829. }
  1830. #endif
  1831. #else
  1832. V_DrawScaledPatch(30, 14, 0, ttwing);
  1833. if (finalecount < 57)
  1834. {
  1835. if (finalecount == 35)
  1836. V_DrawScaledPatch(115, 15, 0, ttspop1);
  1837. else if (finalecount == 36)
  1838. V_DrawScaledPatch(114, 15, 0,ttspop2);
  1839. else if (finalecount == 37)
  1840. V_DrawScaledPatch(113, 15, 0,ttspop3);
  1841. else if (finalecount == 38)
  1842. V_DrawScaledPatch(112, 15, 0,ttspop4);
  1843. else if (finalecount == 39)
  1844. V_DrawScaledPatch(111, 15, 0,ttspop5);
  1845. else if (finalecount == 40)
  1846. V_DrawScaledPatch(110, 15, 0, ttspop6);
  1847. else if (finalecount >= 41 && finalecount <= 44)
  1848. V_DrawScaledPatch(109, 15, 0, ttspop7);
  1849. else if (finalecount >= 45 && finalecount <= 48)
  1850. V_DrawScaledPatch(108, 12, 0, ttsprep1);
  1851. else if (finalecount >= 49 && finalecount <= 52)
  1852. V_DrawScaledPatch(107, 9, 0, ttsprep2);
  1853. else if (finalecount >= 53 && finalecount <= 56)
  1854. V_DrawScaledPatch(106, 6, 0, ttswip1);
  1855. V_DrawScaledPatch(93, 106, 0, ttsonic);
  1856. }
  1857. else
  1858. {
  1859. V_DrawScaledPatch(93, 106, 0,ttsonic);
  1860. if (finalecount/5 & 1)
  1861. V_DrawScaledPatch(100, 3, 0,ttswave1);
  1862. else
  1863. V_DrawScaledPatch(100,3, 0,ttswave2);
  1864. }
  1865. V_DrawScaledPatch(48, 142, 0,ttbanner);
  1866. #endif
  1867. }
  1868. // Demo End Screen
  1869. //
  1870. // F_DemoEndDrawer
  1871. //
  1872. // TODO (Turtle Man#1#): Its going to be real fun to change this for TMNT...
  1873. void F_DemoEndDrawer(void)
  1874. {
  1875. patch_t *mouth;
  1876. // anim the mouth
  1877. if (--mouthtics <= 0)
  1878. {
  1879. mouthframe++;
  1880. mouthtics = mouthframe->tics;
  1881. }
  1882. // Decide which mouth to project
  1883. switch (mouthframe->frame)
  1884. {
  1885. case 1:
  1886. mouth = W_CachePatchName("MOUTB0", PU_CACHE);
  1887. break;
  1888. case 2:
  1889. mouth = W_CachePatchName("MOUTC0", PU_CACHE);
  1890. break;
  1891. case 3:
  1892. mouth = W_CachePatchName("MOUTD0", PU_CACHE);
  1893. break;
  1894. case 4:
  1895. mouth = W_CachePatchName("MOUTE0", PU_CACHE);
  1896. break;
  1897. default:
  1898. mouth = W_CachePatchName("MOUTA0", PU_CACHE);
  1899. break;
  1900. }
  1901. // advance animation
  1902. finalecount++;
  1903. finaletextcount++;
  1904. if (finalestage == 1 && finalecount == 2)
  1905. S_StartSound(NULL, sfx_annon1);
  1906. V_DrawFill(0, 0, 184, 200, *((byte *)colormaps + 0xd7)); // Orange
  1907. V_DrawFill(184, 0, 136, 200, *((byte *)colormaps + 0x04)); // White
  1908. V_DrawScaledPatch(216, 36, 0, desonic); // Sonic
  1909. // Have Sonic blink every so often. (animtimer is used for this)
  1910. if (animtimer)
  1911. animtimer--;
  1912. if (M_Random() == 255 && animtimer == 0 && timetonext & 1)
  1913. animtimer = 3;
  1914. switch (animtimer)
  1915. {
  1916. case 3: // Start to blink..
  1917. case 1: // Opening back up...
  1918. V_DrawScaledPatch(230, 79, 0, deblink1);
  1919. break;
  1920. case 2: // Eyes shut
  1921. V_DrawScaledPatch(230, 79, 0, deblink2);
  1922. break;
  1923. default:
  1924. break;
  1925. }
  1926. #define HANDX 189
  1927. #define HANDY 111
  1928. // Sonic puts his hand out...
  1929. if ((finalestage == 1 && timetonext <= TICRATE/2) || (finalestage >= 2 && finalestage <= 4)
  1930. || (finalestage == 5 && timetonext > 3*TICRATE))
  1931. V_DrawScaledPatch(HANDX, HANDY, 0, dehand3);
  1932. else if (finalestage == 1 && timetonext >= TICRATE/2 + 1*NEWTICRATERATIO
  1933. && timetonext <= TICRATE/2 + 5*NEWTICRATERATIO)
  1934. V_DrawScaledPatch(HANDX, HANDY, 0, dehand2);
  1935. else if (finalestage == 1 && timetonext >= TICRATE/2 + 6*NEWTICRATERATIO
  1936. && timetonext <= TICRATE/2 + 8*NEWTICRATERATIO)
  1937. V_DrawScaledPatch(HANDX, HANDY, 0, dehand1);
  1938. // And brings it back in.
  1939. if (finalestage == 5 && timetonext <= 3*TICRATE-1*NEWTICRATERATIO
  1940. && timetonext >= 3*TICRATE-3*NEWTICRATERATIO)
  1941. {
  1942. V_DrawScaledPatch(HANDX, HANDY, 0, dehand1);
  1943. }
  1944. // Tough part -- SYNCING THE MOUTH!
  1945. // Animation is handled up above.
  1946. V_DrawScaledPatch(254, 98, 0, mouth);
  1947. // Draw the text over everything else
  1948. switch (finalestage)
  1949. {
  1950. case 6:
  1951. case 5:
  1952. V_DrawString(8, 184, 0, "Returning to title screen...");
  1953. case 4:
  1954. V_DrawString(8, 152, 0, "3) Stop by the #srb2fun\nchatroom at irc.esper.net.");
  1955. case 3:
  1956. V_DrawString(8, 120, 0, "2) Poke around the addons\nsection of the website.");
  1957. case 2:
  1958. V_DrawString(8, 80, 0, "1) Visit the SRB2 website\nat www.srb2.org for\nnews and updates.");
  1959. case 1:
  1960. V_DrawString(8, 4, 0, "Thanks for playing the SRB2\ndemo. This is the last release\nbefore the final game comes\nout, but here are several\nthings you you can do to\ntide you over:");
  1961. default:
  1962. break;
  1963. }
  1964. }
  1965. #define INTERVAL 50
  1966. #define TRANSLEVEL V_8020TRANS
  1967. void F_GameEvaluationDrawer(void)
  1968. {
  1969. #ifndef NOEMERALDS
  1970. int x, y;
  1971. const fixed_t radius = 48*FRACUNIT;
  1972. angle_t fa;
  1973. #endif
  1974. V_DrawFill(0, 0, vid.width, vid.height, 0);
  1975. #ifndef TMNTMAIN
  1976. // Draw all the good crap here.
  1977. if (animtimer == 64)
  1978. {
  1979. V_DrawString(114, 16, 0, "GOT THEM ALL!");
  1980. if (gameskill <= sk_easy)
  1981. {
  1982. V_DrawCenteredString(BASEVIDWIDTH/2, 100, V_YELLOWMAP, "Or have you? Play on Normal");
  1983. V_DrawCenteredString(BASEVIDWIDTH/2, 116, V_YELLOWMAP, "or higher to collect them all!");
  1984. }
  1985. }
  1986. else
  1987. V_DrawString(124, 16, 0, "TRY AGAIN!");
  1988. #endif
  1989. finalestage++;
  1990. timetonext = finalestage;
  1991. #ifndef NOEMERALDS
  1992. fa = FINEANGLE_C(timetonext);
  1993. x = 160 + FixedMul(FixedMul(FINECOSINE(fa),radius),1);
  1994. y = 100 + FixedMul(FixedMul(FINESINE(fa),radius),1);
  1995. if (emeralds & EMERALD1)
  1996. V_DrawScaledPatch(x, y, 0, W_CachePatchName("CEMGA0", PU_CACHE));
  1997. else
  1998. V_DrawTranslucentPatch(x, y, TRANSLEVEL|V_TOPLEFT, W_CachePatchName("CEMGA0", PU_CACHE));
  1999. timetonext += INTERVAL;
  2000. fa = FINEANGLE_C(timetonext);
  2001. x = 160 + FixedMul(FixedMul(FINECOSINE(fa),radius),1);
  2002. y = 100 + FixedMul(FixedMul(FINESINE(fa),radius),1);
  2003. if (emeralds & EMERALD2)
  2004. V_DrawScaledPatch(x, y, 0, W_CachePatchName("CEMOA0", PU_CACHE));
  2005. else
  2006. V_DrawTranslucentPatch(x, y, TRANSLEVEL|V_TOPLEFT, W_CachePatchName("CEMOA0", PU_CACHE));
  2007. timetonext += INTERVAL;
  2008. fa = FINEANGLE_C(timetonext);
  2009. x = 160 + FixedMul(FixedMul(FINECOSINE(fa),radius),1);
  2010. y = 100 + FixedMul(FixedMul(FINESINE(fa),radius),1);
  2011. if (emeralds & EMERALD3)
  2012. V_DrawScaledPatch(x, y, 0, W_CachePatchName("CEMPA0", PU_CACHE));
  2013. else
  2014. V_DrawTranslucentPatch(x, y, TRANSLEVEL|V_TOPLEFT, W_CachePatchName("CEMPA0", PU_CACHE));
  2015. timetonext += INTERVAL;
  2016. fa = FINEANGLE_C(timetonext);
  2017. x = 160 + FixedMul(FixedMul(FINECOSINE(fa),radius),1);
  2018. y = 100 + FixedMul(FixedMul(FINESINE(fa),radius),1);
  2019. if (emeralds & EMERALD4)
  2020. V_DrawScaledPatch(x, y, 0, W_CachePatchName("CEMBA0", PU_CACHE));
  2021. else
  2022. V_DrawTranslucentPatch(x, y, TRANSLEVEL|V_TOPLEFT, W_CachePatchName("CEMBA0", PU_CACHE));
  2023. timetonext += INTERVAL;
  2024. fa = FINEANGLE_C(timetonext);
  2025. x = 160 + FixedMul(FixedMul(FINECOSINE(fa),radius),1);
  2026. y = 100 + FixedMul(FixedMul(FINESINE(fa),radius),1);
  2027. if (emeralds & EMERALD5)
  2028. V_DrawScaledPatch(x, y, 0, W_CachePatchName("CEMRA0", PU_CACHE));
  2029. else
  2030. V_DrawTranslucentPatch(x, y, TRANSLEVEL|V_TOPLEFT, W_CachePatchName("CEMRA0", PU_CACHE));
  2031. timetonext += INTERVAL;
  2032. fa = FINEANGLE_C(timetonext);
  2033. x = 160 + FixedMul(FixedMul(FINECOSINE(fa),radius),1);
  2034. y = 100 + FixedMul(FixedMul(FINESINE(fa),radius),1);
  2035. if (emeralds & EMERALD6)
  2036. V_DrawScaledPatch(x, y, 0, W_CachePatchName("CEMLA0", PU_CACHE));
  2037. else
  2038. V_DrawTranslucentPatch(x, y, TRANSLEVEL|V_TOPLEFT, W_CachePatchName("CEMLA0", PU_CACHE));
  2039. timetonext += INTERVAL;
  2040. fa = FINEANGLE_C(timetonext);
  2041. x = 160 + FixedMul(FixedMul(FINECOSINE(fa),radius),1);
  2042. y = 100 + FixedMul(FixedMul(FINESINE(fa),radius),1);
  2043. if (emeralds & EMERALD7)
  2044. V_DrawScaledPatch(x, y, 0, W_CachePatchName("CEMYA0", PU_CACHE));
  2045. else
  2046. V_DrawTranslucentPatch(x, y, TRANSLEVEL|V_TOPLEFT, W_CachePatchName("CEMYA0", PU_CACHE));
  2047. #endif
  2048. if (finalestage >= 360)
  2049. finalestage -= 360;
  2050. if (finalecount == 5*TICRATE)
  2051. {
  2052. if ((!modifiedgame || savemoddata)
  2053. #ifdef CHEATEDGAME
  2054. && !cheatedgame
  2055. #endif
  2056. && mapheaderinfo[gamemap-1].nextlevel == 1102)
  2057. {
  2058. boolean alreadyplayed = false;
  2059. int bitcount = 0;
  2060. int i;
  2061. if (!(emblemlocations[MAXEMBLEMS-2].collected))
  2062. {
  2063. emblemlocations[MAXEMBLEMS-2].collected = true; // For completing the game.
  2064. S_StartSound(NULL, sfx_ncitem);
  2065. alreadyplayed = true;
  2066. drawemblem = true;
  2067. }
  2068. #ifndef NOEMERALDS
  2069. if (ALL7EMERALDS)
  2070. {
  2071. if (gameskill <= sk_easy)
  2072. emeralds = 0; // Bye bye!
  2073. else
  2074. {
  2075. if (!(emblemlocations[MAXEMBLEMS-1].collected))
  2076. {
  2077. emblemlocations[MAXEMBLEMS-1].collected = true;
  2078. if (!alreadyplayed)
  2079. S_StartSound(NULL, sfx_ncitem);
  2080. drawchaosemblem = true;
  2081. }
  2082. grade |= 8; // Now you can access Mario!
  2083. }
  2084. }
  2085. #endif
  2086. for (i = 0; i < MAXEMBLEMS; i++)
  2087. {
  2088. if (emblemlocations[i].collected)
  2089. bitcount++;
  2090. }
  2091. if (bitcount == numemblems) // Got ALL emblems!
  2092. #ifdef TMNTUNLOCK
  2093. grade |= 32;
  2094. #else
  2095. grade |= 16;
  2096. #endif
  2097. grade |= 1; // Just for completing the game.
  2098. timesbeaten++;
  2099. // An award for beating ultimate mode, perhaps?
  2100. if (gameskill >= sk_insane)
  2101. grade |= 1024;
  2102. }
  2103. #ifndef TMNTUNLOCK
  2104. else if (!modifiedgame
  2105. #ifdef CHEATEDGAME
  2106. && !cheatedgame
  2107. #endif
  2108. && gamemap == 29) // Cleared NiGHTS
  2109. grade |= 64;
  2110. else if (!modifiedgame
  2111. #ifdef CHEATEDGAME

Large files files are truncated, but you can click here to view the full file