ID_RF.H 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /* Catacomb Armageddon Source Code
  2. * Copyright (C) 1993-2014 Flat Rock Software
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along
  15. * with this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. */
  18. // ID_RF.H
  19. #define __ID_RF__
  20. #ifndef __ID_MM__
  21. #include "ID_MM.H"
  22. #endif
  23. /*
  24. =============================================================================
  25. CONSTANTS
  26. =============================================================================
  27. */
  28. #define MINTICS 2
  29. #define MAXTICS 6
  30. #define DEMOTICS 3
  31. #define MAPBORDER 2 // map border must be at least 1
  32. #define MAXSPRITES 50 // max tracked sprites
  33. #define MAXANIMTILES 90 // max animating tiles on screen
  34. #define MAXANIMTYPES 50 // max different unique anim tiles on map
  35. #define MAXMAPHEIGHT 200
  36. #define PRIORITIES 4
  37. #define MASKEDTILEPRIORITY 3 // planes go: 0,1,2,MTILES,3
  38. #define TILEGLOBAL 256
  39. #define PIXGLOBAL 16
  40. #define G_T_SHIFT 8 // global >> ?? = tile
  41. #define G_P_SHIFT 4 // global >> ?? = pixels
  42. #define P_T_SHIFT 4 // pixels >> ?? = tile
  43. #define PORTTILESWIDE 21 // all drawing takes place inside a
  44. #define PORTTILESHIGH 14 // non displayed port of this size
  45. //#define PORTGLOBALWIDE (21*TILEGLOBAL)
  46. //#define PORTGLOBALHIGH (14*TILEGLOBAL)
  47. #define UPDATEWIDE (PORTTILESWIDE+1)
  48. #define UPDATEHIGH PORTTILESHIGH
  49. //===========================================================================
  50. typedef enum {spritedraw,maskdraw} drawtype;
  51. /*
  52. =============================================================================
  53. PUBLIC VARIABLES
  54. =============================================================================
  55. */
  56. extern boolean compatability; // crippled refresh for wierdo SVGAs
  57. extern unsigned tics;
  58. extern long lasttimecount;
  59. extern unsigned originxglobal,originyglobal;
  60. extern unsigned originxtile,originytile;
  61. extern unsigned originxscreen,originyscreen;
  62. extern unsigned mapwidth,mapheight,mapbyteswide,mapwordswide
  63. ,mapbytesextra,mapwordsextra;
  64. extern unsigned mapbwidthtable[MAXMAPHEIGHT];
  65. extern unsigned originxmin,originxmax,originymin,originymax;
  66. extern unsigned masterofs;
  67. //
  68. // the floating update window is also used by the view manager for
  69. // double buffer tracking
  70. //
  71. extern byte *updateptr; // current start of update window
  72. #if GRMODE == CGAGR
  73. extern byte *baseupdateptr;
  74. #endif
  75. extern unsigned blockstarts[UPDATEWIDE*UPDATEHIGH];
  76. extern unsigned updatemapofs[UPDATEWIDE*UPDATEHIGH];
  77. extern unsigned uwidthtable[UPDATEHIGH]; // lookup instead of multiple
  78. #define UPDATETERMINATE 0x0301
  79. /*
  80. =============================================================================
  81. PUBLIC FUNCTIONS
  82. =============================================================================
  83. */
  84. void RF_Startup (void);
  85. void RF_Shutdown (void);
  86. void RF_FixOfs (void);
  87. void RF_NewMap (void);
  88. void RF_MarkTileGraphics (void);
  89. void RF_SetScrollBlock (int x, int y, boolean horizontal);
  90. void RF_NewPosition (unsigned x, unsigned y);
  91. void RF_Scroll (int x, int y);
  92. void RF_MapToMap (unsigned srcx, unsigned srcy,
  93. unsigned destx, unsigned desty,
  94. unsigned width, unsigned height);
  95. void RF_MemToMap (unsigned far *source, unsigned plane,
  96. unsigned destx, unsigned desty,
  97. unsigned width, unsigned height);
  98. void RF_ClearBlock (int x, int y, int width, int height);
  99. void RF_RedrawBlock (int x, int y, int width, int height);
  100. void RF_PlaceSprite (void **user,unsigned globalx,unsigned globaly,
  101. unsigned spritenumber, drawtype draw, int priority);
  102. void RF_RemoveSprite (void **user);
  103. void RF_CalcTics (void);
  104. void RF_Refresh (void);
  105. void RF_ForceRefresh (void);
  106. void RF_SetRefreshHook (void (*func) (void) );
  107. unsigned RF_FindFreeBuffer (void);