/*
Copyright (C) 2004-2011 Parallel Realities
+Copyright (C) 2011-2015 Perpendicular Dimensions
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
SDL_Surface *panel = graphics.createSurface(320, 240);
SDL_Surface *background = graphics.loadImage("gfx/main/mapBackground.png");
- SDL_SetSurfaceAlphaMod(background, 130);
+ SDL_SetAlpha(background, 130);
graphics.blit(background, 0, 0, panel, false);
- int color = graphics.black;
-
for (int y = 0 ; y < 48 ; y++)
{
for (int x = 0 ; x < 64 ; x++)
{
for (int x = 0 ; x < 64 ; x++)
{
- color = -1;
+ int color = graphics.black;
if (map.data[x1 + x][y1 + y] == MAP_AIR)
{
- color = -1;
+ color = graphics.black;
}
else if (map.data[x1 + x][y1 + y] == MAP_WATER)
{
- color = -1;
+ color = graphics.black;
}
else if (map.data[x1 + x][y1 + y] == MAP_SLIME)
{
}
else if (map.data[x1 + x][y1 + y] >= MAP_DECORATION)
{
- color = -1;
+ color = graphics.black;
if (map.data[x1 + x][y1 + y - 1] == MAP_WATER)
{
color = graphics.darkGreen;
}
- if (color > -1)
+ if (color != graphics.black)
{
graphics.drawRect(x * 5, y * 5, 5, 5, color, panel);
}
if ((config.isControl(CONTROL::MAP)) || (config.isControl(CONTROL::PAUSE)) || (engine.keyState[SDL_SCANCODE_ESCAPE]))
{
+ engine.keyState[SDL_SCANCODE_ESCAPE] = 0;
+ config.resetControl(CONTROL::MAP);
+ config.resetControl(CONTROL::PAUSE);
break;
}
if (ent->dy < 0)
{
- audio.playSound(SND_WATEROUT, CH_TOUCH);
+ audio.playSound(SND_WATEROUT, CH_TOUCH, ent->x);
}
ent->checkEnvironment();
if (ent->environment == ENV_AIR)
{
- audio.playSound(SND_WATERIN, CH_TOUCH);
+ audio.playSound(SND_WATERIN, CH_TOUCH, ent->x);
if ((mapAttribute == MAP_SLIME) || (mapAttribute == MAP_LAVA))
ent->thinktime = 1;
}