This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Building the SDL frontend (was Re: AI is a pushover & UI)
> >> I assume you are talking about the Tcl interface. It will become obsolete
> >> when the SDL interface is complete, so there are no plans to redesign it.
> >
> >I suppose this means I need to see if I can build the SDL version with
> >Solaris, Cygwin, and VC? :-(
>
> Eventually. But I think Juergen Ruehle already figured out how to build it
> under Cygwin and VC. And since it builds under Linux, Solaris should not be
> too much work.
Actually I haven't tried VC, but cygwin is quite easy with the
following caveats (see below for possibly working diffs):
- SDL is usually built with -mno-cygwin (note that there is a bug in
some releases where this was not consistently so and had to be
fixed manully), therefore -mno-cygwin has to be added to CFLAGS
(note that the last time I looked our top level Makefile.in
hardcodes CFLAGS, which simply should be changed to @CFLAGS@ to
enable configure to be changed to do that automagically).
- The makefiles have to be tweaked as usual:-)
- probably something else I forgot
I've also started on finishing the SDL port, but, as you probably
noticed by now, I'm pretty lazy, so if anybody else wants to complete
it, please don't hold off.
>From the user perspective the main feature that's missing is dialogs
to make the interface rudimentarily playable. Then there has to be a
lot of tweaking.
Unfortunately I think that also the underlying architecture has to be
changed slightly. In my opinion the SDL code needs
- better timing code (running game and UI on Input and Tick events instead
of busy looping)
- refactoring of the graphics update code (its overly complicated and
consequently buggy right now)
- some kind of layout manager (otherwise dialogs become a major PITA)
- removal of a lot of global variables
What I currently have is a working prototype implementation for the
timing code (facilitated by the autoscroll code), a first cut at
graphics update refactoring (needs some more work), and the beginning
of a design for the layout part (no real code yet).
PS: As promised the relevant part of the buildfile diffs I'm using:
--- configure 23 Jan 2001 16:29:05 -0000 1.10
+++ configure 20 Oct 2002 10:26:07 -0000
@@ -1645,9 +1645,32 @@
makefiles="Makefile doc/Makefile kernel/Makefile lib/Makefile images/Makefile misc/Makefile tcltk/Makefile test/Makefile curses/Makefile"
case "${host}" in
-*-*-cygwin* | *-*-mingw32*)
+*-*-cygwin*)
+ if test "${enable_sdl+set}" = set; then
+ if test "${enable_sdl}" = yes; then
+ makefiles="$makefiles"
+ CONFIGTARGET="wsdlconq"
+ CFLAGS="-g -mno-cygwin"
+ HFLAGS=""
+ HOBJS="win32.o socket.o"
+ else
makefiles="$makefiles win/Makefile"
CONFIGTARGET="wconq"
+ CFLAGS="-g"
+ HFLAGS=""
+ HOBJS="win32.o socket.o"
+ fi
+ else
+ makefiles="$makefiles win/Makefile"
+ CONFIGTARGET="wconq"
+ CFLAGS=""
+ HFLAGS=""
+ HOBJS="win32.o socket.o"
+ fi
+ ;;
+*-*-mingw32*)
+ makefiles="$makefiles sdl/Makefile"
+ CONFIGTARGET="wsdlconq"
HFLAGS=""
HOBJS="win32.o socket.o"
;;
--- Makefile.in 11 Oct 2002 21:12:18 -0000 1.13
+++ Makefile.in 20 Oct 2002 10:25:57 -0000
@@ -46,11 +46,11 @@
SELFILE = SelFile
SUBDIRS = kernel $(SELFILE) x11 curses tcl tk tcltk sdl lib images doc test misc
CC = @CC@
-CFLAGS = -g
+CFLAGS = @CFLAGS@
RANLIB = ranlib
@@ -132,17 +132,29 @@
true; \
fi
-# Target for building Windows Xconq.
+# Targets for building Windows Xconq.
-all-wconq: all-kernel all-tcltk all-sdl all-tcl all-tk
+all-wconq: all-kernel all-tcltk
@dir=win; \
if [ -f ./$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
srcroot=`cd $(srcdir); pwd`; export srcroot; \
- (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
+ (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) wconq); \
+ else \
+ true; \
+ fi
+
+all-wsdlconq: all-kernel all-sdl
+ @dir=sdl; \
+ if [ -f ./$${dir}/Makefile ] ; then \
+ r=`pwd`; export r; \
+ srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) wsdlconq); \
else \
true; \
fi
+
+# library targets
all-tcltk:
@dir=`echo $@ | sed -e 's/all-//'`; \
CC = @CC@
-CFLAGS = -g
+CFLAGS = @CFLAGS@
RANLIB = ranlib
--- sdl/Makefile.in 27 Aug 2001 15:57:24 -0000 1.3
+++ sdl/Makefile.in 20 Oct 2002 10:26:16 -0000
@@ -38,6 +38,12 @@
RANLIB = @RANLIB@
+KERNEL_LIB = ../kernel/libconq.a
+
+LOW_LIB = ../kernel/libconqlow.a
+
+SDLUI_LIB = ../sdl/libsdlui.a
+
# Host and target-dependent makefile fragments come in here.
####
# End of host and target-dependent makefile fragments.
@@ -95,6 +101,8 @@
ALL_CFLAGS = $(CFLAGS) $(HFLAGS) -I$(srcdir) -I$(srcdir)/.. -I$(krnsrcdir) `sdl-config --cflags`
+LDFLAGS = `sdl-config --libs`
+
.c.o:
$(CC) -c $(ALL_CFLAGS) $<
@@ -109,6 +117,11 @@
$(AR) $(AR_FLAGS) libsdlui.a $(OBJS)
$(RANLIB) libsdlui.a
+# windows sdlconq
+wsdlconq: sdlwin32.o $(SDLUI_LIB) $(KERNEL_LIB) $(LOW_LIB)
+ rm -f sdlconq.exe
+ $(CC) $(CFLAGS) -o sdlconq sdlwin32.o $(SDLUI_LIB) $(KERNEL_LIB) $(LOW_LIB) $(LDFLAGS) -lws2_32
+
install: all install-only
install-only:
@@ -117,7 +130,7 @@
clean:
rm -f *.o lint.out core
- rm -f *.a *conq *.log
+ rm -f *.a *conq *.log *.exe
distclean: clean
rm -f Makefile config.status
@@ -130,6 +143,7 @@
# All the .h dependencies.
+sdlwin32.o: $(ALL_H) $(SDL_H)
sdlmain.o: $(ALL_H) $(SDL_H)
sdlinit.o: $(ALL_H) $(SDL_H)
sdlcmd.o: $(ALL_H) $(SDL_H)