Merge branch 'linux' of https://github.com/CegepSTH/SQCSim2023 into linux
This commit is contained in:
commit
f2095f6e5b
3
.gitignore
vendored
3
.gitignore
vendored
@ -375,3 +375,6 @@ FodyWeavers.xsd
|
|||||||
/x64/Debug/SQCSim2021.pdb
|
/x64/Debug/SQCSim2021.pdb
|
||||||
/SQCSim-srv/cmake/*
|
/SQCSim-srv/cmake/*
|
||||||
!/SQCSim-srv/cmake/CMakeLists.txt
|
!/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];
|
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);
|
UpdateWorld(player_pos, blockinfo);
|
||||||
//TransposeWorld(player_pos, bullets);
|
//TransposeWorld(player_pos, bullets);
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public:
|
|||||||
BlockType BlockAt(float x, float y, float z, BlockType defaultBlockType = BTYPE_AIR) const;
|
BlockType BlockAt(float x, float y, float z, BlockType defaultBlockType = BTYPE_AIR) const;
|
||||||
BlockType BlockAt(const Vector3f& pos, 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);
|
void GetScope(unsigned int& x, unsigned int& y);
|
||||||
|
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
#ifndef AUDIO_H__
|
#ifndef AUDIO_H__
|
||||||
#define AUDIO_H__
|
#define AUDIO_H__
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
#include <irrKlang.h>
|
#include <irrKlang.h>
|
||||||
#include <ik_ISoundSource.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 "../SQCSim-common/vector3.h"
|
||||||
#include "define.h"
|
#include "define.h"
|
||||||
|
|
||||||
|
@ -6,9 +6,26 @@ set(CMAKE_CXX_STANDARD 17)
|
|||||||
set(CMAKE_STANDARD_REQUIRED True)
|
set(CMAKE_STANDARD_REQUIRED True)
|
||||||
|
|
||||||
set(CMAKE_BUILD_DIRECTORY "./build")
|
set(CMAKE_BUILD_DIRECTORY "./build")
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "../out")
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "../")
|
||||||
|
|
||||||
set(SQCSIM_COMMON_DIR "../../SQCSim-common/")
|
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
|
add_library(SQCSim-common
|
||||||
"${SQCSIM_COMMON_DIR}blockinfo.cpp"
|
"${SQCSIM_COMMON_DIR}blockinfo.cpp"
|
||||||
@ -21,7 +38,7 @@ add_library(SQCSim-common
|
|||||||
"${SQCSIM_COMMON_DIR}world.cpp"
|
"${SQCSIM_COMMON_DIR}world.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(SQCSim-server
|
add_executable(SQCSim-client
|
||||||
"../audio.cpp"
|
"../audio.cpp"
|
||||||
"../connector.cpp"
|
"../connector.cpp"
|
||||||
"../engine.cpp"
|
"../engine.cpp"
|
||||||
@ -30,10 +47,22 @@ add_executable(SQCSim-server
|
|||||||
"../shader.cpp"
|
"../shader.cpp"
|
||||||
"../skybox.cpp"
|
"../skybox.cpp"
|
||||||
"../texture.cpp"
|
"../texture.cpp"
|
||||||
|
"../textureatlas.cpp"
|
||||||
"../tool.cpp"
|
"../tool.cpp"
|
||||||
"../vertexbuffer.cpp"
|
"../vertexbuffer.cpp"
|
||||||
"../worldrenderer.cpp"
|
"../worldrenderer.cpp"
|
||||||
"../main.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}
|
||||||
|
)
|
||||||
|
|
||||||
|
@ -6,14 +6,18 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <GL/glew.h>
|
||||||
#include <SFML/Window.hpp>
|
#include <SFML/Window.hpp>
|
||||||
#include <SFML/Graphics.hpp>
|
#include <SFML/Graphics.hpp>
|
||||||
#include "../SQCSim-common/define.h"
|
#include "../SQCSim-common/define.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <GL/glew.h>
|
|
||||||
#include <gl/GL.h>
|
#include <gl/GL.h>
|
||||||
#include <gl/GLU.h>
|
#include <gl/GLU.h>
|
||||||
|
#else
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glu.h>
|
||||||
|
#include <climits>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NETWORK_TEST false
|
#define NETWORK_TEST false
|
||||||
|
@ -7,7 +7,7 @@ void main()
|
|||||||
texel = texture2D(tex,gl_TexCoord[0].st);
|
texel = texture2D(tex,gl_TexCoord[0].st);
|
||||||
|
|
||||||
texel *= light;
|
texel *= light;
|
||||||
texel.a = 255;
|
texel.a = 255.;
|
||||||
gl_FragColor = texel;
|
gl_FragColor = texel;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user