5 void Quit (const char *error
,...);
7 //===========================================================================
12 //===========================================================================
14 extern SDL_Surface
*screen
, *screenBuffer
, *curSurface
;
16 extern boolean fullscreen
, usedoublebuffering
;
17 extern unsigned screenWidth
, screenHeight
, screenBits
, screenPitch
, bufferPitch
, curPitch
;
18 extern unsigned scaleFactor
;
20 extern boolean screenfaded
;
21 extern unsigned bordercolor
;
23 extern SDL_Color gamepal
[256];
25 //===========================================================================
28 // VGA hardware routines
31 #define VL_WaitVBL(a) SDL_Delay((a)*8)
33 void VL_SetVGAPlaneMode (void);
34 void VL_SetTextMode (void);
35 void VL_Shutdown (void);
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
);
46 byte
*VL_LockSurface(SDL_Surface
*surface
);
47 void VL_UnlockSurface(SDL_Surface
*surface
);
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
)
56 VL_BarScaledCoord(scaleFactor
*x
, scaleFactor
*y
,
57 scaleFactor
*width
, scaleFactor
*height
, color
);
59 void inline VL_ClearScreen(int color
)
61 SDL_FillRect(curSurface
, NULL
, color
);
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
);
73 void inline VL_MemToScreen (byte
*source
, int width
, int height
, int x
, int y
)
75 VL_MemToScreenScaledCoord(source
, width
, height
,
76 scaleFactor
*x
, scaleFactor
*y
);
79 void VL_MaskedToScreen (byte
*source
, int width
, int height
, int x
, int y
);
81 void VL_LatchToScreenScaledCoord (SDL_Surface
*source
, int xsrc
, int ysrc
,
82 int width
, int height
, int scxdest
, int scydest
);
84 void inline VL_LatchToScreen (SDL_Surface
*source
, int xsrc
, int ysrc
,
85 int width
, int height
, int xdest
, int ydest
)
87 VL_LatchToScreenScaledCoord(source
,xsrc
,ysrc
,width
,height
,
88 scaleFactor
*xdest
,scaleFactor
*ydest
);
90 void inline VL_LatchToScreenScaledCoord (SDL_Surface
*source
, int scx
, int scy
)
92 VL_LatchToScreenScaledCoord(source
,0,0,source
->w
,source
->h
,scx
,scy
);
94 void inline VL_LatchToScreen (SDL_Surface
*source
, int x
, int y
)
96 VL_LatchToScreenScaledCoord(source
,0,0,source
->w
,source
->h
,
97 scaleFactor
*x
,scaleFactor
*y
);