diff options
Diffstat (limited to 'apps/plugins/sdl/progs/wolf3d/id_vl.h')
-rw-r--r-- | apps/plugins/sdl/progs/wolf3d/id_vl.h | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/apps/plugins/sdl/progs/wolf3d/id_vl.h b/apps/plugins/sdl/progs/wolf3d/id_vl.h new file mode 100644 index 0000000000..d4a15f4d46 --- /dev/null +++ b/apps/plugins/sdl/progs/wolf3d/id_vl.h | |||
@@ -0,0 +1,101 @@ | |||
1 | // ID_VL.H | ||
2 | |||
3 | // wolf compatability | ||
4 | |||
5 | void Quit (const char *error,...); | ||
6 | |||
7 | //=========================================================================== | ||
8 | |||
9 | #define CHARWIDTH 2 | ||
10 | #define TILEWIDTH 4 | ||
11 | |||
12 | //=========================================================================== | ||
13 | |||
14 | extern SDL_Surface *screen, *screenBuffer, *curSurface; | ||
15 | |||
16 | extern boolean fullscreen, usedoublebuffering; | ||
17 | extern unsigned screenWidth, screenHeight, screenBits, screenPitch, bufferPitch, curPitch; | ||
18 | extern unsigned scaleFactor; | ||
19 | |||
20 | extern boolean screenfaded; | ||
21 | extern unsigned bordercolor; | ||
22 | |||
23 | extern SDL_Color gamepal[256]; | ||
24 | |||
25 | //=========================================================================== | ||
26 | |||
27 | // | ||
28 | // VGA hardware routines | ||
29 | // | ||
30 | |||
31 | #define VL_WaitVBL(a) SDL_Delay((a)*8) | ||
32 | |||
33 | void VL_SetVGAPlaneMode (void); | ||
34 | void VL_SetTextMode (void); | ||
35 | void VL_Shutdown (void); | ||
36 | |||
37 | void VL_ConvertPalette(byte *srcpal, SDL_Color *destpal, int numColors); | ||
38 | void VL_FillPalette (int red, int green, int blue); | ||
39 | void VL_SetColor (int color, int red, int green, int blue); | ||
40 | void VL_GetColor (int color, int *red, int *green, int *blue); | ||
41 | void VL_SetPalette (SDL_Color *palette, bool forceupdate); | ||
42 | void VL_GetPalette (SDL_Color *palette); | ||
43 | void VL_FadeOut (int start, int end, int red, int green, int blue, int steps); | ||
44 | void VL_FadeIn (int start, int end, SDL_Color *palette, int steps); | ||
45 | |||
46 | byte *VL_LockSurface(SDL_Surface *surface); | ||
47 | void VL_UnlockSurface(SDL_Surface *surface); | ||
48 | |||
49 | #define LOCK() VL_LockSurface(curSurface) | ||
50 | #define UNLOCK() VL_UnlockSurface(curSurface) | ||
51 | |||
52 | byte VL_GetPixel (int x, int y); | ||
53 | void VL_Plot (int x, int y, int color); | ||
54 | void VL_Hlin (unsigned x, unsigned y, unsigned width, int color); | ||
55 | void VL_Vlin (int x, int y, int height, int color); | ||
56 | void VL_BarScaledCoord (int scx, int scy, int scwidth, int scheight, int color); | ||
57 | inline void VL_Bar (int x, int y, int width, int height, int color) | ||
58 | { | ||
59 | VL_BarScaledCoord(scaleFactor*x, scaleFactor*y, | ||
60 | scaleFactor*width, scaleFactor*height, color); | ||
61 | } | ||
62 | inline void VL_ClearScreen(int color) | ||
63 | { | ||
64 | SDL_FillRect(curSurface, NULL, color); | ||
65 | } | ||
66 | |||
67 | void VL_MungePic (byte *source, unsigned width, unsigned height); | ||
68 | void VL_DrawPicBare (int x, int y, byte *pic, int width, int height); | ||
69 | void VL_MemToLatch (byte *source, int width, int height, | ||
70 | SDL_Surface *destSurface, int x, int y); | ||
71 | void VL_ScreenToScreen (SDL_Surface *source, SDL_Surface *dest); | ||
72 | void VL_MemToScreenScaledCoord (byte *source, int width, int height, int scx, int scy); | ||
73 | void VL_MemToScreenScaledCoord_ex (byte *source, int origwidth, int origheight, int srcx, int srcy, | ||
74 | int destx, int desty, int width, int height); | ||
75 | |||
76 | inline void VL_MemToScreen (byte *source, int width, int height, int x, int y) | ||
77 | { | ||
78 | VL_MemToScreenScaledCoord(source, width, height, | ||
79 | scaleFactor*x, scaleFactor*y); | ||
80 | } | ||
81 | |||
82 | void VL_MaskedToScreen (byte *source, int width, int height, int x, int y); | ||
83 | |||
84 | void VL_LatchToScreenScaledCoord (SDL_Surface *source, int xsrc, int ysrc, | ||
85 | int width, int height, int scxdest, int scydest); | ||
86 | |||
87 | inline void VL_LatchToScreen (SDL_Surface *source, int xsrc, int ysrc, | ||
88 | int width, int height, int xdest, int ydest) | ||
89 | { | ||
90 | VL_LatchToScreenScaledCoord(source,xsrc,ysrc,width,height, | ||
91 | scaleFactor*xdest,scaleFactor*ydest); | ||
92 | } | ||
93 | inline void VL_LatchToScreenScaledCoord_ez (SDL_Surface *source, int scx, int scy) | ||
94 | { | ||
95 | VL_LatchToScreenScaledCoord(source,0,0,source->w,source->h,scx,scy); | ||
96 | } | ||
97 | inline void VL_LatchToScreen_ez (SDL_Surface *source, int x, int y) | ||
98 | { | ||
99 | VL_LatchToScreenScaledCoord(source,0,0,source->w,source->h, | ||
100 | scaleFactor*x,scaleFactor*y); | ||
101 | } | ||