Mercurial > sdl-ios-xcode
diff src/video/cybergfx/SDL_cgxmodes.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/cybergfx/SDL_cgxmodes.c Mon May 29 03:53:21 2006 +0000 +++ b/src/video/cybergfx/SDL_cgxmodes.c Mon May 29 04:04:35 2006 +0000 @@ -33,35 +33,35 @@ #define CGX_DEBUG static void -set_best_resolution (_THIS, int width, int height) +set_best_resolution(_THIS, int width, int height) { Uint32 idok; int depth = 8; if (SDL_Display) depth = - GetCyberMapAttr (SDL_Display->RastPort.BitMap, CYBRMATTR_DEPTH); + GetCyberMapAttr(SDL_Display->RastPort.BitMap, CYBRMATTR_DEPTH); - idok = BestCModeIDTags (CYBRBIDTG_NominalWidth, width, - CYBRBIDTG_NominalHeight, height, - CYBRBIDTG_Depth, depth, TAG_DONE); + idok = BestCModeIDTags(CYBRBIDTG_NominalWidth, width, + CYBRBIDTG_NominalHeight, height, + CYBRBIDTG_Depth, depth, TAG_DONE); if (idok != INVALID_ID) { if (SDL_Display) { if (currently_fullscreen) - CloseScreen (SDL_Display); + CloseScreen(SDL_Display); else - UnlockPubScreen (NULL, SDL_Display); + UnlockPubScreen(NULL, SDL_Display); } SDL_Display = GFX_Display = - OpenScreenTags (NULL, SA_Width, width, SA_Height, height, - SA_Depth, depth, SA_DisplayID, idok, - SA_ShowTitle, FALSE, TAG_DONE); + OpenScreenTags(NULL, SA_Width, width, SA_Height, height, + SA_Depth, depth, SA_DisplayID, idok, + SA_ShowTitle, FALSE, TAG_DONE); } } static void -get_real_resolution (_THIS, int *w, int *h) +get_real_resolution(_THIS, int *w, int *h) { *w = /*SDL_Display->Width */ SDL_Window->Width - SDL_Window->BorderLeft - SDL_Window->BorderRight; @@ -70,7 +70,7 @@ } static void -move_cursor_to (_THIS, int x, int y) +move_cursor_to(_THIS, int x, int y) { /* XWarpPointer(SDL_Display, None, SDL_Root, 0, 0, 0, 0, x, y); */ @@ -78,20 +78,20 @@ } static void -add_visual (_THIS, int depth, int class) +add_visual(_THIS, int depth, int class) { Uint32 tID; - tID = BestCModeIDTags (CYBRBIDTG_Depth, depth, - CYBRBIDTG_NominalWidth, 640, - CYBRBIDTG_NominalHeight, 480, TAG_DONE); + tID = BestCModeIDTags(CYBRBIDTG_Depth, depth, + CYBRBIDTG_NominalWidth, 640, + CYBRBIDTG_NominalHeight, 480, TAG_DONE); if (tID != INVALID_ID) { int n = this->hidden->nvisuals; this->hidden->visuals[n].depth = depth; this->hidden->visuals[n].visual = tID; - this->hidden->visuals[n].bpp = GetCyberIDAttr (CYBRIDATTR_BPPIX, tID); + this->hidden->visuals[n].bpp = GetCyberIDAttr(CYBRIDATTR_BPPIX, tID); this->hidden->nvisuals++; } } @@ -100,7 +100,7 @@ #define PseudoColor 2 int -CGX_GetVideoModes (_THIS) +CGX_GetVideoModes(_THIS) { int i; ULONG nextid; @@ -108,17 +108,17 @@ SDL_modelist = NULL; - nextid = NextDisplayInfo (INVALID_ID); + nextid = NextDisplayInfo(INVALID_ID); while (nextid != INVALID_ID) { - if (IsCyberModeID (nextid)) { + if (IsCyberModeID(nextid)) { DisplayInfoHandle h; - if (h = FindDisplayInfo (nextid)) { + if (h = FindDisplayInfo(nextid)) { struct DimensionInfo info; if (GetDisplayInfoData - (h, (char *) &info, sizeof (struct DimensionInfo), + (h, (char *) &info, sizeof(struct DimensionInfo), DTAG_DIMS, NULL)) { int ok = 0; @@ -132,15 +132,15 @@ nmodes++; SDL_modelist = - (SDL_Rect **) SDL_realloc (SDL_modelist, - (nmodes + - 1) * - sizeof (SDL_Rect *)); + (SDL_Rect **) SDL_realloc(SDL_modelist, + (nmodes + + 1) * + sizeof(SDL_Rect *)); SDL_modelist[nmodes] = NULL; if (SDL_modelist) { SDL_modelist[nmodes - 1] = (SDL_Rect *) - SDL_malloc (sizeof (SDL_Rect)); + SDL_malloc(sizeof(SDL_Rect)); if (SDL_modelist[nmodes - 1] == NULL) break; @@ -156,30 +156,29 @@ } } } - nextid = NextDisplayInfo (nextid); + nextid = NextDisplayInfo(nextid); } this->hidden->nvisuals = 0; /* Search for the visuals in deepest-first order, so that the first will be the richest one */ - add_visual (this, 32, TrueColor); - add_visual (this, 24, TrueColor); - add_visual (this, 16, TrueColor); - add_visual (this, 15, TrueColor); - add_visual (this, 8, PseudoColor); + add_visual(this, 32, TrueColor); + add_visual(this, 24, TrueColor); + add_visual(this, 16, TrueColor); + add_visual(this, 15, TrueColor); + add_visual(this, 8, PseudoColor); if (this->hidden->nvisuals == 0) { - SDL_SetError ("Found no sufficiently capable CGX visuals"); + SDL_SetError("Found no sufficiently capable CGX visuals"); return -1; } if (SDL_modelist == NULL) { - SDL_modelist = - (SDL_Rect **) SDL_malloc ((1 + 1) * sizeof (SDL_Rect *)); + SDL_modelist = (SDL_Rect **) SDL_malloc((1 + 1) * sizeof(SDL_Rect *)); i = 0; if (SDL_modelist) { - SDL_modelist[i] = (SDL_Rect *) SDL_malloc (sizeof (SDL_Rect)); + SDL_modelist[i] = (SDL_Rect *) SDL_malloc(sizeof(SDL_Rect)); if (SDL_modelist[i]) { SDL_modelist[i]->x = 0; SDL_modelist[i]->y = 0; @@ -191,25 +190,25 @@ } } - D (if (SDL_modelist) { - bug ("CGX video mode list: (%ld)\n", nmodes); - for (i = 0; SDL_modelist[i]; ++i) { - bug ("\t%ld x %ld\n", SDL_modelist[i]->w, SDL_modelist[i]->h);} - } + D(if (SDL_modelist) { + bug("CGX video mode list: (%ld)\n", nmodes); + for (i = 0; SDL_modelist[i]; ++i) { + bug("\t%ld x %ld\n", SDL_modelist[i]->w, SDL_modelist[i]->h);} + } ); - D ( { - bug ("CGX visuals list: (%ld)\n", this->hidden->nvisuals); - for (i = 0; i < this->hidden->nvisuals; i++) - bug ("\t%lx - depth: %ld bpp: %ld\n", - this->hidden->visuals[i].visual, - this->hidden->visuals[i].depth, this->hidden->visuals[i].bpp);} + D( { + bug("CGX visuals list: (%ld)\n", this->hidden->nvisuals); + for (i = 0; i < this->hidden->nvisuals; i++) + bug("\t%lx - depth: %ld bpp: %ld\n", + this->hidden->visuals[i].visual, + this->hidden->visuals[i].depth, this->hidden->visuals[i].bpp);} ); return 0; } int -CGX_SupportedVisual (_THIS, SDL_PixelFormat * format) +CGX_SupportedVisual(_THIS, SDL_PixelFormat * format) { int i; for (i = 0; i < this->hidden->nvisuals; i++) { @@ -220,9 +219,9 @@ } SDL_Rect ** -CGX_ListModes (_THIS, SDL_PixelFormat * format, Uint32 flags) +CGX_ListModes(_THIS, SDL_PixelFormat * format, Uint32 flags) { - if (CGX_SupportedVisual (this, format)) { + if (CGX_SupportedVisual(this, format)) { if (flags & SDL_FULLSCREEN) { return (SDL_modelist); } else { @@ -234,21 +233,21 @@ } void -CGX_FreeVideoModes (_THIS) +CGX_FreeVideoModes(_THIS) { int i; if (SDL_modelist) { for (i = 0; SDL_modelist[i]; ++i) { - SDL_free (SDL_modelist[i]); + SDL_free(SDL_modelist[i]); } - SDL_free (SDL_modelist); + SDL_free(SDL_modelist); SDL_modelist = NULL; } } int -CGX_ResizeFullScreen (_THIS) +CGX_ResizeFullScreen(_THIS) { int x, y; int real_w, real_h; @@ -260,12 +259,12 @@ } void -_QueueEnterFullScreen (_THIS) +_QueueEnterFullScreen(_THIS) { } int -CGX_EnterFullScreen (_THIS) +CGX_EnterFullScreen(_THIS) { int okay; Uint32 saved_flags; @@ -277,23 +276,23 @@ int real_w, real_h; /* Map the fullscreen window to blank the screen */ - get_real_resolution (this, &real_w, &real_h); + get_real_resolution(this, &real_w, &real_h); - CGX_DestroyWindow (this, this->screen); - set_best_resolution (this, real_w, real_h); + CGX_DestroyWindow(this, this->screen); + set_best_resolution(this, real_w, real_h); currently_fullscreen = 1; this->screen->flags = saved_flags; - CGX_CreateWindow (this, this->screen, real_w, real_h, - GetCyberMapAttr (SDL_Display->RastPort.BitMap, - CYBRMATTR_DEPTH), - this->screen->flags); + CGX_CreateWindow(this, this->screen, real_w, real_h, + GetCyberMapAttr(SDL_Display->RastPort.BitMap, + CYBRMATTR_DEPTH), + this->screen->flags); /* Set the new resolution */ - okay = CGX_ResizeFullScreen (this); + okay = CGX_ResizeFullScreen(this); if (!okay) { - CGX_LeaveFullScreen (this); + CGX_LeaveFullScreen(this); } /* Set the colormap */ /* @@ -307,26 +306,26 @@ } int -CGX_LeaveFullScreen (_THIS) +CGX_LeaveFullScreen(_THIS) { if (currently_fullscreen) { int width, height; if (SDL_Window) { - CloseWindow (SDL_Window); + CloseWindow(SDL_Window); SDL_Window = NULL; } - CloseScreen (SDL_Display); + CloseScreen(SDL_Display); - GFX_Display = SDL_Display = LockPubScreen (NULL); + GFX_Display = SDL_Display = LockPubScreen(NULL); currently_fullscreen = 0; - CGX_CreateWindow (this, this->screen, this->screen->w, - this->screen->h, - GetCyberMapAttr (SDL_Display->RastPort.BitMap, - CYBRMATTR_DEPTH), - this->screen->flags); - CGX_ResizeImage (this, this->screen, 0L); + CGX_CreateWindow(this, this->screen, this->screen->w, + this->screen->h, + GetCyberMapAttr(SDL_Display->RastPort.BitMap, + CYBRMATTR_DEPTH), + this->screen->flags); + CGX_ResizeImage(this, this->screen, 0L); } return (0);