Commit Graph

289 Commits (4884837ded0061cbc639f6b9682d432943dd5110)

Author SHA1 Message Date
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