PageRenderTime 51ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/rott-1.1/rott/cin_efct.c

#
C | 957 lines | 594 code | 147 blank | 216 comment | 53 complexity | befa47155f0de60a1e6b4d2ab28e8680 MD5 | raw file
Possible License(s): GPL-2.0
  1. /*
  2. Copyright (C) 1994-1995 Apogee Software, Ltd.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. #include "cin_glob.h"
  16. #include "cin_util.h"
  17. #include "cin_def.h"
  18. #include "cin_main.h"
  19. #include "f_scale.h"
  20. #include "watcom.h"
  21. #include "lumpy.h"
  22. #include "w_wad.h"
  23. #include "z_zone.h"
  24. #include <string.h>
  25. #ifdef DOS
  26. #include <conio.h>
  27. #endif
  28. #include "modexlib.h"
  29. #include "fli_glob.h"
  30. //MED
  31. #include "memcheck.h"
  32. static int cin_sprtopoffset;
  33. static int cin_invscale;
  34. void DrawFadeout ( void );
  35. void DrawBlankScreen ( void );
  36. void DrawClearBuffer ( void );
  37. /*
  38. ===============
  39. =
  40. = SpawnCinematicFlic
  41. =
  42. ===============
  43. */
  44. flicevent * SpawnCinematicFlic ( char * name, boolean loop, boolean usefile )
  45. {
  46. flicevent * flic;
  47. flic = SafeMalloc ( sizeof(flicevent) );
  48. // copy name of flic
  49. strcpy ( flic->name, name );
  50. flic->loop=loop;
  51. flic->usefile=usefile;
  52. return flic;
  53. }
  54. /*
  55. ===============
  56. =
  57. = SpawnCinematicSprite
  58. =
  59. ===============
  60. */
  61. spriteevent * SpawnCinematicSprite ( char * name,
  62. int duration,
  63. int numframes,
  64. int framedelay,
  65. int x,
  66. int y,
  67. int scale,
  68. int endx,
  69. int endy,
  70. int endscale
  71. )
  72. {
  73. spriteevent * sprite;
  74. patch_t *p;
  75. sprite = SafeMalloc ( sizeof (spriteevent) );
  76. // copy name of sprite
  77. strcpy ( sprite->name, name );
  78. // copy rest of sprite information
  79. sprite->duration = duration;
  80. sprite->numframes = numframes;
  81. sprite->framedelay = framedelay;
  82. sprite->frame=0;
  83. sprite->frametime=framedelay;
  84. p=(patch_t *)W_CacheLumpNum( W_GetNumForName(sprite->name), PU_CACHE, Cvt_patch_t, 1);
  85. sprite->x=x << FRACTIONBITS;
  86. sprite->y=y << FRACTIONBITS;
  87. // sprite->y+=(p->width-p->height)<<(FRACTIONBITS-1);
  88. sprite->scale=scale << FRACTIONBITS;
  89. sprite->dx= ( (endx-x) << FRACTIONBITS ) / duration;
  90. sprite->dy= ( (endy-y) << FRACTIONBITS ) / duration;
  91. sprite->dscale= ( (endscale-scale) << FRACTIONBITS ) / duration;
  92. return sprite;
  93. }
  94. /*
  95. ===============
  96. =
  97. = SpawnCinematicBack
  98. =
  99. ===============
  100. */
  101. backevent * SpawnCinematicBack ( char * name,
  102. int duration,
  103. int width,
  104. int startx,
  105. int endx,
  106. int yoffset
  107. )
  108. {
  109. backevent * back;
  110. back = SafeMalloc ( sizeof (backevent) );
  111. // copy name of back
  112. strcpy ( back->name, name );
  113. // copy rest of back information
  114. back->duration = duration;
  115. back->backdropwidth = width;
  116. back->dx = ((endx-startx) << FRACTIONBITS)/duration;
  117. back->currentoffset = startx << FRACTIONBITS;
  118. back->yoffset=yoffset;
  119. return back;
  120. }
  121. /*
  122. ===============
  123. =
  124. = SpawnCinematicMultiBack
  125. =
  126. ===============
  127. */
  128. backevent * SpawnCinematicMultiBack ( char * name,
  129. char * name2,
  130. int duration,
  131. int startx,
  132. int endx,
  133. int yoffset
  134. )
  135. {
  136. backevent * back;
  137. lpic_t * pic1;
  138. lpic_t * pic2;
  139. pic1=(lpic_t *)W_CacheLumpName(name,PU_CACHE, Cvt_lpic_t, 1);
  140. pic2=(lpic_t *)W_CacheLumpName(name2,PU_CACHE, Cvt_lpic_t, 1);
  141. back = SafeMalloc ( sizeof (backevent) );
  142. // copy name of back
  143. strcpy ( back->name, name );
  144. // copy rest of back information
  145. back->duration = duration;
  146. back->dx = ((endx-startx) << FRACTIONBITS)/duration;
  147. back->currentoffset = startx << FRACTIONBITS;
  148. back->yoffset=yoffset;
  149. if (pic1->height != pic2->height)
  150. {
  151. Error("SpawnCinematicMultiBack: heights are not the same\n"
  152. " name1=%s name2=%s\n",name,name2);
  153. }
  154. back->backdropwidth=pic1->width+pic2->width;
  155. back->height=pic1->height;
  156. back->data=SafeMalloc (back->backdropwidth*back->height);
  157. memcpy( back->data, &(pic1->data), pic1->width*pic1->height);
  158. memcpy( back->data+(pic1->width*pic1->height),
  159. &(pic2->data),
  160. pic2->width*pic2->height
  161. );
  162. return back;
  163. }
  164. /*
  165. ===============
  166. =
  167. = SpawnCinematicPalette
  168. =
  169. ===============
  170. */
  171. paletteevent * SpawnCinematicPalette ( char * name )
  172. {
  173. paletteevent * palette;
  174. palette = SafeMalloc ( sizeof (paletteevent) );
  175. // copy name of palette
  176. strcpy ( palette->name, name );
  177. return palette;
  178. }
  179. /*
  180. =================
  181. =
  182. = ScaleFilmPost
  183. =
  184. =================
  185. */
  186. void ScaleFilmPost (byte * src, byte * buf)
  187. {
  188. int offset;
  189. int length;
  190. int topscreen;
  191. int bottomscreen;
  192. offset=*(src++);
  193. for (;offset!=255;)
  194. {
  195. length=*(src++);
  196. topscreen = cin_sprtopoffset + (cin_invscale*offset);
  197. bottomscreen = topscreen + (cin_invscale*length);
  198. cin_yl = (topscreen+FRACTIONUNIT-1)>>FRACTIONBITS;
  199. cin_yh = (bottomscreen-FRACTIONUNIT)>>FRACTIONBITS;
  200. if (cin_yh >= iGLOBAL_SCREENHEIGHT)
  201. cin_yh = iGLOBAL_SCREENHEIGHT-1;
  202. if (cin_yl < 0)
  203. cin_yl = 0;
  204. if (cin_yl <= cin_yh)
  205. {
  206. cin_source=src-offset;
  207. R_DrawFilmColumn (buf);
  208. }
  209. src+=length;
  210. offset=*(src++);
  211. }
  212. }
  213. /*
  214. =================
  215. =
  216. = DrawFlic
  217. =
  218. =================
  219. */
  220. void DrawFlic ( flicevent * flic )
  221. {
  222. byte * curpal;
  223. byte * buf;
  224. char flicname[40];
  225. curpal = SafeMalloc (768);
  226. CinematicGetPalette (curpal);
  227. DrawFadeout ( );
  228. if (flic->usefile==false)
  229. {
  230. buf=W_CacheLumpName(flic->name,PU_CACHE, CvtNull, 1);
  231. strcpy(flicname,flic->name);
  232. }
  233. else
  234. {
  235. strcpy(flicname,flic->name);
  236. strcat(flicname,".fli");
  237. }
  238. // med
  239. // PlayFlic ( flicname, buf, flic->usefile, flic->loop);
  240. if (flic->loop==true)
  241. ClearCinematicAbort();
  242. DrawFadeout ( );
  243. DrawBlankScreen ( );
  244. #ifdef DOS
  245. VL_SetVGAPlaneMode ();
  246. #endif
  247. CinematicSetPalette (curpal);
  248. SafeFree (curpal);
  249. GetCinematicTics ();
  250. GetCinematicTics ();
  251. }
  252. /*
  253. =================
  254. =
  255. = PrecacheFlic
  256. =
  257. =================
  258. */
  259. void PrecacheFlic (flicevent * flic)
  260. {
  261. if (flic->usefile==false)
  262. {
  263. W_CacheLumpName(flic->name,PU_CACHE, CvtNull, 1);
  264. }
  265. }
  266. /*
  267. ===============
  268. =
  269. = DrawCinematicBackground
  270. =
  271. ===============
  272. */
  273. void DrawCinematicBackground ( backevent * back )
  274. {
  275. byte * src;
  276. byte * buf;
  277. lpic_t * pic;
  278. int i;
  279. int plane;
  280. int offset;
  281. int height;
  282. pic=(lpic_t *)W_CacheLumpName(back->name,PU_CACHE, Cvt_lpic_t, 1);
  283. height = pic->height;
  284. if (height+back->yoffset>iGLOBAL_SCREENHEIGHT)
  285. height=iGLOBAL_SCREENHEIGHT-back->yoffset;
  286. if (height!=iGLOBAL_SCREENHEIGHT)
  287. DrawClearBuffer ();
  288. plane = 0;
  289. #ifdef DOS
  290. for (plane=0;plane<4;plane++)
  291. #endif
  292. {
  293. buf=(byte *)bufferofs+ylookup[back->yoffset];
  294. offset=(back->currentoffset>>FRACTIONBITS)+plane;
  295. VGAWRITEMAP(plane);
  296. #ifdef DOS
  297. for (i=plane;i<iGLOBAL_SCREENWIDTH;i+=4,offset+=4,buf++)
  298. #else
  299. for (i=0;i<iGLOBAL_SCREENWIDTH;i++,offset++,buf++)
  300. #endif
  301. {
  302. if (offset>=back->backdropwidth)
  303. src=&(pic->data) + ( (offset - back->backdropwidth) * (pic->height) );
  304. else if (offset<0)
  305. src=&(pic->data) + ( (offset + back->backdropwidth) * (pic->height) );
  306. else
  307. src=&(pic->data) + ( offset * (pic->height) );
  308. DrawFilmPost(buf,src,height);
  309. }
  310. }
  311. }
  312. /*
  313. ===============
  314. =
  315. = DrawCinematicMultiBackground
  316. =
  317. ===============
  318. */
  319. void DrawCinematicMultiBackground ( backevent * back )
  320. {
  321. byte * src;
  322. byte * buf;
  323. int i;
  324. int plane;
  325. int offset;
  326. int height;
  327. height = back->height;
  328. if (height+back->yoffset>iGLOBAL_SCREENHEIGHT)
  329. height=iGLOBAL_SCREENHEIGHT-back->yoffset;
  330. if (height!=iGLOBAL_SCREENHEIGHT)
  331. DrawClearBuffer ();
  332. plane = 0;
  333. #ifdef DOS
  334. for (plane=0;plane<4;plane++)
  335. #endif
  336. {
  337. buf=(byte *)bufferofs+ylookup[back->yoffset];
  338. offset=(back->currentoffset>>FRACTIONBITS)+plane;
  339. VGAWRITEMAP(plane);
  340. #ifdef DOS
  341. for (i=plane;i<iGLOBAL_SCREENWIDTH;i+=4,offset+=4,buf++)
  342. #else
  343. for (i=0;i<iGLOBAL_SCREENWIDTH;i++,offset++,buf++)
  344. #endif
  345. {
  346. if (offset>=back->backdropwidth)
  347. src=back->data + ( (offset - back->backdropwidth) * (back->height) );
  348. else if (offset<0)
  349. src=back->data + ( (offset + back->backdropwidth) * (back->height) );
  350. else
  351. src=back->data + ( offset * (back->height) );
  352. DrawFilmPost(buf,src,height);
  353. }
  354. }
  355. }
  356. /*
  357. ===============
  358. =
  359. = DrawCinematicBackdrop
  360. =
  361. ===============
  362. */
  363. void DrawCinematicBackdrop ( backevent * back )
  364. {
  365. byte * src;
  366. byte * shape;
  367. byte * buf;
  368. patch_t * p;
  369. int i;
  370. int plane;
  371. int offset;
  372. int postoffset;
  373. int postlength;
  374. int toppost;
  375. shape=W_CacheLumpName(back->name,PU_CACHE, Cvt_patch_t, 1);
  376. p=(patch_t *)shape;
  377. toppost=-p->topoffset+back->yoffset;
  378. plane = 0;
  379. #ifdef DOS
  380. for (plane=0;plane<4;plane++)
  381. #endif
  382. {
  383. buf=(byte *)bufferofs;
  384. offset=(back->currentoffset>>FRACTIONBITS)+plane;
  385. VGAWRITEMAP(plane);
  386. #ifdef DOS
  387. for (i=plane;i<iGLOBAL_SCREENWIDTH;i+=4,offset+=4,buf++)
  388. #else
  389. for (i=0;i<iGLOBAL_SCREENWIDTH;i++,offset++,buf++)
  390. #endif
  391. {
  392. if (offset>=back->backdropwidth)
  393. src = shape + p->collumnofs[offset - back->backdropwidth];
  394. else if (offset<0)
  395. src=shape + p->collumnofs[offset + back->backdropwidth];
  396. else
  397. src = shape + p->collumnofs[offset];
  398. postoffset=*(src++);
  399. for (;postoffset!=255;)
  400. {
  401. postlength=*(src++);
  402. DrawFilmPost(buf + ylookup[toppost+postoffset],src,postlength);
  403. src+=postlength;
  404. postoffset=*(src++);
  405. }
  406. }
  407. }
  408. }
  409. /*
  410. =================
  411. =
  412. = PrecacheBack
  413. =
  414. =================
  415. */
  416. void PrecacheBack ( backevent * back )
  417. {
  418. W_CacheLumpName( back->name, PU_CACHE, CvtNull, 1);
  419. }
  420. /*
  421. =================
  422. =
  423. = DrawCinematicSprite
  424. =
  425. =================
  426. */
  427. void DrawCinematicSprite ( spriteevent * sprite )
  428. {
  429. byte *shape;
  430. int frac;
  431. patch_t *p;
  432. int x1,x2;
  433. int tx;
  434. int xcent;
  435. byte * buf;
  436. int height;
  437. height = sprite->scale >> FRACTIONBITS;
  438. if (height<2)
  439. return;
  440. shape=W_CacheLumpNum( W_GetNumForName(sprite->name)+sprite->frame, PU_CACHE, Cvt_patch_t, 1);
  441. p=(patch_t *)shape;
  442. cin_ycenter=sprite->y >> FRACTIONBITS;
  443. cin_invscale = (height<<FRACTIONBITS)/p->origsize;
  444. buf=(byte *)bufferofs;
  445. tx=-p->leftoffset;
  446. xcent=(sprite->x & 0xffff0000)-(height<<(FRACTIONBITS-1))+(FRACTIONUNIT>>1);
  447. //
  448. // calculate edges of the shape
  449. //
  450. x1 = (xcent+(tx*cin_invscale))>>FRACTIONBITS;
  451. if (x1 >= iGLOBAL_SCREENWIDTH)
  452. return; // off the right side
  453. tx+=p->width;
  454. x2 = ((xcent+(tx*cin_invscale)) >>FRACTIONBITS) - 1 ;
  455. if (x2 < 0)
  456. return; // off the left side
  457. cin_iscale=(p->origsize<<FRACTIONBITS)/height;
  458. if (x1<0)
  459. {
  460. frac=cin_iscale*(-x1);
  461. x1=0;
  462. }
  463. else
  464. frac=0;
  465. x2 = x2 >= iGLOBAL_SCREENWIDTH ? (iGLOBAL_SCREENWIDTH-1) : x2;
  466. cin_texturemid = (((p->origsize>>1)+p->topoffset)<<FRACTIONBITS)+(FRACTIONUNIT>>1);
  467. cin_sprtopoffset = (cin_ycenter<<16) - FixedMul(cin_texturemid,cin_invscale);
  468. for (; x1<=x2 ; x1++, frac += cin_iscale)
  469. {
  470. VGAWRITEMAP(x1&3);
  471. #ifdef DOS
  472. ScaleFilmPost(((p->collumnofs[frac>>FRACTIONBITS])+shape),buf+(x1>>2));
  473. #else
  474. ScaleFilmPost(((p->collumnofs[frac>>FRACTIONBITS])+shape),buf+x1);
  475. #endif
  476. }
  477. }
  478. /*
  479. =================
  480. =
  481. = PrecacheCinematicSprite
  482. =
  483. =================
  484. */
  485. void PrecacheCinematicSprite ( spriteevent * sprite )
  486. {
  487. int i;
  488. for (i=0;i<sprite->numframes;i++)
  489. {
  490. W_CacheLumpNum( W_GetNumForName(sprite->name)+i, PU_CACHE, Cvt_patch_t, 1);
  491. }
  492. }
  493. /*
  494. =================
  495. =
  496. = DrawPalette
  497. =
  498. =================
  499. */
  500. void DrawPalette (paletteevent * event)
  501. {
  502. byte * pal;
  503. pal=W_CacheLumpName(event->name,PU_CACHE, CvtNull, 1);
  504. XFlipPage ();
  505. CinematicSetPalette (pal);
  506. }
  507. /*
  508. =================
  509. =
  510. = PrecachePalette
  511. =
  512. =================
  513. */
  514. void PrecachePalette (paletteevent * event)
  515. {
  516. W_CacheLumpName(event->name,PU_CACHE, CvtNull, 1);
  517. }
  518. /*
  519. =================
  520. =
  521. = DrawFadeout
  522. =
  523. =================
  524. */
  525. #define FADEOUTTIME 20
  526. void DrawFadeout ( void )
  527. {
  528. byte origpal[768];
  529. byte newpal[768];
  530. int i,j;
  531. CinematicGetPalette (&origpal[0]);
  532. for (j = 0; j < FADEOUTTIME; j++)
  533. {
  534. for (i = 0; i < 768; i++)
  535. {
  536. newpal[i] = ( origpal[i] * (FADEOUTTIME - j - 1) ) / FADEOUTTIME;
  537. }
  538. WaitVBL();
  539. CinematicSetPalette (&newpal[0]);
  540. CinematicDelay();
  541. }
  542. VL_ClearVideo (0);
  543. GetCinematicTics ();
  544. GetCinematicTics ();
  545. }
  546. /*
  547. =================
  548. =
  549. = DrawBlankScreen
  550. =
  551. =================
  552. */
  553. void DrawBlankScreen ( void )
  554. {
  555. VL_ClearVideo (0);
  556. }
  557. /*
  558. =================
  559. =
  560. = DrawClearBuffer
  561. =
  562. =================
  563. */
  564. void DrawClearBuffer ( void )
  565. {
  566. #ifdef DOS
  567. VGAMAPMASK(15);
  568. memset((byte *)bufferofs,0,iGLOBAL_SCREENBWIDE*iGLOBAL_SCREENHEIGHT);
  569. #else
  570. memset((byte *)bufferofs,0,iGLOBAL_SCREENWIDTH*iGLOBAL_SCREENHEIGHT);
  571. #endif
  572. }
  573. /*
  574. ===============
  575. =
  576. = UpdateCinematicBack
  577. =
  578. ===============
  579. */
  580. boolean UpdateCinematicBack ( backevent * back )
  581. {
  582. back->duration--;
  583. if (back->duration<0)
  584. return false;
  585. back->currentoffset += back->dx;
  586. return true;
  587. }
  588. /*
  589. =================
  590. =
  591. = UpdateCinematicSprite
  592. =
  593. =================
  594. */
  595. boolean UpdateCinematicSprite ( spriteevent * sprite )
  596. {
  597. sprite->duration--;
  598. if (sprite->duration<0)
  599. return false;
  600. sprite->framedelay--;
  601. if (sprite->framedelay==0)
  602. {
  603. sprite->frame++;
  604. if (sprite->frame==sprite->numframes)
  605. sprite->frame=0;
  606. sprite->framedelay=sprite->frametime;
  607. }
  608. sprite->x+=sprite->dx;
  609. sprite->y+=sprite->dy;
  610. sprite->scale+=sprite->dscale;
  611. return true;
  612. }
  613. /*
  614. =================
  615. =
  616. = UpdateCinematicEffect
  617. =
  618. =================
  619. */
  620. boolean UpdateCinematicEffect ( enum_eventtype type, void * effect )
  621. {
  622. switch (type)
  623. {
  624. case background_noscrolling:
  625. case background_scrolling:
  626. case backdrop_scrolling:
  627. case backdrop_noscrolling:
  628. case background_multi:
  629. return UpdateCinematicBack ( (backevent *) effect );
  630. break;
  631. case sprite_background:
  632. case sprite_foreground:
  633. return UpdateCinematicSprite ( (spriteevent *) effect );
  634. break;
  635. case flic:
  636. return true;
  637. break;
  638. case palette:
  639. case fadeout:
  640. case blankscreen:
  641. case clearbuffer:
  642. return true;
  643. break;
  644. case cinematicend:
  645. cinematicdone=true;
  646. return true;
  647. break;
  648. }
  649. return true;
  650. }
  651. /*
  652. =================
  653. =
  654. = DrawCinematicEffect
  655. =
  656. =================
  657. */
  658. boolean DrawCinematicEffect ( enum_eventtype type, void * effect )
  659. {
  660. switch (type)
  661. {
  662. case background_noscrolling:
  663. case background_scrolling:
  664. DrawCinematicBackground ( (backevent *) effect );
  665. return true;
  666. break;
  667. case background_multi:
  668. DrawCinematicMultiBackground ( (backevent *) effect );
  669. return true;
  670. break;
  671. case backdrop_scrolling:
  672. case backdrop_noscrolling:
  673. DrawCinematicBackdrop ( (backevent *) effect );
  674. return true;
  675. break;
  676. case sprite_background:
  677. case sprite_foreground:
  678. DrawCinematicSprite ( (spriteevent *) effect );
  679. return true;
  680. break;
  681. case flic:
  682. DrawFlic ( (flicevent *) effect );
  683. return false;
  684. break;
  685. case palette:
  686. DrawPalette ( (paletteevent *) effect );
  687. return false;
  688. break;
  689. case fadeout:
  690. DrawFadeout ();
  691. return false;
  692. break;
  693. case blankscreen:
  694. DrawBlankScreen ();
  695. return false;
  696. break;
  697. case clearbuffer:
  698. DrawClearBuffer ();
  699. return false;
  700. break;
  701. case cinematicend:
  702. return true;
  703. break;
  704. }
  705. return true;
  706. }
  707. /*
  708. =================
  709. =
  710. = PrecacheCinematicEffect
  711. =
  712. =================
  713. */
  714. void PrecacheCinematicEffect ( enum_eventtype type, void * effect )
  715. {
  716. switch (type)
  717. {
  718. case background_noscrolling:
  719. case background_scrolling:
  720. case backdrop_scrolling:
  721. case backdrop_noscrolling:
  722. PrecacheBack ( (backevent *) effect );
  723. break;
  724. case sprite_background:
  725. case sprite_foreground:
  726. PrecacheCinematicSprite ( (spriteevent *) effect );
  727. break;
  728. case palette:
  729. PrecachePalette ( (paletteevent *) effect );
  730. break;
  731. case flic:
  732. PrecacheFlic ( (flicevent *) effect );
  733. break;
  734. default:
  735. ;
  736. }
  737. }
  738. /*
  739. ===============
  740. =
  741. = ProfileDisplay
  742. =
  743. ===============
  744. */
  745. void ProfileDisplay ( void )
  746. {
  747. byte * buf;
  748. int i;
  749. int plane;
  750. byte src[200];
  751. int width = StretchScreen? 320:iGLOBAL_SCREENWIDTH;
  752. DrawClearBuffer ();
  753. plane = 0;
  754. #ifdef DOS
  755. for (plane=0;plane<4;plane++)
  756. #endif
  757. {
  758. buf=(byte *)bufferofs;
  759. VGAWRITEMAP(plane);
  760. #ifdef DOS
  761. for (i=plane;i<width;i+=4,buf++)
  762. #else
  763. for (i=0;i<width;i++,buf++)
  764. #endif
  765. {
  766. DrawFilmPost(buf,&src[0],200);
  767. }
  768. }
  769. }
  770. /*
  771. ===============
  772. =
  773. = DrawPostPic
  774. =
  775. ===============
  776. */
  777. void DrawPostPic ( int lumpnum )
  778. {
  779. byte * src;
  780. byte * buf;
  781. lpic_t * pic;
  782. int i;
  783. int plane;
  784. int height;
  785. int width = StretchScreen? 320:iGLOBAL_SCREENWIDTH;
  786. pic=(lpic_t *)W_CacheLumpNum(lumpnum,PU_CACHE, Cvt_lpic_t, 1);
  787. height = pic->height;
  788. plane = 0;
  789. #ifdef DOS
  790. for (plane=0;plane<4;plane++)
  791. #endif
  792. {
  793. buf=(byte *)bufferofs;
  794. src=&(pic->data) + (plane*pic->height);
  795. VGAWRITEMAP(plane);
  796. #ifdef DOS
  797. for (i=plane;i<width;i+=4,src+=(pic->height<<2),buf++)
  798. #else
  799. for (i=0;i<width;i++,src+=pic->height,buf++)
  800. #endif
  801. {
  802. DrawFilmPost(buf,src,height);
  803. }
  804. }
  805. }