Skip to content

Commit

Permalink
- update minimum SFML version to 2.4 (fix deprecated get/setColor)
Browse files Browse the repository at this point in the history
- embed sfeMovie
- update cmake to add FFmpeg FindFFMPEG.cmake
- update deprecated code for FFMPEG3 upgrade in sfeMovie (90%)
- remove unused code from sfeMovie (SubtitleStream)

- add isUsable to item
- add touch support (untested)
- add UIText interface
- execute action given drawable id and action name
- refactor buttons
- refactor cel decoding (fix small font)
- refactor input events code
- refactor setText actions into one (text.setText)
- refactor StringButton, Text2
- update android minimum version
- update itemClass description to support skipping matches
- update UIObject interface to add method to get action

- update gamefiles
- resize level panel if user panels are open/closed and if size = 640x480
- update item prefixes and descriptions
- update level right click
  • Loading branch information
demo committed Jul 2, 2017
1 parent 6b516e9 commit 59f7c0c
Show file tree
Hide file tree
Showing 167 changed files with 7,500 additions and 2,647 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
/DGEngine
/DIABDAT
/DIABDAT.*
/FFMPEG*
/FFmpeg*
/gamefiles.zip
/gamefilesd.zip
/gamefilesd/res/icon.png
Expand Down
40 changes: 23 additions & 17 deletions BUILD.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Windows

To compile in Windows, you need Visual Studio 2015, since this project
uses C++ features that are present only in VS2015.
To compile in Windows, you need Visual Studio 2017, since this project
uses C++ features that are present only in VS2017.

The provided project expects the following folders in the root of the
project to build properly.
Expand All @@ -11,8 +11,11 @@ project to build properly.

/SFML - http://www.sfml-dev.org/files/SFML-2.3.2-windows-vc14-32-bit.zip

/sfeMovie - https://github.com/Yalir/sfeMovie/tree/feature/OpenFromStream
Use this branch of sfeMovie that has OpenFromStream.
/FFmpeg - http://ffmpeg.zeranoe.com/builds/
Get both 32 bit shared and dev packages (version 2.x or 3.x)

DGEngine now bundles a modified version of sfeMovie (no subtitle support,
FFmpeg 3.x API suport), so you only need FFmpeg >= 2.8 now.

If you want to skip movie playback support, use the preprocessor define
USE_SFML_MOVIE_STUB which uses a stub class that does nothing instead.
Expand All @@ -22,15 +25,13 @@ sfeMovie with OpenFromStream support installed. Use this to fix that.
To prevent missing DLL errors when running from Visual Studio,
place the following in the root of the project:

avcodec-56.dll (sfeMovie)
avdevice-56.dll (sfeMovie)
avfilter-5.dll (sfeMovie)
avformat-56.dll (sfeMovie)
avutil-54.dll (sfeMovie)
avcodec-56.dll (FFmpeg 2)
avdevice-56.dll (FFmpeg 2)
avfilter-5.dll (FFmpeg 2)
avformat-56.dll (FFmpeg 2)
avutil-54.dll (FFmpeg 2)
openal32.dll (SFML)
physfs.dll (PhysicsFS)
sfeMovie-d.dll (sfeMovie)
sfeMovie.dll (sfeMovie)
sfml-audio-2.dll (SFML)
sfml-audio-d-2.dll (SFML)
sfml-graphics-2.dll (SFML)
Expand All @@ -41,8 +42,8 @@ sfml-system-2.dll (SFML)
sfml-system-d-2.dll (SFML)
sfml-window-2.dll (SFML)
sfml-window-d-2.dll (SFML)
swresample-1.dll (sfeMovie)
swscale-3.dll (sfeMovie)
swresample-1.dll (FFmpeg 2)
swscale-3.dll (FFmpeg 2)

Linux

Expand All @@ -52,15 +53,20 @@ and to have both PhysicsFS and SFML installed.
sudo apt-get install libphysfs-dev
sudo apt-get install libsfml-dev

You also need to use the preprocessor define USE_SFML_MOVIE_STUB to skip
movie support. You can try to get it to use sfeMovie for Linux on your own.
The provided CMake project does this by default.
Optional (for movie support) FFmpeg:

sudo apt-get install libavdevice-dev libavformat-dev libavfilter-dev libavcodec-dev libswscale-dev libavutil-dev

Movie support is enabled by default (CMake), unless FFmpeg isn't found.
In CMake, set DGENGINE_MOVIE_SUPPORT to FALSE to skip movie support.

CMake

