Commit Graph

112 Commits (2063d578c3c1c3e28c50497fd3297dc9f1103215)

Author SHA1 Message Date
Giel van Schijndel bd9977cf3d * Move some variables into a more local scope
* Make use of the fact that FUNCTIONALITY is a union and work some casts away
 * Turn some bitshifting with TILE_SHIFT into map_coord and world_coord function calls
 * Merge some duplicated code in function resetFactoryNumFlag

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2045 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-08 22:47:13 +00:00
Per Inge Mathisen 51d982100e Fix crash and assert when transport is leaving map in campaign
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2003 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-02 20:37:01 +00:00
Dennis Schridde ae1bbe9894 Fix for wrong type by vs2k5.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1991 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-30 23:42:27 +00:00
Dennis Schridde e5ff965bbc Remove unused "altVal"(disp3d) and macros(fract), make macro safer(map)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1902 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-19 23:32:17 +00:00
Dennis Schridde a2b9e22822 - Cleanup unnecessary variables in warcam.c
- Adjust camera-smoothness in warcam.h
- Simplify trackHeight(). I experienced an extreme, infinite but irreproducible rotation once: If anyone experiences it again, this is very probably the culprit.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1901 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-19 23:18:44 +00:00
Dennis Schridde 2f9105cc71 water-fix part 3: Animation
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1896 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-19 18:33:15 +00:00
Dennis Schridde ccc9d53d0a Part 2 of water-fix (river bed), 3rd part (animation) to follow.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1895 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-19 18:20:56 +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 0198bceba2 First part of water-fix, which was broken by one of the last commits.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1893 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-19 17:56:56 +00:00
Dennis Schridde d0bb8172d5 Remove Win32 specific min/max, replace by MIN/MAX from macros.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1892 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-19 17:09:30 +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 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 083b4c97d5 Remove psPx optimization via pointers to minimise further patches.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1874 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-18 13:18:27 +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 66746c4078 * Use decent assertion expressions for some asserts (e.g. !"string", so that debuggers actually display something more interesting than 'FALSE')
* Fix a syntax error (missing brace)
 * Code cleanup: put curly braces on their own line
 * remove a copy&pasted switch statement, and merged it into the switch directly above (all case labels and break statements where _exactly_ the same, only the statements executed where different)
 * Use #if 0;#endif for commenting out code instead of /*;*/
 * move some vars in the most local scope where they're used

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1860 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 20:59:04 +00:00
Per Inge Mathisen 5c23008ee0 Remove the unused 2D map editing code. We are never going there... Notice
that files are removed, so rerun your build systems!


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1859 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 20:49:55 +00:00
Per Inge Mathisen 42ea71702d Add two new check macros, CHECK_OBJECT and CHECK_PROJECTILE, and sprinkle them over the code.
This will cause many new asserts, but easier to track down bugs. To find if a bug is caused
by too early object destruction, use "--debug memory" and compare with pointers such as 
"psObj-psDest" (one frequent offender in projectiles).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1858 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 20:27:10 +00:00
Ari Johnson d411264e17 Reverted changes from r1775 and r1779 that used 'bool' instead of
'BOOL' and thereby prevented the code from building


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1809 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-04 17:26:43 +00:00
Giel van Schijndel b6a27628ba * Go back to using INT_MAX instead of INT32_MAX (this partially reverts r1786)
* Now actually #include <limits.h> so that we can be sure INT_MAX is defined

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1802 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-04 09:37:28 +00:00
Dennis Schridde 68e56823e1 - Constification
- POINT -> Vector2i
- changed internalformat = getPixelFormat() to GL_RGBA in one place
- removed unused variables/functions
- proper intialisation


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1792 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-02 23:01:29 +00:00
Per Inge Mathisen b18c40d58a Oops. I accidentially turned on a gateway illustration debug feature. Turning it back off...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1788 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-01 21:16:44 +00:00
Per Inge Mathisen dc71f601f9 Exorcise hard-coded texture size numbers, so that we can now change the size of
the terrain texture atlas pages.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1787 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-01 20:59:11 +00:00
Per Inge Mathisen 3bc52689dc Remove unused TILE_BITMASK and use INT32_MAX instead of possibly undefined INT_MAX.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1786 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-01 19:40:18 +00:00
Giel van Schijndel 9c15ebad81 * Use native C types (rather than the ancient WinAPI types, we inherited)
* Declare variables at the most localized scope


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1775 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-30 07:20:50 +00:00
Dennis Schridde 1ba7327b0c More verbose SVMESH members:
- s[xyz] -> screen, w[xyz] -> water
- Beware: Besides the name both are (probably) in screenspace coordinates
- .screen and .water only differ for water tiles and then only, because those may have a different .y if they are "PushedDown"
- .water is only used in locateMouse()
- .screen.z is used for basic visbility testing in drawTiles()
- Besides that .screen is only used in locateMouse() and to outline tile corners on keypress


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1773 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-30 02:44:38 +00:00
Dennis Schridde eca9d2bab6 Simplify code, mX -> mouseXPos (like in input.c)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1771 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-30 02:06:46 +00:00
Giel van Schijndel 7af99e5645 * make inQuad const correct
* remove several unused and essentially no-op functions


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1768 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-29 23:11:52 +00:00
Giel van Schijndel 24b444c1a1 No longer cast UDWORD visibleYTiles to an SDWORD if the other variable we compare it to is an UDWORD as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1752 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-29 16:28:12 +00:00
Roman C 884f22a4af - replaced "=<" and "=>" with ">=" and "<=" respectively
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1718 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-27 14:43:12 +00:00
Giel van Schijndel 02c6705f61 Move the condition we are asserting into the ASSERT-statement itself
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1715 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-27 14:05:00 +00:00
Per Inge Mathisen 10542cf278 Repair the experimental moving shadows code. It remains disabled, however.
To enable, uncomment the call to findSunVector() in src/display3d.c and
uncomment the lighting = TRUE in lib/ivis_opengl/piedraw.c


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1713 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-26 21:51:57 +00:00
Per Inge Mathisen cbb0795bd3 Remove misc dead code and make some functions static
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1711 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-26 20:15:42 +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
Per Inge Mathisen ae736962de Code cleanup. There should be no behaviour changes.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1689 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-23 18:43:22 +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 041e086d53 - -Sint32 pie_RotateProject(SDWORD x, SDWORD y, SDWORD z, SDWORD* xs, SDWORD* ys)
+Sint32 pie_RotateProject(Vector3i *v3d, Vector2i *v2d)
  This removes the necessity of the wrapper pie_RotProj.
