summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/game.c1
-rwxr-xr-xsrc/client/layer.c19
2 files changed, 18 insertions, 2 deletions
diff --git a/src/client/game.c b/src/client/game.c
index b0d2322..faf89bb 100644
--- a/src/client/game.c
+++ b/src/client/game.c
@@ -48,6 +48,7 @@ static void initGame()
initSDL();
initFont(FONT_FILE , FONT_SIZE);
initLayer();
+ initArena();
initImageData();
#ifndef NO_SOUND
initAudio();
diff --git a/src/client/layer.c b/src/client/layer.c
index 5aa8124..770a916 100755
--- a/src/client/layer.c
+++ b/src/client/layer.c
@@ -158,9 +158,8 @@ void drawLayerSplit(int local_x, int local_y, int x, int y, int w, int h)
if( local_x + (this->x - x) < local_x )
{
- //this->x = local_x;
int z;
- z = ( local_x + (this->x - x) + this->w ) - local_x;
+
z = local_x - ( local_x + (this->x - x) );
this->x += z;
@@ -173,6 +172,22 @@ void drawLayerSplit(int local_x, int local_y, int x, int y, int w, int h)
this->w -= ( local_x + (this->x - x) + this->w ) - (local_x + w);
}
+ if( local_y + (this->y - y) < local_y )
+ {
+ int z;
+
+ z = local_y - ( local_y + (this->y - y) );
+
+ this->y += z;
+ this->py += z;
+ this->h -= z;
+ }
+
+ if( local_y + (this->y - y) + this->h > local_y+h )
+ {
+ this->h -= ( local_y + (this->y - y) + this->h ) - (local_y + h);
+ }
+
drawImage(this->image,
local_x + (this->x - x), local_y + (this->y - y),
this->px, this->py,