wined3d: Fix lack of indent in PreLoad.

This commit is contained in:
Roderick Colenbrander 2008-02-18 21:34:29 +01:00 committed by Alexandre Julliard
parent ef21f1e85e
commit 28464f9689
1 changed files with 27 additions and 27 deletions

View File

@ -474,35 +474,35 @@ void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface) {
IWineD3DBaseTexture_PreLoad(baseTexture); IWineD3DBaseTexture_PreLoad(baseTexture);
IWineD3DBaseTexture_Release(baseTexture); IWineD3DBaseTexture_Release(baseTexture);
} else { } else {
TRACE("(%p) : About to load surface\n", This); TRACE("(%p) : About to load surface\n", This);
if(!device->isInDraw) { if(!device->isInDraw) {
ActivateContext(device, device->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); ActivateContext(device, device->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
}
ENTER_GL();
glEnable(This->glDescription.target);/* make sure texture support is enabled in this context */
if (!This->glDescription.level) {
if (!This->glDescription.textureName) {
glGenTextures(1, &This->glDescription.textureName);
checkGLcall("glGenTextures");
TRACE("Surface %p given name %d\n", This, This->glDescription.textureName);
} }
glBindTexture(This->glDescription.target, This->glDescription.textureName);
checkGLcall("glBindTexture"); ENTER_GL();
IWineD3DSurface_LoadTexture(iface, FALSE); glEnable(This->glDescription.target);/* make sure texture support is enabled in this context */
/* This is where we should be reducing the amount of GLMemoryUsed */ if (!This->glDescription.level) {
} else if (This->glDescription.textureName) { /* NOTE: the level 0 surface of a mpmapped texture must be loaded first! */ if (!This->glDescription.textureName) {
/* assume this is a coding error not a real error for now */ glGenTextures(1, &This->glDescription.textureName);
FIXME("Mipmap surface has a glTexture bound to it!\n"); checkGLcall("glGenTextures");
} TRACE("Surface %p given name %d\n", This, This->glDescription.textureName);
if (This->resource.pool == WINED3DPOOL_DEFAULT) { }
/* Tell opengl to try and keep this texture in video ram (well mostly) */ glBindTexture(This->glDescription.target, This->glDescription.textureName);
GLclampf tmp; checkGLcall("glBindTexture");
tmp = 0.9f; IWineD3DSurface_LoadTexture(iface, FALSE);
glPrioritizeTextures(1, &This->glDescription.textureName, &tmp); /* This is where we should be reducing the amount of GLMemoryUsed */
} } else if (This->glDescription.textureName) { /* NOTE: the level 0 surface of a mpmapped texture must be loaded first! */
LEAVE_GL(); /* assume this is a coding error not a real error for now */
FIXME("Mipmap surface has a glTexture bound to it!\n");
}
if (This->resource.pool == WINED3DPOOL_DEFAULT) {
/* Tell opengl to try and keep this texture in video ram (well mostly) */
GLclampf tmp;
tmp = 0.9f;
glPrioritizeTextures(1, &This->glDescription.textureName, &tmp);
}
LEAVE_GL();
} }
return; return;
} }