Commit Graph

37 Commits (bf5eaace0ac872d38ff4fe3bfa40e2a6fa984134)

Author SHA1 Message Date
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 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 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
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 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
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
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
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 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 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
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 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
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 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
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
Per Inge Mathisen 5396324fb6 Remove lots of unused graphics code. (Did the Pumpkin guys EVER delete code?)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@686 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-03 21:33:29 +00:00
Per Inge Mathisen 2149739999 Almost all strings and buffers are now of type char. This fixes
more than half the warnings on gcc4, and makes sure we do not
get signedness problems between platforms where char is defined
with different signedness. Also set line-ending properites for
some bison/flex files that did not have it set.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@563 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-12 16:52:37 +00:00
Per Inge Mathisen a3df2ad6c8 Another force fix. Remove more references to DirectX.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@552 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-10 13:53:26 +00:00
Per Inge Mathisen 081ec89b32 Remove legacy graphics code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@550 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-08 20:03:05 +00:00
Per Inge Mathisen 711ca1ff01 Remove a great deal of software renderer related code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@497 4a71c877-e1ca-e34f-864e-861f7616d084
2006-07-23 10:35:30 +00:00
Dennis Schridde 5175535d9d Full pathname includes
Same as in r431, but now for lib/
- converted the sources in lib/ to use full path includes instead of just the filename.
- marked places where lib/ivis_*implementation* (eg opengl) is needed, because of incomplete lib/ivis_common.

Should improve the understanding of interfaces and code organization.

(Also fixed a double slash (//) include in src/multimenu.c)



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@432 4a71c877-e1ca-e34f-864e-861f7616d084
2006-06-02 19:34:58 +00:00
No Author 5ba7ddac6b Create final repository structure.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@362 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-28 17:47:08 +00:00