- Also changed a few "Vector3i null" to "zero" for less confusion.
- And removed an unused variable that hid behind an assignment.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1674 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-21 14:06:31 +00:00
Dennis Schridde 6a29f00101 Remove unused comments.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1662 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 13:29:05 +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 d1d55cc977 FRACT->float,[if]SQRT->sqrtf
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1658 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-19 21:32:19 +00:00
Giel van Schijndel dd03ace476 * replace macros WORLD_COORD and MAP_COORD with inlines world_coord and map_coord respectively (compiler checked, so adds type safety)
* Add some debug messages for the cases where map_Height receives negative SDWORDs passed as if they are UDWORDs

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1614 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-12 13:38:07 +00:00
Dennis Schridde f347fa4fa8 Config option: debugmode (aka --cheat)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1602 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-09 05:31:51 +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 1587bc93c1 - Formating and removal of unused lines
- Removed a 20ms delay from the mainloop
- Added ASSERT_STATIC macro to check assumptions on compiletime


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1582 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-02 15:50:30 +00:00
Per Inge Mathisen 17d9b945fb Cosmetic cleanup of flattenimd function for more readability
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1555 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-29 18:02:07 +00:00
Giel van Schijndel 675c4a0a57 * Keep X&Y values passed to map_Height (directly or indirectly) within safe range
Patch by Watermelon: display3d.c part of projfix13e (with fixes by Per; MAX/MIN and append - 1 to fix indexing; did not include code cleanup)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1554 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-29 17:32:19 +00:00
Per Inge Mathisen 123475ef6b Reorder some code for readability.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1551 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-29 12:38:21 +00:00
Per Inge Mathisen 03c620620b Fix bug that would prevent IMDs with more than 256 points from being
properly flattened.


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