Commit Graph

599 Commits (4fec447170fec1d17e332a9ffe905a8044a2ff32)

Author SHA1 Message Date
Per Inge Mathisen d5687a6bce Only set the colour for a model once, not once for every vertex. It does not vary.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4036 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-13 20:10:57 +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
Per Inge Mathisen 5f31a354f3 Do not enable and disable GL_LIGHTING for every polygon when lighting mode is enabled.
Reorganize the drawing code a bit to make it more obvious how the calls go.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4031 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-13 18:52:09 +00:00
Per Inge Mathisen 4b7f572ba4 Simplify pie_Polygon() since we never draw polygons of less than 3 vertices.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4030 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-13 18:32:45 +00:00
Per Inge Mathisen f9d2a9152d Remove PIE_ALPHA. Revert most of r4023, since some parts of the drawing code
did not handle alpha blending too well, and blended solids in some cases.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4025 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-12 21:07:26 +00:00
Per Inge Mathisen 169e5bcc42 Drastically reduce the number of (spurious) state changes per frame.
Doubles frames per second drawn here.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4024 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-12 20:14:25 +00:00
Per Inge Mathisen d4e10b07e9 Do not care what blending state we are in when drawing simple and solid
graphics additions like lines and boxes to cut down on state changes.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4023 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-12 19:56:34 +00:00
Per Inge Mathisen 4004ce9872 Clean up in rendering modes. Remove unuseful pie_SetColourCombine().
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4022 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-12 19:41:33 +00:00
Per Inge Mathisen 83ddfb7b99 Small cleanup of the screen flip code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4021 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-12 19:29:24 +00:00
Giel van Schijndel 33216b2e9d Move all stuff that actually belongs in CPPFLAGS (but is called CFLAGS) to AM_CPPFLAGS
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3988 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-10 10:50:58 +00:00
Dennis Schridde d8409c9819 - Don't define CFLAGS anymore, export WZ_CFLAGS instead, which can be overridden by make commandlines
- Set -DYY_NO_INPUT only in those places where needed
- Add some previously forgotten CFLAGS where needed
- Remove extranous -lintl from WIN32_LIBS
- Remove apparently unnecessary directory from Mac include (png_util doesn't need it either)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3986 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-10 02:01:46 +00:00
Dennis Schridde 9f44219b1c Move addition of CFLAGS from configure.ac to the places they are actually needed.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3983 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-09 20:08:42 +00:00
Dennis Schridde 3858daf4a1 Reset MSVC version from 9 to 8, since otherwise MSVC8 will refuse to load the project files. (bug #11219)
Does MS provide some kind of templating system? Like autotools generate Makefiles from Makefile.am.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3950 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-08 11:28:40 +00:00
Dennis Schridde d3455b699a Properly set include/library directories for MSVC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3949 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-08 01:45:45 +00:00
Dennis Schridde 1c52c14833 Whitespaces
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3940 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 15:15:27 +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 da462b4511 More float specialisation and generic cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3937 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 12:42:42 +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
Dennis Schridde a854a84ae1 Port r3912: Replace GLC_ with _glc to prevent confusion and use GLC_UTF8_QSO as string type.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3914 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-04 15:03:18 +00:00
Dennis Schridde 377adc40d6 Another backdrop named "My Pet Turtle" by Cathuria from the "A paltry 30k polys" thread http://forums.wz2100.net/?topic=1361.0
License: CC BY-SA 3.0, as allways.
The border and logo look quite good ingame, so 07-bdrop.png should get that, too.
Also: Use a highres version of 07-bdrop.png, also by Cathuria
Also: Change COPYING.README style a bit


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3884 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-01 13:18:44 +00:00
Dennis Schridde 9b81337df9 Why did QuesoGLC/fontrendering only work on Mac OS X? Because the texture was set conditionaly for it only.
This applies patch #961 correctly and thus closes it.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3867 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-25 21:58:35 +00:00
Per Inge Mathisen 683d9deb2e Replace check_extension with one that does not anger valgrind.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3766 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-12 18:57:20 +00:00
Giel van Schijndel 722303eb84 Turn a lot of already-available function documentation comments into Doxygen documentation
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3739 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-10 15:44:53 +00:00
Giel van Schijndel 72003cf9bf Provide Doxygen documentation for iV_DrawFormattedText() and change its return type to int
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3738 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-10 15:25:20 +00:00
Giel van Schijndel 24ba730bdb * in iV_DrawTextRotated() select the model view matrix and don't depend on that one being selected already
* Also push and pop the model view matrix


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3737 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-10 15:06:23 +00:00
Giel van Schijndel 637edb1f0d * in pie_SetTexturePage() _always_ disable texturing when invoked with a negative parameter
* In iV_DrawTextRotated() use -1 instead of -2 as texturepage (not that it matters anymore what negative number we use, due to the above change)
 * Add some Doxygen documentation to pie_SetTexturePage()


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3736 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-10 15:03:58 +00:00
Ari Johnson adfeb3ab98 Updated Mac OS X port to use QuesoGLC 0.7.0 with a work-around for a
text display bug


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3732 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-09 21:55:02 +00:00
Per Inge Mathisen 54bcf0cde5 Remove completely mistaken comment from the original code. Textures use
0 to 256 range of texture coordinates, and the width of the texture should
therefore not be used to deduce wrap around point for texture animation.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3719 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-08 17:58:37 +00:00
Gerard Krol 5ee301ec76 Make the radar (minimap) transparent again.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3701 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-05 23:02:59 +00:00
Gerard Krol 31a8a54ddb Revert r2901 as this is not the correct way to fix the smearing issues. It probably has something to do with the fogbox or
looking underground. As last resort r1301 "Speed up for people who are fillrate limited" can be reverted.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3699 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-05 21:35:42 +00:00
Per Inge Mathisen 79db811b58 Remove ugly radar constants from pieblitfunc, where they do not belong.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3691 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-04 18:03:02 +00:00
Per Inge Mathisen 20620668ef Move pie_DrawRect into narrower scope, move in some duplicated calling code, and make it static.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3689 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-04 16:58:18 +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 411545852f Cleanup
- theSun becomes static (+setter/getter)
- normalsOnTile() doesn't use global vars anymore
- pie_SurfaceNormal3fv() now works more like the pievector.h functions
- pie_SurfaceNormal3fv() was cleaned up and became inline function in piematrix.h
- Use more pievector.h functions
- Remove unnecessary multiplications/divisions from calcTimeIllum()


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3592 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-28 01:29:20 +00:00
Dennis Schridde 751d0809c5 Use new VectorX_Compare instead of old VectorX_compare which I'll remove shortly.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3587 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-28 00:27:21 +00:00
Giel van Schijndel b3a3cecaed Rename fractions.h to math-help.h and remove most junk from it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3584 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-28 00:01:37 +00:00
Per Inge Mathisen e0b92752db Constify some piematrix functions
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3576 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-27 21:05:30 +00:00
Per Inge Mathisen 895ba1c8cd Make less of piematrix.c globally exported.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3575 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-27 20:57:26 +00:00
Per Inge Mathisen fec3b1ca08 Indexed colour usage has been eliminated, so remove its support code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3529 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-21 17:06:31 +00:00
Per Inge Mathisen 921ab82191 Clean up GUI frame drawing and port it to PIELIGHT.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3528 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-21 16:57:00 +00:00
Ari Johnson d075817fce Fixed a typo in the #warning for GLC_TRIANGLE
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3525 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-20 23:48:00 +00:00
Per Inge Mathisen b9bcbad34c Port scores code to use PIELIGHT.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3524 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-20 23:01:13 +00:00
Per Inge Mathisen 08c2a06822 GUI cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3497 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-16 18:54:16 +00:00
Dennis Schridde 31a863a90b Setup eol-style CRLF for vcproj files
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3473 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-14 20:49:48 +00:00
Dennis Schridde d7bbab46af Set eol-style and mime-type for vcproj files
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3471 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-14 19:55:59 +00:00
Per Inge Mathisen 49cc91b0ef Move all skybox page handling to display3d.c to prepare for skybox scriptability.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3438 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-12 15:10:02 +00:00
Per Inge Mathisen 441f4038e4 Replace a ton of custom texture clipping code with a single call to OpenGL scissor test.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3380 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-06 14:05:13 +00:00
Giel van Schijndel a2fe74852b * Fix some errors in the Doxygen documentation
* Parameter descriptions for non-existing parameters removed
  * Wrong parameter names renamed/fixed
  * Syntax errors in passing the a parameter to a Doxygen command at the wrong location
  * Prevent HTML interpretation of some comments

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3373 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-05 23:42:54 +00:00
Per Inge Mathisen 168a66b89c Add another backdrop by cathuria.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3303 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-01 21:40:04 +00:00
Per Inge Mathisen a4972d3d38 Reduce verbosity of LOG_3D
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3273 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-31 14:04:21 +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
Ari Johnson 47816967a7 Updated Xcode project and some endian fixes; also changed endian_*() calls
to expand to ((void) (x)) on little-endian systems, so that the compiler
will catch little-endian developers who forget to update the endian_*()
calls when they change the names of structure fields.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3205 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-27 23:55:34 +00:00
Per Inge Mathisen fae5745233 Remove unused function pie_DrawImageFileID. Rename pie_SetColourKeyedBlack to
pie_SetAlphaTest, and do not enable it while drawing the ordinary terrain.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3189 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-27 01:05:37 +00:00
Per Inge Mathisen 53aa930d6e Turn IMD min and max dimensions into vectors.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3111 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-21 17:34:23 +00:00
Ari Johnson 31fc86ee9f Moved a space to match formatting
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3085 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-17 17:22:07 +00:00
Giel van Schijndel f1f1a19be4 * Fix a bug in iV_DrawTextRotatedFv where I used sprintf instead of vsprintf
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3076 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-16 16:02:54 +00:00
Giel van Schijndel 88bf925cb8 * Add functions iV_DrawTextRotatedFv, iV_DrawTextRotatedF, iV_DrawTextFv and iV_DrawTextF to draw text with a printf-like syntax to the screen
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3075 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-16 15:47:55 +00:00
Ari Johnson 0a9bcf08a3 Xcode project can almost build trunk again. This commit allows the project
to download and build the external libraries that Warzone has added since
the last time that trunk would build under Xcode.  The actual game currently
will not build due to other issues, but this is phase 1.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3068 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-15 23:34:51 +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
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 6c4c61fbb7 PIELIGHT fix for map hightlight. Remove use of colours to communicate a boolean value.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3022 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-09 21:50:47 +00:00
Dennis Schridde c64b565f14 Patch #872 by Buginator. Untested by me since in Bugs we trust. ;)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3020 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-09 19:10:34 +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 4ee90ba9e3 Adapt radar view to PIELIGHT scheme. The radar colours have been changed a lot, and
we probably need to massage these colours a bit before release. Radar tile colours 
in all but objects only mode are a complicated blend of tile height and colour. Closes
patch #858.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3018 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-09 17:23:34 +00:00
Per Inge Mathisen 4ddd4c28af Large PIELIGHT cleanup. Please report bad colours.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3017 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-09 16:09:23 +00:00
Per Inge Mathisen 63211571b0 New utility function pal_Colour() creates PIELIGHT from RGB values.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3011 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-09 13:11:09 +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
Giel van Schijndel ec392ef7d4 * Improve the quality of the QuesoGLC error messages produced when fonts cannot be loaded/selected
* When we're unable to select a font face give a warning (LOG_WARNING) instead of an error (LOG_ERROR)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2992 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-07 19:31:19 +00:00
Freddie Witherden 299d7bfcfb Commit patch #871
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2983 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-05 21:56:12 +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 4519230af1 Split out CLIP_VERTEX from TERRAIN_VERTEX, since the former usages are not really
related to terrain, and do not need all terrain fields and future changes.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2979 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-04 20:25:25 +00:00
Per Inge Mathisen f86858109a Fix texture size warning. It will correctly nag about missing support for 2048x2048 textures.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2973 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-03 20:29:34 +00:00
Per Inge Mathisen 6da463546f More PIELIGHT fixes
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2961 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-02 16:38:21 +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
Per Inge Mathisen afa23e157a Beauty fixes
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2937 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-01 16:55:23 +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
Giel van Schijndel 263f92f24f * Always clear the colour buffer in pie_ScreenFlip; this should prevent "screen smearing"; hinted by Buginator
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2901 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-28 21:53:59 +00:00
Per Inge Mathisen 134e31b558 More PIELIGHT fixes. Retire iV_BoxFill. Fix "mission achieved" dialog colours.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2895 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-26 22:59:21 +00:00
Per Inge Mathisen 4dd2dfc63d More PIELIGHT conversions. Fix colour issue in load/save dialog.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2894 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-26 22:10:31 +00:00
Per Inge Mathisen 13d1607349 Introduce new palette system WZCOL_* for setting the essential game palette.
Change over pie_BoxFill() to PIELIGHT. Fix colour bug when building structures.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2893 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-26 21:48:36 +00:00
Per Inge Mathisen af40ffa1cb Convert fog code to PIELIGHT
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2888 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-25 23:06:24 +00:00
Per Inge Mathisen fcf0fc8d21 More colour cleanup.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2886 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-25 22:38:22 +00:00
Per Inge Mathisen 7713623a64 Remove unused bilinear mode.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2883 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-25 21:47:57 +00:00
Giel van Schijndel 6172bdd498 * Refactor space trailing code in textdraw.c such that it is easier to read (also has some comments now which might help...)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2882 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-25 21:43:16 +00:00
Per Inge Mathisen 4e25b2d0fe Make more use of PIELIGHT.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2880 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-25 21:15:08 +00:00
Per Inge Mathisen b5fa689b41 Include SDL_opengl.h instead of GL/gl.h for better portability. This is vital
for Mac compilation.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2864 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-24 16:41:00 +00:00
Dennis Schridde 9cc0a628c1 Do parts of the proposed changes in "[Warzone-dev] build issues in FreeBSD system" by Yaroslav Kolomiyets from 24.10.2006:
- SDL header includes don't use SDL/ anymore (raw Makefiles and MSVC Project adapted).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2863 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-24 11:49:51 +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 904bfe5f3d Make some stuff static
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2842 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-20 20:41:13 +00:00
Per Inge Mathisen 345d335790 Reduce max radar zoom to 1, because a value of 2 is buggy. Replace
hard-coded radar size values with a slightly better define.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2841 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-19 21:32:35 +00:00
Per Inge Mathisen d8c8ee9ee1 Remove unused _iVPRIM_DIVTABLE table.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2838 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-19 20:09:01 +00:00
Per Inge Mathisen fb9d667895 Clean up screen.c - make globals static and remove unused vars.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2822 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-14 22:29:19 +00:00
Per Inge Mathisen f577a8f269 Remove unused screenGetSurface
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2821 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-14 21:05:45 +00:00
Per Inge Mathisen 50e99ae933 Remove unused pietexture.c|h files and references.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2820 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-14 19:51:04 +00:00
Per Inge Mathisen ff13be0b96 Do not disable lighting if it was never enabled in the first place, to avoid
doing unnecessary OpenGL state changes. Also make sure we turn off normalization.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2778 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-10 13:56:14 +00:00
Dennis Schridde 223bc803e8 Use OLD_TEXTURE_SIZE_FIX instead of 256.0f to scale texcoords, to make clear that this is a fix for the old ...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2759 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-09 17:43:50 +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 01e24bf6ed Clean up pieblitfunc. Dump dead code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2702 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-03 22:48:46 +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
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 49df8ea371 Use GLC_TEXTURE for font rendering. Patch by Bertrand Coconnier in bug #10188.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2646 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 19:20:25 +00:00
Per Inge Mathisen e808d83f0c Add comment about quesoglc workaround being fixed upstream as of today.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2645 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 19:00:55 +00:00
Per Inge Mathisen 1d2caebccd Cleanup fugly code, and add nasty hack around weird bug. See bug #9843 for more info on bug.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2644 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 18:16:15 +00:00
Giel van Schijndel f5602b4778 * Replace a large amount of strncpy() calls with the safer strlcpy()
* Fix an error in src/game.c where we would use the wrong size as parameter to strlcpy()


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2640 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 16:18:52 +00:00
Giel van Schijndel bd37e62cb2 * Replace a lot of strncat(dst, src, sizeof(dst) - strlen(dst) - 1) calls with the less bloated strlcat(dst, src, sizeof(dst)) form
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2637 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 15:47:17 +00:00
Giel van Schijndel 6b4cba1700 * Rename pLevelName to aLevelName (hungarian notation is a pain. Especially when it's wrong!)
* Get rid of several magic numbers
 * Some const correctness
 * Replace a huge amount of strcpy(), strcat(), strncpy() and strncat() calls with a strlcpy() and strlcat() calls respectively


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2635 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 14:35:35 +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
Per Inge Mathisen 35bd80b426 Add missing braces after conditionals. Please follow proper coding style :-)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2632 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-26 23:29:45 +00:00
Per Inge Mathisen 8885cb207c Try to work around QuesoGLC bug that makes Warzone hang on chat output. Fixes bug #10202.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2631 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-26 23:25:32 +00:00
Giel van Schijndel e06c186bd6 * Replace a _lot_ of strcpy(), strcat() and sprintf() calls with the safer strncpy(), strncat() and snprintf() respectively
* Refactor NETlogEntry() to use the array of strings (packetname[]) instead of a large switch-statement with a lot of copy & pasted code


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2617 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-24 21:11:29 +00:00
Giel van Schijndel 95caee7a1f * Don't (re)initialize the text render module upon calling iV_Reset() anymore
* Remove iV_Reset() call from src/levels.c which is there only to prevent a crash caused by the *OLD* font rendering code
 * Make sure to initalize the font rendering module (by calling iv_TextInit()) in init.c:systemInitialize()


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2593 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-22 22:51:44 +00:00
Dennis Schridde c7b00fadaf More work on the ICC front:
- Less strict warnings in debug-mode (still unusable, because ICC warns about _a lot_)
- Explicit conversions
- Clarify parameter evaluation order


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2550 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-15 18:09:18 +00:00
Giel van Schijndel 3ebad628ca * Allow QuesoGLC to fall back to a random font when we failed to load any fonts
* This should fix _the_symptoms_ of bug #10117

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2530 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-05 17:06:20 +00:00
Giel van Schijndel 9d9370e13c * Make anti-aliassing of text optional (for slower systems); it's turned on by default though (option "textantialiassing")
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2529 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-04 21:29:16 +00:00
Giel van Schijndel 7835b437e7 * Wait until *after* font-selection (selection occurs after loading) with dumping the font-face list (otherwise an empty font-face list is always shown)
* Dump the font-face list on LOG_NEVER instead of LOG_ERROR
 * Write an error to LOG_ERROR when the required font couldn't be loaded (currently hardcoded as "DejaVu Sans Mono")

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2528 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-04 19:43:38 +00:00
Giel van Schijndel d075832459 * Add font rendering and UTF-8 support through usage of QuesoGLC (an OpenGLC implementation);
* This _will_ require you to install http://quesoglc.sourceforge.net/ on your system to be able to compile (windows binaries are provided on the sourceforge download page as well; just dump them in wz's devpackage directory for now)
 * Currently the font render code is hard-coded to select two fonts: DejaVu Sans Mono regular style (aka "Book") or bold style; if you're package manager doesn't provide these fonts (Debian and derivatives have "ttf-dejavu"), you can get them from http://dejavu.sourceforge.net/

This closes #1 (https://trac.mortis.eu/warzone/ticket/1 I dumped/maintained my patch there)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2521 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-01 19:45:49 +00:00
Roman C 6daca4513a Fixed a C99-style for loop.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2482 4a71c877-e1ca-e34f-864e-861f7616d084
2007-09-27 12:23:23 +00:00
Giel van Schijndel a8bfacf6ed * Rename iV_DrawText to iV_DrawTextRotated and create a static inline function iV_DrawText which calls iV_DrawTextRotated with rotation=0.f
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2480 4a71c877-e1ca-e34f-864e-861f7616d084
2007-09-25 20:40:56 +00:00
Dennis Schridde fbd3a9c394 Use Unix PATH_MAX as default and thus move all "fixes" to Windows.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2425 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 12:59:05 +00:00
Giel van Schijndel 609d953a63 * Remove forward declarations for undefined functions iV_CreateFont, pie_StartTextExtents and pie_FillTextExtents
* Remove unused functions pie_SetFormattedTextFlags and pie_GetFormattedTextFlags
 * Move constants PIE_TEXT_WHITE_COLOUR, PIE_TEXT_LIGHTBLUE_COLOUR and PIE_TEXT_DARKBLUE_COLOUR from header file to implementation file
 * Remove global var FFlags which only ever had one value (FTEXT_SKIP_TRAILING_SPACES)
 * Remove global var ExtentsMode which only ever had one value (EXTENTS_USEMAXWIDTH) and remove all if-statements which never matched (remove the conditional part from the parts that always matched)
 * Remove #ifdef _TESTBED code since _TESTBED is never defined (not in commented out code either)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2346 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-06 11:22:31 +00:00
Per Inge Mathisen 33e7c70cc4 Cleanup. Remove another ton of unused code. Fix error message which is not an error.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2339 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-03 17:39:04 +00:00
Giel van Schijndel 33354163a9 * rename pie_DrawText and pie_DrawFromattedText to iV_DrawText and iV_DrawFormattedText respectively for consistency's sake (iV_DrawText already existed as a #define "alias")
* replace all usages of iV_DrawText270(...) with iV_DrawTextRotated(..., 270.f) and get rid of MACRO iV_DrawText270


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2333 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-03 13:14:34 +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
Giel van Schijndel bf5eaace0a * Fix a compiler warning caused by non-matching const-ness of a (non-pointer) parameter in function iV_GetCharWidth's declaration and implementation
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2329 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-03 11:37:06 +00:00
Giel van Schijndel 9ad346be5c * move some variables into a more local scope (bool GotSpace, NewLine)
* add some comments
 * actually parse newline characters (ASCII_NEWLINE to be precise which is defined as '@' right now, we might want to change this)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2315 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-01 20:50:27 +00:00
Giel van Schijndel 9814c2eec7 * remove unused flag FTEXTF_SKIP_LEADING_SPACES and all code related to it
* remove "BOOL AddLeadingSpaces" and all code relying on it to be true, since it never would be true
 * turn a while-loop into a for-loop (reduces duplicated code slightly, and increases its readability)
 * merge two nested if's: if (a) { if (b); } => if (a && b)
NOTE: there should be no behavioural changes

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2314 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-01 20:17:23 +00:00
Giel van Schijndel 0733a68c76 * Fix an infinite loop in the text drawing code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2313 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-01 19:21:04 +00:00
Giel van Schijndel f147f95639 * use static linkage for some global vars and some utility functions
* remove character wrapping code from pie_DrawText (word wrapping code already exists in the only function that ever calls pie_DrawText, so why would we need character wrapping?)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2312 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-01 18:59:51 +00:00
Giel van Schijndel bc2d70ea16 run `astyle --suffix=none --indent=tab --brackets=break --indent-switches --pad=oper --unpad=paren --min-conditional-indent=0 --mode=c lib/ivis_opengl/textdraw.c`
This is because I got fed up by mixed indentation style (even on the same line!!), and some dozen of different styles sometimes even in the same function (and I don't want to waste my time on style)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2311 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-01 18:26:56 +00:00
Giel van Schijndel 6ac475282e * remove #ifdef TESTBED code since TESTBED is never defined (not defined by commented out code either)
* fix error in code cutting off trailing spaces where we would cut of everything until a space instead! (oops)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2310 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-01 18:02:49 +00:00
Giel van Schijndel 473e038691 * remove "left justify append" ability from text drawing code (since it isn't justified; erm used)
* put curly braces on a line of their own
 * general clean up (e.g. moving some variables in a more local scope, giving some more sensible names, etc.)
NOTE: there should be _no_ behavioural changes

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2309 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-01 16:57:41 +00:00
Giel van Schijndel 4e3293784a * remove (unused) pie_DrawText callback functionality (the callback had the responsibility of actually drawing the text)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2308 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-01 16:10:50 +00:00
Per Inge Mathisen 0226604dbc Fix wrong texture pages selected for various models. Closes bug #9629.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2307 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-01 15:06:23 +00:00
Per Inge Mathisen 179f89cbad Improve logging for tracking down resource loading bugs.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2294 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-31 12:47:08 +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
Giel van Schijndel 9b31055f08 * make pie_DrawFormattedText const correct ("char*" -> "const char*")
* Don't use a hundred and two different methods of determining the end of nul terminated string
 * Use pointers into the string rather than integers as "iterators"

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2291 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 17:03:02 +00:00
Giel van Schijndel 1b2ee6ae43 * Fix undeclared identifier
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2290 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 16:46:37 +00:00
Giel van Schijndel 518fd90693 * Mismatched declaration and definition
* function was declared unsigned int, but defined as int; now it's unsigned int in both

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2289 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 16:44:56 +00:00
Giel van Schijndel 3cbe1ed25a * Clean out iV_GetCharWidth to make it more readable (it also returns an unsigned int rather than a signed one now)
* Define iV_GetTextWidth in terms of iV_GetCharWidth now (rather than copy&paste implementations)
 * iV_GetTextWidth now also returns an unsigned int

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2287 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 16:42:37 +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
Per Inge Mathisen 9f3301f22a Use anisotropic filtering, if available.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2246 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-28 13:49:52 +00:00
Per Inge Mathisen 57f9c5f17f Sorry, forgot some non-users of texture type in the last commit...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2227 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-27 17:38:50 +00:00
Per Inge Mathisen 31fd7b3a8f Remove unused texture 'type'
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2226 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-27 17:35:08 +00:00
Per Inge Mathisen c9fbb60e50 Remove unused code and resource parameter
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2225 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-27 17:30:44 +00:00
Per Inge Mathisen 8937d19e43 Free texture data from normal memory immediately after uploading to VRAM.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2223 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-27 16:57:41 +00:00
Per Inge Mathisen 176be97ec3 Remove the code to remake terrain tiles. Instead just free them and make them anew.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2219 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-27 14:58:17 +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 41d3a2a0b0 Fix Umlauts (and other characters) in strings (translation, input, etc).
Previously those displayed images instead of the appropriate letters.
This still doesn't allow for UTF-8 strings (since multi-byte characters are not handled), but it should work with ISO8859-X encodings.
Patch by Martin Koller.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2053 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-11 19:24:54 +00:00
Per Inge Mathisen 2de32d08ba Silence a Valgrind warning by not free()ing a NULL pointer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2051 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-10 20:32:59 +00:00
Giel van Schijndel ed62f3da96 * Use 'unsigned int' instead of a fixed-with type to store the width, height and depth of an image
* Change an assert(FALSE) into a more descriptively styled: !"text string"

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2030 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-06 13:47:39 +00:00
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 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 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 96609e273b More backdrops by Terminator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1870 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-17 00:29:34 +00:00
Dennis Schridde b7efd162b2 Another backdrop by Terminator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1869 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-16 12:31:31 +00:00
Giel van Schijndel e292810a5c Forgot to actually commit this:
* r1866 removed piefunc.c from raw Makefiles instead of rendfunc.c: fixed

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1868 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 22:17:45 +00:00
Dennis Schridde 5dc0ccb99e Update raw Makefiles and MSVC to the removal of rendfunc.[ch]
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1866 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 21:58:36 +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 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 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 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
Per Inge Mathisen c511ab63b6 Fix crash introduced in commit r1661 in function pie_RotateTranslate3iv,
where the y and z parameters were not switched, as they should be.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1670 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 21:41:48 +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
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 6e33bd7cbb * Make progress bar white again
apparently we need a glDisable(GL_TEXTURE_2D) call at some times, or do nothing at other times, this is determined by pie_SetTexturePage by use of some global state, and the texture index, in other words pie_SetTexturePage to me seems like a dirty hack, but we need it for the moment

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1579 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-01 15:37:20 +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
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
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
Per Inge Mathisen e127a1d32c Code cleanup and remove unused code. There should be no behaviour changes.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1558 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-29 21:42:22 +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 5bd6e84852 - Change droid->direction to float, this should fix issues with vtols entering a loop around the target
- Make trigonometry tables static and remove usage of FRACT macros (trig.c)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1542 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-27 10:21:17 +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 ea932d1033 Remove more unused flags
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1531 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 18:45:24 +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
Giel van Schijndel 825ac28558 * use malloc instead of a variable sized array (is slower, requires more maintenance work, but is C89 and as such MSVC compatible, *sigh*)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1526 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 14:28:04 +00:00
Dennis Schridde 5c79953e18 Watermelon: projfix11a:
1. Fixed a bug (I made some parenthesis order mistakes, near predictX and predictY, which might corrupt predictX, predictY)
2. Fixed a value corruption when predictX or predictY becomes negative, since proj_SendProjectile only expects UDWORD (now set them to 0 when they become negative, so the turret wont try to fire projectiles to some off-map coords)
3. Fixed zero height building bug (invincible rearm pads) when an imd's ymin is equal to ymax...

lib/ivis_opengl/screen.c: \param channels


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1524 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 14:08:05 +00:00
Giel van Schijndel 486ac3ed11 * Use a variable sized array for the scanline array
allocated on the stack instead of the heap, which usually is a lot faster => stack alloc = O(1), heap (malloc=heap allocater) usually O(n) or O(log n)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1522 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-22 22:36:38 +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
Giel van Schijndel 0ecf2cba49 * now "properly" apply fix for segfault caused by using png_destroy_read_struct to destroy a write_struct
* (r1502 had a NULL pointer to many passed in the argumentlist)

thanks to vs2k5 for this fix (sorry couldn't find any other name anywhere on the mailinglist than your email userid)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1503 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 21:37:49 +00:00
Giel van Schijndel 6bfe7bfa86 * Fix segfault caused by using the wrong destruction function
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1502 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 21:25:32 +00:00
Giel van Schijndel 68eaeab5f3 * if we malloc we should free!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1501 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 20:06:35 +00:00
Giel van Schijndel 108e9ec935 Cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1500 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 18:17:21 +00:00
Giel van Schijndel aa9a519794 * Remove support for decoding (and encoding in case of screenshot dump code) of JPEG pictures
* Remove some dead (commented out) & dirty code from multiint.c which used JPEG code (image_load_from_jpg)
 * Remove dead (commented out) code from screen.c which used JPEG code (function static GLuint image_create_texture)
 * Remove unused backdrop types from pieblitfunc.[ch]
 * Convert last JPEG files into PNG, add a "comment" property on those: "All of these are converted from JPEG files, so this is JPEG quality."

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1490 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-17 18:24:31 +00:00
Giel van Schijndel 5756890d20 * Remove inclusion of <setjmp.h> which apparently libpng wants to include first (in <png.h>)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1489 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-17 17:48:19 +00:00
Giel van Schijndel baa3dcbb2a * Add PNG screenshot dumping code, when pressing F10 (with a default keymap) both a JPEG and PNG screendump will now be output
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1488 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-17 16:53:28 +00:00
Giel van Schijndel fd3324a9fe * pcx.c: use size_t for memory buffer length (size_t is the appropiate type for this, unsigned int is not)
* change macro BUFFER_SIZE to static const JPEG_bufferSize (compiler will optimize this away)
 * char* -> unsigned char*

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1486 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-17 12:58:22 +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 dcf4cb3263 * turn `integer overflow` debug message into an assert
* dump less information in the debug log if the assert is triggered (just "integer overflow; no more filenumbers available.")

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1481 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-16 20:00:12 +00:00
Giel van Schijndel 7527047316 * char* -> const char*
* make screen dumping code (screen shotstuff) more readable and friendly to edit (behaviour should be unchanged)
 * change screenDumpToDisk:
  * now returns void (rather than the target file name of the screen shot) since its only callee (a keymap callback) ignored the return value
  * use snprintf now instead of sprintf (to prevent buffer overflows)
  * add code to detect integer overflows (maybe we should just abort() on this condition?)
 * remove an empty and commented out function (screenTextOut)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1480 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-16 19:22:01 +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 25aa853f29 - Remove lots of inclusions of windows.h (and move inclusion of frame.h up)
- Remove "-%token <sval> TEXT" from audp_parser.y since it clashed with declarations in MinGW's Windows headers. It does still compile and run, but this may have harmed something anyway. Please check!
- Hack around DATADIR being defined by objbase.h in MinGW by undefining it before the inclusion of shlobj.h (incl. in main.c) This only works since the case that DATADIR is actually used on Windows is extremely rare.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1437 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-11 14:21:45 +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
Dennis Schridde 8952155c7a - Add -Wextra to debug=yes, as it doesn't generate so many new warnings
- Add -Wno-nonnull to debug=strict to make it compile (Remove it from AM_CFLAGS)
- Remove -Wno-unused-label as this warning is not generated anymore
- Fix a "... from incompatible pointer type" warning which led to a lot of strings (and associated functions) in the widget area becoming const
- Maybe found the reason for images in UTF-8 strings


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1405 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-09 14:41:22 +00:00
Giel van Schijndel de5510938e * get rid of unused priority queue implementation (lib/gamelib/queue.[ch])
* remove an unused variable from lib/ivis_opengl/piemode.c
 * some code refactoring to increase readability, change if branches that handle error conditions to the folowing style:
    if (error)
    {
        deal with the error;
        return something (usually false or 0);
    }
    
    continue with normal execution path;

 * previously was something like: if(not error) {normal execution path;} else {deal with error;}; the above way groups error detection and handling which is more easily readable/understandable
 * wrap some if branches from r1374 with curly braces according to Per's advice on the dev mailinglist
 * completely get rid of iPriority from struct TRACK (also stripped it out of functions' argumentlists) since the only code that seemed to use it is the removed priority queue implementation

PS someone might want to look at lib/gamelib/audp_parser.y to finalize the modification to audio_SetTrackVals there, I'm not sure whether it will break any code/script if I would simply remove values from the parameter list, so I'm leaving it as is for this moment

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1378 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-05 20:19:58 +00:00
Gerard Krol 7d6382905d Fix some problems introduced in r1286: 1. flickering water edges 2. transparent water was not correctly drawn
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1363 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-05 14:32:13 +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
Dennis Schridde 3b09a756df - Remove unneeded gettext files and instead create them via autopoint
- Remove unneeded checks from autogen.sh (all of them are also checked in configure.ac)
- Move AM_CPPFLAGS=-$(top_srcdir), which was included in nearly every Makefile, to configure.ac
- Remove -g from CFLAGS for usual builds. This should be set by the buildscripts instead
- Remove CFLAGS_OVERRIDE, which was rendered obsolete by the above change


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1332 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-02 17:21:05 +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 d775cc8962 r1302 caused smoke to be nontransparent when viewed in front of the sky or fogbox. This is fixed by first drawing the sky and fogboxes and then
the terrain and other objects. (it was the other way around)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1304 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-30 19:41:44 +00:00
Gerard Krol bbd1fc594f Fix a bug introduced in r1302: Unit selection boxes were not shown or periodically disappeared.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1303 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-30 18:12:56 +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
Gerard Krol 9e3acc087c The distance fog (aka Mist) start and end is now dependent on the zoom level. This should greatly reduce the number of popping tiles that can be
seen.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1275 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-20 20:46:26 +00:00
Dennis Schridde ca3b5909c8 Fix indention and some minor cleanup...
Fixing type-punned pointers is difficult, especially with that HEAP_ALLOC function...


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1252 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-16 19:31:15 +00:00
Per Inge Mathisen e3e1267e7d Fix bug #8730, where we would crash because the game did not find
a texture to replace during game play. The problem is that the 
texture counter is reset several times during a campaign, so we
cannot trust it. This should be fixed more thoroughly later, for 
now we just check all textures irrespective of the texture counter.
Also improves logging, and fixes a problem that should have made
texture replacements simply not work previously. Thanks to
Gernot Kohlhaas <mr_maniac> for reporting the bug.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1246 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-16 17:33:20 +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
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
Gerard Krol 33936df7d9 Removed a strange __APPLE__ ifdef from stencil_one_pass(), and rewrote
the logic in there. 
Hopefully this will fix the crash reported by Richie on the forums.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1227 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-13 19:34:06 +00:00
Gerard Krol feff0ef74d Fix the skybox corners moving downwards when rotating the camera with a
factory or research menu open.
menu.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1221 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-08 19:39:00 +00:00
Gerard Krol 2ba3e85686 Added a working CLEAR_BLACK to pie_ScreenFlip, and modified the videoLoop to always use CLEAR_BLACK. This fixes the fog coloured
(orange) backgrounds for the briefing "video's".


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1193 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-03 16:35:56 +00:00
Per Inge Mathisen ea50a9249c Replace hard-coded map preview size of 512 with
BACKDROP_HACK_WIDTH and BACKDROP_HACK_HEIGHT for now.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1182 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-25 12:57:04 +00:00
Per Inge Mathisen b8deb3acdc Remove the unset, unused default backdrop.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1181 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-25 12:45:35 +00:00
Per Inge Mathisen 8927a832ac Remove more dead code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1180 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-25 12:34:18 +00:00
Per Inge Mathisen 2a14556b60 Add skybox. Patch by Gerard Krol. The maximum allowed camera tilt towards
the sky has been increased to allow easier view of the new skyline.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1179 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-24 22:53:33 +00:00
Per Inge Mathisen a8ec143f3e Remove overzealous log call in previous commit.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1171 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-24 17:13:08 +00:00
Per Inge Mathisen d5b70b2384 Add new debug log category 'fog', and remove more unused code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1170 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-24 16:07:44 +00:00
Per Inge Mathisen 7e2ba186d8 Clean up pie_DrawPoly, renaming it pie_DrawTexTriangle.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1161 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-22 12:07:44 +00:00
Per Inge Mathisen 2b416b26db Remove silly pie_ROTATE_PROJECT macro
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1159 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-21 23:02:14 +00:00
Per Inge Mathisen daaac4b5e3 Clean up redundant copy&paste code. Patch by Gerard Krol with
some stylistic and extra changes by me.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1158 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-21 22:38:52 +00:00
Per Inge Mathisen 255d2fe12e Add log message about maximum texture size, and error
checks for lack of double buffering and too small
texture support. Use --debug texture to see your
texture size (first line in output).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1156 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-21 20:20:26 +00:00
Dennis Schridde 7fca14b129 Improve description of r1152 (fix broken font rendering in menus) and use pie_SetTexturePage(-1) in all places it was used prior to r1075.
Also clean indention.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1153 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-21 00:10:03 +00:00
Giel van Schijndel 82dd8e0bbc fixes (maybe just circumvents?) bug #8514
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1152 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-20 23:46:34 +00:00
Per Inge Mathisen 785daa97e1 Split --enable-debug into four: strict (-Werror),
yes (as before), relaxed (-O2 & -Wextra), and no
(as before). Fix two more reported warnings.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1151 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-20 16:21:19 +00:00
Per Inge Mathisen bbc588699d Turn __attribute__((unused)) into WZ_DECL_UNUSED, which is unset
for compilers other than gcc. Thanks to devurandom for bringing 
this problem to my attention. Also update documentation for
WZ_DECL_DEPRECATED, which had bitrotted. 


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1149 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 17:46:06 +00:00
Per Inge Mathisen 78396463a7 Fixes informed by -Wextra for graphics code. Removes much redundant code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1147 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 17:18:50 +00:00
Per Inge Mathisen 79b3875fc4 This commit fixes all warnings (on my system). -Werror added for
debug builds. Hopefully this will not cause too much pain, but
rather increase code quality for the future.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1144 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 14:10:44 +00:00
Per Inge Mathisen 3a1d1a6069 Clean up pieclip.c, based on patch by Gerard Krol.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1136 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-17 23:03:48 +00:00
Per Inge Mathisen 85dbcef6af Cleanup of textdraw.c, removing pie_DrawTextToSurface(), which was
redundant, as Gerard Krol reported.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1135 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-17 22:39:33 +00:00
Per Inge Mathisen 34ad7b89e9 Some cleanup of piedraw.c (and more or less related fixes), includes
a reduction of duplication fix from Gerard Krol.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1134 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-17 22:29:21 +00:00
Per Inge Mathisen d68164d3af Smaller texture cleanup. Fix bug in debug log call parameters.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1133 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-17 21:33:10 +00:00
Per Inge Mathisen 9f16833e30 Small cleanup of texture loading and handling, removing unused
portions of the code.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1132 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-16 23:19:33 +00:00
Per Inge Mathisen e0a80da628 Remove unused header
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1131 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-16 22:54:18 +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 8a70df4064 Use some more advanced Automake techniques like noinst_HEADERS. Changes partly autogenerated by KDevelop, so this should be compatible with Automake 1.6.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1118 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-16 14:36:03 +00:00
Roman C f4c4c48dd2 Patch by Gerard Krol:
replaces AND/OR macros with &&/||

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1089 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-10 16:39:39 +00:00
Dennis Schridde f105fad779 Improved backdrop-loading and don't delete a texture when it just needs to be replaced.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1085 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-10 14:34:12 +00:00
Dennis Schridde 977b2ee558 - Hack in PNG backdrop loader
- Add 2 new backdrops from Terminator (http://wz2100.net/forum/index.php?topic=109.0)
- Remove unused pal parameter from pie_PNGLoadMem()


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1075 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-07 15:27:17 +00:00
Dennis Schridde 2b16cbd06b Port of r1066
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1067 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-05 14:32:31 +00:00
Per Inge Mathisen 3d6771a521 Unify the several different definitions of pi in the codebase. Now we use the
C macro M_PI (if available, or we will define it on our own in fractions.h).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1033 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-24 19:42:20 +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
Giel van Schijndel 68d435097e enabled some more code to compile with a C++ compiler without -fpermissive (i.e. there should be *less* compile-time errors now)
* moved several #defines to the enums where they belong
 * changed some datatypes on declaration
 * prepended casts to malloc calls (using typeof() style)
 * changed some (void*) casts to (void**) where required
 * removed several #defines and there instances and then replaced them with their corresponding values from an enum

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@969 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-07 23:50:30 +00:00
Giel van Schijndel 851b570bc5 * functions memRecReport & memMemoryReport:
- removed these functions and all calls to it if REALLY_DEBUG_MALLOC isn't defined, because they don't do anything currently when REALLY_DEBUG_MALLOC isn't defined
  - moved the declaration of memRecReport from memint.h to mem.h where it is, together with memMemoryReport, optionally declared depending on REALLY_DEBUG_MALLOC
 * fixed yet another set of signed/unsigned errors (src/seqdisp.c & textdraw.c/h)
 * removed a cast from char* to char* (that's what I call unnecessary; transforming something into something it already is)
 * memory system:
  - added some comments to clarify what certain pieces of code actually do
  - removed some redundant code (e.g. why would you ever want to overwrite memory to zero just before passing it to free()?)
  - made debug-version of free() return immediately when being passed a NULL pointer (i.e. after raising an assert)
  - moved some variable declarations down to the first point of usage
  - *IMPORTANT*: commented the definition of MEMORY_SET out (line 38 mem.c), this might break code that expects freshly malloc'ed memory to be pre-initialized, if you experience any problems due to commenting this out please say so on the mailinglists!

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@957 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-04 18:41:24 +00:00
Giel van Schijndel 3d23a48076 * expand the use of compiler-guards (C preprocessor macros) so that not only the forward declarations and referring macros are guarded, but the referred functions as well
* remove some unused things: variables, macros (MEMORYREPORT, MEMORYTREAP)
 * fix some signing errors:
  * change assignments of/comparisons with -1 to unsigned variables ((-1) directly, not through a preprocessor directive) to ~0 (left OpenAL-code alone)
  * remove some casts to (SDWORD) in comparisons which actually cause signed/unsigned errors rather than fix them
  * redefine some vars as unsigned

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@955 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-04 17:03:32 +00:00
Per Inge Mathisen 3f88e8e4f2 Remove some more dead graphics code, and fix some warnings.
Happy new year everyone!


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@946 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-31 18:19:19 +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 4b3fa4a865 src/projectile.c : Change an if() chain to switch
lib/ivis_common/pietypes.h : Add a depth field to bitmap so different bitdepths can be supported
Some minor cleanups (remainders from a failed abitrary-tiles attempt).



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@902 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-17 18:18:06 +00:00
Stefan Huehner da14eaf2ad Add some more const to char* function parameters,
which aren't modified inside the called function.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@853 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-23 13:28:38 +00:00
Dennis Schridde 770af57c20 Remove more extra types
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@812 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-04 23:16:51 +00:00
Dennis Schridde 67056c8d24 - Droped a lot of (nearly) unused types from lib/framework/types.h
- Remove lots of unused functions (Windows/DDraw related)
- Now store the used bitdepth in the config and thus make it configurable without having to modify the sourcecode


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@808 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-04 01:11:26 +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
Roman C 3ea3f99f73 Patch by Gerard Krol: lesswarnings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@802 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-02 20:15:08 +00:00
Dennis Schridde 39ff5cc515 Make lots of __inline, _inline, FUNCINLINE and whatnot static inline. See bug#7591.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@798 4a71c877-e1ca-e34f-864e-861f7616d084
2006-10-31 20:22:01 +00:00
Dennis Schridde 5a4a9288b0 Patch by Christian Ohm: Gamma controls
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@786 4a71c877-e1ca-e34f-864e-861f7616d084
2006-10-09 19:22:24 +00:00
Dennis Schridde d163be853d Christian Ohm's PSX removal part 1.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@777 4a71c877-e1ca-e34f-864e-861f7616d084
2006-10-07 16:40:18 +00:00
Stefan Huehner 65e820b246 Add some more missing includes:
seqdisp.c, gtime.c: SDL/SDL_timer.h for SDL_GetTicks()
piesraw.c:          SDL/SDL_video.h for SDL_GL_GetProcAddress()



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@753 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-23 18:52:52 +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 876ab9a3ba Patch by Stefan Huehner: "code cleanup: static 3, 3a"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@712 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-14 16:30:07 +00:00
Dennis Schridde 7e8990c661 Patch by Stefan Huehner: "code cleanup: static"
Patch marks several function & datastructures without prototypes, which aren't used outside their declaring sourcefiles as static.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@708 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-13 21:14:47 +00:00
Dennis Schridde b9087ef4ca Patch by Stefan Huehner: "code cleanup: void 4"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@706 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-13 21:11:11 +00:00
Dennis Schridde 728b9a9913 - Commit patches "code cleanup: void" and "code cleanup: const" by Stefan Huehner
- Replace every occurence of VOID with void (and LPVOID with void*)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@703 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-13 09:09:05 +00:00