client linux fonctionnel
This commit is contained in:
parent
cddc59d6cf
commit
93062e49e2
3
.gitignore
vendored
3
.gitignore
vendored
@ -375,3 +375,6 @@ FodyWeavers.xsd
|
||||
/x64/Debug/SQCSim2021.pdb
|
||||
/SQCSim-srv/cmake/*
|
||||
!/SQCSim-srv/cmake/CMakeLists.txt
|
||||
/SQCSim2021/cmake/*
|
||||
!/SQCSim2021/cmake/CMakeLists.txt
|
||||
/SQCSim2021/SQCSim-client
|
||||
|
@ -130,7 +130,7 @@ void World::GetScope(unsigned int& x, unsigned int& y) {
|
||||
y = m_center[1];
|
||||
}
|
||||
|
||||
void World::Update(Bullet* bullets[MAX_BULLETS], Vector3f& player_pos, BlockInfo* blockinfo[BTYPE_LAST]) {
|
||||
void World::Update(Bullet* bullets[MAX_BULLETS], const Vector3f& player_pos, BlockInfo* blockinfo[BTYPE_LAST]) {
|
||||
UpdateWorld(player_pos, blockinfo);
|
||||
//TransposeWorld(player_pos, bullets);
|
||||
}
|
||||
@ -407,4 +407,4 @@ void World::UpdateWorld(const Vector3f& player, BlockInfo* blockinfo[BTYPE_LAST]
|
||||
}*/
|
||||
}
|
||||
|
||||
int World::GettbDeleted() const { return m_tbDeleted.size(); }
|
||||
int World::GettbDeleted() const { return m_tbDeleted.size(); }
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
BlockType BlockAt(float x, float y, float z, BlockType defaultBlockType = BTYPE_AIR) const;
|
||||
BlockType BlockAt(const Vector3f& pos, BlockType defaultBlockType = BTYPE_AIR) const;
|
||||
|
||||
void Update(Bullet* bullets[MAX_BULLETS], Vector3f& player_pos, BlockInfo* blockinfo[BTYPE_LAST]);
|
||||
void Update(Bullet* bullets[MAX_BULLETS], const Vector3f& player_pos, BlockInfo* blockinfo[BTYPE_LAST]);
|
||||
|
||||
void GetScope(unsigned int& x, unsigned int& y);
|
||||
|
||||
|
@ -1,8 +1,14 @@
|
||||
#ifndef AUDIO_H__
|
||||
#define AUDIO_H__
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <irrKlang.h>
|
||||
#include <ik_ISoundSource.h>
|
||||
#else
|
||||
#include "./external/irrKlang-64bit-1.6.0/include/irrKlang.h"
|
||||
#include "./external/irrKlang-64bit-1.6.0/include/ik_ISoundSource.h"
|
||||
#endif
|
||||
|
||||
#include "../SQCSim-common/vector3.h"
|
||||
#include "define.h"
|
||||
|
||||
@ -29,4 +35,4 @@ public:
|
||||
void PauseEngine();
|
||||
};
|
||||
|
||||
#endif // AUDIO_H__
|
||||
#endif // AUDIO_H__
|
||||
|
@ -6,9 +6,26 @@ set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_STANDARD_REQUIRED True)
|
||||
|
||||
set(CMAKE_BUILD_DIRECTORY "./build")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "../out")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "../")
|
||||
|
||||
set(SQCSIM_COMMON_DIR "../../SQCSim-common/")
|
||||
set(SQCSIM_EXTERN_DIR "../external/")
|
||||
|
||||
find_package(SFML COMPONENTS system window graphics REQUIRED)
|
||||
find_package(DevIL REQUIRED)
|
||||
find_package(OpenGL REQUIRED)
|
||||
find_package(GLEW REQUIRED)
|
||||
|
||||
find_library(IRRKLANG_LIBRARY
|
||||
NAMES libIrrKlang.so
|
||||
PATHS "${SQCSIM_EXTERN_DIR}/irrKlang-64bit-1.6.0/lib/linux-gcc-64/")
|
||||
|
||||
include_directories(
|
||||
${SQCSIM_EXTERN_DIR}/irrKlang-64bit-1.6.0/include/
|
||||
${SFML_INCLUDE_DIRS}
|
||||
${IL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
|
||||
add_library(SQCSim-common
|
||||
"${SQCSIM_COMMON_DIR}blockinfo.cpp"
|
||||
@ -21,7 +38,7 @@ add_library(SQCSim-common
|
||||
"${SQCSIM_COMMON_DIR}world.cpp"
|
||||
)
|
||||
|
||||
add_executable(SQCSim-server
|
||||
add_executable(SQCSim-client
|
||||
"../audio.cpp"
|
||||
"../connector.cpp"
|
||||
"../engine.cpp"
|
||||
@ -30,10 +47,22 @@ add_executable(SQCSim-server
|
||||
"../shader.cpp"
|
||||
"../skybox.cpp"
|
||||
"../texture.cpp"
|
||||
"../textureatlas.cpp"
|
||||
"../tool.cpp"
|
||||
"../vertexbuffer.cpp"
|
||||
"../worldrenderer.cpp"
|
||||
"../main.cpp"
|
||||
)
|
||||
|
||||
target_link_libraries(SQCSim-server PUBLIC SQCSim-common)
|
||||
target_link_libraries(SQCSim-client PUBLIC SQCSim-common
|
||||
${IRRKLANG_LIBRARY}
|
||||
sfml-system
|
||||
sfml-window
|
||||
sfml-graphics
|
||||
GL
|
||||
GLU
|
||||
GLEW
|
||||
${IL_LIBRARIES}
|
||||
${ILU_LIBRARIES}
|
||||
)
|
||||
|
||||
|
@ -4,14 +4,18 @@
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include <iomanip>
|
||||
#include <GL/glew.h>
|
||||
#include <SFML/Window.hpp>
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include "../SQCSim-common/define.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <GL/glew.h>
|
||||
#include <gl/GL.h>
|
||||
#include <gl/GLU.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#include <climits>
|
||||
#endif
|
||||
|
||||
#define NETWORK_TEST false
|
||||
|
@ -7,7 +7,7 @@ void main()
|
||||
texel = texture2D(tex,gl_TexCoord[0].st);
|
||||
|
||||
texel *= light;
|
||||
texel.a = 255;
|
||||
texel.a = 255.;
|
||||
gl_FragColor = texel;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user