[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src blitter.cxx,1.3,1.4
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src blitter.cxx,1.3,1.4 |
Date: |
20 Jun 2002 15:41:30 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv20691
Modified Files:
blitter.cxx
Log Message:
- added own version of min/max/mid
Index: blitter.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/blitter.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- blitter.cxx 20 Jun 2002 11:23:53 -0000 1.3
+++ blitter.cxx 20 Jun 2002 15:41:28 -0000 1.4
@@ -25,6 +25,7 @@
#include "color.hxx"
#include "string_converter.hxx"
#include "globals.hxx"
+#include "math.hxx"
#include "blitter.hxx"
/* Headers needed for i18n / gettext */
@@ -32,7 +33,7 @@
#include <config.h>
#include "my_gettext.hxx"
-using namespace std;
+using namespace Pingus;
void
Blitter::put_surface(CL_Canvas* canvas, const CL_Surface& sur,
@@ -212,10 +213,10 @@
// FIXME: This doesn't give correct alpha values
canvas->draw_pixel(x + x_pos, y + y_pos,
- max(0.0, min(1.0, (red * alpha) + (tred *
(1.0-alpha)))),
- max(0.0, min(1.0, (green * alpha) +(tgreen *
(1.0-alpha)))),
- max(0.0, min(1.0, (blue * alpha) + (tblue *
(1.0-alpha)))),
- max(0.0, min(1.0, alpha * alpha +
(talpha*(1.0-alpha)))));
+ Math::mid(0.0, 1.0, (red * alpha) + (tred *
(1.0-alpha))),
+ Math::mid(0.0, 1.0, (green * alpha) +(tgreen *
(1.0-alpha))),
+ Math::mid(0.0, 1.0, (blue * alpha) + (tblue *
(1.0-alpha))),
+ Math::mid(0.0, 1.0, alpha * alpha +
(talpha*(1.0-alpha))));
}
}
else // fast?!
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src blitter.cxx,1.3,1.4,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src math.hxx,NONE,1.1
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src blitter.cxx,1.4,1.5 math.hxx,1.1,1.2
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src math.hxx,NONE,1.1
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src blitter.cxx,1.4,1.5 math.hxx,1.1,1.2
- Index(es):