Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Client: Added PlayerWeaponAnimator for animating new HUD models
Owned by ClientPlayer.
  • Loading branch information
skyjake committed Jul 26, 2015
1 parent a317ae2 commit ccb8229
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 4 deletions.
3 changes: 3 additions & 0 deletions doomsday/apps/client/include/clientplayer.h
Expand Up @@ -24,6 +24,7 @@
#include "lzss.h" // legacy demo code

struct ConsoleEffectStack;
class PlayerWeaponAnimator;

/**
* Information about a client player.
Expand Down Expand Up @@ -78,6 +79,8 @@ class ClientPlayer : public Player
ConsoleEffectStack &fxStack();
ConsoleEffectStack const &fxStack() const;

PlayerWeaponAnimator &playerWeaponAnimator();

DemoTimer &demoTimer();

private:
Expand Down
39 changes: 39 additions & 0 deletions doomsday/apps/client/include/render/playerweaponanimator.h
@@ -0,0 +1,39 @@
/** @file playerweaponanimator.h Player weapon model animator.
*
* @authors Copyright (c) 2015 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
*/

#ifndef CLIENT_RENDER_PLAYERWEAPONANIMATOR_H
#define CLIENT_RENDER_PLAYERWEAPONANIMATOR_H

#include <de/ModelDrawable>

/**
* Animates the player weapon model.
*
* @ingroup render
*/
class PlayerWeaponAnimator : public de::ModelDrawable::Animator
{
public:
PlayerWeaponAnimator();

private:
DENG2_PRIVATE(d)
};

#endif // CLIENT_RENDER_PLAYERWEAPONANIMATOR_H

15 changes: 11 additions & 4 deletions doomsday/apps/client/src/clientplayer.cpp
Expand Up @@ -18,15 +18,17 @@

#include "clientplayer.h"
#include "render/consoleeffect.h"
#include "render/playerweaponanimator.h"

using namespace de;

DENG2_PIMPL_NOREF(ClientPlayer)
{
viewdata_t viewport;
ConsoleEffectStack effects;
clplayerstate_t clPlayerState;
DemoTimer demoTimer;
viewdata_t viewport;
ConsoleEffectStack effects;
PlayerWeaponAnimator playerWeaponAnimator;
clplayerstate_t clPlayerState;
DemoTimer demoTimer;

Instance()
{
Expand Down Expand Up @@ -73,6 +75,11 @@ ConsoleEffectStack const &ClientPlayer::fxStack() const
return d->effects;
}

PlayerWeaponAnimator &ClientPlayer::playerWeaponAnimator()
{
return d->playerWeaponAnimator;
}

DemoTimer &ClientPlayer::demoTimer()
{
return d->demoTimer;
Expand Down
32 changes: 32 additions & 0 deletions doomsday/apps/client/src/render/playerweaponanimator.cpp
@@ -0,0 +1,32 @@
/** @file playerweaponanimator.cpp Player weapon animator.
*
* @authors Copyright (c) 2015 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
*/

#include "render/playerweaponanimator.h"

using namespace de;

DENG2_PIMPL_NOREF(PlayerWeaponAnimator)
{
Instance()
{

}
};

PlayerWeaponAnimator::PlayerWeaponAnimator() : d(new Instance)
{}

0 comments on commit ccb8229

Please sign in to comment.