static void StoreSurfaces( StoreInfo *info ) { OBJ2 *obj = info->obj; LWSurfaceFuncs *surff = info->surff; LWObjectFuncs *objfunc = info->objfunc; const char *name = NULL; const char *filename, *object; LWSurfaceID surfID; int size; U1 *buff; filename = (*objfunc->filename)( info->obj_no ); if (filename == NULL) { filename = (*objfunc->refName)( info->obj_no ); } surfID = (*surff->first)(); buff = (U1 *) malloc( 32767 ); while (surfID) { name = (*surff->name)( surfID ); object = (*surff->sceneObject)( surfID ); if ((filename == NULL && object == NULL) || (filename && object && strcmp( object, filename ) == 0)) { (*obj->newSurf)( obj, (char *) name ); size = FetchSurface( info, surfID, buff ); (*obj->setSurf)( obj, (char *) name, size, buff ); } surfID = (*surff->next)( surfID ); } if (buff) free( buff ); }
GSTexture* GSDevice::CreateOffscreen(int w, int h, int format) { return FetchSurface(GSTexture::Offscreen, w, h, false, format); }
GSTexture* GSDevice::CreateTexture(int w, int h, int format) { return FetchSurface(GSTexture::Texture, w, h, false, format); }
GSTexture* GSDevice::CreateDepthStencil(int w, int h, bool msaa, int format) { return FetchSurface(GSTexture::DepthStencil, w, h, msaa, format); }
GSTexture* GSDevice::CreateRenderTarget(int w, int h, bool msaa, int format) { return FetchSurface(GSTexture::RenderTarget, w, h, msaa, format); }