Commit Graph

49 Commits (898b9c5d728d4f3c6530924c46d5b68dd3732e6c)

Author SHA1 Message Date
Dennis Schridde 9a5fd28e0c - More generic cleanup
- Reorder debug=yes CFLAGS so the -Wno- flags are at the end
- Make skybox float-uv aware


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1890 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-19 16:51:40 +00:00
Dennis Schridde 1f723e656c More cleanup...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1876 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-18 15:46:12 +00:00
Dennis Schridde 07a8031e94 Introduce PIE5 format.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1871 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-17 18:58:29 +00:00
Dennis Schridde bb61dd2eb0 static
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1796 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-03 14:07:31 +00:00
Dennis Schridde 6fa36aa0e9 + const, - unused
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1795 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-03 13:46:50 +00:00
Giel van Schijndel 12078733b8 * Fix usage of `new` which is both a) a keyword in C++, and b) an undescriptive variable name
* Make sure function overloading by a C++ compiler doesn't cause linker errors by declaring affected functions extern "C"

Patch by Christian Ohm (in message <20070523201048.GF3778@localdomain>);
 * applied changes to lib/ivis_common/imdload.c
 * brought linker errors to light caused by function overloading

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1695 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-23 20:57:11 +00:00
Dennis Schridde 057f140b6c Make MSVC happy
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1682 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-21 20:12:39 +00:00
Dennis Schridde 1014259054 This should enable floating point precision in IMD (.pie) files.
It should even render them as floats. I wasn't able to see a difference after modifying some PIE files, though.
This patch is heavily inspired by Watermelon's work. (Namely piefloat.patch)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1681 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-21 19:56:07 +00:00
Dennis Schridde 504126bda9 Forgotten cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1678 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-21 18:33:07 +00:00
Dennis Schridde b8f038d37a Cleanup IMD loader.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1677 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-21 18:25:46 +00:00
Dennis Schridde 01fea434fb Turn some sqrt() into sqrtf() where double precision is not needed.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1667 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 14:47:32 +00:00
Per Inge Mathisen b620f3f25f Remove all mention of non-existent type iVector
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1664 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 14:18:14 +00:00
Dennis Schridde 009b61447c - Remove unused code
- Remove duplicated code/macros
- VECTOR3D->Vector3i
- Create float variants of normal functions to simplify Watermelon's float-PIE patch


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1661 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 11:05:28 +00:00
Dennis Schridde e9cfca5bb2 - WORLD_COORD() and MAP_COORD() macros to make world->tile and tile->world conversions (>>TILE_SHIFT,<<TILE_SHIFT,*TILE_UNITS,/TILE_UNITS) better readable
- Remove unecessary copying and code duplication from drawTerrainTiles
- Remove more BSP and unused code
- pie_Pagename -> pie_MakeTexPageName
- pie_AddBMPToTexPages -> pie_AddTexPage
- Whitespace and formating
- Fix hardcoded SKY_TEXPAGE id, which depends on the loading order in the wrf file. Changed to string (filename).
- iTexPage.textPage3dfx -> iTexPage.id
- Prevent unecessary texpage switching in pie_DrawTexTriangle


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1548 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-28 20:21:16 +00:00
Per Inge Mathisen 4b36d353f2 Remove the unused iV_IMD_PSXTEX and iV_IMD_XTEX flags. The TYPE directive in
IMD files is now totally ignored.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1546 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-28 11:12:14 +00:00
Per Inge Mathisen b994a384c6 Simplify IMD loader code by removing support for IMD version 1 and the
unused NOTEXTURE directive. I believe the NOTEXTURE effect can be achieved
simply by not specifying a texture instead in more recent IMD versions.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1545 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-28 10:49:45 +00:00
Per Inge Mathisen 1b5cbb1c1e Remove flags from IMDShape since they were unused. Clean up IMD loader some
more. Remove unused GetLastHashName() and SetLastHashName().


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1544 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-28 10:36:21 +00:00
Per Inge Mathisen 69e282f30b Cleanup related to old BSP code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1537 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-24 20:15:41 +00:00
Per Inge Mathisen 534472ce72 Remove used but ineffectual BSP IMD code. BSP data from PIE files not yet removed.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1533 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 20:40:41 +00:00
Per Inge Mathisen 3f97cc51b7 Remove many unused IMD flags and an unused debug function.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1530 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 18:11:01 +00:00
Per Inge Mathisen 9e1d57e718 Permit compilation without binary space partitioning. To test this, comment out
the #define BSPIMD line in lib/ivis_common/ivisdef.h header.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1529 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 17:59:13 +00:00
Dennis Schridde 6d55622b75 Several changes to texture loading:
- Be safer with stringlengths
- Create "page-123" texpages in pie_Pagename(). This code is needed since WZ might have loaded a different variant of a texpage (-urban,-arizona,...) and thus can only find it by the common "page-123" part
- Output filename on errors in in PNG loading
- Be a little bit less forgiving for wrong case
- Convert all TEXTURE references in PIE files to lowercase and replace 'fx`s' with 'fx', also replace 'urban area' and 'bases urban' with just 'urban' to keep consistency


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1505 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-19 18:04:41 +00:00
Dennis Schridde ce16856887 FREE->free, MALLOC->malloc (sed+review)
This patch will create crashes where the code expects FREE to set the pointer to NULL! (Those problems should be fixed anyway.)
The only occassion where I saw this is when quiting a game, so it is not too much of an issue.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1459 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-15 10:43:05 +00:00
Dennis Schridde e8da218797 Of course we need to leave room for ".png\0"...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1439 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-11 14:58:50 +00:00
Dennis Schridde 3cdae4332f - Fix a possible invalid write caused by writing up to 80 chars into a 64 char array.
The texture file in PIE files can now be up to MAX_PATH chars long.
- Find the reason for WZ discarding everything after the number in "page-123" styled texture references.
	This led to the problem with Grim's mod referencing the skybox texture instead of his own wall texture.
