132 Commits

Author SHA1 Message Date
Ali El Gariani
288001b625 Optimize the fogging of the minimap:
The darkening of a fogged mini-tile was done in real-time for each one
and take ~80% of the rendering time. So, now use a small cache (few
8x8 tiles) for the fogged version (like we already do for the unfogged
one).

Much faster but probably noticable only on big map and/or slow CPU.
2007-09-17 11:33:52 +00:00
Ali El Gariani
ce9701c318 Make ~TC robust as ~RC:
remove the spaces in parameters because some people use ~TC(1, magenta) 

We also generally need robust image-paths modifications
because any add-on can (badly) use it in the add-on list
2007-09-03 20:33:30 +00:00
Ali El Gariani
bab30040d8 ~TC was incompletely restored after the adhesion storm
Now initialize and reset TC in titlescreen for add-ons and campaigns icons
(previously was only initialized after having played a game)
This also restore coloring for case like ~TC(not a playing side)
2007-09-03 20:02:28 +00:00
Gunter Labes
ae9e10f260 codeclean run
set svn:eol-style to native where missing
2007-08-31 19:09:40 +00:00
Hans Joachim Gurt
8f3ba4ed6c doxygen, comments 2007-08-22 02:06:11 +00:00
Mark de Wever
080eb69f60 Updated the headers to state GPL 2+ and a few changelog cleanups. 2007-08-15 13:41:56 +00:00
Ali El Gariani
922cdf6835 Faster switch between default zoom level and a custom one.
This make the "strategic view" of the previous commit more convenient.

It exploits the cache optimization for default zoom introduced in 1.3.4.

Like always, low memory systems must avoid using zooming.  But this
doesn't change the memory requirements for them or for the zoom users
2007-08-14 05:50:44 +00:00
Mark de Wever
b4c9f875fe Make sure the image cache is flushed when a new builder object is created,
also make sure the existance cache is flushed. The previous behaviour
caused the upcomming themable offmap tile to fail.
2007-08-12 14:09:37 +00:00
Patrick Parker
faf815ae72 graceful error handling for invalid color ranges
(note: this means you must check stdout.txt for error message)
2007-08-07 01:22:55 +00:00
Ali El Gariani
3bf93e724a The adjust_color parameter was broken and so not really used.
It worked only for an image::type and was incorrectly cached. So, I
remove it. It change nothing for the current use: "scaled_to_hex" for
ToD coloring and "unmasked" if not.
2007-08-05 01:10:02 +00:00
Patrick Parker
e8fe8b6b5f team colors:
allow color ranges to be defined on-the-fly (like color palettes)
 
now [side] colour=<string> is valid (previously only int)
2007-07-27 04:42:47 +00:00
Mark de Wever
bb01934b85 A rather large update which updates the copyright info
* Wesnoth is distributed under the terms of the GPL version 2, made
  that more explicit

* updated the copyright range to 2007

