Skip to content

Commit

Permalink
When selecting a list the detail texture (if any) is used when compar…
Browse files Browse the repository at this point in the history
…ing against the primitive to be written. This makes primitives with the same texture to be seen as unique if they have different detail textures and thus they will be added to separate lists (needed for the new debug rendering mode "rend-tex = 2").
  • Loading branch information
danij committed Oct 24, 2006
1 parent 09b0281 commit 7fe2a0c
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 61 deletions.
1 change: 1 addition & 0 deletions doomsday/engine/portable/include/gl_texmanager.h
Expand Up @@ -141,6 +141,7 @@ DGLuint GL_LoadGraphics2(resourceclass_t resClass, const char *name,
gfxmode_t mode, int useMipmap, boolean clamped);
DGLuint GL_GetTextureInfo(int index);
DGLuint GL_GetTextureInfo2(int index, boolean translate);
DGLuint GL_GetFlatInfo(int idx, boolean translate);
DGLuint GL_PrepareTexture(int idx);
DGLuint GL_PrepareTexture2(int idx, boolean translate);
DGLuint GL_PrepareFlat(int idx);
Expand Down
28 changes: 24 additions & 4 deletions doomsday/engine/portable/src/gl_texmanager.c
Expand Up @@ -1346,10 +1346,7 @@ unsigned int GL_PrepareFlat2(int idx, boolean translate)
// The flat isn't yet bound with OpenGL.
lumptexinfo[flat->lump].tex[0] = GL_BindTexFlat(flat);
}
texw = texh = 64;
texmask = false;
texdetail = (r_detail && flat->detail.tex ? &flat->detail : 0);
return lumptexinfo[flat->lump].tex[0];
return GL_GetFlatInfo(idx, translate);
}

/*
Expand Down Expand Up @@ -2984,6 +2981,29 @@ DGLuint GL_GetTextureInfo2(int index, boolean translate)
return tex->tex;
}

/*
* Returns the flat name, if it has been prepared.
*/
DGLuint GL_GetFlatInfo(int idx, boolean translate)
{
flat_t *flat = R_GetFlat(idx);

if(!flat)
return 0;

// Translate the flat.
if(translate && flat->translation.current != idx)
{
flat = R_GetFlat(flat->translation.current);
}

// Set the global texture info variables.
texw = texh = 64;
texmask = false;
texdetail = (r_detail && flat->detail.tex ? &flat->detail : 0);
return lumptexinfo[flat->lump].tex[0];
}

/**
* Copy the averaged texture color into the dest buffer <code>rgb</code>.
*
Expand Down

0 comments on commit 7fe2a0c

Please sign in to comment.