summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-08-22 11:55:33 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-08-22 11:55:33 +0000
commit1e656ce31aca56aa802245b220850ebba6672d93 (patch)
tree2d10ae7ad3d8bc3d77733683ab2ea24c7f461ad9 /src/client
parent3e36d08598a3ab43ddce32f2b34295447d32e38e (diff)
- podpora split screenu v bigArenacha pri hre na jednom PC :)
( zatial teka technikca verzia ) git-svn-id: http://opensvn.csie.org/tuxanci_ng@238 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/client')
-rwxr-xr-xsrc/client/layer.c58
-rwxr-xr-xsrc/client/layer.h1
2 files changed, 51 insertions, 8 deletions
diff --git a/src/client/layer.c b/src/client/layer.c
index c0c9c03..5aa8124 100755
--- a/src/client/layer.c
+++ b/src/client/layer.c
@@ -110,19 +110,12 @@ void drawLayerCenter(int x, int y)
int i;
//int count = 0;
- getCenterScreen(&screen_x, &screen_y, x, y);
+ getCenterScreen(&screen_x, &screen_y, x, y, WINDOW_SIZE_X, WINDOW_SIZE_Y);
for( i = 0 ; i < listLayer->count ; i++ )
{
this = (layer_t *)listLayer->list[i];
-/*
- if( (this->x - screen_x) + this->w < 0 || (this->x - screen_x) > WINDOW_SIZE_X ||
- (this->y - screen_y) + this->h < 0 || (this->y - screen_y) > WINDOW_SIZE_Y )
- {
- continue;
- }
-*/
if( this->x + this->w < screen_x || this->x > screen_x + WINDOW_SIZE_X ||
this->y + this->h < screen_y || this->y > screen_y + WINDOW_SIZE_Y )
{
@@ -145,6 +138,55 @@ void drawLayerCenter(int x, int y)
listLayer = newList();
}
+void drawLayerSplit(int local_x, int local_y, int x, int y, int w, int h)
+{
+ layer_t *this;
+ int i;
+ //int count = 0;
+
+ for( i = 0 ; i < listLayer->count ; i++ )
+ {
+ this = (layer_t *)listLayer->list[i];
+
+ if( this->x + this->w < x || this->x > x + w ||
+ this->y + this->h < y || this->y > y + h )
+ {
+ continue;
+ }
+
+ //count++;
+
+ 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;
+ this->px += z;
+ this->w -= z;
+ }
+
+ if( local_x + (this->x - x) + this->w > local_x+w )
+ {
+ this->w -= ( local_x + (this->x - x) + this->w ) - (local_x + w);
+ }
+
+ drawImage(this->image,
+ local_x + (this->x - x), local_y + (this->y - y),
+ this->px, this->py,
+ this->w, this->h);
+
+ //printf("%d %d\n", this->x - screen_x, this->y - screen_y);
+ }
+
+ //printf("count = %d\n", count);
+
+ destroyListItem(listLayer, free);
+ listLayer = newList();
+}
+
void flushLayer()
{
destroyListItem(listLayer, free);
diff --git a/src/client/layer.h b/src/client/layer.h
index f61a162..eea611a 100755
--- a/src/client/layer.h
+++ b/src/client/layer.h
@@ -48,6 +48,7 @@ extern void addLayer(image_t *img,
*/
extern void drawLayer();
extern void drawLayerCenter(int x, int y);
+extern void drawLayerSplit(int local_x, int local_y, int x, int y, int w, int h);
extern void flushLayer();
extern void quitLayer();