Compare commits
No commits in common. "440fd87cccf96f47d8e2938883491e07d6f9df4b" and "69be7aa5292f698734ead645eeadb509db400c04" have entirely different histories.
440fd87ccc
...
69be7aa529
5
.gitignore
vendored
5
.gitignore
vendored
@ -18,7 +18,4 @@ venv/
|
|||||||
typer.py
|
typer.py
|
||||||
|
|
||||||
# Cache Files
|
# Cache Files
|
||||||
.cache/
|
.cache/
|
||||||
|
|
||||||
# Script output files
|
|
||||||
output.txt
|
|
@ -4,13 +4,6 @@ project(FarmFighter)
|
|||||||
set(CMAKE_C_STANDARD 11)
|
set(CMAKE_C_STANDARD 11)
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
||||||
|
|
||||||
if(POLICY CMP0077)
|
|
||||||
cmake_policy(SET CMP0077 NEW)
|
|
||||||
endif()
|
|
||||||
set(FETCHCONTENT_QUIET OFF)
|
|
||||||
|
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
raylib
|
raylib
|
||||||
@ -22,15 +15,6 @@ FetchContent_MakeAvailable(raylib)
|
|||||||
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||||
set(BUILD_GAMES OFF CACHE BOOL "" FORCE)
|
set(BUILD_GAMES OFF CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
FetchContent_Declare(
|
|
||||||
enet
|
|
||||||
URL https://github.com/zpl-c/enet/archive/refs/tags/v2.3.10.zip
|
|
||||||
)
|
|
||||||
FetchContent_MakeAvailable(enet)
|
|
||||||
|
|
||||||
add_library(enet INTERFACE)
|
|
||||||
target_include_directories(enet INTERFACE ${enet_SOURCE_DIR}/include)
|
|
||||||
|
|
||||||
add_subdirectory(networking)
|
add_subdirectory(networking)
|
||||||
add_subdirectory(engine)
|
add_subdirectory(engine)
|
||||||
add_subdirectory(client)
|
add_subdirectory(client)
|
||||||
|
@ -22,6 +22,7 @@ add_library(ImGui STATIC
|
|||||||
)
|
)
|
||||||
target_include_directories(ImGui PUBLIC ${imgui_SOURCE_DIR})
|
target_include_directories(ImGui PUBLIC ${imgui_SOURCE_DIR})
|
||||||
|
|
||||||
|
# rlImGui
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
rlImGui
|
rlImGui
|
||||||
GIT_REPOSITORY https://github.com/raylib-extras/rlImGui.git
|
GIT_REPOSITORY https://github.com/raylib-extras/rlImGui.git
|
||||||
@ -45,10 +46,8 @@ target_include_directories(client PUBLIC
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../networking/include
|
${CMAKE_CURRENT_SOURCE_DIR}/../networking/include
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../engine/include
|
${CMAKE_CURRENT_SOURCE_DIR}/../engine/include
|
||||||
${enet_SOURCE_DIR}/include
|
|
||||||
)
|
)
|
||||||
|
target_link_libraries(client raylib networking engine rlImGui ImGui)
|
||||||
target_link_libraries(client raylib networking engine rlImGui ImGui enet)
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_link_libraries(client ws2_32)
|
target_link_libraries(client ws2_32)
|
||||||
|
@ -1,13 +1,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define ENET_IMPLEMENTATION
|
|
||||||
#include <enet.h>
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
printf("This is the farm fighter client!\n");
|
printf("This is the farm fighter client!\n");
|
||||||
if (enet_initialize() != 0) {
|
return 0;
|
||||||
printf("Error init enet\n");
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
}
|
@ -7,7 +7,6 @@ add_library(engine STATIC
|
|||||||
target_include_directories(engine PUBLIC
|
target_include_directories(engine PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
${raylib_SOURCE_DIR}/src
|
${raylib_SOURCE_DIR}/src
|
||||||
${enet_SOURCE_DIR}/include
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(engine PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
target_include_directories(engine PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
@ -7,9 +7,6 @@ add_library(networking STATIC
|
|||||||
target_include_directories(networking PUBLIC
|
target_include_directories(networking PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
${raylib_SOURCE_DIR}/src
|
${raylib_SOURCE_DIR}/src
|
||||||
${enet_SOURCE_DIR}/include
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(networking PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
target_include_directories(networking PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||||
|
|
||||||
target_link_libraries(networking enet)
|
|
6088
networking/include/enet.h
Normal file
6088
networking/include/enet.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -8,11 +8,10 @@ target_include_directories(server PUBLIC
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../networking/include
|
${CMAKE_CURRENT_SOURCE_DIR}/../networking/include
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../engine/include
|
${CMAKE_CURRENT_SOURCE_DIR}/../engine/include
|
||||||
${enet_SOURCE_DIR}/include
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(server networking engine raylib enet)
|
target_link_libraries(server networking engine raylib)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_link_libraries(server ws2_32)
|
target_link_libraries(server ws2_32)
|
||||||
endif()
|
endif()
|
@ -1,16 +1,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define ENET_IMPLEMENTATION
|
|
||||||
#include <enet.h>
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
printf("Server starting...\n");
|
printf("Server starting...\n");
|
||||||
if (enet_initialize() != 0) {
|
|
||||||
printf("Error init enet\n");
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("Press any key to exit...\n");
|
printf("Press any key to exit...\n");
|
||||||
scanf_s("0");
|
scanf_s("0");
|
||||||
|
return 0;
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user