1 //=============================================================================
2 //
3 // Adventure Game Studio (AGS)
4 //
5 // Copyright (C) 1999-2011 Chris Jones and 2011-20xx others
6 // The full list of copyright holders can be found in the Copyright.txt
7 // file, which is part of this source code distribution.
8 //
9 // The AGS source code is provided under the Artistic License 2.0.
10 // A copy of this license can be found in the file License.txt and at
11 // http://www.opensource.org/licenses/artistic-license-2.0.php
12 //
13 //=============================================================================
14 //
15 // WGT -> Allegro portability interface
16 //
17 // wsavesprites and wloadsprites are hi-color compliant
18 //
19 //=============================================================================
20 
21 #define _WGT45_
22 
23 #ifndef __WGT4_H
24 #define __WGT4_H
25 
26 #include "allegro.h"
27 #ifdef WINDOWS_VERSION
28 #include "winalleg.h"
29 #endif
30 
31 namespace AGS { namespace Common { class Bitmap; }}
32 using namespace AGS; // FIXME later
33 
34 
35 #if defined WGT2ALLEGRO_NOFUNCTIONS
36 #error WGT2ALLEGRO_NOFUNCTIONS macro is obsolete and should not be defined anymore.
37 #endif
38 
39 #define color RGB
40 
41 //=============================================================================
42 
43 extern Common::Bitmap *SetVirtualScreen(Common::Bitmap *nss);
44 // CHECKME: temporary solution for plugin system
45 extern Common::Bitmap *SetVirtualScreenRaw(BITMAP *nss);
46 // Not physically a screen bitmap, but rather what counts as one at this moment
47 extern Common::Bitmap *GetVirtualScreen();
48 
49 // [IKM] 2012-09-13: this function is now defined in engine and editor separately
50 extern void __my_setcolor(int *ctset, int newcol, int wantColDep);
51 
52 #ifdef __cplusplus
53 extern "C"
54 {
55 #endif
56 
57     extern void wsetrgb(int coll, int r, int g, int b, color * pall);
58     extern void wcolrotate(unsigned char start, unsigned char finish, int dir, color * pall);
59 
60     extern Common::Bitmap *wnewblock(Common::Bitmap *src, int x1, int y1, int x2, int y2);
61 
62     extern int wloadsprites(color * pall, char *filnam, Common::Bitmap ** sarray, int strt, int eend);
63 
64     extern void wputblock(Common::Bitmap *ds, int xx, int yy, Common::Bitmap *bll, int xray);
65 	// CHECKME: temporary solution for plugin system
66 	extern void wputblock_raw(Common::Bitmap *ds, int xx, int yy, BITMAP *bll, int xray);
67     extern const int col_lookups[32];
68 
69     //extern void wsetcolor(int nval);
70 
71     extern int __wremap_keep_transparent;
72     extern void wremap(color * pal1, Common::Bitmap *picc, color * pal2);
73     extern void wremapall(color * pal1, Common::Bitmap *picc, color * pal2);
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #define XRAY    1
80 #define NORMAL  0
81 
82 // archive attributes to search for - al_findfirst breaks with 0
83 #define FA_SEARCH -1
84 
85 #if defined (WINDOWS_VERSION)
86 #undef CreateFile  // undef the declaration from winbase.h
87 #endif
88 
89 #endif // __WGT4_H
90