Commit Graph

82 Commits (06a469ed5b207eaafc81dbfe8f80f1033e535787)

Author SHA1 Message Date
Per Inge Mathisen b99feff92f Merge PIEVERTEX and SVMESH into TERRAIN_VERTEX and use struct assignment instead of memcpy on it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2668 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 21:41:38 +00:00
Per Inge Mathisen 70718282a4 Fix shadows looking bad from opposite view direction of shadows, and fix
memory leak in shadow code reported in bug #10190.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2659 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 18:52:43 +00:00
Per Inge Mathisen 94421b5b56 Clean up LOG_3D
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2634 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 13:58:01 +00:00
Giel van Schijndel 4966b22bf5 * remove functions pie_DrawImage270, pie_DrawText270 and pie_TextRender270; which where a whole chain of functions that where just duplicates of the same functions without 270 in their name
* add function iV_DrawTextRotated which uses glTranslatef and glRotatef to change (i.e. rotate) the result of iV_DrawText which it also calls; the translation matrix is later reset using glLoadIdentity() (no pushing&popping of the matrix)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2330 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-03 11:57:16 +00:00
Per Inge Mathisen ce56538fba Revert commit r2258 which made texture coordinates into floating point. It
caused bug #9631, wrong team colours displayed.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2292 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 20:20:06 +00:00
Dennis Schridde 723f9bfaa1 Use float texture coordinates in the range 0.0-1.0.
Any fixes, if necessary, should be applied on loading.
In the image code (IMAGEDEF) this did not work, so OLD_TEXTURE_SIZE_FIX is applied during rendering.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2258 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-29 13:32:21 +00:00
Dennis Schridde 27f505a3f5 Some renamings and cleanups to simplify the upcoming float uv patch.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2247 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-28 13:50:16 +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
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
Dennis Schridde 807f41a852 - Further improve moveGetDirection.
- Extend the Vector library.
- Cleanup (more Vectors).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2104 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 20:13:24 +00:00
Dennis Schridde 7c51ddbadc - pie_MAX_POINTS became pie_MAX_VERTICES and was increased to 768 from 512. (Grim's request.)
- pie_MAX_POLYS became pie_MAX_POLYGONS.
- pie_MAX_POLY_VERTS became pie_MAX_VERTICES_PER_POLYGON and was decreased to 6 from 10. This _should_ work everywhere, I didn't see glitches. Grim recommended to even reduce it to 4, but the terrain renderer didn't like that. (When you pitched down the camera too much, the left screen side of the terrain disappeared.)
- iV_IMD_MAX_POINTS, iV_IMD_MAX_POLYS now are defined to the pie_ variants.
- scrPoints was moved into the scope of the only using function, pie_Draw3DShape2.
- aByteScale was never used, so it got removed.
- Some counters were changed from signed to unsigned.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2054 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-11 21:09:40 +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 92bf004d99 Cleanup pie_PiePolyFrame and some other minor changes.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1884 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-19 14:27:14 +00:00
Dennis Schridde 8ee46cc331 Minimal comment/header reordering.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1878 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-18 16:32:38 +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 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
Per Inge Mathisen 077433f02f Audit more globals not being set correctly to NULL.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1850 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-12 17:56:34 +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
Dennis Schridde d34ab46555 Update to previous commit: Also ignore the activeevent in multiplayer games.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1745 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-29 14:10:32 +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
Per Inge Mathisen 4cf37f5ddc Remove unused parameter, define, and set more visually pleasing
ambient lighting for the disabled OpenGL lighting mode.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1712 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-26 20:49:35 +00:00
Per Inge Mathisen 2ec98482ba Remove workaround for Direct3D bug
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1710 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-26 19:29:36 +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 b29fad2da0 Load the object matrices by loading them and not by loading the identity and multiplying.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1708 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-26 18:51:47 +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 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 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 7544470e35 Cleanup. Note the FIXME!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1680 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-21 19:42:05 +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 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 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
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
Ari Johnson d84e7fbf27 Warning linting on Mac OS X
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1570 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-30 20:42:18 +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
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
Per Inge Mathisen dad0851e7e Remove unused PIETOOL code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1532 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 20:29:43 +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 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
Giel van Schijndel 365c37812d * Remove PIEPIXEL and change all of its instances to Vector3f (definition is exactly the same where types are concerned, only member vars were named different)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1412 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 10:47:20 +00:00
Per Inge Mathisen 0de1ff1124 Fix warning
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1324 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-01 20:12:47 +00:00
Gerard Krol 290fb5ebe2 A speed up for people who are fillrate limited: 1. The stencil buffer is no longer cleared each frame when shadows are disabled. 2. The color buffer
is no longer cleared each frame, but care is taken do draw on the entire screen so that no smearing takes place. This patch gives me about +30 fps. 
(from 45 to 75)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1302 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-30 17:38:35 +00:00
Gerard Krol baf02b66df Oops, screwed up applying r1290. Broke the build by duplicating the whole function... This fixes it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1291 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-28 18:38:36 +00:00
Gerard Krol 01ec2ae422 Patch by Watermelon: C89 compliant(MSVC) and removed the 'BOOL same', in the function compare_edge in piedraw.c
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1290 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-28 18:31:35 +00:00
Gerard Krol 2fe34ce6cc Per's patch to use texture compression, modified to always specify generic compression (and let the driver decide which compression to use) and to
only compress the texure pages, and not backdrops and other textures. This this should give a framerate increase of 5-10 fps on fillrate limited 
systems (cpu usage < 100%).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1289 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-28 15:08:57 +00:00
Gerard Krol ee76f4ce10 Tweaks and optimisations for CPU usage. Tiles are no longer added to the bucket sort, and the size of the bucket array is made smaller. The maximum
number of simultaneous effects is down from 2500 to 500 (a big fight has about 200 effects). The effect processing and drawing is now done from one 
loop instead of from 2 (saves on the iterations). The pie_DrawTexTriangle function defaults to non transparent tiles and sets an alpha drawing mode 
only when needed.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1286 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-27 13:56:36 +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
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 7e12df4e35 - Backport r1228 (lib/script/script_parser.y, not initializing ppsLocalVarVal leads to segfault)
- Change some idention and whitespaces


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1229 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-13 20:49:03 +00:00