summaryrefslogtreecommitdiff
path: root/source/win_swimp.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-11-13 18:58:41 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-11-13 18:58:41 +0000
commitbbefa87db18f5b76dc67efa00b7cc798361480f3 (patch)
treeefc130fe3b4fe22f111154a8720491b756daa7bd /source/win_swimp.c
parentd65e02496cd9873f5bb0297661b19762b44ddfec (diff)
Hacked the source to get it compile on Windows Mobile using CeGCC toolchain.
Fixed nasty memory corruption bug in UI scripts loading code. Fixed software refresh compilation issues on Windows. Inactive MVD channels are now completely destroyed and recreated once they are active again, and they are no longer allowed to stay in waiting state forever. Fixed delay buffer overflow resulting in fatal connection error. Preserve MVD stream flags in demos recorded on GTV server, and handle `inuse' flag correctly on players when writing gamestate. Updated documentation and Debian package descriptions.
Diffstat (limited to 'source/win_swimp.c')
-rw-r--r--source/win_swimp.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/source/win_swimp.c b/source/win_swimp.c
index 0aaf245..be4edfa 100644
--- a/source/win_swimp.c
+++ b/source/win_swimp.c
@@ -94,9 +94,11 @@ SWimp_Shutdown
System specific graphics subsystem shutdown routine.
Destroys DIB surfaces as appropriate.
*/
-static void SWimp_Shutdown( void ) {
+void VID_Shutdown( void ) {
if ( sww.palettized ) {
+#ifndef __COREDLL__
SetSystemPaletteUse( win.dc, SYSPAL_STATIC );
+#endif
SetSysColors( NUM_SYS_COLORS, s_syspalindices, sww.oldsyscolors );
}
@@ -187,7 +189,7 @@ SWimp_Init
This routine is responsible for initializing the implementation
specific stuff in a software rendering subsystem.
*/
-static qboolean SWimp_Init( void ) {
+qboolean VID_Init( void ) {
int i;
// create the window
@@ -219,11 +221,11 @@ static qboolean SWimp_Init( void ) {
fail:
Com_Printf( "GetLastError() = %#lx", GetLastError() );
- SWimp_Shutdown();
+ VID_Shutdown();
return qfalse;
}
-static void SWimp_BeginFrame( void ) {
+void VID_BeginFrame( void ) {
}
/*
@@ -232,7 +234,7 @@ SWimp_EndFrame
This does an implementation specific copy from the backbuffer to the
front buffer. In the Win32 case it uses BitBlt if we're using DIB sections/GDI.
*/
-static void SWimp_EndFrame( void ) {
+void VID_EndFrame( void ) {
BitBlt( win.dc, 0, 0, win.rc.width, win.rc.height, sww.dibdc, 0, 0, SRCCOPY );
}
@@ -249,7 +251,7 @@ G = offset 1
B = offset 2
A = offset 3
*/
-static void SWimp_UpdatePalette( const byte *_pal ) {
+void VID_UpdatePalette( const byte *_pal ) {
const byte *pal = _pal;
RGBQUAD colors[256];
int i;
@@ -284,9 +286,11 @@ static void SWimp_UpdatePalette( const byte *_pal ) {
identitypalette_t ipal;
LOGPALETTE *pLogPal = ( LOGPALETTE * )&ipal;
+#ifndef __COREDLL__
if ( SetSystemPaletteUse( win.dc, SYSPAL_NOSTATIC ) == SYSPAL_ERROR ) {
Com_Error( ERR_FATAL, "DIB_SetPalette: SetSystemPaletteUse() failed\n" );
}
+#endif
// destroy our old palette
if ( sww.pal ) {
@@ -331,18 +335,4 @@ static void SWimp_UpdatePalette( const byte *_pal ) {
}
}
-/*
-@@@@@@@@@@@@
-VID_FillSWAPI
-@@@@@@@@@@@@
-*/
-void VID_FillSWAPI( videoAPI_t *api ) {
- api->Init = SWimp_Init;
- api->Shutdown = SWimp_Shutdown;
- api->UpdateGamma = Win_UpdateGamma;
- api->UpdatePalette = SWimp_UpdatePalette;
- api->GetProcAddr = NULL;
- api->BeginFrame = SWimp_BeginFrame;
- api->EndFrame = SWimp_EndFrame;
-}