Turn on use of Unicode. (Still not actually used.)

This commit is contained in:
Julie Marchant 2019-06-03 20:20:13 -04:00
parent edd1239f01
commit 1f3f1d46b1
4 changed files with 23 additions and 7 deletions

View File

@ -84,6 +84,8 @@ Project: Starfighter depends on the following libraries to build:
* SDL2 <http://libsdl.org> * SDL2 <http://libsdl.org>
* SDL2_image <http://www.libsdl.org/projects/SDL_image/> * SDL2_image <http://www.libsdl.org/projects/SDL_image/>
* SDL2_mixer <http://www.libsdl.org/projects/SDL_mixer/> * SDL2_mixer <http://www.libsdl.org/projects/SDL_mixer/>
* SDL2_ttf <http://www.libsdl.org/projects/SDL_ttf/>
* utf8proc <https://juliastrings.github.io/utf8proc/>
Once you have all dependencies installed, you can do the following from Once you have all dependencies installed, you can do the following from
a terminal window: a terminal window:

View File

@ -21,12 +21,29 @@ STARFIGHTER_CFLAGS="-DVERSION=\\\"$PACKAGE_VERSION\\\""
# Checks for libraries. # Checks for libraries.
PKG_CHECK_EXISTS([SDL2_mixer], [ PKG_CHECK_EXISTS([SDL2_mixer], [
PKG_CHECK_EXISTS([SDL2_ttf], [
PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image SDL2_mixer SDL2_ttf])
], [
PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image SDL2_mixer]) PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image SDL2_mixer])
STARFIGHTER_CFLAGS="$STARFIGHTER_CFLAGS -DNOFONT"
echo "Note: SDL_ttf not found; Unicode will not be supported."
])
], [ ], [
PKG_CHECK_EXISTS([SDL2_ttf], [
PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image SDL2_ttf])
], [
PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image]) PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image])
STARFIGHTER_CFLAGS="$STARFIGHTER_CFLAGS -DNOFONT"
echo "Note: SDL_ttf not found; Unicode will not be supported."
])
STARFIGHTER_CFLAGS="$STARFIGHTER_CFLAGS -DNOSOUND" STARFIGHTER_CFLAGS="$STARFIGHTER_CFLAGS -DNOSOUND"
echo "Note: SDL_mixer not found; audio will not be supported." echo "Note: SDL_mixer not found; audio will not be supported."
]) ])
PKG_CHECK_MODULES([UTF8PROC], [libutf8proc], [
], [
STARFIGHTER_CFLAGS="$STARFIGHTER_CFLAGS -DNOFONT"
echo "Note: utf8proc not found; Unicode will not be supported."
])
AC_ARG_VAR([SF_SCREEN_WIDTH], [The width of the game window in pixels]) AC_ARG_VAR([SF_SCREEN_WIDTH], [The width of the game window in pixels])
AC_ARG_VAR([SF_SCREEN_HEIGHT], [The height of the game window in pixels]) AC_ARG_VAR([SF_SCREEN_HEIGHT], [The height of the game window in pixels])

View File

@ -6,8 +6,8 @@
bin_PROGRAMS = starfighter bin_PROGRAMS = starfighter
starfighter_CPPFLAGS = $(STARFIGHTER_CFLAGS) -DDATADIR=\"$(pkgdatadir)\" -Wall starfighter_CPPFLAGS = $(STARFIGHTER_CFLAGS) -DDATADIR=\"$(pkgdatadir)\" -Wall
starfighter_CFLAGS = $(SDL_CFLAGS) -lm starfighter_CFLAGS = $(SDL_CFLAGS) $(UTF8PROC_CFLAGS) -lm
starfighter_LDADD = $(SDL_LIBS) starfighter_LDADD = $(SDL_LIBS) $(UTF8PROC_LIBS)
starfighter_SOURCES = \ starfighter_SOURCES = \
Starfighter.c \ Starfighter.c \

View File

@ -17,9 +17,6 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
// Not ready yet
#define NOFONT
#include <ctype.h> #include <ctype.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>