Skip to content

Commit

Permalink
Fixed|Weapon Info: "Static" psprites (weapon offset scale)
Browse files Browse the repository at this point in the history
When drawing psprites, the weapon offset scale that is used for
preventing the lowering of the psprite was not applied as intended:
WEAPONTOP cannot be ignored as that is the highest offset that the
psprite will reach (non-zero).

Todo for later: Make WEAPONTOP a DD_value so that it doesn't have to
hardcoded.
  • Loading branch information
skyjake committed Apr 16, 2013
1 parent f3ea600 commit 7b2c5f6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions doomsday/client/src/render/sprite.cpp
Expand Up @@ -310,8 +310,11 @@ static void setupPSpriteParams(rendpspriteparams_t *params, vispsprite_t *spr)
Texture const &tex = ms.texture(MTU_PRIMARY).generalCase();
variantspecification_t const &texSpec = TS_GENERAL(ms.texture(MTU_PRIMARY).spec());

params->pos[VX] = psp->pos[VX] - -tex.origin().x + pspOffset[VX] + -texSpec.border;
params->pos[VY] = offScaleY * (psp->pos[VY] - -tex.origin().y) + pspOffset[VY] + -texSpec.border;
#define WEAPONTOP 32 /// @todo Currently hardcoded here and in the plugins.

params->pos[VX] = psp->pos[VX] + tex.origin().x + pspOffset[VX] - texSpec.border;
params->pos[VY] = WEAPONTOP + offScaleY * (psp->pos[VY] - WEAPONTOP) + tex.origin().y +
pspOffset[VY] - texSpec.border;
params->width = ms.width() + texSpec.border*2;
params->height = ms.height() + texSpec.border*2;

Expand Down

0 comments on commit 7b2c5f6

Please sign in to comment.