* updated Dave's email adress
2007-07-21 07:28:04 +00:00
Ali El Gariani
ecc8a46423 Restore ~TC imagepath mod feature...
...which was killed only for code-refactoring reasons.  This simply
intialize a vector of each TC colors when we load the side-coloring of
flags.  (note that we can always improve/kill it, but now the
implementation problem doesn't pollute the question)
2007-07-18 13:43:21 +00:00
Eric S. Raymond
de2e1071a7 Retire TC until and unless we can find a way to do it "above the line"...
in the team-aware code.
2007-07-03 20:27:46 +00:00
Mark de Wever
b68d0a56bf And another patch to kill the unused parameter warnings,
...but in a portable way.  Also restore the default value for
can_execute_command which was removed before.
2007-06-09 06:34:05 +00:00
Eric S. Raymond
8fb016cbe9 Eliminate all but three compiler warnings.
Most are banished by use of a new UNUSED macro that expnds to the
right GNU C++ attribute but an empty string elsewhere.  I have the
definition being generated into config.h, which therefore has to be
included a few places it wasn't before.  There might be a better place
to put it.
2007-06-08 19:54:28 +00:00
Ali El Gariani
7bc115743c remove a never-used cache "alternative_images"
commented out code about the ToD masks, currently we don't cache it
here, we just blit it in display.cpp
2007-06-08 16:00:57 +00:00
Ali El Gariani
2950c43d98 Important optimization of the cache size and zooming...
...for standard terrain at default zoom level:

Previously the image type UNMASKED was a cache for hex-masking and
scaling.  added a type HEXED for caching the hex-masking, when using
it skip the UNSCALED, since these hexed images will normally never be
used non-hexed.

So this new cache doesn't cost memory and hex-masking doesn't need to
be redone when zooming.

At default zoom level, we can now skip the UNMASKED cache, so will
spare a cache level in memory

In theory, we win 25%-33% of memory space (depend of the use of
BRIGHTENED) for standard terrain hexes.

Note: the hex-masking and scaling operations are now inverted, it
doesn't seems to have a visible effect.
2007-06-08 14:05:33 +00:00
Mark de Wever
65c0563f9d removes zipios support.
Project files in the root haven't been updated since I'm unable to test them.
2007-06-02 06:46:01 +00:00
Ali El Gariani
e3637f74f9 comment out a non-working part of code about image_mask 2007-05-22 21:45:55 +00:00
David Philippi
f231fb12e0 merged patch #714 by silene
- removal of dead stuff and static linkage marking for internal functions
2007-04-06 12:26:02 +00:00
Ali El Gariani
e8b9cd24bf The ratio given by zoom() is now zoom/tile_size.
This make more sense (how much stretch the tiles), change nothing for
the normal gui and fix centering of units in tiny gui.
2007-04-02 03:06:14 +00:00
Ali El Gariani
0541e0335b Don't flush the units cache when ToD color changes
(units are not ToD colored)
2007-03-27 17:43:04 +00:00
Mark de Wever
6d67ae6e92 Added a new image type which only depends on the scaling factor,
...and used this type for units and haloes.

renamed some items to scaled_to_hex (forgot that in the previous image
change)

I consider this too intrusive to port to the 1.2 branch.

It fixes:

 * units are scaled properly when zooming also with tiny gui (bug
   #8703 and bug #6570)

 * haloes in tiny gui are now scaled (before unscaled, thus a factor 2
   bigger as intended)

 * removes the scaling handling in the halo, removing quite some code
2007-03-17 12:07:51 +00:00
Mark de Wever
035b2f4678 renamed SCALED to SCALED_TO_HEX
as preparation to allow units to be properly scaled
2007-03-16 23:18:29 +00:00
Mark de Wever
54fcb6902f tiles with overlays are also properly shown if compiled with --enable-tinygui
(bug #8720 patch #697)
2007-03-13 14:20:24 +00:00
Mark de Wever
3734f61e55 removed dead line of code 2007-02-16 22:53:27 +00:00
Patrick Parker
4df11b9720 added image flip function, as requested by Eleazar ;) 2007-02-15 03:44:36 +00:00
Mark de Wever
e43975a05b removed unused function register_image 2007-02-04 22:30:38 +00:00
Mark de Wever
9d5f3ec2c7 removed unused function get_colour_adjustment 2007-02-04 22:18:11 +00:00
Mark de Wever
efc168df87 removed unused function get_alternative 2007-02-04 22:05:40 +00:00
Mark de Wever
2654360bcb removed unused function get_image_dim 2007-02-04 21:55:22 +00:00
Mark de Wever
a9742f01eb marked serveral functions for inlining 2007-02-04 21:44:15 +00:00
Jérémy Rosen
8fa217d398 remove the darkened image cache, overlay images/terrain/darken.png instead.
this should reduce mem consumption a lot... but there is still work to
do. Artists should feel free to imprve the new image
2006-11-24 20:07:01 +00:00
Patrick Parker
2abd619502 another fix to ~TC():
the first parameter is a side number N, not a color range of the name N.
2006-11-19 05:23:40 +00:00
Patrick Parker
f1c7d846d0 fix substring calculation of ~TC() second parameter 2006-11-17 05:06:25 +00:00
John W. C. McNabb
c165ad2cde Change new TC function to RC function and restore old
TC function definition.
2006-11-17 01:23:03 +00:00
John W. C. McNabb
53c9ed0db7 Make image replacement do nothing if the new color range is unknown. 2006-11-14 19:38:21 +00:00
John W. C. McNabb
28b06edc9d [[Fixes for LOW_MEM behavior]] 2006-11-12 18:38:34 +00:00
John W. C. McNabb
735bc2afaf Step towards TC upgrade 2006-11-05 17:45:32 +00:00
Jérémy Rosen
e7633095ff unit images arn't cached, except when standing 2006-10-07 12:07:39 +00:00
Karol Nowak
428994b4ab Some silly code formating fixes. 2006-08-10 12:16:52 +00:00
Patrick Parker
d5aa645603 <Xan|> image.cpp: after line 132 add val_.type_ = SUB_FILE;
<Xan|> And remove the else clause on line 304
<Xan|> And the Eastern Invasion campaign cfg has a typo in the icon path.
2006-07-21 05:37:23 +00:00
Patrick Parker
cac45240c1 changed constructor syntax for MSVC6 compat. 2006-07-20 00:43:39 +00:00
Dominic Bolin
2b640beadc Syntax change to TC, and fix a few more spots that use it.
MP selection always uses red, because the selection dialogs don't know
what color to use.
2006-07-19 22:10:24 +00:00
Dominic Bolin
caf2704de6 Implement team-coloring mark-up system, and fix tc of recruit menu. 2006-07-19 18:08:27 +00:00
András Salamon
99bbbd6a51 whitespace cleanup 2006-01-12 11:04:50 +00:00
John W. C. McNabb
0c56b20f75 cleanup of team color code 2005-12-15 17:33:20 +00:00
John W. C. McNabb
c6d4551563 modifications to team_rgb 2005-12-12 04:09:50 +00:00
Isaac Clerencia Perez
c334ea5ca9 Little hack to image.cpp to try to load images from images/units...
...if the image isn't found in images/ (it seems to work here,
somebody else should review it anyway :P)

PS. We should remember to revert the hack when we have decided a rational
image directory structure
2005-12-07 07:53:05 +00:00