@@ -29,32 +29,9 @@ Engine::~Engine() {
}
void Engine : : Init ( ) {
GLenum glewErr = glewInit ( ) ;
if ( glewErr ! = GLEW_OK ) {
std : : cerr < < " ERREUR GLEW : " < < glewGetErrorString ( glewErr ) < < std : : endl ;
abort ( ) ;
}
uint64_t seed = SEED ;
glDisable ( GL_FRAMEBUFFER_SRGB ) ;
glEnable ( GL_DEPTH_TEST ) ;
glEnable ( GL_STENCIL_TEST ) ;
glEnable ( GL_POINT_SMOOTH ) ;
glEnable ( GL_BLEND ) ;
glEnable ( GL_TEXTURE_2D ) ;
glMatrixMode ( GL_PROJECTION ) ;
glLoadIdentity ( ) ;
gluPerspective ( 45.0f , ( float ) Width ( ) / ( float ) Height ( ) , 0.1f , VIEW_DISTANCE ) ;
glShadeModel ( GL_SMOOTH ) ;
glHint ( GL_PERSPECTIVE_CORRECTION_HINT , GL_NICEST ) ;
glDisable ( GL_BLEND ) ;
glBlendFunc ( GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA ) ;
glBlendEquation ( GL_FUNC_SUBTRACT ) ;
if ( m_istarted )
return ;
else m_istarted = true ;
@@ -70,6 +47,9 @@ void Engine::Init() {
m_whoosh [ x ] = nullptr ;
}
// Init Chunks
m_world . GetChunks ( ) . Reset ( nullptr ) ;
char * ch = new char [ 2 ] ;
std : : cout < < " Jouer en ligne? [o/N] " ;
@@ -102,13 +82,16 @@ void Engine::Init() {
if ( ! m_conn . Connect ( srvname . c_str ( ) , playname ) ) {
// setup jeu en reseau.
std : : cout < < " ID recu du serveur: " < < std : : to_string ( m_conn . getId ( ) ) < < " ! " < < std : : endl ;
std : : cout < < " Seed recu du serveur: " < < std : : to_string( m_conn. getSeed( ) ) < < " ! " < < std : : endl ;
//std::cout << "Seed recu du serveur: " << std:: to_string( m_conn. getSeed()) << "!" << std::endl;
m_player = Player ( m_conn . getOrigin ( ) . position ) ;
for ( auto & [ key , player ] : m_conn . m_players )
for ( auto & [ key , player ] : m_conn . m_players ) {
m_players [ key ] = new RemotePlayer ( player ) ;
RemotePlayer * rt = ( RemotePlayer * ) m_players [ key ] ;
rt - > SetPosition ( Vector3f ( 555 , 555 , 555 ) ) ;
}
seed = m_conn. getSeed( ) ;
seed = 9370707 ; // m_conn. getSeed();
m_networkgame = true ;
}
else std : : cout < < " Erreur de connexion. " < < std : : endl ;
@@ -119,17 +102,41 @@ void Engine::Init() {
m_world . SetSeed ( seed ) ;
// Init Chunks
m_world . GetChunks ( ) . Reset ( nullptr ) ;
m_startTime = std : : chrono : : high_resolution_clock : : now ( ) ;
m_remotePlayer . SetPosition ( Vector3f ( .5 , CHUNK_SIZE_Y + 10. , .5 ) ) ;
// Gestion de souris.
CenterMouse ( ) ;
HideCursor ( ) ;
}
void Engine : : DeInit ( ) { }
void Engine : : LoadResource ( ) {
GLenum glewErr = glewInit ( ) ;
if ( glewErr ! = GLEW_OK ) {
std : : cerr < < " ERREUR GLEW : " < < glewGetErrorString ( glewErr ) < < std : : endl ;
abort ( ) ;
}
glDisable ( GL_FRAMEBUFFER_SRGB ) ;
glEnable ( GL_DEPTH_TEST ) ;
glEnable ( GL_STENCIL_TEST ) ;
glEnable ( GL_POINT_SMOOTH ) ;
glEnable ( GL_BLEND ) ;
glEnable ( GL_CULL_FACE ) ;
glEnable ( GL_TEXTURE_2D ) ;
glMatrixMode ( GL_PROJECTION ) ;
glLoadIdentity ( ) ;
gluPerspective ( 45.0f , ( float ) Width ( ) / ( float ) Height ( ) , 0.1f , VIEW_DISTANCE ) ;
glShadeModel ( GL_SMOOTH ) ;
glHint ( GL_PERSPECTIVE_CORRECTION_HINT , GL_NICEST ) ;
glDisable ( GL_BLEND ) ;
glBlendFunc ( GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA ) ;
glBlendEquation ( GL_FUNC_SUBTRACT ) ;
LoadTexture ( m_skybox . GetTexture ( ) , TEXTURE_PATH " skybox.png " , true ) ;
LoadTexture ( m_textureCrosshair , TEXTURE_PATH " cross.bmp " , true ) ;
LoadTexture ( m_textureFont , TEXTURE_PATH " font.bmp " , true ) ;
@@ -180,29 +187,71 @@ void Engine::LoadResource() {
//AJOUTER LES TEXTURES DANS L'ORDRE DE L'ÉNUM
//STILL//STANDING
TextureAtlas : : TextureIndex StillFront = m_animeAtlas . AddTexture ( ANIME_PATH_STILL " BlueFrontRight.png " ) ;
//TextureAtlas::TextureIndex StillQuarterFrontLeft = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueLeft.png");
//TextureAtlas::TextureIndex StillQuarterFrontRight = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueRight.png");
//TextureAtlas::TextureIndex StillProfiltLeft = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueProfilLeft.png");
//TextureAtlas::TextureIndex StillProfiltRight = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueProfilRight.png");
//TextureAtlas::TextureIndex StillQuarterBackLeft = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueLeftBack.png");
//TextureAtlas::TextureIndex StillQuarterBackRight = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueRightBack.png");
//TextureAtlas::TextureIndex StillBack = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueBackRight.png");
//SHOOTINGSTILL SANS TIRER
//TextureAtlas::TextureIndex StillFrontShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueFrontRightShootingRight.png");
//TextureAtlas::TextureIndex StillQuarterFrontLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueFrontRightShootingRight.png");
//TextureAtlas::TextureIndex StillQuarterFrontRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueRightShootingRight.png");
//TextureAtlas::TextureIndex StillProfiltLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueProfilShootingLeft.png");
//TextureAtlas::TextureIndex StillProfiltRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueProfilShootingRight.png");
//TextureAtlas::TextureIndex StillQuarterBackLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueBackLeftShootingLeft.png");
//TextureAtlas::TextureIndex StillQuarterBackRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueBackRightShootingRight.png");
//TextureAtlas::TextureIndex StillBackShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueShootingBackRight.png");
//SHOOTINGSTILL TIRER
//TextureAtlas::TextureIndex StillFrontShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueFrontRightShootingRightShoot1.png");
//TextureAtlas::TextureIndex StillQuarterFrontLeftFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueLeftShootingLeftShoot1.png");
//TextureAtlas::TextureIndex StillQuarterFrontRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueRightShootingRightShoot1.png");
//TextureAtlas::TextureIndex StillProfiltLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueProfilShootingLeftShoot1.png");
//TextureAtlas::TextureIndex StillProfiltRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueProfilShootingRightShoot1.png");
//TextureAtlas::TextureIndex StillQuarterBackLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueBackLeftShootingLeftShoot1.png");
//TextureAtlas::TextureIndex StillQuarterBackRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueBackRightShootingRightShoot1.png");
//TextureAtlas::TextureIndex StillBackShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueShootingBackRightShoot1.png");
//JUMP
//TextureAtlas::TextureIndex JumpBack = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueBackJumpRight.png");
//TextureAtlas::TextureIndex JumpFront = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueFrontJumpRight.png");
//TextureAtlas::TextureIndex JumpQuarterBackLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueLeftBackJumpLeft.png");
//TextureAtlas::TextureIndex JumpQuarterBackRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueRightBackJumpRight.png");
//TextureAtlas::TextureIndex JumpProfiltLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilJumpLeft.png");
//TextureAtlas::TextureIndex JumpProfiltRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilJumpRight.png");
//TextureAtlas::TextureIndex JumpQuarterFrontLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueLeftFrontJumpLeft.png");
//TextureAtlas::TextureIndex JumpQuarterFrontRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueRightFrontJumpRight.png");
//TextureAtlas::TextureIndex JumpProfiltLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilJumpLeft.png");
//TextureAtlas::TextureIndex JumpProfiltRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilJumpRight.png");
//TextureAtlas::TextureIndex JumpQuarterBackLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueLeftBackJumpLeft.png");
//TextureAtlas::TextureIndex JumpQuarterBackRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueRightBackJumpRight.png");
//TextureAtlas::TextureIndex JumpBack = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueBackJumpRight.png");
//STILL
//TextureAtlas::TextureIndex StillBack = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueBackRight.png");
TextureAtlas : : TextureIndex StillFront = m_animeAtlas . AddTexture ( ANIME_PATH_STILL " BlueFrontRight.png " ) ;
//TextureAtlas::TextureIndex StillQuarterBackLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueLeftBack.png");
//TextureAtlas::TextureIndex StillQuarterBackRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueRightBack.png");
//TextureAtlas::TextureIndex StillProfiltLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilLeft.png");
//TextureAtlas::TextureIndex StillProfiltRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilRight.png");
//TextureAtlas::TextureIndex StillQuarterFrontLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueLeft.png");
//TextureAtlas::TextureIndex StillQuarterFrontRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueRight.png");
//SHOOTINGSTILL
//SHOOTINGJUMP
//SHOOTINGJUMP SANS TIRER
//TextureAtlas::TextureIndex JumpFrontShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueFrontJumpRightShootingRight.png");
//TextureAtlas::TextureIndex JumpQuarterFrontLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueFrontLeftJumpLeftShootingLeft.png");
//TextureAtlas::TextureIndex JumpQuarterFrontRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueFrontRightJumpRightShootingRight.png");
//TextureAtlas::TextureIndex JumpProfiltLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueProfilLeftJumpLeftShootingLeft.png");
//TextureAtlas::TextureIndex JumpProfiltRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BluerProfilRightJumprightShootingRight.png");
//TextureAtlas::TextureIndex JumpQuarterBackLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueBackLeftJumpLeftShootingLeft.png");
//TextureAtlas::TextureIndex JumpQuarterBackRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueBackRightJumpRightShootingRight.png");
//TextureAtlas::TextureIndex JumpBackShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueBackJumpRightShootingRight.png");
//SHOOTINGJUMP TIRER
//TextureAtlas::TextureIndex JumpFrontShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueFrontJumpRightShootingRightShoot1.png");
//TextureAtlas::TextureIndex JumpQuarterFrontLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueFrontLeftJumpLeftShootingLeftShoot1.png");
//TextureAtlas::TextureIndex JumpQuarterFrontRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueFrontRightJumpRightShootingRightShoot1.png");
//TextureAtlas::TextureIndex JumpProfiltLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueProfilLeftJumpLeftShootingLeftShoot1.png");
//TextureAtlas::TextureIndex JumpProfiltRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BluerProfilRightJumprightShootingRightShoot1.png");
//TextureAtlas::TextureIndex JumpQuarterBackLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueBackLeftJumpLeftShootingLeftShoot1.png");
//TextureAtlas::TextureIndex JumpQuarterBackRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueBackRightJumpRightShootingRightShoot1.png");
//TextureAtlas::TextureIndex JumpBackShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueBackJumpRightShootingRightShoot1.png");
if ( ! m_animeAtlas . Generate ( TEXTURE_SIZE , false ) ) {
std : : cout < < " Unable to generate texture atlas ... " < < std : : endl ;
abort ( ) ;
@@ -360,6 +409,7 @@ void Engine::DisplayHud(int timer) {
glBindTexture ( GL_TEXTURE_2D , 0 ) ;
glLoadIdentity ( ) ;
glBlendFunc ( GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA ) ;
glClear ( GL_STENCIL_BUFFER_BIT ) ;
float itemBackgroundWidthProportion = 0.25f ;
float itemBackgroundHeightProportion = 0.175f ;
@@ -655,7 +705,7 @@ void Engine::DisplayInfo(float elapsedTime, BlockType bloc) {
fPosY = fPosYJump ;
fPosY - = charSize ;
ss < < " Velocity : " < < m_remoteP layer . GetVelocity ( ) ;
ss < < " Velocity : " < < m_p layer . GetVelocity ( ) ;
PrintText ( fPosX , fPosY , ss . str ( ) ) ;
ss . str ( " " ) ;
fPosY - = charSize ;
@@ -665,7 +715,7 @@ void Engine::DisplayInfo(float elapsedTime, BlockType bloc) {
ss . str ( " " ) ;
fPosY - = charSize ;
ss < < " Remote Position : " < < m_remotePlayer . GetPosition ( ) ; //m_player.GetPosition();
ss < < " Remote Position : " < < m_otherplayerpos ;
PrintText ( fPosX , fPosY , ss . str ( ) ) ;
ss . str ( " " ) ;
fPosY - = charSize ;
@@ -1225,10 +1275,11 @@ void Engine::Render(float elapsedTime) {
if ( bloc = = BTYPE_LAST + 1 ) bloc = BTYPE_AIR + 1 ;
else if ( bloc = = BTYPE_AIR ) bloc = BTYPE_LAST ; // La selection de BTYPE_LAST <20> quipe l'arme.
m_mouseWU = m_mouseWD = m_key1 = m_key2 = false ;
netprot : : ChunkMod * cmod = nullptr ;
if ( m_mouseL ) {
if ( bloc ! = BTYPE_LAST )
m_world . ChangeBlockAtCursor ( bloc , m_player . GetPosition ( ) , m_player . GetDirection ( ) , m_block ) ;
cmod = m_world. ChangeBlockAtCursor ( bloc , m_player . GetPosition ( ) , m_player . GetDirection ( ) , m_block , m_networkgame );
else if ( bulletTime < = 0.f ) {
for ( int x = 0 ; x < MAX_BULLETS ; + + x ) // Ajouter une balle dans l'array (aussi connu sous le nom de "faire pow pow").
if ( ! m_bullets [ x ] ) {
@@ -1250,12 +1301,12 @@ void Engine::Render(float elapsedTime) {
}
}
else if ( m_mouseR )
m_world . ChangeBlockAtCursor ( BTYPE_AIR , m_player . GetPosition ( ) , m_player . GetDirection ( ) , m_block ) ;
cmod = m_world. ChangeBlockAtCursor ( BTYPE_AIR , m_player . GetPosition ( ) , m_player . GetDirection ( ) , m_block , m_networkgame );
for ( int x = 0 ; x < MAX_BULLETS ; + + x ) { // Array de bullets en jeu.
if ( m_bullets [ x ] ) {
for ( int b = 0 ; b < BULLET_UPDATES_PER_FRAME ; + + b ) {
if ( m_bullets [ x ] - > Update ( & m_world , elapsedTime , BULLET_UPDATES_PER_FRAME , m_players ) ) {
if ( m_bullets [ x ] - > Update ( & m_world , elapsedTime , BULLET_UPDATES_PER_FRAME , m_players , m_networkgame ? & m_chunkmod : nullptr )) {
m_bullets [ x ] - > ~ Bullet ( ) ;
if ( m_whoosh [ x ] )
m_whoosh [ x ] - > drop ( ) ;
@@ -1276,18 +1327,10 @@ void Engine::Render(float elapsedTime) {
gameTime + = elapsedTime * 10 ;
Vector3f dance = Vector3f ( sin ( gameTime ) , 0 , cos ( - gameTime ) ) ;
dance . Normalize ( ) ;
m_remotePlayer . ApplyPhysics ( dance , & m_world , elapsedTime ) ;
m_world . Update ( m_bullets , m_player . GetPosition ( ) , m_blockinfo ) ;
m_renderer . UpdateMesh ( & m_world , m_player . GetPosition ( ) , m_blockinfo ) ;
m_remotePlayer . Render ( m_animeAtlas , m_shader01 , all , elapsedTime ) ;
m_booster . RenderBillboard ( { 195 , 16 , 195 } , m_textureAtlas , m_shader01 , all ) ;
if ( m_isSkybox ) m_renderer . RenderWorld ( & m_world , m_renderCount , m_player . GetPosition ( ) , m_player . GetDirection ( ) , all , m_shader01 , m_textureAtlas ) ;
//glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
//m_remotePlayer.Render(m_textureAtlas, m_shader01, all, elapsedTime);
//m_booster.RenderBillboard({ 195,16,195 }, m_textureAtlas, m_shader01, all);
m_renderer . RenderWorld ( & m_world , m_renderCount , m_player . GetPosition ( ) , m_player . GetDirection ( ) , all , m_shader01 , m_textureAtlas ) ;
@@ -1310,9 +1353,11 @@ void Engine::Render(float elapsedTime) {
}
if ( m_networkgame ) { // Pour se gerer le paquet.
static bool has_synced = false ;
using namespace std : : chrono ;
using namespace netprot ;
Timestamp tstamp = duration_cast < milliseconds > ( high_resolution_clock : : now ( ) - m_startTime ) . count ( ) ;
static Timestamp last = 0 ;
Input input ;
Sync sync ;
uint64_t id = m_conn . getId ( ) ;
@@ -1332,9 +1377,13 @@ void Engine::Render(float elapsedTime) {
sync_acc - = 1000 ;
sync . sid = id ;
sync . timestamp = tstamp ;
sync . position = m_player . GetPosition ( ) ;
sync . position = m_player . GetPositionAbs ( ) ;
sync . hp = m_player . GetHP ( ) ;
// TODO: Garrocher ca quelque-part.
if ( ! has_synced ) {
has_synced = true ;
sendPackTo < Sync > ( m_conn . m_sock_udp , & sync , & m_bufout , & m_conn . m_srvsockaddr ) ;
}
m_syncs [ sync . timestamp ] = sync ;
}
if ( cmod_acc > = 1000 ) {
@@ -1372,15 +1421,40 @@ void Engine::Render(float elapsedTime) {
using enum PACKET_TYPE ;
case SYNC :
if ( Deserialize ( & sync , pck , & bsize ) ) {
if ( sync . sid ! = m_conn . getId ( ) )
if ( sync . sid ! = m_conn . getId ( ) ) {
std : : cout < < " syncsid be no good. " ;
break ;
// TODO: Vérifier si les positions concordent au sync local.
}
if ( m_syncs . count ( sync . timestamp ) ) {
Sync comp = m_syncs [ sync . timestamp ] ;
m_player . InflictDamage ( sync . hp - comp . hp ) ;
Vector3f diff = sync . position - comp . position ;
if ( diff . y < 1. )
diff . y = 0 ;
if ( diff . Length ( ) > 1.5 ) {
diff . Normalize ( ) ;
m_player . Move ( - diff ) ;
}
// TODO: Syncer sync.timer avec le timer
m_syncs . erase ( sync . timestamp ) ;
}
else std : : cout < < " sync be no good. " ;
}
break ;
case OUTPUT :
if ( Deserialize ( & out , pck , & bsize ) ) {
RemotePlayer * r = ( RemoteP layer* ) m_player s[ out . id ] ;
r - > Feed ( out ) ;
if ( ! m_p layers . contain s( out . id ) ) {
std : : cout < < out . id < < " is id no good. " < < std : : endl ;
break ;
}
RemotePlayer * rt = static_cast < RemotePlayer * > ( m_players [ out . id ] ) ;
rt - > Feed ( out ) ;
}
break ;
case CHUNKMOD :
@@ -1411,11 +1485,22 @@ void Engine::Render(float elapsedTime) {
}
break ;
default :
std : : cout < < " packet be no good. " ;
break ;
}
}
lsPck . clear ( ) ;
glDisable ( GL_CULL_FACE ) ;
for ( auto & [ key , player ] : m_players ) {
RemotePlayer * rt = static_cast < RemotePlayer * > ( player ) ;
glClear ( GL_STENCIL_BUFFER_BIT ) ;
rt - > Render ( m_animeAtlas , m_shader01 , all , elapsedTime ) ;
m_otherplayerpos = player - > GetPosition ( ) ; // Aller chercher GetPosition des deux façon, voir si ça chie.
}
glEnable ( GL_CULL_FACE ) ;
}
}
}