summaryrefslogtreecommitdiff
path: root/src/screen_credits.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-28 16:38:35 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-28 16:38:35 +0000
commit2d776fcd61be168e1ff0ff2e4a5e71835e7cea19 (patch)
tree7cf274897bf540d5332d446f583ffd066e4e2e1d /src/screen_credits.c
parentb877ae23ac5d380ab3aa48d7724045cf4883b186 (diff)
- prekopanie adresarovej struktury, prva cast
git-svn-id: http://opensvn.csie.org/tuxanci_ng@77 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/screen_credits.c')
-rw-r--r--src/screen_credits.c128
1 files changed, 0 insertions, 128 deletions
diff --git a/src/screen_credits.c b/src/screen_credits.c
deleted file mode 100644
index 3416fb5..0000000
--- a/src/screen_credits.c
+++ /dev/null
@@ -1,128 +0,0 @@
-
-#include <stdio.h>
-#include <assert.h>
-
-#include "main.h"
-#include "language.h"
-#include "interface.h"
-#include "list.h"
-#include "textFile.h"
-#include "screen.h"
-#include "image.h"
-#include "music.h"
-#include "fake_audio.h"
-#include "screen_credits.h"
-
-#include "widget_image.h"
-#include "widget_label.h"
-#include "widget_button.h"
-
-static widget_image_t *image_backgorund;
-static widget_button_t *button_back;
-static list_t *listWidgetLabel;
-static textFile_t *textFile;
-static int offset;
-
-void startScreenCredits()
-{
- playMusic("menu", MUSIC_GROUP_BASE);
- offset = 0;
-}
-
-void drawScreenCredits()
-{
- int i;
-
- drawWidgetImage(image_backgorund);
-
- drawWidgetButton(button_back);
-
- for( i = 0 ; i < listWidgetLabel->count ; i++ )
- {
- int z;
-
- widget_label_t *this;
- this = (widget_label_t *)listWidgetLabel->list[i];
-
- z = this->y;
- this->y += offset;
-
- if( this->y > SCREEN_CREDITS_OFFSET_MIN && this->y < SCREEN_CREDITS_OFFSET_MAX )
- {
- drawWidgetLabel(this);
- }
-
- this->y = z;
- }
-
-}
-
-void eventScreenCredits()
-{
- eventWidgetButton(button_back);
-
- offset -= SCREEN_CREDITS_OFFSET_SPEED;
-
- if( offset < SCREEN_CREDITS_OFFSET_RESTART )
- {
- offset = 0;
- }
-
- //printf("offset = %d\n", offset);
-}
-
-void stopScreenCredits()
-{
-}
-
-static void eventWidget(void *p)
-{
- widget_button_t *button;
-
- button = (widget_button_t *)(p);
-
- if( button == button_back )
- {
- setScreen("mainMenu");
- }
-}
-
-void initScreenCredits()
-{
- SDL_Surface *image;
- int i;
-
- image = getImage(IMAGE_GROUP_BASE, "screen_main");
- image_backgorund = newWidgetImage(0, 0, image);
-
- button_back = newWidgetButton(getMyText("BACK"), WINDOW_SIZE_X/2 -WIDGET_BUTTON_WIDTH/2, WINDOW_SIZE_Y-80, eventWidget);
-
- listWidgetLabel = newList();
- accessExistFile(PATH_DATA SCREEN_CREDITS_FILE);
- textFile = loadTextFile(PATH_DATA SCREEN_CREDITS_FILE);
-
- for( i = 0 ; i < textFile->text->count ; i++ )
- {
- widget_label_t *label;
- char *line;
-
- line = (char *)textFile->text->list[i];
- label = newWidgetLabel(line, WINDOW_SIZE_X/2, (WINDOW_SIZE_Y-100)+i*20,
- WIDGET_LABEL_CENTER);
-
- addList(listWidgetLabel, label);
- }
-
- registerScreen( newScreen("credits", startScreenCredits, eventScreenCredits,
- drawScreenCredits, stopScreenCredits) );
-}
-
-void quitScreenCredits()
-{
- destroyWidgetImage(image_backgorund);
-
- destroyWidgetButton(button_back);
- destroyListItem(listWidgetLabel, destroyWidgetLabel);
- destroyTextFile(textFile);
-}
-