Deletion suggested by Buginator. This should fix bug #12136
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5777 4a71c877-e1ca-e34f-864e-861f7616d084
* Reduce the nesting inside Init_FBO
* Bail out of Init_FBO as soon as we discovered that FBOs are unavailable
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5771 4a71c877-e1ca-e34f-864e-861f7616d084
* Restore the empty lines removed in r5732
* Add a note to GAMESTRUCT containing a list of elements that need to be updated when GAMESTRUCT's definition changes
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5770 4a71c877-e1ca-e34f-864e-861f7616d084
* Fix indentation
* Don't repeat function prototypes in their pre-leading comments
* "Upgrade" some function comments to Doxygen comments
* Remove whitespace from the end of lines
* Reintroduce empty lines removed in r5733
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5769 4a71c877-e1ca-e34f-864e-861f7616d084
* Rename audio_Get3DPlayerRotAboutVerticalAxis to audio_GetPlayerOrientation and change it to return two Vector3f's with a forward and upward pointing vector in it (which can be directly used by OpenAL)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5763 4a71c877-e1ca-e34f-864e-861f7616d084
* Use Vector3f_Mult to multiply all members with some number instead of doing it manually
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5762 4a71c877-e1ca-e34f-864e-861f7616d084
* Update the autotools, win32 makefiles, Code::Blocks and MSVC build systems
NOTE: Xcode will need an update for this
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5761 4a71c877-e1ca-e34f-864e-861f7616d084
* Vector3f_ToRadians to convert a rotation vector (Euler angles) from degrees to radians
* Vector3iPSX_To3fDegree to convert the PSX "wannabe-float" degree vectors into a vector of ''real'' floats, with ''real'' degrees (i.e. 360 is completely round, instead of 65536 representing that)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5745 4a71c877-e1ca-e34f-864e-861f7616d084
This allows players to get to the correct starting position on the map they picked, much easier.
Note, this uses a FBO. If your card doesn't support it, then you will basically notice nothing different. A fallback routine is done (but not in this patch), it is just waiting for a decent font *bitmap* that we can use.
Please see http://forums.wz2100.net/viewtopic.php?f=19&t=1953 for more discussion on the matter.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5733 4a71c877-e1ca-e34f-864e-861f7616d084
* At the only place where these ID numbers where used (scrValDefSave and scrValDefLoad), use the key-string instead (e.g. "ZNULLBODY" instead of 17)
* Rename function strresGetStringByID to strresGetString
* Increment event save file version to 4 (version of savegame.es files)
* Reject loading of savegames that need to load non-NULL ST_TEXTSTRING variables from version < 4
NOTE: This may break current savegames of games that use scripts with variables of type TEXTSTRING in them (AFAIK currently only ''some'' campaign and tutorial savegames have these).
This closes ticket:19
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5685 4a71c877-e1ca-e34f-864e-861f7616d084
* Don't maintain a secondary linked list of strings in strres.c
* Add the string that's tracked and it's ID number to the TREAP_NODE structure
* Let the treap code manage its own memory
* Have the treap code perform reverse lookups using either the resource string (i.e. not the "key" string) or associated ID number
NOTE: Searching a treap for anything else than the key is O(n), but that's no worse than a linked list, which is O(n) as well. Walking a treap has O(log n) as memory requirement, whereas walking a linked list has O(1) as memory requirement (stack size). So the only disadvantage is that searching the treap has a (highly remote!) possibility of stack overflows.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5666 4a71c877-e1ca-e34f-864e-861f7616d084
* Replace the only use of strresGetIDString with a call to function strresGetStringByID, which will also return NULL on failure to find the given ID string
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5663 4a71c877-e1ca-e34f-864e-861f7616d084
* Get rid of function strresGetIDNum with its inconvenient API and use strresGetStringByID instead
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5661 4a71c877-e1ca-e34f-864e-861f7616d084
* Instead use strdup() where a non-const reference to these strings is used
* NOTE: This may introduce memory leaks, but I'd rather have memory leaks than double-frees, of which I'm frankly surprised that they don't occur ''much'' more often
* Change FindDroidTemplate to take its parameter as const
* Don't multi-purpose the parameters of FindDroidTemplate as local variables
* Store string variables in getName as const
* scrvGetString:
* Directly return the string it retrieved and use NULL to indicate failure
* Return the string as `const'
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5658 4a71c877-e1ca-e34f-864e-861f7616d084
* Allocate STR_ID structures in such a way that a single free() call on it will suffice as cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5657 4a71c877-e1ca-e34f-864e-861f7616d084
* Change allocateName to do as the name suggests and actually ''allocate'' a string!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5656 4a71c877-e1ca-e34f-864e-861f7616d084
* Instead pass the current STR_RES* pointer to work on to the parser function
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5654 4a71c877-e1ca-e34f-864e-861f7616d084
In any case I ''think'' these ASSERTs always hold true, (and for the testing I've done so far they do). But I'd like some more certainty and confirmation, hence why I'm committing this (before I make changes that rely on that assertion holding true), so other people get a chance to test this and prove my assertion wrong.
Thus, ''if'', these ASSERTs are triggered, please open a bugreport or otherwise notify me of it (e-mail, IRC, text message, postal mail, phone call, etc.)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5649 4a71c877-e1ca-e34f-864e-861f7616d084
* win32 Makefile system:
* Compile with debug symbols and all warnings enabled on both debug ''and'' non-debug builds
* Only use -Werror-implicit-function-declaration when compiling C sources, as for C++ implicit function declarations are illegal anyway (and g++ thus doesn't like this compiler option)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5647 4a71c877-e1ca-e34f-864e-861f7616d084
* Add a forward declaration for STR_RES to strres.h (so that we can still declare pointers to this type)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5645 4a71c877-e1ca-e34f-864e-861f7616d084
* Return the STR_RES* pointer from strresCreate and use NULL to indicate failure
* Use size_t to store memory sizes in instead of UDWORD
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5644 4a71c877-e1ca-e34f-864e-861f7616d084
* Use calloc instead of a malloc followed by memset(0)
* Check the return value from malloc&calloc for ''all'' invocations of it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5643 4a71c877-e1ca-e34f-864e-861f7616d084
* Use an unsigned int instead of UDWORD as we don't depend on the size guarantee
* Move the definition of aUsage into #ifdef DEBUG_CHECK_FOR_UNUSED_STRINGS, because that's the only place where it's used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5630 4a71c877-e1ca-e34f-864e-861f7616d084
* Replace use of the forwarding macro TREAP_ADD with a direct call to treapAdd
* Remove treap debugging code (actually that's what the above changes effectively accomplished)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5627 4a71c877-e1ca-e34f-864e-861f7616d084
* Replace use of the forwarding macro TREAP_CREATE with a direct call to treapCreate
* Return the TREAP* pointer directly from treapCreate and use NULL as an indicator for failure
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5626 4a71c877-e1ca-e34f-864e-861f7616d084
* Change the Windows locale list to allow specifying sublanguages as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5598 4a71c877-e1ca-e34f-864e-861f7616d084
Because the treap management code is only used by the code for string resources, make it specific for these string resources and don't use casting back & forth from void* all over the place. This simplifies the interaction of string resource code with treap code.
This will allow an easier cleanup and eventually a removal of string resource code. As the string resource code can eventually be replaced with gettext code instead.
This closes#18
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5586 4a71c877-e1ca-e34f-864e-861f7616d084
This fixes bug #12047 (assert failure as soon as you open one of the design/manufacture/construct/research windows)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5583 4a71c877-e1ca-e34f-864e-861f7616d084
* Add a new function dbgDumpLog to dumpinfo.cpp for dumping the last debug messages
* Add a debug output callback to dumpinfo.cpp which is used to fetch the debug messages and store them in a ring buffer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5581 4a71c877-e1ca-e34f-864e-861f7616d084
* Replace uses of strncmp, snprintf and vsnprintf with sstrcmp, ssprintf and vssprintf respectively
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5579 4a71c877-e1ca-e34f-864e-861f7616d084
* In widgSetTabs depend on functions widgGetNumTabMajor and widgGetNumTabMinor respectively instead of duplicating their code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5573 4a71c877-e1ca-e34f-864e-861f7616d084
use the texture rectangle extension to draw the radar window, which should be
supported on even the oldest OpenGL-capable hardware out there.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5562 4a71c877-e1ca-e34f-864e-861f7616d084
* Don't strdup strings retrieved from __FILE__ directives; just store const char* the pointer instead (prevents a memory leak as well)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5549 4a71c877-e1ca-e34f-864e-861f7616d084
* Declare these functions with static linkage instead.
* Update autotools buildsystem, Code::Blocks project and MSVC project, raw win32 Makefiles don't need an update
NOTE: This may require updating of buildsystems not mentioned above
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5544 4a71c877-e1ca-e34f-864e-861f7616d084
* Use a forward declaration in strres.h to declare a pointer to a TREAP instead of importing the full treap.h declarations in strres.h and thus large portions of the codebase
* Rename TREAP's forward declaration name from _treap to TREAP
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5543 4a71c877-e1ca-e34f-864e-861f7616d084
* Update build systems: autotools, raw win32 makefiles, Code::Blocks project and MSVC project
* Rename _droid and _base_object forward declaration types to DROID and BASE_OBJECT respectively
* Add two forward declarations for BASE_OBJECT and DROID to scriptfuncs.h so that it can declare pointers to these types
* src/messagedef.h depends on lib/ivis_common/ivisdef.h and src/positiondef.h so #include those
* Don't #include stuff from src/ in lib/script/chat_processing.h
* Remove all unnecessary #inlucdes from src/ from lib/script/chat_lexer.l
NOTE: Build systems not mentioned above might need updating.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5531 4a71c877-e1ca-e34f-864e-861f7616d084
had a little bug of its own, that made player 3, 5, and 7 drop instead. Fixed!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5521 4a71c877-e1ca-e34f-864e-861f7616d084
an integer value. This fixes the problem of AL_INVALID being used for
invalid values, while it is really a perfectly valid ID for a sample.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5426 4a71c877-e1ca-e34f-864e-861f7616d084
currently impossible case of the sample not being in the active list.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5425 4a71c877-e1ca-e34f-864e-861f7616d084
Clean scriptFreeCode's formating and remove unnecessary checks for ptr!=NULL before freeing.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5400 4a71c877-e1ca-e34f-864e-861f7616d084
* Flush the write end of the pipe after writing all GDB commands into it
* Process the return data (both return value and the contents of the output integer) from waitpid()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5390 4a71c877-e1ca-e34f-864e-861f7616d084
* return as soon as an error condition is detected, thus preventing the need for deep nested if-branches.
* Add some additional comments
* Return true or false, false indicating an error, true indicating success
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5389 4a71c877-e1ca-e34f-864e-861f7616d084
* Instead compile that code on all platforms except for the given one (Mac OSX)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5385 4a71c877-e1ca-e34f-864e-861f7616d084
With our current backtrace dumps I quite oftenly find that in case of segfaults, which combined with assert failures are the most common crash cause, I cannot easily see what value the dereferenced pointer held.
To be able to see this the exception handler will now invoke the "disassemble" and "info registers" commands when producing a back trace using GDB. This gives us the ability to see the precise assembly instruction that triggered the crash, together with the value of the register that was used as pointer.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5352 4a71c877-e1ca-e34f-864e-861f7616d084
Exception is when generating the .wz files, where we need the path to the build directory and building a reverse relative path to $(srcdir) will be messy.
Also silence submake.mk a great deal.
Bug #11883 should be fixed now for the most part.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5325 4a71c877-e1ca-e34f-864e-861f7616d084
Their use is currently flawed, since it will not work in directories with spaces in them... (
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5319 4a71c877-e1ca-e34f-864e-861f7616d084
- Use PACKAGE, PACKAGE_VERSION, remove VERSION
- Allow out-of-source-dir builds (mkdir build && cd build && make -f ../Makefile.raw)
- Move config.mk from $(top_srcdir)/makerules/config.mk to $(top_builddir)/config.mk
When keeping current behaviour (srcdir=builddir), this means: Move it from makerules into the main directory
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5308 4a71c877-e1ca-e34f-864e-861f7616d084
* Remove now double variable filename and rename line_buf to filename
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5291 4a71c877-e1ca-e34f-864e-861f7616d084
The playlist file is no a simple list of files to play during the game.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5281 4a71c877-e1ca-e34f-864e-861f7616d084
(which is now created by default). Someone should look more carefully at
this code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5262 4a71c877-e1ca-e34f-864e-861f7616d084
This breaks network compatibility with everything older than this commit.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5234 4a71c877-e1ca-e34f-864e-861f7616d084
* Add a new colour: WZCOL_MENU_SHADOW
* Use this colour instead of WZCOL_MENU_BACKGROUND to create a "Black shadow"
Closes#11; patch by Buginator
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5201 4a71c877-e1ca-e34f-864e-861f7616d084
* Assume __all__ windows builds use Bison 2.1 (this isn't correct, but it's the best I can currently do, as Bison provides no version macros aside from a string macro)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5196 4a71c877-e1ca-e34f-864e-861f7616d084
* "table" will now attempt to load the given resource type from the given table (in the currently opened database)
* Maintain the current database's name (for error message, etc.)
* Pass the table name to the database loading functions and use it (in combination with sqlite3_mprintf) to produce the SQL statements
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5189 4a71c877-e1ca-e34f-864e-861f7616d084
* Add two new keywords to the .wrf files: "database" and "table"
* "database" will cause the given filename to be opened as a database file (using SQLite3)
* "table" will attempt to load the given resource type from the currently opened database
* Don't open the database in the file loading functions (src/data.c) anymore; turn them in table loading functions instead (which get the current database passed as a paramter)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5188 4a71c877-e1ca-e34f-864e-861f7616d084
This fixes a bug with maps smaller than max visible tiles area which would
either crash or create seams, re-reported by Buginator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5134 4a71c877-e1ca-e34f-864e-861f7616d084
- Set() functions for Vector3i and 3uw
- Add() for Vector3i
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5103 4a71c877-e1ca-e34f-864e-861f7616d084
* Use these functions in cdaudio.c to change the volume of the currently playing AUDIO_STREAM in function sound_SetMusicVolume
This fixes bug #11579 ("Music volume slider dont work")
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5101 4a71c877-e1ca-e34f-864e-861f7616d084
* Make sure that this heap memory __will__ be released regardless of syntax errors during scanning
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5097 4a71c877-e1ca-e34f-864e-861f7616d084
* Add a new subrule `looping` and use that in rule audio_track instead of duplicating two code paths for audio_track
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5096 4a71c877-e1ca-e34f-864e-861f7616d084
* Get rid of lexer function parseGetErrorData and use audp_get_lineno() and audp_get_text() instead
* Add a WZ_DECL_FORMAT declaration to audp_error to enable GCC's printf format checking
* In audp_error allocate the buffer on the stack using alloca() instead of an auto 1kB text buffer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5094 4a71c877-e1ca-e34f-864e-861f7616d084
* Make sure that this heap memory __will__ be released regardless of syntax errors during scanning
* Reduce code duplication in strres_parser.y by reducing a single parsing rule with duplicated code up into two rules
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5085 4a71c877-e1ca-e34f-864e-861f7616d084
* Get rid of lexer function strresGetErrorData and use strres_get_lineno() and strres_get_text() instead
* Don't call abort() in function strres_error as the parser will return an error anyway (causing strresLoad to return false)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5084 4a71c877-e1ca-e34f-864e-861f7616d084
* Don't bother to check whether we're in a comment when reaching the end of a string resource file
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5083 4a71c877-e1ca-e34f-864e-861f7616d084
* Make sure that this heap memory __will__ be released regardless of syntax errors during scanning
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5079 4a71c877-e1ca-e34f-864e-861f7616d084
* Lets __not__ use very bad practices just because we can!!! Make it static again
* Give strres_lexer.l such an array of its own (static as well)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5077 4a71c877-e1ca-e34f-864e-861f7616d084
* Don't call abort() in function res_error as the parser will return an error anyway (causing resLoad to return false)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5073 4a71c877-e1ca-e34f-864e-861f7616d084
* Don't add the function name to the debug message in openLoadFile as debug() does that itself already
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5072 4a71c877-e1ca-e34f-864e-861f7616d084
* Update file-level comment for chat_lexer.l for the change in r899 (i.e. the flex option `-i` doesn't need to be specified anymore)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5059 4a71c877-e1ca-e34f-864e-861f7616d084