Merge branch 'linux' of https://github.com/CegepSTH/SQCSim2023 into linux

This commit is contained in:
MarcEricMartel 2023-10-07 11:43:55 -04:00
commit f2095f6e5b
7 changed files with 51 additions and 9 deletions

3
.gitignore vendored
View File

@ -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

View File

@ -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);
}

View File

@ -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);

View File

@ -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"

View File

@ -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}
)

View File

@ -6,14 +6,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

View File

@ -7,7 +7,7 @@ void main()
texel = texture2D(tex,gl_TexCoord[0].st);
texel *= light;
texel.a = 255;
texel.a = 255.;
gl_FragColor = texel;
}