1 /* 2 BStone: A Source port of 3 Blake Stone: Aliens of Gold and Blake Stone: Planet Strike 4 5 Copyright (c) 1992-2013 Apogee Entertainment, LLC 6 Copyright (c) 2013-2015 Boris I. Bendovsky (bibendovsky@hotmail.com) 7 8 This program is free software; you can redistribute it and/or 9 modify it under the terms of the GNU General Public License 10 as published by the Free Software Foundation; either version 2 11 of the License, or (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the 20 Free Software Foundation, Inc., 21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 */ 23 24 25 #ifndef BSTONE_ID_VH_INCLUDED 26 #define BSTONE_ID_VH_INCLUDED 27 28 29 #include <cstdint> 30 #include <vector> 31 32 33 #define WHITE (15) // graphics mode independant colors 34 #define BLACK (0) 35 36 37 struct spritetabletype { 38 int16_t width; 39 int16_t height; 40 int16_t orgx; 41 int16_t orgy; 42 int16_t xl; 43 int16_t yl; 44 int16_t xh; 45 int16_t yh; 46 int16_t shifts; 47 }; // spritetabletype 48 49 struct pictabletype { 50 int16_t width; 51 int16_t height; 52 }; // pictabletype 53 54 struct fontstruct { 55 int16_t height; 56 int16_t location[256]; 57 char width[256]; 58 }; // fontstruct 59 60 61 extern pictabletype* pictable; 62 extern pictabletype* picmtable; 63 extern spritetabletype* spritetable; 64 65 extern uint8_t fontcolor; 66 extern int16_t fontnumber; 67 extern int16_t px; 68 extern int16_t py; 69 extern bool allcaps; 70 71 72 // 73 // mode independant routines 74 // coordinates in pixels, rounded to best screen res 75 // regions marked in double buffer 76 // 77 78 void VWB_DrawTile8( 79 int x, 80 int y, 81 int tile); 82 void VWB_DrawPic( 83 int x, 84 int y, 85 int chunknum); 86 void VWB_DrawMPic( 87 int x, 88 int y, 89 int chunknum); 90 void VWB_Bar( 91 int x, 92 int y, 93 int width, 94 int height, 95 uint8_t color); 96 97 void VWB_DrawPropString( 98 const char* string); 99 void VW_DrawPropString( 100 const char* string); 101 void VWB_Plot( 102 int x, 103 int y, 104 uint8_t color); 105 void VWB_Hlin( 106 int x1, 107 int x2, 108 int y, 109 uint8_t color); 110 void VWB_Vlin( 111 int y1, 112 int y2, 113 int x, 114 uint8_t color); 115 116 117 // 118 // wolfenstein EGA compatability stuff 119 // 120 extern const uint8_t vgapal[768]; 121 122 123 #define VW_Startup VL_Startup 124 #define VW_Shutdown VL_Shutdown 125 #define VW_Bar VL_Bar 126 #define VW_Plot VL_Plot 127 #define VW_Hlin(x, z, y, c) VL_Hlin((x), (y), (z) - (x) + 1, (c)) 128 #define VW_Vlin(y, z, x, c) VL_Vlin((x), (y), (z) - (y) + 1, (c)) 129 #define VW_WaitVBL VL_WaitVBL 130 #define VW_FadeIn() VL_FadeIn(0, 255, vgapal, 30); 131 #define VW_FadeOut() VL_FadeOut(0, 255, 0, 0, 0, 30); 132 #define VW_ScreenToScreen VL_ScreenToScreen 133 void VW_MeasurePropString( 134 const char* string, 135 int* width, 136 int* height); 137 #define VW_UpdateScreen() VH_UpdateScreen() 138 139 #define LatchDrawChar(x, y, p) VL_LatchToScreen(latchpics[0] + (p) * 64, 8, 8, x, y) 140 #define LatchDrawTile(x, y, p) VL_LatchToScreen(latchpics[1] + (p) * 64, 16, 16, x, y) 141 142 void LatchDrawPic( 143 int x, 144 int y, 145 int picnum); 146 void LoadLatchMem(); 147 148 extern int latchpics[]; 149 150 extern int LatchMemFree; 151 152 // BBi 153 void vl_minimize_fullscreen_window( 154 bool value); 155 156 using LatchesCache = std::vector<uint8_t>; 157 extern LatchesCache latches_cache; 158 159 160 #endif // BSTONE_ID_VH_INCLUDED 161