Mercurial > sdl-ios-xcode
diff src/video/riscos/SDL_riscosmouse.c @ 1668:4da1ee79c9af SDL-1.3
more tweaking indent options
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 29 May 2006 04:04:35 +0000 |
parents | 782fd950bd46 |
children |
line wrap: on
line diff
--- a/src/video/riscos/SDL_riscosmouse.c Mon May 29 03:53:21 2006 +0000 +++ b/src/video/riscos/SDL_riscosmouse.c Mon May 29 04:04:35 2006 +0000 @@ -50,22 +50,22 @@ static int cursor_palette_saved = 0; -void WIMP_SaveCursorPalette (); -void WIMP_RestoreWimpCursor (); -void WIMP_SetSDLCursorPalette (); +void WIMP_SaveCursorPalette(); +void WIMP_RestoreWimpCursor(); +void WIMP_SetSDLCursorPalette(); void -RISCOS_FreeWMCursor (_THIS, WMcursor * cursor) +RISCOS_FreeWMCursor(_THIS, WMcursor * cursor) { - SDL_free (cursor->data); - SDL_free (cursor); + SDL_free(cursor->data); + SDL_free(cursor); } WMcursor * -RISCOS_CreateWMCursor (_THIS, - Uint8 * data, Uint8 * mask, int w, int h, int hot_x, - int hot_y) +RISCOS_CreateWMCursor(_THIS, + Uint8 * data, Uint8 * mask, int w, int h, int hot_x, + int hot_y) { WMcursor *cursor; Uint8 *cursor_data; @@ -75,22 +75,22 @@ /* Check to make sure the cursor size is okay */ if ((w > 32) || (h > 32)) { - SDL_SetError ("Only with width and height <= 32 pixels are allowed"); + SDL_SetError("Only with width and height <= 32 pixels are allowed"); return (NULL); } /* Allocate the cursor */ - cursor = (WMcursor *) SDL_malloc (sizeof (*cursor)); + cursor = (WMcursor *) SDL_malloc(sizeof(*cursor)); if (cursor == NULL) { - SDL_SetError ("Out of memory"); + SDL_SetError("Out of memory"); return (NULL); } /* Note: SDL says width must be a multiple of 8 */ - cursor_data = SDL_malloc (w / 4 * h); + cursor_data = SDL_malloc(w / 4 * h); if (cursor_data == NULL) { - SDL_free (cursor); - SDL_SetError ("Out of memory"); + SDL_free(cursor); + SDL_SetError("Out of memory"); return (NULL); } @@ -137,12 +137,12 @@ } int -RISCOS_ShowWMCursor (_THIS, WMcursor * cursor) +RISCOS_ShowWMCursor(_THIS, WMcursor * cursor) { current_cursor = cursor; if (cursor == NULL) { - _kernel_osbyte (106, 0, 0); + _kernel_osbyte(106, 0, 0); defined_cursor = NULL; } else { WMcursor *old_cursor = defined_cursor; @@ -161,8 +161,8 @@ cursor_def[8] = ((int) (cursor->data) >> 16) & 0xFF; /* ... */ cursor_def[9] = ((int) (cursor->data) >> 24) & 0xFF; /* Most significant byte of pointer to data */ - if (_kernel_osword (21, (int *) cursor_def) != 0) { - SDL_SetError ("RISCOS couldn't create the cursor to show"); + if (_kernel_osword(21, (int *) cursor_def) != 0) { + SDL_SetError("RISCOS couldn't create the cursor to show"); return (0); } defined_cursor = cursor; @@ -171,19 +171,19 @@ if (old_cursor == NULL) { /* First time or reshow in window, so save/setup palette */ if (!cursor_palette_saved) { - WIMP_SaveCursorPalette (); + WIMP_SaveCursorPalette(); } - WIMP_SetSDLCursorPalette (); + WIMP_SetSDLCursorPalette(); } - _kernel_osbyte (106, 2, 0); + _kernel_osbyte(106, 2, 0); } return (1); } void -FULLSCREEN_WarpWMCursor (_THIS, Uint16 x, Uint16 y) +FULLSCREEN_WarpWMCursor(_THIS, Uint16 x, Uint16 y) { Uint8 move_block[5]; int eig_block[3]; @@ -196,7 +196,7 @@ regs.r[0] = (int) eig_block; regs.r[1] = (int) eig_block; - _kernel_swi (OS_ReadVduVariables, ®s, ®s); + _kernel_swi(OS_ReadVduVariables, ®s, ®s); os_x = x << eig_block[0]; os_y = y << eig_block[1]; @@ -207,22 +207,22 @@ move_block[3] = os_y & 0xFF; move_block[4] = (os_y >> 8) & 0xFF; - _kernel_osword (21, (int *) move_block); - SDL_PrivateMouseMotion (0, 0, x, y); + _kernel_osword(21, (int *) move_block); + SDL_PrivateMouseMotion(0, 0, x, y); } /* Reshow cursor when mouse re-enters the window */ void -WIMP_ReshowCursor (_THIS) +WIMP_ReshowCursor(_THIS) { defined_cursor = NULL; cursor_palette_saved = 0; - RISCOS_ShowWMCursor (this, current_cursor); + RISCOS_ShowWMCursor(this, current_cursor); } void -WIMP_WarpWMCursor (_THIS, Uint16 x, Uint16 y) +WIMP_WarpWMCursor(_THIS, Uint16 x, Uint16 y) { _kernel_swi_regs regs; int window_state[9]; @@ -231,7 +231,7 @@ window_state[0] = this->hidden->window_handle; regs.r[1] = (unsigned int) window_state; - _kernel_swi (Wimp_GetWindowState, ®s, ®s); + _kernel_swi(Wimp_GetWindowState, ®s, ®s); osX = (x << this->hidden->xeig) + window_state[1]; osY = window_state[4] - (y << this->hidden->yeig); @@ -244,15 +244,15 @@ regs.r[0] = 21; regs.r[1] = (int) block; - _kernel_swi (OS_Word, ®s, ®s); - SDL_PrivateMouseMotion (0, 0, x, y); + _kernel_swi(OS_Word, ®s, ®s); + SDL_PrivateMouseMotion(0, 0, x, y); } int -WIMP_ShowWMCursor (_THIS, WMcursor * cursor) +WIMP_ShowWMCursor(_THIS, WMcursor * cursor) { if (mouseInWindow) - return RISCOS_ShowWMCursor (this, cursor); + return RISCOS_ShowWMCursor(this, cursor); else current_cursor = cursor; @@ -260,7 +260,7 @@ } SDL_GrabMode -RISCOS_GrabInput (_THIS, SDL_GrabMode mode) +RISCOS_GrabInput(_THIS, SDL_GrabMode mode) { /* In fullscreen mode we don't need to do anything */ if (mode < SDL_GRAB_FULLSCREEN) { @@ -288,7 +288,7 @@ *((int *) window_state) = this->hidden->window_handle; regs.r[1] = (unsigned int) window_state; - _kernel_swi (Wimp_GetWindowState, ®s, ®s); + _kernel_swi(Wimp_GetWindowState, ®s, ®s); block[1] = window_state[4]; block[2] = window_state[5]; @@ -303,7 +303,7 @@ regs.r[0] = 21; /* OS word code */ regs.r[1] = (int) block; - _kernel_swi (OS_Word, ®s, ®s); + _kernel_swi(OS_Word, ®s, ®s); } return mode; @@ -313,7 +313,7 @@ defining a cursor */ void -WIMP_SaveCursorPalette () +WIMP_SaveCursorPalette() { _kernel_swi_regs regs; int colour; @@ -322,7 +322,7 @@ regs.r[0] = (int) wimp_cursor_palette[colour][0]; regs.r[1] = 25; /* Read settings with OS_ReadPalette */ - if (_kernel_swi (0x2f, ®s, ®s) == NULL) { + if (_kernel_swi(0x2f, ®s, ®s) == NULL) { wimp_cursor_palette[colour][2] = (unsigned char) ((regs.r[2] >> 8) & 0xFF); wimp_cursor_palette[colour][3] = @@ -337,17 +337,17 @@ /* Restore the WIMP's cursor when we leave the SDL window */ void -WIMP_RestoreWimpCursor () +WIMP_RestoreWimpCursor() { int colour; /* Reset to pointer shape 1 */ - _kernel_osbyte (106, 1, 0); + _kernel_osbyte(106, 1, 0); /* Reset pointer colours */ if (cursor_palette_saved) { for (colour = 0; colour < 2; colour++) { - _kernel_osword (12, (int *) wimp_cursor_palette[colour]); + _kernel_osword(12, (int *) wimp_cursor_palette[colour]); } } cursor_palette_saved = 0; @@ -355,7 +355,7 @@ /* Set palette used for SDL mouse cursors */ void -WIMP_SetSDLCursorPalette () +WIMP_SetSDLCursorPalette() { /* First time set up the mouse colours */ Uint8 block[5]; @@ -366,7 +366,7 @@ block[2] = 255; /* red component */ block[3] = 255; /* green component */ block[4] = 255; /* blue component */ - _kernel_osword (12, (int *) block); + _kernel_osword(12, (int *) block); /* Set colour 3 to back */ block[0] = 3; /* Colour to change 1 - 3 */ @@ -374,7 +374,7 @@ block[2] = 0; /* red component */ block[3] = 0; /* green component */ block[4] = 0; /* blue component */ - _kernel_osword (12, (int *) block); + _kernel_osword(12, (int *) block); } /* vi: set ts=4 sw=4 expandtab: */