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:
@@ -0,0 +1,9 @@
|
|||||||
|
.DS_Store
|
||||||
|
*.app
|
||||||
|
build.vars
|
||||||
|
config.state
|
||||||
|
config_unix.h
|
||||||
|
obj
|
||||||
|
uqm-debug
|
||||||
|
uqm-wrapper
|
||||||
|
uqm
|
||||||
+10
-5
@@ -7,7 +7,7 @@ The Ur-Quan Masters port:
|
|||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
Core team (in alphabetical order):
|
Core team (in alphabetical order):
|
||||||
Serge van den Boom <svdb@stack.nl>
|
Serge van den Boom <serge@vdboom.org>
|
||||||
Mika Kolehmainen <mk@kapsi.fi>
|
Mika Kolehmainen <mk@kapsi.fi>
|
||||||
Michael Chapman Martin <mcmartin@gmail.com>
|
Michael Chapman Martin <mcmartin@gmail.com>
|
||||||
Chris Nelson <chris@toysforbob.com>
|
Chris Nelson <chris@toysforbob.com>
|
||||||
@@ -19,13 +19,18 @@ Additional programming (in alphabetical order):
|
|||||||
|
|
||||||
Music remixers (in alphabetical order):
|
Music remixers (in alphabetical order):
|
||||||
Jouni Airaksinen <markvera@spacesynth.net>
|
Jouni Airaksinen <markvera@spacesynth.net>
|
||||||
Tore Aune Fjellstad
|
András Barják <forevian@freemail.hu>
|
||||||
Espen Gätzschmann
|
Matt Bentley
|
||||||
|
Tore Aune Fjellstad <void@medievalfuture.com>
|
||||||
|
Espen Gätzschmann <tilt@medievalfuture.com>
|
||||||
Aaron J. Grier <agrier@poofygoof.com>
|
Aaron J. Grier <agrier@poofygoof.com>
|
||||||
|
A. Keren
|
||||||
|
Casey Monroe
|
||||||
Dan Nicholson <dan@kosmic.org>
|
Dan Nicholson <dan@kosmic.org>
|
||||||
George Nowik <norgio@attbi.com>
|
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>
|
Erol Otus <erol@toysforbob.com>
|
||||||
|
Greg Szymanski
|
||||||
|
|
||||||
Other contributions (in alphabetical order):
|
Other contributions (in alphabetical order):
|
||||||
Jouni Airaksinen <markvera@spacesynth.net> (Startup Menu)
|
Jouni Airaksinen <markvera@spacesynth.net> (Startup Menu)
|
||||||
@@ -138,7 +143,7 @@ Additional writing:
|
|||||||
Music:
|
Music:
|
||||||
Burke Treischmann
|
Burke Treischmann
|
||||||
Dan Nicholson
|
Dan Nicholson
|
||||||
Riku Nuottajärvi
|
Riku Nuottajärvi
|
||||||
Eric Berge
|
Eric Berge
|
||||||
Erol Otus
|
Erol Otus
|
||||||
Marc Brown
|
Marc Brown
|
||||||
|
|||||||
+55
-1
@@ -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
|
- New SDL2 backend for modern operating systems - Micahel
|
||||||
- Fixed netplay when compiling against modern versions of Visual
|
- Fixed netplay when compiling against modern versions of Visual
|
||||||
Studio, from Ala-lala
|
Studio, from Ala-lala
|
||||||
|
|||||||
+7
-7
@@ -5,7 +5,7 @@ These guidelines are there so that you won't waste both our and your time.
|
|||||||
|
|
||||||
Before making changes:
|
Before making changes:
|
||||||
- Read this entire document
|
- 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
|
http://bugs.uqm.stack.nl/ contains any comments on what you're planning
|
||||||
to do.
|
to do.
|
||||||
- Make sure you're using the most recent Subversion version
|
- Make sure you're using the most recent Subversion version
|
||||||
@@ -26,7 +26,7 @@ Making changes:
|
|||||||
we don't even always do, but we've accepted this as our standard. The main
|
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.
|
reason is that this is very close to the original style.
|
||||||
Trying to start a discussion about the standard is pointless and is
|
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 1 tab per indentation level
|
||||||
- Use no more than 76 chars on a line, when using a tab size 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,
|
- Use 2 extra indentation levels for the continuation of a broken line,
|
||||||
@@ -47,7 +47,7 @@ Making changes:
|
|||||||
}
|
}
|
||||||
(Though in this particular case, I personally would repeat the 'long',
|
(Though in this particular case, I personally would repeat the 'long',
|
||||||
or place l and m on the same line)
|
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.
|
for the start of a block.
|
||||||
- one space around binary operators, and after commas.
|
- one space around binary operators, and after commas.
|
||||||
- one space between the function name and following '(', both in
|
- 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
|
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
|
original. If you don't have the skills or patience to do so, this is not
|
||||||
the place for you.
|
the place for you.
|
||||||
- Only use portable functions. The code is intended to work on Windows,
|
- Only use portable functions. The code is intended to work on Windows
|
||||||
Linux, FreeBSD, BeOS and MacOS X.
|
(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
|
Try to avoid unnecessary system-dependant code, but use #ifdefs if you
|
||||||
really have to.
|
really have to.
|
||||||
- No shortcuts. Don't assume anything about user input (like the length),
|
- 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.
|
mentioning an URL where we can get the patch.
|
||||||
The committers are listed below (in alphabetical order), with their
|
The committers are listed below (in alphabetical order), with their
|
||||||
particular field of expertise with the source. Though all of us
|
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.
|
mentioned.
|
||||||
Serge van den Boom (svdb at stack.nl), SvdB at #sc2
|
Serge van den Boom (svdb at stack.nl), SvdB at #sc2
|
||||||
- Resource system
|
- Resource system
|
||||||
@@ -113,7 +113,7 @@ Getting the patches committed:
|
|||||||
- Graphics
|
- Graphics
|
||||||
- Sound
|
- Sound
|
||||||
- General issues
|
- General issues
|
||||||
Michael Martin (mcmartin at stanford.edu), McMartin at #sc2
|
Michael Martin (mcmartin at mail.com), McMartin at #sc2
|
||||||
- Threading
|
- Threading
|
||||||
- Graphics
|
- Graphics
|
||||||
- Input system
|
- Input system
|
||||||
|
|||||||
@@ -42,6 +42,13 @@ $(OBJDIR)%.c.d: $(BUILD_ROOT)%.c
|
|||||||
fi
|
fi
|
||||||
$(call act,act_mkdep_c,MKDEP ,$@)
|
$(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
|
$(OBJDIR)%.m.d: $(BUILD_ROOT)%.m
|
||||||
@DIR=$(dir $@); \
|
@DIR=$(dir $@); \
|
||||||
if [ ! -d $$DIR ]; then \
|
if [ ! -d $$DIR ]; then \
|
||||||
@@ -63,6 +70,13 @@ $(OBJDIR)%.m.d: $(BUILD_ROOT)%.m
|
|||||||
fi
|
fi
|
||||||
$(call act,act_cc,CC ,$@)
|
$(call act,act_cc,CC ,$@)
|
||||||
|
|
||||||
|
%.cpp.o:
|
||||||
|
@DIR=$(dir $@); \
|
||||||
|
if [ ! -d $$DIR ]; then \
|
||||||
|
mkdir -p "$$DIR"; \
|
||||||
|
fi
|
||||||
|
$(call act,act_cxx,CXX ,$@)
|
||||||
|
|
||||||
%.m.o:
|
%.m.o:
|
||||||
@DIR=$(dir $@); \
|
@DIR=$(dir $@); \
|
||||||
if [ ! -d $$DIR ]; then \
|
if [ ! -d $$DIR ]; then \
|
||||||
|
|||||||
@@ -17,8 +17,10 @@ case "$HOST_SYSTEM" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
uqm_CFLAGS="$uqm_CFLAGS -Isrc"
|
uqm_CFLAGS="$uqm_CFLAGS -Isrc"
|
||||||
|
uqm_CXXFLAGS="$uqm_CXXFLAGS -Isrc"
|
||||||
if [ "$uqm_HAVE_REGEX" = 0 ]; then
|
if [ "$uqm_HAVE_REGEX" = 0 ]; then
|
||||||
uqm_CFLAGS="$uqm_CFLAGS -Isrc/regex"
|
uqm_CFLAGS="$uqm_CFLAGS -Isrc/regex"
|
||||||
|
uqm_CXXFLAGS="$uqm_CXXFLAGS -Isrc/regex"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Stuff to install under the directory for libraries, as specified during
|
# Stuff to install under the directory for libraries, as specified during
|
||||||
|
|||||||
+7
-3
@@ -20,6 +20,9 @@ HOST_SYSTEM='@HOST_SYSTEM@'
|
|||||||
PREPROC_C='@PREPROC_C@'
|
PREPROC_C='@PREPROC_C@'
|
||||||
MKDEP_C='@MKDEP_C@'
|
MKDEP_C='@MKDEP_C@'
|
||||||
COMPILE_C='@COMPILE_C@'
|
COMPILE_C='@COMPILE_C@'
|
||||||
|
PREPROC_CXX='@PREPROC_CXX@'
|
||||||
|
MKDEP_CXX='@MKDEP_CXX@'
|
||||||
|
COMPILE_CXX='@COMPILE_CXX@'
|
||||||
PREPROC_OBJC='@PREPROC_OBJC@'
|
PREPROC_OBJC='@PREPROC_OBJC@'
|
||||||
MKDEP_OBJC='@MKDEP_OBJC@'
|
MKDEP_OBJC='@MKDEP_OBJC@'
|
||||||
COMPILE_OBJC='@COMPILE_OBJC@'
|
COMPILE_OBJC='@COMPILE_OBJC@'
|
||||||
@@ -30,6 +33,7 @@ SED='@SED@'
|
|||||||
REZ='@REZ@'
|
REZ='@REZ@'
|
||||||
WINDRES='@WINDRES@'
|
WINDRES='@WINDRES@'
|
||||||
uqm_CFLAGS='@CFLAGS@'
|
uqm_CFLAGS='@CFLAGS@'
|
||||||
|
uqm_CXXFLAGS='@CXXFLAGS@'
|
||||||
uqm_LDFLAGS='@LDFLAGS@'
|
uqm_LDFLAGS='@LDFLAGS@'
|
||||||
uqm_INSTALL_BINDIR='@INSTALL_BINDIR@'
|
uqm_INSTALL_BINDIR='@INSTALL_BINDIR@'
|
||||||
uqm_INSTALL_LIBDIR='@INSTALL_LIBDIR@'
|
uqm_INSTALL_LIBDIR='@INSTALL_LIBDIR@'
|
||||||
@@ -54,8 +58,8 @@ MACRO_WIN32='@MACRO_WIN32@'
|
|||||||
MACRO___MINGW32__='@MACRO___MINGW32__@'
|
MACRO___MINGW32__='@MACRO___MINGW32__@'
|
||||||
export BUILD_SYSTEM HOST_SYSTEM DEBUG
|
export BUILD_SYSTEM HOST_SYSTEM DEBUG
|
||||||
export MACRO_WIN32 MACRO___MINGW32__
|
export MACRO_WIN32 MACRO___MINGW32__
|
||||||
export uqm_SOUNDMODULE uqm_USE_INTERNAL_MIKMOD uqm_HAVE_GETOPT_LONG
|
export uqm_SOUNDMODULE uqm_OGGVORBIS uqm_USE_INTERNAL_MIKMOD
|
||||||
export uqm_OGGVORBIS
|
export uqm_HAVE_GETOPT_LONG uqm_HAVE_REGEX uqm_USE_WINSOCK uqm_GFXMODULE
|
||||||
export uqm_HAVE_REGEX uqm_USE_WINSOCK uqm_GFXMODULE uqm_HAVE_OPENGL
|
export uqm_HAVE_OPENGL
|
||||||
export uqm_USE_ZIP_IO uqm_USE_PLATFORM_ACCEL uqm_THREADLIB uqm_NETPLAY
|
export uqm_USE_ZIP_IO uqm_USE_PLATFORM_ACCEL uqm_THREADLIB uqm_NETPLAY
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ PostBuild_Cmds=rebase -b 0x400000 -x . "../../uqm.exe"
|
|||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
# 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
|
# SUBTRACT CPP /YX
|
||||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||||
@@ -101,7 +101,7 @@ LINK32=link.exe
|
|||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
# 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
|
# SUBTRACT CPP /YX
|
||||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||||
@@ -215,6 +215,14 @@ SOURCE=..\..\src\libs\callback\alarm.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin 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
|
SOURCE=..\..\src\libs\callback\callback.c
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -1490,6 +1498,10 @@ SOURCE=..\..\src\libs\alarm.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\src\libs\async.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\src\libs\callback.h
|
SOURCE=..\..\src\libs\callback.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -2237,6 +2249,10 @@ SOURCE=..\..\src\uqm\planets\solarsys.c
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\src\uqm\planets\solarsys.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\src\uqm\planets\sundata.h
|
SOURCE=..\..\src\uqm\planets\sundata.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -3138,6 +3154,10 @@ SOURCE=..\..\src\uqm\controls.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\src\uqm\corecode.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\src\uqm\credits.c
|
SOURCE=..\..\src\uqm\credits.c
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -3494,6 +3514,10 @@ SOURCE=..\..\src\uqm\starmap.c
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\src\uqm\starmap.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\src\uqm\state.c
|
SOURCE=..\..\src\uqm\state.c
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -3650,10 +3674,6 @@ SOURCE=..\..\doc\devel\glossary
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\doc\devel\graphicslock
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\..\doc\devel\input
|
SOURCE=..\..\doc\devel\input
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|||||||
+56
-38
@@ -10,6 +10,7 @@ uqm_requirements()
|
|||||||
{
|
{
|
||||||
# Some requirements:
|
# Some requirements:
|
||||||
have_build_tools_language C || exit 1
|
have_build_tools_language C || exit 1
|
||||||
|
have_build_tools_language CXX || exit 1
|
||||||
have_build_tool LINK || exit 1
|
have_build_tool LINK || exit 1
|
||||||
case "$HOST_SYSTEM" in
|
case "$HOST_SYSTEM" in
|
||||||
MINGW32*|cegcc)
|
MINGW32*|cegcc)
|
||||||
@@ -118,16 +119,16 @@ uqm_prepare_config()
|
|||||||
nodebug_action() {
|
nodebug_action() {
|
||||||
case "$HOST_SYSTEM" in
|
case "$HOST_SYSTEM" in
|
||||||
WINSCW)
|
WINSCW)
|
||||||
CFLAGS="$CFLAGS -O2 -d NDEBUG"
|
CCOMMONFLAGS="$CCOMMONFLAGS -O2 -d NDEBUG"
|
||||||
;;
|
;;
|
||||||
ARMV5)
|
ARMV5)
|
||||||
CFLAGS="$CFLAGS -O3 -Otime -DNDEBUG"
|
CCOMMONFLAGS="$CCOMMONFLAGS -O3 -Otime -DNDEBUG"
|
||||||
;;
|
;;
|
||||||
GCCE)
|
GCCE)
|
||||||
CFLAGS="$CFLAGS -O3 -DNDEBUG"
|
CCOMMONFLAGS="$CCOMMONFLAGS -O3 -DNDEBUG"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
CFLAGS="$CFLAGS -O3 -DNDEBUG"
|
CCOMMONFLAGS="$CCOMMONFLAGS -O3 -DNDEBUG"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
DEBUG=0
|
DEBUG=0
|
||||||
@@ -137,13 +138,13 @@ uqm_prepare_config()
|
|||||||
debug_action() {
|
debug_action() {
|
||||||
case "$HOST_SYSTEM" in
|
case "$HOST_SYSTEM" in
|
||||||
WINSCW)
|
WINSCW)
|
||||||
CFLAGS="$CFLAGS -g -O0 -W all -d DEBUG -d _DEBUG"
|
CCOMMONFLAGS="$CCOMMONFLAGS -g -O0 -W all -d DEBUG -d _DEBUG"
|
||||||
;;
|
;;
|
||||||
ARMV5|GCCE)
|
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"
|
LDFLAGS="$LDFLAGS -O0"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -154,40 +155,46 @@ uqm_prepare_config()
|
|||||||
strictdebug_action() {
|
strictdebug_action() {
|
||||||
case "$HOST_SYSTEM" in
|
case "$HOST_SYSTEM" in
|
||||||
WINSCW)
|
WINSCW)
|
||||||
CFLAGS="$CFLAGS -g -O0 -W all -d DEBUG -d _DEBUG"
|
CCOMMONFLAGS="$CCOMMONFLAGS -g -O0 -W all -d DEBUG -d _DEBUG"
|
||||||
;;
|
;;
|
||||||
ARMV5|GCCE)
|
ARMV5|GCCE)
|
||||||
CFLAGS="$CFLAGS -g -O0 -DDEBUG -D_DEBUG"
|
CCOMMONFLAGS="$CCOMMONFLAGS -g -O0 -DDEBUG -D_DEBUG"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
CFLAGS="$CFLAGS -O1" # This is needed for -Wunitialized
|
CCOMMONFLAGS="$CCOMMONFLAGS -g -O0 -DDEBUG -W -Wall"
|
||||||
CFLAGS="$CFLAGS -g -DDEBUG -W -Wall \
|
# CCOMMONFLAGS="$CCOMMONFLAGS -O1"
|
||||||
-Wbad-function-cast -Wcast-qual -Wmissing-prototypes \
|
# This is needed for -Wunitialized with gcc 3.4
|
||||||
-Wstrict-prototypes -Wmissing-declarations \
|
CCOMMONFLAGS="$CCOMMONFLAGS -Wcast-qual -Wmissing-declarations \
|
||||||
-Wwrite-strings -Wimplicit -Wreturn-type -Wformat \
|
-Wwrite-strings -Wimplicit -Wreturn-type -Wformat \
|
||||||
-Wswitch -Wcomment -Wchar-subscripts \
|
-Wswitch -Wcomment -Wchar-subscripts \
|
||||||
-Wparentheses -Wcast-align \
|
-Wparentheses -Wcast-align -Wuninitialized"
|
||||||
-Wuninitialized"
|
CFLAGS="$CFLAGS -Wbad-function-cast -Wmissing-prototypes \
|
||||||
# CFLAGS="$CFLAGS -Waggregate-return"
|
-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.
|
# 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
|
# Some standard header won't even compile with this on
|
||||||
# CFLAGS="$CFLAGS -Wshadow"
|
# CCOMMONFLAGS="$CCOMMONFLAGS -Wshadow"
|
||||||
# This gives absurd conflicts with standard files,
|
# This gives absurd conflicts with standard files,
|
||||||
# like from 'y0 and y1'
|
# like from 'y0 and y1'
|
||||||
# CFLAGS="$CFLAGS -Werror"
|
# CCOMMONFLAGS="$CCOMMONFLAGS -Werror"
|
||||||
# We shouldn't do this until we actually nail them
|
# We shouldn't do this until we actually nail them
|
||||||
# all in the original code. Then we can enforce them
|
# all in the original code. Then we can enforce them
|
||||||
# on ourselves.
|
# on ourselves.
|
||||||
# CFLAGS="$CFLAGS -pedantic-errors -ansi -trigraphs" # ANSI
|
# CCOMMONFLAGS="$CCOMMONFLAGS -pedantic-errors -ansi -trigraphs" # ANSI
|
||||||
# CFLAGS="$CFLAGS -Wnested-externs"
|
# CCOMMONFLAGS="$CCOMMONFLAGS -Wnested-externs"
|
||||||
# We know they're in the code, and though we'd like to
|
# We know they're in the code, and though we'd like to
|
||||||
# get rid of them, they're not bugs.
|
# get rid of them, they're not bugs.
|
||||||
# CFLAGS="$CFLAGS -Winline"
|
# CCOMMONFLAGS="$CCOMMONFLAGS -Winline"
|
||||||
# This gives too many warnings which we can do nothing
|
# This gives too many warnings which we can do nothing
|
||||||
# about, obscuring legitimate warnings.
|
# about, obscuring legitimate warnings.
|
||||||
CFLAGS=`echo $CFLAGS`
|
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.
|
# for more readable messages.
|
||||||
LDFLAGS="$LDFLAGS -O0"
|
LDFLAGS="$LDFLAGS -O0"
|
||||||
;;
|
;;
|
||||||
@@ -211,6 +218,7 @@ uqm_prepare_config()
|
|||||||
CHOICE_graphics_OPTION_pure_PRECOND='have_library SDL 1.2.8'
|
CHOICE_graphics_OPTION_pure_PRECOND='have_library SDL 1.2.8'
|
||||||
graphics_pure_action() {
|
graphics_pure_action() {
|
||||||
CFLAGS="$CFLAGS -DGFXMODULE_SDL -DSDL_DIR=SDL"
|
CFLAGS="$CFLAGS -DGFXMODULE_SDL -DSDL_DIR=SDL"
|
||||||
|
CCOMMONFLAGS="$CCOMMONFLAGS -DGFXMODULE_SDL"
|
||||||
GFXMODULE=sdl
|
GFXMODULE=sdl
|
||||||
HAVE_OPENGL=0
|
HAVE_OPENGL=0
|
||||||
use_library SDL 1.2.8
|
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_PRECOND="have_library openal"
|
||||||
CHOICE_sound_OPTION_openal_ACTION=sound_openal_action
|
CHOICE_sound_OPTION_openal_ACTION=sound_openal_action
|
||||||
sound_openal_action() {
|
sound_openal_action() {
|
||||||
CFLAGS="$CFLAGS -DHAVE_OPENAL"
|
CCOMMONFLAGS="$CCOMMONFLAGS -DHAVE_OPENAL"
|
||||||
SOUNDMODULE=openal
|
SOUNDMODULE=openal
|
||||||
use_library openal
|
use_library openal
|
||||||
}
|
}
|
||||||
@@ -271,14 +279,14 @@ uqm_prepare_config()
|
|||||||
CHOICE_ovcodec_OPTION_tremor_PRECOND="have_library tremor"
|
CHOICE_ovcodec_OPTION_tremor_PRECOND="have_library tremor"
|
||||||
CHOICE_ovcodec_OPTION_tremor_ACTION=ovcodec_tremor_action
|
CHOICE_ovcodec_OPTION_tremor_ACTION=ovcodec_tremor_action
|
||||||
ovcodec_tremor_action() {
|
ovcodec_tremor_action() {
|
||||||
CFLAGS="$CFLAGS -DOVCODEC_TREMOR"
|
CCOMMONFLAGS="$CCOMMONFLAGS -DOVCODEC_TREMOR"
|
||||||
OGGVORBIS=tremor
|
OGGVORBIS=tremor
|
||||||
use_library tremor
|
use_library tremor
|
||||||
}
|
}
|
||||||
CHOICE_ovcodec_OPTION_none_TITLE="No Ogg Vorbis support"
|
CHOICE_ovcodec_OPTION_none_TITLE="No Ogg Vorbis support"
|
||||||
CHOICE_ovcodec_OPTION_none_ACTION=ovcodec_none_action
|
CHOICE_ovcodec_OPTION_none_ACTION=ovcodec_none_action
|
||||||
ovcodec_none_action() {
|
ovcodec_none_action() {
|
||||||
CFLAGS="$CFLAGS -DOVCODEC_NONE"
|
CCOMMONFLAGS="$CCOMMONFLAGS -DOVCODEC_NONE"
|
||||||
OGGVORBIS=none
|
OGGVORBIS=none
|
||||||
}
|
}
|
||||||
CHOICE_ovcodec_DEFAULT=standard
|
CHOICE_ovcodec_DEFAULT=standard
|
||||||
@@ -288,7 +296,7 @@ uqm_prepare_config()
|
|||||||
CHOICE_mikmod_OPTION_internal_TITLE="Included libmikmod"
|
CHOICE_mikmod_OPTION_internal_TITLE="Included libmikmod"
|
||||||
CHOICE_mikmod_OPTION_internal_ACTION=mikmod_internal_action
|
CHOICE_mikmod_OPTION_internal_ACTION=mikmod_internal_action
|
||||||
mikmod_internal_action() {
|
mikmod_internal_action() {
|
||||||
CFLAGS="$CFLAGS -DUSE_INTERNAL_MIKMOD"
|
CCOMMONFLAGS="$CCOMMONFLAGS -DUSE_INTERNAL_MIKMOD"
|
||||||
USE_INTERNAL_MIKMOD=1
|
USE_INTERNAL_MIKMOD=1
|
||||||
}
|
}
|
||||||
CHOICE_mikmod_OPTION_external_TITLE="System libmikmod"
|
CHOICE_mikmod_OPTION_external_TITLE="System libmikmod"
|
||||||
@@ -307,7 +315,7 @@ uqm_prepare_config()
|
|||||||
# TODO: Check whether SDL has joystick support.
|
# TODO: Check whether SDL has joystick support.
|
||||||
CHOICE_joystick_OPTION_enabled_ACTION=joystick_enabled_action
|
CHOICE_joystick_OPTION_enabled_ACTION=joystick_enabled_action
|
||||||
joystick_enabled_action() {
|
joystick_enabled_action() {
|
||||||
CFLAGS="$CFLAGS -DHAVE_JOYSTICK"
|
CCOMMONFLAGS="$CCOMMONFLAGS -DHAVE_JOYSTICK"
|
||||||
}
|
}
|
||||||
CHOICE_joystick_OPTION_disabled_TITLE="disabled"
|
CHOICE_joystick_OPTION_disabled_TITLE="disabled"
|
||||||
case "$HOST_SYSTEM" in
|
case "$HOST_SYSTEM" in
|
||||||
@@ -331,7 +339,7 @@ uqm_prepare_config()
|
|||||||
CHOICE_netplay_OPTION_full_PRECOND="have_library netlibs"
|
CHOICE_netplay_OPTION_full_PRECOND="have_library netlibs"
|
||||||
CHOICE_netplay_OPTION_full_ACTION=netplay_full_action
|
CHOICE_netplay_OPTION_full_ACTION=netplay_full_action
|
||||||
netplay_full_action() {
|
netplay_full_action() {
|
||||||
CFLAGS="$CFLAGS -DNETPLAY=NETPLAY_FULL"
|
CCOMMONFLAGS="$CCOMMONFLAGS -DNETPLAY=NETPLAY_FULL"
|
||||||
if [ -n "$MACRO_WIN32" ]; then
|
if [ -n "$MACRO_WIN32" ]; then
|
||||||
LDFLAGS="$LDFLAGS -lws2_32"
|
LDFLAGS="$LDFLAGS -lws2_32"
|
||||||
fi
|
fi
|
||||||
@@ -342,7 +350,7 @@ uqm_prepare_config()
|
|||||||
CHOICE_netplay_OPTION_ipv4_PRECOND="have_library netlibs"
|
CHOICE_netplay_OPTION_ipv4_PRECOND="have_library netlibs"
|
||||||
CHOICE_netplay_OPTION_ipv4_ACTION=netplay_ipv4_action
|
CHOICE_netplay_OPTION_ipv4_ACTION=netplay_ipv4_action
|
||||||
netplay_ipv4_action() {
|
netplay_ipv4_action() {
|
||||||
CFLAGS="$CFLAGS -DNETPLAY=NETPLAY_IPV4"
|
CCOMMONFLAGS="$CCOMMONFLAGS -DNETPLAY=NETPLAY_IPV4"
|
||||||
NETPLAY="IPV4"
|
NETPLAY="IPV4"
|
||||||
use_library netlibs
|
use_library netlibs
|
||||||
}
|
}
|
||||||
@@ -355,7 +363,7 @@ uqm_prepare_config()
|
|||||||
CHOICE_ioformat_OPTION_stdio_zip_PRECOND="have_library zlib"
|
CHOICE_ioformat_OPTION_stdio_zip_PRECOND="have_library zlib"
|
||||||
CHOICE_ioformat_OPTION_stdio_zip_ACTION="ioformat_stdio_zip_action"
|
CHOICE_ioformat_OPTION_stdio_zip_ACTION="ioformat_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_ZIP_IO=1
|
||||||
use_library zlib
|
use_library zlib
|
||||||
}
|
}
|
||||||
@@ -366,7 +374,7 @@ uqm_prepare_config()
|
|||||||
CHOICE_accel_OPTION_asm_TITLE="Platform acceleration (asm, etc.)"
|
CHOICE_accel_OPTION_asm_TITLE="Platform acceleration (asm, etc.)"
|
||||||
CHOICE_accel_OPTION_asm_ACTION="accel_asm_action"
|
CHOICE_accel_OPTION_asm_ACTION="accel_asm_action"
|
||||||
accel_asm_action() {
|
accel_asm_action() {
|
||||||
CFLAGS="$CFLAGS -DUSE_PLATFORM_ACCEL"
|
CCOMMONFLAGS="$CCOMMONFLAGS -DUSE_PLATFORM_ACCEL"
|
||||||
USE_PLATFORM_ACCEL=1
|
USE_PLATFORM_ACCEL=1
|
||||||
}
|
}
|
||||||
CHOICE_accel_OPTION_plainc_TITLE="Only plain C code"
|
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_TITLE="SDL-controlled thread library"
|
||||||
CHOICE_threadlib_OPTION_sdl_ACTION="threadlib_sdl_action"
|
CHOICE_threadlib_OPTION_sdl_ACTION="threadlib_sdl_action"
|
||||||
threadlib_sdl_action() {
|
threadlib_sdl_action() {
|
||||||
CFLAGS="$CFLAGS -DTHREADLIB_SDL"
|
CCOMMONFLAGS="$CCOMMONFLAGS -DTHREADLIB_SDL"
|
||||||
THREADLIB="SDL"
|
THREADLIB="SDL"
|
||||||
}
|
}
|
||||||
CHOICE_threadlib_OPTION_pthread_TITLE="Pthread thread library"
|
CHOICE_threadlib_OPTION_pthread_TITLE="Pthread thread library"
|
||||||
CHOICE_threadlib_OPTION_pthread_PRECOND="have_library pthread"
|
CHOICE_threadlib_OPTION_pthread_PRECOND="have_library pthread"
|
||||||
CHOICE_threadlib_OPTION_pthread_ACTION="threadlib_pthread_action"
|
CHOICE_threadlib_OPTION_pthread_ACTION="threadlib_pthread_action"
|
||||||
threadlib_pthread_action() {
|
threadlib_pthread_action() {
|
||||||
CFLAGS="$CFLAGS -DTHREADLIB_PTHREAD"
|
CCOMMONFLAGS="$CCOMMONFLAGS -DTHREADLIB_PTHREAD"
|
||||||
THREADLIB="PTHREAD"
|
THREADLIB="PTHREAD"
|
||||||
use_library pthread
|
use_library pthread
|
||||||
}
|
}
|
||||||
@@ -441,7 +449,16 @@ uqm_process_config() {
|
|||||||
# Set the content dir
|
# Set the content dir
|
||||||
CONTENTDIR="${INSTALL_SHAREDIR}uqm/content"
|
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
|
# Export the HAVE_ symbols to config_unix.h, using config_unix.h.in
|
||||||
# as template (or config_win.h/config_win.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"
|
substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES src "$BUILD_WORK"
|
||||||
|
|
||||||
# Make build.vars from build.vars.in, substituting variables.
|
# 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_C MKDEP_C COMPILE_C \
|
||||||
|
PREPROC_CXX MKDEP_CXX COMPILE_CXX \
|
||||||
PREPROC_OBJC MKDEP_OBJC COMPILE_OBJC \
|
PREPROC_OBJC MKDEP_OBJC COMPILE_OBJC \
|
||||||
MAKE ECHON SED DEBUG JOYSTICK NETPLAY \
|
MAKE ECHON SED DEBUG JOYSTICK NETPLAY \
|
||||||
OGGVORBIS SOUNDMODULE USE_INTERNAL_MIKMOD \
|
OGGVORBIS SOUNDMODULE USE_INTERNAL_MIKMOD \
|
||||||
@@ -470,7 +488,7 @@ uqm_process_config() {
|
|||||||
SUBSTITUTE_FILES="build.vars"
|
SUBSTITUTE_FILES="build.vars"
|
||||||
substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES . "$BUILD_WORK"
|
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_VARS="INSTALL_LIBDIR INSTALL_BINDIR INSTALL_SHAREDIR uqm_NAME"
|
||||||
SUBSTITUTE_FILES="uqm-wrapper"
|
SUBSTITUTE_FILES="uqm-wrapper"
|
||||||
substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES build/unix "$BUILD_WORK"
|
substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES build/unix "$BUILD_WORK"
|
||||||
@@ -601,7 +619,7 @@ uqm_install_osx() {
|
|||||||
$PREPROC_C -D__MACOSX__ -include $HEADER - | \
|
$PREPROC_C -D__MACOSX__ -include $HEADER - | \
|
||||||
awk '(/'$HEADER_FILE'/ && $2 == 1) { print $3; exit }' | \
|
awk '(/'$HEADER_FILE'/ && $2 == 1) { print $3; exit }' | \
|
||||||
$SED 's/.Headers.*$/"/'`
|
$SED 's/.Headers.*$/"/'`
|
||||||
cp -r "$FRAMEWORK" "$INSTROOT/Frameworks"
|
cp -a "$FRAMEWORK" "$INSTROOT/Frameworks"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Install game content (it should probably make a zipfile)
|
# Install game content (it should probably make a zipfile)
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ if [ -z "$TARGET" ]; then
|
|||||||
fi
|
fi
|
||||||
BUILD_PROJECT="$TARGET"
|
BUILD_PROJECT="$TARGET"
|
||||||
export TARGET BUILD_PROJECT ECHON
|
export TARGET BUILD_PROJECT ECHON
|
||||||
export PREPROC_C MKDEP_C COMPILE_C PREPROC_OBJC MKDEP_OBJC COMPILE_OBJC LINK
|
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}_LDFLAGS"
|
export "${BUILD_PROJECT}_CFLAGS" "${BUILD_PROJECT}_CXXFLAGS" "${BUILD_PROJECT}_LDFLAGS"
|
||||||
|
|
||||||
# Add trailing / from objs dir
|
# Add trailing / from objs dir
|
||||||
eval ${BUILD_PROJECT}_OBJS=\${${BUILD_PROJECT}_OBJS%/}/
|
eval ${BUILD_PROJECT}_OBJS=\${${BUILD_PROJECT}_OBJS%/}/
|
||||||
|
|||||||
@@ -106,9 +106,10 @@ build_depend() {
|
|||||||
# $1 - additional arguments to pass to make (at the moment just
|
# $1 - additional arguments to pass to make (at the moment just
|
||||||
# an optional -j arg for parallel builds).
|
# an optional -j arg for parallel builds).
|
||||||
build_compile() {
|
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 CFLAGS="\${${BUILD_PROJECT}_CFLAGS}"
|
||||||
|
eval CXXFLAGS="\${${BUILD_PROJECT}_CXXFLAGS}"
|
||||||
eval LDFLAGS="\${${BUILD_PROJECT}_LDFLAGS}"
|
eval LDFLAGS="\${${BUILD_PROJECT}_LDFLAGS}"
|
||||||
eval OBJDIR=\""\$BUILD_WORK/\${${BUILD_PROJECT}_OBJS}"\"
|
eval OBJDIR=\""\$BUILD_WORK/\${${BUILD_PROJECT}_OBJS}"\"
|
||||||
eval TARGET_FILE=\""\$BUILD_WORK/\${${BUILD_PROJECT}_NAME}"\"
|
eval TARGET_FILE=\""\$BUILD_WORK/\${${BUILD_PROJECT}_NAME}"\"
|
||||||
@@ -116,7 +117,7 @@ build_compile() {
|
|||||||
|
|
||||||
eval "${TARGET}_pre_build"
|
eval "${TARGET}_pre_build"
|
||||||
|
|
||||||
CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS \
|
CFLAGS=$CFLAGS CXXFLAGS=$CXXFLAGS LDFLAGS=$LDFLAGS \
|
||||||
OBJDIR=$OBJDIR \
|
OBJDIR=$OBJDIR \
|
||||||
BUILD_ROOT= \
|
BUILD_ROOT= \
|
||||||
TARGET_FILE=$TARGET_FILE DEPEND_FILE=$DEPEND_FILE \
|
TARGET_FILE=$TARGET_FILE DEPEND_FILE=$DEPEND_FILE \
|
||||||
@@ -133,6 +134,7 @@ build_clean() {
|
|||||||
|
|
||||||
eval DEPEND_FILE="\$BUILD_WORK/\${${BUILD_PROJECT}_OBJS}${DEPEND_NAME}"
|
eval DEPEND_FILE="\$BUILD_WORK/\${${BUILD_PROJECT}_OBJS}${DEPEND_NAME}"
|
||||||
rm -f "$DEPEND_FILE" "$BUILD_WORK/build.vars" \
|
rm -f "$DEPEND_FILE" "$BUILD_WORK/build.vars" \
|
||||||
|
"$BUILD_WORK/uqm-wrapper" \
|
||||||
"$BUILD_WORK/config.state"
|
"$BUILD_WORK/config.state"
|
||||||
eval "${TARGET}_clean"
|
eval "${TARGET}_clean"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
# CFLAGS
|
# CFLAGS
|
||||||
SYSTEM_BUILD_CFLAGS=""
|
SYSTEM_BUILD_CFLAGS=""
|
||||||
|
|
||||||
|
# CXXFLAGS
|
||||||
|
SYSTEM_BUILD_CXXFLAGS=""
|
||||||
|
|
||||||
# LDFLAGS
|
# LDFLAGS
|
||||||
SYSTEM_BUILD_LDFLAGS=""
|
SYSTEM_BUILD_LDFLAGS=""
|
||||||
|
|
||||||
@@ -33,6 +36,9 @@ SYSTEM_BUILD_LDFLAGS=""
|
|||||||
BUILDTOOL_PREPROC_C_NAME="C preprocessor"
|
BUILDTOOL_PREPROC_C_NAME="C preprocessor"
|
||||||
BUILDTOOL_MKDEP_C_NAME="C dependency generator"
|
BUILDTOOL_MKDEP_C_NAME="C dependency generator"
|
||||||
BUILDTOOL_COMPILE_C_NAME="C compiler"
|
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_PREPROC_OBJC_NAME="Objective-C preprocessor"
|
||||||
BUILDTOOL_MKDEP_OBJC_NAME="Objective-C dependency generator"
|
BUILDTOOL_MKDEP_OBJC_NAME="Objective-C dependency generator"
|
||||||
BUILDTOOL_COMPILE_OBJC_NAME="Objective-C compiler"
|
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_COMMAND="\$PROG_gcc_FILE -c $EXTRA_PLATFORM_GCC_FLAGS_COMPILE_C"
|
||||||
BUILDTOOL_COMPILE_C_DEPEND='gcc'
|
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_COMMAND="\$PROG_gcc_FILE -E $EXTRA_PLATFORM_GCC_FLAGS_PREPROC_OBJC"
|
||||||
BUILDTOOL_PREPROC_OBJC_DEPEND='gcc'
|
BUILDTOOL_PREPROC_OBJC_DEPEND='gcc'
|
||||||
|
|
||||||
@@ -303,6 +318,12 @@ PROG_gcce_ACTION=""
|
|||||||
PROG_gcce_VERSION='$(arm-none-symbianelf-gcc --version)'
|
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: #
|
# Describe the libaries (possibly) used: #
|
||||||
|
|||||||
@@ -24,17 +24,7 @@
|
|||||||
|
|
||||||
|
|
||||||
# CFLAGS
|
# 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=""
|
SYSTEM_HOST_CFLAGS=""
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# LDFLAGS
|
# LDFLAGS
|
||||||
SYSTEM_HOST_LDFLAGS=""
|
SYSTEM_HOST_LDFLAGS=""
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ define act_mkdep_c
|
|||||||
$(MKDEP_C) $(CFLAGS) -o "$(@D)/$(<F).o" "$<" --depend "$@"
|
$(MKDEP_C) $(CFLAGS) -o "$(@D)/$(<F).o" "$<" --depend "$@"
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define act_mkdep_cxx
|
||||||
|
$(MKDEP_CXX) $(CXXFLAGS) -o "$(@D)/$(<F).o" "$<" --depend "$@"
|
||||||
|
endef
|
||||||
|
|
||||||
define act_link
|
define act_link
|
||||||
$(LINK) --create "$@" $^ $(LDFLAGS)
|
$(LINK) --create "$@" $^ $(LDFLAGS)
|
||||||
endef
|
endef
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ define act_mkdep_c
|
|||||||
$(MKDEP_C) $(CFLAGS) "$<" -MT "$(@D)/$(<F).o" -MF "$@"
|
$(MKDEP_C) $(CFLAGS) "$<" -MT "$(@D)/$(<F).o" -MF "$@"
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define act_mkdep_cxx
|
||||||
|
$(MKDEP_CXX) $(CXXFLAGS) "$<" -MT "$(@D)/$(<F).o" -MF "$@"
|
||||||
|
endef
|
||||||
|
|
||||||
define act_mkdep_m
|
define act_mkdep_m
|
||||||
$(MKDEP_OBJC) $(CFLAGS) "$<" -MT "$(@D)/$(<F).o" -MF "$@"
|
$(MKDEP_OBJC) $(CFLAGS) "$<" -MT "$(@D)/$(<F).o" -MF "$@"
|
||||||
endef
|
endef
|
||||||
@@ -18,6 +22,10 @@ define act_cc
|
|||||||
$(COMPILE_C) -o "$@" $(CFLAGS) "$<"
|
$(COMPILE_C) -o "$@" $(CFLAGS) "$<"
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define act_cxx
|
||||||
|
$(COMPILE_CXX) -o "$@" $(CXXFLAGS) "$<"
|
||||||
|
endef
|
||||||
|
|
||||||
define act_objcc
|
define act_objcc
|
||||||
$(COMPILE_OBJC) -o "$@" $(CFLAGS) "$<"
|
$(COMPILE_OBJC) -o "$@" $(CFLAGS) "$<"
|
||||||
endef
|
endef
|
||||||
|
|||||||
@@ -10,3 +10,10 @@ define act_mkdep_c
|
|||||||
@rm -f "$@.tmp"
|
@rm -f "$@.tmp"
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define act_mkdep_cxx
|
||||||
|
$(MKDEP_C) $(CXXFLAGS) "$<" -o "$@.tmp"
|
||||||
|
@echo -n "$(@D)/" > $@
|
||||||
|
@cat "$@.tmp" >> $@
|
||||||
|
@rm -f "$@.tmp"
|
||||||
|
endef
|
||||||
|
|
||||||
|
|||||||
@@ -18,3 +18,6 @@
|
|||||||
!define PKG_REMIX3_FILE "uqm-remix-disc3.uqm"
|
!define PKG_REMIX3_FILE "uqm-remix-disc3.uqm"
|
||||||
!define PKG_REMIX3_MD5SUM "5ccc6d4ac301ae98e172ac6835dcdead"
|
!define PKG_REMIX3_MD5SUM "5ccc6d4ac301ae98e172ac6835dcdead"
|
||||||
!define PKG_REMIX3_SIZE 38989
|
!define PKG_REMIX3_SIZE 38989
|
||||||
|
!define PKG_REMIX4_FILE "uqm-remix-disc4.uqm"
|
||||||
|
!define PKG_REMIX4_MD5SUM "d3dc6036588662391a3820ca6b222dd6"
|
||||||
|
!define PKG_REMIX4_SIZE 84517
|
||||||
@@ -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
|
||||||
@@ -14,6 +14,10 @@ Var UQMUSERDATA
|
|||||||
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
||||||
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
|
!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
|
; UQM Package definitions
|
||||||
!include "packages.nsh"
|
!include "packages.nsh"
|
||||||
|
|
||||||
@@ -80,7 +84,7 @@ var ICONS_GROUP
|
|||||||
; MUI end ------
|
; MUI end ------
|
||||||
|
|
||||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
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\"
|
InstallDir "$PROGRAMFILES\The Ur-Quan Masters\"
|
||||||
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
|
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
|
||||||
ShowInstDetails show
|
ShowInstDetails show
|
||||||
@@ -125,114 +129,74 @@ FunctionEnd
|
|||||||
|
|
||||||
Function RandomServer
|
Function RandomServer
|
||||||
Push $0
|
Push $0
|
||||||
Push 27
|
Push 17
|
||||||
Call Random
|
Call Random
|
||||||
Pop $0
|
Pop $0
|
||||||
IntCmp $0 0 0 +4 +4
|
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"
|
StrCpy $0 "aarnet"
|
||||||
Exch $0
|
Exch $0
|
||||||
Return
|
Return
|
||||||
IntCmp $0 3 0 +4 +4
|
IntCmp $0 1 0 +4 +4
|
||||||
StrCpy $0 "switch"
|
StrCpy $0 "citylan"
|
||||||
Exch $0
|
Exch $0
|
||||||
Return
|
Return
|
||||||
IntCmp $0 4 0 +4 +4
|
IntCmp $0 2 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
|
|
||||||
StrCpy $0 "freefr"
|
StrCpy $0 "freefr"
|
||||||
Exch $0
|
Exch $0
|
||||||
Return
|
Return
|
||||||
IntCmp $0 17 0 +4 +4
|
IntCmp $0 3 0 +4 +4
|
||||||
StrCpy $0 "garr"
|
StrCpy $0 "garr"
|
||||||
Exch $0
|
Exch $0
|
||||||
Return
|
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"
|
StrCpy $0 "ignum"
|
||||||
Exch $0
|
Exch $0
|
||||||
Return
|
Return
|
||||||
IntCmp $0 19 0 +4 +4
|
IntCmp $0 7 0 +4 +4
|
||||||
StrCpy $0 "internode"
|
StrCpy $0 "internode"
|
||||||
Exch $0
|
Exch $0
|
||||||
Return
|
Return
|
||||||
IntCmp $0 20 0 +4 +4
|
IntCmp $0 8 0 +4 +4
|
||||||
StrCpy $0 "iweb"
|
StrCpy $0 "iweb"
|
||||||
Exch $0
|
Exch $0
|
||||||
Return
|
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"
|
StrCpy $0 "netcologne"
|
||||||
Exch $0
|
Exch $0
|
||||||
Return
|
Return
|
||||||
IntCmp $0 22 0 +4 +4
|
IntCmp $0 12 0 +4 +4
|
||||||
StrCpy $0 "leaseweb"
|
StrCpy $0 "switch"
|
||||||
Exch $0
|
Exch $0
|
||||||
Return
|
Return
|
||||||
IntCmp $0 23 0 +4 +4
|
IntCmp $0 13 0 +4 +4
|
||||||
StrCpy $0 "ncu"
|
|
||||||
Exch $0
|
|
||||||
Return
|
|
||||||
IntCmp $0 24 0 +4 +4
|
|
||||||
StrCpy $0 "tenet"
|
StrCpy $0 "tenet"
|
||||||
Exch $0
|
Exch $0
|
||||||
Return
|
Return
|
||||||
IntCmp $0 25 0 +4 +4
|
IntCmp $0 14 0 +4 +4
|
||||||
StrCpy $0 "transact"
|
StrCpy $0 "ufpr"
|
||||||
Exch $0
|
Exch $0
|
||||||
Return
|
Return
|
||||||
StrCpy $0 "citylan"
|
IntCmp $0 15 0 +4 +4
|
||||||
|
StrCpy $0 "voxel"
|
||||||
|
Exch $0
|
||||||
|
Return
|
||||||
|
StrCpy $0 "waix"
|
||||||
Exch $0
|
Exch $0
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
@@ -251,6 +215,7 @@ Function HandlePackage
|
|||||||
Exch $1 # File name
|
Exch $1 # File name
|
||||||
Push $2
|
Push $2
|
||||||
Push $3
|
Push $3
|
||||||
|
StrCpy $R9 0 # failure count
|
||||||
# Check to make sure the file wasn't already installed
|
# Check to make sure the file wasn't already installed
|
||||||
IfFileExists "$0\$1" 0 NotThere
|
IfFileExists "$0\$1" 0 NotThere
|
||||||
md5dll::GetFileMD5 "$0\$1"
|
md5dll::GetFileMD5 "$0\$1"
|
||||||
@@ -289,6 +254,12 @@ AttemptDownload:
|
|||||||
StrCmp $2 "success" DownloadSuccessful
|
StrCmp $2 "success" DownloadSuccessful
|
||||||
StrCmp $2 "cancel" DownloadCanceled
|
StrCmp $2 "cancel" DownloadCanceled
|
||||||
StrCpy $2 "Could not install the package $1 due to the following error: $\"$2$\"."
|
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
|
Goto CheckMandatory
|
||||||
DownloadCanceled:
|
DownloadCanceled:
|
||||||
StrCpy $2 "Download was canceled by user."
|
StrCpy $2 "Download was canceled by user."
|
||||||
@@ -411,7 +382,7 @@ SectionGroup "!UQM" SECGRP01
|
|||||||
AddSize ${PKG_CONTENT_SIZE}
|
AddSize ${PKG_CONTENT_SIZE}
|
||||||
StrCpy $MANDATORY 1
|
StrCpy $MANDATORY 1
|
||||||
StrCpy $MD5SUM "${PKG_CONTENT_MD5SUM}"
|
StrCpy $MD5SUM "${PKG_CONTENT_MD5SUM}"
|
||||||
File "content\version"
|
File "..\..\content\version"
|
||||||
StrCpy $DOWNLOADPATH "UQM/0.7/"
|
StrCpy $DOWNLOADPATH "UQM/0.7/"
|
||||||
Push "${PKG_CONTENT_FILE}"
|
Push "${PKG_CONTENT_FILE}"
|
||||||
Push "$INSTDIR\content\packages"
|
Push "$INSTDIR\content\packages"
|
||||||
@@ -504,20 +475,20 @@ SectionGroup "Modern Remixes" SECGRP03
|
|||||||
!insertmacro MUI_STARTMENU_WRITE_END
|
!insertmacro MUI_STARTMENU_WRITE_END
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
# Section "Pack 4" SEC08
|
Section "Pack 4" SEC08
|
||||||
# SectionIn 6
|
SectionIn 6
|
||||||
# AddSize ${PKG_REMIX4_SIZE}
|
AddSize ${PKG_REMIX4_SIZE}
|
||||||
# StrCpy $MANDATORY 0
|
StrCpy $MANDATORY 0
|
||||||
# StrCpy $MD5SUM "${PKG_REMIX4_MD5SUM}"
|
StrCpy $MD5SUM "${PKG_REMIX4_MD5SUM}"
|
||||||
# StrCpy $DOWNLOADPATH "UQM%20Remix%20Packs/UQM%20Remix%20Pack%204/"
|
StrCpy $DOWNLOADPATH "UQM%20Remix%20Packs/UQM%20Remix%20Pack%204/"
|
||||||
# Push "${PKG_REMIX4_FILE}"
|
Push "${PKG_REMIX4_FILE}"
|
||||||
# Push "$INSTDIR\content\addons"
|
Push "$INSTDIR\content\addons"
|
||||||
# Call HandlePackage
|
Call HandlePackage
|
||||||
# Call EnableRemixes
|
Call EnableRemixes
|
||||||
# ; Shortcuts
|
; Shortcuts
|
||||||
# !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
||||||
# !insertmacro MUI_STARTMENU_WRITE_END
|
!insertmacro MUI_STARTMENU_WRITE_END
|
||||||
# SectionEnd
|
SectionEnd
|
||||||
SectionGroupEnd
|
SectionGroupEnd
|
||||||
|
|
||||||
Section -ShortcutsAndIcons
|
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 ${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 ${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 ${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
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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.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.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.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.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.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
|
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.
|
The members of the old Alliance.
|
||||||
|
|
||||||
#(what_about_hierarchy)
|
#(what_about_hierarchy)
|
||||||
The battle thralls in the Hierarchy.
|
The Hierarchy and their battle thralls.
|
||||||
|
|
||||||
#(what_about_other)
|
#(what_about_other)
|
||||||
Were there any alien races who weren't in the War?
|
Were there any alien races who weren't in the War?
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ Shall we begin trading now?
|
|||||||
#(WERE_NOT_AFRAID) melnorme-010.ogg
|
#(WERE_NOT_AFRAID) melnorme-010.ogg
|
||||||
We reel with inchoate fear, and are thrown into a sudden panic.
|
We reel with inchoate fear, and are thrown into a sudden panic.
|
||||||
Being peaceful by nature
|
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.
|
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.
|
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
|
#(HELLO_AND_DOWN_TO_BUSINESS_2) melnorme-013.ogg
|
||||||
How nice to see you again, Captain.
|
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
|
#(HELLO_AND_DOWN_TO_BUSINESS_3) melnorme-014.ogg
|
||||||
I had itchy pods this morning, Captain, and here you are!
|
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
|
#(RESCUE_OFFER) melnorme-045.ogg
|
||||||
You have no Credit balance in our mercantile computer
|
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.
|
but, perhaps we can work out a special deal.
|
||||||
In exchange for our giving you enough fuel to
|
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
|
#(OK_BUY_ALIEN_RACE_11) melnorme-109.ogg
|
||||||
The Arilou Lalee'lay are a mysterious race of IDF beings
|
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.
|
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
|
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.
|
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.
|
When the Dnyarri took control over the Milieu, one race fought back -- the Taalo.
|
||||||
These slow, quiet creatures were silicon-based life forms
|
These slow, quiet creatures were silicon-based life forms
|
||||||
but bore little resemblance to the modern Chenjesu.
|
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
|
The Taalo were natural immunes to the Dnyarri psychic compulsion; they were unaffected by the creatures' power
|
||||||
and the Dynarri would not permit anyone to exist outside their control
|
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.
|
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.
|
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.
|
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.
|
deteriorated and degenerated into a great galactic gulag.
|
||||||
Alien races which did not serve with the efficiency and speed demanded by the Dnyarri
|
Alien races which did not serve with the efficiency and speed demanded by the Dnyarri
|
||||||
were ruthlessly burned from the faces of their worlds.
|
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
|
After almost twenty-five hundred years of unrelenting Dnyarri control
|
||||||
there were only four living member races of the once-great Sentient Milieu.
|
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:
|
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.
|
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.
|
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
|
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
|
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.
|
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.
|
Kzer-Za chose its moment carefully -- it waited until it was near an open transmission unit.
|
||||||
|
|||||||
@@ -551,8 +551,7 @@ a material quaintness, if you will.
|
|||||||
We will be somewhat disappointed to have to leave it.
|
We will be somewhat disappointed to have to leave it.
|
||||||
|
|
||||||
#(how_goes_war)
|
#(how_goes_war)
|
||||||
I seem to be having a little trouble defeating the Ur-Quan Hierarchy.
|
I seem to be having a little trouble defeating the Ur-Quan Hierarchy. Do you have any helpful advice for me?
|
||||||
Do you have any helpful advice for me?
|
|
||||||
|
|
||||||
#(WAR_GOES_1) pkunk-071.ogg
|
#(WAR_GOES_1) pkunk-071.ogg
|
||||||
Well, not advice exactly, but I can offer you plenty of moral support.
|
Well, not advice exactly, but I can offer you plenty of moral support.
|
||||||
|
|||||||
@@ -215,11 +215,11 @@ No, wait, Shofixti! I have an important duty for you to perform.
|
|||||||
What might that be?
|
What might that be?
|
||||||
|
|
||||||
#(need_you_for_duty)
|
#(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
|
#(OK_WILL_BE_SENTRY) shofixti-033.ogg
|
||||||
To fight again? Against the Ur-Quan?
|
To fight again? Against the UR-QUAN!?
|
||||||
Yes. But no
|
YES!!... But no.
|
||||||
I cannot leave my homeworld unguarded. I will remain here and keep a solitary vigil.
|
I cannot leave my homeworld unguarded. I will remain here and keep a solitary vigil.
|
||||||
Goodbye.
|
Goodbye.
|
||||||
|
|
||||||
|
|||||||
@@ -1324,7 +1324,7 @@ No more history, thank you.
|
|||||||
The members of the old Alliance.
|
The members of the old Alliance.
|
||||||
|
|
||||||
#(what_about_hierarchy)
|
#(what_about_hierarchy)
|
||||||
The battle thralls in the Hierarchy.
|
The Hierarchy and their battle thralls.
|
||||||
|
|
||||||
#(what_about_other)
|
#(what_about_other)
|
||||||
Were there any alien races who weren't in the War?
|
Were there any alien races who weren't in the War?
|
||||||
|
|||||||
@@ -61,13 +61,18 @@ MUSIC REMIXERS
|
|||||||
#(Music remixers)
|
#(Music remixers)
|
||||||
13 C
|
13 C
|
||||||
Jouni Airaksinen
|
Jouni Airaksinen
|
||||||
|
András Barják
|
||||||
|
Matt Bentley
|
||||||
Tore Aune Fjellstad
|
Tore Aune Fjellstad
|
||||||
Espen Gätzschmann
|
Espen Gätzschmann
|
||||||
Aaron J. Grier
|
Aaron J. Grier
|
||||||
|
A. Keren
|
||||||
|
Casey Monroe
|
||||||
Dan Nicholson
|
Dan Nicholson
|
||||||
George Nowik
|
George Nowik
|
||||||
Riku Nuottajärvi
|
Riku Nuottajärvi
|
||||||
Erol Otus
|
Erol Otus
|
||||||
|
Greg Szymanski
|
||||||
|
|
||||||
#(Other contrib caption)
|
#(Other contrib caption)
|
||||||
13 C
|
13 C
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#(Vega)
|
#(Vega) -- STAR_STRING_BASE
|
||||||
Vega
|
Vega
|
||||||
|
|
||||||
|
|
||||||
@@ -530,7 +530,7 @@ Lentilis
|
|||||||
UNKNOWN
|
UNKNOWN
|
||||||
|
|
||||||
|
|
||||||
#(devices)
|
#(devices) -- DEVICE_STRING_BASE
|
||||||
devices
|
devices
|
||||||
|
|
||||||
|
|
||||||
@@ -646,7 +646,7 @@ Glowing Rod
|
|||||||
Moon Base
|
Moon Base
|
||||||
|
|
||||||
|
|
||||||
#(cargo)
|
#(cargo) -- CARGO_STRING_BASE
|
||||||
cargo
|
cargo
|
||||||
|
|
||||||
|
|
||||||
@@ -686,7 +686,7 @@ Radioactive
|
|||||||
Exotic
|
Exotic
|
||||||
|
|
||||||
|
|
||||||
#(Hydrogen)
|
#(Hydrogen) -- ELEMENTS_STRING_BASE
|
||||||
Hydrogen
|
Hydrogen
|
||||||
|
|
||||||
|
|
||||||
@@ -1218,7 +1218,7 @@ Calcium Compounds
|
|||||||
Nitric Acid
|
Nitric Acid
|
||||||
|
|
||||||
|
|
||||||
#(MINERAL SCAN)
|
#(MINERAL SCAN) -- SCAN_STRING_BASE
|
||||||
MINERAL SCAN
|
MINERAL SCAN
|
||||||
|
|
||||||
|
|
||||||
@@ -1442,7 +1442,7 @@ World
|
|||||||
Gas Giant
|
Gas Giant
|
||||||
|
|
||||||
|
|
||||||
#(Alpha)
|
#(Alpha) -- STAR_NUMBER_BASE
|
||||||
Alpha
|
Alpha
|
||||||
|
|
||||||
|
|
||||||
@@ -1498,7 +1498,7 @@ Nu
|
|||||||
Xi
|
Xi
|
||||||
|
|
||||||
|
|
||||||
#(Mercury)
|
#(Mercury) -- PLANET_NUMBER_BASE
|
||||||
Mercury
|
Mercury
|
||||||
|
|
||||||
|
|
||||||
@@ -1625,10 +1625,12 @@ Planet XV
|
|||||||
#(Planet XVI)
|
#(Planet XVI)
|
||||||
Planet XVI
|
Planet XVI
|
||||||
|
|
||||||
|
|
||||||
#(Sa-Matra)
|
#(Sa-Matra)
|
||||||
Sa-Matra
|
Sa-Matra
|
||||||
|
|
||||||
#(JAN)
|
|
||||||
|
#(JAN) -- MONTHS_STRING_BASE
|
||||||
JAN
|
JAN
|
||||||
|
|
||||||
|
|
||||||
@@ -1676,7 +1678,7 @@ NOV
|
|||||||
DEC
|
DEC
|
||||||
|
|
||||||
|
|
||||||
#((In response to your statement))
|
#((In response to your statement)) -- FEEDBACK_STRING_BASE
|
||||||
(In response to your statement)
|
(In response to your statement)
|
||||||
|
|
||||||
|
|
||||||
@@ -1684,7 +1686,7 @@ DEC
|
|||||||
MORE
|
MORE
|
||||||
|
|
||||||
|
|
||||||
#(Starbase)
|
#(Starbase) -- STARBASE_STRING_BASE
|
||||||
Starbase
|
Starbase
|
||||||
|
|
||||||
|
|
||||||
@@ -1704,7 +1706,7 @@ Shipyard
|
|||||||
Depart StarBase
|
Depart StarBase
|
||||||
|
|
||||||
|
|
||||||
#(ENCOUNTER IN)
|
#(ENCOUNTER IN) -- ENCOUNTER_STRING_BASE
|
||||||
ENCOUNTER IN
|
ENCOUNTER IN
|
||||||
|
|
||||||
|
|
||||||
@@ -1736,7 +1738,7 @@ Debris
|
|||||||
Scavenged
|
Scavenged
|
||||||
|
|
||||||
|
|
||||||
#(HyperSpace)
|
#(HyperSpace) -- NAVIGATION_STRING_BASE
|
||||||
HyperSpace
|
HyperSpace
|
||||||
|
|
||||||
|
|
||||||
@@ -1760,7 +1762,7 @@ Fuel:
|
|||||||
Fuel Use:
|
Fuel Use:
|
||||||
|
|
||||||
|
|
||||||
#(Enter name)
|
#(Enter name) -- NAMING_STRING_BASE
|
||||||
Enter name
|
Enter name
|
||||||
|
|
||||||
|
|
||||||
@@ -1776,7 +1778,7 @@ Vindicator
|
|||||||
Zelnick
|
Zelnick
|
||||||
|
|
||||||
|
|
||||||
#(Empty)
|
#(Empty) -- MELEE_STRING_BASE
|
||||||
Empty
|
Empty
|
||||||
|
|
||||||
|
|
||||||
@@ -1812,7 +1814,7 @@ Behemoth Zenith
|
|||||||
The Peeled Eyes
|
The Peeled Eyes
|
||||||
|
|
||||||
|
|
||||||
#(Saving . . .)
|
#(Saving . . .) -- SAVEGAME_STRING_BASE
|
||||||
Saving . . .
|
Saving . . .
|
||||||
|
|
||||||
|
|
||||||
@@ -1832,7 +1834,7 @@ Empty Slot
|
|||||||
Saved Game - Date:
|
Saved Game - Date:
|
||||||
|
|
||||||
|
|
||||||
#(Sound)
|
#(Sound) -- OPTION_STRING_BASE
|
||||||
Sound
|
Sound
|
||||||
|
|
||||||
|
|
||||||
@@ -1852,7 +1854,7 @@ OFF
|
|||||||
ON
|
ON
|
||||||
|
|
||||||
|
|
||||||
#(Really Quit)
|
#(Really Quit) -- QUITMENU_STRING_BASE
|
||||||
Really Quit?
|
Really Quit?
|
||||||
|
|
||||||
|
|
||||||
@@ -1864,7 +1866,7 @@ Yes
|
|||||||
No
|
No
|
||||||
|
|
||||||
|
|
||||||
#(Cr)
|
#(Cr) -- STATUS_STRING_BASE
|
||||||
Cr
|
Cr
|
||||||
|
|
||||||
|
|
||||||
@@ -1888,7 +1890,7 @@ CREW
|
|||||||
CAPTAIN
|
CAPTAIN
|
||||||
|
|
||||||
|
|
||||||
#(nose:)
|
#(nose:) -- FLAGSHIP_STRING_BASE
|
||||||
nose:
|
nose:
|
||||||
|
|
||||||
|
|
||||||
@@ -1940,7 +1942,7 @@ n/a
|
|||||||
none
|
none
|
||||||
|
|
||||||
|
|
||||||
#(Orbit: )
|
#(Orbit: ) -- ORBITSCAN_STRING_BASE
|
||||||
Orbit:
|
Orbit:
|
||||||
|
|
||||||
|
|
||||||
@@ -2016,7 +2018,7 @@ Day:
|
|||||||
Tilt:
|
Tilt:
|
||||||
|
|
||||||
|
|
||||||
#(scan)
|
#(scan) -- MAINMENU_STRING_BASE
|
||||||
scan
|
scan
|
||||||
|
|
||||||
|
|
||||||
@@ -2237,7 +2239,7 @@ Use the keyboard or joystick instead.
|
|||||||
|
|
||||||
Please press ENTER or SPACE to return.
|
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.
|
Unconnected. Press LEFT to connect.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,10 +30,12 @@ Positional Audio
|
|||||||
Sound Driver
|
Sound Driver
|
||||||
Sound Quality
|
Sound Quality
|
||||||
Slave Shields
|
Slave Shields
|
||||||
Player One
|
Bottom Player
|
||||||
Player Two
|
Top Player
|
||||||
Control Set
|
Control Set
|
||||||
UQM Remixes
|
UQM Remixes
|
||||||
|
Speech
|
||||||
|
Aspect Ratio
|
||||||
|
|
||||||
#(CAT_0_OPTS)
|
#(CAT_0_OPTS)
|
||||||
320x240
|
320x240
|
||||||
@@ -314,28 +316,28 @@ Placeholder
|
|||||||
Placeholder
|
Placeholder
|
||||||
|
|
||||||
#(CAT_18_OPT_0_DESC)
|
#(CAT_18_OPT_0_DESC)
|
||||||
Player 1 controls the bottom player in
|
Controls the bottom player in Super
|
||||||
Super Melee, and the entire Full Game.
|
Melee, and the entire Full Game.
|
||||||
|
|
||||||
#(CAT_18_OPT_1_DESC)
|
#(CAT_18_OPT_1_DESC)
|
||||||
Player 1 controls the bottom player in
|
Controls the bottom player in Super
|
||||||
Super Melee, and the entire Full Game.
|
Melee, and the entire Full Game.
|
||||||
|
|
||||||
#(CAT_18_OPT_2_DESC)
|
#(CAT_18_OPT_2_DESC)
|
||||||
Player 1 controls the bottom player in
|
Controls the bottom player in Super
|
||||||
Super Melee, and the entire Full Game.
|
Melee, and the entire Full Game.
|
||||||
|
|
||||||
#(CAT_18_OPT_3_DESC)
|
#(CAT_18_OPT_3_DESC)
|
||||||
Player 1 controls the bottom player in
|
Controls the bottom player in Super
|
||||||
Super Melee, and the entire Full Game.
|
Melee, and the entire Full Game.
|
||||||
|
|
||||||
#(CAT_18_OPT_4_DESC)
|
#(CAT_18_OPT_4_DESC)
|
||||||
Player 1 controls the bottom player in
|
Controls the bottom player in Super
|
||||||
Super Melee, and the entire Full Game.
|
Melee, and the entire Full Game.
|
||||||
|
|
||||||
#(CAT_18_OPT_5_DESC)
|
#(CAT_18_OPT_5_DESC)
|
||||||
Player 1 controls the bottom player in
|
Controls the bottom player in Super
|
||||||
Super Melee, and the entire Full Game.
|
Melee, and the entire Full Game.
|
||||||
|
|
||||||
#(CAT_19_OPTS)
|
#(CAT_19_OPTS)
|
||||||
Placeholder
|
Placeholder
|
||||||
@@ -346,27 +348,27 @@ Placeholder
|
|||||||
Placeholder
|
Placeholder
|
||||||
|
|
||||||
#(CAT_19_OPT_0_DESC)
|
#(CAT_19_OPT_0_DESC)
|
||||||
Player 2 controls the top player
|
Controls the top player
|
||||||
in Super Melee.
|
in Super Melee.
|
||||||
|
|
||||||
#(CAT_19_OPT_1_DESC)
|
#(CAT_19_OPT_1_DESC)
|
||||||
Player 2 controls the top player
|
Controls the top player
|
||||||
in Super Melee.
|
in Super Melee.
|
||||||
|
|
||||||
#(CAT_19_OPT_2_DESC)
|
#(CAT_19_OPT_2_DESC)
|
||||||
Player 2 controls the top player
|
Controls the top player
|
||||||
in Super Melee.
|
in Super Melee.
|
||||||
|
|
||||||
#(CAT_19_OPT_3_DESC)
|
#(CAT_19_OPT_3_DESC)
|
||||||
Player 2 controls the top player
|
Controls the top player
|
||||||
in Super Melee.
|
in Super Melee.
|
||||||
|
|
||||||
#(CAT_19_OPT_4_DESC)
|
#(CAT_19_OPT_4_DESC)
|
||||||
Player 2 controls the top player
|
Controls the top player
|
||||||
in Super Melee.
|
in Super Melee.
|
||||||
|
|
||||||
#(CAT_19_OPT_5_DESC)
|
#(CAT_19_OPT_5_DESC)
|
||||||
Player 2 controls the top player
|
Controls the top player
|
||||||
in Super Melee.
|
in Super Melee.
|
||||||
|
|
||||||
#(CAT_20_OPTS)
|
#(CAT_20_OPTS)
|
||||||
@@ -420,10 +422,39 @@ Overrides PC or 3do soundtrack with the
|
|||||||
modern soundtrack written by The Precursors.
|
modern soundtrack written by The Precursors.
|
||||||
Requires a restart of UQM to take effect.
|
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)
|
#(SLIDERS)
|
||||||
Music Volume
|
Music Volume
|
||||||
SFX Volume
|
SFX Volume
|
||||||
Speech Volume
|
Speech Volume
|
||||||
|
Gamma Correction
|
||||||
|
|
||||||
#(SLIDER_0_DESC)
|
#(SLIDER_0_DESC)
|
||||||
Sets the music volume.
|
Sets the music volume.
|
||||||
@@ -434,6 +465,10 @@ Sets the sound effects volume.
|
|||||||
#(SLIDER_2_DESC)
|
#(SLIDER_2_DESC)
|
||||||
Sets the speech volume.
|
Sets the speech volume.
|
||||||
|
|
||||||
|
#(SLIDER_3_DESC)
|
||||||
|
Sets the gamma correction.
|
||||||
|
May not work on all hardware.
|
||||||
|
|
||||||
#(BUTTONS)
|
#(BUTTONS)
|
||||||
Quit Setup Menu
|
Quit Setup Menu
|
||||||
Return to Main Menu
|
Return to Main Menu
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ delete.2 = STRING:key Keypad-.
|
|||||||
backspace.1 = STRING:key Backspace
|
backspace.1 = STRING:key Backspace
|
||||||
editcancel.1 = STRING:key Escape
|
editcancel.1 = STRING:key Escape
|
||||||
search.1 = STRING:key /
|
search.1 = STRING:key /
|
||||||
|
search.2 = STRING:key F6
|
||||||
next.1 = STRING:key Tab
|
next.1 = STRING:key Tab
|
||||||
pause.1 = STRING:key Pause
|
pause.1 = STRING:key Pause
|
||||||
pause.2 = STRING:key F1
|
pause.2 = STRING:key F1
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ Announcing the release:
|
|||||||
- send a mail to sc2-announce
|
- send a mail to sc2-announce
|
||||||
- set the forum 'news'
|
- set the forum 'news'
|
||||||
- set the #sc2 irc channel topic
|
- set the #sc2 irc channel topic
|
||||||
|
- update the version number in http://uqm.stack.nl/wiki/Template:Uqmversion
|
||||||
|
|
||||||
|
|
||||||
Moving on to the next version:
|
Moving on to the next version:
|
||||||
|
|||||||
@@ -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
|
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
|
are named (those in the Sol system), are handled as a special case of
|
||||||
the routines that prints these names (PrintCoarseScan3DO and
|
the routines that prints these names (PrintCoarseScan3DO and
|
||||||
PrintCoraseScanPC).
|
PrintCoarseScanPC).
|
||||||
|
|
||||||
INIT_NPCS
|
INIT_NPCS
|
||||||
REINIT_NPCS
|
REINIT_NPCS
|
||||||
|
|||||||
@@ -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>
|
|
||||||
@@ -14,6 +14,9 @@ Medium-priority:
|
|||||||
- Closing and destroying of NetConnections is a terrible mess.
|
- Closing and destroying of NetConnections is a terrible mess.
|
||||||
- Checks allConnected() shouldn't be needed if CHECK_ABORT is set
|
- Checks allConnected() shouldn't be needed if CHECK_ABORT is set
|
||||||
on disconnect.
|
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:
|
Low-priority:
|
||||||
@@ -75,6 +78,7 @@ Future improvements/optimisations:
|
|||||||
- Per state data (in NetConnection.stateData) is unnecessarilly complicated.
|
- Per state data (in NetConnection.stateData) is unnecessarilly complicated.
|
||||||
Putting all fields directly in NetConnection simplifies things a lot.
|
Putting all fields directly in NetConnection simplifies things a lot.
|
||||||
It's not as generic, but this code won't be used elsewhere anyhow.
|
It's not as generic, but this code won't be used elsewhere anyhow.
|
||||||
|
- Send captain names to the other side
|
||||||
|
|
||||||
|
|
||||||
Bugs:
|
Bugs:
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ GlobData.Game_state.avail_race_q:
|
|||||||
except for, technically, SAMATRA_SHIP. URQUAN_PROBE_SHIP is a
|
except for, technically, SAMATRA_SHIP. URQUAN_PROBE_SHIP is a
|
||||||
very incomplete 'race'.
|
very incomplete 'race'.
|
||||||
Elements are of type FLEET_INFO.
|
Elements are of type FLEET_INFO.
|
||||||
Filled in InitSIS().
|
Filled in InitGameStructures().
|
||||||
Partially included in savegames.
|
Partially included in savegames.
|
||||||
|
|
||||||
GlobData.Game_state.built_ship_q:
|
GlobData.Game_state.built_ship_q:
|
||||||
@@ -19,7 +19,7 @@ GlobData.Game_state.built_ship_q:
|
|||||||
master_q:
|
master_q:
|
||||||
List of templates for all the ships that are available in SuperMelee.
|
List of templates for all the ships that are available in SuperMelee.
|
||||||
Elements are of type MASTER_SHIP_INFO.
|
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().
|
Filled in LoadMasterShipList().
|
||||||
|
|
||||||
GlobData.Game_state.npc_built_ship_q:
|
GlobData.Game_state.npc_built_ship_q:
|
||||||
|
|||||||
@@ -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:
|
Entry #0:
|
||||||
|
|||||||
@@ -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.
|
||||||
@@ -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
|
sleep if the mutex is already locked, and awaken once the mutex
|
||||||
becomes available. A Mutex must be unlocked by the same thread that
|
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
|
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
|
(without unlocking it first).
|
||||||
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.
|
|
||||||
|
|
||||||
API:
|
API:
|
||||||
Mutex CreateMutex (const char *name, DWORD syncClass);
|
Mutex CreateMutex (const char *name, DWORD syncClass);
|
||||||
|
|||||||
@@ -39,4 +39,4 @@ Version 0.6.6: Revision 3143
|
|||||||
Version 0.6.7: Revision 3276
|
Version 0.6.7: Revision 3276
|
||||||
Version 0.6.8: Revision 3334
|
Version 0.6.8: Revision 3334
|
||||||
Version 0.6.9: Revision 3537
|
Version 0.6.9: Revision 3537
|
||||||
Version 0.7.0-rc2: Revision 3622
|
Version 0.7.0: Revision 3631
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
THE UR-QUAN MASTERS v0.7 -- homepage: http://sc2.sf.net/
|
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
|
document will tell you everything you need to play, even if you've
|
||||||
never played the original.
|
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
|
in the game. '--addon' may be specified more than once to enable multiple
|
||||||
add-ons.
|
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.
|
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.
|
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
|
If you install UQM 0.7 from the Windows installer, the remix packs
|
||||||
|
|||||||
+5
-2
@@ -1,4 +1,6 @@
|
|||||||
uqm_SUBDIRS="libs res uqm"
|
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
|
if [ "$uqm_HAVE_GETOPT_LONG" = 0 ]; then
|
||||||
uqm_SUBDIRS="$uqm_SUBDIRS getopt"
|
uqm_SUBDIRS="$uqm_SUBDIRS getopt"
|
||||||
@@ -8,11 +10,12 @@ case "$HOST_SYSTEM" in
|
|||||||
Darwin)
|
Darwin)
|
||||||
uqm_SUBDIRS="$uqm_SUBDIRS darwin"
|
uqm_SUBDIRS="$uqm_SUBDIRS darwin"
|
||||||
;;
|
;;
|
||||||
|
MSVC)
|
||||||
|
uqm_HFILES="$uqm_HFILES config_vc6.h"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "$uqm_HAVE_REGEX" = 0 ]; then
|
if [ "$uqm_HAVE_REGEX" = 0 ]; then
|
||||||
uqm_SUBDIRS="$uqm_SUBDIRS regex"
|
uqm_SUBDIRS="$uqm_SUBDIRS regex"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
uqm_CFILES="options.c port.c uqm.c"
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
uqm_MFILES="SDLMain.m"
|
uqm_MFILES="SDLMain.m"
|
||||||
|
uqm_HFILES="SDLMain.h"
|
||||||
|
|||||||
@@ -5,15 +5,12 @@
|
|||||||
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 */
|
#import <Cocoa/Cocoa.h>
|
||||||
@interface NSAppleMenuController:NSObject {}
|
|
||||||
- (void)controlMenu:(NSMenu *)aMenu;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface SDLMain : NSObject
|
@interface SDLMain : NSObject
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface SDLApplication : NSApplication
|
#endif /* _SDLMain_h_ */
|
||||||
@end
|
|
||||||
|
|||||||
+213
-97
@@ -3,9 +3,6 @@
|
|||||||
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
|
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
|
||||||
|
|
||||||
Modified for use with The Ur-Quan Masters by Nicolas Simonds
|
|
||||||
<uqm at submedia dot net>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "port.h"
|
#import "port.h"
|
||||||
@@ -35,93 +32,152 @@ static BOOL gFinderLaunch;
|
|||||||
(void) sender; /* Get rid of unused variable warning */
|
(void) sender; /* Get rid of unused variable warning */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* override NSApplication:sendEvent, to keep Cocoa from beeping on
|
/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
|
||||||
non-command keystrokes */
|
but the method still is there and works. To avoid warnings, we declare
|
||||||
- (void)sendEvent:(NSEvent *)anEvent {
|
it ourselves here. */
|
||||||
if (NSKeyDown == [anEvent type] || NSKeyUp == [anEvent type]) {
|
@interface NSApplication(SDL_Missing_Methods)
|
||||||
if ([anEvent modifierFlags] & NSCommandKeyMask)
|
- (void)setAppleMenu:(NSMenu *)menu;
|
||||||
[super sendEvent: anEvent];
|
@end
|
||||||
} else
|
|
||||||
[super sendEvent: anEvent];
|
/* 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
|
@end
|
||||||
|
|
||||||
/* The main class of the application, the application's delegate */
|
/* The main class of the application, the application's delegate */
|
||||||
@implementation SDLMain
|
@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 */
|
/* Set the working directory to the .app's parent directory */
|
||||||
- (void) setupWorkingDirectory:(BOOL)shouldChdir
|
- (void) setupWorkingDirectory:(BOOL)shouldChdir
|
||||||
{
|
{
|
||||||
char origindir[PATH_MAX];
|
if (shouldChdir)
|
||||||
char *c;
|
{
|
||||||
|
char parentdir[MAXPATHLEN];
|
||||||
if (!shouldChdir)
|
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
|
||||||
return;
|
CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
|
||||||
|
if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
|
||||||
strncpy (origindir, gArgv[0], sizeof origindir);
|
chdir(parentdir); /* chdir to the binary app's parent */
|
||||||
origindir[sizeof origindir - 1] = '\0';
|
}
|
||||||
|
CFRelease(url);
|
||||||
c = basename (origindir);
|
CFRelease(url2);
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
#if SDL_USE_NIB_FILE
|
||||||
setupAppleMenu (void)
|
|
||||||
{
|
|
||||||
NSMenu *appleMenu;
|
|
||||||
|
|
||||||
|
/* Fix menu to contain the real app name instead of "SDL App" */
|
||||||
|
- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
|
||||||
|
{
|
||||||
|
NSRange aRange;
|
||||||
|
NSEnumerator *enumerator;
|
||||||
|
NSMenuItem *menuItem;
|
||||||
|
|
||||||
|
aRange = [[aMenu title] rangeOfString:@"SDL App"];
|
||||||
|
if (aRange.length != 0)
|
||||||
|
[aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with: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];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
static void setApplicationMenu(void)
|
||||||
|
{
|
||||||
|
/* warning: this code is very odd */
|
||||||
|
NSMenu *appleMenu;
|
||||||
NSMenuItem *menuItem;
|
NSMenuItem *menuItem;
|
||||||
NSString *title;
|
NSString *title;
|
||||||
NSString *appName;
|
NSString *appName;
|
||||||
|
|
||||||
appName = [NSString stringWithUTF8String:basename (gArgv[0])];
|
appName = getApplicationName();
|
||||||
appleMenu = [[NSMenu alloc] initWithTitle:appName];
|
appleMenu = [[NSMenu alloc] initWithTitle:@""];
|
||||||
|
|
||||||
/* Add menu items */
|
/* Add menu items */
|
||||||
title = [@"Hide " stringByAppendingString:appName];
|
title = [@"About " stringByAppendingString:appName];
|
||||||
[appleMenu addItemWithTitle:title action:@selector(hide:)
|
[appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
|
||||||
keyEquivalent:@"h"];
|
|
||||||
|
|
||||||
menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others"
|
[appleMenu addItem:[NSMenuItem separatorItem]];
|
||||||
action:@selector(hideOtherApplications:)
|
|
||||||
keyEquivalent:@"h"];
|
title = [@"Hide " stringByAppendingString:appName];
|
||||||
|
[appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
|
||||||
|
|
||||||
|
menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
|
||||||
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
|
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
|
||||||
|
|
||||||
[appleMenu addItemWithTitle:@"Show All"
|
[appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
|
||||||
action:@selector(unhideAllApplications:)
|
|
||||||
keyEquivalent:@""];
|
|
||||||
|
|
||||||
[appleMenu addItem:[NSMenuItem separatorItem]];
|
[appleMenu addItem:[NSMenuItem separatorItem]];
|
||||||
|
|
||||||
title = [@"Quit " stringByAppendingString:appName];
|
title = [@"Quit " stringByAppendingString:appName];
|
||||||
[appleMenu addItemWithTitle:title action:@selector(terminate:)
|
[appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
|
||||||
keyEquivalent:@"q"];
|
|
||||||
|
|
||||||
/* Put menu into the menubar */
|
/* Put menu into the menubar */
|
||||||
menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil
|
menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
|
||||||
keyEquivalent:@""];
|
|
||||||
[menuItem setSubmenu:appleMenu];
|
[menuItem setSubmenu:appleMenu];
|
||||||
[[NSApp mainMenu] addItem:menuItem];
|
[[NSApp mainMenu] addItem:menuItem];
|
||||||
|
|
||||||
@@ -134,8 +190,7 @@ setupAppleMenu (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Create a window menu */
|
/* Create a window menu */
|
||||||
void
|
static void setupWindowMenu(void)
|
||||||
setupWindowMenu (void)
|
|
||||||
{
|
{
|
||||||
NSMenu *windowMenu;
|
NSMenu *windowMenu;
|
||||||
NSMenuItem *windowMenuItem;
|
NSMenuItem *windowMenuItem;
|
||||||
@@ -144,15 +199,12 @@ setupWindowMenu (void)
|
|||||||
windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
|
windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
|
||||||
|
|
||||||
/* "Minimize" item */
|
/* "Minimize" item */
|
||||||
menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize"
|
menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
|
||||||
action:@selector(performMiniaturize:)
|
|
||||||
keyEquivalent:@"m"];
|
|
||||||
[windowMenu addItem:menuItem];
|
[windowMenu addItem:menuItem];
|
||||||
[menuItem release];
|
[menuItem release];
|
||||||
|
|
||||||
/* Put menu into the menubar */
|
/* Put menu into the menubar */
|
||||||
windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window"
|
windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
|
||||||
action:nil keyEquivalent:@""];
|
|
||||||
[windowMenuItem setSubmenu:windowMenu];
|
[windowMenuItem setSubmenu:windowMenu];
|
||||||
[[NSApp mainMenu] addItem:windowMenuItem];
|
[[NSApp mainMenu] addItem:windowMenuItem];
|
||||||
|
|
||||||
@@ -165,18 +217,28 @@ setupWindowMenu (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Replacement for NSApplicationMain */
|
/* Replacement for NSApplicationMain */
|
||||||
void
|
static void CustomApplicationMain (int argc, char **argv)
|
||||||
CustomApplicationMain (int argc, char **argv)
|
|
||||||
{
|
{
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
SDLMain *sdlMain;
|
SDLMain *sdlMain;
|
||||||
|
|
||||||
/* Ensure the application object is initialised */
|
/* Ensure the application object is initialised */
|
||||||
[SDLApplication sharedApplication];
|
[NSApplication sharedApplication];
|
||||||
|
|
||||||
|
#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 */
|
||||||
|
|
||||||
/* Set up the menubar */
|
/* Set up the menubar */
|
||||||
[NSApp setMainMenu:[[NSMenu alloc] init]];
|
[NSApp setMainMenu:[[NSMenu alloc] init]];
|
||||||
setupAppleMenu ();
|
setApplicationMenu();
|
||||||
setupWindowMenu();
|
setupWindowMenu();
|
||||||
|
|
||||||
/* Create SDLMain and make it the app delegate */
|
/* Create SDLMain and make it the app delegate */
|
||||||
@@ -188,11 +250,60 @@ CustomApplicationMain (int argc, char **argv)
|
|||||||
|
|
||||||
[sdlMain release];
|
[sdlMain release];
|
||||||
[pool release];
|
[pool release];
|
||||||
|
|
||||||
(void) argc; /* Get rid of unused variable warning */
|
|
||||||
(void) argv; /* Get rid of unused variable warning */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#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 */
|
/* Called when the internal event loop has just started running */
|
||||||
- (void) applicationDidFinishLaunching: (NSNotification *) note
|
- (void) applicationDidFinishLaunching: (NSNotification *) note
|
||||||
{
|
{
|
||||||
@@ -201,19 +312,21 @@ CustomApplicationMain (int argc, char **argv)
|
|||||||
/* Set the working directory to the .app's parent directory */
|
/* Set the working directory to the .app's parent directory */
|
||||||
[self setupWorkingDirectory:gFinderLaunch];
|
[self setupWorkingDirectory:gFinderLaunch];
|
||||||
|
|
||||||
/* allow Cocoa to hear keystrokes like Command-Q, etc. */
|
#if SDL_USE_NIB_FILE
|
||||||
setenv ("SDL_ENABLEAPPEVENTS", "1", 1);
|
/* 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 */
|
/* Hand off to main application code */
|
||||||
|
gCalledAppMainline = TRUE;
|
||||||
status = SDL_main (gArgc, gArgv);
|
status = SDL_main (gArgc, gArgv);
|
||||||
|
|
||||||
/* We're done, thank you for playing */
|
/* We're done, thank you for playing */
|
||||||
exit(status);
|
exit(status);
|
||||||
|
|
||||||
(void) note; /* Get rid of unused variable warning */
|
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
@implementation NSString (ReplaceSubString)
|
@implementation NSString (ReplaceSubString)
|
||||||
|
|
||||||
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
|
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
|
||||||
@@ -226,7 +339,7 @@ CustomApplicationMain (int argc, char **argv)
|
|||||||
NSString *result;
|
NSString *result;
|
||||||
|
|
||||||
bufferSize = selfLen + aStringLen - aRange.length;
|
bufferSize = selfLen + aStringLen - aRange.length;
|
||||||
buffer = NSAllocateMemoryPages (bufferSize * sizeof (unichar));
|
buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
|
||||||
|
|
||||||
/* Get first part into buffer */
|
/* Get first part into buffer */
|
||||||
localRange.location = 0;
|
localRange.location = 0;
|
||||||
@@ -241,8 +354,7 @@ CustomApplicationMain (int argc, char **argv)
|
|||||||
/* Get last part into buffer */
|
/* Get last part into buffer */
|
||||||
localRange.location = aRange.location + aRange.length;
|
localRange.location = aRange.location + aRange.length;
|
||||||
localRange.length = selfLen - localRange.location;
|
localRange.length = selfLen - localRange.location;
|
||||||
[self getCharacters:(buffer + aRange.location+aStringLen)
|
[self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
|
||||||
range:localRange];
|
|
||||||
|
|
||||||
/* Build output string */
|
/* Build output string */
|
||||||
result = [NSString stringWithCharacters:buffer length:bufferSize];
|
result = [NSString stringWithCharacters:buffer length:bufferSize];
|
||||||
@@ -254,34 +366,38 @@ CustomApplicationMain (int argc, char **argv)
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef main
|
#ifdef main
|
||||||
# undef main
|
# undef main
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Main entry point to executable - should *not* be SDL_main! */
|
/* Main entry point to executable - should *not* be SDL_main! */
|
||||||
int
|
int main (int argc, char **argv)
|
||||||
main (int argc, char **argv)
|
|
||||||
{
|
{
|
||||||
/* Copy the arguments into a global variable */
|
/* Copy the arguments into a global variable */
|
||||||
int i;
|
/* This is passed if we are launched by double-clicking */
|
||||||
|
if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
|
||||||
/* If we are launched by double-clicking, argv[1] is "-psn_<some_number> */
|
gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
|
||||||
if ( argc >= 2 && strncmp (argv[1], "-psn_", 5) == 0 ) {
|
gArgv[0] = argv[0];
|
||||||
|
gArgv[1] = NULL;
|
||||||
gArgc = 1;
|
gArgc = 1;
|
||||||
gFinderLaunch = YES;
|
gFinderLaunch = YES;
|
||||||
} else {
|
} else {
|
||||||
|
int i;
|
||||||
gArgc = argc;
|
gArgc = argc;
|
||||||
|
gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
|
||||||
|
for (i = 0; i <= argc; i++)
|
||||||
|
gArgv[i] = argv[i];
|
||||||
gFinderLaunch = NO;
|
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;
|
|
||||||
|
|
||||||
|
#if SDL_USE_NIB_FILE
|
||||||
|
NSApplicationMain (argc, argv);
|
||||||
|
#else
|
||||||
CustomApplicationMain (argc, argv);
|
CustomApplicationMain (argc, argv);
|
||||||
free (gArgv);
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,11 @@
|
|||||||
#define UQM_Swap32 __arch__swab32
|
#define UQM_Swap32 __arch__swab32
|
||||||
#endif
|
#endif
|
||||||
#endif /* linux */
|
#endif /* linux */
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Use inline functions for compilers that support them, and static
|
/* Use inline functions for compilers that support them, and static
|
||||||
functions for those that do not. Because these functions become
|
functions for those that do not. Because these functions become
|
||||||
static for compilers that do not support inline functions, this
|
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)
|
#define UQM_SwapBE64(X) (X)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _ENDIAN_H */
|
#endif /* _ENDIAN_H */
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
uqm_CFILES="getopt.c getopt1.c"
|
uqm_CFILES="getopt.c getopt1.c"
|
||||||
|
uqm_HFILES="getopt.h"
|
||||||
|
|||||||
@@ -12,3 +12,8 @@ fi
|
|||||||
# uqm_SUBDIRS="$UQM_SUBDIRS debug"
|
# uqm_SUBDIRS="$UQM_SUBDIRS debug"
|
||||||
#fi
|
#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"
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,9 @@
|
|||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "callback/alarm.h"
|
#include "callback/alarm.h"
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "callback/async.h"
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
@@ -1,2 +1,10 @@
|
|||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "callback/callback.h"
|
#include "callback/callback.h"
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "alarm.h"
|
#include "alarm.h"
|
||||||
|
|
||||||
|
#include SDL_INCLUDE(SDL.h)
|
||||||
#include "libs/heap.h"
|
#include "libs/heap.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@@ -71,19 +72,36 @@ Alarm_uninit(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline AlarmTime
|
static inline AlarmTime
|
||||||
AlarmTime_nowMS(void) {
|
AlarmTime_nowMs(void) {
|
||||||
return SDL_GetTicks();
|
return SDL_GetTicks();
|
||||||
}
|
}
|
||||||
|
|
||||||
Alarm *
|
Alarm *
|
||||||
Alarm_addRelativeMs(Uint32 ms, AlarmCallback callback,
|
Alarm_addAbsoluteMs(uint32 ms, AlarmCallback callback,
|
||||||
AlarmCallbackArg arg) {
|
AlarmCallbackArg arg) {
|
||||||
Alarm *alarm;
|
Alarm *alarm;
|
||||||
|
|
||||||
assert(alarmHeap != NULL);
|
assert(alarmHeap != NULL);
|
||||||
|
|
||||||
alarm = Alarm_alloc();
|
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->callback = callback;
|
||||||
alarm->arg = arg;
|
alarm->arg = arg;
|
||||||
|
|
||||||
@@ -99,15 +117,40 @@ Alarm_remove(Alarm *alarm) {
|
|||||||
Alarm_free(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
|
// 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.
|
// that it called. It should not be called from multiple threads at once.
|
||||||
void
|
void
|
||||||
Alarm_process(void) {
|
Alarm_processAll(void) {
|
||||||
AlarmTime now;
|
AlarmTime now;
|
||||||
|
|
||||||
assert(alarmHeap != NULL);
|
assert(alarmHeap != NULL);
|
||||||
|
|
||||||
now = AlarmTime_nowMS();
|
now = AlarmTime_nowMs();
|
||||||
while (Heap_hasMore(alarmHeap)) {
|
while (Heap_hasMore(alarmHeap)) {
|
||||||
Alarm *alarm = (Alarm *) Heap_first(alarmHeap);
|
Alarm *alarm = (Alarm *) Heap_first(alarmHeap);
|
||||||
|
|
||||||
@@ -119,8 +162,9 @@ Alarm_process(void) {
|
|||||||
Alarm_free(alarm);
|
Alarm_free(alarm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Uint32
|
uint32
|
||||||
Alarm_timeBeforeNextMs(void) {
|
Alarm_timeBeforeNextMs(void) {
|
||||||
Alarm *alarm;
|
Alarm *alarm;
|
||||||
|
|
||||||
@@ -131,4 +175,3 @@ Alarm_timeBeforeNextMs(void) {
|
|||||||
return alarmTimeToMsUint32(alarm->time);
|
return alarmTimeToMsUint32(alarm->time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,10 @@
|
|||||||
#include "port.h"
|
#include "port.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
#include SDL_INCLUDE(SDL.h)
|
typedef uint32 AlarmTime;
|
||||||
typedef Uint32 AlarmTime;
|
static inline uint32
|
||||||
static inline Uint32
|
|
||||||
alarmTimeToMsUint32(AlarmTime time) {
|
alarmTimeToMsUint32(AlarmTime time) {
|
||||||
return (Uint32) time;
|
return (uint32) time;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct Alarm Alarm;
|
typedef struct Alarm Alarm;
|
||||||
@@ -44,11 +43,14 @@ struct Alarm {
|
|||||||
|
|
||||||
void Alarm_init(void);
|
void Alarm_init(void);
|
||||||
void Alarm_uninit(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);
|
AlarmCallbackArg arg);
|
||||||
void Alarm_remove(Alarm *alarm);
|
void Alarm_remove(Alarm *alarm);
|
||||||
void Alarm_process(void);
|
bool Alarm_processOne(void);
|
||||||
Uint32 Alarm_timeBeforeNextMs(void);
|
void Alarm_processAll(void);
|
||||||
|
uint32 Alarm_timeBeforeNextMs(void);
|
||||||
|
|
||||||
#endif /* LIBS_CALLBACK_ALARM_H_ */
|
#endif /* LIBS_CALLBACK_ALARM_H_ */
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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 */
|
||||||
|
|
||||||
@@ -23,6 +23,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include "libs/threadlib.h"
|
||||||
|
|
||||||
typedef struct CallbackLink CallbackLink;
|
typedef struct CallbackLink CallbackLink;
|
||||||
|
|
||||||
#define CALLBACK_INTERNAL
|
#define CALLBACK_INTERNAL
|
||||||
@@ -38,16 +40,16 @@ static CallbackLink *callbacks;
|
|||||||
static CallbackLink **callbacksEnd;
|
static CallbackLink **callbacksEnd;
|
||||||
static CallbackLink *const *callbacksProcessEnd;
|
static CallbackLink *const *callbacksProcessEnd;
|
||||||
|
|
||||||
|
static Mutex callbackListLock;
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
CallbackList_lock(void) {
|
CallbackList_lock(void) {
|
||||||
// TODO
|
LockMutex(callbackListLock);
|
||||||
// Necessary for reentrant operation
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
CallbackList_unlock(void) {
|
CallbackList_unlock(void) {
|
||||||
// TODO
|
UnlockMutex(callbackListLock);
|
||||||
// Necessary for reentrant operation
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@@ -62,6 +64,14 @@ Callback_init(void) {
|
|||||||
callbacks = NULL;
|
callbacks = NULL;
|
||||||
callbacksEnd = &callbacks;
|
callbacksEnd = &callbacks;
|
||||||
callbacksProcessEnd = &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.
|
// 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,9 +33,11 @@ typedef void *CallbackArg;
|
|||||||
typedef void (*CallbackFunction)(CallbackArg arg);
|
typedef void (*CallbackFunction)(CallbackArg arg);
|
||||||
|
|
||||||
void Callback_init(void);
|
void Callback_init(void);
|
||||||
|
void Callback_uninit(void);
|
||||||
CallbackID Callback_add(CallbackFunction callback, CallbackArg arg);
|
CallbackID Callback_add(CallbackFunction callback, CallbackArg arg);
|
||||||
bool Callback_remove(CallbackID id);
|
bool Callback_remove(CallbackID id);
|
||||||
void Callback_process(void);
|
void Callback_process(void);
|
||||||
|
bool Callback_haveMore(void);
|
||||||
|
|
||||||
#endif /* LIBS_CALLBACK_CALLBACK_H_ */
|
#endif /* LIBS_CALLBACK_CALLBACK_H_ */
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
uqm_CFILES="cdp.c cdpapi.c"
|
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"
|
||||||
|
|||||||
@@ -19,6 +19,14 @@
|
|||||||
#ifndef LIBS_CDPLIB_H_
|
#ifndef LIBS_CDPLIB_H_
|
||||||
#define LIBS_CDPLIB_H_
|
#define LIBS_CDPLIB_H_
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "cdp/cdp.h"
|
#include "cdp/cdp.h"
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* LIBS_CDPLIB_H_ */
|
#endif /* LIBS_CDPLIB_H_ */
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef uint8 BYTE;
|
typedef uint8 BYTE;
|
||||||
typedef uint8 UBYTE;
|
typedef uint8 UBYTE;
|
||||||
typedef sint8 SBYTE;
|
typedef sint8 SBYTE;
|
||||||
@@ -85,5 +89,8 @@ typedef DWORD (*PDWORDFUNC) (void);
|
|||||||
# define _ALIGNED_ON(bytes)
|
# define _ALIGNED_ON(bytes)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* LIBS_COMPILER_H_ */
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* LIBS_COMPILER_H_ */
|
||||||
|
|||||||
@@ -20,6 +20,11 @@
|
|||||||
#define LIBS_DECLIB_H_
|
#define LIBS_DECLIB_H_
|
||||||
|
|
||||||
#include "libs/compiler.h"
|
#include "libs/compiler.h"
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct _LZHCODE_DESC* DECODE_REF;
|
typedef struct _LZHCODE_DESC* DECODE_REF;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@@ -45,4 +50,8 @@ extern COUNT cread (void *pStr, COUNT size, COUNT count,
|
|||||||
extern COUNT cwrite (const void *pStr, COUNT size, COUNT count,
|
extern COUNT cwrite (const void *pStr, COUNT size, COUNT count,
|
||||||
DECODE_REF DecodeRef);
|
DECODE_REF DecodeRef);
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* LIBS_DECLIB_H_ */
|
#endif /* LIBS_DECLIB_H_ */
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
uqm_CFILES="lzdecode.c lzencode.c update.c"
|
uqm_CFILES="lzdecode.c lzencode.c update.c"
|
||||||
|
uqm_HFILES="lzh.h"
|
||||||
|
|||||||
@@ -25,6 +25,10 @@
|
|||||||
// for bool
|
// for bool
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// from temp.h
|
// from temp.h
|
||||||
void initTempDir (void);
|
void initTempDir (void);
|
||||||
@@ -83,5 +87,9 @@ static inline int isDriveLetter(int c)
|
|||||||
}
|
}
|
||||||
#endif /* HAVE_DRIVE_LETTERS */
|
#endif /* HAVE_DRIVE_LETTERS */
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* LIBS_FILE_H_ */
|
#endif /* LIBS_FILE_H_ */
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
uqm_CFILES="dirs.c files.c"
|
uqm_CFILES="dirs.c files.c"
|
||||||
|
uqm_HFILES="filintrn.h"
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ mkdirhier (const char *path)
|
|||||||
|
|
||||||
if (*pathstart == '\0') {
|
if (*pathstart == '\0') {
|
||||||
// path exists completely, nothing more to do
|
// path exists completely, nothing more to do
|
||||||
return 0;
|
goto success;
|
||||||
}
|
}
|
||||||
|
|
||||||
// walk through the path as long as the components exist
|
// walk through the path as long as the components exist
|
||||||
@@ -177,7 +177,7 @@ mkdirhier (const char *path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (*pathend == '\0')
|
if (*pathend == '\0')
|
||||||
return 0;
|
goto success;
|
||||||
|
|
||||||
*ptr = '/';
|
*ptr = '/';
|
||||||
ptr++;
|
ptr++;
|
||||||
@@ -187,7 +187,7 @@ mkdirhier (const char *path)
|
|||||||
// pathstart is the next non-slash character
|
// pathstart is the next non-slash character
|
||||||
|
|
||||||
if (*pathstart == '\0')
|
if (*pathstart == '\0')
|
||||||
return 0;
|
goto success;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create all components left
|
// create all components left
|
||||||
@@ -221,6 +221,9 @@ mkdirhier (const char *path)
|
|||||||
ptr += pathend - pathstart;
|
ptr += pathend - pathstart;
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
success:
|
||||||
|
HFree (buf);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
@@ -641,6 +644,7 @@ expandPath (char *dest, size_t len, const char *src, int what)
|
|||||||
*destptr = '\0';
|
*destptr = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HFree (buf);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
@@ -656,7 +660,7 @@ err:
|
|||||||
// This code is only needed if we have a current working directory
|
// This code is only needed if we have a current working directory
|
||||||
// per drive.
|
// per drive.
|
||||||
// letter is 0 based: 0 = A, 1 = B, ...
|
// letter is 0 based: 0 = A, 1 = B, ...
|
||||||
bool
|
static bool
|
||||||
driveLetterExists(int letter)
|
driveLetterExists(int letter)
|
||||||
{
|
{
|
||||||
unsigned long drives;
|
unsigned long drives;
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ copyFile (uio_DirHandle *srcDir, const char *srcName,
|
|||||||
buf = HMalloc(BUFSIZE);
|
buf = HMalloc(BUFSIZE);
|
||||||
// This was originally a statically allocated buffer,
|
// This was originally a statically allocated buffer,
|
||||||
// but as this function might be run from a thread with
|
// 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)
|
while (1)
|
||||||
{
|
{
|
||||||
numInBuf = uio_read (src, buf, BUFSIZE);
|
numInBuf = uio_read (src, buf, BUFSIZE);
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ struct Color {
|
|||||||
|
|
||||||
#include "libs/reslib.h"
|
#include "libs/reslib.h"
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct context_desc CONTEXT_DESC;
|
typedef struct context_desc CONTEXT_DESC;
|
||||||
typedef struct frame_desc FRAME_DESC;
|
typedef struct frame_desc FRAME_DESC;
|
||||||
typedef struct font_desc FONT_DESC;
|
typedef struct font_desc FONT_DESC;
|
||||||
@@ -227,8 +231,16 @@ typedef struct text
|
|||||||
COUNT CharCount;
|
COUNT CharCount;
|
||||||
} TEXT;
|
} TEXT;
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "libs/strlib.h"
|
#include "libs/strlib.h"
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef STRING_TABLE COLORMAP_REF;
|
typedef STRING_TABLE COLORMAP_REF;
|
||||||
typedef STRING COLORMAP;
|
typedef STRING COLORMAP;
|
||||||
// COLORMAPPTR is really a pointer to colortable entry structure
|
// COLORMAPPTR is really a pointer to colortable entry structure
|
||||||
@@ -237,6 +249,7 @@ typedef void *COLORMAPPTR;
|
|||||||
|
|
||||||
#include "graphics/prim.h"
|
#include "graphics/prim.h"
|
||||||
|
|
||||||
|
|
||||||
typedef BYTE BATCH_FLAGS;
|
typedef BYTE BATCH_FLAGS;
|
||||||
// This flag is currently unused but it might make sense to restore it
|
// This flag is currently unused but it might make sense to restore it
|
||||||
#define BATCH_BUILD_PAGE (BATCH_FLAGS)(1 << 0)
|
#define BATCH_BUILD_PAGE (BATCH_FLAGS)(1 << 0)
|
||||||
@@ -454,4 +467,8 @@ extern COLORMAPPTR GetColorMapAddress (COLORMAP);
|
|||||||
void SetSystemRect (const RECT *pRect);
|
void SetSystemRect (const RECT *pRect);
|
||||||
void ClearSystemRect (void);
|
void ClearSystemRect (void);
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* LIBS_GFXLIB_H_ */
|
#endif /* LIBS_GFXLIB_H_ */
|
||||||
|
|||||||
@@ -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
|
font.c frame.c gfx_common.c intersec.c loaddisp.c
|
||||||
pixmap.c resgfx.c tfb_draw.c tfb_prim.c widgets.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"
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,10 @@ static int mapcount;
|
|||||||
static Mutex maplock;
|
static Mutex maplock;
|
||||||
|
|
||||||
|
|
||||||
|
static void release_colormap (TFB_ColorMap *map);
|
||||||
|
static void delete_colormap (TFB_ColorMap *map);
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
InitColorMaps (void)
|
InitColorMaps (void)
|
||||||
{
|
{
|
||||||
@@ -84,13 +88,23 @@ InitColorMaps (void)
|
|||||||
void
|
void
|
||||||
UninitColorMaps (void)
|
UninitColorMaps (void)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
TFB_ColorMap *next;
|
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
|
// free spares
|
||||||
for ( ; poolhead; poolhead = next)
|
for ( ; poolhead; poolhead = next, --poolcount)
|
||||||
{
|
{
|
||||||
next = poolhead->next;
|
next = poolhead->next;
|
||||||
HFree (poolhead);
|
delete_colormap (poolhead);
|
||||||
}
|
}
|
||||||
|
|
||||||
DestroyMutex (fadeLock);
|
DestroyMutex (fadeLock);
|
||||||
@@ -155,6 +169,13 @@ clone_colormap (TFB_ColorMap *from, int index)
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
delete_colormap (TFB_ColorMap *map)
|
||||||
|
{
|
||||||
|
FreeNativePalette (map->palette);
|
||||||
|
HFree (map);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
free_colormap (TFB_ColorMap *map)
|
free_colormap (TFB_ColorMap *map)
|
||||||
{
|
{
|
||||||
@@ -172,8 +193,7 @@ free_colormap (TFB_ColorMap *map)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // don't need any more spares
|
{ // don't need any more spares
|
||||||
FreeNativePalette (map->palette);
|
delete_colormap (map);
|
||||||
HFree (map);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,7 +213,7 @@ get_colormap (int index)
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static void
|
||||||
release_colormap (TFB_ColorMap *map)
|
release_colormap (TFB_ColorMap *map)
|
||||||
{
|
{
|
||||||
if (!map)
|
if (!map)
|
||||||
|
|||||||
@@ -123,6 +123,8 @@ FindContextPtr (CONTEXT context) {
|
|||||||
BOOLEAN
|
BOOLEAN
|
||||||
DestroyContext (CONTEXT ContextRef)
|
DestroyContext (CONTEXT ContextRef)
|
||||||
{
|
{
|
||||||
|
TFB_Image *img;
|
||||||
|
|
||||||
if (ContextRef == 0)
|
if (ContextRef == 0)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
@@ -139,6 +141,10 @@ DestroyContext (CONTEXT ContextRef)
|
|||||||
}
|
}
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
|
img = ContextRef->FontBacking;
|
||||||
|
if (img)
|
||||||
|
TFB_DrawImage_Delete (img);
|
||||||
|
|
||||||
FreeContext (ContextRef);
|
FreeContext (ContextRef);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,9 +155,18 @@ Init_DrawCommandQueue (void)
|
|||||||
|
|
||||||
void
|
void
|
||||||
Uninit_DrawCommandQueue (void)
|
Uninit_DrawCommandQueue (void)
|
||||||
|
{
|
||||||
|
if (RenderingCond)
|
||||||
{
|
{
|
||||||
DestroyCondVar (RenderingCond);
|
DestroyCondVar (RenderingCond);
|
||||||
|
RenderingCond = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DCQ_Mutex)
|
||||||
|
{
|
||||||
DestroyRecursiveMutex (DCQ_Mutex);
|
DestroyRecursiveMutex (DCQ_Mutex);
|
||||||
|
DCQ_Mutex = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -216,6 +225,30 @@ TFB_DrawCommandQueue_Clear ()
|
|||||||
UnlockRecursiveMutex (DCQ_Mutex);
|
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
|
void
|
||||||
TFB_EnqueueDrawCommand (TFB_DrawCommand* DrawCommand)
|
TFB_EnqueueDrawCommand (TFB_DrawCommand* DrawCommand)
|
||||||
{
|
{
|
||||||
@@ -224,6 +257,8 @@ TFB_EnqueueDrawCommand (TFB_DrawCommand* DrawCommand)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkExclusiveThread (DrawCommand);
|
||||||
|
|
||||||
if (DrawCommand->Type <= TFB_DRAWCOMMANDTYPE_COPYTOIMAGE
|
if (DrawCommand->Type <= TFB_DRAWCOMMANDTYPE_COPYTOIMAGE
|
||||||
&& _CurFramePtr->Type == SCREEN_DRAWABLE)
|
&& _CurFramePtr->Type == SCREEN_DRAWABLE)
|
||||||
{
|
{
|
||||||
@@ -587,3 +622,49 @@ TFB_FlushGraphics (void)
|
|||||||
RenderedFrames++;
|
RenderedFrames++;
|
||||||
BroadcastCondVar (RenderingCond);
|
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 ();
|
||||||
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ UnbatchGraphics (void)
|
|||||||
been processed. */
|
been processed. */
|
||||||
|
|
||||||
void
|
void
|
||||||
FlushGraphics ()
|
FlushGraphics (void)
|
||||||
{
|
{
|
||||||
TFB_DrawScreen_WaitForSignal ();
|
TFB_DrawScreen_WaitForSignal ();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
int TFB_ReInitGraphics (int driver, int flags, int width, int height);
|
||||||
void TFB_UninitGraphics (void);
|
void TFB_UninitGraphics (void);
|
||||||
void TFB_ProcessEvents (void);
|
void TFB_ProcessEvents (void);
|
||||||
void TFB_SetGamma (float gamma);
|
bool TFB_SetGamma (float gamma);
|
||||||
void TFB_UploadTransitionScreen (void);
|
void TFB_UploadTransitionScreen (void);
|
||||||
int TFB_SupportsHardwareScaling (void);
|
int TFB_SupportsHardwareScaling (void);
|
||||||
// This function should not be called directly
|
// This function should not be called directly
|
||||||
@@ -99,6 +99,7 @@ extern float FrameRate;
|
|||||||
extern int FrameRateTickBase;
|
extern int FrameRateTickBase;
|
||||||
|
|
||||||
void TFB_FlushGraphics (void); // Only call from main thread!!
|
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 ScreenWidth;
|
||||||
extern int ScreenHeight;
|
extern int ScreenHeight;
|
||||||
|
|||||||
@@ -321,15 +321,7 @@ _ReleaseCelData (void *handle)
|
|||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
cel_ct = DrawablePtr->MaxIndex + 1;
|
cel_ct = DrawablePtr->MaxIndex + 1;
|
||||||
|
|
||||||
if (DrawablePtr->Frame)
|
|
||||||
{
|
|
||||||
FramePtr = DrawablePtr->Frame;
|
FramePtr = DrawablePtr->Frame;
|
||||||
if (FramePtr->Type == SCREEN_DRAWABLE)
|
|
||||||
{
|
|
||||||
FramePtr = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
HFree (handle);
|
HFree (handle);
|
||||||
if (FramePtr)
|
if (FramePtr)
|
||||||
|
|||||||
@@ -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
|
2xscalers_mmx.c 2xscalers_sse.c 2xscalers_3dnow.c
|
||||||
nearest2x.c bilinear2x.c biadv2x.c triscan2x.c hq2x.c
|
nearest2x.c bilinear2x.c biadv2x.c triscan2x.c hq2x.c
|
||||||
canvas.c png2sdl.c sdluio.c rotozoom.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"
|
||||||
|
|||||||
@@ -74,30 +74,6 @@ static TFB_GRAPHICS_BACKEND opengl_unscaled_backend = {
|
|||||||
TFB_GL_ColorLayer };
|
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
|
static int
|
||||||
AttemptColorDepth (int flags, int width, int height, int bpp)
|
AttemptColorDepth (int flags, int width, int height, int bpp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#if SDL_MAJOR_VERSION == 1
|
#if SDL_MAJOR_VERSION == 1
|
||||||
|
|
||||||
int TFB_GL_InitGraphics (int driver, int flags, int width, int height);
|
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);
|
int TFB_GL_ConfigureVideo (int driver, int flags, int width, int height, int togglefullscreen);
|
||||||
|
|
||||||
#ifdef HAVE_OPENGL
|
#ifdef HAVE_OPENGL
|
||||||
|
|||||||
@@ -53,30 +53,6 @@ static TFB_GRAPHICS_BACKEND pure_unscaled_backend = {
|
|||||||
TFB_Pure_ScreenLayer,
|
TFB_Pure_ScreenLayer,
|
||||||
TFB_Pure_ColorLayer };
|
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
|
// 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
|
// 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.
|
// 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TFB_Pure_UninitGraphics (void)
|
||||||
|
{
|
||||||
|
UnInit_Screen (&scaled_display);
|
||||||
|
UnInit_Screen (&fade_color_surface);
|
||||||
|
UnInit_Screen (&fade_temp);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ScanLines (SDL_Surface *dst, SDL_Rect *r)
|
ScanLines (SDL_Surface *dst, SDL_Rect *r)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "libs/graphics/sdl/sdl_common.h"
|
#include "libs/graphics/sdl/sdl_common.h"
|
||||||
|
|
||||||
int TFB_Pure_InitGraphics (int driver, int flags, int width, int height);
|
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);
|
int TFB_Pure_ConfigureVideo (int driver, int flags, int width, int height, int togglefullscreen);
|
||||||
void Scale_PerfTest (void);
|
void Scale_PerfTest (void);
|
||||||
|
|
||||||
|
|||||||
@@ -223,6 +223,7 @@ int zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int smooth)
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static
|
||||||
int zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst)
|
int zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst)
|
||||||
{
|
{
|
||||||
Uint32 sx, sy, *sax, *say, *csax, *csay, csx, csy;
|
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)
|
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;
|
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)
|
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;
|
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 */
|
/* Local rotozoom-size function with trig result return */
|
||||||
|
|
||||||
|
static
|
||||||
void rotozoomSurfaceSizeTrig(int width, int height, double angle, double zoom, int *dstwidth, int *dstheight,
|
void rotozoomSurfaceSizeTrig(int width, int height, double angle, double zoom, int *dstwidth, int *dstheight,
|
||||||
double *canglezoom, double *sanglezoom)
|
double *canglezoom, double *sanglezoom)
|
||||||
{
|
{
|
||||||
@@ -581,8 +585,8 @@ void rotozoomSurfaceSizeTrig(int width, int height, double angle, double zoom, i
|
|||||||
cy = *canglezoom * y;
|
cy = *canglezoom * y;
|
||||||
sx = *sanglezoom * x;
|
sx = *sanglezoom * x;
|
||||||
sy = *sanglezoom * y;
|
sy = *sanglezoom * y;
|
||||||
dstwidthhalf = MAX((int) ceil(fabs(cx) + fabs(sy)), 1);
|
dstwidthhalf = MAX(ceil(fabs(cx) + fabs(sy)), 1);
|
||||||
dstheighthalf = MAX((int) ceil(fabs(sx) + fabs(cy)), 1);
|
dstheighthalf = MAX(ceil(fabs(sx) + fabs(cy)), 1);
|
||||||
*dstwidth = 2 * dstwidthhalf;
|
*dstwidth = 2 * dstwidthhalf;
|
||||||
*dstheight = 2 * dstheighthalf;
|
*dstheight = 2 * dstheighthalf;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,8 +213,8 @@ Scale_PrepPlatform (int flags, const SDL_PixelFormat* fmt)
|
|||||||
// first match wins
|
// first match wins
|
||||||
// add better platform techs to the top
|
// add better platform techs to the top
|
||||||
#ifdef MMX_ASM
|
#ifdef MMX_ASM
|
||||||
if ( (!force_platform && (SDL_HasSSE () || SDL_HasMMX ()))
|
if ( (!force_platform && (SDL_HasSSE () || SDL_HasMMXExt ()))
|
||||||
|| force_platform == SCALEPLAT_SSE)
|
|| force_platform == PLATFORM_SSE)
|
||||||
{
|
{
|
||||||
log_add (log_Info, "Screen scalers are using SSE/MMX-Ext/MMX code");
|
log_add (log_Info, "Screen scalers are using SSE/MMX-Ext/MMX code");
|
||||||
Scale_Platform = SCALEPLAT_SSE;
|
Scale_Platform = SCALEPLAT_SSE;
|
||||||
@@ -223,7 +223,7 @@ Scale_PrepPlatform (int flags, const SDL_PixelFormat* fmt)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ( (!force_platform && SDL_HasAltiVec ())
|
if ( (!force_platform && SDL_HasAltiVec ())
|
||||||
|| force_platform == SCALEPLAT_ALTIVEC)
|
|| force_platform == PLATFORM_ALTIVEC)
|
||||||
{
|
{
|
||||||
log_add (log_Info, "Screen scalers would use AltiVec code "
|
log_add (log_Info, "Screen scalers would use AltiVec code "
|
||||||
"if someone actually wrote it");
|
"if someone actually wrote it");
|
||||||
@@ -231,7 +231,7 @@ Scale_PrepPlatform (int flags, const SDL_PixelFormat* fmt)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ( (!force_platform && SDL_Has3DNow ())
|
if ( (!force_platform && SDL_Has3DNow ())
|
||||||
|| force_platform == SCALEPLAT_3DNOW)
|
|| force_platform == PLATFORM_3DNOW)
|
||||||
{
|
{
|
||||||
log_add (log_Info, "Screen scalers are using 3DNow/MMX code");
|
log_add (log_Info, "Screen scalers are using 3DNow/MMX code");
|
||||||
Scale_Platform = SCALEPLAT_3DNOW;
|
Scale_Platform = SCALEPLAT_3DNOW;
|
||||||
@@ -240,7 +240,7 @@ Scale_PrepPlatform (int flags, const SDL_PixelFormat* fmt)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ( (!force_platform && SDL_HasMMX ())
|
if ( (!force_platform && SDL_HasMMX ())
|
||||||
|| force_platform == SCALEPLAT_MMX)
|
|| force_platform == PLATFORM_MMX)
|
||||||
{
|
{
|
||||||
log_add (log_Info, "Screen scalers are using MMX code");
|
log_add (log_Info, "Screen scalers are using MMX code");
|
||||||
Scale_Platform = SCALEPLAT_MMX;
|
Scale_Platform = SCALEPLAT_MMX;
|
||||||
|
|||||||
@@ -50,18 +50,96 @@ TFB_GRAPHICS_BACKEND *graphics_backend = NULL;
|
|||||||
volatile int QuitPosted = 0;
|
volatile int QuitPosted = 0;
|
||||||
volatile int GameActive = 1; // Track the SDL_ACTIVEEVENT state SDL_APPACTIVE
|
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
|
int
|
||||||
TFB_InitGraphics (int driver, int flags, int width, int height)
|
TFB_InitGraphics (int driver, int flags, int width, int height)
|
||||||
{
|
{
|
||||||
int result, i;
|
int result;
|
||||||
char caption[200];
|
char caption[200];
|
||||||
|
|
||||||
/* Null out screen pointers the first time */
|
|
||||||
for (i = 0; i < TFB_GFX_NUMSCREENS; i++)
|
|
||||||
{
|
|
||||||
SDL_Screens[i] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
GfxFlags = flags;
|
GfxFlags = flags;
|
||||||
|
|
||||||
if (driver == TFB_GFXDRIVER_SDL_OPENGL)
|
if (driver == TFB_GFXDRIVER_SDL_OPENGL)
|
||||||
@@ -95,17 +173,25 @@ TFB_InitGraphics (int driver, int flags, int width, int height)
|
|||||||
|
|
||||||
TFB_DrawCanvas_Initialize ();
|
TFB_DrawCanvas_Initialize ();
|
||||||
|
|
||||||
atexit (TFB_UninitGraphics);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TFB_UninitGraphics (void)
|
TFB_UninitGraphics (void)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
Uninit_DrawCommandQueue ();
|
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
|
void
|
||||||
@@ -113,7 +199,7 @@ TFB_ProcessEvents ()
|
|||||||
{
|
{
|
||||||
SDL_Event Event;
|
SDL_Event Event;
|
||||||
|
|
||||||
while (SDL_PollEvent (&Event))
|
while (SDL_PollEvent (&Event) > 0)
|
||||||
{
|
{
|
||||||
/* Run through the InputEvent filter. */
|
/* Run through the InputEvent filter. */
|
||||||
ProcessInputEvent (&Event);
|
ProcessInputEvent (&Event);
|
||||||
|
|||||||
@@ -55,4 +55,8 @@ int TFB_SetColorKey (SDL_Surface *surface, Uint32 key, int rleaccel);
|
|||||||
int TFB_DisableColorKey (SDL_Surface *surface);
|
int TFB_DisableColorKey (SDL_Surface *surface);
|
||||||
int TFB_SetColors (SDL_Surface *surface, SDL_Color *colors, int firstcolor, int ncolors);
|
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
|
#endif
|
||||||
|
|||||||
@@ -301,6 +301,7 @@ TFB_DrawImage_New (TFB_Canvas canvas)
|
|||||||
img->last_scale_hs = NullHs;
|
img->last_scale_hs = NullHs;
|
||||||
img->last_scale_type = -1;
|
img->last_scale_type = -1;
|
||||||
img->last_scale = 0;
|
img->last_scale = 0;
|
||||||
|
img->dirty = FALSE;
|
||||||
TFB_DrawCanvas_GetExtent (canvas, &img->extent);
|
TFB_DrawCanvas_GetExtent (canvas, &img->extent);
|
||||||
|
|
||||||
if (TFB_DrawCanvas_IsPaletted (canvas))
|
if (TFB_DrawCanvas_IsPaletted (canvas))
|
||||||
@@ -414,8 +415,16 @@ TFB_DrawImage_Delete (TFB_Image *image)
|
|||||||
|
|
||||||
TFB_DrawCanvas_Delete (image->NormalImg);
|
TFB_DrawCanvas_Delete (image->NormalImg);
|
||||||
|
|
||||||
if (image->ScaledImg) {
|
if (image->ScaledImg)
|
||||||
|
{
|
||||||
TFB_DrawCanvas_Delete (image->ScaledImg);
|
TFB_DrawCanvas_Delete (image->ScaledImg);
|
||||||
|
image->ScaledImg = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (image->FilledImg)
|
||||||
|
{
|
||||||
|
TFB_DrawCanvas_Delete (image->FilledImg);
|
||||||
|
image->FilledImg = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
UnlockMutex (image->mutex);
|
UnlockMutex (image->mutex);
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ TFB_Prim_Stamp (STAMP *stmp, DrawMode mode, POINT ctxOrigin)
|
|||||||
if (!SrcFramePtr)
|
if (!SrcFramePtr)
|
||||||
{
|
{
|
||||||
log_add (log_Warning, "TFB_Prim_Stamp: Tried to draw a NULL frame"
|
log_add (log_Warning, "TFB_Prim_Stamp: Tried to draw a NULL frame"
|
||||||
" (Stamp address = %p)", stmp);
|
" (Stamp address = %p)", (void *) stmp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
img = SrcFramePtr->image;
|
img = SrcFramePtr->image;
|
||||||
@@ -180,7 +180,7 @@ TFB_Prim_StampFill (STAMP *stmp, Color color, DrawMode mode, POINT ctxOrigin)
|
|||||||
if (!SrcFramePtr)
|
if (!SrcFramePtr)
|
||||||
{
|
{
|
||||||
log_add (log_Warning, "TFB_Prim_StampFill: Tried to draw a NULL frame"
|
log_add (log_Warning, "TFB_Prim_StampFill: Tried to draw a NULL frame"
|
||||||
" (Stamp address = %p)", stmp);
|
" (Stamp address = %p)", (void *) stmp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
img = SrcFramePtr->image;
|
img = SrcFramePtr->image;
|
||||||
|
|||||||
@@ -1,2 +1,9 @@
|
|||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "heap/heap.h"
|
#include "heap/heap.h"
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
uqm_CFILES="heap.c"
|
uqm_CFILES="heap.c"
|
||||||
|
uqm_HFILES="heap.h"
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ Heap_new(HeapValue_Comparator comparator, size_t initialSize, size_t minSize,
|
|||||||
heap->minSize = minSize;
|
heap->minSize = minSize;
|
||||||
heap->minFillQuotient = minFillQuotient;
|
heap->minFillQuotient = minFillQuotient;
|
||||||
heap->size = nextPower2(initialSize);
|
heap->size = nextPower2(initialSize);
|
||||||
heap->minFill = (size_t) ceil(((double) (heap->size >> 1))
|
heap->minFill = ceil(((double) (heap->size >> 1))
|
||||||
* heap->minFillQuotient);
|
* heap->minFillQuotient);
|
||||||
heap->entries = malloc(heap->size * sizeof (HeapValue *));
|
heap->entries = malloc(heap->size * sizeof (HeapValue *));
|
||||||
heap->numEntries = 0;
|
heap->numEntries = 0;
|
||||||
|
|||||||
+11
-4
@@ -24,6 +24,10 @@
|
|||||||
#include "libs/uio.h"
|
#include "libs/uio.h"
|
||||||
#include "libs/unicode.h"
|
#include "libs/unicode.h"
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
extern BOOLEAN AnyButtonPress (BOOLEAN DetectSpecial);
|
extern BOOLEAN AnyButtonPress (BOOLEAN DetectSpecial);
|
||||||
|
|
||||||
@@ -49,9 +53,9 @@ UniChar GetLastCharacter (void);
|
|||||||
|
|
||||||
/* Interrogating the current key configuration */
|
/* Interrogating the current key configuration */
|
||||||
|
|
||||||
void InterrogateInputState (int template, int control, int index, char *buffer, int maxlen);
|
void InterrogateInputState (int templat, int control, int index, char *buffer, int maxlen);
|
||||||
void RemoveInputState (int template, int control, int index);
|
void RemoveInputState (int templat, int control, int index);
|
||||||
void RebindInputState (int template, int control, int index);
|
void RebindInputState (int templat, int control, int index);
|
||||||
|
|
||||||
void SaveKeyConfiguration (uio_DirHandle *path, const char *fname);
|
void SaveKeyConfiguration (uio_DirHandle *path, const char *fname);
|
||||||
|
|
||||||
@@ -59,5 +63,8 @@ void SaveKeyConfiguration (uio_DirHandle *path, const char *fname);
|
|||||||
|
|
||||||
void BeginInputFrame (void);
|
void BeginInputFrame (void);
|
||||||
|
|
||||||
#endif /* LIBS_INPLIB_H_ */
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* LIBS_INPLIB_H */
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ if [ "$uqm_GFXMODULE" = "sdl" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
uqm_CFILES="input_common.c"
|
uqm_CFILES="input_common.c"
|
||||||
|
uqm_HFILES="inpintrn.h input_common.h"
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
uqm_CFILES="input.c keynames.c vcontrol.c"
|
uqm_CFILES="input.c keynames.c vcontrol.c"
|
||||||
|
uqm_HFILES="input.h keynames.h vcontrol.h"
|
||||||
|
|||||||
@@ -18,8 +18,10 @@
|
|||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "input.h"
|
||||||
#include "../inpintrn.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/vcontrol.h"
|
||||||
#include "libs/input/sdl/keynames.h"
|
#include "libs/input/sdl/keynames.h"
|
||||||
#include "libs/memlib.h"
|
#include "libs/memlib.h"
|
||||||
@@ -218,13 +220,12 @@ TFB_SetInputVectors (volatile int menu[], int num_menu_, volatile int flight[],
|
|||||||
num_flight = num_flight_;
|
num_flight = num_flight_;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
#ifdef HAVE_JOYSTICK
|
||||||
TFB_InitInput (int driver, int flags)
|
|
||||||
|
static void
|
||||||
|
initJoystick (void)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
int nJoysticks;
|
int nJoysticks;
|
||||||
(void)driver;
|
|
||||||
(void)flags;
|
|
||||||
|
|
||||||
#if SDL_MAJOR_VERSION == 1
|
#if SDL_MAJOR_VERSION == 1
|
||||||
SDL_EnableUNICODE(1);
|
SDL_EnableUNICODE(1);
|
||||||
@@ -246,6 +247,8 @@ TFB_InitInput (int driver, int flags)
|
|||||||
nJoysticks = SDL_NumJoysticks ();
|
nJoysticks = SDL_NumJoysticks ();
|
||||||
if (nJoysticks > 0)
|
if (nJoysticks > 0)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
log_add (log_Info, "The names of the joysticks are:");
|
log_add (log_Info, "The names of the joysticks are:");
|
||||||
for (i = 0; i < nJoysticks; i++)
|
for (i = 0; i < nJoysticks; i++)
|
||||||
{
|
{
|
||||||
@@ -258,6 +261,23 @@ TFB_InitInput (int driver, int flags)
|
|||||||
}
|
}
|
||||||
SDL_JoystickEventState (SDL_ENABLE);
|
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 */
|
#endif /* HAVE_JOYSTICK */
|
||||||
|
|
||||||
in_character_mode = FALSE;
|
in_character_mode = FALSE;
|
||||||
@@ -271,7 +291,6 @@ TFB_InitInput (int driver, int flags)
|
|||||||
VControl_ResetInput ();
|
VControl_ResetInput ();
|
||||||
InputInitialized = TRUE;
|
InputInitialized = TRUE;
|
||||||
|
|
||||||
atexit (TFB_UninitInput);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,7 +347,7 @@ GetLastCharacter (void)
|
|||||||
|
|
||||||
volatile int MouseButtonDown = 0;
|
volatile int MouseButtonDown = 0;
|
||||||
|
|
||||||
void
|
static void
|
||||||
ProcessMouseEvent (const SDL_Event *e)
|
ProcessMouseEvent (const SDL_Event *e)
|
||||||
{
|
{
|
||||||
switch (e->type)
|
switch (e->type)
|
||||||
@@ -372,10 +391,12 @@ ProcessInputEvent (const SDL_Event *Event)
|
|||||||
|
|
||||||
if (Event->type == SDL_KEYDOWN || Event->type == SDL_KEYUP)
|
if (Event->type == SDL_KEYDOWN || Event->type == SDL_KEYUP)
|
||||||
{ // process character input event, if any
|
{ // 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;
|
UniChar map_key = Event->key.keysym.unicode;
|
||||||
|
|
||||||
if (k > num_keys)
|
if (k < 0 || k > num_keys)
|
||||||
k = num_keys; // for unknown keys
|
k = num_keys; // for unknown keys
|
||||||
|
|
||||||
if (Event->type == SDL_KEYDOWN)
|
if (Event->type == SDL_KEYDOWN)
|
||||||
@@ -494,11 +515,11 @@ TFB_ResetControls (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
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)
|
|| index >= MAX_FLIGHT_ALTERNATES)
|
||||||
{
|
{
|
||||||
log_add (log_Warning, "InterrogateInputState(): invalid control index");
|
log_add (log_Warning, "InterrogateInputState(): invalid control index");
|
||||||
@@ -531,13 +552,13 @@ InterrogateInputState (int template, int control, int index, char *buffer, int m
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
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];
|
char keybuf[40];
|
||||||
keybuf[39] = '\0';
|
keybuf[39] = '\0';
|
||||||
|
|
||||||
if (template >= num_templ || control >= num_flight
|
if (templat >= num_templ || control >= num_flight
|
||||||
|| index >= MAX_FLIGHT_ALTERNATES)
|
|| index >= MAX_FLIGHT_ALTERNATES)
|
||||||
{
|
{
|
||||||
log_add (log_Warning, "RemoveInputState(): invalid control index");
|
log_add (log_Warning, "RemoveInputState(): invalid control index");
|
||||||
@@ -545,23 +566,23 @@ RemoveInputState (int template, int control, int index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VControl_RemoveGestureBinding (g,
|
VControl_RemoveGestureBinding (g,
|
||||||
(int *)(flight_vec + template * num_flight + control));
|
(int *)(flight_vec + templat * num_flight + control));
|
||||||
g->type = VCONTROL_NONE;
|
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);
|
res_Remove (keybuf);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RebindInputState (int template, int control, int index)
|
RebindInputState (int templat, int control, int index)
|
||||||
{
|
{
|
||||||
VCONTROL_GESTURE g;
|
VCONTROL_GESTURE g;
|
||||||
char keybuf[40], valbuf[40];
|
char keybuf[40], valbuf[40];
|
||||||
keybuf[39] = valbuf[39] = '\0';
|
keybuf[39] = valbuf[39] = '\0';
|
||||||
|
|
||||||
if (template >= num_templ || control >= num_flight
|
if (templat >= num_templ || control >= num_flight
|
||||||
|| index >= MAX_FLIGHT_ALTERNATES)
|
|| index >= MAX_FLIGHT_ALTERNATES)
|
||||||
{
|
{
|
||||||
log_add (log_Warning, "RebindInputState(): invalid control index");
|
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 */
|
/* Remove the old binding on this spot */
|
||||||
RemoveInputState (template, control, index);
|
RemoveInputState (templat, control, index);
|
||||||
|
|
||||||
/* Wait for the next interesting bit of user input */
|
/* Wait for the next interesting bit of user input */
|
||||||
VControl_ClearGesture ();
|
VControl_ClearGesture ();
|
||||||
@@ -580,9 +601,9 @@ RebindInputState (int template, int control, int index)
|
|||||||
|
|
||||||
/* And now, add the new binding. */
|
/* And now, add the new binding. */
|
||||||
VControl_AddGestureBinding (&g,
|
VControl_AddGestureBinding (&g,
|
||||||
(int *)(flight_vec + template * num_flight + control));
|
(int *)(flight_vec + templat * num_flight + control));
|
||||||
*CONTROL_PTR(template, control, index) = g;
|
*CONTROL_PTR(templat, control, index) = g;
|
||||||
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);
|
||||||
VControl_DumpGesture (valbuf, 39, &g);
|
VControl_DumpGesture (valbuf, 39, &g);
|
||||||
res_PutString (keybuf, valbuf);
|
res_PutString (keybuf, valbuf);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
#ifndef INPUT_H
|
#ifndef INPUT_H
|
||||||
#define INPUT_H
|
#define INPUT_H
|
||||||
|
|
||||||
|
#include "port.h"
|
||||||
|
#include SDL_INCLUDE(SDL.h)
|
||||||
|
|
||||||
extern void ProcessInputEvent (const SDL_Event *Event);
|
extern void ProcessInputEvent (const SDL_Event *Event);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
* tragedy. */
|
* tragedy. */
|
||||||
|
|
||||||
typedef struct vcontrol_keyname {
|
typedef struct vcontrol_keyname {
|
||||||
/* const */ char *name;
|
const char *name;
|
||||||
int code;
|
int code;
|
||||||
} keyname;
|
} keyname;
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ static keyname keynames[] = {
|
|||||||
{"Unknown", 0}};
|
{"Unknown", 0}};
|
||||||
/* Last element must have code zero */
|
/* Last element must have code zero */
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
VControl_code2name (int code)
|
VControl_code2name (int code)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -213,12 +213,12 @@ VControl_code2name (int code)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
VControl_name2code (char *name)
|
VControl_name2code (const char *name)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
char *test = keynames[i].name;
|
const char *test = keynames[i].name;
|
||||||
int code = keynames[i].code;
|
int code = keynames[i].code;
|
||||||
if (!strcasecmp(test, name) || !code)
|
if (!strcasecmp(test, name) || !code)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,6 +17,6 @@
|
|||||||
#ifndef LIBS_INPUT_SDL_KEYNAMES_H_
|
#ifndef LIBS_INPUT_SDL_KEYNAMES_H_
|
||||||
#define LIBS_INPUT_SDL_KEYNAMES_H_
|
#define LIBS_INPUT_SDL_KEYNAMES_H_
|
||||||
|
|
||||||
char *VControl_code2name (int code);
|
const char *VControl_code2name (int code);
|
||||||
int VControl_name2code (char *code);
|
int VControl_name2code (const char *code);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ static void
|
|||||||
key_init (void)
|
key_init (void)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
int num_keys; // Temp to match type of param for SDL_GetKeyState().
|
||||||
pool = allocate_key_chunk ();
|
pool = allocate_key_chunk ();
|
||||||
for (i = 0; i < KEYBOARD_INPUT_BUCKETS; i++)
|
for (i = 0; i < KEYBOARD_INPUT_BUCKETS; i++)
|
||||||
bindings[i] = NULL;
|
bindings[i] = NULL;
|
||||||
@@ -1265,7 +1266,7 @@ VControl_ParseGesture (VCONTROL_GESTURE *g, const char *spec)
|
|||||||
parse_state ps;
|
parse_state ps;
|
||||||
|
|
||||||
strncpy (ps.line, spec, LINE_SIZE);
|
strncpy (ps.line, spec, LINE_SIZE);
|
||||||
ps.line[LINE_SIZE] = '\0';
|
ps.line[LINE_SIZE - 1] = '\0';
|
||||||
ps.index = ps.error = 0;
|
ps.index = ps.error = 0;
|
||||||
ps.linenum = -1;
|
ps.linenum = -1;
|
||||||
|
|
||||||
|
|||||||
@@ -16,5 +16,14 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "list/list.h"
|
#include "list/list.h"
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
uqm_CFILES="list.c"
|
uqm_CFILES="list.c"
|
||||||
|
uqm_HFILES="list.h"
|
||||||
|
|||||||
@@ -14,4 +14,12 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "log/uqmlog.h"
|
#include "log/uqmlog.h"
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user