Rev 9097 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8557 | maxcodehac | 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 | |||
9790 | turbocat | 31 | #define VL_WaitVBL(a) SDL_Delay((a)*8) |
8557 | maxcodehac | 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 | byte VL_GetPixel (int x, int y); |
||
50 | void VL_Plot (int x, int y, int color); |
||
51 | void VL_Hlin (unsigned x, unsigned y, unsigned width, int color); |
||
52 | void VL_Vlin (int x, int y, int height, int color); |
||
53 | void VL_BarScaledCoord (int scx, int scy, int scwidth, int scheight, int color); |
||
54 | void inline VL_Bar (int x, int y, int width, int height, int color) |
||
55 | { |
||
56 | VL_BarScaledCoord(scaleFactor*x, scaleFactor*y, |
||
57 | scaleFactor*width, scaleFactor*height, color); |
||
58 | } |
||
59 | void inline VL_ClearScreen(int color) |
||
60 | { |
||
61 | SDL_FillRect(curSurface, NULL, color); |
||
62 | } |
||
63 | |||
64 | void VL_MungePic (byte *source, unsigned width, unsigned height); |
||
65 | void VL_DrawPicBare (int x, int y, byte *pic, int width, int height); |
||
66 | void VL_MemToLatch (byte *source, int width, int height, |
||
67 | SDL_Surface *destSurface, int x, int y); |
||
68 | void VL_ScreenToScreen (SDL_Surface *source, SDL_Surface *dest); |
||
69 | void VL_MemToScreenScaledCoord (byte *source, int width, int height, int scx, int scy); |
||
70 | void VL_MemToScreenScaledCoord (byte *source, int origwidth, int origheight, int srcx, int srcy, |
||
71 | int destx, int desty, int width, int height); |
||
72 | |||
73 | void inline VL_MemToScreen (byte *source, int width, int height, int x, int y) |
||
74 | { |
||
75 | VL_MemToScreenScaledCoord(source, width, height, |
||
76 | scaleFactor*x, scaleFactor*y); |
||
77 | } |
||
78 | |||
79 | void VL_MaskedToScreen (byte *source, int width, int height, int x, int y); |
||
80 | |||
81 | void VL_LatchToScreenScaledCoord (SDL_Surface *source, int xsrc, int ysrc, |
||
82 | int width, int height, int scxdest, int scydest); |
||
83 | |||
84 | void inline VL_LatchToScreen (SDL_Surface *source, int xsrc, int ysrc, |
||
85 | int width, int height, int xdest, int ydest) |
||
86 | { |
||
87 | VL_LatchToScreenScaledCoord(source,xsrc,ysrc,width,height, |
||
88 | scaleFactor*xdest,scaleFactor*ydest); |
||
89 | } |
||
90 | void inline VL_LatchToScreenScaledCoord (SDL_Surface *source, int scx, int scy) |
||
91 | { |
||
92 | VL_LatchToScreenScaledCoord(source,0,0,source->w,source->h,scx,scy); |
||
93 | } |
||
94 | void inline VL_LatchToScreen (SDL_Surface *source, int x, int y) |
||
95 | { |
||
96 | VL_LatchToScreenScaledCoord(source,0,0,source->w,source->h, |
||
97 | scaleFactor*x,scaleFactor*y); |
||
98 | } |