Commit Graph

1927 Commits (623ac960aed6c4f9fe17999e280699f7b2f6638c)

Author SHA1 Message Date
Giel van Schijndel 2fcc6e82c2 * Use std::istream instead of FILE* for PCXHandler::ReadPCX
* Change private member functions of PCXHandler; EncodedGet, EncodeLine and EncodedPut into static, inline, non-member, utility functions (EncodedGet now also works with std::istream)
 * Use std::string for the composition of strings, rather than some char[] buffer and strcpy + strcat

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2196 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-26 00:18:21 +00:00
Dennis Schridde 6b8e636fc3 Revisit data loading (image/texture related) and remove unecessary fVertex pietype.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2195 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-25 22:37:48 +00:00
Per Inge Mathisen ad5900b2ed Fix crash in design screen if we draw a weapon component that is really really big.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2194 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-25 22:17:04 +00:00
Dennis Schridde 75d5e135c5 Remove some useless comments for iIMDShape, also remove some unnecessary fields and variables.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2193 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-25 20:58:57 +00:00
Per Inge Mathisen 898b9c5d72 Move a lot of code around for cleanup.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2192 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-25 15:31:27 +00:00
Giel van Schijndel ecbd74b04f * Revert r2167 since this workaround is no longer required anymore with NSIS versions > 2.25
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2191 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-25 15:14:54 +00:00
Giel van Schijndel 06afa3c7a0 * Less violation of encapsulation: use private instead of protected (since we don't need access to these members anyway; plus we don't inherit from these classes ATM)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2190 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-25 14:58:16 +00:00
Per Inge Mathisen c6190a85f2 More cleanup. More debug log message. Send player ID as a single char instead
of the old pointer casting with alignment issues.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2189 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 19:33:46 +00:00
Per Inge Mathisen 0cb6023b76 Clean up source and add comments to explain what is going on.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2188 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 18:59:57 +00:00
Giel van Schijndel f54618b6c4 * Remove files gateinterface.* which basically where a C<->C++ interface to the gateway* files (these are now C++ files)
* Move previous interface functions into gateway.cpp

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2187 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 18:49:29 +00:00
Giel van Schijndel 5a9cc58788 * Fix yet some more dependencies in header files
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2186 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 18:44:18 +00:00
Per Inge Mathisen 5d0a52460d Remove NETsetMessageSize
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2185 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 18:25:33 +00:00
Per Inge Mathisen 1df2199ce8 Remove final pieces of encryption code. Warning: This touches some seriously
unstable code. Bugs may follow!


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2184 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 18:22:04 +00:00
Giel van Schijndel 2e28b1926a * Fix some header dependencies
* Indent class CHeightMap in a more readable manner

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2183 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 18:05:32 +00:00
Giel van Schijndel c05b65d532 * Fix compile error by including dependent header (<windows.h>: ugh)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2182 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 17:43:48 +00:00
Giel van Schijndel 4c7f823d2f Cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2181 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 17:34:28 +00:00
Giel van Schijndel 91b10bd4db * Modify function IsPower2 into a static inline
* Make IsPower2 take advantage of the mathematical properties that a number which is a power of two has (which is that a number which is a power of two minus one has _no_ matching bits with the number that is power of two); this severely decreases the complexity of this function (previous one looped over all bits)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2180 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 16:51:17 +00:00
Giel van Schijndel d48c7f67a4 * Make C file gatewaysup.c a C++ file gatewaysup.cpp
* Remove macro MALLOC
 * Use reinterpret_cast for the malloc stuff

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2179 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 15:49:19 +00:00
Giel van Schijndel b06b660b6a * Remove all stuff which wasn't compiled when EDITORWORLD is not defined; also remove the macro EDITORWORLD itself
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2178 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 15:34:39 +00:00
Giel van Schijndel 9a630f45f5 * Turn C file gateway.c into C++ file gateway.cpp
* Turn linked list macro LIST_REMOVE into inline function list_remove
 * Remove macro MALLOC and use malloc instead (MALLOC was defined as malloc anyway)
 * Replace some UBYTEs with chars

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2177 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 15:14:50 +00:00
Giel van Schijndel 763d707f02 * Fix warning about implicit declaration of memset
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2176 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 15:08:29 +00:00
Giel van Schijndel 2b00b2e4c1 * Add svn:keywords
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2175 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 14:54:31 +00:00
Giel van Schijndel 20a03d68cc * Add GPL header (which apparently I forgot on this file)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2174 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 14:53:22 +00:00
Giel van Schijndel 1ec5cc8fb2 * Remove unused parameter `bool Flip` from BMPHandler::WriteBMP (only it's default value "false") was used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2173 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 13:36:18 +00:00
Giel van Schijndel 7873df53f1 * Remove unused member functions from class BMPHandler: ReadBMP, Clear, GetBitmapWidth and GetBitmapHeight
* Remove unused BMP palette code, since obviously we're not using it
 * Remove two other unused parameters from BMPHandler::Create: `void* Bits`, `bool Is555`

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2172 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 13:25:33 +00:00
Giel van Schijndel e94d4a1e5a * Forgotten in last commit: removal of parameter from calling function
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2171 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 12:56:07 +00:00
Giel van Schijndel 76fe009e44 * Change protected section of class BMPHandler to a private section
* Remove unused parameter PALETTEENTRY* Palette from function BMPHandler::Create
 * Change BMPHandler::GetBitmapWidth's return value to `unsigned int`
 * Use std::vector for an "array" of PALETTENTRYs instead of a plain array
 * Add a type CopyAblePALETTEENTRY which's definition is similar to PALETTEENTRY; with as difference that it has a copy assignment operator (so that we can use this type with std::copy, and other algorithms from the Standard Library)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2170 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 12:52:10 +00:00
Per Inge Mathisen 84a6541f53 New weapon connectors on the dragon body for two weapons by Grim Moroe.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2169 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 12:17:27 +00:00
Giel van Schijndel 3f342f72a9 * Fix spelling error in MSVC project file (got there due to my manual conversion probably)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2168 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 12:05:07 +00:00
Giel van Schijndel e89edb7fbb * Use forward slashes for commandline arguments to makensis.exe because NSIS uses forward slashes on windows, while it uses dashes on GNU/Linux; (doh! inconsistencies aren't good!)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2167 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 12:00:21 +00:00
Giel van Schijndel ed12db0b4f * The raw makefile system (wrongly) depended upon the GNU FileUtils ("rm" to be precise);
* we now use "$(RMF)" (which expands to "del /f") instead of "$(RM)" (which expands to "rm -f")

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2166 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 11:54:36 +00:00
Giel van Schijndel d3628a0d11 * Don't use (void) as argument list for functions anymore; with C++ this is implicit when using (), a variadic function has to be explicitly declared using (x, y, ...)
* Replace BOOL, TRUE and FALSE with bool, true and false respectively
 * Use the initializer list of the constructor instead of its function body for member variable initialization
 * Replace usage of "operator delete" with "operator delete []" where the respective pointer had its memory allocated using "operator new []" (not doing so may cause heap corruption)
 * Don't if (pointer != NULL) delete pointer; since delete NULL is a valid no-op.
 * declare variables in a more local scope
 * Use algorithms instead of custom implementations; e.g. std::swap rather than { tmp = x; x = y; y = tmp}
 * Use reintrepret_cast<T> at some places instead of a C style cast, since these casts are really bad in this case (i.e. unnecessary), but they're easier to recognize this way

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2165 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-23 14:51:22 +00:00
Per Inge Mathisen 2e24b34ef7 Fix oil animation. Enable "kill" and "get off my land" cheats in single
player skirmish.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2164 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-23 11:30:26 +00:00
Per Inge Mathisen 59768447c6 Remove some overzealous asserts
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2163 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-23 10:47:26 +00:00
Per Inge Mathisen ca6d31dc6c Remove unused POWER_STATS
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2162 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-22 13:22:01 +00:00
Per Inge Mathisen fcc8c41fe9 Hide share research and share vision buttons in intelligence dialog when in
locked teams mode. Patch #773.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2161 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-22 11:34:34 +00:00
Per Inge Mathisen dcfe102699 Fix bug in removal of baba player in campaign if too many human players.
Also add some fallback in case server sends us a bad player number.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2160 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-22 11:12:50 +00:00
Per Inge Mathisen d94d7ea9ea Remove force editor. Nice widget, but nobody knew what to do with it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2159 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-21 17:22:30 +00:00
Per Inge Mathisen f9a3adeaba Rename multiplayer game mode "Campaign" to "Mayhem" mode. Remove possibility
of alliances in this mode, and always add scavengers. Note that this mode
will not work if there are eight human players, and I do not know exactly
what will happen in this case. A check to remove scavengers has been added, 
but not tested. The problem is of course that scavengers need a player, too.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2158 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-21 16:44:38 +00:00
Per Inge Mathisen cc17f21df5 Remove templay related code in scripts. Sorry for breaking skirmish for a few minutes :)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2157 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-21 16:41:53 +00:00
Per Inge Mathisen 45b4dfb7b7 Remove unused "death match" game mode code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2156 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-21 15:52:33 +00:00
Per Inge Mathisen ac131d745f Remove separate "team play" game mode. We now have proper team play
functionality in the skirmish game mode, so it is not necessary.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2155 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-21 15:39:00 +00:00
Roman C 2cce50c2ad Allow to disable all AIs in a multiplayer game with more than 1 human.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2154 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-21 14:18:40 +00:00
Giel van Schijndel 46a2f0ade2 * Remove some rather useless debugging printf statements
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2153 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-21 14:12:49 +00:00
Roman C 8fdfad5a67 Fix the second file checking end condition from the mp folder.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2152 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-21 13:16:56 +00:00
Roman C 74c29b312f Fix end condition checking for the multiplayer campaign game mode.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2151 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-21 13:13:21 +00:00
Per Inge Mathisen 74af7fefa1 Clean up missionDestroyObjects() and ensure that projectiles are free()d there.
Make sure that "let me win" cheat works again by fixing assert when grid is
updated with the base (non-off-world) units.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2150 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-19 22:15:17 +00:00
Per Inge Mathisen e3b98734d5 Fix crash when loading savegames and animations are not properly cleaned up first.
This is similar to the fix in r2050.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2149 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-19 21:15:22 +00:00
Per Inge Mathisen 77bc1dfd1d Fix bug #9542. Check that projectiles are within the map before updating them.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2148 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-19 20:30:53 +00:00
Roman C a23b19137f Added some commander templates for the ai.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2147 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-19 19:31:03 +00:00