- Beautify some code


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1438 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-11 14:55:54 +00:00
Giel van Schijndel 26f2672bfd * remove macro PTRVALID
* replace all instances of PTRVALID(ptr,size) by (ptr != NULL)
 * remove asserts of style ASSERT( x == NULL || x != NULL ) because they would evaluate to true always anyhow and as such wouldn't ever trigger
 * remove macros iV_HeapAlloc and iV_HeapFree and replaced them with MALLOC and FREE respectively (that's what they expanded to anyway)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1348 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-03 13:20:41 +00:00
Giel van Schijndel 902400c774 Warning fixes:
* NULL assignment to a non-pointer -> changed to assignment of 0
 * remove unused variables
 * remove empty function drawEffects (and a commented out line that called it)
 * Fix implicit declaration (of war_GetFog and war_SetFog) by including warzoneconfig.h

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1287 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-27 17:53:48 +00:00
Gerard Krol a4c540f24a New shadow code, easier on the fillrate of your graphics card, but uses
more cpu time. Buildings have static shadows, the shadows of 
components/droids get recomputed every frame. Rain/bullets/other effects 
do no longer drop a shadow.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1281 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-24 22:53:18 +00:00
Stefan Huehner 57674e3545 Minor cleanup.
Remove some unsused vars,function,prototypes



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1253 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-16 20:08:23 +00:00
Dennis Schridde 2a74242eb3 - Replaced various vectors with Vector3i and Vector3f (idea by Watermelon)
- Vector3i from lib/ivis also used in lib/audio, maybe want to move it to some more generic place?
- Replace iPoint with Vector2i
- Remove additional integer type declarations from pietypes.h
- Rename all iSprite to iTexture
- Various warning fixes: Unsigned/signed comparisons, uninitialized variables, declared but not defined symbols
- Replace DEBUG_BLOCK with DEBUG_MALLOC (it was virtually the same)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1245 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-16 16:20:16 +00:00
Dennis Schridde b7ccc234b3 - Remove unused type from pietypes.h
- Replace iBool with BOOL where it was used
- Fix a warning in src/effects.c about validatePie being declared but not defined


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1241 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-15 22:49:54 +00:00
Per Inge Mathisen 9a0d08f699 Clean up IMD loading, informed by -Wextra, removing lots of redundant and
unused code. Also add -Wno-unused-label to Makefile.raw builds, too, to
skip the warning generated by flex that we cannot fix.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1148 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 17:37:11 +00:00
Per Inge Mathisen f5b266c722 Remove excess conversion to lowercase of imd filenames and function
to do so.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1130 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-16 22:49:56 +00:00
Per Inge Mathisen b46d680987 Remove lib/ivis_common/bug.c|.h, containing unused logging
functions of dubious usefulness. The log calls are still
present, with protos in ivi.h, in case someone wants to
build something better with them.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1128 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-16 22:31:52 +00:00
Dennis Schridde 49ceba7503 Add GPL notices to all sourcecode files.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1014 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-15 20:09:25 +00:00
Dennis Schridde 4e28453441 src/* and lib/ivis_common/piemode.h by me: Cleanup unused functions.
Rest: Patch by Giel van Schijndel: codecleaning patch: lets delete stuff


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@939 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-29 19:56:06 +00:00
Dennis Schridde d3cd44148d Patch by Gerard Krol: Replace STRING with char (STRING was confusingly defined to char)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@804 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-03 21:35:50 +00:00
Dennis Schridde 4ea12897a5 - Replaced all filenames (I could find) with their lowercase and platform independed notation. There might be some uppercase filenames left in the sourcecode.
- Because savegame filenames are converted to lowercase old savegames won't work anymore. You can simply fix that by renaming them to lowercase.
- All unix_path, unix_fopen and PHYSFSEXT_locateCorectCase functions and calls to them have been removed. (So you _will_ notice when a file is not found, at least on Unix systems.)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@776 4a71c877-e1ca-e34f-864e-861f7616d084
2006-10-07 14:13:47 +00:00
Dennis Schridde a135ae55be Forgotten in last commit
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@748 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-23 15:38:24 +00:00
Dennis Schridde 912cf2c8e2 Partially revert r739.
SDL < 1.2.10 doesn't define the string function wrappers.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@747 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-23 14:56:18 +00:00
Dennis Schridde d39f787caf - Enforce floats in several places
- Define WORD and BYTE types to SDL types
- Let SDL handle some more of the win32fixes


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@739 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-20 19:46:33 +00:00
Stefan Huehner 1395a7c69c Make some more functions static which aren't used outside their
declaring source files and which have no prototype.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@731 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-19 18:45:48 +00:00
Dennis Schridde d889ce9da7 Patch by Christian Ohm: "g++ fixes"
Mainly explicit casts, some type changes, a few fixes.

We need to have a look if this line creates any problems:
lib/script/interp.c @@ -329,7 +329,7 @@
- if(!RetStackRemember(CurEvent, (ip + 2)))       //Remember where to jump back later
+ if(!RetStackRemember(CurEvent, *(ip + 2)))      //Remember where to jump back later


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@719 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-17 20:39:25 +00:00
Dennis Schridde 0e288f45e7 - Replace all ASSERT(( )) with ASSERT( )
- Simplify definition of ASSERT(). Now is the same for GCC and MSVC.
  This may not work on versions older than MSVC 2005. If you experience this, please report it!

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@613 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-23 12:58:48 +00:00
Dennis Schridde f4d639b8e4 Cleanup redefinitions of inline and strcasecmp on MSVC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@611 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-22 23:32:18 +00:00
Dennis Schridde 62ae49b0ce Replaced all occurences of DBMB, DBPRINTF and DBERROR with their former define.
( DBPRINTF(("Message")); becomes debug( LOG_NEVER, "Message" ); )



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@608 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-22 14:28:49 +00:00
Per Inge Mathisen 6d8b190950 Make SBYTE explicitly a signed char, not just a char. This would have broken
some things on platforms where 'just char' means unsigned char. Fix lots of
new signedness warnings resulting from that fix (which would have cropped
up on unsigned char platforms anyway). Also implement a small subset of
stdint.h for windows platform in frame.h, hope this does not create any
conflicts. This allows us to use types like uint64_t where relevant.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@569 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-15 18:20:36 +00:00
Dennis Schridde 5175535d9d Full pathname includes
Same as in r431, but now for lib/
- converted the sources in lib/ to use full path includes instead of just the filename.
- marked places where lib/ivis_*implementation* (eg opengl) is needed, because of incomplete lib/ivis_common.

Should improve the understanding of interfaces and code organization.

(Also fixed a double slash (//) include in src/multimenu.c)



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@432 4a71c877-e1ca-e34f-864e-861f7616d084
2006-06-02 19:34:58 +00:00
No Author 5ba7ddac6b Create final repository structure.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@362 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-28 17:47:08 +00:00