forked from DusteDdk/Wizznic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpack.h
71 lines (59 loc) · 2.67 KB
/
pack.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef PACK_H_INCLUDED
#define PACK_H_INCLUDED
/************************************************************************
* This file is part of Wizznic. *
* Copyright 2009-2011 Jimmy Christensen <[email protected]> *
* Wizznic is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* Wizznic is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with Foobar. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include <SDL/SDL.h>
#include "list.h"
#include "sprite.h"
#include "levels.h"
struct packInfo_s {
char* name; //Name user sees
char* author;
char* comment;
char* path; //Path to pack
SDL_Surface* icon;
listItem* levels; //LevelInfo*'s
int numLevels;
int hasFinishedImg;
};
typedef struct packInfo_s packInfoType;
struct packState_s {
int numPacks; //Number of packs
int selected; //Currently selected
listItem* packs; //PackInfoType*s
packInfoType* cp; //Current pack
SDL_Surface* packBoxImg; //Graphics for the box
SDL_Surface* finishedImg;; //Image shown when cp is completed (0 = not been loaded)
spriteType* packBoxSpr[2];
};
typedef struct packState_s packStateType;
typedef struct {
int from,to;
char* song;
} playListItem;
void packInit(); //Generate pack list
void packSet(int packNum); //Set selected pack, default to wizznic if out of range.
void packSetByPath(const char* dir); //Search through packs to find dir, if none found, default to 0.
packStateType* packState(); //Return ptr to packstate.
const char* packGetFile(const char* path,const char* fn); //Return filename for file in currently selected pack, or from wizznic if not found there.
levelInfo_t* levelInfo(int num);
int getNumLevels();
void packFreeGfx(); //Free the images and sprites used to show packs.
void showPackBox(SDL_Surface* screen, int posx, int posy, int packNum);
int isFile(const char* fileName);
int isDir(const char* dirName);
#endif // PACK_H_INCLUDED