Mercurial > sdl-ios-xcode
diff src/video/photon/SDL_ph_image.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/photon/SDL_ph_image.c Mon May 29 03:53:21 2006 +0000 +++ b/src/video/photon/SDL_ph_image.c Mon May 29 04:04:35 2006 +0000 @@ -33,7 +33,7 @@ #include "SDL_ph_gl.h" int -ph_SetupImage (_THIS, SDL_Surface * screen) +ph_SetupImage(_THIS, SDL_Surface * screen) { PgColor_t *palette = NULL; int type = 0; @@ -70,7 +70,7 @@ break; default: { - SDL_SetError ("ph_SetupImage(): unsupported bpp=%d !\n", bpp); + SDL_SetError("ph_SetupImage(): unsupported bpp=%d !\n", bpp); return -1; } break; @@ -79,28 +79,28 @@ /* palette emulation code */ if ((bpp == 8) && (desktoppal == SDLPH_PAL_EMULATE)) { /* creating image palette */ - palette = SDL_malloc (_Pg_MAX_PALETTE * sizeof (PgColor_t)); + palette = SDL_malloc(_Pg_MAX_PALETTE * sizeof(PgColor_t)); if (palette == NULL) { SDL_SetError ("ph_SetupImage(): can't allocate memory for palette !\n"); return -1; } - PgGetPalette (palette); + PgGetPalette(palette); /* using shared memory for speed (set last param to 1) */ if ((SDL_Image = - PhCreateImage (NULL, screen->w, screen->h, type, palette, - _Pg_MAX_PALETTE, 1)) == NULL) { + PhCreateImage(NULL, screen->w, screen->h, type, palette, + _Pg_MAX_PALETTE, 1)) == NULL) { SDL_SetError ("ph_SetupImage(): PhCreateImage() failed for bpp=8 !\n"); - SDL_free (palette); + SDL_free(palette); return -1; } } else { /* using shared memory for speed (set last param to 1) */ if ((SDL_Image = - PhCreateImage (NULL, screen->w, screen->h, type, NULL, 0, - 1)) == NULL) { + PhCreateImage(NULL, screen->w, screen->h, type, NULL, 0, + 1)) == NULL) { SDL_SetError ("ph_SetupImage(): PhCreateImage() failed for bpp=%d !\n", bpp); @@ -117,7 +117,7 @@ } int -ph_SetupOCImage (_THIS, SDL_Surface * screen) +ph_SetupOCImage(_THIS, SDL_Surface * screen) { int type = 0; int bpp; @@ -155,7 +155,7 @@ break; default: { - SDL_SetError ("ph_SetupOCImage(): unsupported bpp=%d !\n", bpp); + SDL_SetError("ph_SetupOCImage(): unsupported bpp=%d !\n", bpp); return -1; } break; @@ -163,8 +163,8 @@ /* Currently offscreen contexts with the same bit depth as display bpp only can be created */ OCImage.offscreen_context = - PdCreateOffscreenContext (0, screen->w, screen->h, - Pg_OSC_MEM_PAGE_ALIGN); + PdCreateOffscreenContext(0, screen->w, screen->h, + Pg_OSC_MEM_PAGE_ALIGN); if (OCImage.offscreen_context == NULL) { SDL_SetError @@ -175,13 +175,12 @@ screen->pitch = OCImage.offscreen_context->pitch; OCImage.dc_ptr = - (unsigned char *) PdGetOffscreenContextPtr (OCImage. - offscreen_context); + (unsigned char *) PdGetOffscreenContextPtr(OCImage.offscreen_context); if (OCImage.dc_ptr == NULL) { SDL_SetError ("ph_SetupOCImage(): PdGetOffscreenContextPtr function failed !\n"); - PhDCRelease (OCImage.offscreen_context); + PhDCRelease(OCImage.offscreen_context); return -1; } @@ -189,7 +188,7 @@ OCImage.CurrentFrameData = OCImage.FrameData0; OCImage.current = 0; - PhDCSetCurrent (OCImage.offscreen_context); + PhDCSetCurrent(OCImage.offscreen_context); screen->pixels = OCImage.CurrentFrameData; @@ -199,25 +198,25 @@ } int -ph_SetupFullScreenImage (_THIS, SDL_Surface * screen) +ph_SetupFullScreenImage(_THIS, SDL_Surface * screen) { OCImage.flags = screen->flags; /* Begin direct and fullscreen mode */ - if (!ph_EnterFullScreen (this, screen, PH_ENTER_DIRECTMODE)) { + if (!ph_EnterFullScreen(this, screen, PH_ENTER_DIRECTMODE)) { return -1; } /* store palette for fullscreen */ if ((screen->format->BitsPerPixel == 8) && (desktopbpp != 8)) { - PgGetPalette (savedpal); - PgGetPalette (syspalph); + PgGetPalette(savedpal); + PgGetPalette(syspalph); } OCImage.offscreen_context = - PdCreateOffscreenContext (0, 0, 0, - Pg_OSC_MAIN_DISPLAY | Pg_OSC_MEM_PAGE_ALIGN - | Pg_OSC_CRTC_SAFE); + PdCreateOffscreenContext(0, 0, 0, + Pg_OSC_MAIN_DISPLAY | Pg_OSC_MEM_PAGE_ALIGN + | Pg_OSC_CRTC_SAFE); if (OCImage.offscreen_context == NULL) { SDL_SetError ("ph_SetupFullScreenImage(): PdCreateOffscreenContext() function failed !\n"); @@ -226,8 +225,8 @@ if ((screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) { OCImage.offscreen_backcontext = - PdDupOffscreenContext (OCImage.offscreen_context, - Pg_OSC_MEM_PAGE_ALIGN | Pg_OSC_CRTC_SAFE); + PdDupOffscreenContext(OCImage.offscreen_context, + Pg_OSC_MEM_PAGE_ALIGN | Pg_OSC_CRTC_SAFE); if (OCImage.offscreen_backcontext == NULL) { SDL_SetError ("ph_SetupFullScreenImage(): PdCreateOffscreenContext(back) function failed !\n"); @@ -236,34 +235,33 @@ } OCImage.FrameData0 = - (unsigned char *) PdGetOffscreenContextPtr (OCImage. - offscreen_context); + (unsigned char *) PdGetOffscreenContextPtr(OCImage.offscreen_context); if (OCImage.FrameData0 == NULL) { SDL_SetError ("ph_SetupFullScreenImage(): PdGetOffscreenContextPtr() function failed !\n"); - ph_DestroyImage (this, screen); + ph_DestroyImage(this, screen); return -1; } if ((screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) { OCImage.FrameData1 = - (unsigned char *) PdGetOffscreenContextPtr (OCImage. - offscreen_backcontext); + (unsigned char *) PdGetOffscreenContextPtr(OCImage. + offscreen_backcontext); if (OCImage.FrameData1 == NULL) { SDL_SetError ("ph_SetupFullScreenImage(back): PdGetOffscreenContextPtr() function failed !\n"); - ph_DestroyImage (this, screen); + ph_DestroyImage(this, screen); return -1; } } /* wait for the hardware */ - PgFlush (); - PgWaitHWIdle (); + PgFlush(); + PgWaitHWIdle(); if ((screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) { OCImage.current = 0; - PhDCSetCurrent (OCImage.offscreen_context); + PhDCSetCurrent(OCImage.offscreen_context); screen->pitch = OCImage.offscreen_context->pitch; screen->pixels = OCImage.FrameData0; @@ -272,19 +270,19 @@ int i; for (i = 0; i < 40; i++) { - SDL_memset (screen->pixels + screen->pitch * i, 0x00, - screen->pitch); + SDL_memset(screen->pixels + screen->pitch * i, 0x00, + screen->pitch); } for (i = 440; i < 480; i++) { - SDL_memset (screen->pixels + screen->pitch * i, 0x00, - screen->pitch); + SDL_memset(screen->pixels + screen->pitch * i, 0x00, + screen->pitch); } screen->pixels += screen->pitch * 40; } - PgSwapDisplay (OCImage.offscreen_backcontext, 0); + PgSwapDisplay(OCImage.offscreen_backcontext, 0); } else { OCImage.current = 0; - PhDCSetCurrent (OCImage.offscreen_context); + PhDCSetCurrent(OCImage.offscreen_context); screen->pitch = OCImage.offscreen_context->pitch; screen->pixels = OCImage.FrameData0; @@ -293,12 +291,12 @@ int i; for (i = 0; i < 40; i++) { - SDL_memset (screen->pixels + screen->pitch * i, 0x00, - screen->pitch); + SDL_memset(screen->pixels + screen->pitch * i, 0x00, + screen->pitch); } for (i = 440; i < 480; i++) { - SDL_memset (screen->pixels + screen->pitch * i, 0x00, - screen->pitch); + SDL_memset(screen->pixels + screen->pitch * i, 0x00, + screen->pitch); } screen->pixels += screen->pitch * 40; } @@ -307,8 +305,8 @@ this->UpdateRects = ph_OCDCUpdate; /* wait for the hardware */ - PgFlush (); - PgWaitHWIdle (); + PgFlush(); + PgWaitHWIdle(); return 0; } @@ -316,7 +314,7 @@ #if SDL_VIDEO_OPENGL int -ph_SetupOpenGLImage (_THIS, SDL_Surface * screen) +ph_SetupOpenGLImage(_THIS, SDL_Surface * screen) { this->UpdateRects = ph_OpenGLUpdate; screen->pixels = NULL; @@ -324,7 +322,7 @@ #if (_NTO_VERSION >= 630) if ((screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) { - if (!ph_EnterFullScreen (this, screen, PH_IGNORE_DIRECTMODE)) { + if (!ph_EnterFullScreen(this, screen, PH_IGNORE_DIRECTMODE)) { screen->flags &= ~SDL_FULLSCREEN; return -1; } @@ -344,19 +342,19 @@ #endif /* SDL_VIDEO_OPENGL */ void -ph_DestroyImage (_THIS, SDL_Surface * screen) +ph_DestroyImage(_THIS, SDL_Surface * screen) { #if SDL_VIDEO_OPENGL if (screen->flags & SDL_INTERNALOPENGL) { if (oglctx) { #if (_NTO_VERSION < 630) - PhDCSetCurrent (NULL); - PhDCRelease (oglctx); + PhDCSetCurrent(NULL); + PhDCRelease(oglctx); #else - qnxgl_context_destroy (oglctx); - qnxgl_buffers_destroy (oglbuffers); - qnxgl_finish (); + qnxgl_context_destroy(oglctx); + qnxgl_buffers_destroy(oglbuffers); + qnxgl_finish(); #endif /* 6.3.0 */ oglctx = NULL; oglbuffers = NULL; @@ -365,7 +363,7 @@ } #if (_NTO_VERSION >= 630) if (currently_fullscreen) { - ph_LeaveFullScreen (this); + ph_LeaveFullScreen(this); } #endif /* 6.3.0 */ @@ -376,21 +374,21 @@ if (currently_fullscreen) { /* if we right now in 8bpp fullscreen we must release palette */ if ((screen->format->BitsPerPixel == 8) && (desktopbpp != 8)) { - PgSetPalette (syspalph, 0, -1, 0, 0, 0); - PgSetPalette (savedpal, 0, 0, _Pg_MAX_PALETTE, - Pg_PALSET_GLOBAL | Pg_PALSET_FORCE_EXPOSE, 0); - PgFlush (); + PgSetPalette(syspalph, 0, -1, 0, 0, 0); + PgSetPalette(savedpal, 0, 0, _Pg_MAX_PALETTE, + Pg_PALSET_GLOBAL | Pg_PALSET_FORCE_EXPOSE, 0); + PgFlush(); } - ph_LeaveFullScreen (this); + ph_LeaveFullScreen(this); } if (OCImage.offscreen_context != NULL) { - PhDCRelease (OCImage.offscreen_context); + PhDCRelease(OCImage.offscreen_context); OCImage.offscreen_context = NULL; OCImage.FrameData0 = NULL; } if (OCImage.offscreen_backcontext != NULL) { - PhDCRelease (OCImage.offscreen_backcontext); + PhDCRelease(OCImage.offscreen_backcontext); OCImage.offscreen_backcontext = NULL; OCImage.FrameData1 = NULL; } @@ -399,10 +397,10 @@ if (SDL_Image) { /* if palette allocated, free it */ if (SDL_Image->palette) { - SDL_free (SDL_Image->palette); + SDL_free(SDL_Image->palette); } - PgShmemDestroy (SDL_Image->image); - SDL_free (SDL_Image); + PgShmemDestroy(SDL_Image->image); + SDL_free(SDL_Image); } /* Must be zeroed everytime */ @@ -414,13 +412,13 @@ } int -ph_UpdateHWInfo (_THIS) +ph_UpdateHWInfo(_THIS) { PgVideoModeInfo_t vmode; PgHWCaps_t hwcaps; /* Update video ram amount */ - if (PgGetGraphicsHWCaps (&hwcaps) < 0) { + if (PgGetGraphicsHWCaps(&hwcaps) < 0) { SDL_SetError ("ph_UpdateHWInfo(): GetGraphicsHWCaps() function failed !\n"); return -1; @@ -428,7 +426,7 @@ this->info.video_mem = hwcaps.currently_available_video_ram / 1024; /* obtain current mode capabilities */ - if (PgGetVideoModeInfo (hwcaps.current_video_mode, &vmode) < 0) { + if (PgGetVideoModeInfo(hwcaps.current_video_mode, &vmode) < 0) { SDL_SetError ("ph_UpdateHWInfo(): GetVideoModeInfo() function failed !\n"); return -1; @@ -478,59 +476,58 @@ } int -ph_SetupUpdateFunction (_THIS, SDL_Surface * screen, Uint32 flags) +ph_SetupUpdateFunction(_THIS, SDL_Surface * screen, Uint32 flags) { int setupresult = -1; - ph_DestroyImage (this, screen); + ph_DestroyImage(this, screen); #if SDL_VIDEO_OPENGL if (flags & SDL_INTERNALOPENGL) { - setupresult = ph_SetupOpenGLImage (this, screen); + setupresult = ph_SetupOpenGLImage(this, screen); } else { #endif if ((flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) { - setupresult = ph_SetupFullScreenImage (this, screen); + setupresult = ph_SetupFullScreenImage(this, screen); } else { if ((flags & SDL_HWSURFACE) == SDL_HWSURFACE) { - setupresult = ph_SetupOCImage (this, screen); + setupresult = ph_SetupOCImage(this, screen); } else { - setupresult = ph_SetupImage (this, screen); + setupresult = ph_SetupImage(this, screen); } } #if SDL_VIDEO_OPENGL } #endif if (setupresult != -1) { - ph_UpdateHWInfo (this); + ph_UpdateHWInfo(this); } return setupresult; } int -ph_AllocHWSurface (_THIS, SDL_Surface * surface) +ph_AllocHWSurface(_THIS, SDL_Surface * surface) { PgHWCaps_t hwcaps; if (surface->hwdata != NULL) { - SDL_SetError ("ph_AllocHWSurface(): hwdata already exists!\n"); + SDL_SetError("ph_AllocHWSurface(): hwdata already exists!\n"); return -1; } - surface->hwdata = SDL_malloc (sizeof (struct private_hwdata)); - SDL_memset (surface->hwdata, 0x00, sizeof (struct private_hwdata)); + surface->hwdata = SDL_malloc(sizeof(struct private_hwdata)); + SDL_memset(surface->hwdata, 0x00, sizeof(struct private_hwdata)); surface->hwdata->offscreenctx = - PdCreateOffscreenContext (0, surface->w, surface->h, - Pg_OSC_MEM_PAGE_ALIGN); + PdCreateOffscreenContext(0, surface->w, surface->h, + Pg_OSC_MEM_PAGE_ALIGN); if (surface->hwdata->offscreenctx == NULL) { SDL_SetError ("ph_AllocHWSurface(): PdCreateOffscreenContext() function failed !\n"); return -1; } - surface->pixels = - PdGetOffscreenContextPtr (surface->hwdata->offscreenctx); + surface->pixels = PdGetOffscreenContextPtr(surface->hwdata->offscreenctx); if (surface->pixels == NULL) { - PhDCRelease (surface->hwdata->offscreenctx); + PhDCRelease(surface->hwdata->offscreenctx); SDL_SetError ("ph_AllocHWSurface(): PdGetOffscreenContextPtr() function failed !\n"); return -1; @@ -545,16 +542,16 @@ if (PdCreateOffscreenLock (surface->hwdata->offscreenctx, &surface->hwdata->crlockparam) != EOK) { - PhDCRelease (surface->hwdata->offscreenctx); - SDL_SetError ("ph_AllocHWSurface(): Can't create offscreen lock !\n"); + PhDCRelease(surface->hwdata->offscreenctx); + SDL_SetError("ph_AllocHWSurface(): Can't create offscreen lock !\n"); return -1; } #endif /* 0 */ /* Update video ram amount */ - if (PgGetGraphicsHWCaps (&hwcaps) < 0) { - PdDestroyOffscreenLock (surface->hwdata->offscreenctx); - PhDCRelease (surface->hwdata->offscreenctx); + if (PgGetGraphicsHWCaps(&hwcaps) < 0) { + PdDestroyOffscreenLock(surface->hwdata->offscreenctx); + PhDCRelease(surface->hwdata->offscreenctx); SDL_SetError ("ph_AllocHWSurface(): GetGraphicsHWCaps() function failed !\n"); return -1; @@ -565,35 +562,34 @@ } void -ph_FreeHWSurface (_THIS, SDL_Surface * surface) +ph_FreeHWSurface(_THIS, SDL_Surface * surface) { PgHWCaps_t hwcaps; if (surface->hwdata == NULL) { - SDL_SetError ("ph_FreeHWSurface(): no hwdata!\n"); + SDL_SetError("ph_FreeHWSurface(): no hwdata!\n"); return; } if (surface->hwdata->offscreenctx == NULL) { - SDL_SetError - ("ph_FreeHWSurface(): no offscreen context to delete!\n"); + SDL_SetError("ph_FreeHWSurface(): no offscreen context to delete!\n"); return; } #if 0 /* FIXME */ /* unlock the offscreen context if it has been locked before destroy it */ - if (PdIsOffscreenLocked (surface->hwdata->offscreenctx) == Pg_OSC_LOCKED) { - PdUnlockOffscreen (surface->hwdata->offscreenctx); + if (PdIsOffscreenLocked(surface->hwdata->offscreenctx) == Pg_OSC_LOCKED) { + PdUnlockOffscreen(surface->hwdata->offscreenctx); } - PdDestroyOffscreenLock (surface->hwdata->offscreenctx); + PdDestroyOffscreenLock(surface->hwdata->offscreenctx); #endif /* 0 */ - PhDCRelease (surface->hwdata->offscreenctx); + PhDCRelease(surface->hwdata->offscreenctx); - SDL_free (surface->hwdata); + SDL_free(surface->hwdata); surface->hwdata = NULL; /* Update video ram amount */ - if (PgGetGraphicsHWCaps (&hwcaps) < 0) { + if (PgGetGraphicsHWCaps(&hwcaps) < 0) { SDL_SetError ("ph_FreeHWSurface(): GetGraphicsHWCaps() function failed !\n"); return; @@ -604,7 +600,7 @@ } int -ph_CheckHWBlit (_THIS, SDL_Surface * src, SDL_Surface * dst) +ph_CheckHWBlit(_THIS, SDL_Surface * src, SDL_Surface * dst) { if ((src->hwdata == NULL) && (src != this->screen)) { SDL_SetError @@ -642,7 +638,7 @@ } PgColor_t -ph_ExpandColor (_THIS, SDL_Surface * surface, Uint32 color) +ph_ExpandColor(_THIS, SDL_Surface * surface, Uint32 color) { Uint32 truecolor; @@ -653,9 +649,9 @@ if ((surface->format->palette) && (color <= surface->format->palette->ncolors)) { truecolor = - PgRGB (surface->format->palette->colors[color].r, - surface->format->palette->colors[color].g, - surface->format->palette->colors[color].b); + PgRGB(surface->format->palette->colors[color].r, + surface->format->palette->colors[color].g, + surface->format->palette->colors[color].b); } else { SDL_SetError ("ph_ExpandColor(): Color out of range for the 8bpp mode !\n"); @@ -706,7 +702,7 @@ } int -ph_FillHWRect (_THIS, SDL_Surface * surface, SDL_Rect * rect, Uint32 color) +ph_FillHWRect(_THIS, SDL_Surface * surface, SDL_Rect * rect, Uint32 color) { PgColor_t oldcolor; Uint32 truecolor; @@ -716,36 +712,36 @@ return -1; } - truecolor = ph_ExpandColor (this, surface, color); + truecolor = ph_ExpandColor(this, surface, color); if (truecolor == 0xFFFFFFFFUL) { return -1; } - oldcolor = PgSetFillColor (truecolor); + oldcolor = PgSetFillColor(truecolor); /* 640x400 videomode emulation */ if (videomode_emulatemode == 1) { ydisp += 40; } - PgDrawIRect (rect->x, rect->y + ydisp, rect->w + rect->x - 1, - rect->h + rect->y + ydisp - 1, Pg_DRAW_FILL); - PgSetFillColor (oldcolor); - PgFlush (); - PgWaitHWIdle (); + PgDrawIRect(rect->x, rect->y + ydisp, rect->w + rect->x - 1, + rect->h + rect->y + ydisp - 1, Pg_DRAW_FILL); + PgSetFillColor(oldcolor); + PgFlush(); + PgWaitHWIdle(); return 0; } int -ph_FlipHWSurface (_THIS, SDL_Surface * screen) +ph_FlipHWSurface(_THIS, SDL_Surface * screen) { PhArea_t farea; if ((screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) { /* flush all drawing ops before blitting */ - PgFlush (); - PgWaitHWIdle (); + PgFlush(); + PgWaitHWIdle(); farea.pos.x = 0; farea.pos.y = 0; @@ -757,18 +753,18 @@ farea.pos.y += 40; } - PgContextBlitArea (OCImage.offscreen_context, &farea, - OCImage.offscreen_backcontext, &farea); + PgContextBlitArea(OCImage.offscreen_context, &farea, + OCImage.offscreen_backcontext, &farea); /* flush the blitting */ - PgFlush (); - PgWaitHWIdle (); + PgFlush(); + PgWaitHWIdle(); } return 0; } int -ph_LockHWSurface (_THIS, SDL_Surface * surface) +ph_LockHWSurface(_THIS, SDL_Surface * surface) { #if 0 /* FIXME */ @@ -781,20 +777,20 @@ surface->hwdata->lockparam.flags = 0; surface->hwdata->lockparam.time_out = NULL; lockresult = - PdLockOffscreen (surface->hwdata->offscreenctx, - &surface->hwdata->lockparam); + PdLockOffscreen(surface->hwdata->offscreenctx, + &surface->hwdata->lockparam); switch (lockresult) { case EOK: break; case Pg_OSC_LOCK_DEADLOCK: - SDL_SetError ("ph_LockHWSurface(): Deadlock detected !\n"); + SDL_SetError("ph_LockHWSurface(): Deadlock detected !\n"); return -1; case Pg_OSC_LOCK_INVALID: - SDL_SetError ("ph_LockHWSurface(): Lock invalid !\n"); + SDL_SetError("ph_LockHWSurface(): Lock invalid !\n"); return -1; default: - SDL_SetError ("ph_LockHWSurface(): Can't lock the surface !\n"); + SDL_SetError("ph_LockHWSurface(): Can't lock the surface !\n"); return -1; } #endif /* 0 */ @@ -803,7 +799,7 @@ } void -ph_UnlockHWSurface (_THIS, SDL_Surface * surface) +ph_UnlockHWSurface(_THIS, SDL_Surface * surface) { #if 0 /* FIXME */ @@ -813,8 +809,8 @@ return; } - if (PdIsOffscreenLocked (surface->hwdata->offscreenctx) == Pg_OSC_LOCKED) { - unlockresult = PdUnlockOffscreen (surface->hwdata->offscreenctx); + if (PdIsOffscreenLocked(surface->hwdata->offscreenctx) == Pg_OSC_LOCKED) { + unlockresult = PdUnlockOffscreen(surface->hwdata->offscreenctx); } #endif /* 0 */ @@ -822,8 +818,8 @@ } int -ph_HWAccelBlit (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, - SDL_Rect * dstrect) +ph_HWAccelBlit(SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, + SDL_Rect * dstrect) { SDL_VideoDevice *this = current_video; PhArea_t srcarea; @@ -848,13 +844,13 @@ if (((src == this->screen) || (src->hwdata != NULL)) && ((dst == this->screen) || (dst->hwdata != NULL))) { if ((src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) { - ph_SetHWColorKey (this, src, src->format->colorkey); - PgChromaOn (); + ph_SetHWColorKey(this, src, src->format->colorkey); + PgChromaOn(); } if ((src->flags & SDL_SRCALPHA) == SDL_SRCALPHA) { - ph_SetHWAlpha (this, src, src->format->alpha); - PgAlphaOn (); + ph_SetHWAlpha(this, src, src->format->alpha); + PgAlphaOn(); } if (dst == this->screen) { @@ -862,33 +858,33 @@ /* blitting from main screen to main screen */ dstarea.pos.y += ydisp; srcarea.pos.y += ydisp; - PgContextBlitArea (OCImage.offscreen_context, &srcarea, - OCImage.offscreen_context, &dstarea); + PgContextBlitArea(OCImage.offscreen_context, &srcarea, + OCImage.offscreen_context, &dstarea); } else { /* blitting from offscreen to main screen */ dstarea.pos.y += ydisp; - PgContextBlitArea (src->hwdata->offscreenctx, &srcarea, - OCImage.offscreen_context, &dstarea); + PgContextBlitArea(src->hwdata->offscreenctx, &srcarea, + OCImage.offscreen_context, &dstarea); } } else { if (src == this->screen) { /* blitting from main screen to offscreen */ srcarea.pos.y += ydisp; - PgContextBlitArea (OCImage.offscreen_context, &srcarea, - dst->hwdata->offscreenctx, &dstarea); + PgContextBlitArea(OCImage.offscreen_context, &srcarea, + dst->hwdata->offscreenctx, &dstarea); } else { /* blitting offscreen to offscreen */ - PgContextBlitArea (src->hwdata->offscreenctx, &srcarea, - dst->hwdata->offscreenctx, &dstarea); + PgContextBlitArea(src->hwdata->offscreenctx, &srcarea, + dst->hwdata->offscreenctx, &dstarea); } } if ((src->flags & SDL_SRCALPHA) == SDL_SRCALPHA) { - PgAlphaOff (); + PgAlphaOff(); } if ((src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) { - PgChromaOff (); + PgChromaOff(); } } else { SDL_SetError @@ -896,55 +892,55 @@ return -1; } - PgFlush (); - PgWaitHWIdle (); + PgFlush(); + PgWaitHWIdle(); return 0; } int -ph_SetHWColorKey (_THIS, SDL_Surface * surface, Uint32 key) +ph_SetHWColorKey(_THIS, SDL_Surface * surface, Uint32 key) { if (this->info.blit_hw_CC != 1) { return -1; } if (surface->hwdata != NULL) { - surface->hwdata->colorkey = ph_ExpandColor (this, surface, key); + surface->hwdata->colorkey = ph_ExpandColor(this, surface, key); if (surface->hwdata->colorkey == 0xFFFFFFFFUL) { return -1; } } - PgSetChroma (surface->hwdata->colorkey, - Pg_CHROMA_SRC_MATCH | Pg_CHROMA_NODRAW); + PgSetChroma(surface->hwdata->colorkey, + Pg_CHROMA_SRC_MATCH | Pg_CHROMA_NODRAW); return 0; } int -ph_SetHWAlpha (_THIS, SDL_Surface * surface, Uint8 alpha) +ph_SetHWAlpha(_THIS, SDL_Surface * surface, Uint8 alpha) { if (this->info.blit_hw_A != 1) { return -1; } - PgSetAlphaBlend (NULL, alpha); + PgSetAlphaBlend(NULL, alpha); return 0; } #if SDL_VIDEO_OPENGL void -ph_OpenGLUpdate (_THIS, int numrects, SDL_Rect * rects) +ph_OpenGLUpdate(_THIS, int numrects, SDL_Rect * rects) { - this->GL_SwapBuffers (this); + this->GL_SwapBuffers(this); return; } #endif /* SDL_VIDEO_OPENGL */ void -ph_NormalUpdate (_THIS, int numrects, SDL_Rect * rects) +ph_NormalUpdate(_THIS, int numrects, SDL_Rect * rects) { PhPoint_t ph_pos; PhRect_t ph_rect; @@ -966,19 +962,19 @@ ph_rect.lr.x = rects[i].x + rects[i].w; ph_rect.lr.y = rects[i].y + rects[i].h; - if (PgDrawPhImageRectmx (&ph_pos, SDL_Image, &ph_rect, 0) < 0) { - SDL_SetError ("ph_NormalUpdate(): PgDrawPhImageRectmx failed!\n"); + if (PgDrawPhImageRectmx(&ph_pos, SDL_Image, &ph_rect, 0) < 0) { + SDL_SetError("ph_NormalUpdate(): PgDrawPhImageRectmx failed!\n"); return; } } - if (PgFlush () < 0) { - SDL_SetError ("ph_NormalUpdate(): PgFlush() function failed!\n"); + if (PgFlush() < 0) { + SDL_SetError("ph_NormalUpdate(): PgFlush() function failed!\n"); } } void -ph_OCUpdate (_THIS, int numrects, SDL_Rect * rects) +ph_OCUpdate(_THIS, int numrects, SDL_Rect * rects) { int i; @@ -986,12 +982,12 @@ PhArea_t src_rect; PhArea_t dest_rect; - PgSetTranslation (&zero, 0); - PgSetRegion (PtWidgetRid (window)); - PgSetClipping (0, NULL); + PgSetTranslation(&zero, 0); + PgSetRegion(PtWidgetRid(window)); + PgSetClipping(0, NULL); - PgFlush (); - PgWaitHWIdle (); + PgFlush(); + PgWaitHWIdle(); for (i = 0; i < numrects; ++i) { if (rects[i].w == 0) { /* Clipped? */ @@ -1012,22 +1008,22 @@ dest_rect.size.w = rects[i].w; dest_rect.size.h = rects[i].h; - PgContextBlitArea (OCImage.offscreen_context, &src_rect, NULL, - &dest_rect); + PgContextBlitArea(OCImage.offscreen_context, &src_rect, NULL, + &dest_rect); } - if (PgFlush () < 0) { - SDL_SetError ("ph_OCUpdate(): PgFlush failed.\n"); + if (PgFlush() < 0) { + SDL_SetError("ph_OCUpdate(): PgFlush failed.\n"); } } void -ph_OCDCUpdate (_THIS, int numrects, SDL_Rect * rects) +ph_OCDCUpdate(_THIS, int numrects, SDL_Rect * rects) { - PgWaitHWIdle (); + PgWaitHWIdle(); - if (PgFlush () < 0) { - SDL_SetError ("ph_OCDCUpdate(): PgFlush failed.\n"); + if (PgFlush() < 0) { + SDL_SetError("ph_OCDCUpdate(): PgFlush failed.\n"); } }