[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src display.cpp display.hpp
From: |
Philippe Plantier |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src display.cpp display.hpp |
Date: |
Wed, 25 Aug 2004 16:09:47 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Philippe Plantier <address@hidden> 04/08/25 20:05:12
Modified files:
src : display.cpp display.hpp
Log message:
(cvs internal) fixed level-up fadings that were broken by a previous
commit.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/display.cpp.diff?tr1=1.256&tr2=1.257&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/display.hpp.diff?tr1=1.81&tr2=1.82&r1=text&r2=text
Patches:
Index: wesnoth/src/display.cpp
diff -u wesnoth/src/display.cpp:1.256 wesnoth/src/display.cpp:1.257
--- wesnoth/src/display.cpp:1.256 Wed Aug 25 02:59:51 2004
+++ wesnoth/src/display.cpp Wed Aug 25 20:05:12 2004
@@ -1,4 +1,4 @@
-/* $Id: display.cpp,v 1.256 2004/08/25 02:59:51 Sirp Exp $ */
+/* $Id: display.cpp,v 1.257 2004/08/25 20:05:12 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -90,7 +90,7 @@
std::string::size_type pos;
while((pos = flag.find("%d")) != std::string::npos) {
std::ostringstream s;
- s << int(i+1);
+ s << teams_[i].map_colour_to();
flag.replace(pos, 2, s.str());
}
} else {
@@ -1194,12 +1194,14 @@
const int height_adjust = it->second.is_flying() ? 0 :
int(map_.get_terrain_info(terrain).unit_height_adjust()*zoom());
const double submerge = it->second.is_flying() ? 0.0 :
map_.get_terrain_info(terrain).unit_submerge();
+ double blend_ratio = 0.25;
+
if(loc == advancingUnit_ && it != units_.end()) {
//the unit is advancing - set the advancing colour to white if
it's a
//non-chaotic unit, otherwise black
blend_with = it->second.type().alignment() ==
unit_type::CHAOTIC ?
rgb(16,16,16) :
rgb(255,255,255);
- highlight_ratio = advancingAmount_;
+ blend_ratio = 1 - advancingAmount_;
} else if(it->second.poisoned() /* && highlight_ratio == 1.0 */) {
//the unit is poisoned - draw with a green hue
blend_with = rgb(0,255,0);
@@ -1220,7 +1222,7 @@
}
draw_unit(xpos,ypos - height_adjust,unit_image,false,
-
highlight_ratio,blend_with,submerge,ellipse_back,ellipse_front);
+
highlight_ratio,blend_with,blend_ratio,submerge,ellipse_back,ellipse_front);
}
const double bar_alpha = highlight_ratio < 1.0 && blend_with == 0 ?
highlight_ratio : 1.0;
@@ -1826,7 +1828,7 @@
}
void display::draw_unit(int x, int y, surface image,
- bool upside_down, double alpha, Uint32 blendto, double
submerged,
+ bool upside_down, double alpha, Uint32 blendto, double
blend_ratio, double submerged,
surface ellipse_back, surface ellipse_front)
{
//calculate the y position of the ellipse. It should be the same as the
y position of the image, unless
@@ -1842,8 +1844,8 @@
surf.assign(flop_surface(surf));
}
- if(blendto != 0) {
- surf = blend_surface(surf, 0.25, blendto);
+ if(blend_ratio != 0) {
+ surf = blend_surface(surf, blend_ratio, blendto);
}
if(alpha > 1.0) {
surf = brighten_image(surf,alpha);
Index: wesnoth/src/display.hpp
diff -u wesnoth/src/display.hpp:1.81 wesnoth/src/display.hpp:1.82
--- wesnoth/src/display.hpp:1.81 Sat Aug 21 22:21:05 2004
+++ wesnoth/src/display.hpp Wed Aug 25 20:05:12 2004
@@ -1,4 +1,4 @@
-/* $Id: display.hpp,v 1.81 2004/08/21 22:21:05 Sirp Exp $ */
+/* $Id: display.hpp,v 1.82 2004/08/25 20:05:12 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -323,7 +323,9 @@
//submerged: the amount of the unit out of 1.0 that is submerged
// (presumably under water) and thus shouldn't be drawn
void draw_unit(int x, int y, surface image,
- bool upside_down=false,double alpha=1.0, Uint32
blendto=0, double submerged=0.0,
+ bool upside_down=false,double alpha=1.0,
+ Uint32 blendto=0, double blend_ratio=0,
+ double submerged=0.0,
surface ellipse_back=surface(NULL),
surface ellipse_front=surface(NULL));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src display.cpp display.hpp,
Philippe Plantier <=