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 Sfinx source code
24  * Copyright (c) 1994-1997 Janusz B. Wisniewski and L.K. Avalon
25  */
26 
27 #ifndef CGE2_BITMAP_H
28 #define CGE2_BITMAP_H
29 
30 #include "cge2/general.h"
31 #include "common/file.h"
32 
33 namespace CGE2 {
34 
35 class CGE2Engine;
36 class EncryptedStream;
37 class V2D;
38 
39 #define kMaxPath 128
40 
41 enum {
42  kBmpEOI = 0x0000,
43  kBmpSKP = 0x4000,
44  kBmpREP = 0x8000,
45  kBmpCPY = 0xC000
46 };
47 
48 #include "common/pack-start.h"
49 
50 struct HideDesc {
51  uint16 _skip;
52  uint16 _hide;
53 };
54 
55 #include "common/pack-end.h"
56 
57 class Bitmap {
58  CGE2Engine *_vm;
59 
60  Common::String setExtension(const Common::String &str, const Common::String &ext);
61  bool loadVBM(EncryptedStream *f);
62 public:
63  uint16 _w;
64  uint16 _h;
65  uint8 *_v;
66  int32 _map;
67  HideDesc *_b;
68 
69  Bitmap();
70  Bitmap(CGE2Engine *vm, const char *fname);
71  Bitmap(CGE2Engine *vm, uint16 w, uint16 h, uint8 *map);
72  Bitmap(CGE2Engine *vm, uint16 w, uint16 h, uint8 fill);
73  Bitmap(CGE2Engine *vm, const Bitmap &bmp);
74  ~Bitmap();
75 
76  void setVM(CGE2Engine *vm);
77  Bitmap *code(uint8 *map);
78  Bitmap &operator=(const Bitmap &bmp);
79  void release();
80  void hide(V2D pos);
81  void show(V2D pos);
82  bool solidAt(V2D pos);
83  void xLatPos(V2D &p);
84 
85  static uint8 *makeSpeechBubbleTail(int des, uint8 colorSet[][4]);
86 };
87 
88 
89 typedef Bitmap *BitmapPtr;
90 
91 } // End of namespace CGE2
92 
93 #endif // CGE2_BITMAP_H
Definition: cge2.h:149
Definition: str.h:59
Definition: bitmap.h:50
Definition: vga13h.h:94
Definition: fileio.h:105
Definition: bitmap.h:33
Definition: bitmap.h:57
signed char * fill(signed char *first, signed char *last, Value val)
Definition: algorithm.h:168