From b56004caaa4e1c2b682e5f3391239321acc41b8a Mon Sep 17 00:00:00 2001 From: oroborus Date: Fri, 22 Aug 2008 16:37:04 +0000 Subject: - moznost nastavit ako sa ma screen splitnut tuxanci-svn --split-vertical alebo tuxanci-svn --split-horizontal git-svn-id: http://opensvn.csie.org/tuxanci_ng@239 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/client/game.c | 1 + src/client/layer.c | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src/client') 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, -- cgit v1.2.3