Skip to content

Commit

Permalink
Fixed: DOOM2 ending monsters too low
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Dec 10, 2011
1 parent 8ece5e9 commit c7cf1b8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
8 changes: 1 addition & 7 deletions doomsday/engine/portable/src/def_main.c
Expand Up @@ -1031,20 +1031,14 @@ static int generateMaterialDefForSpriteTexture(textureid_t texId, void* paramate
tex = Textures_ToTexture(texId);
if(tex)
{
spritetex_t* sprTex = (spritetex_t*)Texture_UserData(tex);
assert(sprTex);

mat->width = Texture_Width(tex);
mat->height = Texture_Height(tex);

st->texOrigin[0] = sprTex->offX;
st->texOrigin[1] = sprTex->offY;
}
#if _DEBUG
else
{
ddstring_t* path = Uri_ToString(texUri);
Con_Message("Warning:generateMaterialDefForSpriteTexture: Texture \"%s\" has not yet been defined, resultant Material will inherit dimensions and layer origin=[0, 0].\n", Str_Text(path));
Con_Message("Warning:generateMaterialDefForSpriteTexture: Texture \"%s\" has not yet been defined, resultant Material will inherit dimensions.\n", Str_Text(path));
Str_Delete(path);
}
#endif
Expand Down
21 changes: 18 additions & 3 deletions doomsday/engine/portable/src/ui2_main.c
Expand Up @@ -1004,17 +1004,32 @@ static void drawPicFrame(fidata_pic_t* p, uint frame, const float _origin[3],
const materialvariantspecification_t* spec = Materials_VariantSpecificationForContext(
MC_UI, 0, 1, 0, 0, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE, 0, 1, 0, false, false, false, false);
const materialsnapshot_t* ms = Materials_Prepare(mat, spec, true);
DGLuint tex = MSU_gltexture(ms, MTU_PRIMARY);

if(tex)
glTexName = MSU_gltexture(ms, MTU_PRIMARY);
if(glTexName)
{
const texturevariantspecification_t* spec = MSU_texturespec(ms, MTU_PRIMARY);

/// \todo Utilize *all* properties of the Material.
V3_Set(offset, -MSU(ms, MTU_PRIMARY).offset[0], -MSU(ms, MTU_PRIMARY).offset[1], 0);
V3_Set(dimensions, ms->size.width + TS_GENERAL(spec)->border*2,
ms->size.height + TS_GENERAL(spec)->border*2, 0);
TextureVariant_Coords(MST(ms, MTU_PRIMARY), &texScale[VX], &texScale[VY]);

switch(Textures_Namespace(Textures_Id(MSU_texture(ms, MTU_PRIMARY))))
{
case TN_SPRITES: {
spritetex_t* sTex = (spritetex_t*)Texture_UserData(MSU_texture(ms, MTU_PRIMARY));
if(sTex)
{
V3_Set(offset, -sTex->offX, -sTex->offY, 0);
break;
}
}
// Fall through.
default:
V3_Set(offset, 0, 0, 0);
break;
}
}
}
break;
Expand Down

0 comments on commit c7cf1b8

Please sign in to comment.