A CMake project file is provided. It doesn't add video playback support.
A CMake project file is provided. Movie support is enabled by default.
It will generate a project to compile on the target platform.

cmake CMakeLists.txt
cmake CMakeLists.txt -DDGENGINE_MOVIE_SUPPORT:BOOL=FALSE

Both PhysicsFS and SFML must be installed.
FFmpeg is also required for movie support.
76 changes: 59 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,27 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)

project(DGEngine)

include_directories(./src)
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
message(FATAL_ERROR "GCC 5.0+ is required")
endif()

add_definitions(-DUSE_SFML_MOVIE_STUB)
if(NOT BEOS)
add_definitions(-Wall)
endif()
endif()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules")

option(DGENGINE_MOVIE_SUPPORT "Enable Movie support" TRUE)

if(DGENGINE_MOVIE_SUPPORT)
find_package(FFmpeg COMPONENTS avcodec avformat avutil swscale)
endif()
find_package(PhysFS REQUIRED)
find_package(SFML 2.3 REQUIRED system window graphics network audio)

include_directories(./src)

set(SOURCE_FILES
src/Main.cpp
Expand Down Expand Up @@ -84,11 +102,14 @@ set(SOURCE_FILES
src/StringText.h
src/Text2.cpp
src/Text2.h
src/TextUtils.cpp
src/TextUtils.h
src/TileSet.cpp
src/TileSet.h
src/UIObject.h
src/Utils.cpp
src/Utils.h
src/UIText.h
src/Variable.cpp
src/Variable.h
src/Variant.h
Expand Down Expand Up @@ -123,6 +144,7 @@ set(SOURCE_FILES
src/Actions/ActSound.h
src/Actions/ActText.h
src/Actions/ActTexture.h
src/Actions/ActUIText.h
src/Actions/ActVariable.h
src/Actions/ActVisibility.h
src/Game/CelLevelObject.cpp
Expand Down Expand Up @@ -261,6 +283,7 @@ set(SOURCE_FILES
src/Parser/Utils/ParseUtilsVal.h
src/Predicates/Predicate.h
src/Predicates/PredIO.h
src/Predicates/PredItem.h
src/Predicates/PredPlayer.h
src/rapidjson/allocators.h
src/rapidjson/document.h
Expand Down Expand Up @@ -304,28 +327,47 @@ set(SOURCE_FILES
src/variant/variant_visitor.hpp
)

add_executable(${PROJECT_NAME} ${SOURCE_FILES})
if(FFmpeg_FOUND)
SET(SOURCE_FILES ${SOURCE_FILES}
src/sfeMovie/AudioStream.cpp
src/sfeMovie/AudioStream.hpp
src/sfeMovie/Demuxer.cpp
src/sfeMovie/Demuxer.hpp
src/sfeMovie/Macros.cpp
src/sfeMovie/Macros.hpp
src/sfeMovie/Movie.cpp
src/sfeMovie/Movie.hpp
src/sfeMovie/MovieImpl.cpp
src/sfeMovie/MovieImpl.hpp
src/sfeMovie/Stream.cpp
src/sfeMovie/Stream.hpp
src/sfeMovie/StreamSelection.cpp
src/sfeMovie/StreamSelection.hpp
src/sfeMovie/Timer.cpp
src/sfeMovie/Timer.hpp
src/sfeMovie/TimerPriorities.cpp
src/sfeMovie/TimerPriorities.hpp
src/sfeMovie/Utilities.cpp
src/sfeMovie/Utilities.hpp
src/sfeMovie/VideoStream.cpp
src/sfeMovie/VideoStream.hpp
)
else()
add_definitions(-DUSE_SFML_MOVIE_STUB)
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
message(FATAL_ERROR "GCC 5.0+ is required")
endif()
add_executable(${PROJECT_NAME} ${SOURCE_FILES})

if(NOT BEOS)
add_definitions(-Wall)
endif()
if(FFmpeg_FOUND)
include_directories(${FFmpeg_INCLUDES})
target_link_libraries(${PROJECT_NAME} ${FFmpeg_LIBRARIES})
endif()

# Detect and add PhysFS
find_package(PhysFS REQUIRED)
if(PHYSFS_FOUND)
include_directories(${PHYSFS_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${PHYSFS_LIBRARY})
include_directories(${PHYSFS_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${PHYSFS_LIBRARY})
endif()

# Detect and add SFML
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
find_package(SFML 2.3 REQUIRED system window graphics network audio)
if(SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${SFML_LIBRARIES})
Expand Down
Loading

0 comments on commit 59f7c0c

Please sign in to comment.