[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2509 - in trunk/src: . editor
From: |
jave27 |
Subject: |
[Pingus-CVS] r2509 - in trunk/src: . editor |
Date: |
Fri, 18 Nov 2005 03:26:54 +0100 |
Author: jave27
Date: 2005-11-18 03:26:45 +0100 (Fri, 18 Nov 2005)
New Revision: 2509
Modified:
trunk/src/blitter.cxx
trunk/src/editor/xml_level.cxx
Log:
Fixed a Blitter bug for non-Mac systems.
Modified: trunk/src/blitter.cxx
===================================================================
--- trunk/src/blitter.cxx 2005-11-17 17:42:26 UTC (rev 2508)
+++ trunk/src/blitter.cxx 2005-11-18 02:26:45 UTC (rev 2509)
@@ -192,9 +192,6 @@
* 17msec with uint8
*/
- std::cout << "X: " << start_x << " " << end_x << std::endl;
- std::cout << "Y: " << start_y << " " << end_y << std::endl;
-
cl_uint8* target_buf = static_cast<cl_uint8*>(target.get_data());
cl_uint8* source_buf = static_cast<cl_uint8*>(source.get_data());
@@ -203,6 +200,7 @@
int tidx = 4*(twidth * (y_pos + y) + x_pos);
int sidx = 4*(swidth * y);
+ /*
if (0)
{ // Fast but doesn't handle masks
memcpy(target_buf + tidx + 4*start_x, source_buf + sidx + 4*start_x,
@@ -234,7 +232,7 @@
sptr += 4;
}
}
- else
+ else */
{
// doesn't handle masks either, but looks half correct
cl_uint8* tptr = target_buf + tidx + 4*start_x;
@@ -242,17 +240,17 @@
for (int x = start_x; x < end_x; ++x)
{
- float a = sptr[3]/255.0f;
-
if (!CL_Endian::is_system_big())
{
- tptr[0] = Math::mid(0, int((1.0f - a) * tptr[0] + a *
sptr[3]), 255);
- tptr[1] = Math::mid(0, int((1.0f - a) * tptr[1] + a *
sptr[0]), 255);
- tptr[2] = Math::mid(0, int((1.0f - a) * tptr[2] + a *
sptr[1]), 255);
- tptr[3] = Math::mid(0, int((1.0f - a) * tptr[3] + a *
sptr[2]), 255);
+ float a =
sptr[0]/255.0f;
+ tptr[0] = Math::mid(0, int((1.0f - a) * tptr[0] + a *
sptr[0]), 255);
+ tptr[1] = Math::mid(0, int((1.0f - a) * tptr[1] + a *
sptr[1]), 255);
+ tptr[2] = Math::mid(0, int((1.0f - a) * tptr[2] + a *
sptr[2]), 255);
+ tptr[3] = Math::mid(0, int((1.0f - a) * tptr[3] + a *
sptr[3]), 255);
}
else
{
+ float a = sptr[3]/255.0f;
tptr[3] = Math::mid(0, int((1.0f - a) * tptr[3] + a *
sptr[3]), 255);
tptr[2] = Math::mid(0, int((1.0f - a) * tptr[2] + a *
sptr[0]), 255);
tptr[1] = Math::mid(0, int((1.0f - a) * tptr[1] + a *
sptr[1]), 255);
@@ -267,7 +265,6 @@
source.unlock();
target.unlock();
- std::cout << "done" << std::endl;
}
void
@@ -608,7 +605,6 @@
for (int y = 0; y < height; ++y)
for (int x = 0; x < width; ++x)
{
- // std::cout << "X: " << x << " Y: " << y << std::endl;
CL_Color color = provider.get_pixel(x * provider.get_width () /
width,
y * provider.get_height ()
/ height);
// FIXME: ignoring the source alpha due to get_pixel
Modified: trunk/src/editor/xml_level.cxx
===================================================================
--- trunk/src/editor/xml_level.cxx 2005-11-17 17:42:26 UTC (rev 2508)
+++ trunk/src/editor/xml_level.cxx 2005-11-18 02:26:45 UTC (rev 2509)
@@ -46,7 +46,18 @@
delete impl;
}
-// Verify that level is valid
+/** Verify that level is valid:
+ Level should contain the following attributes in order to be "valid":
+ -----------
+ LevelObj's:
+ - At least 1 entrance
+ - At least 1 exit
+ - Exactly 1 surface-background
+ - Each object should be within valid ranges (pos Vector should be inside the
world)
+ -----------
+ Head section:
+ - Everything should be filled in and within valid ranges
+ */
bool XMLLevel::is_valid()
{
std::cout << "XMLLevel::is_valid() - Not yet implemented" << std::endl;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2509 - in trunk/src: . editor,
jave27 <=