-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove hqx Remove scaling
- Loading branch information
Showing
41 changed files
with
679 additions
and
13,126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
# - Locate SDL2 library (modified from CMake's FindSDL.cmake) | ||
# This module defines | ||
# SDL2_LIBRARY, the name of the library to link against | ||
# SDL2_FOUND, if false, do not try to link to SDL | ||
# SDL2_INCLUDE_DIR, where to find SDL.h | ||
# SDL2_VERSION_STRING, human-readable string containing the version of SDL2 | ||
# | ||
# This module responds to the the flag: | ||
# SDL2_BUILDING_LIBRARY | ||
# If this is defined, then no SDL_main will be linked in because | ||
# only applications need main(). | ||
# Otherwise, it is assumed you are building an application and this | ||
# module will attempt to locate and set the the proper link flags | ||
# as part of the returned SDL2_LIBRARY variable. | ||
# | ||
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration | ||
# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library | ||
# (SDL2.dll, libsdl2.so, SDL2.framework, etc). | ||
# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again. | ||
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value | ||
# as appropriate. These values are used to generate the final SDL2_LIBRARY | ||
# variable, but when these values are unset, SDL2_LIBRARY does not get created. | ||
# | ||
# | ||
# $SDLDIR is an environment variable that would | ||
# correspond to the ./configure --prefix=$SDLDIR | ||
# used in building SDL. | ||
# | ||
|
||
#============================================================================= | ||
# Copyright 2014 Justin Jacobs | ||
# | ||
# Distributed under the OSI-approved BSD License (the "License"); | ||
# see accompanying file Copyright.txt for details. | ||
# | ||
# This software is distributed WITHOUT ANY WARRANTY; without even the | ||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# See the License for more information. | ||
#============================================================================= | ||
|
||
find_path(SDL2_INCLUDE_DIR SDL.h | ||
HINTS | ||
ENV SDLDIR | ||
PATH_SUFFIXES include/SDL2 include | ||
) | ||
|
||
find_library(SDL2_LIBRARY_TEMP | ||
NAMES SDL2 | ||
HINTS | ||
ENV SDLDIR | ||
PATH_SUFFIXES lib | ||
) | ||
|
||
if(NOT SDL2_BUILDING_LIBRARY) | ||
if(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework") | ||
# Non-OS X framework versions expect you to also dynamically link to | ||
# SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms | ||
# seem to provide SDLmain for compatibility even though they don't | ||
# necessarily need it. | ||
find_library(SDL2MAIN_LIBRARY | ||
NAMES SDL2main | ||
HINTS | ||
ENV SDLDIR | ||
PATH_SUFFIXES lib | ||
PATHS | ||
/sw | ||
/opt/local | ||
/opt/csw | ||
/opt | ||
) | ||
endif() | ||
endif() | ||
|
||
# SDL2 may require threads on your system. | ||
# The Apple build may not need an explicit flag because one of the | ||
# frameworks may already provide it. | ||
# But for non-OSX systems, I will use the CMake Threads package. | ||
if(NOT APPLE) | ||
find_package(Threads) | ||
endif() | ||
|
||
# MinGW needs an additional library, mwindows | ||
# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows | ||
# (Actually on second look, I think it only needs one of the m* libraries.) | ||
if(MINGW) | ||
set(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") | ||
endif() | ||
|
||
if(SDL2_LIBRARY_TEMP) | ||
# For SDLmain | ||
if(SDL2MAIN_LIBRARY AND NOT SDL2_BUILDING_LIBRARY) | ||
list(FIND SDL2_LIBRARY_TEMP "${SDL2MAIN_LIBRARY}" _SDL2_MAIN_INDEX) | ||
if(_SDL2_MAIN_INDEX EQUAL -1) | ||
set(SDL2_LIBRARY_TEMP "${SDL2MAIN_LIBRARY}" ${SDL2_LIBRARY_TEMP}) | ||
endif() | ||
unset(_SDL2_MAIN_INDEX) | ||
endif() | ||
|
||
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa. | ||
# CMake doesn't display the -framework Cocoa string in the UI even | ||
# though it actually is there if I modify a pre-used variable. | ||
# I think it has something to do with the CACHE STRING. | ||
# So I use a temporary variable until the end so I can set the | ||
# "real" variable in one-shot. | ||
if(APPLE) | ||
set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa") | ||
endif() | ||
|
||
# For threads, as mentioned Apple doesn't need this. | ||
# In fact, there seems to be a problem if I used the Threads package | ||
# and try using this line, so I'm just skipping it entirely for OS X. | ||
if(NOT APPLE) | ||
set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT}) | ||
endif() | ||
|
||
# For MinGW library | ||
if(MINGW) | ||
set(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP}) | ||
endif() | ||
|
||
# Set the final string here so the GUI reflects the final state. | ||
set(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found") | ||
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI | ||
set(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "") | ||
endif() | ||
|
||
if(SDL2_INCLUDE_DIR AND EXISTS "${SDL2_INCLUDE_DIR}/SDL_version.h") | ||
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL_version.h" SDL2_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+[0-9]+$") | ||
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL_version.h" SDL2_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MINOR_VERSION[ \t]+[0-9]+$") | ||
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL_version.h" SDL2_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_PATCHLEVEL[ \t]+[0-9]+$") | ||
string(REGEX REPLACE "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MAJOR "${SDL2_VERSION_MAJOR_LINE}") | ||
string(REGEX REPLACE "^#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MINOR "${SDL2_VERSION_MINOR_LINE}") | ||
string(REGEX REPLACE "^#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_PATCH "${SDL2_VERSION_PATCH_LINE}") | ||
set(SDL2_VERSION_STRING ${SDL2_VERSION_MAJOR}.${SDL2_VERSION_MINOR}.${SDL2_VERSION_PATCH}) | ||
unset(SDL2_VERSION_MAJOR_LINE) | ||
unset(SDL2_VERSION_MINOR_LINE) | ||
unset(SDL2_VERSION_PATCH_LINE) | ||
unset(SDL2_VERSION_MAJOR) | ||
unset(SDL2_VERSION_MINOR) | ||
unset(SDL2_VERSION_PATCH) | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 | ||
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR | ||
VERSION_VAR SDL2_VERSION_STRING) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# - Locate SDL2_image library (modified from Cmake's FindSDL_image.cmake) | ||
# This module defines: | ||
# SDL2_IMAGE_LIBRARIES, the name of the library to link against | ||
# SDL2_IMAGE_INCLUDE_DIRS, where to find the headers | ||
# SDL2_IMAGE_FOUND, if false, do not try to link against | ||
# SDL2_IMAGE_VERSION_STRING - human-readable string containing the version of SDL2_image | ||
# | ||
# For backward compatiblity the following variables are also set: | ||
# SDL2IMAGE_LIBRARY (same value as SDL2_IMAGE_LIBRARIES) | ||
# SDL2IMAGE_INCLUDE_DIR (same value as SDL2_IMAGE_INCLUDE_DIRS) | ||
# SDL2IMAGE_FOUND (same value as SDL2_IMAGE_FOUND) | ||
# | ||
# $SDLDIR is an environment variable that would | ||
# correspond to the ./configure --prefix=$SDLDIR | ||
# used in building SDL. | ||
# | ||
#============================================================================= | ||
# Copyright 2014 Justin Jacobs | ||
# | ||
# Distributed under the OSI-approved BSD License (the "License"); | ||
# see accompanying file Copyright.txt for details. | ||
# | ||
# This software is distributed WITHOUT ANY WARRANTY; without even the | ||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# See the License for more information. | ||
#============================================================================= | ||
|
||
if(NOT SDL2_IMAGE_INCLUDE_DIR AND SDL2IMAGE_INCLUDE_DIR) | ||
set(SDL2_IMAGE_INCLUDE_DIR ${SDL2IMAGE_INCLUDE_DIR} CACHE PATH "directory cache | ||
entry initialized from old variable name") | ||
endif() | ||
find_path(SDL2_IMAGE_INCLUDE_DIR SDL_image.h | ||
HINTS | ||
ENV SDLIMAGEDIR | ||
ENV SDLDIR | ||
PATH_SUFFIXES include/SDL2 include | ||
) | ||
|
||
if(NOT SDL2_IMAGE_LIBRARY AND SDL2IMAGE_LIBRARY) | ||
set(SDL2_IMAGE_LIBRARY ${SDL2IMAGE_LIBRARY} CACHE FILEPATH "file cache entry | ||
initialized from old variable name") | ||
endif() | ||
find_library(SDL2_IMAGE_LIBRARY | ||
NAMES SDL2_image | ||
HINTS | ||
ENV SDLIMAGEDIR | ||
ENV SDLDIR | ||
PATH_SUFFIXES lib | ||
) | ||
|
||
if(SDL2_IMAGE_INCLUDE_DIR AND EXISTS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h") | ||
file(STRINGS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL2_IMAGE_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+[0-9]+$") | ||
file(STRINGS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL2_IMAGE_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+[0-9]+$") | ||
file(STRINGS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL2_IMAGE_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+[0-9]+$") | ||
string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_IMAGE_VERSION_MAJOR "${SDL2_IMAGE_VERSION_MAJOR_LINE}") | ||
string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_IMAGE_VERSION_MINOR "${SDL2_IMAGE_VERSION_MINOR_LINE}") | ||
string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_IMAGE_VERSION_PATCH "${SDL2_IMAGE_VERSION_PATCH_LINE}") | ||
set(SDL2_IMAGE_VERSION_STRING ${SDL2_IMAGE_VERSION_MAJOR}.${SDL2_IMAGE_VERSION_MINOR}.${SDL2_IMAGE_VERSION_PATCH}) | ||
unset(SDL2_IMAGE_VERSION_MAJOR_LINE) | ||
unset(SDL2_IMAGE_VERSION_MINOR_LINE) | ||
unset(SDL2_IMAGE_VERSION_PATCH_LINE) | ||
unset(SDL2_IMAGE_VERSION_MAJOR) | ||
unset(SDL2_IMAGE_VERSION_MINOR) | ||
unset(SDL2_IMAGE_VERSION_PATCH) | ||
endif() | ||
|
||
set(SDL2_IMAGE_LIBRARIES ${SDL2_IMAGE_LIBRARY}) | ||
set(SDL2_IMAGE_INCLUDE_DIRS ${SDL2_IMAGE_INCLUDE_DIR}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_image | ||
REQUIRED_VARS SDL2_IMAGE_LIBRARIES SDL2_IMAGE_INCLUDE_DIRS | ||
VERSION_VAR SDL2_IMAGE_VERSION_STRING) | ||
|
||
# for backward compatiblity | ||
set(SDL2IMAGE_LIBRARY ${SDL2_IMAGE_LIBRARIES}) | ||
set(SDL2IMAGE_INCLUDE_DIR ${SDL2_IMAGE_INCLUDE_DIRS}) | ||
set(SDL2IMAGE_FOUND ${SDL2_IMAGE_FOUND}) | ||
|
||
mark_as_advanced(SDL2_IMAGE_LIBRARY SDL2_IMAGE_INCLUDE_DIR) |
Oops, something went wrong.