1 /* 2 3 Copyright (C) 2015-2018 Night Dive Studios, LLC. 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 //==================================================================================== 20 // 21 // System Shock - ©1994-1995 Looking Glass Technologies, Inc. 22 // 23 // ShockBitmap.c - Manages off-screen bitmaps and palettes. 24 // 25 //==================================================================================== 26 27 28 #include <SDL.h> 29 30 #if 1 31 32 #else 33 //-------------------- 34 // Types 35 //-------------------- 36 typedef struct 37 { 38 Ptr Address; 39 long RowBytes; 40 GrafPtr bits; 41 Rect bounds; 42 Boolean Color; 43 44 BitMap BWBits; // B&W port & map 45 GrafPort BWPort; 46 47 CGrafPort CPort; // color port 48 49 Handle OrigBits; 50 51 } ShockBitmap; 52 53 54 //-------------------- 55 // Globals 56 //-------------------- 57 extern PixMapHandle gScreenPixMap; 58 extern CTabHandle gMainColorHand; 59 extern Boolean gChangedColors; 60 //extern ShockBitmap gMainOffScreen; 61 62 #endif // 0 63 64 typedef struct ShockBitmap ShockBitmap; // FIXME: if this is actually needed, provide a portable struct 65 66 extern SDL_Surface* drawSurface; 67 extern SDL_Surface* offscreenDrawSurface; 68 69 70 //-------------------- 71 // Prototypes 72 //-------------------- 73 void SetupOffscreenBitmaps(int width, int height); 74 void ResetCTSeed(void); 75 void RememberSeed(void); 76 void FixPalette(void); 77 //void NewShockBitmap(ShockBitmap *theMap, short width, short height, Boolean color); 78 void FreeShockBitmap(ShockBitmap *theMap); 79 //Handle Build8PixMap(CGrafPtr theCGrafPtr,short width, short height); 80 short CurScreenDepth(void); 81 void CheckBitDepth(void); 82 void CleanupPalette(void); 83 void LoadPictShockBitmap(ShockBitmap *theMap, short PictID); 84 85 void SetupTitleScreen(void); 86 //int DoShockTitleButtons(Point mousePt); 87