Merge post-0.7.0 commits through 'c8250d8b8' into v0.7.2.

sdl_common.c has lost some commits in the restructuring and those
will need to be replayed over the restructured files for SDL1 and 2.
This commit is contained in:
Michael Martin
2020-04-03 17:43:49 -07:00
597 changed files with 10714 additions and 5297 deletions
+9
View File
@@ -0,0 +1,9 @@
.DS_Store
*.app
build.vars
config.state
config_unix.h
obj
uqm-debug
uqm-wrapper
uqm
+10 -5
View File
@@ -7,7 +7,7 @@ The Ur-Quan Masters port:
-------------------------
Core team (in alphabetical order):
Serge van den Boom <svdb@stack.nl>
Serge van den Boom <serge@vdboom.org>
Mika Kolehmainen <mk@kapsi.fi>
Michael Chapman Martin <mcmartin@gmail.com>
Chris Nelson <chris@toysforbob.com>
@@ -19,13 +19,18 @@ Additional programming (in alphabetical order):
Music remixers (in alphabetical order):
Jouni Airaksinen <markvera@spacesynth.net>
Tore Aune Fjellstad
Espen Gätzschmann
András Barják <forevian@freemail.hu>
Matt Bentley
Tore Aune Fjellstad <void@medievalfuture.com>
Espen Gätzschmann <tilt@medievalfuture.com>
Aaron J. Grier <agrier@poofygoof.com>
A. Keren
Casey Monroe
Dan Nicholson <dan@kosmic.org>
George Nowik <norgio@attbi.com>
Riku Nuottajärvi <riku.nuottajarvi@pp.inet.fi>
Riku Nuottajärvi <riku.nuottajarvi@pp.inet.fi>
Erol Otus <erol@toysforbob.com>
Greg Szymanski
Other contributions (in alphabetical order):
Jouni Airaksinen <markvera@spacesynth.net> (Startup Menu)
@@ -138,7 +143,7 @@ Additional writing:
Music:
Burke Treischmann
Dan Nicholson
Riku Nuottajärvi
Riku Nuottajärvi
Eric Berge
Erol Otus
Marc Brown
+55 -1
View File
@@ -1,4 +1,58 @@
Changes towards version 0.7.1:
0.7.2:
- Some added documentation for UIO.
- Added a StringHashTable type.
- A few superficial fixes to charhashtable.
- Removed GraphicsLock and made comm callbacks queued - Alex
- Split debug key function into sync and async parts, paving the way
for GraphicsLock removal - Alex
- PageUp/PageDown now add/remove 10 fuel in the shipyard, from
Scott A. Colcord, Nic
- Annihigate flash thread - SvdB
- Switch SetFlashRect() to the new flash code - SvdB
- Add C++ support to the build system, from Scott A. Colcord
- Cleaning up DoModifyShips() - SvdB
- Added Valgrind suppression file, from Louis Delacroix
- Fix several memory leaks, from Loius Delacroix
- Some cleanups / warnings fixes, from Louis Delacroix
- Added a free callback function for the values of the key-value pairs
in hash tables - SvdB
- Annigilate ActivateStarShip() - SvdB
- Removed obsolete RESPONSE_TO_REF() - SvdB
- Don't require the 'shadow' dir in addon packs, from Alex
- Make use of GAME_STATE_FILE consistently, from Scott A. Colcord
- Fixed unconst(), from Scott A. Colcord
- Fixes to a few small bugs in UIO which shouldn't have had an impact on
UQM, but would in the future, from Alex
- Allow F6 as a default alternate search key, from related projects.
- "Player 1" and "Player 2" are now "Bottom" and "Top" player (#954) - McM
- Fix Utwig dialog inconsistency (#756) - McM
- Use a deterministic seed for Melnorme modules-for-fuel deals (#567) - McM
- Various warnings cleanup (bug #50), from Scott A. Colcord
- Fixed various Pkunk reincarnation and Shofixti Glory device interactions;
Pkunk ditty plays in a simultaneous destruction (bug #666) - Alex
- Preparing for linking with C++ code, from Scott A. Colcord
- Fixed player's phrase leading to Tanaka's response about a solitary
vigil (bug #859) - Alex
- Added the Ur-Quan to the list of starfaring races on which Commander
Hayes provides info (bug #865) - Alex
- Commander Hayes now advises the player correctly on the number of
landers one needs (bug #1098) - Alex
- All Sound Options are now preserved between visits to the setup menu.
Some options still require a restart (bug #1132) - Alex
- Removed the remnants of the --music option (bug #1133) - Alex
- Fixed flagship re-entering the inner system after an encounter in the
outer system, thus trapping the player (bug #1135) - Alex
- Fixed starmap fuel range circle shrinking (bug #1130) - Alex
- Added gamma correction to the setup menu (bug #977) - Alex, Nic
- Refactor Melnorme comm code to make modding easier; step 1 (bug #1128),
from Scott A. Colcord
- Added aspect ratio option to the setup menu - Alex
- Positional audio setup menu option now has an immediate effect - Alex
- Added speech option which controls loading of 3dovoice addon (no need
to set speech volume to 0 anymore) - Alex
- Added the MetaChron story to the no-voice Melnorme script (bug #43) - Alex
0.7.1:
- New SDL2 backend for modern operating systems - Micahel
- Fixed netplay when compiling against modern versions of Visual
Studio, from Ala-lala
+8 -8
View File
@@ -5,7 +5,7 @@ These guidelines are there so that you won't waste both our and your time.
Before making changes:
- Read this entire document
- See if the the Bugzilla bug database at
- See if the Bugzilla bug database at
http://bugs.uqm.stack.nl/ contains any comments on what you're planning
to do.
- Make sure you're using the most recent Subversion version
@@ -26,9 +26,9 @@ Making changes:
we don't even always do, but we've accepted this as our standard. The main
reason is that this is very close to the original style.
Trying to start a discussion about the standard is pointless and is
definately NOT appreciated.
definitely NOT appreciated.
- Use 1 tab per indentation level
- Use no more than 76 chars on a line, when using a tabsize of 4.
- Use no more than 76 chars on a line, when using a tab size of 4.
- Use 2 extra indentation levels for the continuation of a broken line,
like this:
if (blablablabla || foobar ||
@@ -47,7 +47,7 @@ Making changes:
}
(Though in this particular case, I personally would repeat the 'long',
or place l and m on the same line)
- Put { on a seperate line, both for the start of a function and
- Put { on a separate line, both for the start of a function and
for the start of a block.
- one space around binary operators, and after commas.
- one space between the function name and following '(', both in
@@ -65,8 +65,8 @@ Making changes:
because you think that would be easier than trying to understand the
original. If you don't have the skills or patience to do so, this is not
the place for you.
- Only use portable functions. The code is intended to work on Windows,
Linux, FreeBSD, BeOS and MacOS X.
- Only use portable functions. The code is intended to work on Windows
(MSVC 6), Linux (GCC 4), FreeBSD (GCC 4) and MacOS X (GCC 4).
Try to avoid unnecessary system-dependant code, but use #ifdefs if you
really have to.
- No shortcuts. Don't assume anything about user input (like the length),
@@ -101,7 +101,7 @@ Getting the patches committed:
mentioning an URL where we can get the patch.
The committers are listed below (in alphabetical order), with their
particular field of expertise with the source. Though all of us
should have enough experience to deal with most issues not explicitely
should have enough experience to deal with most issues not explicitly
mentioned.
Serge van den Boom (svdb at stack.nl), SvdB at #sc2
- Resource system
@@ -113,7 +113,7 @@ Getting the patches committed:
- Graphics
- Sound
- General issues
Michael Martin (mcmartin at stanford.edu), McMartin at #sc2
Michael Martin (mcmartin at mail.com), McMartin at #sc2
- Threading
- Graphics
- Input system
+14
View File
@@ -42,6 +42,13 @@ $(OBJDIR)%.c.d: $(BUILD_ROOT)%.c
fi
$(call act,act_mkdep_c,MKDEP ,$@)
$(OBJDIR)%.cpp.d: $(BUILD_ROOT)%.cpp
@DIR=$(dir $@); \
if [ ! -d $$DIR ]; then \
mkdir -p "$$DIR"; \
fi
$(call act,act_mkdep_cxx,MKDEP ,$@)
$(OBJDIR)%.m.d: $(BUILD_ROOT)%.m
@DIR=$(dir $@); \
if [ ! -d $$DIR ]; then \
@@ -63,6 +70,13 @@ $(OBJDIR)%.m.d: $(BUILD_ROOT)%.m
fi
$(call act,act_cc,CC ,$@)
%.cpp.o:
@DIR=$(dir $@); \
if [ ! -d $$DIR ]; then \
mkdir -p "$$DIR"; \
fi
$(call act,act_cxx,CXX ,$@)
%.m.o:
@DIR=$(dir $@); \
if [ ! -d $$DIR ]; then \
+2
View File
@@ -17,8 +17,10 @@ case "$HOST_SYSTEM" in
;;
esac
uqm_CFLAGS="$uqm_CFLAGS -Isrc"
uqm_CXXFLAGS="$uqm_CXXFLAGS -Isrc"
if [ "$uqm_HAVE_REGEX" = 0 ]; then
uqm_CFLAGS="$uqm_CFLAGS -Isrc/regex"
uqm_CXXFLAGS="$uqm_CXXFLAGS -Isrc/regex"
fi
# Stuff to install under the directory for libraries, as specified during
+7 -3
View File
@@ -20,6 +20,9 @@ HOST_SYSTEM='@HOST_SYSTEM@'
PREPROC_C='@PREPROC_C@'
MKDEP_C='@MKDEP_C@'
COMPILE_C='@COMPILE_C@'
PREPROC_CXX='@PREPROC_CXX@'
MKDEP_CXX='@MKDEP_CXX@'
COMPILE_CXX='@COMPILE_CXX@'
PREPROC_OBJC='@PREPROC_OBJC@'
MKDEP_OBJC='@MKDEP_OBJC@'
COMPILE_OBJC='@COMPILE_OBJC@'
@@ -30,6 +33,7 @@ SED='@SED@'
REZ='@REZ@'
WINDRES='@WINDRES@'
uqm_CFLAGS='@CFLAGS@'
uqm_CXXFLAGS='@CXXFLAGS@'
uqm_LDFLAGS='@LDFLAGS@'
uqm_INSTALL_BINDIR='@INSTALL_BINDIR@'
uqm_INSTALL_LIBDIR='@INSTALL_LIBDIR@'
@@ -54,8 +58,8 @@ MACRO_WIN32='@MACRO_WIN32@'
MACRO___MINGW32__='@MACRO___MINGW32__@'
export BUILD_SYSTEM HOST_SYSTEM DEBUG
export MACRO_WIN32 MACRO___MINGW32__
export uqm_SOUNDMODULE uqm_USE_INTERNAL_MIKMOD uqm_HAVE_GETOPT_LONG
export uqm_OGGVORBIS
export uqm_HAVE_REGEX uqm_USE_WINSOCK uqm_GFXMODULE uqm_HAVE_OPENGL
export uqm_SOUNDMODULE uqm_OGGVORBIS uqm_USE_INTERNAL_MIKMOD
export uqm_HAVE_GETOPT_LONG uqm_HAVE_REGEX uqm_USE_WINSOCK uqm_GFXMODULE
export uqm_HAVE_OPENGL
export uqm_USE_ZIP_IO uqm_USE_PLATFORM_ACCEL uqm_THREADLIB uqm_NETPLAY
+26 -6
View File
@@ -74,7 +74,7 @@ PostBuild_Cmds=rebase -b 0x400000 -x . "../../uqm.exe"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "..\..\src" /I "..\..\src\regex" /D "DEBUG" /D "_DEBUG" /D "DEBUG_TRACK_SEM" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _VW=320 /D _VH=240 /D "HAVE_OPENGL" /D "GFXMODULE_SDL" /D "THREADLIB_SDL" /D "HAVE_OPENAL" /D "HAVE_ZIP" /D "HAVE_JOYSTICK" /D "NETPLAY" /D "ZLIB_DLL" /D "USE_INTERNAL_MIKMOD" /D "USE_PLATFORM_ACCEL" /FR /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "..\..\src" /I "..\..\src\regex" /D "DEBUG" /D "_DEBUG" /D "DEBUG_TRACK_SEM" /D "DEBUG_DCQ_THREADS" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _VW=320 /D _VH=240 /D "HAVE_OPENGL" /D "GFXMODULE_SDL" /D "THREADLIB_SDL" /D "HAVE_OPENAL" /D "HAVE_ZIP" /D "HAVE_JOYSTICK" /D "NETPLAY" /D "ZLIB_DLL" /D "USE_INTERNAL_MIKMOD" /D "USE_PLATFORM_ACCEL" /FR /FD /GZ /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
@@ -101,7 +101,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "..\..\src" /I "..\..\src\regex" /D "DEBUG" /D "_DEBUG" /D "DEBUG_TRACK_SEM" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _VW=320 /D _VH=240 /D "HAVE_OPENGL" /D "GFXMODULE_SDL" /D "THREADLIB_SDL" /D "HAVE_OPENAL" /D "HAVE_ZIP" /D "HAVE_JOYSTICK" /D "NETPLAY" /D "ZLIB_DLL" /D "USE_INTERNAL_MIKMOD" /FR /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "..\..\src" /I "..\..\src\regex" /D "DEBUG" /D "_DEBUG" /D "DEBUG_TRACK_SEM" /D "DEBUG_DCQ_THREADS" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _VW=320 /D _VH=240 /D "HAVE_OPENGL" /D "GFXMODULE_SDL" /D "THREADLIB_SDL" /D "HAVE_OPENAL" /D "HAVE_ZIP" /D "HAVE_JOYSTICK" /D "NETPLAY" /D "ZLIB_DLL" /D "USE_INTERNAL_MIKMOD" /FR /FD /GZ /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
@@ -215,6 +215,14 @@ SOURCE=..\..\src\libs\callback\alarm.h
# End Source File
# Begin Source File
SOURCE=..\..\src\libs\callback\async.c
# End Source File
# Begin Source File
SOURCE=..\..\src\libs\callback\async.h
# End Source File
# Begin Source File
SOURCE=..\..\src\libs\callback\callback.c
# End Source File
# Begin Source File
@@ -1490,6 +1498,10 @@ SOURCE=..\..\src\libs\alarm.h
# End Source File
# Begin Source File
SOURCE=..\..\src\libs\async.h
# End Source File
# Begin Source File
SOURCE=..\..\src\libs\callback.h
# End Source File
# Begin Source File
@@ -2237,6 +2249,10 @@ SOURCE=..\..\src\uqm\planets\solarsys.c
# End Source File
# Begin Source File
SOURCE=..\..\src\uqm\planets\solarsys.h
# End Source File
# Begin Source File
SOURCE=..\..\src\uqm\planets\sundata.h
# End Source File
# Begin Source File
@@ -3138,6 +3154,10 @@ SOURCE=..\..\src\uqm\controls.h
# End Source File
# Begin Source File
SOURCE=..\..\src\uqm\corecode.h
# End Source File
# Begin Source File
SOURCE=..\..\src\uqm\credits.c
# End Source File
# Begin Source File
@@ -3494,6 +3514,10 @@ SOURCE=..\..\src\uqm\starmap.c
# End Source File
# Begin Source File
SOURCE=..\..\src\uqm\starmap.h
# End Source File
# Begin Source File
SOURCE=..\..\src\uqm\state.c
# End Source File
# Begin Source File
@@ -3650,10 +3674,6 @@ SOURCE=..\..\doc\devel\glossary
# End Source File
# Begin Source File
SOURCE=..\..\doc\devel\graphicslock
# End Source File
# Begin Source File
SOURCE=..\..\doc\devel\input
# End Source File
# Begin Source File
+56 -38
View File
@@ -10,6 +10,7 @@ uqm_requirements()
{
# Some requirements:
have_build_tools_language C || exit 1
have_build_tools_language CXX || exit 1
have_build_tool LINK || exit 1
case "$HOST_SYSTEM" in
MINGW32*|cegcc)
@@ -118,16 +119,16 @@ uqm_prepare_config()
nodebug_action() {
case "$HOST_SYSTEM" in
WINSCW)
CFLAGS="$CFLAGS -O2 -d NDEBUG"
CCOMMONFLAGS="$CCOMMONFLAGS -O2 -d NDEBUG"
;;
ARMV5)
CFLAGS="$CFLAGS -O3 -Otime -DNDEBUG"
CCOMMONFLAGS="$CCOMMONFLAGS -O3 -Otime -DNDEBUG"
;;
GCCE)
CFLAGS="$CFLAGS -O3 -DNDEBUG"
CCOMMONFLAGS="$CCOMMONFLAGS -O3 -DNDEBUG"
;;
*)
CFLAGS="$CFLAGS -O3 -DNDEBUG"
CCOMMONFLAGS="$CCOMMONFLAGS -O3 -DNDEBUG"
;;
esac
DEBUG=0
@@ -137,13 +138,13 @@ uqm_prepare_config()
debug_action() {
case "$HOST_SYSTEM" in
WINSCW)
CFLAGS="$CFLAGS -g -O0 -W all -d DEBUG -d _DEBUG"
CCOMMONFLAGS="$CCOMMONFLAGS -g -O0 -W all -d DEBUG -d _DEBUG"
;;
ARMV5|GCCE)
CFLAGS="$CFLAGS -g -O0 -DDEBUG -D_DEBUG"
CCOMMONFLAGS="$CCOMMONFLAGS -g -O0 -DDEBUG -D_DEBUG"
;;
*)
CFLAGS="$CFLAGS -g -O0 -W -Wall -DDEBUG"
CCOMMONFLAGS="$CCOMMONFLAGS -g -O0 -W -Wall -DDEBUG"
LDFLAGS="$LDFLAGS -O0"
;;
esac
@@ -154,40 +155,46 @@ uqm_prepare_config()
strictdebug_action() {
case "$HOST_SYSTEM" in
WINSCW)
CFLAGS="$CFLAGS -g -O0 -W all -d DEBUG -d _DEBUG"
CCOMMONFLAGS="$CCOMMONFLAGS -g -O0 -W all -d DEBUG -d _DEBUG"
;;
ARMV5|GCCE)
CFLAGS="$CFLAGS -g -O0 -DDEBUG -D_DEBUG"
CCOMMONFLAGS="$CCOMMONFLAGS -g -O0 -DDEBUG -D_DEBUG"
;;
*)
CFLAGS="$CFLAGS -O1" # This is needed for -Wunitialized
CFLAGS="$CFLAGS -g -DDEBUG -W -Wall \
-Wbad-function-cast -Wcast-qual -Wmissing-prototypes \
-Wstrict-prototypes -Wmissing-declarations \
CCOMMONFLAGS="$CCOMMONFLAGS -g -O0 -DDEBUG -W -Wall"
# CCOMMONFLAGS="$CCOMMONFLAGS -O1"
# This is needed for -Wunitialized with gcc 3.4
CCOMMONFLAGS="$CCOMMONFLAGS -Wcast-qual -Wmissing-declarations \
-Wwrite-strings -Wimplicit -Wreturn-type -Wformat \
-Wswitch -Wcomment -Wchar-subscripts \
-Wparentheses -Wcast-align \
-Wuninitialized"
# CFLAGS="$CFLAGS -Waggregate-return"
-Wparentheses -Wcast-align -Wuninitialized"
CFLAGS="$CFLAGS -Wbad-function-cast -Wmissing-prototypes \
-Wstrict-prototypes"
# CFLAGS is for flags not valid in C++.
CFLAGS="$CFLAGS -Wdeclaration-after-statement"
# Until we abandon MSVC 6
# CCOMMONFLAGS="$CCOMMONFLAGS -Waggregate-return"
# It's not unreasonable to return structs at times.
# CFLAGS="$CFLAGS "-Wpointer-arith"
# CCOMMONFLAGS="$CCOMMONFLAGS "-Wpointer-arith"
# Some standard header won't even compile with this on
# CFLAGS="$CFLAGS -Wshadow"
# CCOMMONFLAGS="$CCOMMONFLAGS -Wshadow"
# This gives absurd conflicts with standard files,
# like from 'y0 and y1'
# CFLAGS="$CFLAGS -Werror"
# CCOMMONFLAGS="$CCOMMONFLAGS -Werror"
# We shouldn't do this until we actually nail them
# all in the original code. Then we can enforce them
# on ourselves.
# CFLAGS="$CFLAGS -pedantic-errors -ansi -trigraphs" # ANSI
# CFLAGS="$CFLAGS -Wnested-externs"
# CCOMMONFLAGS="$CCOMMONFLAGS -pedantic-errors -ansi -trigraphs" # ANSI
# CCOMMONFLAGS="$CCOMMONFLAGS -Wnested-externs"
# We know they're in the code, and though we'd like to
# get rid of them, they're not bugs.
# CFLAGS="$CFLAGS -Winline"
# CCOMMONFLAGS="$CCOMMONFLAGS -Winline"
# This gives too many warnings which we can do nothing
# about, obscuring legitimate warnings.
CFLAGS=`echo $CFLAGS`
# Remove all the unnecessary spaces from $CFLAGS,
CXXFLAGS=`echo $CXXFLAGS`
CCOMMONFLAGS=`echo $CCOMMONFLAGS`
# Remove all the unnecessary spaces from the flags vars
# for more readable messages.
LDFLAGS="$LDFLAGS -O0"
;;
@@ -211,6 +218,7 @@ uqm_prepare_config()
CHOICE_graphics_OPTION_pure_PRECOND='have_library SDL 1.2.8'
graphics_pure_action() {
CFLAGS="$CFLAGS -DGFXMODULE_SDL -DSDL_DIR=SDL"
CCOMMONFLAGS="$CCOMMONFLAGS -DGFXMODULE_SDL"
GFXMODULE=sdl
HAVE_OPENGL=0
use_library SDL 1.2.8
@@ -252,7 +260,7 @@ uqm_prepare_config()
CHOICE_sound_OPTION_openal_PRECOND="have_library openal"
CHOICE_sound_OPTION_openal_ACTION=sound_openal_action
sound_openal_action() {
CFLAGS="$CFLAGS -DHAVE_OPENAL"
CCOMMONFLAGS="$CCOMMONFLAGS -DHAVE_OPENAL"
SOUNDMODULE=openal
use_library openal
}
@@ -271,14 +279,14 @@ uqm_prepare_config()
CHOICE_ovcodec_OPTION_tremor_PRECOND="have_library tremor"
CHOICE_ovcodec_OPTION_tremor_ACTION=ovcodec_tremor_action
ovcodec_tremor_action() {
CFLAGS="$CFLAGS -DOVCODEC_TREMOR"
CCOMMONFLAGS="$CCOMMONFLAGS -DOVCODEC_TREMOR"
OGGVORBIS=tremor
use_library tremor
}
CHOICE_ovcodec_OPTION_none_TITLE="No Ogg Vorbis support"
CHOICE_ovcodec_OPTION_none_ACTION=ovcodec_none_action
ovcodec_none_action() {
CFLAGS="$CFLAGS -DOVCODEC_NONE"
CCOMMONFLAGS="$CCOMMONFLAGS -DOVCODEC_NONE"
OGGVORBIS=none
}
CHOICE_ovcodec_DEFAULT=standard
@@ -288,7 +296,7 @@ uqm_prepare_config()
CHOICE_mikmod_OPTION_internal_TITLE="Included libmikmod"
CHOICE_mikmod_OPTION_internal_ACTION=mikmod_internal_action
mikmod_internal_action() {
CFLAGS="$CFLAGS -DUSE_INTERNAL_MIKMOD"
CCOMMONFLAGS="$CCOMMONFLAGS -DUSE_INTERNAL_MIKMOD"
USE_INTERNAL_MIKMOD=1
}
CHOICE_mikmod_OPTION_external_TITLE="System libmikmod"
@@ -307,7 +315,7 @@ uqm_prepare_config()
# TODO: Check whether SDL has joystick support.
CHOICE_joystick_OPTION_enabled_ACTION=joystick_enabled_action
joystick_enabled_action() {
CFLAGS="$CFLAGS -DHAVE_JOYSTICK"
CCOMMONFLAGS="$CCOMMONFLAGS -DHAVE_JOYSTICK"
}
CHOICE_joystick_OPTION_disabled_TITLE="disabled"
case "$HOST_SYSTEM" in
@@ -331,7 +339,7 @@ uqm_prepare_config()
CHOICE_netplay_OPTION_full_PRECOND="have_library netlibs"
CHOICE_netplay_OPTION_full_ACTION=netplay_full_action
netplay_full_action() {
CFLAGS="$CFLAGS -DNETPLAY=NETPLAY_FULL"
CCOMMONFLAGS="$CCOMMONFLAGS -DNETPLAY=NETPLAY_FULL"
if [ -n "$MACRO_WIN32" ]; then
LDFLAGS="$LDFLAGS -lws2_32"
fi
@@ -342,7 +350,7 @@ uqm_prepare_config()
CHOICE_netplay_OPTION_ipv4_PRECOND="have_library netlibs"
CHOICE_netplay_OPTION_ipv4_ACTION=netplay_ipv4_action
netplay_ipv4_action() {
CFLAGS="$CFLAGS -DNETPLAY=NETPLAY_IPV4"
CCOMMONFLAGS="$CCOMMONFLAGS -DNETPLAY=NETPLAY_IPV4"
NETPLAY="IPV4"
use_library netlibs
}
@@ -355,7 +363,7 @@ uqm_prepare_config()
CHOICE_ioformat_OPTION_stdio_zip_PRECOND="have_library zlib"
CHOICE_ioformat_OPTION_stdio_zip_ACTION="ioformat_stdio_zip_action"
ioformat_stdio_zip_action() {
CFLAGS="$CFLAGS -DHAVE_ZIP=1"
CCOMMONFLAGS="$CCOMMONFLAGS -DHAVE_ZIP=1"
USE_ZIP_IO=1
use_library zlib
}
@@ -366,7 +374,7 @@ uqm_prepare_config()
CHOICE_accel_OPTION_asm_TITLE="Platform acceleration (asm, etc.)"
CHOICE_accel_OPTION_asm_ACTION="accel_asm_action"
accel_asm_action() {
CFLAGS="$CFLAGS -DUSE_PLATFORM_ACCEL"
CCOMMONFLAGS="$CCOMMONFLAGS -DUSE_PLATFORM_ACCEL"
USE_PLATFORM_ACCEL=1
}
CHOICE_accel_OPTION_plainc_TITLE="Only plain C code"
@@ -381,14 +389,14 @@ uqm_prepare_config()
CHOICE_threadlib_OPTION_sdl_TITLE="SDL-controlled thread library"
CHOICE_threadlib_OPTION_sdl_ACTION="threadlib_sdl_action"
threadlib_sdl_action() {
CFLAGS="$CFLAGS -DTHREADLIB_SDL"
CCOMMONFLAGS="$CCOMMONFLAGS -DTHREADLIB_SDL"
THREADLIB="SDL"
}
CHOICE_threadlib_OPTION_pthread_TITLE="Pthread thread library"
CHOICE_threadlib_OPTION_pthread_PRECOND="have_library pthread"
CHOICE_threadlib_OPTION_pthread_ACTION="threadlib_pthread_action"
threadlib_pthread_action() {
CFLAGS="$CFLAGS -DTHREADLIB_PTHREAD"
CCOMMONFLAGS="$CCOMMONFLAGS -DTHREADLIB_PTHREAD"
THREADLIB="PTHREAD"
use_library pthread
}
@@ -441,7 +449,16 @@ uqm_process_config() {
# Set the content dir
CONTENTDIR="${INSTALL_SHAREDIR}uqm/content"
CFLAGS="$CFLAGS -I\"$BUILD_WORK\""
CCOMMONFLAGS="$CCOMMONFLAGS -I\"$BUILD_WORK\""
# Set C++ only flags
# These allow use of C++ without the standard library
CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions -nostdinc++"
# At this point, all the compiler flags must be set.
CFLAGS="$CFLAGS $CCOMMONFLAGS"
CXXFLAGS="$CXXFLAGS $CCOMMONFLAGS"
CCOMMONFLAGS=""
# Export the HAVE_ symbols to config_unix.h, using config_unix.h.in
# as template (or config_win.h/config_win.h.in).
@@ -457,8 +474,9 @@ uqm_process_config() {
substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES src "$BUILD_WORK"
# Make build.vars from build.vars.in, substituting variables.
SUBSTITUTE_VARS="BUILD_SYSTEM HOST_SYSTEM CFLAGS LDFLAGS LINK \
SUBSTITUTE_VARS="BUILD_SYSTEM HOST_SYSTEM CFLAGS CXXFLAGS LDFLAGS LINK \
PREPROC_C MKDEP_C COMPILE_C \
PREPROC_CXX MKDEP_CXX COMPILE_CXX \
PREPROC_OBJC MKDEP_OBJC COMPILE_OBJC \
MAKE ECHON SED DEBUG JOYSTICK NETPLAY \
OGGVORBIS SOUNDMODULE USE_INTERNAL_MIKMOD \
@@ -470,7 +488,7 @@ uqm_process_config() {
SUBSTITUTE_FILES="build.vars"
substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES . "$BUILD_WORK"
# Make 'uqm' shell script from build.vars.in, substituting variables.
# Make 'uqm' shell script from uqm-wrapper.in, substituting variables.
SUBSTITUTE_VARS="INSTALL_LIBDIR INSTALL_BINDIR INSTALL_SHAREDIR uqm_NAME"
SUBSTITUTE_FILES="uqm-wrapper"
substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES build/unix "$BUILD_WORK"
@@ -601,7 +619,7 @@ uqm_install_osx() {
$PREPROC_C -D__MACOSX__ -include $HEADER - | \
awk '(/'$HEADER_FILE'/ && $2 == 1) { print $3; exit }' | \
$SED 's/.Headers.*$/"/'`
cp -r "$FRAMEWORK" "$INSTROOT/Frameworks"
cp -a "$FRAMEWORK" "$INSTROOT/Frameworks"
done
# Install game content (it should probably make a zipfile)
+2 -2
View File
@@ -99,8 +99,8 @@ if [ -z "$TARGET" ]; then
fi
BUILD_PROJECT="$TARGET"
export TARGET BUILD_PROJECT ECHON
export PREPROC_C MKDEP_C COMPILE_C PREPROC_OBJC MKDEP_OBJC COMPILE_OBJC LINK
export "${BUILD_PROJECT}_CFLAGS" "${BUILD_PROJECT}_LDFLAGS"
export PREPROC_C MKDEP_C COMPILE_C PREPROC_CXX MKDEP_CXX COMPILE_CXX PREPROC_OBJC MKDEP_OBJC COMPILE_OBJC LINK
export "${BUILD_PROJECT}_CFLAGS" "${BUILD_PROJECT}_CXXFLAGS" "${BUILD_PROJECT}_LDFLAGS"
# Add trailing / from objs dir
eval ${BUILD_PROJECT}_OBJS=\${${BUILD_PROJECT}_OBJS%/}/
+4 -2
View File
@@ -106,9 +106,10 @@ build_depend() {
# $1 - additional arguments to pass to make (at the moment just
# an optional -j arg for parallel builds).
build_compile() {
local CFLAGS LDFLAGS TARGET_FILE DEPEND_FILE OBJDIR
local CFLAGS CXXFLAGS LDFLAGS TARGET_FILE DEPEND_FILE OBJDIR
eval CFLAGS="\${${BUILD_PROJECT}_CFLAGS}"
eval CXXFLAGS="\${${BUILD_PROJECT}_CXXFLAGS}"
eval LDFLAGS="\${${BUILD_PROJECT}_LDFLAGS}"
eval OBJDIR=\""\$BUILD_WORK/\${${BUILD_PROJECT}_OBJS}"\"
eval TARGET_FILE=\""\$BUILD_WORK/\${${BUILD_PROJECT}_NAME}"\"
@@ -116,7 +117,7 @@ build_compile() {
eval "${TARGET}_pre_build"
CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS \
CFLAGS=$CFLAGS CXXFLAGS=$CXXFLAGS LDFLAGS=$LDFLAGS \
OBJDIR=$OBJDIR \
BUILD_ROOT= \
TARGET_FILE=$TARGET_FILE DEPEND_FILE=$DEPEND_FILE \
@@ -133,6 +134,7 @@ build_clean() {
eval DEPEND_FILE="\$BUILD_WORK/\${${BUILD_PROJECT}_OBJS}${DEPEND_NAME}"
rm -f "$DEPEND_FILE" "$BUILD_WORK/build.vars" \
"$BUILD_WORK/uqm-wrapper" \
"$BUILD_WORK/config.state"
eval "${TARGET}_clean"
}
+21
View File
@@ -26,6 +26,9 @@
# CFLAGS
SYSTEM_BUILD_CFLAGS=""
# CXXFLAGS
SYSTEM_BUILD_CXXFLAGS=""
# LDFLAGS
SYSTEM_BUILD_LDFLAGS=""
@@ -33,6 +36,9 @@ SYSTEM_BUILD_LDFLAGS=""
BUILDTOOL_PREPROC_C_NAME="C preprocessor"
BUILDTOOL_MKDEP_C_NAME="C dependency generator"
BUILDTOOL_COMPILE_C_NAME="C compiler"
BUILDTOOL_PREPROC_CXX_NAME="C++ preprocessor"
BUILDTOOL_MKDEP_CXX_NAME="C++ dependency generator"
BUILDTOOL_COMPILE_CXX_NAME="C++ compiler"
BUILDTOOL_PREPROC_OBJC_NAME="Objective-C preprocessor"
BUILDTOOL_MKDEP_OBJC_NAME="Objective-C dependency generator"
BUILDTOOL_COMPILE_OBJC_NAME="Objective-C compiler"
@@ -48,6 +54,15 @@ useGccBuildTools() {
BUILDTOOL_COMPILE_C_COMMAND="\$PROG_gcc_FILE -c $EXTRA_PLATFORM_GCC_FLAGS_COMPILE_C"
BUILDTOOL_COMPILE_C_DEPEND='gcc'
BUILDTOOL_PREPROC_CXX_COMMAND="\$PROG_gcc_FILE -E $EXTRA_PLATFORM_GCC_FLAGS_PREPROC_CXX"
BUILDTOOL_PREPROC_CXX_DEPEND='gcc'
BUILDTOOL_MKDEP_CXX_COMMAND="\$PROG_gcc_FILE -MM $EXTRA_PLATFORM_GCC_FLAGS_MKDEP_CXX"
BUILDTOOL_MKDEP_CXX_DEPEND='gcc'
BUILDTOOL_COMPILE_CXX_COMMAND="\$PROG_gcc_FILE -c $EXTRA_PLATFORM_GCC_FLAGS_COMPILE_CXX"
BUILDTOOL_COMPILE_CXX_DEPEND='gcc'
BUILDTOOL_PREPROC_OBJC_COMMAND="\$PROG_gcc_FILE -E $EXTRA_PLATFORM_GCC_FLAGS_PREPROC_OBJC"
BUILDTOOL_PREPROC_OBJC_DEPEND='gcc'
@@ -303,6 +318,12 @@ PROG_gcce_ACTION=""
PROG_gcce_VERSION='$(arm-none-symbianelf-gcc --version)'
### mingw-gcc ###
PROG_mingw_gcc_NAME="GNU C MinGW Cross-compiler"
PROG_mingw_gcc_FILE="i686-pc-mingw32-gcc"
PROG_mingw_gcc_ACTION=""
PROG_mingw_gcc_VERSION='$(i686-pc-mingw32-gcc --version)'
##############################################################################
# Describe the libaries (possibly) used: #
+1 -11
View File
@@ -24,17 +24,7 @@
# CFLAGS
case "$HOST_SYSTEM" in
CYGWIN*)
# HACK: sdl-config on Cygwin supplies -mno-cygwin which means that
# dependencies detected without that flag may not be available at
# the actual build.
SYSTEM_HOST_CFLAGS="-mno-cygwin"
;;
*)
SYSTEM_HOST_CFLAGS=""
;;
esac
SYSTEM_HOST_CFLAGS=""
# LDFLAGS
SYSTEM_HOST_LDFLAGS=""
+4
View File
@@ -7,6 +7,10 @@ define act_mkdep_c
$(MKDEP_C) $(CFLAGS) -o "$(@D)/$(<F).o" "$<" --depend "$@"
endef
define act_mkdep_cxx
$(MKDEP_CXX) $(CXXFLAGS) -o "$(@D)/$(<F).o" "$<" --depend "$@"
endef
define act_link
$(LINK) --create "$@" $^ $(LDFLAGS)
endef
+8
View File
@@ -6,6 +6,10 @@ define act_mkdep_c
$(MKDEP_C) $(CFLAGS) "$<" -MT "$(@D)/$(<F).o" -MF "$@"
endef
define act_mkdep_cxx
$(MKDEP_CXX) $(CXXFLAGS) "$<" -MT "$(@D)/$(<F).o" -MF "$@"
endef
define act_mkdep_m
$(MKDEP_OBJC) $(CFLAGS) "$<" -MT "$(@D)/$(<F).o" -MF "$@"
endef
@@ -18,6 +22,10 @@ define act_cc
$(COMPILE_C) -o "$@" $(CFLAGS) "$<"
endef
define act_cxx
$(COMPILE_CXX) -o "$@" $(CXXFLAGS) "$<"
endef
define act_objcc
$(COMPILE_OBJC) -o "$@" $(CFLAGS) "$<"
endef
+7
View File
@@ -10,3 +10,10 @@ define act_mkdep_c
@rm -f "$@.tmp"
endef
define act_mkdep_cxx
$(MKDEP_C) $(CXXFLAGS) "$<" -o "$@.tmp"
@echo -n "$(@D)/" > $@
@cat "$@.tmp" >> $@
@rm -f "$@.tmp"
endef
+3
View File
@@ -18,3 +18,6 @@
!define PKG_REMIX3_FILE "uqm-remix-disc3.uqm"
!define PKG_REMIX3_MD5SUM "5ccc6d4ac301ae98e172ac6835dcdead"
!define PKG_REMIX3_SIZE 38989
!define PKG_REMIX4_FILE "uqm-remix-disc4.uqm"
!define PKG_REMIX4_MD5SUM "d3dc6036588662391a3820ca6b222dd6"
!define PKG_REMIX4_SIZE 84517
+11
View File
@@ -0,0 +1,11 @@
3domusic = BOOLEAN:true
textmenu = BOOLEAN:false
textgradients = BOOLEAN:false
subtitles = BOOLEAN:false
iconicscan = BOOLEAN:true
3domovies = BOOLEAN:true
speechvol = INT32:100
pulseshield = BOOLEAN:true
smoothmelee = BOOLEAN:true
smoothscroll = BOOLEAN:true
remixmusic = BOOLEAN:false
+63 -92
View File
@@ -14,6 +14,10 @@ Var UQMUSERDATA
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
; The INSTALLER_VERSION is a suffix to the version number for installer patches or to mark
; alpha/beta/release candidate status. In normal releases it is the empty string.
!define INSTALLER_VERSION "-1"
; UQM Package definitions
!include "packages.nsh"
@@ -80,7 +84,7 @@ var ICONS_GROUP
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "uqm-${PRODUCT_VERSION}-installer.exe"
OutFile "uqm-${PRODUCT_VERSION}${INSTALLER_VERSION}-installer.exe"
InstallDir "$PROGRAMFILES\The Ur-Quan Masters\"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
@@ -125,114 +129,74 @@ FunctionEnd
Function RandomServer
Push $0
Push 27
Push 17
Call Random
Pop $0
IntCmp $0 0 0 +4 +4
StrCpy $0 "ovh"
Exch $0
Return
IntCmp $0 1 0 +4 +4
StrCpy $0 "mesh"
Exch $0
Return
IntCmp $0 2 0 +4 +4
StrCpy $0 "aarnet"
Exch $0
Return
IntCmp $0 3 0 +4 +4
StrCpy $0 "switch"
IntCmp $0 1 0 +4 +4
StrCpy $0 "citylan"
Exch $0
Return
IntCmp $0 4 0 +4 +4
StrCpy $0 "superb-sea2"
Exch $0
Return
IntCmp $0 5 0 +4 +4
StrCpy $0 "jaist"
Exch $0
Return
IntCmp $0 6 0 +4 +4
StrCpy $0 "voxel"
Exch $0
Return
IntCmp $0 7 0 +4 +4
StrCpy $0 "heanet"
Exch $0
Return
IntCmp $0 8 0 +4 +4
StrCpy $0 "cdnetworks-us-1"
Exch $0
Return
IntCmp $0 9 0 +4 +4
StrCpy $0 "cdnetworks-us-2"
Exch $0
Return
IntCmp $0 10 0 +4 +4
StrCpy $0 "cdnetworks-kr-1"
Exch $0
Return
IntCmp $0 11 0 +4 +4
StrCpy $0 "surfnet"
Exch $0
Return
IntCmp $0 12 0 +4 +4
StrCpy $0 "cdnetworks-kr-2"
Exch $0
Return
IntCmp $0 13 0 +4 +4
StrCpy $0 "kent"
Exch $0
Return
IntCmp $0 14 0 +4 +4
StrCpy $0 "nchc"
Exch $0
Return
IntCmp $0 15 0 +4 +4
StrCpy $0 "dfn"
Exch $0
Return
IntCmp $0 16 0 +4 +4
IntCmp $0 2 0 +4 +4
StrCpy $0 "freefr"
Exch $0
Return
IntCmp $0 17 0 +4 +4
IntCmp $0 3 0 +4 +4
StrCpy $0 "garr"
Exch $0
Return
IntCmp $0 18 0 +4 +4
IntCmp $0 4 0 +4 +4
StrCpy $0 "heanet"
Exch $0
Return
IntCmp $0 5 0 +4 +4
StrCpy $0 "hivelocity"
Exch $0
Return
IntCmp $0 6 0 +4 +4
StrCpy $0 "ignum"
Exch $0
Return
IntCmp $0 19 0 +4 +4
IntCmp $0 7 0 +4 +4
StrCpy $0 "internode"
Exch $0
Return
IntCmp $0 20 0 +4 +4
IntCmp $0 8 0 +4 +4
StrCpy $0 "iweb"
Exch $0
Return
IntCmp $0 21 0 +4 +4
IntCmp $0 9 0 +4 +4
StrCpy $0 "jaist"
Exch $0
Return
IntCmp $0 10 0 +4 +4
StrCpy $0 "nchc"
Exch $0
Return
IntCmp $0 11 0 +4 +4
StrCpy $0 "netcologne"
Exch $0
Return
IntCmp $0 22 0 +4 +4
StrCpy $0 "leaseweb"
IntCmp $0 12 0 +4 +4
StrCpy $0 "switch"
Exch $0
Return
IntCmp $0 23 0 +4 +4
StrCpy $0 "ncu"
Exch $0
Return
IntCmp $0 24 0 +4 +4
IntCmp $0 13 0 +4 +4
StrCpy $0 "tenet"
Exch $0
Return
IntCmp $0 25 0 +4 +4
StrCpy $0 "transact"
IntCmp $0 14 0 +4 +4
StrCpy $0 "ufpr"
Exch $0
Return
StrCpy $0 "citylan"
IntCmp $0 15 0 +4 +4
StrCpy $0 "voxel"
Exch $0
Return
StrCpy $0 "waix"
Exch $0
FunctionEnd
@@ -251,6 +215,7 @@ Function HandlePackage
Exch $1 # File name
Push $2
Push $3
StrCpy $R9 0 # failure count
# Check to make sure the file wasn't already installed
IfFileExists "$0\$1" 0 NotThere
md5dll::GetFileMD5 "$0\$1"
@@ -289,6 +254,12 @@ AttemptDownload:
StrCmp $2 "success" DownloadSuccessful
StrCmp $2 "cancel" DownloadCanceled
StrCpy $2 "Could not install the package $1 due to the following error: $\"$2$\"."
# Only actually display the error every third try, unless it's a user cancellation. We can't
# really rely on SF.net to have everything at every mirror.
IntOp $R9 $R9 + 1
IntCmp $R9 3 0 AttemptDownload
# If we fell through, reset the count.
StrCpy $R9 0
Goto CheckMandatory
DownloadCanceled:
StrCpy $2 "Download was canceled by user."
@@ -411,7 +382,7 @@ SectionGroup "!UQM" SECGRP01
AddSize ${PKG_CONTENT_SIZE}
StrCpy $MANDATORY 1
StrCpy $MD5SUM "${PKG_CONTENT_MD5SUM}"
File "content\version"
File "..\..\content\version"
StrCpy $DOWNLOADPATH "UQM/0.7/"
Push "${PKG_CONTENT_FILE}"
Push "$INSTDIR\content\packages"
@@ -504,20 +475,20 @@ SectionGroup "Modern Remixes" SECGRP03
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
# Section "Pack 4" SEC08
# SectionIn 6
# AddSize ${PKG_REMIX4_SIZE}
# StrCpy $MANDATORY 0
# StrCpy $MD5SUM "${PKG_REMIX4_MD5SUM}"
# StrCpy $DOWNLOADPATH "UQM%20Remix%20Packs/UQM%20Remix%20Pack%204/"
# Push "${PKG_REMIX4_FILE}"
# Push "$INSTDIR\content\addons"
# Call HandlePackage
# Call EnableRemixes
# ; Shortcuts
# !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
# !insertmacro MUI_STARTMENU_WRITE_END
# SectionEnd
Section "Pack 4" SEC08
SectionIn 6
AddSize ${PKG_REMIX4_SIZE}
StrCpy $MANDATORY 0
StrCpy $MD5SUM "${PKG_REMIX4_MD5SUM}"
StrCpy $DOWNLOADPATH "UQM%20Remix%20Packs/UQM%20Remix%20Pack%204/"
Push "${PKG_REMIX4_FILE}"
Push "$INSTDIR\content\addons"
Call HandlePackage
Call EnableRemixes
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
SectionGroupEnd
Section -ShortcutsAndIcons
@@ -588,7 +559,7 @@ SectionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${SEC05} `Ur-Quan Masters Remix Pack 1 - 'Super Melee!' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
!insertmacro MUI_DESCRIPTION_TEXT ${SEC06} `Ur-Quan Masters Remix Pack 2 - 'Neutral Aliens - Don't Shoot!' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
!insertmacro MUI_DESCRIPTION_TEXT ${SEC07} `Ur-Quan Masters Remix Pack 3 - 'The Ur-Quan Hierarchy.' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
# !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} `Ur-Quan Masters Remix Pack 4 - 'The New Alliance of Free Stars.' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
!insertmacro MUI_DESCRIPTION_TEXT ${SEC08} `Ur-Quan Masters Remix Pack 4 - 'The New Alliance of Free Stars.' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
!insertmacro MUI_FUNCTION_DESCRIPTION_END
+11
View File
@@ -0,0 +1,11 @@
3domusic = BOOLEAN:false
textmenu = BOOLEAN:true
textgradients = BOOLEAN:true
subtitles = BOOLEAN:true
iconicscan = BOOLEAN:false
3domovies = BOOLEAN:false
positionalsfx = BOOLEAN:false
pulseshield = BOOLEAN:false
smoothmelee = BOOLEAN:false
smoothscroll = BOOLEAN:false
remixmusic = BOOLEAN:false
+1 -1
View File
@@ -4,7 +4,7 @@ comm.commander.dialogue = CONVERSATION:base/comm/commander/commander.txt:addons/
comm.druuge.dialogue = CONVERSATION:base/comm/druuge/druuge.txt:addons/3dovoice/druuge/:addons/3dovoice/druuge/druuge.ts
comm.ilwrath.dialogue = CONVERSATION:base/comm/ilwrath/ilwrath.txt:addons/3dovoice/ilwrath/:addons/3dovoice/ilwrath/ilwrath.ts
comm.kohrah.dialogue = CONVERSATION:base/comm/kohrah/kohrah.txt:addons/3dovoice/kohrah/:addons/3dovoice/kohrah/kohrah.ts
comm.melnorme.dialogue = CONVERSATION:base/comm/melnorme/melnorme.txt:addons/3dovoice/melnorme/:addons/3dovoice/melnorme/melnorme.ts
comm.melnorme.dialogue = CONVERSATION:addons/3dovoice/melnorme/melnorme.txt:addons/3dovoice/melnorme/:addons/3dovoice/melnorme/melnorme.ts
comm.mycon.dialogue = CONVERSATION:addons/3dovoice/mycon/mycon.txt:addons/3dovoice/mycon/:addons/3dovoice/mycon/mycon.ts
comm.orz.dialogue = CONVERSATION:base/comm/orz/orz.txt:addons/3dovoice/orz/:addons/3dovoice/orz/orz.ts
comm.pkunk.dialogue = CONVERSATION:base/comm/pkunk/pkunk.txt:addons/3dovoice/pkunk/:addons/3dovoice/pkunk/pkunk.ts
File diff suppressed because it is too large Load Diff
@@ -1324,7 +1324,7 @@ No more history, thank you.
The members of the old Alliance.
#(what_about_hierarchy)
The battle thralls in the Hierarchy.
The Hierarchy and their battle thralls.
#(what_about_other)
Were there any alien races who weren't in the War?
+23 -7
View File
@@ -89,7 +89,7 @@ Shall we begin trading now?
#(WERE_NOT_AFRAID) melnorme-010.ogg
We reel with inchoate fear, and are thrown into a sudden panic.
Being peaceful by nature
We would no doubt be unprepared for your sudden hostility
we would no doubt be unprepared for your sudden hostility
were it not for the excellent weapon system we bought from the Keel-Verezy just last month.
A weapon system which is fully locked on your command bridge, by the way.
@@ -105,6 +105,22 @@ Yes, let us get down to business.
#(HELLO_AND_DOWN_TO_BUSINESS_2) melnorme-013.ogg
How nice to see you again, Captain.
Before we go on, I have a small announcement.
As you may know, in our travels throughout the galaxy
we Melnorme have found many strange and interesting alien artifacts.
One of these devices is the MetaChron, a kind of trans-time alarm system.
In a nutshell, it warns me of future dangers by predicting its own demise
which is most likely linked to my own well being, since I keep it under my pillow.
The unit is a small pyramid and, when all is well, white in color.
But if we are proceeding along a timeline which will eventually result in the destruction of the MetaChron
the unit slowly darkens. Presumably, it will be destroyed at the same time as it turns completely black.
When we first entered this region of space, the MetaChron was white.
Now it is light gray.
At its present rate of change, something will destroy the MetaChron
in the early part of the year 2159.
In order to avoid this unpleasantness, we may be leaving just before this time
so if you have business you wish to conduct with us
I suggest you do so before January 2159, or February at the latest.
#(HELLO_AND_DOWN_TO_BUSINESS_3) melnorme-014.ogg
I had itchy pods this morning, Captain, and here you are!
@@ -305,7 +321,7 @@ I don't need your help at this time. Maybe later, though.
#(RESCUE_OFFER) melnorme-045.ogg
You have no Credit balance in our mercantile computer
and our scanners show you that you possess no useful trade goods
and our scanners show that you possess no useful trade goods
but, perhaps we can work out a special deal.
In exchange for our giving you enough fuel to
@@ -844,7 +860,7 @@ Actually, we don't know what the Orz did to the Androsynth -- they're just all g
#(OK_BUY_ALIEN_RACE_11) melnorme-109.ogg
The Arilou Lalee'lay are a mysterious race of IDF beings
IDF meaning, Inter-Dimensional Fatigue
IDF meaning, Inter-Dimensional Fatigue.
They do not reside in this galaxy, or in fact, anywhere in this universe.
While it is true that the Arilou are rarely seen far from the Columbae star group
they do make regular, secret visits to your world, and have done so for centuries.
@@ -952,8 +968,8 @@ Within a month, Dnyarri-compelled starships had spread the evil, psychic creatur
When the Dnyarri took control over the Milieu, one race fought back -- the Taalo.
These slow, quiet creatures were silicon-based life forms
but bore little resemblance to the modern Chenjesu.
The Taalo were natural immunes to the Dynarri psychic compulsion; they were unaffected by the creatures' power
and the Dynarri would not permit anyone to exist outside their control
The Taalo were natural immunes to the Dnyarri psychic compulsion; they were unaffected by the creatures' power
and the Dnyarri would not permit anyone to exist outside their control
so they ordered the remaining races of the Milieu to attack and destroy the Taalo home planet.
This planet was one of the few Milieu worlds located in this region of space.
I believe you call their star Delta Vulpeculae. Their home was a moon revolving about the second planet.
@@ -970,7 +986,7 @@ As the centuries of Dnyarri dominance passed, what was once the Sentient Milieu
deteriorated and degenerated into a great galactic gulag.
Alien races which did not serve with the efficiency and speed demanded by the Dnyarri
were ruthlessly burned from the faces of their worlds.
The agents of this genocide were inevitably the Dynarri's favored pet, the Ur-Quan.
The agents of this genocide were inevitably the Dnyarri's favored pet, the Ur-Quan.
After almost twenty-five hundred years of unrelenting Dnyarri control
there were only four living member races of the once-great Sentient Milieu.
By this point, the Dnyarri had used genetic manipulation to split the Ur-Quan into two sub-species:
@@ -987,7 +1003,7 @@ By this point in history, the Dnyarri had grown lax in their dominance
and on occasion accidentally permitted their slaves moments of self-direction.
Kzer-Za was able to use those few scattered minutes to compose a theory.
From its observations, Kzer-Za realized that when a slave died
the Dynarri `disconnected' from the slave's mind, lest it too be dragged down to death.
the Dnyarri `disconnected' from the slave's mind, lest it too be dragged down to death.
Further, the Ur-Quan scientist uncovered the fact that when a slave underwent great pain
the Dnyarri temporarily disconnected -- but that the degree of pain had to be extreme, nearly lethal.
Kzer-Za chose its moment carefully -- it waited until it was near an open transmission unit.
+1 -2
View File
@@ -551,8 +551,7 @@ a material quaintness, if you will.
We will be somewhat disappointed to have to leave it.
#(how_goes_war)
I seem to be having a little trouble defeating the Ur-Quan Hierarchy.
Do you have any helpful advice for me?
I seem to be having a little trouble defeating the Ur-Quan Hierarchy. Do you have any helpful advice for me?
#(WAR_GOES_1) pkunk-071.ogg
Well, not advice exactly, but I can offer you plenty of moral support.
+3 -3
View File
@@ -215,11 +215,11 @@ No, wait, Shofixti! I have an important duty for you to perform.
What might that be?
#(need_you_for_duty)
Shofixti, I am now your new commander. I order you not to kill yourself. You are to remain here and guard your solar system.
Shofixti, I am now your new commander. I order you not to kill yourself. Instead, join our fleet. Fight with us!
#(OK_WILL_BE_SENTRY) shofixti-033.ogg
To fight again? Against the Ur-Quan?
Yes. But no
To fight again? Against the UR-QUAN!?
YES!!... But no.
I cannot leave my homeworld unguarded. I will remain here and keep a solitary vigil.
Goodbye.
+1 -1
View File
@@ -1324,7 +1324,7 @@ No more history, thank you.
The members of the old Alliance.
#(what_about_hierarchy)
The battle thralls in the Hierarchy.
The Hierarchy and their battle thralls.
#(what_about_other)
Were there any alien races who weren't in the War?
@@ -61,13 +61,18 @@ MUSIC REMIXERS
#(Music remixers)
13 C
Jouni Airaksinen
András Barják
Matt Bentley
Tore Aune Fjellstad
Espen Gätzschmann
Aaron J. Grier
A. Keren
Casey Monroe
Dan Nicholson
George Nowik
Riku Nuottajärvi
Erol Otus
Greg Szymanski
#(Other contrib caption)
13 C
+24 -22
View File
@@ -1,4 +1,4 @@
#(Vega)
#(Vega) -- STAR_STRING_BASE
Vega
@@ -530,7 +530,7 @@ Lentilis
UNKNOWN
#(devices)
#(devices) -- DEVICE_STRING_BASE
devices
@@ -646,7 +646,7 @@ Glowing Rod
Moon Base
#(cargo)
#(cargo) -- CARGO_STRING_BASE
cargo
@@ -686,7 +686,7 @@ Radioactive
Exotic
#(Hydrogen)
#(Hydrogen) -- ELEMENTS_STRING_BASE
Hydrogen
@@ -1218,7 +1218,7 @@ Calcium Compounds
Nitric Acid
#(MINERAL SCAN)
#(MINERAL SCAN) -- SCAN_STRING_BASE
MINERAL SCAN
@@ -1442,7 +1442,7 @@ World
Gas Giant
#(Alpha)
#(Alpha) -- STAR_NUMBER_BASE
Alpha
@@ -1498,7 +1498,7 @@ Nu
Xi
#(Mercury)
#(Mercury) -- PLANET_NUMBER_BASE
Mercury
@@ -1625,10 +1625,12 @@ Planet XV
#(Planet XVI)
Planet XVI
#(Sa-Matra)
Sa-Matra
#(JAN)
#(JAN) -- MONTHS_STRING_BASE
JAN
@@ -1676,7 +1678,7 @@ NOV
DEC
#((In response to your statement))
#((In response to your statement)) -- FEEDBACK_STRING_BASE
(In response to your statement)
@@ -1684,7 +1686,7 @@ DEC
MORE
#(Starbase)
#(Starbase) -- STARBASE_STRING_BASE
Starbase
@@ -1704,7 +1706,7 @@ Shipyard
Depart StarBase
#(ENCOUNTER IN)
#(ENCOUNTER IN) -- ENCOUNTER_STRING_BASE
ENCOUNTER IN
@@ -1736,7 +1738,7 @@ Debris
Scavenged
#(HyperSpace)
#(HyperSpace) -- NAVIGATION_STRING_BASE
HyperSpace
@@ -1760,7 +1762,7 @@ Fuel:
Fuel Use:
#(Enter name)
#(Enter name) -- NAMING_STRING_BASE
Enter name
@@ -1776,7 +1778,7 @@ Vindicator
Zelnick
#(Empty)
#(Empty) -- MELEE_STRING_BASE
Empty
@@ -1812,7 +1814,7 @@ Behemoth Zenith
The Peeled Eyes
#(Saving . . .)
#(Saving . . .) -- SAVEGAME_STRING_BASE
Saving . . .
@@ -1832,7 +1834,7 @@ Empty Slot
Saved Game - Date:
#(Sound)
#(Sound) -- OPTION_STRING_BASE
Sound
@@ -1852,7 +1854,7 @@ OFF
ON
#(Really Quit)
#(Really Quit) -- QUITMENU_STRING_BASE
Really Quit?
@@ -1864,7 +1866,7 @@ Yes
No
#(Cr)
#(Cr) -- STATUS_STRING_BASE
Cr
@@ -1888,7 +1890,7 @@ CREW
CAPTAIN
#(nose:)
#(nose:) -- FLAGSHIP_STRING_BASE
nose:
@@ -1940,7 +1942,7 @@ n/a
none
#(Orbit: )
#(Orbit: ) -- ORBITSCAN_STRING_BASE
Orbit:
@@ -2016,7 +2018,7 @@ Day:
Tilt:
#(scan)
#(scan) -- MAINMENU_STRING_BASE
scan
@@ -2237,7 +2239,7 @@ Use the keyboard or joystick instead.
Please press ENTER or SPACE to return.
#(Unconnected. Press LEFT to connect.)
#(Unconnected. Press LEFT to connect.) -- NETMELEE_STRING_BASE
Unconnected. Press LEFT to connect.
+55 -20
View File
@@ -30,10 +30,12 @@ Positional Audio
Sound Driver
Sound Quality
Slave Shields
Player One
Player Two
Bottom Player
Top Player
Control Set
UQM Remixes
Speech
Aspect Ratio
#(CAT_0_OPTS)
320x240
@@ -314,28 +316,28 @@ Placeholder
Placeholder
#(CAT_18_OPT_0_DESC)
Player 1 controls the bottom player in
Super Melee, and the entire Full Game.
Controls the bottom player in Super
Melee, and the entire Full Game.
#(CAT_18_OPT_1_DESC)
Player 1 controls the bottom player in
Super Melee, and the entire Full Game.
Controls the bottom player in Super
Melee, and the entire Full Game.
#(CAT_18_OPT_2_DESC)
Player 1 controls the bottom player in
Super Melee, and the entire Full Game.
Controls the bottom player in Super
Melee, and the entire Full Game.
#(CAT_18_OPT_3_DESC)
Player 1 controls the bottom player in
Super Melee, and the entire Full Game.
Controls the bottom player in Super
Melee, and the entire Full Game.
#(CAT_18_OPT_4_DESC)
Player 1 controls the bottom player in
Super Melee, and the entire Full Game.
Controls the bottom player in Super
Melee, and the entire Full Game.
#(CAT_18_OPT_5_DESC)
Player 1 controls the bottom player in
Super Melee, and the entire Full Game.
Controls the bottom player in Super
Melee, and the entire Full Game.
#(CAT_19_OPTS)
Placeholder
@@ -346,27 +348,27 @@ Placeholder
Placeholder
#(CAT_19_OPT_0_DESC)
Player 2 controls the top player
Controls the top player
in Super Melee.
#(CAT_19_OPT_1_DESC)
Player 2 controls the top player
Controls the top player
in Super Melee.
#(CAT_19_OPT_2_DESC)
Player 2 controls the top player
Controls the top player
in Super Melee.
#(CAT_19_OPT_3_DESC)
Player 2 controls the top player
Controls the top player
in Super Melee.
#(CAT_19_OPT_4_DESC)
Player 2 controls the top player
Controls the top player
in Super Melee.
#(CAT_19_OPT_5_DESC)
Player 2 controls the top player
Controls the top player
in Super Melee.
#(CAT_20_OPTS)
@@ -420,10 +422,39 @@ Overrides PC or 3do soundtrack with the
modern soundtrack written by The Precursors.
Requires a restart of UQM to take effect.
#(CAT_22_OPTS)
Disabled
Enabled
#(CAT_22_OPT_0_DESC)
Do not load the 3DO Speech Pack.
Uses script closer to PC version.
Requires a restart of UQM to take effect.
#(CAT_22_OPT_1_DESC)
Use 3DO speech. The script is closer to 3DO
version where there are differences.
Requires a restart of UQM to take effect.
#(CAT_23_OPTS)
Any
Force 4:3
#(CAT_23_OPT_0_DESC)
Allow any aspect ratio. The game may be
stretched in windows that are not 4:3.
Currently only meaningful in OpenGL mode.
#(CAT_23_OPT_1_DESC)
Display the game with 4:3 aspect even when
the window is not.
Currently only meaningful in OpenGL mode.
#(SLIDERS)
Music Volume
SFX Volume
Speech Volume
Gamma Correction
#(SLIDER_0_DESC)
Sets the music volume.
@@ -434,6 +465,10 @@ Sets the sound effects volume.
#(SLIDER_2_DESC)
Sets the speech volume.
#(SLIDER_3_DESC)
Sets the gamma correction.
May not work on all hardware.
#(BUTTONS)
Quit Setup Menu
Return to Main Menu
+1
View File
@@ -48,6 +48,7 @@ delete.2 = STRING:key Keypad-.
backspace.1 = STRING:key Backspace
editcancel.1 = STRING:key Escape
search.1 = STRING:key /
search.2 = STRING:key F6
next.1 = STRING:key Tab
pause.1 = STRING:key Pause
pause.2 = STRING:key F1
+1
View File
@@ -42,6 +42,7 @@ Announcing the release:
- send a mail to sc2-announce
- set the forum 'news'
- set the #sc2 irc channel topic
- update the version number in http://uqm.stack.nl/wiki/Template:Uqmversion
Moving on to the next version:
+1 -1
View File
@@ -142,7 +142,7 @@ so that it will be shown appropriately in melee if combat follows.
There is no generate function for the names of moons. The few moons that
are named (those in the Sol system), are handled as a special case of
the routines that prints these names (PrintCoarseScan3DO and
PrintCoraseScanPC).
PrintCoarseScanPC).
INIT_NPCS
REINIT_NPCS
-104
View File
@@ -1,104 +0,0 @@
HOW TO NOT GET HOSED BY DOUBLE-LOCK/UNLOCKS WITH GraphicsLock
For the kinds of modifications you're likely to be doing, there only a
few functions that you must take care to ensure that you hold
GraphicsLock before calling. There are also some general guidelines.
GENERAL GUIDELINES
- Don't hold the GraphicsLock in Generate* functions.
- Always hold it while doing ship operations - they're all only called
by RedrawQueue. (preprocess, postprocess, etc.)
- On ConcludeTask, you must not be holding *anything* or you could
cause a deadlock if the thread you're waiting to conclude needs
whatever lock you hold before it can safely exit. It is
acceptable to hold the GraphicsLock when merely calling
Task_SetState.
Specific Guidelines:
Always hold the GraphicsLock when calling...
- SetFlashRect in sis.c; this changes which part of the screen is
flashing. Very common.
- RedrawQueue in process.c; this is for updating all the the graphics
for ship animations.
- GetMeleeStarShip in pickmele.c. That this is extern at all is
probably a sign of lousy code organization.
- DoMenuOptions in hyper.c; this is a consequence of being called from
a ship operation when in hyperspace, which means that it must assume
that it's called with the GraphicsLock held.
- DoDiscoveryReport in planets/report.c; this is called by the
Generate* functions, which always start out not holding the Lock.
- ClearSISRect and DeltaSISGauges in sis.c; you might call these if
working on code that modifies fuel or crew somehow.
THE GORY DETAILS
[functionname] means that the function is static and demands lockedness.
<functionname> means that the function is static and demands unlockedness.
*functionname* means that the function is extern and demands lockedness
(functionname) means that the function is extern and demands unlockedness.
This information is incomplete, and the result of a fairly informal
hand-analysis of the code. In the case of extern-requires-lock,
context and calling sites have been tracked so that all such functions
are reached.
battle.c: (Battle)
border.c: (DrawSISFrame)
build.c: (ActivateStarShip)
clock.c: (clock_task_func)
comm.c: (ambient_anim_task) [SpewPhrases] (AlienTalkSegue)
<DoCommunication> [HailAlien] (InitCommunication)
confirm.c: (DoConfirmExit)
credits.c: (Credits) (OutTakes)
encount.c: <DoSelectAction> (InitEncounter) [DrawFadeText]
(UninitEncounter) (EncounterBattle)
fmv.c: (Introduction)
gameopt.c: <FeedbackSetting> <FeedbackQuit> <DrawDescriptionString>
<DoNaming> <DoSettings> <DoQuitMenu> [ShowSummary]
<DoPickGame> <PickGame>
hyper.c: *LoadHyperspace* *FreeHyperspace* *DoMenuOptions*
init.c: *InitShips* *UninitShips*
melee.c: [DrawPickFrame] (flash_selection_func) <DrawMeleeShipStrings>
<DoLoadTeam> <DoSaveTeam> <DoEdit> <DoPickShip>
<FreeMeleeInfo> <DoMelee>
menu.c: (DrawMenuStateStrings)
outfit.c: <DoInstallModule> (ChangeFuelQuantity) (DoOutfit)
pickmele.c: *GetMeleeStarShip*
pickship.c: <DoPickBattleShip> [GetArmadaStarShip]
process.c: *RedrawQueue*
restart.c: <DrawRestartMenu> <DoRestart> (StartGame)
save.c: (SaveProblem)
ship.c: *ship_preprocess*
shipyard.c: (hangar_anim_func) <DrawRaceStrings> <ShowCombatShip>
[CrewTransaction] <DoModifyShips> <DrawBluePrint>
(DoShipyard)
sis.c: *ClearSISRect* *DeltaSISGauges* (flash_rect_func)
*SetFlashRect*
starbase.c: (rotate_starbase) (DoStarBase)
starcon.c: (arilou_gate_task) (Starcon2Main)
utils.c: (PauseGame)
cargo.c: (DrawCargoStrings) <DoDiscardCargo> (Cargo)
devices.c: <DrawDevices> <DoManipulateDevices> (Devices)
lander.c: <ScrollPlanetSide> [AnimateLaunch] <InitPlanetSide>
<ReturnToOrbit> (PlanetSide) (InitLander)
planets.c: (LoadPlanet) (FreePlanet)
plangen.c: (rotate_planet_task)
pstarmap.c: (flash_cursor_func) (DrawStarMap) [EraseCursor]
<DoMoveCursor> [DoStarMap] (DoFlagshipCommands)
report.c: [MakeReport] *DoDiscoveryReport*
roster.c: (flash_ship_task) <DoModifyRoster>
scan.c: <EraseCoarseScan> <PrintCoarseScanPC> <PrintCoarseScan3DO>
<SetPlanetLoc> (flash_planet_loc_func) <PickPlanetSide>
<DoScan> (ScanSystem)
solarsys.c: <FreeSolarSys> (IPtask_func) <DrawInnerSystem>
(ChangeSolarSys) <InitSolarSys>
+4
View File
@@ -14,6 +14,9 @@ Medium-priority:
- Closing and destroying of NetConnections is a terrible mess.
- Checks allConnected() shouldn't be needed if CHECK_ABORT is set
on disconnect.
- Shorten or lengthen the time between frames depending on how full the input
buffer is, to prevent one side constantly stalling when the connection in
one direction is slower than in the other direction.
Low-priority:
@@ -75,6 +78,7 @@ Future improvements/optimisations:
- Per state data (in NetConnection.stateData) is unnecessarilly complicated.
Putting all fields directly in NetConnection simplifies things a lot.
It's not as generic, but this code won't be used elsewhere anyhow.
- Send captain names to the other side
Bugs:
+2 -2
View File
@@ -7,7 +7,7 @@ GlobData.Game_state.avail_race_q:
except for, technically, SAMATRA_SHIP. URQUAN_PROBE_SHIP is a
very incomplete 'race'.
Elements are of type FLEET_INFO.
Filled in InitSIS().
Filled in InitGameStructures().
Partially included in savegames.
GlobData.Game_state.built_ship_q:
@@ -19,7 +19,7 @@ GlobData.Game_state.built_ship_q:
master_q:
List of templates for all the ships that are available in SuperMelee.
Elements are of type MASTER_SHIP_INFO.
Sorted on the (abbreviated) race name (see doc/racestrings).
Sorted on the (abbreviated) race name (see doc/devel/racestrings).
Filled in LoadMasterShipList().
GlobData.Game_state.npc_built_ship_q:
+2 -1
View File
@@ -1,4 +1,5 @@
This file describes the use for each entry of the content/<race>/*.txt files
This file describes the use for each entry of the
content/base/ships/<race>/<ship>.txt files.
Entry #0:
+123
View File
@@ -0,0 +1,123 @@
Ur-Quan Masters State Files
---------------------------
Statefiles are a legacy component of the UQM runtime and savegame
format. They represent largish (10-64KB) chunks of semi-structured
data that the engine used to keep on disk during gameplay, checking
and updating it as needed. These files were then dumped into and
restored from save files in a compressed form.
In UQM as it exists now (0.7), these files exist as expandable memory
arrays that are consulted as if they were files. UQM 0.8 will change
the savegame format to remove the compression (64K just isn't much
anymore) and put more structure to the data within. The statefile
abstraction itself is not guaranteed to be retained, and indeed core
team considers it kind of horrible and would like to destroy it.
There are three state files.
STARINFO_FILE aka "starinfo.dat"
--------------------------------
This is probably the most reasonable of the three. It keeps track of
which star systems you have visited, and which mineral deposits and
interesting life forms and gadgets you have harvested from the worlds
therein.
The file begins with one DWORD for every star system in the
game. (There are 502 star systems, defined in a gigantic array in
starmap_array in plandata.c). The DWORD is 0 if the star system is
unvisited. It is otherwise an absolute offset within the state file.
Generally speaking, UQM star systems are procedurally generated with a
PRNG and various properties of the star including its type and
location. Thus, the information in starmap.c is sufficient to provide
an accounting of the number and quality of worlds in any given
system. Each world can have up to 32 each of mineral deposits, energy
signatures, or life forms. Thus, each world, in order, in the system
will be listed at its offset with three DWORDS, representing mineral,
energy, and biological entities respectively. Captured entities have a
1 bit set.
With a little over 3,800 visitable celestial bodies, this state file
is capped at a little under 50 KB.
RANDGRPINFO_FILE aka "randgrp.dat"
----------------------------------
This is a "battle group file" - it tracks the information regarding
groups of ships that you can encounter in interplanetary space. This
file gives the location information for all ships in the last solar
system you visited, and it tracks the fleet composition, health, &c
for ships randomly generated due to visiting a solar system in some
species's sphere of influence. Random battle groups are reset after a
week in HyperSpace or upon arrival in some other star system.
The data structures, and the reader/writer functions for them, are
primarily defined in grpinfo.c.
The RANDGRPINFO file starts with a GROUP_HEADER struct, specifying
which star this information is for, when the data expires, and then 65
offsets into the file. This is a *one-indexed array* for
randomly-generated groups.
This is because the offset for group zero points to an entirely
different data structure: the "Group List". This gives the starmap
depiction and location on the Interplanetary map of every battle group
in the system, whether it is randomly generated or pre-defined. This
comprises two bytes (the ID of the most recently encountered group,
and then the number of groups), followed by a series of 17-byte chunks
representing battle groups. These are a byte indicating the race
identifier of the fleet (battle groups can be mixed-composition, but
only one ship appears on the map at a time; this specifies that)
followed by 16 bytes that represent an IP_GROUP structure. See the
Read/WriteIpGroup functions in gengrp.c for the exact layout in the
virtual file. There's a lot of wasted space there, a legacy of the
time when these files were actually structure dumps on 32-bit machines
with very specific memory layouts.
The offsets that are not Group Zero have a similar layout, interpreted
differently. Each of these represents a single battle group. It
retains the two-byte prologue, the second of which specifies the
number of 17-byte chunks to follow. The first byte here is the
displayed race identifier, again, and then each 17-byte chunk is that
ship's particular race ID followed by a 16-byte representation of a
SHIP_FRAGMENT.
There are no requirements about order of layout or total size of this
file; the only requirement is that there is a GROUP_HEADER at offset
zero and that the extents described in the valid offsets do not
overlap.
DEFGRPINFO_FILE aka "defgrp.dat"
--------------------------------
This is a random-access scratch space for battle groups that are
deliberately placed by the plot. There's one GROUP_HEADER in this
file, somewhere, for each star system that has ever had predefined
ships and that the player has visited. There is *no guarantee of any
kind* as to where they are, a priori.
This information instead lives within the game state array, a
155-byte-long bitfield that is mostly used for storing plot events and
event flags. 32-bit values within this array store the relevant
offsets for their fleets, or a 0 if they have not yet been
encountered. In vanilla UQM, there are 14 of these values,
corresponding to the Ur-Quan Probe, the Zoq-Fot-Pik scout, the
Shofixti Survivor, the Unzervalt Guardian, the Sa-Matra, and the nine
Melnorme traders in TrueSpace. Each of these has a corresponding entry
in the game state array that ends in _OFFS0. (Due to the
implementation of GET_GAME_STATE, these values actually are stored as
four eight-bit values each, but this can be ignored pretty much
everywhere but the definition of the states themselves).
If one of these offsets is non-zero, then that offset in the
DEFGRPINFO_FILE will have a SHIP_FRAGMENT-based group definition in
the same format as the ones in RANDGRPINFO_FILE.
The Game State array uses 0 as a special value to mean "this
predefined battle group has not yet been spawned." Because of that, 0
is not a legal offset to place a GROUP_HEADER. To ensure that no
GROUP_HEADER is placed there, a zero is written to the first byte of
the file. That way, the first defined group (which, for vanilla UQM,
will always be the Ur-Quan Probe) thus begins at offset 1.
+1 -4
View File
@@ -97,10 +97,7 @@ The simplest form of lock. If a thread tries to lock a mutex, it will
sleep if the mutex is already locked, and awaken once the mutex
becomes available. A Mutex must be unlocked by the same thread that
locked it, and a thread must never lock a mutex it has already locked
(without unlocking it first). The most important Mutex in the program
the GraphicsLock. Code in UQM that does things like change the
screen's clipping rectangle always grabs the GraphicsLock first, to
ensure that the screen doesn't go crazy.
(without unlocking it first).
API:
Mutex CreateMutex (const char *name, DWORD syncClass);
+1 -1
View File
@@ -39,4 +39,4 @@ Version 0.6.6: Revision 3143
Version 0.6.7: Revision 3276
Version 0.6.8: Revision 3334
Version 0.6.9: Revision 3537
Version 0.7.0-rc2: Revision 3622
Version 0.7.0: Revision 3631
+2 -2
View File
@@ -1,6 +1,6 @@
THE UR-QUAN MASTERS v0.7 -- homepage: http://sc2.sf.net/
Welcome to the sixth release of the Ur-Quan Masters port. This
Welcome to this beta release of the Ur-Quan Masters port. This
document will tell you everything you need to play, even if you've
never played the original.
@@ -791,7 +791,7 @@ inside the directory content/addons/<addon> will be included
in the game. '--addon' may be specified more than once to enable multiple
add-ons.
Formerly standard packages, 3domusic and 3dovoice are now standard add-ons,
Unlike previous releases, 3domusic and 3dovoice are now standard add-ons,
and can be turned on and off from the in-game setup menu.
The Precursors UQM Remix project is intended to be used as an add-on.
If you install UQM 0.7 from the Windows installer, the remix packs
+5 -2
View File
@@ -1,4 +1,6 @@
uqm_SUBDIRS="libs res uqm"
uqm_CFILES="options.c port.c uqm.c"
uqm_HFILES="config.h endian_uqm.h options.h port.h types.h uqmversion.h"
if [ "$uqm_HAVE_GETOPT_LONG" = 0 ]; then
uqm_SUBDIRS="$uqm_SUBDIRS getopt"
@@ -8,11 +10,12 @@ case "$HOST_SYSTEM" in
Darwin)
uqm_SUBDIRS="$uqm_SUBDIRS darwin"
;;
MSVC)
uqm_HFILES="$uqm_HFILES config_vc6.h"
;;
esac
if [ "$uqm_HAVE_REGEX" = 0 ]; then
uqm_SUBDIRS="$uqm_SUBDIRS regex"
fi
uqm_CFILES="options.c port.c uqm.c"
+1 -1
View File
@@ -1,2 +1,2 @@
uqm_MFILES="SDLMain.m"
uqm_HFILES="SDLMain.h"
+8 -11
View File
@@ -1,19 +1,16 @@
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
Feel free to customize this file to suit your needs
Feel free to customize this file to suit your needs
*/
#import <Cocoa/Cocoa.h>
#ifndef _SDLMain_h_
#define _SDLMain_h_
/* An internal Apple class used to setup Apple menus */
@interface NSAppleMenuController:NSObject {}
- (void)controlMenu:(NSMenu *)aMenu;
@end
#import <Cocoa/Cocoa.h>
@interface SDLMain : NSObject
@end
@interface SDLApplication : NSApplication
@end
#endif /* _SDLMain_h_ */
+297 -181
View File
@@ -1,11 +1,8 @@
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
Feel free to customize this file to suit your needs
Modified for use with The Ur-Quan Masters by Nicolas Simonds
<uqm at submedia dot net>
Feel free to customize this file to suit your needs
*/
#import "port.h"
@@ -35,254 +32,373 @@ static BOOL gFinderLaunch;
(void) sender; /* Get rid of unused variable warning */
}
/* override NSApplication:sendEvent, to keep Cocoa from beeping on
non-command keystrokes */
- (void)sendEvent:(NSEvent *)anEvent {
if (NSKeyDown == [anEvent type] || NSKeyUp == [anEvent type]) {
if ([anEvent modifierFlags] & NSCommandKeyMask)
[super sendEvent: anEvent];
} else
[super sendEvent: anEvent];
/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
but the method still is there and works. To avoid warnings, we declare
it ourselves here. */
@interface NSApplication(SDL_Missing_Methods)
- (void)setAppleMenu:(NSMenu *)menu;
@end
/* Use this flag to determine whether we use SDLMain.nib or not */
#define SDL_USE_NIB_FILE 0
/* Use this flag to determine whether we use CPS (docking) or not */
#define SDL_USE_CPS 1
#ifdef SDL_USE_CPS
/* Portions of CPS.h */
typedef struct CPSProcessSerNum
{
UInt32 lo;
UInt32 hi;
} CPSProcessSerNum;
extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
#endif /* SDL_USE_CPS */
static int gArgc;
static char **gArgv;
static BOOL gFinderLaunch;
static BOOL gCalledAppMainline = FALSE;
static NSString *getApplicationName(void)
{
const NSDictionary *dict;
NSString *appName = 0;
/* Determine the application name */
dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
if (dict)
appName = [dict objectForKey: @"CFBundleName"];
if (![appName length])
appName = [[NSProcessInfo processInfo] processName];
return appName;
}
#if SDL_USE_NIB_FILE
/* A helper category for NSString */
@interface NSString (ReplaceSubString)
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
@end
#endif
@interface NSApplication (SDLApplication)
@end
@implementation NSApplication (SDLApplication)
/* Invoked from the Quit menu item */
- (void)terminate:(id)sender
{
/* Post a SDL_QUIT event */
SDL_Event event;
event.type = SDL_QUIT;
SDL_PushEvent(&event);
}
@end
/* The main class of the application, the application's delegate */
@implementation SDLMain
static char *
basename (char *path)
{
char *base;
base = strrchr (path, '/');
if (base == NULL)
return path;
return (base + 1);
}
/* Set the working directory to the .app's parent directory */
- (void) setupWorkingDirectory:(BOOL)shouldChdir
{
char origindir[PATH_MAX];
char *c;
if (!shouldChdir)
return;
strncpy (origindir, gArgv[0], sizeof origindir);
origindir[sizeof origindir - 1] = '\0';
c = basename (origindir);
if (c == origindir)
strcpy (origindir, ".");
else
*c = '\0';
/* chdir to the binary app's point of origin */
if (chdir (origindir) != 0)
abort ();
/* then chdir to the .app's parent */
if ( chdir ("../Resources/") != 0 )
abort();
if (shouldChdir)
{
char parentdir[MAXPATHLEN];
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
chdir(parentdir); /* chdir to the binary app's parent */
}
CFRelease(url);
CFRelease(url2);
}
}
void
setupAppleMenu (void)
#if SDL_USE_NIB_FILE
/* Fix menu to contain the real app name instead of "SDL App" */
- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
{
NSMenu *appleMenu;
NSRange aRange;
NSEnumerator *enumerator;
NSMenuItem *menuItem;
NSMenuItem *menuItem;
NSString *title;
NSString *appName;
aRange = [[aMenu title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
[aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
appName = [NSString stringWithUTF8String:basename (gArgv[0])];
appleMenu = [[NSMenu alloc] initWithTitle:appName];
enumerator = [[aMenu itemArray] objectEnumerator];
while ((menuItem = [enumerator nextObject]))
{
aRange = [[menuItem title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
[menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
if ([menuItem hasSubmenu])
[self fixMenu:[menuItem submenu] withAppName:appName];
}
}
/* Add menu items */
title = [@"Hide " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(hide:)
keyEquivalent:@"h"];
#else
menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others"
action:@selector(hideOtherApplications:)
keyEquivalent:@"h"];
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
static void setApplicationMenu(void)
{
/* warning: this code is very odd */
NSMenu *appleMenu;
NSMenuItem *menuItem;
NSString *title;
NSString *appName;
[appleMenu addItemWithTitle:@"Show All"
action:@selector(unhideAllApplications:)
keyEquivalent:@""];
appName = getApplicationName();
appleMenu = [[NSMenu alloc] initWithTitle:@""];
[appleMenu addItem:[NSMenuItem separatorItem]];
/* Add menu items */
title = [@"About " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
title = [@"Quit " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(terminate:)
keyEquivalent:@"q"];
[appleMenu addItem:[NSMenuItem separatorItem]];
/* Put menu into the menubar */
menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil
keyEquivalent:@""];
[menuItem setSubmenu:appleMenu];
[[NSApp mainMenu] addItem:menuItem];
title = [@"Hide " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
/* Tell the application object that this is now the application menu */
[NSApp setAppleMenu:appleMenu];
menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
/* Finally give up our references to the objects */
[appleMenu release];
[menuItem release];
[appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
[appleMenu addItem:[NSMenuItem separatorItem]];
title = [@"Quit " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
/* Put menu into the menubar */
menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
[menuItem setSubmenu:appleMenu];
[[NSApp mainMenu] addItem:menuItem];
/* Tell the application object that this is now the application menu */
[NSApp setAppleMenu:appleMenu];
/* Finally give up our references to the objects */
[appleMenu release];
[menuItem release];
}
/* Create a window menu */
void
setupWindowMenu (void)
static void setupWindowMenu(void)
{
NSMenu *windowMenu;
NSMenuItem *windowMenuItem;
NSMenuItem *menuItem;
NSMenu *windowMenu;
NSMenuItem *windowMenuItem;
NSMenuItem *menuItem;
windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
/* "Minimize" item */
menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize"
action:@selector(performMiniaturize:)
keyEquivalent:@"m"];
[windowMenu addItem:menuItem];
[menuItem release];
/* "Minimize" item */
menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
[windowMenu addItem:menuItem];
[menuItem release];
/* Put menu into the menubar */
windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window"
action:nil keyEquivalent:@""];
[windowMenuItem setSubmenu:windowMenu];
[[NSApp mainMenu] addItem:windowMenuItem];
/* Put menu into the menubar */
windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
[windowMenuItem setSubmenu:windowMenu];
[[NSApp mainMenu] addItem:windowMenuItem];
/* Tell the application object that this is now the window menu */
[NSApp setWindowsMenu:windowMenu];
/* Tell the application object that this is now the window menu */
[NSApp setWindowsMenu:windowMenu];
/* Finally give up our references to the objects */
[windowMenu release];
[windowMenuItem release];
/* Finally give up our references to the objects */
[windowMenu release];
[windowMenuItem release];
}
/* Replacement for NSApplicationMain */
void
CustomApplicationMain (int argc, char **argv)
static void CustomApplicationMain (int argc, char **argv)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
SDLMain *sdlMain;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
SDLMain *sdlMain;
/* Ensure the application object is initialised */
[SDLApplication sharedApplication];
/* Ensure the application object is initialised */
[NSApplication sharedApplication];
/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
setupAppleMenu ();
setupWindowMenu ();
#ifdef SDL_USE_CPS
{
CPSProcessSerNum PSN;
/* Tell the dock about us */
if (!CPSGetCurrentProcess(&PSN))
if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
if (!CPSSetFrontProcess(&PSN))
[NSApplication sharedApplication];
}
#endif /* SDL_USE_CPS */
/* Create SDLMain and make it the app delegate */
sdlMain = [[SDLMain alloc] init];
[NSApp setDelegate:sdlMain];
/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
setApplicationMenu();
setupWindowMenu();
/* Start the main event loop */
[NSApp run];
/* Create SDLMain and make it the app delegate */
sdlMain = [[SDLMain alloc] init];
[NSApp setDelegate:sdlMain];
[sdlMain release];
[pool release];
/* Start the main event loop */
[NSApp run];
(void) argc; /* Get rid of unused variable warning */
(void) argv; /* Get rid of unused variable warning */
[sdlMain release];
[pool release];
}
#endif
/*
* Catch document open requests...this lets us notice files when the app
* was launched by double-clicking a document, or when a document was
* dragged/dropped on the app's icon. You need to have a
* CFBundleDocumentsType section in your Info.plist to get this message,
* apparently.
*
* Files are added to gArgv, so to the app, they'll look like command line
* arguments. Previously, apps launched from the finder had nothing but
* an argv[0].
*
* This message may be received multiple times to open several docs on launch.
*
* This message is ignored once the app's mainline has been called.
*/
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
const char *temparg;
size_t arglen;
char *arg;
char **newargv;
if (!gFinderLaunch) /* MacOS is passing command line args. */
return FALSE;
if (gCalledAppMainline) /* app has started, ignore this document. */
return FALSE;
temparg = [filename UTF8String];
arglen = SDL_strlen(temparg) + 1;
arg = (char *) SDL_malloc(arglen);
if (arg == NULL)
return FALSE;
newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
if (newargv == NULL)
{
SDL_free(arg);
return FALSE;
}
gArgv = newargv;
SDL_strlcpy(arg, temparg, arglen);
gArgv[gArgc++] = arg;
gArgv[gArgc] = NULL;
return TRUE;
}
/* Called when the internal event loop has just started running */
- (void) applicationDidFinishLaunching: (NSNotification *) note
{
int status;
int status;
/* Set the working directory to the .app's parent directory */
[self setupWorkingDirectory:gFinderLaunch];
/* Set the working directory to the .app's parent directory */
[self setupWorkingDirectory:gFinderLaunch];
/* allow Cocoa to hear keystrokes like Command-Q, etc. */
setenv ("SDL_ENABLEAPPEVENTS", "1", 1);
#if SDL_USE_NIB_FILE
/* Set the main menu to contain the real app name instead of "SDL App" */
[self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
#endif
/* Hand off to main application code */
status = SDL_main (gArgc, gArgv);
/* Hand off to main application code */
gCalledAppMainline = TRUE;
status = SDL_main (gArgc, gArgv);
/* We're done, thank you for playing */
exit (status);
(void) note; /* Get rid of unused variable warning */
/* We're done, thank you for playing */
exit(status);
}
@end
@implementation NSString (ReplaceSubString)
- (NSString *) stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
{
unsigned int bufferSize;
unsigned int selfLen = [self length];
unsigned int aStringLen = [aString length];
unichar *buffer;
NSRange localRange;
NSString *result;
unsigned int bufferSize;
unsigned int selfLen = [self length];
unsigned int aStringLen = [aString length];
unichar *buffer;
NSRange localRange;
NSString *result;
bufferSize = selfLen + aStringLen - aRange.length;
buffer = NSAllocateMemoryPages (bufferSize * sizeof (unichar));
bufferSize = selfLen + aStringLen - aRange.length;
buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
/* Get first part into buffer */
localRange.location = 0;
localRange.length = aRange.location;
[self getCharacters:buffer range:localRange];
/* Get first part into buffer */
localRange.location = 0;
localRange.length = aRange.location;
[self getCharacters:buffer range:localRange];
/* Get middle part into buffer */
localRange.location = 0;
localRange.length = aStringLen;
[aString getCharacters:(buffer + aRange.location) range:localRange];
/* Get middle part into buffer */
localRange.location = 0;
localRange.length = aStringLen;
[aString getCharacters:(buffer+aRange.location) range:localRange];
/* Get last part into buffer */
localRange.location = aRange.location + aRange.length;
localRange.length = selfLen - localRange.location;
[self getCharacters:(buffer + aRange.location+aStringLen)
range:localRange];
/* Get last part into buffer */
localRange.location = aRange.location + aRange.length;
localRange.length = selfLen - localRange.location;
[self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
/* Build output string */
result = [NSString stringWithCharacters:buffer length:bufferSize];
/* Build output string */
result = [NSString stringWithCharacters:buffer length:bufferSize];
NSDeallocateMemoryPages (buffer, bufferSize);
NSDeallocateMemoryPages(buffer, bufferSize);
return result;
return result;
}
@end
#ifdef main
# undef main
#endif
/* Main entry point to executable - should *not* be SDL_main! */
int
main (int argc, char **argv)
int main (int argc, char **argv)
{
/* Copy the arguments into a global variable */
int i;
/* Copy the arguments into a global variable */
/* This is passed if we are launched by double-clicking */
if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
gArgv[0] = argv[0];
gArgv[1] = NULL;
gArgc = 1;
gFinderLaunch = YES;
} else {
int i;
gArgc = argc;
gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
for (i = 0; i <= argc; i++)
gArgv[i] = argv[i];
gFinderLaunch = NO;
}
/* If we are launched by double-clicking, argv[1] is "-psn_<some_number> */
if ( argc >= 2 && strncmp (argv[1], "-psn_", 5) == 0 ) {
gArgc = 1;
gFinderLaunch = YES;
} else {
gArgc = argc;
gFinderLaunch = NO;
}
gArgv = (char **) malloc (sizeof *gArgv * (gArgc + 1));
if (gArgv == NULL)
abort ();
for (i = 0; i < gArgc; i++)
gArgv[i] = argv[i];
gArgv[i] = NULL;
CustomApplicationMain (argc, argv);
free (gArgv);
return 0;
#if SDL_USE_NIB_FILE
NSApplicationMain (argc, argv);
#else
CustomApplicationMain (argc, argv);
#endif
return 0;
}
#endif
+9
View File
@@ -61,6 +61,11 @@
#define UQM_Swap32 __arch__swab32
#endif
#endif /* linux */
#if defined(__cplusplus)
extern "C" {
#endif
/* Use inline functions for compilers that support them, and static
functions for those that do not. Because these functions become
static for compilers that do not support inline functions, this
@@ -124,4 +129,8 @@ static __inline__ uint64 UQM_Swap64(uint64 val)
#define UQM_SwapBE64(X) (X)
#endif
#if defined(__cplusplus)
}
#endif
#endif /* _ENDIAN_H */
+1
View File
@@ -1 +1,2 @@
uqm_CFILES="getopt.c getopt1.c"
uqm_HFILES="getopt.h"
+5
View File
@@ -12,3 +12,8 @@ fi
# uqm_SUBDIRS="$UQM_SUBDIRS debug"
#fi
uqm_HFILES="alarm.h async.h callback.h cdplib.h compiler.h declib.h file.h
gfxlib.h heap.h inplib.h list.h log.h mathlib.h md5.h memlib.h
misc.h net.h platform.h reslib.h sndlib.h strlib.h tasklib.h
threadlib.h timelib.h uio.h uioutils.h unicode.h vidlib.h"
+7
View File
@@ -1,2 +1,9 @@
#if defined(__cplusplus)
extern "C" {
#endif
#include "callback/alarm.h"
#if defined(__cplusplus)
}
#endif
+10
View File
@@ -0,0 +1,10 @@
#if defined(__cplusplus)
extern "C" {
#endif
#include "callback/async.h"
#if defined(__cplusplus)
}
#endif
+8
View File
@@ -1,2 +1,10 @@
#if defined(__cplusplus)
extern "C" {
#endif
#include "callback/callback.h"
#if defined(__cplusplus)
}
#endif
+2 -2
View File
@@ -1,2 +1,2 @@
uqm_CFILES="alarm.c callback.c"
uqm_CFILES="alarm.c async.c callback.c"
uqm_HFILES="alarm.h async.h callback.h"
+50 -7
View File
@@ -18,6 +18,7 @@
#include "alarm.h"
#include SDL_INCLUDE(SDL.h)
#include "libs/heap.h"
#include <assert.h>
@@ -71,19 +72,36 @@ Alarm_uninit(void) {
}
static inline AlarmTime
AlarmTime_nowMS(void) {
AlarmTime_nowMs(void) {
return SDL_GetTicks();
}
Alarm *
Alarm_addRelativeMs(Uint32 ms, AlarmCallback callback,
Alarm_addAbsoluteMs(uint32 ms, AlarmCallback callback,
AlarmCallbackArg arg) {
Alarm *alarm;
assert(alarmHeap != NULL);
alarm = Alarm_alloc();
alarm->time = AlarmTime_nowMS() + ms;
alarm->time = ms;
alarm->callback = callback;
alarm->arg = arg;
Heap_add(alarmHeap, (HeapValue *) alarm);
return alarm;
}
Alarm *
Alarm_addRelativeMs(uint32 ms, AlarmCallback callback,
AlarmCallbackArg arg) {
Alarm *alarm;
assert(alarmHeap != NULL);
alarm = Alarm_alloc();
alarm->time = AlarmTime_nowMs() + ms;
alarm->callback = callback;
alarm->arg = arg;
@@ -99,15 +117,40 @@ Alarm_remove(Alarm *alarm) {
Alarm_free(alarm);
}
// Process at most one alarm, if its time has come.
// It is safe to call this function again from inside a callback function
// that it called. It should not be called from multiple threads at once.
bool
Alarm_processOne(void)
{
AlarmTime now;
Alarm *alarm;
assert(alarmHeap != NULL);
if (!Heap_hasMore(alarmHeap))
return false;
now = AlarmTime_nowMs();
alarm = (Alarm *) Heap_first(alarmHeap);
if (now < alarm->time)
return false;
Heap_pop(alarmHeap);
alarm->callback(alarm->arg);
Alarm_free(alarm);
return true;
}
#if 0
// It is safe to call this function again from inside a callback function
// that it called. It should not be called from multiple threads at once.
void
Alarm_process(void) {
Alarm_processAll(void) {
AlarmTime now;
assert(alarmHeap != NULL);
now = AlarmTime_nowMS();
now = AlarmTime_nowMs();
while (Heap_hasMore(alarmHeap)) {
Alarm *alarm = (Alarm *) Heap_first(alarmHeap);
@@ -119,8 +162,9 @@ Alarm_process(void) {
Alarm_free(alarm);
}
}
#endif
Uint32
uint32
Alarm_timeBeforeNextMs(void) {
Alarm *alarm;
@@ -131,4 +175,3 @@ Alarm_timeBeforeNextMs(void) {
return alarmTimeToMsUint32(alarm->time);
}
+9 -7
View File
@@ -22,11 +22,10 @@
#include "port.h"
#include "types.h"
#include SDL_INCLUDE(SDL.h)
typedef Uint32 AlarmTime;
static inline Uint32
typedef uint32 AlarmTime;
static inline uint32
alarmTimeToMsUint32(AlarmTime time) {
return (Uint32) time;
return (uint32) time;
}
typedef struct Alarm Alarm;
@@ -44,11 +43,14 @@ struct Alarm {
void Alarm_init(void);
void Alarm_uninit(void);
Alarm *Alarm_addRelativeMs(Uint32 ms, AlarmCallback callback,
Alarm *Alarm_addAbsoluteMs(uint32 ms, AlarmCallback callback,
AlarmCallbackArg arg);
Alarm *Alarm_addRelativeMs(uint32 ms, AlarmCallback callback,
AlarmCallbackArg arg);
void Alarm_remove(Alarm *alarm);
void Alarm_process(void);
Uint32 Alarm_timeBeforeNextMs(void);
bool Alarm_processOne(void);
void Alarm_processAll(void);
uint32 Alarm_timeBeforeNextMs(void);
#endif /* LIBS_CALLBACK_ALARM_H_ */
+56
View File
@@ -0,0 +1,56 @@
/*
* Copyright 2012 Serge van den Boom <svdb@stack.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "async.h"
#include "libs/alarm.h"
#include "libs/callback.h"
// Process all alarms and callbacks.
// First, all scheduled callbacks are called.
// Then each alarm due is called, and after each of these alarms, the
// callbacks scheduled by this alarm are called.
void
Async_process(void)
{
// Call pending callbacks.
Callback_process();
for (;;) {
if (!Alarm_processOne())
return;
// Call callbacks scheduled from the last alarm.
Callback_process();
}
}
// Returns the next time that some asynchronous callback is
// to be called. Note that all values lower than the current time
// should be considered as 'somewhere in the past'.
uint32
Async_timeBeforeNextMs(void) {
if (Callback_haveMore()) {
// Any time before the current time is ok, though we reserve 0 so
// that the caller may use it as a special value in its own code.
return 1;
}
return Alarm_timeBeforeNextMs();
}
+28
View File
@@ -0,0 +1,28 @@
/*
* Copyright 2012 Serge van den Boom <svdb@stack.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _ASYNC_H
#define _ASYNC_H
#include "types.h"
void Async_process(void);
uint32 Async_timeBeforeNextMs(void);
#endif /* _ASYNC_H */
+24 -4
View File
@@ -23,6 +23,8 @@
#include <stdlib.h>
#include <sys/types.h>
#include "libs/threadlib.h"
typedef struct CallbackLink CallbackLink;
#define CALLBACK_INTERNAL
@@ -38,16 +40,16 @@ static CallbackLink *callbacks;
static CallbackLink **callbacksEnd;
static CallbackLink *const *callbacksProcessEnd;
static Mutex callbackListLock;
static inline void
CallbackList_lock(void) {
// TODO
// Necessary for reentrant operation
LockMutex(callbackListLock);
}
static inline void
CallbackList_unlock(void) {
// TODO
// Necessary for reentrant operation
UnlockMutex(callbackListLock);
}
#if 0
@@ -62,6 +64,14 @@ Callback_init(void) {
callbacks = NULL;
callbacksEnd = &callbacks;
callbacksProcessEnd = &callbacks;
callbackListLock = CreateMutex("Callback List Lock", SYNC_CLASS_TOPLEVEL);
}
void
Callback_uninit(void) {
// TODO: cleanup the queue?
DestroyMutex (callbackListLock);
callbackListLock = 0;
}
// Callbacks are guaranteed to be called in the order that they are queued.
@@ -170,4 +180,14 @@ Callback_process(void) {
}
}
bool
Callback_haveMore(void) {
bool result;
CallbackList_lock();
result = (callbacks != NULL);
CallbackList_unlock();
return result;
}
+2
View File
@@ -33,9 +33,11 @@ typedef void *CallbackArg;
typedef void (*CallbackFunction)(CallbackArg arg);
void Callback_init(void);
void Callback_uninit(void);
CallbackID Callback_add(CallbackFunction callback, CallbackArg arg);
bool Callback_remove(CallbackID id);
void Callback_process(void);
bool Callback_haveMore(void);
#endif /* LIBS_CALLBACK_CALLBACK_H_ */
+2
View File
@@ -1 +1,3 @@
uqm_CFILES="cdp.c cdpapi.c"
uqm_HFILES="cdp_alli.h cdpapi.h cdp.h cdp_iio.h cdp_imem.h cdpint.h
cdp_isnd.h cdp_ivid.h cdpmod.h windl.h"
+8
View File
@@ -19,6 +19,14 @@
#ifndef LIBS_CDPLIB_H_
#define LIBS_CDPLIB_H_
#if defined(__cplusplus)
extern "C" {
#endif
#include "cdp/cdp.h"
#if defined(__cplusplus)
}
#endif
#endif /* LIBS_CDPLIB_H_ */
+8 -1
View File
@@ -21,6 +21,10 @@
#include "types.h"
#if defined(__cplusplus)
extern "C" {
#endif
typedef uint8 BYTE;
typedef uint8 UBYTE;
typedef sint8 SBYTE;
@@ -85,5 +89,8 @@ typedef DWORD (*PDWORDFUNC) (void);
# define _ALIGNED_ON(bytes)
#endif
#endif /* LIBS_COMPILER_H_ */
#if defined(__cplusplus)
}
#endif
#endif /* LIBS_COMPILER_H_ */
+9
View File
@@ -20,6 +20,11 @@
#define LIBS_DECLIB_H_
#include "libs/compiler.h"
#if defined(__cplusplus)
extern "C" {
#endif
typedef struct _LZHCODE_DESC* DECODE_REF;
enum
@@ -45,4 +50,8 @@ extern COUNT cread (void *pStr, COUNT size, COUNT count,
extern COUNT cwrite (const void *pStr, COUNT size, COUNT count,
DECODE_REF DecodeRef);
#if defined(__cplusplus)
}
#endif
#endif /* LIBS_DECLIB_H_ */
+1
View File
@@ -1 +1,2 @@
uqm_CFILES="lzdecode.c lzencode.c update.c"
uqm_HFILES="lzh.h"
+8
View File
@@ -25,6 +25,10 @@
// for bool
#include "types.h"
#if defined(__cplusplus)
extern "C" {
#endif
#if 0
// from temp.h
void initTempDir (void);
@@ -83,5 +87,9 @@ static inline int isDriveLetter(int c)
}
#endif /* HAVE_DRIVE_LETTERS */
#if defined(__cplusplus)
}
#endif
#endif /* LIBS_FILE_H_ */
+1
View File
@@ -1 +1,2 @@
uqm_CFILES="dirs.c files.c"
uqm_HFILES="filintrn.h"
+8 -4
View File
@@ -142,7 +142,7 @@ mkdirhier (const char *path)
if (*pathstart == '\0') {
// path exists completely, nothing more to do
return 0;
goto success;
}
// walk through the path as long as the components exist
@@ -177,7 +177,7 @@ mkdirhier (const char *path)
}
if (*pathend == '\0')
return 0;
goto success;
*ptr = '/';
ptr++;
@@ -187,7 +187,7 @@ mkdirhier (const char *path)
// pathstart is the next non-slash character
if (*pathstart == '\0')
return 0;
goto success;
}
// create all components left
@@ -221,6 +221,9 @@ mkdirhier (const char *path)
ptr += pathend - pathstart;
*ptr = '\0';
}
success:
HFree (buf);
return 0;
err:
@@ -641,6 +644,7 @@ expandPath (char *dest, size_t len, const char *src, int what)
*destptr = '\0';
}
HFree (buf);
return 0;
err:
@@ -656,7 +660,7 @@ err:
// This code is only needed if we have a current working directory
// per drive.
// letter is 0 based: 0 = A, 1 = B, ...
bool
static bool
driveLetterExists(int letter)
{
unsigned long drives;
+1 -1
View File
@@ -94,7 +94,7 @@ copyFile (uio_DirHandle *srcDir, const char *srcName,
buf = HMalloc(BUFSIZE);
// This was originally a statically allocated buffer,
// but as this function might be run from a thread with
// a small Stack, this is better.
// a small stack, this is better.
while (1)
{
numInBuf = uio_read (src, buf, BUFSIZE);
+17
View File
@@ -32,6 +32,10 @@ struct Color {
#include "libs/reslib.h"
#if defined(__cplusplus)
extern "C" {
#endif
typedef struct context_desc CONTEXT_DESC;
typedef struct frame_desc FRAME_DESC;
typedef struct font_desc FONT_DESC;
@@ -227,8 +231,16 @@ typedef struct text
COUNT CharCount;
} TEXT;
#if defined(__cplusplus)
}
#endif
#include "libs/strlib.h"
#if defined(__cplusplus)
extern "C" {
#endif
typedef STRING_TABLE COLORMAP_REF;
typedef STRING COLORMAP;
// COLORMAPPTR is really a pointer to colortable entry structure
@@ -237,6 +249,7 @@ typedef void *COLORMAPPTR;
#include "graphics/prim.h"
typedef BYTE BATCH_FLAGS;
// This flag is currently unused but it might make sense to restore it
#define BATCH_BUILD_PAGE (BATCH_FLAGS)(1 << 0)
@@ -454,4 +467,8 @@ extern COLORMAPPTR GetColorMapAddress (COLORMAP);
void SetSystemRect (const RECT *pRect);
void ClearSystemRect (void);
#if defined(__cplusplus)
}
#endif
#endif /* LIBS_GFXLIB_H_ */
+3
View File
@@ -7,3 +7,6 @@ uqm_CFILES="boxint.c clipline.c cmap.c context.c drawable.c filegfx.c
font.c frame.c gfx_common.c intersec.c loaddisp.c
pixmap.c resgfx.c tfb_draw.c tfb_prim.c widgets.c"
uqm_HFILES="bbox.h cmap.h context.h dcqueue.h drawable.h drawcmd.h font.h
gfx_common.h gfxintrn.h prim.h tfb_draw.h tfb_prim.h widgets.h"
+25 -5
View File
@@ -64,6 +64,10 @@ static int mapcount;
static Mutex maplock;
static void release_colormap (TFB_ColorMap *map);
static void delete_colormap (TFB_ColorMap *map);
void
InitColorMaps (void)
{
@@ -84,13 +88,23 @@ InitColorMaps (void)
void
UninitColorMaps (void)
{
int i;
TFB_ColorMap *next;
for (i = 0; i < MAX_COLORMAPS; ++i)
{
TFB_ColorMap *map = colormaps[i];
if (!map)
continue;
release_colormap (map);
colormaps[i] = 0;
}
// free spares
for ( ; poolhead; poolhead = next)
for ( ; poolhead; poolhead = next, --poolcount)
{
next = poolhead->next;
HFree (poolhead);
delete_colormap (poolhead);
}
DestroyMutex (fadeLock);
@@ -155,6 +169,13 @@ clone_colormap (TFB_ColorMap *from, int index)
return map;
}
static void
delete_colormap (TFB_ColorMap *map)
{
FreeNativePalette (map->palette);
HFree (map);
}
static inline void
free_colormap (TFB_ColorMap *map)
{
@@ -172,8 +193,7 @@ free_colormap (TFB_ColorMap *map)
}
else
{ // don't need any more spares
FreeNativePalette (map->palette);
HFree (map);
delete_colormap (map);
}
}
@@ -193,7 +213,7 @@ get_colormap (int index)
return map;
}
static inline void
static void
release_colormap (TFB_ColorMap *map)
{
if (!map)
+6
View File
@@ -123,6 +123,8 @@ FindContextPtr (CONTEXT context) {
BOOLEAN
DestroyContext (CONTEXT ContextRef)
{
TFB_Image *img;
if (ContextRef == 0)
return (FALSE);
@@ -139,6 +141,10 @@ DestroyContext (CONTEXT ContextRef)
}
#endif /* DEBUG */
img = ContextRef->FontBacking;
if (img)
TFB_DrawImage_Delete (img);
FreeContext (ContextRef);
return TRUE;
}
+83 -2
View File
@@ -156,8 +156,17 @@ Init_DrawCommandQueue (void)
void
Uninit_DrawCommandQueue (void)
{
DestroyCondVar (RenderingCond);
DestroyRecursiveMutex (DCQ_Mutex);
if (RenderingCond)
{
DestroyCondVar (RenderingCond);
RenderingCond = 0;
}
if (DCQ_Mutex)
{
DestroyRecursiveMutex (DCQ_Mutex);
DCQ_Mutex = 0;
}
}
void
@@ -216,6 +225,30 @@ TFB_DrawCommandQueue_Clear ()
UnlockRecursiveMutex (DCQ_Mutex);
}
static void
checkExclusiveThread (TFB_DrawCommand* DrawCommand)
{
#ifdef DEBUG_DCQ_THREADS
static uint32 exclusiveThreadId;
extern uint32 SDL_ThreadID(void);
// Only one thread is currently allowed to enqueue commands
// This is not a technical limitation but rather a semantical one atm.
if (DrawCommand->Type == TFB_DRAWCOMMANDTYPE_REINITVIDEO)
{ // TFB_DRAWCOMMANDTYPE_REINITVIDEO is an exception
// It is queued from the main() thread, which is safe to do
return;
}
if (!exclusiveThreadId)
exclusiveThreadId = SDL_ThreadID();
else
assert (SDL_ThreadID() == exclusiveThreadId);
#else
(void) DrawCommand; // suppress unused warning
#endif
}
void
TFB_EnqueueDrawCommand (TFB_DrawCommand* DrawCommand)
{
@@ -224,6 +257,8 @@ TFB_EnqueueDrawCommand (TFB_DrawCommand* DrawCommand)
return;
}
checkExclusiveThread (DrawCommand);
if (DrawCommand->Type <= TFB_DRAWCOMMANDTYPE_COPYTOIMAGE
&& _CurFramePtr->Type == SCREEN_DRAWABLE)
{
@@ -587,3 +622,49 @@ TFB_FlushGraphics (void)
RenderedFrames++;
BroadcastCondVar (RenderingCond);
}
void
TFB_PurgeDanglingGraphics (void)
{
Lock_DCQ (-1);
for (;;)
{
TFB_DrawCommand DC;
if (!TFB_DrawCommandQueue_Pop (&DC))
{
// the Queue is now empty.
break;
}
switch (DC.Type)
{
case TFB_DRAWCOMMANDTYPE_DELETEIMAGE:
{
TFB_Image *DC_image = DC.data.deleteimage.image;
TFB_DrawImage_Delete (DC_image);
break;
}
case TFB_DRAWCOMMANDTYPE_DELETEDATA:
{
void *data = DC.data.deletedata.data;
HFree (data);
break;
}
case TFB_DRAWCOMMANDTYPE_IMAGE:
{
TFB_ColorMap *cmap = DC.data.image.colormap;
if (cmap)
TFB_ReturnColorMap (cmap);
break;
}
case TFB_DRAWCOMMANDTYPE_SENDSIGNAL:
{
ClearSemaphore (DC.data.sendsignal.sem);
break;
}
}
}
Unlock_DCQ ();
}
+1 -1
View File
@@ -99,7 +99,7 @@ UnbatchGraphics (void)
been processed. */
void
FlushGraphics ()
FlushGraphics (void)
{
TFB_DrawScreen_WaitForSignal ();
}
+2 -1
View File
@@ -67,7 +67,7 @@ int TFB_InitGraphics (int driver, int flags, int width, int height);
int TFB_ReInitGraphics (int driver, int flags, int width, int height);
void TFB_UninitGraphics (void);
void TFB_ProcessEvents (void);
void TFB_SetGamma (float gamma);
bool TFB_SetGamma (float gamma);
void TFB_UploadTransitionScreen (void);
int TFB_SupportsHardwareScaling (void);
// This function should not be called directly
@@ -99,6 +99,7 @@ extern float FrameRate;
extern int FrameRateTickBase;
void TFB_FlushGraphics (void); // Only call from main thread!!
void TFB_PurgeDanglingGraphics (void); // Only call from main thread as part of shutdown.
extern int ScreenWidth;
extern int ScreenHeight;
+1 -9
View File
@@ -321,15 +321,7 @@ _ReleaseCelData (void *handle)
return (FALSE);
cel_ct = DrawablePtr->MaxIndex + 1;
if (DrawablePtr->Frame)
{
FramePtr = DrawablePtr->Frame;
if (FramePtr->Type == SCREEN_DRAWABLE)
{
FramePtr = NULL;
}
}
FramePtr = DrawablePtr->Frame;
HFree (handle);
if (FramePtr)
+3
View File
@@ -4,3 +4,6 @@ uqm_CFILES="opengl.c palette.c primitives.c pure.c sdl2_pure.c
2xscalers_mmx.c 2xscalers_sse.c 2xscalers_3dnow.c
nearest2x.c bilinear2x.c biadv2x.c triscan2x.c hq2x.c
canvas.c png2sdl.c sdluio.c rotozoom.c"
uqm_HFILES="2xscalers.h 2xscalers_mmx.h opengl.h palette.h png2sdl.h
primitives.h pure.h rotozoom.h scaleint.h scalemmx.h
scalers.h sdl_common.h sdluio.h"
-24
View File
@@ -74,30 +74,6 @@ static TFB_GRAPHICS_BACKEND opengl_unscaled_backend = {
TFB_GL_ColorLayer };
static SDL_Surface *
Create_Screen (SDL_Surface *template, int w, int h)
{
SDL_Surface *newsurf = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h,
template->format->BitsPerPixel,
template->format->Rmask, template->format->Gmask,
template->format->Bmask, 0);
if (newsurf == 0) {
log_add (log_Error, "Couldn't create screen buffers: %s",
SDL_GetError());
}
return newsurf;
}
static int
ReInit_Screen (SDL_Surface **screen, SDL_Surface *template, int w, int h)
{
if (*screen)
SDL_FreeSurface (*screen);
*screen = Create_Screen (template, w, h);
return *screen == 0 ? -1 : 0;
}
static int
AttemptColorDepth (int flags, int width, int height, int bpp)
{
+1
View File
@@ -23,6 +23,7 @@
#if SDL_MAJOR_VERSION == 1
int TFB_GL_InitGraphics (int driver, int flags, int width, int height);
void TFB_GL_UninitGraphics (void);
int TFB_GL_ConfigureVideo (int driver, int flags, int width, int height, int togglefullscreen);
#ifdef HAVE_OPENGL
+8 -24
View File
@@ -53,30 +53,6 @@ static TFB_GRAPHICS_BACKEND pure_unscaled_backend = {
TFB_Pure_ScreenLayer,
TFB_Pure_ColorLayer };
static SDL_Surface *
Create_Screen (SDL_Surface *template, int w, int h)
{
SDL_Surface *newsurf = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h,
template->format->BitsPerPixel,
template->format->Rmask, template->format->Gmask,
template->format->Bmask, 0);
if (newsurf == 0) {
log_add (log_Error, "Couldn't create screen buffers: %s",
SDL_GetError());
}
return newsurf;
}
static int
ReInit_Screen (SDL_Surface **screen, SDL_Surface *template, int w, int h)
{
if (*screen)
SDL_FreeSurface (*screen);
*screen = Create_Screen (template, w, h);
return *screen == 0 ? -1 : 0;
}
// We cannot rely on SDL_DisplayFormatAlpha() anymore. It can return
// formats that we do not expect (SDL v1.2.14 on Mac OSX). Mac likes
// ARGB surfaces, but SDL_DisplayFormatAlpha thinks that only RGBA are fast.
@@ -293,6 +269,14 @@ TFB_Pure_InitGraphics (int driver, int flags, int width, int height)
return 0;
}
void
TFB_Pure_UninitGraphics (void)
{
UnInit_Screen (&scaled_display);
UnInit_Screen (&fade_color_surface);
UnInit_Screen (&fade_temp);
}
static void
ScanLines (SDL_Surface *dst, SDL_Rect *r)
{
+1
View File
@@ -22,6 +22,7 @@
#include "libs/graphics/sdl/sdl_common.h"
int TFB_Pure_InitGraphics (int driver, int flags, int width, int height);
void TFB_Pure_UninitGraphics (void);
int TFB_Pure_ConfigureVideo (int driver, int flags, int width, int height, int togglefullscreen);
void Scale_PerfTest (void);
+6 -2
View File
@@ -223,6 +223,7 @@ int zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int smooth)
*/
static
int zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst)
{
Uint32 sx, sy, *sax, *say, *csax, *csay, csx, csy;
@@ -343,6 +344,7 @@ int zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst)
*/
static
void transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos, int smooth)
{
int x, y, t1, t2, dx, dy, xd, yd, sdx, sdy, ax, ay, ex, ey, sw, sh;
@@ -498,6 +500,7 @@ void transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx, int cy,
*/
static
void transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos)
{
int x, y, dx, dy, xd, yd, sdx, sdy, ax, ay, sw, sh;
@@ -560,6 +563,7 @@ void transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int
/* Local rotozoom-size function with trig result return */
static
void rotozoomSurfaceSizeTrig(int width, int height, double angle, double zoom, int *dstwidth, int *dstheight,
double *canglezoom, double *sanglezoom)
{
@@ -581,8 +585,8 @@ void rotozoomSurfaceSizeTrig(int width, int height, double angle, double zoom, i
cy = *canglezoom * y;
sx = *sanglezoom * x;
sy = *sanglezoom * y;
dstwidthhalf = MAX((int) ceil(fabs(cx) + fabs(sy)), 1);
dstheighthalf = MAX((int) ceil(fabs(sx) + fabs(cy)), 1);
dstwidthhalf = MAX(ceil(fabs(cx) + fabs(sy)), 1);
dstheighthalf = MAX(ceil(fabs(sx) + fabs(cy)), 1);
*dstwidth = 2 * dstwidthhalf;
*dstheight = 2 * dstheighthalf;
}
+5 -5
View File
@@ -213,8 +213,8 @@ Scale_PrepPlatform (int flags, const SDL_PixelFormat* fmt)
// first match wins
// add better platform techs to the top
#ifdef MMX_ASM
if ( (!force_platform && (SDL_HasSSE () || SDL_HasMMX ()))
|| force_platform == SCALEPLAT_SSE)
if ( (!force_platform && (SDL_HasSSE () || SDL_HasMMXExt ()))
|| force_platform == PLATFORM_SSE)
{
log_add (log_Info, "Screen scalers are using SSE/MMX-Ext/MMX code");
Scale_Platform = SCALEPLAT_SSE;
@@ -223,7 +223,7 @@ Scale_PrepPlatform (int flags, const SDL_PixelFormat* fmt)
}
else
if ( (!force_platform && SDL_HasAltiVec ())
|| force_platform == SCALEPLAT_ALTIVEC)
|| force_platform == PLATFORM_ALTIVEC)
{
log_add (log_Info, "Screen scalers would use AltiVec code "
"if someone actually wrote it");
@@ -231,7 +231,7 @@ Scale_PrepPlatform (int flags, const SDL_PixelFormat* fmt)
}
else
if ( (!force_platform && SDL_Has3DNow ())
|| force_platform == SCALEPLAT_3DNOW)
|| force_platform == PLATFORM_3DNOW)
{
log_add (log_Info, "Screen scalers are using 3DNow/MMX code");
Scale_Platform = SCALEPLAT_3DNOW;
@@ -240,7 +240,7 @@ Scale_PrepPlatform (int flags, const SDL_PixelFormat* fmt)
}
else
if ( (!force_platform && SDL_HasMMX ())
|| force_platform == SCALEPLAT_MMX)
|| force_platform == PLATFORM_MMX)
{
log_add (log_Info, "Screen scalers are using MMX code");
Scale_Platform = SCALEPLAT_MMX;
+98 -12
View File
@@ -50,18 +50,96 @@ TFB_GRAPHICS_BACKEND *graphics_backend = NULL;
volatile int QuitPosted = 0;
volatile int GameActive = 1; // Track the SDL_ACTIVEEVENT state SDL_APPACTIVE
static void TFB_PreQuit (void);
void
TFB_PreInit (void)
{
log_add (log_Info, "Initializing base SDL functionality.");
log_add (log_Info, "Using SDL version %d.%d.%d (compiled with "
"%d.%d.%d)", SDL_Linked_Version ()->major,
SDL_Linked_Version ()->minor, SDL_Linked_Version ()->patch,
SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
#if 0
if (SDL_Linked_Version ()->major != SDL_MAJOR_VERSION ||
SDL_Linked_Version ()->minor != SDL_MINOR_VERSION ||
SDL_Linked_Version ()->patch != SDL_PATCHLEVEL) {
log_add (log_Warning, "The used SDL library is not the same version "
"as the one used to compile The Ur-Quan Masters with! "
"If you experience any crashes, this would be an excellent "
"suspect.");
}
#endif
if ((SDL_Init (SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) == -1))
{
log_add (log_Fatal, "Could not initialize SDL: %s.", SDL_GetError ());
exit (EXIT_FAILURE);
}
atexit (TFB_PreQuit);
}
static void
TFB_PreQuit (void)
{
SDL_Quit ();
}
int
TFB_ReInitGraphics (int driver, int flags, int width, int height)
{
int result;
int togglefullscreen = 0;
char caption[200];
if (GfxFlags == (flags ^ TFB_GFXFLAGS_FULLSCREEN) &&
driver == GraphicsDriver &&
width == ScreenWidthActual && height == ScreenHeightActual)
{
togglefullscreen = 1;
}
GfxFlags = flags;
if (driver == TFB_GFXDRIVER_SDL_OPENGL)
{
#ifdef HAVE_OPENGL
result = TFB_GL_ConfigureVideo (driver, flags, width, height,
togglefullscreen);
#else
driver = TFB_GFXDRIVER_SDL_PURE;
log_add (log_Warning, "OpenGL support not compiled in,"
" so using pure SDL driver");
result = TFB_Pure_ConfigureVideo (driver, flags, width, height,
togglefullscreen);
#endif
}
else
{
result = TFB_Pure_ConfigureVideo (driver, flags, width, height,
togglefullscreen);
}
sprintf (caption, "The Ur-Quan Masters v%d.%d.%d%s",
UQM_MAJOR_VERSION, UQM_MINOR_VERSION,
UQM_PATCH_VERSION, UQM_EXTRA_VERSION);
SDL_WM_SetCaption (caption, NULL);
if (flags & TFB_GFXFLAGS_FULLSCREEN)
SDL_ShowCursor (SDL_DISABLE);
else
SDL_ShowCursor (SDL_ENABLE);
return result;
}
int
TFB_InitGraphics (int driver, int flags, int width, int height)
{
int result, i;
int result;
char caption[200];
/* Null out screen pointers the first time */
for (i = 0; i < TFB_GFX_NUMSCREENS; i++)
{
SDL_Screens[i] = NULL;
}
GfxFlags = flags;
if (driver == TFB_GFXDRIVER_SDL_OPENGL)
@@ -95,17 +173,25 @@ TFB_InitGraphics (int driver, int flags, int width, int height)
TFB_DrawCanvas_Initialize ();
atexit (TFB_UninitGraphics);
return 0;
}
void
TFB_UninitGraphics (void)
{
int i;
Uninit_DrawCommandQueue ();
// TODO: Uninit whatever the drivers have set up for us
SDL_Quit ();
for (i = 0; i < TFB_GFX_NUMSCREENS; i++)
UnInit_Screen (&SDL_Screens[i]);
TFB_Pure_UninitGraphics ();
#ifdef HAVE_OPENGL
TFB_GL_UninitGraphics ();
#endif
UnInit_Screen (&format_conv_surf);
}
void
@@ -113,7 +199,7 @@ TFB_ProcessEvents ()
{
SDL_Event Event;
while (SDL_PollEvent (&Event))
while (SDL_PollEvent (&Event) > 0)
{
/* Run through the InputEvent filter. */
ProcessInputEvent (&Event);
+4
View File
@@ -55,4 +55,8 @@ int TFB_SetColorKey (SDL_Surface *surface, Uint32 key, int rleaccel);
int TFB_DisableColorKey (SDL_Surface *surface);
int TFB_SetColors (SDL_Surface *surface, SDL_Color *colors, int firstcolor, int ncolors);
SDL_Surface* Create_Screen (SDL_Surface *templat, int w, int h);
int ReInit_Screen (SDL_Surface **screen, SDL_Surface *templat, int w, int h);
void UnInit_Screen (SDL_Surface **screen);
#endif
+10 -1
View File
@@ -301,6 +301,7 @@ TFB_DrawImage_New (TFB_Canvas canvas)
img->last_scale_hs = NullHs;
img->last_scale_type = -1;
img->last_scale = 0;
img->dirty = FALSE;
TFB_DrawCanvas_GetExtent (canvas, &img->extent);
if (TFB_DrawCanvas_IsPaletted (canvas))
@@ -414,8 +415,16 @@ TFB_DrawImage_Delete (TFB_Image *image)
TFB_DrawCanvas_Delete (image->NormalImg);
if (image->ScaledImg) {
if (image->ScaledImg)
{
TFB_DrawCanvas_Delete (image->ScaledImg);
image->ScaledImg = 0;
}
if (image->FilledImg)
{
TFB_DrawCanvas_Delete (image->FilledImg);
image->FilledImg = 0;
}
UnlockMutex (image->mutex);
+2 -2
View File
@@ -131,7 +131,7 @@ TFB_Prim_Stamp (STAMP *stmp, DrawMode mode, POINT ctxOrigin)
if (!SrcFramePtr)
{
log_add (log_Warning, "TFB_Prim_Stamp: Tried to draw a NULL frame"
" (Stamp address = %p)", stmp);
" (Stamp address = %p)", (void *) stmp);
return;
}
img = SrcFramePtr->image;
@@ -180,7 +180,7 @@ TFB_Prim_StampFill (STAMP *stmp, Color color, DrawMode mode, POINT ctxOrigin)
if (!SrcFramePtr)
{
log_add (log_Warning, "TFB_Prim_StampFill: Tried to draw a NULL frame"
" (Stamp address = %p)", stmp);
" (Stamp address = %p)", (void *) stmp);
return;
}
img = SrcFramePtr->image;
+7
View File
@@ -1,2 +1,9 @@
#if defined(__cplusplus)
extern "C" {
#endif
#include "heap/heap.h"
#if defined(__cplusplus)
}
#endif
+1 -1
View File
@@ -1,2 +1,2 @@
uqm_CFILES="heap.c"
uqm_HFILES="heap.h"
+1 -1
View File
@@ -49,7 +49,7 @@ Heap_new(HeapValue_Comparator comparator, size_t initialSize, size_t minSize,
heap->minSize = minSize;
heap->minFillQuotient = minFillQuotient;
heap->size = nextPower2(initialSize);
heap->minFill = (size_t) ceil(((double) (heap->size >> 1))
heap->minFill = ceil(((double) (heap->size >> 1))
* heap->minFillQuotient);
heap->entries = malloc(heap->size * sizeof (HeapValue *));
heap->numEntries = 0;
+11 -4
View File
@@ -24,6 +24,10 @@
#include "libs/uio.h"
#include "libs/unicode.h"
#if defined(__cplusplus)
extern "C" {
#endif
extern BOOLEAN AnyButtonPress (BOOLEAN DetectSpecial);
@@ -49,9 +53,9 @@ UniChar GetLastCharacter (void);
/* Interrogating the current key configuration */
void InterrogateInputState (int template, int control, int index, char *buffer, int maxlen);
void RemoveInputState (int template, int control, int index);
void RebindInputState (int template, int control, int index);
void InterrogateInputState (int templat, int control, int index, char *buffer, int maxlen);
void RemoveInputState (int templat, int control, int index);
void RebindInputState (int templat, int control, int index);
void SaveKeyConfiguration (uio_DirHandle *path, const char *fname);
@@ -59,5 +63,8 @@ void SaveKeyConfiguration (uio_DirHandle *path, const char *fname);
void BeginInputFrame (void);
#endif /* LIBS_INPLIB_H_ */
#if defined(__cplusplus)
}
#endif
#endif /* LIBS_INPLIB_H */
+1
View File
@@ -3,3 +3,4 @@ if [ "$uqm_GFXMODULE" = "sdl" ]; then
fi
uqm_CFILES="input_common.c"
uqm_HFILES="inpintrn.h input_common.h"
+1
View File
@@ -1 +1,2 @@
uqm_CFILES="input.c keynames.c vcontrol.c"
uqm_HFILES="input.h keynames.h vcontrol.h"
+45 -24
View File
@@ -18,8 +18,10 @@
#include <assert.h>
#include <errno.h>
#include <string.h>
#include "input.h"
#include "../inpintrn.h"
#include "libs/graphics/sdl/sdl_common.h"
#include "libs/threadlib.h"
#include "libs/input/sdl/vcontrol.h"
#include "libs/input/sdl/keynames.h"
#include "libs/memlib.h"
@@ -218,13 +220,12 @@ TFB_SetInputVectors (volatile int menu[], int num_menu_, volatile int flight[],
num_flight = num_flight_;
}
int
TFB_InitInput (int driver, int flags)
#ifdef HAVE_JOYSTICK
static void
initJoystick (void)
{
int i;
int nJoysticks;
(void)driver;
(void)flags;
#if SDL_MAJOR_VERSION == 1
SDL_EnableUNICODE(1);
@@ -246,6 +247,8 @@ TFB_InitInput (int driver, int flags)
nJoysticks = SDL_NumJoysticks ();
if (nJoysticks > 0)
{
int i;
log_add (log_Info, "The names of the joysticks are:");
for (i = 0; i < nJoysticks; i++)
{
@@ -258,6 +261,23 @@ TFB_InitInput (int driver, int flags)
}
SDL_JoystickEventState (SDL_ENABLE);
}
}
#endif /* HAVE_JOYSTICK */
int
TFB_InitInput (int driver, int flags)
{
(void)driver;
(void)flags;
SDL_EnableUNICODE(1);
(void)SDL_GetKeyState (&num_keys);
kbdstate = (int *)HMalloc (sizeof (int) * (num_keys + 1));
#ifdef HAVE_JOYSTICK
initJoystick ();
#endif /* HAVE_JOYSTICK */
in_character_mode = FALSE;
@@ -271,7 +291,6 @@ TFB_InitInput (int driver, int flags)
VControl_ResetInput ();
InputInitialized = TRUE;
atexit (TFB_UninitInput);
return 0;
}
@@ -328,7 +347,7 @@ GetLastCharacter (void)
volatile int MouseButtonDown = 0;
void
static void
ProcessMouseEvent (const SDL_Event *e)
{
switch (e->type)
@@ -372,10 +391,12 @@ ProcessInputEvent (const SDL_Event *Event)
if (Event->type == SDL_KEYDOWN || Event->type == SDL_KEYUP)
{ // process character input event, if any
SDLKey k = Event->key.keysym.sym;
// keysym.sym is an SDLKey type which is an enum and can be signed
// or unsigned on different platforms; we'll use a guaranteed type
int k = Event->key.keysym.sym;
UniChar map_key = Event->key.keysym.unicode;
if (k > num_keys)
if (k < 0 || k > num_keys)
k = num_keys; // for unknown keys
if (Event->type == SDL_KEYDOWN)
@@ -494,11 +515,11 @@ TFB_ResetControls (void)
}
void
InterrogateInputState (int template, int control, int index, char *buffer, int maxlen)
InterrogateInputState (int templat, int control, int index, char *buffer, int maxlen)
{
VCONTROL_GESTURE *g = CONTROL_PTR(template, control, index);
VCONTROL_GESTURE *g = CONTROL_PTR(templat, control, index);
if (template >= num_templ || control >= num_flight
if (templat >= num_templ || control >= num_flight
|| index >= MAX_FLIGHT_ALTERNATES)
{
log_add (log_Warning, "InterrogateInputState(): invalid control index");
@@ -531,13 +552,13 @@ InterrogateInputState (int template, int control, int index, char *buffer, int m
}
void
RemoveInputState (int template, int control, int index)
RemoveInputState (int templat, int control, int index)
{
VCONTROL_GESTURE *g = CONTROL_PTR(template, control, index);
VCONTROL_GESTURE *g = CONTROL_PTR(templat, control, index);
char keybuf[40];
keybuf[39] = '\0';
if (template >= num_templ || control >= num_flight
if (templat >= num_templ || control >= num_flight
|| index >= MAX_FLIGHT_ALTERNATES)
{
log_add (log_Warning, "RemoveInputState(): invalid control index");
@@ -545,23 +566,23 @@ RemoveInputState (int template, int control, int index)
}
VControl_RemoveGestureBinding (g,
(int *)(flight_vec + template * num_flight + control));
(int *)(flight_vec + templat * num_flight + control));
g->type = VCONTROL_NONE;
snprintf (keybuf, 39, "keys.%d.%s.%d", template+1, flight_res_names[control], index+1);
snprintf (keybuf, 39, "keys.%d.%s.%d", templat+1, flight_res_names[control], index+1);
res_Remove (keybuf);
return;
}
void
RebindInputState (int template, int control, int index)
RebindInputState (int templat, int control, int index)
{
VCONTROL_GESTURE g;
char keybuf[40], valbuf[40];
keybuf[39] = valbuf[39] = '\0';
if (template >= num_templ || control >= num_flight
if (templat >= num_templ || control >= num_flight
|| index >= MAX_FLIGHT_ALTERNATES)
{
log_add (log_Warning, "RebindInputState(): invalid control index");
@@ -569,7 +590,7 @@ RebindInputState (int template, int control, int index)
}
/* Remove the old binding on this spot */
RemoveInputState (template, control, index);
RemoveInputState (templat, control, index);
/* Wait for the next interesting bit of user input */
VControl_ClearGesture ();
@@ -580,9 +601,9 @@ RebindInputState (int template, int control, int index)
/* And now, add the new binding. */
VControl_AddGestureBinding (&g,
(int *)(flight_vec + template * num_flight + control));
*CONTROL_PTR(template, control, index) = g;
snprintf (keybuf, 39, "keys.%d.%s.%d", template+1, flight_res_names[control], index+1);
(int *)(flight_vec + templat * num_flight + control));
*CONTROL_PTR(templat, control, index) = g;
snprintf (keybuf, 39, "keys.%d.%s.%d", templat+1, flight_res_names[control], index+1);
VControl_DumpGesture (valbuf, 39, &g);
res_PutString (keybuf, valbuf);
}
+3
View File
@@ -19,6 +19,9 @@
#ifndef INPUT_H
#define INPUT_H
#include "port.h"
#include SDL_INCLUDE(SDL.h)
extern void ProcessInputEvent (const SDL_Event *Event);
#endif
+4 -4
View File
@@ -33,7 +33,7 @@
* tragedy. */
typedef struct vcontrol_keyname {
/* const */ char *name;
const char *name;
int code;
} keyname;
@@ -197,7 +197,7 @@ static keyname keynames[] = {
{"Unknown", 0}};
/* Last element must have code zero */
char *
const char *
VControl_code2name (int code)
{
int i = 0;
@@ -213,12 +213,12 @@ VControl_code2name (int code)
}
int
VControl_name2code (char *name)
VControl_name2code (const char *name)
{
int i = 0;
while (1)
{
char *test = keynames[i].name;
const char *test = keynames[i].name;
int code = keynames[i].code;
if (!strcasecmp(test, name) || !code)
{
+2 -2
View File
@@ -17,6 +17,6 @@
#ifndef LIBS_INPUT_SDL_KEYNAMES_H_
#define LIBS_INPUT_SDL_KEYNAMES_H_
char *VControl_code2name (int code);
int VControl_name2code (char *code);
const char *VControl_code2name (int code);
int VControl_name2code (const char *code);
#endif
+2 -1
View File
@@ -195,6 +195,7 @@ static void
key_init (void)
{
unsigned int i;
int num_keys; // Temp to match type of param for SDL_GetKeyState().
pool = allocate_key_chunk ();
for (i = 0; i < KEYBOARD_INPUT_BUCKETS; i++)
bindings[i] = NULL;
@@ -1265,7 +1266,7 @@ VControl_ParseGesture (VCONTROL_GESTURE *g, const char *spec)
parse_state ps;
strncpy (ps.line, spec, LINE_SIZE);
ps.line[LINE_SIZE] = '\0';
ps.line[LINE_SIZE - 1] = '\0';
ps.index = ps.error = 0;
ps.linenum = -1;
+9
View File
@@ -16,5 +16,14 @@
*
*/
#if defined(__cplusplus)
extern "C" {
#endif
#include "list/list.h"
#if defined(__cplusplus)
}
#endif
+1
View File
@@ -1 +1,2 @@
uqm_CFILES="list.c"
uqm_HFILES="list.h"
+8
View File
@@ -14,4 +14,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#if defined(__cplusplus)
extern "C" {
#endif
#include "log/uqmlog.h"
#if defined(__cplusplus)
}
#endif

Some files were not shown because too many files have changed in this diff Show More