misc.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Command & Conquer *
  23. * *
  24. * $Archive:: /Commando/Library/MISC.H $*
  25. * *
  26. * $Author:: Greg_h $*
  27. * *
  28. * $Modtime:: 7/22/97 11:37a $*
  29. * *
  30. * $Revision:: 1 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef MISC_H
  36. #define MISC_H
  37. #include "win.h"
  38. #include "ddraw.h"
  39. extern unsigned char CurrentPalette[768];
  40. extern bool Debug_Windowed;
  41. extern LPDIRECTDRAWSURFACE PaletteSurface;
  42. /*========================= C++ Routines ==================================*/
  43. /*=========================================================================*/
  44. /* The following prototypes are for the file: DDRAW.CPP */
  45. /*=========================================================================*/
  46. void Prep_Direct_Draw(void);
  47. void Process_DD_Result(HRESULT result, int display_ok_msg);
  48. bool Set_Video_Mode(HWND hwnd, int w, int h, int bits_per_pixel);
  49. void Reset_Video_Mode(void);
  50. unsigned Get_Free_Video_Memory(void);
  51. void Wait_Blit(void);
  52. unsigned Get_Video_Hardware_Capabilities(void);
  53. extern "C" void Wait_Vert_Blank(void);
  54. #include "palette.h"
  55. void Set_Palette(PaletteClass const & pal, int time = 0, void (*callback)() = NULL);
  56. void Set_Palette(void const * palette);
  57. /*
  58. ** Pointer to function to call if we detect a focus loss
  59. */
  60. //extern void (*Misc_Focus_Loss_Function)(void);
  61. /*
  62. ** Pointer to function to call if we detect a surface restore
  63. */
  64. //extern void (*Misc_Focus_Restore_Function)(void);
  65. /*
  66. ** Function to call if we detect focus loss
  67. */
  68. extern void (*Audio_Focus_Loss_Function)(void);
  69. /*
  70. * Flags returned by Get_Video_Hardware_Capabilities
  71. */
  72. /* Hardware blits supported? */
  73. #define VIDEO_BLITTER 1
  74. /* Hardware blits asyncronous? */
  75. #define VIDEO_BLITTER_ASYNC 2
  76. /* Can palette changes be synced to vertical refresh? */
  77. #define VIDEO_SYNC_PALETTE 4
  78. /* Is the video cards memory bank switched? */
  79. #define VIDEO_BANK_SWITCHED 8
  80. /* Can the blitter do filled rectangles? */
  81. #define VIDEO_COLOR_FILL 16
  82. /* Is there no hardware assistance avaailable at all? */
  83. #define VIDEO_NO_HARDWARE_ASSIST 32
  84. extern bool SurfacesRestored;
  85. /*=========================================================================*/
  86. /* The following variables are declared in: DDRAW.CPP */
  87. /*=========================================================================*/
  88. extern LPDIRECTDRAW DirectDrawObject;
  89. extern LPDIRECTDRAW2 DirectDraw2Interface;
  90. //extern HWND MainWindow;
  91. //extern bool SystemToVideoBlits;
  92. //extern bool VideoToSystemBlits;
  93. //extern bool SystemToSystemBlits;
  94. //extern bool OverlappedVideoBlits; // Can video driver blit overlapped regions?
  95. /*=========================================================================*/
  96. /* The following prototypes are for the file: EXIT.CPP */
  97. /* Prog_End Must be supplied by the user program in startup.cpp */
  98. /*=========================================================================*/
  99. void Prog_End(void);
  100. //void __cdecl Exit(INT errorval, const char *message, ...);
  101. /*=========================================================================*/
  102. /* The following prototypes are for the file: DELAY.CPP */
  103. /*=========================================================================*/
  104. void Delay(int duration);
  105. void Vsync(void);
  106. /*========================= Assembly Routines ==============================*/
  107. #ifdef __cplusplus
  108. extern "C" {
  109. #endif
  110. /*=========================================================================*/
  111. /* The following prototype is for the file: SHAKESCR.ASM */
  112. /*=========================================================================*/
  113. void __cdecl Shake_Screen(int shakes);
  114. //void * Build_Fading_Table(PaletteClass const & palette, void * dest, int color, int frac);
  115. //void * __cdecl Build_Fading_Table(void const *palette, void const *dest, long int color, long int frac);
  116. /*=========================================================================*/
  117. /* The following prototypes are for the file: DETPROC.ASM */
  118. /*=========================================================================*/
  119. extern WORD __cdecl Processor(void);
  120. extern WORD __cdecl Operating_System(void);
  121. extern int __cdecl Clip_Rect ( int * x , int * y , int * dw , int * dh ,
  122. int width , int height ) ;
  123. extern int __cdecl Confine_Rect ( int * x , int * y , int dw , int dh ,
  124. int width , int height ) ;
  125. /*=========================================================================*/
  126. /* The following prototypes are for the file: OPSYS.ASM */
  127. /*=========================================================================*/
  128. extern WORD OperationgSystem;
  129. #ifdef __cplusplus
  130. }
  131. #endif
  132. /*=========================================================================*/
  133. #endif // MISC_H