Skip to content

Commit

Permalink
Remove Allegro backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Manga authored and Felipe Manga committed Dec 13, 2023
1 parent 62f3d9c commit 2d498e0
Show file tree
Hide file tree
Showing 268 changed files with 18 additions and 83,628 deletions.
65 changes: 9 additions & 56 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,11 @@ option(WITH_DEPRECATED_GLIB_SUPPORT "Enable support for older glib versions" off
option(WITH_DESKTOP_INTEGRATION "Enable desktop integration modules" off)
option(WITH_QT_THUMBNAILER "Enable kde5/qt5 thumnailer" off)

option(USE_SHARED_ALLEGRO4 "Use shared Allegro 4 library (without resize support)" off)
option(ENABLE_MEMLEAK "Enable memory-leaks detector (only for developers)" off)
option(ENABLE_TESTS "Enable the unit tests" off)
option(FULLSCREEN_PLATFORM "Enable fullscreen by default" off)

if(APPLE)
# On OS X Allegro isn't supported anymore
set(USE_ALLEG4_BACKEND off)
option(USE_SDL2_BACKEND "Use SDL2 backend" on)
else()
option(USE_ALLEG4_BACKEND "Use Allegro 4 backend" off)
option(USE_SDL2_BACKEND "Use SDL2 backend" on)
endif()
option(USE_SDL2_BACKEND "Use SDL2 backend" on)

######################################################################
# Profile build type
Expand Down Expand Up @@ -141,6 +133,12 @@ if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()

# tinyxml2
find_library(TINYXML2_LIBRARY NAMES tinyxml2)
find_path(TINYXML2_INCLUDE_DIR NAMES tinyxml2.h)
include_directories(${TINYXML2_INCLUDE_DIR})

if(NOT GEN_ONLY)
# zlib
find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIRS})
Expand Down Expand Up @@ -170,11 +168,6 @@ if(WITH_WEBP_SUPPORT)
include_directories(${WEBP_INCLUDE_DIR})
endif()

# tinyxml2
find_library(TINYXML2_LIBRARY NAMES tinyxml2)
find_path(TINYXML2_INCLUDE_DIR NAMES tinyxml2.h)
include_directories(${TINYXML2_INCLUDE_DIR})

# pixman
find_library(PIXMAN_LIBRARY NAMES pixman pixman-1)
find_path(PIXMAN_INCLUDE_DIR NAMES pixman.h PATH_SUFFIXES pixman-1)
Expand Down Expand Up @@ -240,15 +233,10 @@ else()
message(STATUS "Optional V8 library NOT found. Disabling V8 scripting engine.")
endif()

if(USE_ALLEG4_BACKEND)
set(LOADPNG_LIBRARY loadpng)
set(LOADPNG_INCLUDE_DIR ${LOADPNG_DIR})
include_directories(${LOADPNG_INCLUDE_DIR})
endif()

find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIRS})

endif()
# simpleini
include_directories(${SIMPLEINI_DIR})

Expand All @@ -257,41 +245,6 @@ include_directories(${SIMPLEINI_DIR})

set(PLATFORM_LIBS)

# Allegro 4 backend
if(USE_ALLEG4_BACKEND)
add_definitions(-DUSE_ALLEG4_BACKEND)
add_definitions(-DALLEGRO_NO_FIX_ALIASES)

if(USE_SHARED_ALLEGRO4)
# Find the shared Allegro 4 library
find_library(LIBALLEGRO4_LIBRARY alleg)
find_path(LIBALLEGRO4_INCLUDE_DIR allegro.h)

if(NOT LIBALLEGRO4_LIBRARY)
message(FATAL_ERROR "Allegro 4 not found")
endif()

# Get flags to link programs using allegro-config program
execute_process(COMMAND allegro-config --libs --shared
OUTPUT_VARIABLE LIBALLEGRO4_LINK_FLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)

set(LIBALLEGRO4_LINK_FLAGS ${LIBALLEGRO4_LINK_FLAGS} ${PLATFORM_LIBS})
include_directories(${LIBALLEGRO4_INCLUDE_DIR})
else()
include_directories(${CMAKE_SOURCE_DIR}/src/allegro/include)
include_directories(${CMAKE_BINARY_DIR}/include)

add_definitions(-DALLEGRO4_WITH_RESIZE_PATCH)
add_definitions(-DALLEGRO4_WITH_EXTRA_CURSORS)

# Static Allegro (the code of Allegro library is embedded).
add_definitions(-DALLEGRO_STATICLINK)

set(LIBALLEGRO4_LINK_FLAGS allegro)
endif()
endif()

# SDL2 backend
if(USE_SDL2_BACKEND)
add_definitions(-DUSE_SDL2_BACKEND)
Expand All @@ -304,7 +257,7 @@ endif()

# -- Unix --

if(UNIX AND NOT APPLE AND NOT BEOS)
if(UNIX AND NOT APPLE AND NOT BEOS AND NOT GEN_ONLY)
# Pthreads
find_package(Threads REQUIRED)
list(APPEND PLATFORM_LIBS m ${CMAKE_THREAD_LIBS_INIT})
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ It tries to replicate some pixel-art algorithms:

And it uses the following third-party libraries:

* [allegro 4.4](https://liballeg.org) (Giftware)
* [curl](http://curl.haxx.se/) (curl)
* [duktape](https://duktape.org) (MIT)
* [freetype](https://www.freetype.org) (FTL)
Expand Down
17 changes: 0 additions & 17 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ To update an existing clone, use the following commands:
git pull
git submodule update --init --recursive

## Backends

LibreSprite can be compiled with two different backends:

1. SDL2 backend (WIP)
2. Allegro backend (deprecated) (Windows and Linux only)

## Dependencies

You'll need the following dependencies to compile LibreSprite:
Expand Down Expand Up @@ -101,16 +94,6 @@ To compile LibreSprite, run the following commands:
cmake -G Ninja ..
ninja libresprite

To compile the legacy Allegro backend, run `cmake` with the flags
`-DUSE_SDL2_BACKEND=off -DUSE_ALLEG4_BACKEND=on`.

The repository contains a patched version of the Allegro 4 library.
If you want to use your installed version of Allegro, run `cmake` with
the flag `-DUSE_SHARED_ALLEGRO4=ON`. However, this is not recommended due to
issues with Allegro 4.4
[(1)](https://github.com/aseprite/aseprite/issues/192)
[(2)](https://github.com/LibreSprite/LibreSprite/commit/27b55030e26e93c5e8d9e7e21206c8709d46ff22).

### Windows details

Run the following in mingw32.exe:
Expand Down
66 changes: 0 additions & 66 deletions cmake/Toolchain-mingw.cmake

This file was deleted.

0 comments on commit 2d498e0

Please sign in to comment.