Merge branch 'SQC-15_online' of https://github.com/CegepSTH/SQCSim2023 into SQC-15_online

This commit is contained in:
MarcEricMartel 2023-12-13 16:10:34 -05:00
commit 7b350fa403

View File

@ -130,14 +130,9 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
time -= 0.05; time -= 0.05;
Shooting = !Shooting; Shooting = !Shooting;
/*if (!current.states.shooting)
Shooting = false;
else
Shooting = true;*/
} }
std::cout << Shooting << std::endl;
//std::cout << time << std::endl; std::cout << "shooting : " << current.states.shooting << " jumping : " << current.states.jumping << " jumpshot : " << current.states.jumpshot << " running : " << current.states.running << " still : " << current.states.still << " dead : " << current.states.dead << " hit : " << current.states.hit << std::endl;
//std::cout << "shooting : " << current.states.shooting << " jumping : " << current.states.jumping << " jumpshot : " << current.states.jumpshot << " running : " << current.states.running << " still : " << current.states.still << " dead : " << current.states.dead << " hit : " << current.states.hit << std::endl;
if (angle >= 0.75) //Face - side positif if (angle >= 0.75) //Face - side positif
{ {
@ -321,9 +316,23 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
atlas.TextureIndexToCoord(index, u, v, w, h); atlas.TextureIndexToCoord(index, u, v, w, h);
glEnable(GL_BLEND); glEnable(GL_BLEND);
if (current.states.hit)
{
glBlendFunc(GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR);
glBlendColor(1.f, 0.f, 0.f, 1.f);
}
else {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
glBlendEquation(GL_FUNC_ADD); glBlendEquation(GL_FUNC_ADD);
glLoadMatrixf(tran.GetMatrix().GetInternalValues()); glLoadMatrixf(tran.GetMatrix().GetInternalValues());
glBegin(GL_QUADS); glBegin(GL_QUADS);
glTexCoord2f(u, v); glVertex3f(v1.x, v1.y, v1.z); glTexCoord2f(u, v); glVertex3f(v1.x, v1.y, v1.z);