summaryrefslogtreecommitdiff
path: root/src/screen/screen_choiceArena.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-09-02 22:07:07 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-09-02 22:07:07 +0000
commit7c4d8699b2e9ba64f98bd2a0290080726fa8ccfe (patch)
treebdb43761035b14a4ad1dd2d86c7e12a89963a0a0 /src/screen/screen_choiceArena.c
parentf8204ae7059f1b49c01c72e1bc9647f366cb34b9 (diff)
- areny su ulozene v *.zip archivoch
( totalne rozmrdany zdrojovy kod -- zajtra to dokoncim ) git-svn-id: http://opensvn.csie.org/tuxanci_ng@263 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/screen/screen_choiceArena.c')
-rw-r--r--src/screen/screen_choiceArena.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/screen/screen_choiceArena.c b/src/screen/screen_choiceArena.c
index 6d10649..ca14c0c 100644
--- a/src/screen/screen_choiceArena.c
+++ b/src/screen/screen_choiceArena.c
@@ -29,7 +29,7 @@ static widget_t *button_play;
static widget_t *button_back;
static list_t *listWidgetButtonimage;
-static int choiceArenaId;
+static arenaFile_t* currentArena;
void startScreenChoiceArena()
{
@@ -90,7 +90,7 @@ static void eventWidgetButtonImage(void *p)
if( buttonimage == this )
{
setWidgetButtonimageActive(this, TRUE);
- choiceArenaId = i;
+ currentArena = getArenaFile(i);
}
else
{
@@ -99,18 +99,23 @@ static void eventWidgetButtonImage(void *p)
}
}
-int getChoiceArenaId()
+arenaFile_t* getChoiceArenaId()
{
- return choiceArenaId;
+ return currentArena;
}
void setChoiceArenaId(int n)
{
widget_t *widget_buttonimage;
- choiceArenaId = n;
+ if( n < 0 )
+ {
+ return;
+ }
+
+ currentArena = getArenaFile(n);
- widget_buttonimage = (widget_t *)listWidgetButtonimage->list[choiceArenaId];
+ widget_buttonimage = (widget_t *)listWidgetButtonimage->list[n];
setWidgetButtonimageActive(widget_buttonimage, TRUE);
}
@@ -143,14 +148,21 @@ void initScreenChoiceArena()
button_play = newWidgetButton(_("play"), WINDOW_SIZE_X-200, WINDOW_SIZE_Y-100, eventWidget);
listWidgetButtonimage = newList();
- choiceArenaId = 0;
+ currentArena = NULL;
for( i = 0 ; i < getArenaCount() ; i++ )
{
widget_t *widget_buttonimage;
+ arenaFile_t* arenaFile;
int x, y;
- image = addImageData(getArenaImage(i), IMAGE_NO_ALPHA, "none", IMAGE_GROUP_BASE);
+ arenaFile = getArenaFile(i);
+ //image = addImageData(getArenaImage(i), IMAGE_NO_ALPHA, "none", IMAGE_GROUP_BASE);
+ image = loadImageFromArena(arenaFile,
+ getArenaImage(arenaFile),
+ IMAGE_GROUP_BASE,
+ "none",
+ IMAGE_NO_ALPHA);
x = 100 + 200 * ( i - 3 * ( i/3 ) );
y = 150 + 200 * ( i/3 );