[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2495 - in trunk/src: . worldobjs
From: |
jave27 |
Subject: |
[Pingus-CVS] r2495 - in trunk/src: . worldobjs |
Date: |
Mon, 14 Nov 2005 15:09:14 +0100 |
Author: jave27
Date: 2005-11-14 15:08:55 +0100 (Mon, 14 Nov 2005)
New Revision: 2495
Modified:
trunk/src/blitter.cxx
trunk/src/credits.cxx
trunk/src/credits.hxx
trunk/src/pingu.cxx
trunk/src/pingus_main.cxx
trunk/src/savegame_manager.cxx
trunk/src/smallmap_image.cxx
trunk/src/spot_map.cxx
trunk/src/worldobjs/surface_background.cxx
Log:
Applied Sean Heber's (BigZaphod's) MacOSX patch. Pingus can now compile and
run on MacOSX.
Modified: trunk/src/blitter.cxx
===================================================================
--- trunk/src/blitter.cxx 2005-11-10 20:38:25 UTC (rev 2494)
+++ trunk/src/blitter.cxx 2005-11-14 14:08:55 UTC (rev 2495)
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <assert.h>
#include <ClanLib/Core/System/clanstring.h>
+#include <ClanLib/Core/IOData/cl_endian.h>
#include <ClanLib/Core/IOData/datatypes.h>
#include <ClanLib/Display/palette.h>
#include <ClanLib/Display/pixel_buffer.h>
@@ -104,10 +105,20 @@
{
if (*sptr != colorkey)
{
- tptr[0] = 255;
- tptr[1] = palette.colors[*sptr].get_blue();
- tptr[2] = palette.colors[*sptr].get_green();
- tptr[3] = palette.colors[*sptr].get_red();
+ if (!CL_Endian::is_system_big())
+ {
+ tptr[0] = 255;
+ tptr[1] = palette.colors[*sptr].get_blue();
+ tptr[2] = palette.colors[*sptr].get_green();
+ tptr[3] = palette.colors[*sptr].get_red();
+ }
+ else
+ {
+ tptr[3] = 255;
+ tptr[2] = palette.colors[*sptr].get_blue();
+ tptr[1] = palette.colors[*sptr].get_green();
+ tptr[0] = palette.colors[*sptr].get_red();
+ }
}
tptr += 4;
@@ -123,11 +134,21 @@
cl_uint8* sptr = source_buf + swidth*y + start_x;
for (int x = start_x; x < end_x; ++x)
- {
- tptr[0] = 255;
- tptr[1] = palette.colors[*sptr].get_blue();
- tptr[2] = palette.colors[*sptr].get_green();
- tptr[3] = palette.colors[*sptr].get_red();
+ {
+ if (!CL_Endian::is_system_big())
+ {
+ tptr[0] = 255;
+ tptr[1] = palette.colors[*sptr].get_blue();
+ tptr[2] = palette.colors[*sptr].get_green();
+ tptr[3] = palette.colors[*sptr].get_red();
+ }
+ else
+ {
+ tptr[3] = 255;
+ tptr[2] = palette.colors[*sptr].get_blue();
+ tptr[1] = palette.colors[*sptr].get_green();
+ tptr[0] = palette.colors[*sptr].get_red();
+ }
tptr += 4;
sptr += 1;
@@ -194,10 +215,20 @@
for (int x = start_x; x < end_x; ++x)
{
- tptr[0] = sptr[3];
- tptr[1] = sptr[0];
- tptr[2] = sptr[1];
- tptr[3] = sptr[2];
+ if (!CL_Endian::is_system_big())
+ {
+ tptr[0] = sptr[3];
+ tptr[1] = sptr[0];
+ tptr[2] = sptr[1];
+ tptr[3] = sptr[2];
+ }
+ else
+ {
+ tptr[3] = sptr[3];
+ tptr[2] = sptr[0];
+ tptr[1] = sptr[1];
+ tptr[0] = sptr[2];
+ }
tptr += 4;
sptr += 4;
@@ -212,12 +243,22 @@
for (int x = start_x; x < end_x; ++x)
{
float a = sptr[3]/255.0f;
-
- 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);
+ 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);
+ }
+ else
+ {
+ 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);
+ tptr[0] = Math::mid(0, int((1.0f - a) * tptr[0] + a *
sptr[2]), 255);
+ }
+
tptr += 4;
sptr += 4;
}
@@ -265,9 +306,18 @@
for (int x = start_x; x < end_x; ++x)
{
- tptr[0] = color.get_red();
- tptr[1] = color.get_green();
- tptr[2] = color.get_blue();
+ if (!CL_Endian::is_system_big())
+ {
+ tptr[0] = color.get_red();
+ tptr[1] = color.get_green();
+ tptr[2] = color.get_blue();
+ }
+ else
+ {
+ tptr[2] = color.get_red();
+ tptr[1] = color.get_green();
+ tptr[0] = color.get_blue();
+ }
tptr += 3;
}
}
@@ -282,9 +332,18 @@
for (int x = start_x; x < end_x; ++x)
{
- tptr[0] = Math::mid(0, int(((1.0f - a) * (tptr[0])) + a *
color.get_blue()) , 255); //blue
- tptr[1] = Math::mid(0, int(((1.0f - a) * (tptr[1])) + a *
color.get_green()), 255); //green
- tptr[2] = Math::mid(0, int(((1.0f - a) * (tptr[2])) + a *
color.get_red()), 255); //red
+ if (!CL_Endian::is_system_big())
+ {
+ tptr[0] = Math::mid(0, int(((1.0f - a) * (tptr[0])) + a *
color.get_blue()) , 255); //blue
+ tptr[1] = Math::mid(0, int(((1.0f - a) * (tptr[1])) + a *
color.get_green()), 255); //green
+ tptr[2] = Math::mid(0, int(((1.0f - a) * (tptr[2])) + a *
color.get_red()), 255); //red
+ }
+ else
+ {
+ tptr[2] = Math::mid(0, int(((1.0f - a) * (tptr[2])) + a *
color.get_blue()) , 255); //blue
+ tptr[1] = Math::mid(0, int(((1.0f - a) * (tptr[1])) + a *
color.get_green()), 255); //green
+ tptr[0] = Math::mid(0, int(((1.0f - a) * (tptr[0])) + a *
color.get_red()), 255); //red
+ }
tptr += 3;
}
@@ -301,10 +360,20 @@
for (int x = start_x; x < end_x; ++x)
{
- tptr[0] = 255;
- tptr[1] = color.get_blue();
- tptr[2] = color.get_green();
- tptr[3] = color.get_red();
+ if (!CL_Endian::is_system_big())
+ {
+ tptr[0] = 255;
+ tptr[1] = color.get_blue();
+ tptr[2] = color.get_green();
+ tptr[3] = color.get_red();
+ }
+ else
+ {
+ tptr[3] = 255;
+ tptr[2] = color.get_blue();
+ tptr[1] = color.get_green();
+ tptr[0] = color.get_red();
+ }
tptr += 4;
}
}
@@ -319,10 +388,20 @@
{
float a = color.get_alpha()/255.0f;
- tptr[0] = Math::mid(0, int(tptr[0] + a * color.get_alpha()),
255);
- tptr[1] = Math::mid(0, int((1.0f - a) * tptr[1] + a *
color.get_blue()) , 255);
- tptr[2] = Math::mid(0, int((1.0f - a) * tptr[2] + a *
color.get_green()), 255);
- tptr[3] = Math::mid(0, int((1.0f - a) * tptr[3] + a *
color.get_red()) , 255);
+ if (!CL_Endian::is_system_big())
+ {
+ tptr[0] = Math::mid(0, int(tptr[0] + a *
color.get_alpha()), 255);
+ tptr[1] = Math::mid(0, int((1.0f - a) * tptr[1] + a *
color.get_blue()) , 255);
+ tptr[2] = Math::mid(0, int((1.0f - a) * tptr[2] + a *
color.get_green()), 255);
+ tptr[3] = Math::mid(0, int((1.0f - a) * tptr[3] + a *
color.get_red()) , 255);
+ }
+ else
+ {
+ tptr[3] = Math::mid(0, int(tptr[3] + a *
color.get_alpha()), 255);
+ tptr[2] = Math::mid(0, int((1.0f - a) * tptr[2] + a *
color.get_blue()) , 255);
+ tptr[1] = Math::mid(0, int((1.0f - a) * tptr[1] + a *
color.get_green()), 255);
+ tptr[0] = Math::mid(0, int((1.0f - a) * tptr[0] + a *
color.get_red()) , 255);
+ }
}
}
}
@@ -367,10 +446,20 @@
for (int si = 0, ti = 0; si < buffer_size; si += 3, ti += 4)
{
- tbuffer[ti + 0] = 255; // Alpha
- tbuffer[ti + 1] = sbuffer[si + 0];
- tbuffer[ti + 2] = sbuffer[si + 1];
- tbuffer[ti + 3] = sbuffer[si + 2];
+ if (!CL_Endian::is_system_big())
+ {
+ tbuffer[ti + 0] = 255; // Alpha
+ tbuffer[ti + 1] = sbuffer[si + 0];
+ tbuffer[ti + 2] = sbuffer[si + 1];
+ tbuffer[ti + 3] = sbuffer[si + 2];
+ }
+ else
+ {
+ tbuffer[ti + 3] = 255; // Alpha
+ tbuffer[ti + 2] = sbuffer[si + 0];
+ tbuffer[ti + 1] = sbuffer[si + 1];
+ tbuffer[ti + 0] = sbuffer[si + 2];
+ }
}
// -FIXME: memory hole
@@ -429,9 +518,18 @@
unsigned char pixel = *(static_cast<unsigned
char*>(provider.get_data ())
+ (y * pheight/height) *
provider.get_pitch() + (x * pwidth/width));
- color.red = provider.get_palette().colors[pixel*3 +0].color /
255.0f;
- color.green = provider.get_palette().colors[pixel*3 +1].color /
255.0f;
- color.blue = provider.get_palette().colors[pixel*3 +2].color /
255.0f;
+ if (!CL_Endian::is_system_big())
+ {
+ color.red = provider.get_palette().colors[pixel*3 +0].color /
255.0f;
+ color.green = provider.get_palette().colors[pixel*3
+1].color / 255.0f;
+ color.blue = provider.get_palette().colors[pixel*3 +2].color /
255.0f;
+ }
+ else
+ {
+ color.red = provider.get_palette().colors[pixel*3 +1].color /
255.0f;
+ color.green = provider.get_palette().colors[pixel*3 +1].color /
255.0f;
+ color.blue = provider.get_palette().colors[pixel*3 +0].color /
255.0f;
+ }
if (provider.get_format().has_colorkey()
&& provider.get_format().get_colorkey() == pixel)
@@ -459,10 +557,20 @@
int si = ((y * pheight / height) * pwidth
+ (x * pwidth / width)) * 3;
- tbuffer[ti + 0] = 255; // alpha
- tbuffer[ti + 1] = sbuffer[(si + 0)]; // blue
- tbuffer[ti + 2] = sbuffer[(si + 1)]; // green
- tbuffer[ti + 3] = sbuffer[(si + 2)]; // red
+ if (!CL_Endian::is_system_big())
+ {
+ tbuffer[ti + 0] = 255; // alpha
+ tbuffer[ti + 1] = sbuffer[(si + 0)]; // blue
+ tbuffer[ti + 2] = sbuffer[(si + 1)]; // green
+ tbuffer[ti + 3] = sbuffer[(si + 2)]; // red
+ }
+ else
+ {
+ tbuffer[ti + 3] = 255; // alpha
+ tbuffer[ti + 0] = sbuffer[(si + 0)]; // blue
+ tbuffer[ti + 1] = sbuffer[(si + 1)]; // green
+ tbuffer[ti + 2] = sbuffer[(si + 2)]; // red
+ }
}
}
break;
@@ -477,10 +585,20 @@
int si = ((y * pheight / height) * pwidth
+ (x * pwidth / width)) * 4;
- tbuffer[ti + 0] = sbuffer[(si + 0)]; // alpha
- tbuffer[ti + 1] = sbuffer[(si + 1)]; // blue
- tbuffer[ti + 2] = sbuffer[(si + 2)]; // green
- tbuffer[ti + 3] = sbuffer[(si + 3)]; // red
+ if (!CL_Endian::is_system_big())
+ {
+ tbuffer[ti + 0] = sbuffer[(si + 0)]; // alpha
+ tbuffer[ti + 1] = sbuffer[(si + 1)]; // blue
+ tbuffer[ti + 2] = sbuffer[(si + 2)]; // green
+ tbuffer[ti + 3] = sbuffer[(si + 3)]; // red
+ }
+ else
+ {
+ tbuffer[ti + 3] = sbuffer[(si + 0)]; // alpha
+ tbuffer[ti + 2] = sbuffer[(si + 1)]; // blue
+ tbuffer[ti + 1] = sbuffer[(si + 2)]; // green
+ tbuffer[ti + 0] = sbuffer[(si + 3)]; // red
+ }
}
}
break;
Modified: trunk/src/credits.cxx
===================================================================
--- trunk/src/credits.cxx 2005-11-10 20:38:25 UTC (rev 2494)
+++ trunk/src/credits.cxx 2005-11-14 14:08:55 UTC (rev 2495)
@@ -101,9 +101,14 @@
credits.push_back("_Kenneth Gangst�");
credits.push_back("_Michael K�ser");
credits.push_back("_Neil Mitchell");
- credits.push_back("_Jason Green");
+ credits.push_back("_Jason Green");
credits.push_back("n");
+ credits.push_back(_("-Porting (MacOSX)"));
+ credits.push_back("_Jason Green");
+ credits.push_back("_Sean Heber");
+ credits.push_back("n");
+
credits.push_back(_("-Gfx"));
credits.push_back("_Alan Tennent");
credits.push_back("_Craig Timpany");
@@ -241,21 +246,21 @@
else
{
if (fast_scrolling)
- offset -= static_cast<int>(450.0f * delta);
+ offset -= 450.0f * delta;
else
- offset -= static_cast<int>(35.0f * delta);
+ offset -= 35.0f * delta;
}
}
void
Credits::draw_background (DrawingContext& gc)
{
- int x;
- int y;
- int yof;
+ float x;
+ float y;
+ float yof;
x = CL_Display::get_width()/2;
- y = int(offset);
+ y = offset;
gc.draw(background, Vector(gc.get_width()/2, gc.get_height()/2));
gc.draw(pingu, Vector(gc.get_width()/2, gc.get_height()/2 - 20));
@@ -274,13 +279,11 @@
switch ((*i)[0])
{
case '-':
- gc.print_center(font, static_cast<float>(x),
-
static_cast<float>(y + yof), i->substr(1));
+ gc.print_center(font, x, (y + yof), i->substr(1));
yof += font.get_height() + 5;
break;
case '_':
- gc.print_center(font_small, static_cast<float>(x),
-
static_cast<float>(y + yof), i->substr(1));
+ gc.print_center(font_small, x, (y + yof), i->substr(1));
yof += font_small.get_height() + 5;
break;
case 'n':
Modified: trunk/src/credits.hxx
===================================================================
--- trunk/src/credits.hxx 2005-11-10 20:38:25 UTC (rev 2494)
+++ trunk/src/credits.hxx 2005-11-14 14:08:55 UTC (rev 2495)
@@ -43,8 +43,8 @@
bool is_init;
- int end_offset;
- int offset;
+ float end_offset;
+ float offset;
/** The string's which are shown in the scrolling text, the first
character of the string can be used to apply a special format.
Modified: trunk/src/pingu.cxx
===================================================================
--- trunk/src/pingu.cxx 2005-11-10 20:38:25 UTC (rev 2494)
+++ trunk/src/pingu.cxx 2005-11-14 14:08:55 UTC (rev 2495)
@@ -320,7 +320,7 @@
die. */
if (rel_getpixel(0, -1) == Groundtype::GP_OUTOFSCREEN)
{
- Sound::PingusSound::play_sound("die");
+ //Sound::PingusSound::play_sound("die");
status = PS_DEAD;
return;
}
@@ -356,9 +356,7 @@
// FIXME: in ticks, should probally be in seconds]
snprintf(str, 16, "%d", action_time/3);
- gc.color().print_center(Fonts::lcd,
- static_cast<int>(pos_x), static_cast<int>(pos_y
- 45) + 2,
- str);
+ gc.color().print_center(Fonts::lcd, pos_x, pos_y - 45 + 2, str);
}
gc.light().draw(light, get_center_pos());
Modified: trunk/src/pingus_main.cxx
===================================================================
--- trunk/src/pingus_main.cxx 2005-11-10 20:38:25 UTC (rev 2494)
+++ trunk/src/pingus_main.cxx 2005-11-14 14:08:55 UTC (rev 2495)
@@ -245,6 +245,8 @@
_("Disable some cpu intensive features"));
argp.add_option(353, "min-cpu-usage", "",
_("Reduces the CPU usage by issuing sleep()"));
+ argp.add_option(359, "show-credits", "",
+ _("Shows the credits"));
argp.add_group(_("Demo playing and recording:"));
argp.add_option('p', "play-demo", _("FILE"),
Modified: trunk/src/savegame_manager.cxx
===================================================================
--- trunk/src/savegame_manager.cxx 2005-11-10 20:38:25 UTC (rev 2494)
+++ trunk/src/savegame_manager.cxx 2005-11-14 14:08:55 UTC (rev 2495)
@@ -80,7 +80,7 @@
}
}
}
- catch (CL_Error& err)
+ catch (...)
{
std::cout << "SavegameManager: Couldn't find savegame file '" << filename
<< "', starting with a empty one." << std::endl;
Modified: trunk/src/smallmap_image.cxx
===================================================================
--- trunk/src/smallmap_image.cxx 2005-11-10 20:38:25 UTC (rev 2494)
+++ trunk/src/smallmap_image.cxx 2005-11-14 14:08:55 UTC (rev 2495)
@@ -17,6 +17,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#include <ClanLib/Core/IOData/cl_endian.h>
#include <ClanLib/Display/pixel_buffer.h>
#include <ClanLib/Display/pixel_format.h>
#include "world.hxx"
@@ -107,49 +108,109 @@
switch (current_pixel)
{
case Groundtype::GP_NOTHING:
- cbuffer[i + 0] = alpha;
- cbuffer[i + 1] = 0;
- cbuffer[i + 2] = 0;
- cbuffer[i + 3] = 0;
+ if (!CL_Endian::is_system_big())
+ {
+ cbuffer[i + 0] = alpha;
+ cbuffer[i + 1] = 0;
+ cbuffer[i + 2] = 0;
+ cbuffer[i + 3] = 0;
+ }
+ else
+ {
+ cbuffer[i + 3] = alpha;
+ cbuffer[i + 2] = 0;
+ cbuffer[i + 1] = 0;
+ cbuffer[i + 0] = 0;
+ }
break;
case Groundtype::GP_BRIDGE:
- cbuffer[i + 0] = 255;
- cbuffer[i + 1] = 100;
- cbuffer[i + 2] = 255;
- cbuffer[i + 3] = 0;
+ if (!CL_Endian::is_system_big())
+ {
+ cbuffer[i + 0] = 255;
+ cbuffer[i + 1] = 100;
+ cbuffer[i + 2] = 255;
+ cbuffer[i + 3] = 0;
+ }
+ else
+ {
+ cbuffer[i + 3] = 255;
+ cbuffer[i + 2] = 100;
+ cbuffer[i + 1] = 255;
+ cbuffer[i + 0] = 0;
+ }
break;
case Groundtype::GP_WATER:
case Groundtype::GP_LAVA:
- cbuffer[i + 0] = 255;
- cbuffer[i + 1] = 200;
- cbuffer[i + 2] = 0;
- cbuffer[i + 3] = 0;
+ if (!CL_Endian::is_system_big())
+ {
+ cbuffer[i + 0] = 255;
+ cbuffer[i + 1] = 200;
+ cbuffer[i + 2] = 0;
+ cbuffer[i + 3] = 0;
+ }
+ else
+ {
+ cbuffer[i + 3] = 255;
+ cbuffer[i + 2] = 200;
+ cbuffer[i + 1] = 0;
+ cbuffer[i + 0] = 0;
+ }
break;
#if 0
// FIXME: temporaty disabled for 0.6.0 release, since all
liquids are currently lava
case Groundtype::GP_LAVA:
- cbuffer[i + 0] = 255; // alpha
- cbuffer[i + 1] = 255; // blue
- cbuffer[i + 2] = 128; // green
- cbuffer[i + 3] = 128; // red
+ if (!CL_Endian::is_system_big())
+ {
+ cbuffer[i + 0] = 255; // alpha
+ cbuffer[i + 1] = 255; // blue
+ cbuffer[i + 2] = 128; // green
+ cbuffer[i + 3] = 128; // red
+ }
+ else
+ {
+ cbuffer[i + 3] = 255; // alpha
+ cbuffer[i + 2] = 255; // blue
+ cbuffer[i + 1] = 128; // green
+ cbuffer[i + 0] = 128; // red
+ }
break;
#endif
case Groundtype::GP_SOLID:
- cbuffer[i + 0] = 255;
- cbuffer[i + 1] = 100;
- cbuffer[i + 2] = 100;
- cbuffer[i + 3] = 100;
+ if (!CL_Endian::is_system_big())
+ {
+ cbuffer[i + 0] = 255;
+ cbuffer[i + 1] = 100;
+ cbuffer[i + 2] = 100;
+ cbuffer[i + 3] = 100;
+ }
+ else
+ {
+ cbuffer[i + 3] = 255;
+ cbuffer[i + 2] = 100;
+ cbuffer[i + 1] = 100;
+ cbuffer[i + 0] = 100;
+ }
break;
default:
- cbuffer[i + 0] = 255;
- cbuffer[i + 1] = 200;
- cbuffer[i + 2] = 200;
- cbuffer[i + 3] = 200;
+ if (!CL_Endian::is_system_big())
+ {
+ cbuffer[i + 0] = 255;
+ cbuffer[i + 1] = 200;
+ cbuffer[i + 2] = 200;
+ cbuffer[i + 3] = 200;
+ }
+ else
+ {
+ cbuffer[i + 3] = 255;
+ cbuffer[i + 2] = 200;
+ cbuffer[i + 1] = 200;
+ cbuffer[i + 0] = 200;
+ }
break;
}
}
Modified: trunk/src/spot_map.cxx
===================================================================
--- trunk/src/spot_map.cxx 2005-11-10 20:38:25 UTC (rev 2494)
+++ trunk/src/spot_map.cxx 2005-11-14 14:08:55 UTC (rev 2495)
@@ -22,6 +22,7 @@
#include <ClanLib/Display/pixel_buffer.h>
#include <ClanLib/Display/pixel_format.h>
#include <ClanLib/Core/core_iostream.h>
+#include <ClanLib/Core/IOData/cl_endian.h>
#include "display/scene_context.hxx"
#include "pingus_error.hxx"
#include "blitter.hxx"
@@ -232,10 +233,13 @@
for (int x = start_x; x < end_x; ++x)
{
- if (*sptr != colorkey
&&
-
colmap->getpixel(real_x_arg+x, real_y_arg+y)
- !=
Groundtype::GP_SOLID)
- *tptr = 0;
+ if (*sptr != colorkey && colmap->getpixel(real_x_arg+x,
real_y_arg+y) != Groundtype::GP_SOLID)
+ {
+ if (!CL_Endian::is_system_big())
+ *tptr = 0;
+ else
+ tptr[3] = 0;
+ }
tptr += 4;
sptr += 1;
@@ -251,9 +255,13 @@
for (int x = start_x; x < end_x; ++x)
{
- if (colmap->getpixel(real_x_arg+x, real_y_arg+y)
- !=
Groundtype::GP_SOLID)
- *tptr = 0;
+ if (colmap->getpixel(real_x_arg+x, real_y_arg+y) !=
Groundtype::GP_SOLID)
+ {
+ if (!CL_Endian::is_system_big())
+ *tptr = 0;
+ else
+ tptr[3] = 0;
+ }
tptr += 4;
sptr += 1;
Modified: trunk/src/worldobjs/surface_background.cxx
===================================================================
--- trunk/src/worldobjs/surface_background.cxx 2005-11-10 20:38:25 UTC (rev
2494)
+++ trunk/src/worldobjs/surface_background.cxx 2005-11-14 14:08:55 UTC (rev
2495)
@@ -194,11 +194,11 @@
// to handle this.
for(int y = start_y;
y < world->get_height();
- y += bg_surface.get_height() -1)
+ y += bg_surface.get_height())
{
for(int x = start_x;
x < world->get_width();
- x += bg_surface.get_width() -1)
+ x += bg_surface.get_width())
{
gc.color().draw(bg_surface,
Vector(static_cast<float>(x),
static_cast<float>(y)));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2495 - in trunk/src: . worldobjs,
jave27 <=