diff options
author | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-08-23 17:07:46 +0000 |
---|---|---|
committer | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-08-23 17:07:46 +0000 |
commit | b25208caa5f84ac6c370314945c6f110261d2c70 (patch) | |
tree | c477c16395f409c901bc7d405b14db67ff4a4d90 /crawl-ref/source/rltiles/makefile.unix | |
parent | 02bae5372f40ac282701831cc61deb2483938876 (diff) | |
download | crawl-ref-b25208caa5f84ac6c370314945c6f110261d2c70.tar.gz crawl-ref-b25208caa5f84ac6c370314945c6f110261d2c70.zip |
RLTiles complete code rewrite: now much more robust and functional.
Added PNG and non-palettized image input. Added PNG output. Added better tile
packing and support for tiles of different sizes. Converted all BMPs to PNGs
(for space and explicit transparency reasons.) Added the 48x32 pandemonium
demon tiles, but these are not yet used in game. Added Bill B.'s portal tile
(finally).
The Win32 makefiles are not updated quite yet and thus will not build. Sorry.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6850 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/rltiles/makefile.unix')
-rw-r--r-- | crawl-ref/source/rltiles/makefile.unix | 147 |
1 files changed, 32 insertions, 115 deletions
diff --git a/crawl-ref/source/rltiles/makefile.unix b/crawl-ref/source/rltiles/makefile.unix index 33d3a6b6e2..a6bff9643e 100644 --- a/crawl-ref/source/rltiles/makefile.unix +++ b/crawl-ref/source/rltiles/makefile.unix @@ -1,128 +1,45 @@ -########################################################################## -# makefile.unix -# -# This is a makefile to build all the rltiles files needed for Dungeon -# Crawl - Stone Soup. -# -# - Enne (enne.walker@gmail.com) -# -SRC = tool/ -B2PSRC = bmp2png/ -B2P = bmp2png -B2PTOOL = $(B2PSRC)$(B2P) +SDL_CFLAGS := $(shell sdl-config --cflags) +SDL_LDFLAGS := $(shell sdl-config --libs) -CC = cc -DELETE = rm -f - -OBJECTS = \ -$(SRC)bm.o \ -$(SRC)dcpl.o \ -$(SRC)dctile.o - -TOOLS = \ -dcpl \ -dctile - -EXTRATOOLS = \ -dcreverse - -HEADERS = \ -tiledef.h \ -tiledef-p.h \ -tilep-cmt.h \ -tiledef-dngn.h \ -tilecount-dngn.h \ -map.htm - -ALLTOOLS = $(TOOLS) $(EXTRATOOLS) - -GENERATEDBMP = \ -tile.bmp \ -player.bmp \ -dngn.bmp - -TILEBMP = \ -$(GENERATEDBMP) \ -title.bmp - -TILEPNG = $(TILEBMP:.bmp=.png) - -########################################################################## -# Top-level -# - -all: tools tiles - -tools: $(TOOLS) +ifeq ($(strip $(OSX)),y) +PNG_INCLUDE := -I/sw/include +PNG_LIB := -L/sw/lib +else +PNG_INCLUDE := +PNG_LIB := +endif -tiles: $(TILEBMP) $(TILEPNG) +CFLAGS := $(SDL_CFLAGS) $(PNG_INCLUDE) +LDFLAGS := $(SDL_LDFLAGS) $(PNGLIB) -lSDL_Image -lpng -########################################################################## -# Tools -# -# Note: dcreverse is not built by default. It does the opposite -# of dctile. It takes a bitmap with lots of tiles, specifies regions, -# and cuts them out into smaller pieces. It's useful only for when somebody -# updates the tiles directly and then doesn't give you the source files. -# Not that I'm bitter. -# - -depend: $(OBJECTS:.o=.c) - @for i in $^; do \ - $(CC) -c $$i - -dcpl: $(SRC)dcpl.o $(SRC)bm.o - $(CC) $(SRC)dcpl.o $(SRC)bm.o -o dcpl - -dctile: $(SRC)dctile.o $(SRC)bm.o - $(CC) $(SRC)dctile.o $(SRC)bm.o -o dctile - -dcreverse: $(SRC)dcreverse.o $(SRC)bm.o - $(CC) $(SRC)dcreverse.o $(SRC)bm.o -o dcreverse - -########################################################################## -# Bitmaps -# - -# NOTE: the dependencies here aren't fantastic. In an ideal world, -# there would be another tool elf that could read an input text file -# and then output the .bmp and .txt dependencies for it. It's kind -# of a low priority though, as tiles will be rebuilt infrequently. - -dngn.bmp: dngn.txt dctile - ./dctile dngn.txt - -tile.bmp: dc-2d.txt dctile - ./dctile dc-2d.txt - -player.bmp: dc-pl.txt dcpl - ./dcpl dc-pl.txt +CXX = g++ +DELETE = rm -f -wall2d.bmp: dc-wall2d.txt dctile - ./dctile dc-wall2d.txt +TOOLDIR := tool +TILEGEN := $(TOOLDIR)/tilegen.elf -########################################################################## -# PNG Conversion -# +INPUTS := main dngn player demon +INPUTFILES := $(INPUTS:%=dc-%.txt) +HEADERS := $(INPUTS:%=tiledef-%.h) +SOURCE := $(INPUTS:%=tiledef-%.cc) +IMAGES := $(INPUTS:%=%.png) -$(B2PTOOL): - cd $(B2PSRC) && make -f makefile.lin $(B2P) && cd .. +BASE_OBJECTS := tile_colour.o tile.o tile_page.o tile_list_processor.o main.o +OBJECTS := $(BASE_OBJECTS:%=$(TOOLDIR)/%) -%.png: %.bmp $(B2PTOOL) - $(DELETE) $@ - $(B2PTOOL) -Q $< +all: $(TILEGEN) $(HEADERS) $(SOURCE) $(IMAGES) -########################################################################## -# Cleaning... -# +tiledef-%.h tiledef-%.cc %.png: dc-%.txt $(TILEGEN) + $(TILEGEN) $< clean: - $(DELETE) $(OBJECTS) - $(DELETE) $(ALLTOOLS) - cd $(B2PSRC) && make -f makefile.lin clean && cd .. + $(DELETE) $(HEADERS) $(OBJECTS) $(TILEGEN) $(SOURCE) $(IMAGES) distclean: clean - $(DELETE) $(GENERATEDBMP) - $(DELETE) $(TILEPNG) - $(DELETE) $(HEADERS) + +.cc.o: + ${CXX} ${CFLAGS} -c $< -o $@ + +$(TILEGEN): $(OBJECTS) + ${CXX} ${LDFLAGS} $(OBJECTS) -o $@ |