push de test pour les animations

This commit is contained in:
Claudel-D-Roy
2023-11-13 16:02:13 -05:00
parent d49d5cdebc
commit dfd2ddc8af
6 changed files with 80 additions and 7 deletions

View File

@@ -1,10 +1,26 @@
#include "remoteplayer.h"
#include <iostream>
#include <cstring>
#include "texture.h"
#include <thread>
#include <queue>
RemotePlayer::RemotePlayer(netprot::PlayerInfo pinfo) : Player(Vector3f(0, 0, 0), 0, 0), m_pinfo(pinfo), m_aminacc(0.0f), m_animstate(Anim::STILL), m_team_id(0), current(), previous() {
RemotePlayer::RemotePlayer(netprot::PlayerInfo pinfo) : m_pinfo(pinfo), m_aminacc(0.0f), m_animstate(Anim::STILL), m_team_id(0), current(), previous(), m_texture_front(), Player(Vector3f(0, 0, 0), 0, 0) {
LoadTexture(m_texture_front, TEXTURE_PATH "AssetOtherPlayer/FinalPNGStanding/BlueFrontRight.png", false, false);
}
//RemotePlayer::RemotePlayer()
//{
//
//}
RemotePlayer::~RemotePlayer()
{
}
void RemotePlayer::Init() {
@@ -67,4 +83,31 @@ void RemotePlayer::Feed(const netprot::Output out) {
}
}
void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, float elapsedTime)
{
m_texture_front.Bind();
glBegin(GL_QUADS);
glTexCoord2f(0, 0); glVertex2f(0, 500);
glTexCoord2f(1, 0); glVertex2f(500, 500);
glTexCoord2f(1, 1); glVertex2f(500, 0);
glTexCoord2f(0, 1); glVertex2f(0, 0);
glEnd();
}
bool RemotePlayer::LoadTexture(Texture& texture, const std::string& filename, bool useMipmaps, bool stopOnError)
{
texture.Load(filename, useMipmaps);
if (!texture.IsValid()) {
std::cerr << "Unable to load texture (" << filename << ")" << std::endl;
if (stopOnError)
return false;
return false;
}
return true;
}