ScummVM API documentation
bitmap.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * This code is based on original Soltys source code
24  * Copyright (c) 1994-1995 Janusz B. Wisniewski and L.K. Avalon
25  */
26 
27 #ifndef CGE_BITMAP_H
28 #define CGE_BITMAP_H
29 
30 #include "cge/general.h"
31 #include "common/file.h"
32 
33 namespace CGE {
34 
35 class CGEEngine;
36 class EncryptedStream;
37 
38 #define kMaxPath 128
39 enum {
40  kBmpEOI = 0x0000,
41  kBmpSKP = 0x4000,
42  kBmpREP = 0x8000,
43  kBmpCPY = 0xC000
44 };
45 
46 #include "common/pack-start.h"
47 
48 struct HideDesc {
49  uint16 _skip;
50  uint16 _hide;
51 } PACKED_STRUCT;
52 
53 #include "common/pack-end.h"
54 
55 class Bitmap {
56  CGEEngine *_vm;
57  char *forceExt(char *buf, const char *name, const char *ext);
58  bool loadVBM(EncryptedStream *f);
59 public:
60  uint16 _w;
61  uint16 _h;
62  uint8 *_m;
63  uint8 *_v;
64  int32 _map;
65  HideDesc *_b;
66 
67  Bitmap(CGEEngine *vm, const char *fname);
68  Bitmap(CGEEngine *vm, uint16 w, uint16 h, uint8 *map);
69  Bitmap(CGEEngine *vm, uint16 w, uint16 h, uint8 fill);
70  Bitmap(CGEEngine *vm, const Bitmap &bmp);
71  ~Bitmap();
72 
73  Bitmap *code();
74  Bitmap &operator=(const Bitmap &bmp);
75  void hide(int16 x, int16 y);
76  void show(int16 x, int16 y);
77  void xShow(int16 x, int16 y);
78  bool solidAt(int16 x, int16 y);
79 };
80 
81 
82 typedef Bitmap *BitmapPtr;
83 
84 } // End of namespace CGE
85 
86 #endif
Definition: cge.h:127
Definition: bitmap.h:55
Definition: fileio.h:98
signed char * fill(signed char *first, signed char *last, Value val)
Definition: algorithm.h:111
Definition: bitmap.h:33
Definition: bitmap.h:48