Render Dirty.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. #ifndef __RENDER_DIRTY_H
  2. #define __RENDER_DIRTY_H
  3. //DEFINES
  4. #define BGND_FLAG_PERMANENT 0x80000000
  5. #define BGND_FLAG_SINGLE 0x40000000
  6. #define BGND_FLAG_SAVE_Z 0x20000000
  7. #define BGND_FLAG_MERC 0x10000000
  8. #define BGND_FLAG_SAVERECT 0x08000000
  9. #define BGND_FLAG_TOPMOST 0x04000000
  10. #define BGND_FLAG_ANIMATED 0x00000001
  11. #define VOVERLAY_DIRTYBYTEXT 0x00000001
  12. #define VOVERLAY_STARTDISABLED 0x00000002
  13. #define VOVERLAY_DESC_TEXT 0x00001000
  14. #define VOVERLAY_DESC_DISABLED 0x00002000
  15. #define VOVERLAY_DESC_POSITION 0x00004000
  16. // STRUCTURES
  17. // Callback for topmost blitters
  18. typedef void (*OVERLAY_CALLBACK)(struct _VIDEO_OVERLAY * );
  19. // Struct for backgrounds
  20. typedef struct
  21. {
  22. BOOLEAN fAllocated;
  23. BOOLEAN fFilled;
  24. BOOLEAN fFreeMemory;
  25. BOOLEAN fZBuffer;
  26. UINT32 uiFlags;
  27. INT16 *pSaveArea;
  28. INT16 *pZSaveArea;
  29. INT16 sLeft;
  30. INT16 sTop;
  31. INT16 sRight;
  32. INT16 sBottom;
  33. INT16 sWidth;
  34. INT16 sHeight;
  35. BOOLEAN fPendingDelete;
  36. BOOLEAN fDisabled;
  37. } BACKGROUND_SAVE;
  38. // Struct for topmost blitters
  39. typedef struct _VIDEO_OVERLAY
  40. {
  41. UINT32 uiFlags;
  42. BOOLEAN fAllocated;
  43. BOOLEAN fDisabled;
  44. BOOLEAN fActivelySaving;
  45. BOOLEAN fDeletionPending;
  46. INT32 uiBackground;
  47. BACKGROUND_SAVE *pBackground;
  48. INT16 *pSaveArea;
  49. UINT32 uiUserData[ 5 ];
  50. UINT32 uiFontID;
  51. INT16 sX;
  52. INT16 sY;
  53. UINT8 ubFontBack;
  54. UINT8 ubFontFore;
  55. INT16 zText[ 200 ];
  56. UINT32 uiDestBuff;
  57. OVERLAY_CALLBACK BltCallback;
  58. } VIDEO_OVERLAY;
  59. // Struct for init topmost blitter
  60. typedef struct
  61. {
  62. UINT32 uiFlags;
  63. BOOLEAN fDisabled;
  64. INT16 sLeft;
  65. INT16 sTop;
  66. INT16 sRight;
  67. INT16 sBottom;
  68. UINT32 uiFontID;
  69. INT16 sX;
  70. INT16 sY;
  71. UINT8 ubFontBack;
  72. UINT8 ubFontFore;
  73. INT16 pzText[ 200 ];
  74. OVERLAY_CALLBACK BltCallback;
  75. } VIDEO_OVERLAY_DESC;
  76. // GLOBAL VARIABLES
  77. SGPRect gDirtyClipRect;
  78. // FUNCTIONS
  79. ////////////
  80. // DIRTY QUEUE
  81. BOOLEAN InitializeBaseDirtyRectQueue( );
  82. void ShutdownBaseDirtyRectQueue( );
  83. void AddBaseDirtyRect( INT32 iLeft, INT32 iTop, INT32 iRight, INT32 iBottom );
  84. BOOLEAN ExecuteBaseDirtyRectQueue( );
  85. BOOLEAN EmptyDirtyRectQueue( );
  86. // BACKGROUND RECT BUFFERING STUFF
  87. void DisableBackgroundRect( INT32 iIndex, BOOLEAN fDisabled );
  88. BOOLEAN InitializeBackgroundRects(void);
  89. BOOLEAN ShutdownBackgroundRects(void);
  90. INT32 RegisterBackgroundRect(UINT32 uiFlags, INT16 *pSaveArea, INT16 sLeft, INT16 sTop, INT16 sRight, INT16 sBottom);
  91. BOOLEAN FreeBackgroundRect(INT32 iIndex);
  92. BOOLEAN FreeBackgroundRectPending(INT32 iIndex);
  93. BOOLEAN FreeBackgroundRectType(UINT32 uiFlags);
  94. BOOLEAN RestoreBackgroundRects(void);
  95. BOOLEAN SaveBackgroundRects(void);
  96. BOOLEAN InvalidateBackgroundRects(void);
  97. BOOLEAN UpdateSaveBuffer(void);
  98. BOOLEAN RestoreExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight );
  99. void SetBackgroundRectFilled( UINT32 uiBackgroundID );
  100. BOOLEAN EmptyBackgroundRects( void );
  101. // GPRINTF DIRTY STUFF
  102. UINT16 gprintfdirty(INT16 x, INT16 y, UINT16 *pFontString, ...);
  103. UINT16 gprintfinvalidate(INT16 x, INT16 y, UINT16 *pFontString, ...);
  104. UINT16 gprintfRestore(INT16 x, INT16 y, UINT16 *pFontString, ...);
  105. // VIDEO OVERLAY STUFF
  106. INT32 GetFreeVideoOverlay(void);
  107. void RecountVideoOverlays(void);
  108. INT32 RegisterVideoOverlay( UINT32 uiFlags, VIDEO_OVERLAY_DESC *pTopmostDesc );
  109. void ExecuteVideoOverlays( );
  110. BOOLEAN UpdateVideoOverlay( VIDEO_OVERLAY_DESC *pTopmostDesc, UINT32 iBlitterIndex, BOOLEAN fForceAll );
  111. void SaveVideoOverlaysArea( UINT32 uiSrcBuffer );
  112. void DeleteVideoOverlaysArea( );
  113. void AllocateVideoOverlaysArea( );
  114. void ExecuteVideoOverlaysToAlternateBuffer( UINT32 uiNewDestBuffer );
  115. void RemoveVideoOverlay( INT32 iVideoOverlay );
  116. BOOLEAN RestoreShiftedVideoOverlays( INT16 sShiftX, INT16 sShiftY );
  117. BOOLEAN SetOverlayUserData( INT32 iVideoOverlay, UINT8 ubNum, UINT32 uiData );
  118. void EnableVideoOverlay( BOOLEAN fEnable, INT32 iOverlayIndex );
  119. void BlitMFont( VIDEO_OVERLAY *pBlitter );
  120. BOOLEAN BlitBufferToBuffer(UINT32 uiSrcBuffer, UINT32 uiDestBuffer, UINT16 usSrcX, UINT16 usSrcY, UINT16 usWidth, UINT16 usHeight);
  121. #endif