hi Denis,<br><br>I see that this commit of yours draws several comments of mine obsolete. sorry that I replied to your commits as I read them instead of reading them all and filtered unnecessary comments. I have also already read your reply to my e-mail.<br>
<br><br><div class="gmail_quote">
On Wed, Jul 22, 2009 at 6:42 AM, <span dir="ltr"><<a href="mailto:dkasak13@users.sourceforge.net" target="_blank">dkasak13@users.sourceforge.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Revision: 42647<br>
<a href="http://scummvm.svn.sourceforge.net/scummvm/?rev=42647&view=rev" target="_blank">http://scummvm.svn.sourceforge.net/scummvm/?rev=42647&view=rev</a><br>
Author: dkasak13<br>
Date: 2009-07-22 04:42:33 +0000 (Wed, 22 Jul 2009)<br>
<br>
Log Message:<br>
-----------<br>
* Moved scaling support from Animation to Sprite<br>
* Now each Sprite (and hence frame in an animation) can have a separate zoom (which is needed for some animations in the game)<br>
</blockquote><div><br>sounds good. is it needed by the dragon's walking animations when he gradually comes closer? that makes sense.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
* Scale factors are not stored any more; instead, we only store scaled dimensions (since these are stored in the data files) and calculate the factors from those.<br>
</blockquote><div><br>sounds good, and I would suggest on top of that to get rid of scaling factors whatsoever and working only with the scaled dimensions. that way you will only need integers instead of floats. we don't use floats except for computing the perspective scaling, which is OK, because these computations need not be precise. however, sprite scaling must be precise, so integers are generally better.<br>
<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Modified: scummvm/branches/gsoc2009-draci/engines/draci/game.cpp<br>
===================================================================<br>
--- scummvm/branches/gsoc2009-draci/engines/draci/game.cpp 2009-07-22 00:12:48 UTC (rev 42646)<br>
+++ scummvm/branches/gsoc2009-draci/engines/draci/game.cpp 2009-07-22 04:42:33 UTC (rev 42647)<br>
@@ -176,27 +176,33 @@<br>
+ // Set the scaled dimensions for all frames<br>
+ for (uint i = 0; i < anim->getFramesNum(); ++i) {<br>
+ frame = anim->getFrame(i);<br>
+<br>
+ // Calculate scaled dimensions<br>
+ uint scaledWidth = scaleX * frame->getWidth();<br>
+ uint scaledHeight = scaleY * frame->getHeight();<br>
+<br>
+ frame->setScaled(scaledWidth, scaledHeight);<br>
+ }</blockquote><div><br>ok, as you said, this may be useful in the future if one uses zooming in the game player.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Modified: scummvm/branches/gsoc2009-draci/engines/draci/sprite.cpp<br>
===================================================================<br>
--- scummvm/branches/gsoc2009-draci/engines/draci/sprite.cpp 2009-07-22 00:12:48 UTC (rev 42646)<br>
+++ scummvm/branches/gsoc2009-draci/engines/draci/sprite.cpp 2009-07-22 04:42:33 UTC (rev 42647)<br>
@@ -152,6 +161,10 @@<br>
int *rowIndices = new int[rows];<br>
int *columnIndices = new int[columns];<br>
<br>
+ // Calculate scaling factors<br>
+ double scaleX = double(_scaledWidth) / _width;<br>
+ double scaleY = double(_scaledHeight) / _height;<br>
+<br>
// Precalculate pixel indexes<br>
for (int i = 0; i < rows; ++i) {<br>
rowIndices[i] = lround(i / scaleY);<br>
</blockquote><div><br>even if you keep the rest of the code as is, in the future, it would be nice to reimplement it without using floats. you only use it for linear scaling and that can be done as well using integers only. I can show you how if you want.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Modified: scummvm/branches/gsoc2009-draci/engines/draci/sprite.h<br>
===================================================================<br>
--- scummvm/branches/gsoc2009-draci/engines/draci/sprite.h 2009-07-22 00:12:48 UTC (rev 42646)<br>
+++ scummvm/branches/gsoc2009-draci/engines/draci/sprite.h 2009-07-22 04:42:33 UTC (rev 42647)<br>
@@ -38,17 +38,21 @@<br>
<br>
public:<br>
virtual void draw(Surface *surface, bool markDirty = true) const = 0;<br>
- virtual void drawScaled(Surface *surface, double scaleX, double scaleY,<br>
- bool markDirty = true) const = 0;<br>
+ virtual void drawScaled(Surface *surface, bool markDirty = true) const = 0;<br>
</blockquote><div><br>please comment on which method does what<br></div></div><br>-- <br>Robert Špalek <<a href="mailto:rspalek@gmail.com" target="_blank">rspalek@gmail.com</a>><br>