Skip to content

Commit

Permalink
- refactor game to use DGEngine core
Browse files Browse the repository at this point in the history
- add FileBytes resource type
- add Shape UIObject
- add action to delete audio
- add bindWhenHidden property to BindableText
- add portable mode
- add rightClick actions to Button
- add scale4xhq and xbrz4x shaders
- add support for BitmapFontTexturePacks with more than 256 chars
- add vcpkg port for physfs and sfml
- add x64 to project
- fix errors
- load grayscale palette on error
- override SFML wave implementation with one using dr_wav (faster)
- refactoring to remove composite element parsing
- remove android build support
- remove rectpack2D
- rename Keyboard to InputEvent
- set default texturePack directions to 1
- setSmooth textures
- support for utf8 in FileUtils
- support for utf8 strings in BitmapText and StringText
- update gamefiles
- update to new lighting system using circles and BlendMode
- use more c++20
- use string_view in parsers
  • Loading branch information
dgengin committed Jan 2, 2021
1 parent a950a2a commit c34aee0
Show file tree
Hide file tree
Showing 601 changed files with 16,909 additions and 12,702 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[src/{endian,gsl,rapidjson,rectpack2D}/**]
[src/{endian,rapidjson}/**]
indent_size = unset
indent_style = unset
insert_final_newline = unset
Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build_linux:
name: linux build
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Checkout DGEngine
uses: actions/checkout@v2
Expand All @@ -30,8 +30,8 @@ jobs:
git clone -q --depth=1 --branch=2.5.x https://github.com/SFML/SFML.git /home/runner/work/DGEngine/DGEngine/sfml > /dev/null
git -C /home/runner/work/DGEngine/DGEngine/sfml pull > /dev/null
cd /home/runner/work/DGEngine/DGEngine/sfml
export CC=/usr/bin/gcc-9
export CXX=/usr/bin/g++-9
export CC=/usr/bin/gcc-10
export CXX=/usr/bin/g++-10
cmake /home/runner/work/DGEngine/DGEngine/sfml/CMakeLists.txt
sudo make install
Expand All @@ -43,8 +43,8 @@ jobs:
- name: CMake + make DGEngine
run: |
export CC=/usr/bin/gcc-9
export CXX=/usr/bin/g++-9
export CC=/usr/bin/gcc-10
export CXX=/usr/bin/g++-10
cmake CMakeLists.txt
make
Expand All @@ -62,24 +62,17 @@ jobs:
path: C:/vcpkg/installed
key: cache-windows

- name: Checkout physfs
if: steps.cache-windows.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: dgengin/physfs
path: physfs

- name: Install dependencies
if: steps.cache-windows.outputs.cache-hit != 'true'
run: vcpkg install physfs:x86-windows-static sfml:x86-windows-static --overlay-ports=D:/a/DGEngine/DGEngine/physfs/vcpkg-port
run: vcpkg install physfs:x86-windows-static sfml:x86-windows-static --overlay-ports=D:/a/DGEngine/DGEngine/vcpkg/ports

- name: Setup MSBuild
uses: microsoft/[email protected].0
uses: microsoft/[email protected].2

- name: MSBuild DGEngine
run: |
vcpkg integrate install
msbuild DGEngine.vcxproj /p:Configuration="Release Static NoMovie" /p:Platform=Win32
msbuild Project.vcxproj /p:Configuration="Release Static NoMovie" /p:Platform=Win32
- name: Create DGEngine.zip
run: 7z a DGEngine.zip "./Release Static NoMovie/DGEngine.exe" LICENSE.* main.json gamefiles*
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
/Debug NoDiabloFormatSupport
/Debug NoMovie
/DGEngine
/DGEngine.dir
/DIABDAT
/DIABDAT.*
/FFMPEG*
Expand All @@ -47,10 +46,12 @@
/Makefile
/obj
/PhysicsFS
/portable
/Project.dir
/Release
/Release NoMovie
/Release Static
/Release Static NoMovie
/sfeMovie
/SFML
/Win32
/x64
2 changes: 1 addition & 1 deletion BUILD.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ USE_SFML_MOVIE_STUB which uses a stub class that does nothing instead.

Linux

To compile in Linux (Ubuntu), you need gcc or clang with C++17 support
To compile in Linux (Ubuntu), you need gcc or clang with C++20 support
and to have both PhysicsFS >= 2.1 and SFML >= 2.5 installed.

sudo apt install libphysfs-dev
Expand Down
69 changes: 47 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR)
cmake_minimum_required(VERSION 3.12.4 FATAL_ERROR)

project(DGEngine)

Expand Down Expand Up @@ -31,6 +31,7 @@ set(SOURCE_FILES
src/Anchor.h
src/Animation.cpp
src/Animation.h
src/AnimationInfo.h
src/AnimationType.h
src/AudioSource.h
src/BaseAnimation.cpp
Expand Down Expand Up @@ -62,14 +63,21 @@ set(SOURCE_FILES
src/EventManager.h
src/FadeInOut.cpp
src/FadeInOut.h
src/FileBytes.h
src/FileUtils.cpp
src/FileUtils.h
src/Font.h
src/Formula.cpp
src/Formula.h
src/Formulas.h
src/FreeTypeFont.h
src/Game.cpp
src/Game.h
src/GameConstants.h
src/GameUtils.cpp
src/GameUtils.h
src/GameUtilsGame.cpp
src/GameUtilsGame.h
src/IfCondition.cpp
src/IfCondition.h
src/IgnoreResource.h
Expand All @@ -85,8 +93,6 @@ set(SOURCE_FILES
src/LoadingScreen.h
src/Menu.cpp
src/Menu.h
src/Min.cpp
src/Min.h
src/Movie2.cpp
src/Movie2.h
src/Palette.cpp
Expand All @@ -104,8 +110,11 @@ set(SOURCE_FILES
src/ResourceManager.h
src/Scrollable.cpp
src/Scrollable.h
src/Shader.h
src/ShaderManager.cpp
src/ShaderManager.h
src/Shape.cpp
src/Shape.h
src/StreamReader.h
src/StringButton.cpp
src/StringButton.h
Expand Down Expand Up @@ -165,9 +174,6 @@ set(SOURCE_FILES
src/Game/ColorLevelLayer.cpp
src/Game/ColorLevelLayer.h
src/Game/FlagsVector.h
src/Game/Formula.cpp
src/Game/Formula.h
src/Game/Formulas.h
src/Game/fsa.h
src/Game/GameHashes.h
src/Game/GameProperties.cpp
Expand Down Expand Up @@ -197,12 +203,12 @@ set(SOURCE_FILES
src/Game/LevelSurface.h
src/Game/LightMap.h
src/Game/LightSource.h
src/Game/Number.h
src/Game/PairXY.h
src/Game/PathFinder.cpp
src/Game/PathFinder.h
src/Game/Player.cpp
src/Game/Player.h
src/Game/PlayerAI.cpp
src/Game/PlayerAI.h
src/Game/PlayerClass.cpp
src/Game/PlayerClass.h
src/Game/Quest.cpp
Expand Down Expand Up @@ -236,6 +242,8 @@ set(SOURCE_FILES
src/Json/JsonUtils.h
src/Parser/ParseAction.cpp
src/Parser/ParseAction.h
src/Parser/ParseActionGame.cpp
src/Parser/ParseActionGame.h
src/Parser/ParseAnimation.cpp
src/Parser/ParseAnimation.h
src/Parser/ParseAudio.cpp
Expand All @@ -256,6 +264,10 @@ set(SOURCE_FILES
src/Parser/ParseEvent.h
src/Parser/ParseFile.cpp
src/Parser/ParseFile.h
src/Parser/ParseFileBytes.cpp
src/Parser/ParseFileBytes.h
src/Parser/ParseFileGame.cpp
src/Parser/ParseFileGame.h
src/Parser/ParseFont.cpp
src/Parser/ParseFont.h
src/Parser/ParseIcon.cpp
Expand All @@ -264,10 +276,10 @@ set(SOURCE_FILES
src/Parser/ParseImage.h
src/Parser/ParseImageContainer.cpp
src/Parser/ParseImageContainer.h
src/Parser/ParseInputEvent.cpp
src/Parser/ParseInputEvent.h
src/Parser/ParseInputText.cpp
src/Parser/ParseInputText.h
src/Parser/ParseKeyboard.cpp
src/Parser/ParseKeyboard.h
src/Parser/ParseLoadingScreen.cpp
src/Parser/ParseLoadingScreen.h
src/Parser/ParseMenu.cpp
Expand All @@ -284,13 +296,19 @@ set(SOURCE_FILES
src/Parser/ParsePanel.h
src/Parser/ParsePredicate.cpp
src/Parser/ParsePredicate.h
src/Parser/ParsePredicateGame.cpp
src/Parser/ParsePredicateGame.h
src/Parser/Parser.cpp
src/Parser/Parser.h
src/Parser/ParseRectangle.cpp
src/Parser/ParseRectangle.h
src/Parser/ParserProperties.h
src/Parser/ParseScrollable.cpp
src/Parser/ParseScrollable.h
src/Parser/ParseShader.cpp
src/Parser/ParseShader.h
src/Parser/ParseShape.cpp
src/Parser/ParseShape.h
src/Parser/ParseSound.cpp
src/Parser/ParseSound.h
src/Parser/ParseText.cpp
Expand Down Expand Up @@ -323,6 +341,10 @@ set(SOURCE_FILES
src/Parser/Game/ParseSpell.h
src/Parser/Utils/ParseUtils.cpp
src/Parser/Utils/ParseUtils.h
src/Parser/Utils/ParseUtilsGameKey.cpp
src/Parser/Utils/ParseUtilsGameKey.h
src/Parser/Utils/ParseUtilsGameVal.cpp
src/Parser/Utils/ParseUtilsGameVal.h
src/Parser/Utils/ParseUtilsIdx.cpp
src/Parser/Utils/ParseUtilsIdx.h
src/Parser/Utils/ParseUtilsKey.cpp
Expand All @@ -336,6 +358,9 @@ set(SOURCE_FILES
src/Predicates/PredPlayer.h
src/SFML/CompositeSprite.cpp
src/SFML/CompositeSprite.h
src/SFML/dr_wav.h
src/SFML/GradientCircle.cpp
src/SFML/GradientCircle.h
src/SFML/Image2.h
src/SFML/Music2.cpp
src/SFML/Music2.h
Expand All @@ -349,8 +374,12 @@ set(SOURCE_FILES
src/SFML/Text2.h
src/SFML/VertexArray2.cpp
src/SFML/VertexArray2.h
src/SFML/VertexShape.cpp
src/SFML/VertexShape.h
src/SFML/View2.cpp
src/SFML/View2.h
src/SFML/Wave2.cpp
src/SFML/Wave2.h
src/TexturePacks/BitmapFontTexturePack.cpp
src/TexturePacks/BitmapFontTexturePack.h
src/TexturePacks/CachedTexturePack.cpp
Expand All @@ -373,8 +402,11 @@ set(SOURCE_FILES
src/Utils/Helper2D.h
src/Utils/iterator_tpl.h
src/Utils/LRUCache.h
src/Utils/Number.h
src/Utils/NumberVector.h
src/Utils/PairXY.h
src/Utils/ReverseIterable.h
src/Utils/UnorderedStringMap.h
src/Utils/Utils.cpp
src/Utils/Utils.h
)
Expand Down Expand Up @@ -406,6 +438,8 @@ if(DGENGINE_DIABLO_FORMAT_SUPPORT)
SET(SOURCE_FILES ${SOURCE_FILES}
src/DS1.cpp
src/DS1.h
src/Min.cpp
src/Min.h
src/Game/LevelHelper.cpp
src/Game/LevelHelper.h
src/ImageContainers/CELImageContainer.cpp
Expand All @@ -429,22 +463,13 @@ endif()

add_executable(${PROJECT_NAME} ${SOURCE_FILES})

target_link_libraries(${PROJECT_NAME} stdc++fs)

if(FFmpeg_FOUND)
include_directories(${FFmpeg_INCLUDES})
target_link_libraries(${PROJECT_NAME} ${FFmpeg_LIBRARIES})
endif()

if(PHYSFS_FOUND)
include_directories(${PHYSFS_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${PHYSFS_LIBRARY})
endif()

if(SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${SFML_LIBRARIES})
endif()
include_directories(${PHYSFS_INCLUDE_DIRS} ${SFML_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${PHYSFS_LIBRARY} ${SFML_LIBRARIES})

set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
2 changes: 1 addition & 1 deletion DGEngine.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28922.388
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DGEngine", "DGEngine.vcxproj", "{B30255A6-E921-4847-9FB1-26842AB465A4}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DGEngine", "Project.vcxproj", "{B30255A6-E921-4847-9FB1-26842AB465A4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.Zlib.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016 DGEngine
Copyright (c) 2020 DGEngine

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
Expand Down
16 changes: 6 additions & 10 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DGEngine is dual licensed.

if you use diablo file formats support (CEL/CL2/COF/DC6/DCC)
the license is GPL3. if you don't use these formats, the license if zLib.
the license is GPL3. if you don't use these formats, the license is zLib.

DGEngine used parts of another project called freeablo (CEL decoding)
licensed under GPL3. The project's author has granted permission to use
Expand Down Expand Up @@ -46,10 +46,6 @@ endian uses the BSD license.

https://github.com/steinwurf/endian

GSL: Guideline Support Library uses the MIT license.

https://github.com/Microsoft/GSL

The Liberation Serif Regular font uses the SIL Open Font License.

http://scripts.sil.org/OFL
Expand All @@ -65,11 +61,7 @@ https://icculus.org/physfs/

RapidJSON uses the MIT license.

https://github.com/miloyip/rapidjson/

rectpack2D uses the MIT license.

https://github.com/TeamHypersomnia/rectpack2D
https://github.com/Tencent/rapidjson

Simple Iterator Template implementation by Vinícius Garcia uses the MIT license.

Expand All @@ -91,6 +83,10 @@ SFML uses the zlib/png license.

https://github.com/SFML/SFML

dr_wav uses the MIT-0 license.

https://github.com/mackron/dr_libs

Other SFML code snippets were taken from the wiki
and should have a permissive license.

Expand Down
Loading

0 comments on commit c34aee0

Please sign in to comment.