Commit Graph

67 Commits (eb3ac2e356f59f798a328174d644fafba99be00a)

Author SHA1 Message Date
Per Inge Mathisen ae2c501b8f Use power-of-two texture for radar again. Fixes support for ancient gfx cards.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5530 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 18:10:58 +00:00
Per Inge Mathisen d6d6a9919e Commit API only from patch #907: Make texture coordinates into static array.
This fixes a bug with maps smaller than max visible tiles area which would
either crash or create seams, re-reported by Buginator.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5134 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-17 21:48:23 +00:00
Per Inge Mathisen bdb6bf9ef0 Silence compiler complaints about memory leaks in tile drawing code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4992 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-09 18:13:03 +00:00
Freddie Witherden 6459f52cf2 Rename PIELIGHT.argb to PIELIGHT.rgba so that it reflects its actual format.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4509 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 22:33:22 +00:00
Per Inge Mathisen 1b9ef4f995 Remove hardcoded map visibility size from the ivis_opengl code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4103 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-16 11:05:08 +00:00
Per Inge Mathisen 7693909947 Kill oddball type TERRAIN_VERTEXF (never used for terrain!) and reduce copying some more.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4035 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-13 20:03:50 +00:00
Per Inge Mathisen 3bcd4f7d1d Kill PIEPOLY and reduce a lot of silly copying of variables back and forth for each polygon.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4033 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-13 19:44:57 +00:00
Per Inge Mathisen a8f88483ac Fix bug in OpenGL lighting mode which would mess up GUI. Also do not
recalculate the surface normal for every polygon for every frame! It
is already calculated when we load the PIE model, so let's use it.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4032 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-13 19:09:44 +00:00
Dennis Schridde a8dc02f672 Generic cleanup, often variable initialisation
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3939 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 15:09:03 +00:00
Dennis Schridde a3284e7a7d Port r3921 till r3924:
- Move VISIBLE_XTILES from src/ to lib/ivis_common/, so we don't have to hardcore mapview sizes in piedraw.c...
- Make INTERFACE_DEPTH/MAX_Z int, since that's what they are used as.
- Remove unused defines
- Less fog and more shadows


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3926 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-05 19:30:29 +00:00
Per Inge Mathisen b1ef18e61d Kill unused PIESTYLE struct and parameter.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3688 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-04 16:55:56 +00:00
Dennis Schridde 7f3c67175c Comment FP12
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3590 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-28 00:43:26 +00:00
Per Inge Mathisen 75c77a4af4 Make drawing code less convoluted and store less state in tileScreenInfo.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3573 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-27 18:47:08 +00:00
Per Inge Mathisen 2cd496d9c7 Remove unused defines, prettify animation code a bit, and use same electronic
warfare effect code for all objects - the one which does not modify individual vertices.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3429 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-10 22:18:20 +00:00
Per Inge Mathisen 877ac6456c Add lots of doxygenized comments.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3230 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-29 22:34:41 +00:00
Per Inge Mathisen 2390ed5d63 Remove wrongly set (ie was unused) water xyz for tiles, and fix wrong comments.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3176 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-25 20:37:33 +00:00
Per Inge Mathisen e0c450b415 Remove excess display related code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3062 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-15 12:18:56 +00:00
Per Inge Mathisen 5417afae46 Read tile colour information directly from mapTiles, instead of going through tileScreenInfo
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3057 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-15 11:08:23 +00:00
Per Inge Mathisen 0484f5e383 We no longer need .wlight to separately store water colour.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3054 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-14 16:21:12 +00:00
Giel van Schijndel c51bd8ae10 * Get rid of a large quantity of unused parameters
* Turn some signed integers ("int" or "SDWORD") into unsigned integers where it made more sence (and signed integers caused warnings about comparing signed with unsigned integers)
 * At some places cast to an unsigned integer (where the type of the expression is a signed integer but the result of it logically _always_ is an absolute value)
 * Remove unused struct-type EVENT_INIT
 * Convert use of malloc->memcpy->free to one single realloc call (and now make sure to actually check realloc's return value, which wasn't done with the malloc call)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3037 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-10 23:15:46 +00:00
Per Inge Mathisen 53f11c391f Add a new vector field to the PIELIGHT union, and send colours to OpenGL
as arrays rather than as individual bytes.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3019 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-09 17:41:00 +00:00
Per Inge Mathisen 76840b01d2 Large PIELIGHT cleanup. Also cleans up tile drawing logic somewhat.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3006 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-09 00:33:03 +00:00
Per Inge Mathisen 8d48c5fdd1 Partial conversion from 0.0->1.0 texture coordinate range. For now only terrain
textures are converted. Once they are done, the texture matrix hack is restored.
Thanks to devurandom and cybersphinx for help and previous efforts in this area.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2980 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-05 18:54:17 +00:00
Per Inge Mathisen 4bbf490aca Change the rendering of the normal terrain to use vertex arrays. We still
recalculate everything each turn. See patch #865.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2939 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-01 17:07:03 +00:00
Dennis Schridde d75b63cdb3 Cleanup water-moving:
- Remove now unnecessary offset parameter from pie_DrawTerrainTriangle
- Move GL code from display3d.c to piematrix.c


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2935 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-01 16:43:28 +00:00
Per Inge Mathisen 3dfc90107e Simplify handling and drawing of areas outside the map.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2934 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-01 16:35:49 +00:00
Per Inge Mathisen 36c3cb1b6c Remove unused PIEVERTLIGHT. Retire iColour type in favour of PIELIGHT. Fix circular headers.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2861 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-23 21:51:48 +00:00
Per Inge Mathisen e624663f40 Now that we draw water in a separate pass, we can reduce the number of state changes a lot.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2704 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-04 13:26:04 +00:00
Per Inge Mathisen 6e19e51118 Replace int x,y,z in TERRAIN_VERTEX with a Vector2i, and fix two cases of
type punned pointer casts.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2670 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 22:00:55 +00:00
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
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 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 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 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 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 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 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
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
Giel van Schijndel f49c5cbdd5 * change pie_PNGLoadMem to pie_PNGLoadFile which (as the name suggests) now loads textures directly from PNG files (rather than memory buffers)
* change pie_ReloadTexPage to use files instead of memory buffers as well
 * change data.c's resource handler mappings to now load some more fileformats directly from file (all that directly or indirectly used to depend upon pie_PNGLoadMem)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1483 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-16 22:29:44 +00:00
Giel van Schijndel 7356aa1b9a * make pie_PNGLoadMem play nice and take the buffer size as an argument rather than assuming it to be 10000000 (10 million)
* do the same with pie_ReloadTexPage which calls pie_PNGLoadMem
 * char* -> const char* in tex.c
 * fix a syntax error from r1481

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1482 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-16 20:07:56 +00:00
Giel van Schijndel 09b08c1582 * remove senseless use of malloc (we now statically allocate on the stack)
* remove goto, placed the "goto"-code in an inline function instead
 * make pie_PNGLoadMem const correct (i.e. take a buffer we don't write to as const char*)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1477 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-16 17:34:11 +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