Skip to content

Commit

Permalink
Merge branch 'dev-no-makeheaders' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Lactozilla committed Oct 19, 2024
2 parents 02181b9 + e30303e commit bb84d9c
Show file tree
Hide file tree
Showing 257 changed files with 6,649 additions and 9,001 deletions.
30 changes: 30 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

*.txt text eol=lf
Makefile text eol=lf
README text eol=lf
COPYING text eol=lf
CONTRIBUTING text eol=lf
COMPILING text eol=lf
*.s text eol=lf
*.c text eol=lf
*.h text eol=lf
*.pl text eol=lf
*.py text eol=lf
*.sh text eol=lf

*.s linguist-language=Assembly
*.c linguist-language=C
*.h linguist-language=C
include/**/*.h linguist-language=C++
meta/**/*.h linguist-language=C++
source/**/*.h linguist-language=C++
tools/**/*.h linguist-language=C++

*.pl linguist-vendored
*.py linguist-vendored
*.sh linguist-vendored
Makefile linguist-vendored
doc/** linguist-vendored
etc/** linguist-vendored
data/** linguist-vendored
util/** linguist-vendored
2 changes: 1 addition & 1 deletion .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CMake (Linux and Windows)

on:
push:
branches: [ "master", "dev", "workflow-test" ]
branches: [ "master", "dev", "dev-no-makeheaders", "workflow-test" ]
pull_request:
branches: [ "master", "dev" ]

Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
HatchGameEngine.exe
*-Debug.exe
*-Release.exe
makeheaders.bin
include/*

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand All @@ -38,6 +36,7 @@ mono_crash.*
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
builds/
[Bb]in/
[Oo]bj/
[Ll]og/
Expand Down
56 changes: 56 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/include",
"${workspaceFolder}/source",
"/opt/homebrew/opt/llvm/include",
"/opt/homebrew/include",
"/usr/local/include"
],
"defines": [
"MACOSX",
"TARGET_NAME=\"HatchGameEngine\"",
"USING_OPENGL",
"USING_LIBPNG",
"USING_LIBPNG_HEADER=<libpng16/png.h>",
"DEBUG",
"USING_VM_DISPATCH_TABLE",
"_THREAD_SAFE",
"__VSCODE_INTELLISENSE__"
],
"cStandard": "c89",
"cppStandard": "c++11",
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
],
"compilerPath": "/opt/homebrew/opt/llvm/bin/clang",
"intelliSenseMode": "clang-arm64"
}, {
"name": "Linux",
"includePath": [
"${workspaceFolder}/include",
"${workspaceFolder}/source",
"/usr/local/include",
"/usr/include"
],
"defines": [
"LINUX",
"TARGET_NAME=HatchGameEngine",
"USING_LIBPNG",
"USING_LIBPNG_HEADER=<libpng16/png.h>",
"DEBUG",
"USING_VM_DISPATCH_TABLE",
"_THREAD_SAFE",
"__VSCODE_INTELLISENSE__"
],
"cStandard": "c89",
"cppStandard": "c++11",
"compilerPath": "/usr/bin/gcc",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}
13 changes: 0 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,6 @@ endif()

add_definitions(-DMINIZ_NO_ARCHIVE_APIS -DMINIZ_NO_ARCHIVE_WRITING_APIS -DMINIZ_NO_TIME )

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(MAKEHEADERS_BINARY makeheaders.exe)
else()
set(MAKEHEADERS_BINARY makeheaders)
endif()

add_custom_target(makeheaders ALL
COMMAND ${CMAKE_SOURCE_DIR}/tools/${MAKEHEADERS_BINARY} source/
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
BYPRODUCTS "${CMAKE_SOURCE_DIR}/include/makeheaders.bin" "${CMAKE_SOURCE_DIR}/include/Engine"
COMMENT "Generating header files")

find_file(REPO_DIR NAMES .git PATHS ${CMAKE_SOURCE_DIR} NO_DEFAULT_PATH)

if (REPO_DIR)
Expand All @@ -112,7 +100,6 @@ if (REPO_DIR)
endif()

add_executable(${PROJECT_NAME} ${HATCH_SOURCES})
add_dependencies(${PROJECT_NAME} makeheaders)

set(OUT_EXEC_NAME ${PROJECT_NAME})

Expand Down
44 changes: 18 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,15 @@ ifeq ($(PLATFORM),$(PLATFORM_WINDOWS))
PROGRAM_SUFFIX := .exe
endif

ifeq ($(PLATFORM),$(PLATFORM_LINUX))
MAKEHEADERS := ./tools/makeheaders
else
MAKEHEADERS := ./tools/makeheaders$(PROGRAM_SUFFIX)
endif

USING_LIBAV = 0
USING_CURL = 0
USING_LIBPNG = 1
USING_ASSIMP = 1

ifeq ($(PLATFORM),$(PLATFORM_MACOS))
USING_ASSIMP = 0
endif

TARGET = HatchGameEngine
TARGETDIR = builds/$(OUT_FOLDER)/$(TARGET)
OBJS = main.o
Expand All @@ -63,10 +61,10 @@ ifeq ($(PLATFORM),$(PLATFORM_MACOS))
OBJ_DIRS += $(addprefix out/$(OUT_FOLDER)/, $(dir $(SRC_M:source/%.m=%.o)))
endif

OBJS := $(addprefix out/$(OUT_FOLDER)/, $(SRC_C:source/%.c=%.o)) \
OBJS := $(addprefix out/$(OUT_FOLDER)/, $(SRC_C:source/%.c=%.o)) \
$(addprefix out/$(OUT_FOLDER)/, $(SRC_CPP:source/%.cpp=%.o))
ifeq ($(PLATFORM),$(PLATFORM_MACOS))
OBJ_DIRS += $(addprefix out/$(OUT_FOLDER)/, $(SRC_M:source/%.m=%.o))
OBJS += $(addprefix out/$(OUT_FOLDER)/, $(SRC_M:source/%.m=%.o))
endif

INCLUDES = -Wall -Wno-deprecated -Wno-unused-variable \
Expand All @@ -90,13 +88,10 @@ ifneq ($(MSYS_VERSION),0)
DEFINES += -DMSYS
endif
endif
ifeq ($(PLATOFRM),$(PLATFORM_MACOS))
INCLUDES += -F/Library/Frameworks/ \
-F/System/Library/Frameworks/ \
-Fmeta/mac/ \
-I/Library/Frameworks/SDL2.framework/Headers/ \
-I/System/Library/Frameworks/OpenGL.framework/Headers/
DEFINES += -DMACOSX -DUSING_FRAMEWORK
ifeq ($(PLATFORM),$(PLATFORM_MACOS))
INCLUDES += -I/opt/homebrew/include
LIBS += -lobjc
DEFINES += -DMACOSX -DUSING_OPENGL
endif
ifeq ($(PLATFORM),$(PLATFORM_LINUX))
DEFINES += -DLINUX
Expand Down Expand Up @@ -132,25 +127,23 @@ LIBS += -logg -lvorbis -lvorbisfile
LIBS += -lz

ifeq ($(PLATFORM),$(PLATFORM_MACOS))
LINKER = -framework SDL2 \
-framework OpenGL \
-framework CoreFoundation \
-framework CoreServices \
-framework Foundation
# \
-framework Cocoa
LINKER = -framework IOKit \
-framework OpenGL \
-framework CoreFoundation \
-framework CoreServices \
-framework Foundation \
-framework Cocoa
endif

all:
mkdir -p $(OBJ_DIRS)
$(MAKEHEADERS) source
$(MAKE) build

clean:
rm -rf $(OBJS)

build: $(OBJS)
$(CXX) $^ $(INCLUDES) $(LIBS) $(LINKER) -o "$(TARGETDIR)" -std=c++11
$(CXX) $^ $(INCLUDES) $(LIBS) $(LINKER) -o "$(TARGETDIR)" -std=c++17

$(OBJ_DIRS):
mkdir -p $@
Expand All @@ -164,7 +157,6 @@ package:
@mkdir -p "$(TARGETDIR).app/Contents/Resources"
@# @rm -rf $(OBJS)
@mkdir -p $(OBJ_DIRS)
@./tools/makeheaders source
@make build
@chmod +x "$(TARGETDIR)"
@cp "$(TARGETDIR)" "$(TARGETDIR).app/Contents/MacOS/$(TARGET)"
Expand Down Expand Up @@ -226,7 +218,7 @@ package:
@install_name_tool -change /usr/local/Cellar/libvorbis/1.3.6/lib/libvorbis.0.dylib @executable_path/../Frameworks/_libvorbis.0.dylib "$(TARGETDIR).app/Contents/Frameworks/_libvorbisfile.3.dylib"

out/$(OUT_FOLDER)/%.o: source/%.cpp
$(CXX) -c -g $(INCLUDES) $(DEFINES) -o "$@" "$<" -std=c++11
$(CXX) -c -g $(INCLUDES) $(DEFINES) -o "$@" "$<" -std=c++17

out/$(OUT_FOLDER)/%.o: source/%.c
$(CC) -c -g $(INCLUDES) $(DEFINES) -o "$@" "$<" -std=c11
Expand Down
24 changes: 0 additions & 24 deletions VisualC/HatchGameEngine.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@
<SubSystem>Console</SubSystem>
<AdditionalDependencies>Ws2_32.lib;Wldap32.lib;Advapi32.lib;Crypt32.lib;Normaliz.lib;legacy_stdio_definitions.lib;glew32s.lib;opengl32.lib;freetype.lib;SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>CD "..\tools"
"makeheaders.exe" ../source
CD ..</Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>copy "$(TargetPath)" "$(SolutionDir)..\builds\win\$(TargetName)-Debug.exe"</Command>
</PostBuildEvent>
Expand All @@ -118,11 +113,6 @@ CD ..</Command>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>Ws2_32.lib;Wldap32.lib;Advapi32.lib;Crypt32.lib;Normaliz.lib;legacy_stdio_definitions.lib;glew32s.lib;opengl32.lib;freetype.lib;SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>CD "..\tools"
"makeheaders.exe" ../source
CD ..</Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>copy "$(TargetPath)" "$(SolutionDir)..\builds\win\$(TargetName)-Release.exe"</Command>
</PostBuildEvent>
Expand All @@ -131,11 +121,6 @@ CD ..</Command>
<ClCompile>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<PreBuildEvent>
<Command>CD "..\tools"
"makeheaders.exe" ../source
CD ..</Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>copy "$(TargetPath)" "$(SolutionDir)..\builds\win\$(TargetName)-Debug.exe"</Command>
</PostBuildEvent>
Expand All @@ -144,11 +129,6 @@ CD ..</Command>
<ClCompile>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<PreBuildEvent>
<Command>CD "..\tools"
"makeheaders.exe" ../source
CD ..</Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>copy "$(TargetPath)" "$(SolutionDir)..\builds\win\$(TargetName)-Release.exe"</Command>
</PostBuildEvent>
Expand Down Expand Up @@ -263,10 +243,6 @@ CD ..</Command>
<ClCompile Include="..\source\engine\Scene.cpp" />
<ClCompile Include="..\source\engine\scene\SceneInfo.cpp" />
<ClCompile Include="..\source\engine\scene\SceneLayer.cpp" />
<ClCompile Include="..\source\engine\scene\ScrollingIndex.cpp" />
<ClCompile Include="..\source\engine\scene\ScrollingInfo.cpp" />
<ClCompile Include="..\source\engine\scene\TileConfig.cpp" />
<ClCompile Include="..\source\engine\scene\TileSpriteInfo.cpp" />
<ClCompile Include="..\source\engine\scene\View.cpp" />
<ClCompile Include="..\source\engine\textformats\ini\INI.cpp" />
<ClCompile Include="..\source\engine\textformats\xml\XMLParser.cpp" />
Expand Down
12 changes: 0 additions & 12 deletions VisualC/HatchGameEngine.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -339,18 +339,6 @@
<ClCompile Include="..\source\engine\scene\SceneLayer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\source\engine\scene\ScrollingIndex.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\source\engine\scene\ScrollingInfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\source\engine\scene\TileConfig.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\source\engine\scene\TileSpriteInfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\source\engine\scene\View.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down
Loading

0 comments on commit bb84d9c

Please sign in to comment.