]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_sdl.c
reworked transparency in palettes, made palette_complete be strictly opaque, added...
[xonotic/darkplaces.git] / vid_sdl.c
index 4906819bc2b362b0fd5e03b530cf5d214700d42b..e5c844e5362718c3aeb0ae943bc47e05716a77cb 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -23,6 +23,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 // Tell startup code that we have a client
 int cl_available = true;
+
+qboolean vid_supportrefreshrate = false;
+
 static qboolean vid_usingmouse;
 static qboolean vid_isfullscreen;
 
@@ -251,6 +254,26 @@ static int Sys_EventFilter( SDL_Event *event )
 #endif
 }
 
+static keynum_t buttonremap[16] =
+{
+       K_MOUSE1,
+       K_MOUSE3,
+       K_MOUSE2,
+       K_MOUSE4,
+       K_MOUSE5,
+       K_MOUSE6,
+       K_MOUSE7,
+       K_MOUSE8,
+       K_MOUSE9,
+       K_MOUSE10,
+       K_MOUSE11,
+       K_MOUSE12,
+       K_MOUSE13,
+       K_MOUSE14,
+       K_MOUSE15,
+       K_MOUSE16,
+};
+
 void Sys_SendKeyEvents( void )
 {
        SDL_Event event;
@@ -274,18 +297,12 @@ void Sys_SendKeyEvents( void )
                                }
                                break;
                        case SDL_MOUSEBUTTONDOWN:
-                               if( event.button.button == SDL_BUTTON_MIDDLE )
-                                       event.button.button = SDL_BUTTON_RIGHT;
-                               else if( event.button.button == SDL_BUTTON_RIGHT )
-                                       event.button.button = SDL_BUTTON_MIDDLE;
-                               Key_Event( K_MOUSE1 + event.button.button - 1, 0, true );
+                               if (event.button.button <= 16)
+                                       Key_Event( buttonremap[event.button.button - 1], 0, true );
                                break;
                        case SDL_MOUSEBUTTONUP:
-                               if( event.button.button == SDL_BUTTON_MIDDLE )
-                                       event.button.button = SDL_BUTTON_RIGHT;
-                               else if( event.button.button == SDL_BUTTON_RIGHT )
-                                       event.button.button = SDL_BUTTON_MIDDLE;
-                               Key_Event( K_MOUSE1 + event.button.button - 1, 0, false );
+                               if (event.button.button <= 16)
+                                       Key_Event( buttonremap[event.button.button - 1], 0, false );
                                break;
                }
 }
@@ -346,7 +363,7 @@ static void VID_OutputVersion()
                                        version->major, version->minor, version->patch );
 }
 
-int VID_InitMode(int fullscreen, int width, int height, int bpp)
+int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate)
 {
        int i;
        int flags = SDL_OPENGL;