void Surface::vfunc_DisplayFormat (SDL_Surface * (*func) (SDL_Surface *)) { SDL_Surface *tmp = NULL; tmp = func (surface); validPtr(tmp); SDL_FreeSurface (surface); surface = tmp; }
void Surface::ConvertSurface (const Surface & s, Uint32 flag) { SDL_Surface *tmp = NULL; tmp = SDL_ConvertSurface (surface, s.surface->format, flag); SDL_FreeSurface (surface); surface = tmp; validPtr (surface); }
void Surface::Resize (int width, int height) { SDL_Surface *tmp = SDL_CreateRGBSurface (surface->flags, width, height, surface->format->BitsPerPixel, 0, 0, 0, 0); validPtr (tmp); SDL_BlitSurface (surface, NULL, tmp, NULL); SDL_FreeSurface (surface); surface = tmp; }
void verifyHeap(heapPo H) { for (termPo t = H->start; t < H->curr;) { clssPo clss = classOf(t); if (isSpecialClass(clss)) { specialClassPo sClass = (specialClassPo) clss; t = sClass->scanFun(sClass, verifyScanHelper, H, t); } else { normalPo trm = C_TERM(t); labelPo lbl = C_LBL((termPo) clss); for (integer ix = 0; ix < labelArity(lbl); ix++) { validPtr(H, trm->args[ix]); } t = t + termSize(trm); } } }
static retCode verifyScanHelper(ptrPo arg, void *c) { heapPo H = (heapPo) c; validPtr(H, *arg); return Ok; }
Surface::Surface (SDL_Surface * s) { validPtr (s); surface = s; }