Commit Graph

173 Commits (345b1d6106391c24e8eba08cbab2fb72028babdf)

Author SHA1 Message Date
Giel van Schijndel d55bd507c6 * Remove unused parameter char* DisplayBuffer from function pie_UploadDisplayBuffer (maybe we might as well remove this function altogether ?)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1986 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-27 12:30:29 +00:00
Dennis Schridde cc2294112b Clean my WC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1894 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-19 18:00:46 +00:00
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 3f2786c030 - More cleanup
- Teach for to pieblitfunc
- sed DrawTransImage to DrawImage (they were defined this way before anyway) and remove an unnecessary parameter


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1875 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-18 14:25:06 +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 e40c830278 Remove more unused code. This includes iV_GetMouseFrame, which returned an undefined value before. scriptextern.c might want to be adapted.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1865 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 21:56:36 +00:00
Giel van Schijndel 12f21d0b0c * Replace usage of uint8_t with char for C-strings; while (u)int8_t works perfectly nice for numbers it isn't nice for text (char-array)
* To make sure we still have the guarantee that a char is 8bit I've inserted a static assertion for this (CHAR_BIT == 8)
 * Use exact length types for lobbyserver

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1821 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 12:01:59 +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
Dennis Schridde db49a55df0 More constiness and documentation
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1770 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-30 01:50:01 +00:00
Dennis Schridde fde0d68082 - (__STDC_VERSION__ >= 199901L) -> defined(_ISOC99_SOURCE)
- Tune lighting and enable by default (This doesn't seem to affect the terrain)
- Declaration updates (Trolltech says that attributes need to go after the "static inline", the GCC manual is a bit unspecific about this)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1744 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-29 14:09:10 +00:00
Giel van Schijndel 721a32314f * Use PHYSFS_close on every point of exit in iV_LoadImageFile
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1740 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-29 10:05:16 +00:00
Per Inge Mathisen d7a003cac1 Fix signedness warning
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1728 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-28 12:03:36 +00:00
Giel van Schijndel fb8094aae2 * Use uint8_t instead of char since we depend on the precise size of this structure
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1727 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-27 23:48:20 +00:00
Giel van Schijndel f9783ff29f * Remove unused member Version from IMAGEHEADER
* Use PHYSFS_close after we've read from the image file

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1724 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-27 19:28:54 +00:00
Giel van Schijndel 575a78836a remove unused member PalID from IMAGEDEF
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1723 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-27 18:51:52 +00:00
Giel van Schijndel b5154ae4a3 * Remove redundant and unused string from IMG-header (PalFile)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1722 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-27 18:24:37 +00:00
Giel van Schijndel 9e520c844b Cleanup:
* Simply return the value we need (instead of using a pointer)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1721 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-27 16:41:21 +00:00
Giel van Schijndel cdea281ca6 * now load resources of type "IMG" directly from their file rather than an intermediate memory buffer
* make definitions of IMAGEHEADER and IMAGEDEF safe for loading on systems with different sizes for datatypes
 * Allocate IMAGEDEF in a function of its own: iV_AllocImageFile (uses only one malloc call so we don't need to go and toy with lots free() calls on failure)
 * Use PHYSFS_read* functions for endian correctness (rather than the endian_*word stuff)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1719 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-27 15:50:56 +00:00
Dennis Schridde 8efecd07b2 const and indent
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1709 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-26 19:14:23 +00:00
Dennis Schridde 3c2afc391e Move the calculation of the relative light position for shadows out of the ShadowDrawLoop, into Draw3DShape, so we don't need to calculate it twice for the front- and the backface.
Patch inspired by Watermelon.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1707 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-26 18:25:15 +00:00
Dennis Schridde 2313b8d53e The Vector3 functions where not really const, since they operated on pointers.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1706 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-26 17:00:55 +00:00
Dennis Schridde f29d7647f6 It's probably safer with these types... (Because of the previous commits)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1704 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-25 18:03:48 +00:00
Dennis Schridde 9d4a007121 More inlining and const
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1703 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-25 17:58:23 +00:00
Dennis Schridde 52486bee8b const const const
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1702 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-25 17:21:13 +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 49f8259226 More cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1679 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-21 18:57:11 +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
Per Inge Mathisen b7e9c15c93 Some residual cleanup, including fixing an erronous static
assignment in the sound code.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1595 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-06 20:20:45 +00:00
Dennis Schridde 351060f21f - 1st attempt to create an API for image loading (support for PNG features like non 8bit channels still needs to be thought of). Appropriate code location is also missing (added new functions to tex.c, since they were not PNG related)
- Renamed pie_PNGLoadFile, because I got confused about pie_ vs. iV_ when working on my terrain stuff, and did not fix it when backporting to trunk
- iTexture (now aka iV_Image, s.a.) is given a depth field to enable support for different number of channels. This is required to support RGB only textures (without adding a useless alpha channel) and eg. for greyscale images like heightmaps
- Simplyfied iV_loadImage_PNG (formerly known as pie_PNGLoadFile, s.a.) and also removed lots of seemingly unnecessary conversions
- Converted page-8 from paletted to RGB for simplification. This multiplied the size by about 3x (still < 100kB)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1580 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-01 20:34:54 +00:00
Giel van Schijndel d6758391d8 * Fix nameclash of <png.h> with lib/ivis_common/png.h
* renamed lib/ivis_common/png.[ch] to lib/ivis_common/png_util.[ch]

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1562 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-30 14:09:33 +00:00
Ari Johnson c62421a6ad Updated Xcode project to reflect pcx.c -> png.c change
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1561 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-30 02:10:22 +00:00
Giel van Schijndel 82eee99004 * Move PNG dumping code from screen.c to png.c
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1560 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-29 23:00:38 +00:00
Giel van Schijndel aff4430378 * Move PNG specific code to png.[ch] (PNG saving code still needs moving though)
NOTE: this _WILL_ require updating the MSVC project file

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1559 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-29 22:19:21 +00:00
Dennis Schridde e5e418c480 - Sample prototype for a PNG saving function
- Vector2f type which will be needed for texture coordinates
- Output adjustment for pie_AddTexPage


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1550 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-29 00:58:39 +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
Dennis Schridde 24c2c3296d - Remove unused function drawTexturedTile
- Increase drawed terrain size to 64 tiles
- (re)move some variables


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1547 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-28 13:53:41 +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
Giel van Schijndel 4548e56fe2 * Fix some signed vs unsigned comparisons
* Turn some implicit conversions of void* to something* into an explicit cast
 * remove some redundant commented out code
 * refactor some error checking code ( was: if (!error) normal exec path; else deal with error; now is: if (error) deal with error; normal exec path )

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1534 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 22:08:53 +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