Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Nuked all windows newlines.

Corrected "Foobar" to "Wizznic" in GPL header.
  • Loading branch information...
commit aa80153cd889299e5102fbdd19da32732de577a0 1 parent d237e7c
Jimmy authored
Showing with 1,359 additions and 1,356 deletions.
  1. +94 −94 board.c
  2. +21 −21 board.h
  3. +266 −266 credits.c
  4. +11 −11 credits.h
  5. +4 −4 cursor.c
  6. +1 −1  cursor.h
  7. +6 −1 defs.h
  8. +68 −68 draw.c
  9. +18 −18 draw.h
  10. +7 −7 dumplevelimages.c
  11. +7 −7 dumplevelimages.h
  12. +1 −1  game.c
  13. +8 −8 game.h
  14. +2 −2 input.c
  15. +7 −7 input.h
  16. +1 −1  leveleditor.c
  17. +8 −8 leveleditor.h
  18. +49 −49 levels.c
  19. +7 −7 levels.h
  20. +2 −2 levelselector.c
  21. +7 −7 levelselector.h
  22. +1 −1  list.c
  23. +7 −7 list.h
  24. +7 −7 loader.h
  25. +1 −1  main.c
  26. +1 −1  mbrowse.c
  27. +4 −4 mbrowse.h
  28. +1 −1  menu.c
  29. +5 −5 menu.h
  30. +6 −6 pack.c
  31. +5 −5 pack.h
  32. +3 −3 particle.c
  33. +8 −8 particles.h
  34. +1 −1  pixel.c
  35. +3 −3 pixel.h
  36. +62 −62 platform/pc.c
  37. +1 −1  platform/pc.h
  38. +1 −1  player.c
  39. +6 −6 player.h
  40. +1 −1  pointer.c
  41. +2 −2 pointer.h
  42. +12 −12 settings.c
  43. +7 −7 settings.h
  44. +3 −3 sound.c
  45. +8 −8 sound.h
  46. +5 −5 sprite.c
  47. +6 −6 sprite.h
  48. +198 −198 stars.c
  49. +14 −14 stars.h
  50. +15 −15 states.h
  51. +1 −1  stats.c
  52. +10 −10 stats.h
  53. +1 −1  strings.c
  54. +1 −1  strings.h
  55. +37 −37 swscale.c
  56. +1 −1  swscale.h
  57. +91 −91 teleport.c
  58. +20 −20 teleport.h
  59. +95 −95 text.c
  60. +15 −15 text.h
  61. +1 −1  ticks.c
  62. +6 −6 ticks.h
  63. +2 −2 tools/releaser/data/wiz/wiz-launch-ini.ini
  64. +1 −1  userfiles.c
  65. +6 −6 userfiles.h
  66. +51 −51 waveimg.c
  67. +17 −17 waveimg.h
  68. +14 −16 wizznic.cbp
188 board.c
View
@@ -12,19 +12,19 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
-#include "board.h"
+#include "board.h"
-#include <stdio.h>
+#include <stdio.h>
#include "ticks.h"
#include "strings.h"
-#include "teleport.h"
+#include "teleport.h"
#include "particles.h"
#include "draw.h"
-#include "input.h"
-
+#include "input.h"
+
static int isWall(playField* pf, int x, int y)
{
@@ -143,9 +143,9 @@ void boardSetWalls(playField* pf)
}
}
-int loadField(playField* pf, const char* file)
-{
- FILE *f = fopen(file, "r");
+int loadField(playField* pf, const char* file)
+{
+ FILE *f = fopen(file, "r");
if(!f)
{
printf("%s %i Board: couldn't open '%s'\n",__FILE__,__LINE__,file);
@@ -201,13 +201,13 @@ int loadField(playField* pf, const char* file)
pf->board[x][y]->curLock=0;
pf->board[x][y]->sx = x;
pf->board[x][y]->sy = y;
- pf->board[x][y]->dx = x;
- pf->board[x][y]->dy = y;
+ pf->board[x][y]->dx = x;
+ pf->board[x][y]->dy = y;
pf->board[x][y]->tl = MOVERCOUNTDOWN;
pf->board[x][y]->moveXspeed = 0;
pf->board[x][y]->moveYspeed = 0;
-
- pf->board[x][y]->dmx = 0;
+
+ pf->board[x][y]->dmx = 0;
} else {
pf->board[x][y] = 0;
}
@@ -228,8 +228,8 @@ int loadField(playField* pf, const char* file)
//Figure out which tile to use for each wall (int 6)
boardSetWalls(pf);
- return(1);
-}
+ return(1);
+}
void freeField(playField* pf)
{
@@ -283,7 +283,7 @@ int moveBrick(playField* pf, int x, int y, int dirx, int diry, int block, int sp
return(0);
}
}
-
+
//If destination is empty
if( !pf->board[dx][dy] || (block==NOBLOCK && (!pf->board[dx][dy] || pf->board[dx][dy]->type==RESERVED)) )
{
@@ -309,10 +309,10 @@ int moveBrick(playField* pf, int x, int y, int dirx, int diry, int block, int sp
}
return(0);
-}
-
-//Move a brick instantly to teleports dest
-void telePortBrick(playField* pf,telePort_t* t,cursorType* cur)
+}
+
+//Move a brick instantly to teleports dest
+void telePortBrick(playField* pf,telePort_t* t,cursorType* cur)
{
psysSet_t ps; //Particle system for particle effect
brickType* b = pf->board[t->sx][t->sy];
@@ -395,7 +395,7 @@ void telePortBrick(playField* pf,telePort_t* t,cursorType* cur)
//Play sound
sndPlayOnce(SND_TELEPORTED, b->pxx);
-
+
}
void doTelePort(playField* pf,cursorType* cur)
@@ -424,7 +424,7 @@ static int vertMover(playField* pf,int x, int y, int dir)
{
//Outside bounds
if(y+dir < 0 || y+dir == FIELDSIZE) return(0);
-
+
//Abort if it's not a brick, or a mover.
if(!isBrick(pf->board[x][y]) && !isMover(pf->board[x][y]) ) return(0);
@@ -518,24 +518,24 @@ void simField(playField* pf, cursorType* cur)
//Do we need to move it?
int deltaX= (b->dx*brickSize+boardOffsetX) - b->pxx ;
int deltaY= (b->dy*brickSize+boardOffsetY) - b->pxy ;
-
+
if(deltaX || deltaY )
{
//Doing this lock to only move one dir at a time
if( deltaX )
{
- b->pxx += b->moveXspeed;
-
- if(b->moveXspeed < 0 && b->pxx < (b->dx*brickSize+boardOffsetX) )
- b->pxx = (b->dx*brickSize+boardOffsetX);
-
- if(b->moveXspeed > 0 && b->pxx > (b->dx*brickSize+boardOffsetX) )
- b->pxx = (b->dx*brickSize+boardOffsetX);
-
+ b->pxx += b->moveXspeed;
+
+ if(b->moveXspeed < 0 && b->pxx < (b->dx*brickSize+boardOffsetX) )
+ b->pxx = (b->dx*brickSize+boardOffsetX);
+
+ if(b->moveXspeed > 0 && b->pxx > (b->dx*brickSize+boardOffsetX) )
+ b->pxx = (b->dx*brickSize+boardOffsetX);
+
}
- if( deltaY)
+ if( deltaY)
{
- b->pxy += b->moveYspeed;
+ b->pxy += b->moveYspeed;
}
//}
//Is cursor attached?
@@ -561,9 +561,9 @@ void simField(playField* pf, cursorType* cur)
b->moveYspeed=0;
//Put it down:
- pf->board[ b->dx ][ b->dy ] = b;
-
-
+ pf->board[ b->dx ][ b->dy ] = b;
+
+
//Clear source
pf->board[ b->sx ][ b->sy ] = 0;
@@ -577,7 +577,7 @@ void simField(playField* pf, cursorType* cur)
}
//May I be forgiven for I do not know better.
- brickType* hack;
+ brickType* hack;
//Run teleport rules first
doTelePort(pf,cur);
@@ -602,16 +602,16 @@ void simField(playField* pf, cursorType* cur)
pf->board[x][y]->curLock=0;
}
- //Things that happens below it
- if(y+1 < FIELDSIZE)
- {
+ //Things that happens below it
+ if(y+1 < FIELDSIZE)
+ {
//Falling?
if( !pf->board[x][y+1] )
{
//Move down
moveBrick(pf, x, y, 0, DIRDOWN, DOBLOCK, FALLINGSPEED);
- } else //Laying on a reserved brick might mean that it should be attached to a mover.
+ } else //Laying on a reserved brick might mean that it should be attached to a mover.
{
if( pf->board[x][y+1]->type == RESERVED) //Magnet to mover
{
@@ -638,10 +638,10 @@ void simField(playField* pf, cursorType* cur)
break;
}
} else if(b->type==MOVERVERT)
- {
-
- //Only magnet if it's moving down (if it's moving up, it will eventually hit the resting brick)
- if(b->sy < b->dy)
+ {
+
+ //Only magnet if it's moving down (if it's moving up, it will eventually hit the resting brick)
+ if(b->sy < b->dy)
{
//Fetch the original underlying brick.
b=findMoving(pf, x,y+1);
@@ -651,9 +651,9 @@ void simField(playField* pf, cursorType* cur)
hack->pxy=b->pxy-20;
hack->moveYspeed=b->moveYspeed;
break;
- }
+ }
}
- }
+ }
b=findMoving(pf,x,b->dy+1);
} else {
@@ -662,8 +662,8 @@ void simField(playField* pf, cursorType* cur)
} //Loop through list
}
- } //Resting on a reserved
- } //Not free
+ } //Resting on a reserved
+ } //Not free
}
}
@@ -746,29 +746,29 @@ void simField(playField* pf, cursorType* cur)
}
}
- }
+ }
}
}
- }
+ }
for(y=FIELDSIZE-1; y > -1; y--)
{
for(x=0; x < FIELDSIZE; x++)
{
- if(pf->board[x][y])
+ if(pf->board[x][y])
{
- //Unmark "checked" status.
- pf->board[x][y]->checked=0;
-
- //Do delayed x movement
- if( isBrick(pf->board[x][y]) && pf->board[x][y]->dmx )
- {
- b=pf->board[x][y];
- curMoveBrick(pf, b, b->dmx);
- b->dmx=0;
- }
-
+ //Unmark "checked" status.
+ pf->board[x][y]->checked=0;
+
+ //Do delayed x movement
+ if( isBrick(pf->board[x][y]) && pf->board[x][y]->dmx )
+ {
+ b=pf->board[x][y];
+ curMoveBrick(pf, b, b->dmx);
+ b->dmx=0;
+ }
+
}
}
}
@@ -799,7 +799,7 @@ int doRules(playField* pf)
listItem* li=pf->movingList;
brickType* b;
while( (li = li->next) )
- {
+ {
if( isBrick((brickType*)li->data) )
bricksLeft++;
}
@@ -965,23 +965,23 @@ brickType* findMoving(playField* pf, int x, int y)
}
return(0);
-}
-
-brickType* brickUnderCursor(playField* pf, int x, int y)
-{
- brickType* b=findMoving(pf,x,y);
-
- //If it's not moving, they maybe it's standing still
- if( !b && pf->board[x][y] )
- b=pf->board[x][y];
-
- if( b && isBrick(b) )
- return(b);
-
- return(0);
-}
-
-int curMoveBrick(playField *pf, brickType *b, int dir)
+}
+
+brickType* brickUnderCursor(playField* pf, int x, int y)
+{
+ brickType* b=findMoving(pf,x,y);
+
+ //If it's not moving, they maybe it's standing still
+ if( !b && pf->board[x][y] )
+ b=pf->board[x][y];
+
+ if( b && isBrick(b) )
+ return(b);
+
+ return(0);
+}
+
+int curMoveBrick(playField *pf, brickType *b, int dir)
{
//We can't move the brick, if it is falling.
if( isBrickFalling(pf, b) ) return(0);
@@ -989,26 +989,26 @@ int curMoveBrick(playField *pf, brickType *b, int dir)
//We can't move it if it is on top of brick that is exploding (makes "glitch" solving possible).
if( onTopOfReserved(pf, b->dx, b->dy) ) return(0);
- //Move brick that is not moving<.
- if(b->moveXspeed==0 && b->moveYspeed==0)
+ //Move brick that is not moving<.
+ if(b->moveXspeed==0 && b->moveYspeed==0)
{
- //First, check that it's a brick, and not a reserved.
+ //First, check that it's a brick, and not a reserved.
if(pf->board[b->sx][b->sy] && isBrick( pf->board[b->sx][b->sy]) )
- {
+ {
if(moveBrick( pf, b->sx, b->sy, dir, 0, DOBLOCK, CURSORMOVESPEED))
{
return(1);
}
- }
- } else {
- if( ((b->moveXspeed < 0 && dir > 0) || (b->moveXspeed > 0 && dir <0)) || b->moveYspeed )
+ }
+ } else {
+ if( ((b->moveXspeed < 0 && dir > 0) || (b->moveXspeed > 0 && dir <0)) || b->moveYspeed )
{
if(!b->dmx)
- {
- b->dmx = dir;
+ {
+ b->dmx = dir;
return(1);
- }
- }
+ }
+ }
}
- return(0);
-}
+ return(0);
+}
42 board.h
View
@@ -1,5 +1,5 @@
-#ifndef BOARD_H_INCLUDED
-#define BOARD_H_INCLUDED
+#ifndef BOARD_H_INCLUDED
+#define BOARD_H_INCLUDED
/************************************************************************
* This file is part of Wizznic. *
@@ -15,14 +15,14 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
-
+
#include "defs.h"
#include "cursor.h"
#include "list.h"
#include "sound.h"
-#include "levels.h"
+#include "levels.h"
#include "teleport.h"
#define NOBRICKSLEFT -1
@@ -32,7 +32,7 @@ struct brick_t
{
int type;
int dx, dy; //destionation positions, for when moving
- int sx, sy; //source destionation, for clearing block when they moved
+ int sx, sy; //source destionation, for clearing block when they moved
int dmx; //"Delayed movement" for if moving a brick when it's between bricks.
int moveXspeed, moveYspeed;
int pxx, pxy; //Position in pixels
@@ -46,7 +46,7 @@ struct brick_t
};
typedef struct brick_t brickType;
-struct playField_t
+struct playField_t
{
levelInfo_t* levelInfo;
@@ -56,21 +56,21 @@ struct playField_t
brickType* blocker; //Universial, invisible, quite magic blocker, for reserving space when bricks are travelling.
listItem* movingList; //Start of the linked list of moving bricks
- listItem* removeList; //Start of the linked list of bricks that's going to die, tl counts down their lifespan
+ listItem* removeList; //Start of the linked list of bricks that's going to die, tl counts down their lifespan
};
-
-typedef struct playField_t playField;
-void boardSetWalls(playField* pf);
+typedef struct playField_t playField;
+
+void boardSetWalls(playField* pf);
int loadField(playField* pf, const char* file); //Henter et spillefelt med filnavnet, retunerer 0 ved fejl.
-void freeField(playField* pf); //Frees allocated memory
+void freeField(playField* pf); //Frees allocated memory
void simField(playField* pf, cursorType* cur); //Does logic on the field (gravity/moving bricks)
-int doRules(playField* pf); //Does gameRules, returns number of bricks destroyed, returns -1 when no more bricks left.
-int moveBrick(playField* pf, int x, int y, int dirx,int diry, int block, int speed); //Move a brick within the field (if possible) in either 0:Left, 1: Right, returns 1 on success
-
-void telePortBrick(playField* pf,telePort_t* t, cursorType* cur);
-
-
+int doRules(playField* pf); //Does gameRules, returns number of bricks destroyed, returns -1 when no more bricks left.
+int moveBrick(playField* pf, int x, int y, int dirx,int diry, int block, int speed); //Move a brick within the field (if possible) in either 0:Left, 1: Right, returns 1 on success
+
+void telePortBrick(playField* pf,telePort_t* t, cursorType* cur);
+
+
int isBrickFalling(playField* pf, brickType* b);
inline int isBrick(brickType* b);
@@ -78,7 +78,7 @@ int isMover(brickType* b);
int isOneWay(brickType* b);
int curMoveBrick(playField *pf, brickType *b, int dir);
-brickType* findMoving(playField* pf, int x, int y);
+brickType* findMoving(playField* pf, int x, int y);
brickType* brickUnderCursor(playField* pf, int x, int y);
-
-#endif // BOARD_H_INCLUDED
+
+#endif // BOARD_H_INCLUDED
532 credits.c
View
@@ -12,292 +12,292 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
-#include "credits.h"
-#include "waveimg.h"
-#include "pixel.h"
-#include "text.h"
-#include "list.h"
+#include "credits.h"
+#include "waveimg.h"
+#include "pixel.h"
+#include "text.h"
+#include "list.h"
#include "particles.h"
-#include "defs.h"
+#include "defs.h"
#include "settings.h"
-
-#define MSGSTATE_TITLE_SLIDING_IN 0
-#define MSGSTATE_NAME_SLIDING_IN 1
-#define MSGSTATE_NAME_DECREASE_WAVE 2
-#define MSGSTATE_NAME_SHAKING 3
-#define MSGSTATE_NEXT_MSG 4
-
-struct msg_s {
- SDL_Surface *surfTitle;
- wavingImage_t nameWaving;
- int state;
- int stateTicks;
- SDL_Rect rTitle;
- SDL_Rect nWander;
-};
-typedef struct msg_s msg_t;
-
-static msg_t* cm; //Current msg.
-static int currentMsgIndex; //in list
-static listItem* msgList;
-static int ticksToNextPs=0;
-static psysSet_t ps;
-SDL_Rect r; //Used to shake the name
-
-
-
-msg_t* initMsg(const char* strTitle, const char* strName,SDL_Surface* screen)
+
+#define MSGSTATE_TITLE_SLIDING_IN 0
+#define MSGSTATE_NAME_SLIDING_IN 1
+#define MSGSTATE_NAME_DECREASE_WAVE 2
+#define MSGSTATE_NAME_SHAKING 3
+#define MSGSTATE_NEXT_MSG 4
+
+struct msg_s {
+ SDL_Surface *surfTitle;
+ wavingImage_t nameWaving;
+ int state;
+ int stateTicks;
+ SDL_Rect rTitle;
+ SDL_Rect nWander;
+};
+typedef struct msg_s msg_t;
+
+static msg_t* cm; //Current msg.
+static int currentMsgIndex; //in list
+static listItem* msgList;
+static int ticksToNextPs=0;
+static psysSet_t ps;
+SDL_Rect r; //Used to shake the name
+
+
+
+msg_t* initMsg(const char* strTitle, const char* strName,SDL_Surface* screen)
+{
+ msg_t* t = malloc(sizeof(msg_t));
+
+ //Create surface
+ t->surfTitle = SDL_CreateRGBSurface(SDL_SWSURFACE, (getCharSize(FONTSMALL)[0]*strlen(strTitle)),(getCharSize(FONTSMALL)[1]), (setting()->bpp*8), screen->format->Rmask,screen->format->Gmask,screen->format->Bmask,0xff000000);
+ t->nameWaving.img = SDL_CreateRGBSurface(SDL_SWSURFACE, (getCharSize(FONTMEDIUM)[0]*strlen(strName)),(getCharSize(FONTMEDIUM)[1]),(setting()->bpp*8), screen->format->Rmask,screen->format->Gmask,screen->format->Bmask,0xff000000);
+ t->nameWaving.screen=screen;
+ SDL_FillRect(t->surfTitle, 0, SDL_MapRGB(t->surfTitle->format, 0,255,255));
+ SDL_FillRect(t->nameWaving.img, 0, SDL_MapRGB(t->nameWaving.img->format, 0,255,255));
+
+ //Render text to surface
+ txtWrite(t->surfTitle, FONTSMALL, strTitle, 0,0);
+ txtWrite(t->nameWaving.img, FONTMEDIUM, strName, 0,0);
+
+ SDL_Surface* tempSurf;
+
+ tempSurf=SDL_DisplayFormat(t->surfTitle);
+ SDL_FreeSurface(t->surfTitle);
+ SDL_SetColorKey( tempSurf, SDL_SRCCOLORKEY, SDL_MapRGB( tempSurf->format, 0, 0xFF, 0xFF ) );
+ t->surfTitle=tempSurf;
+
+ tempSurf=SDL_DisplayFormat(t->nameWaving.img);
+ SDL_FreeSurface(t->nameWaving.img);
+ SDL_SetColorKey( tempSurf, SDL_SRCCOLORKEY, SDL_MapRGB( tempSurf->format, 0, 0xFF, 0xFF ) );
+ t->nameWaving.img=tempSurf;
+
+ return(t);
+}
+
+void setCurrent()
{
- msg_t* t = malloc(sizeof(msg_t));
-
- //Create surface
- t->surfTitle = SDL_CreateRGBSurface(SDL_SWSURFACE, (getCharSize(FONTSMALL)[0]*strlen(strTitle)),(getCharSize(FONTSMALL)[1]), (setting()->bpp*8), screen->format->Rmask,screen->format->Gmask,screen->format->Bmask,0xff000000);
- t->nameWaving.img = SDL_CreateRGBSurface(SDL_SWSURFACE, (getCharSize(FONTMEDIUM)[0]*strlen(strName)),(getCharSize(FONTMEDIUM)[1]),(setting()->bpp*8), screen->format->Rmask,screen->format->Gmask,screen->format->Bmask,0xff000000);
- t->nameWaving.screen=screen;
- SDL_FillRect(t->surfTitle, 0, SDL_MapRGB(t->surfTitle->format, 0,255,255));
- SDL_FillRect(t->nameWaving.img, 0, SDL_MapRGB(t->nameWaving.img->format, 0,255,255));
-
- //Render text to surface
- txtWrite(t->surfTitle, FONTSMALL, strTitle, 0,0);
- txtWrite(t->nameWaving.img, FONTMEDIUM, strName, 0,0);
-
- SDL_Surface* tempSurf;
-
- tempSurf=SDL_DisplayFormat(t->surfTitle);
- SDL_FreeSurface(t->surfTitle);
- SDL_SetColorKey( tempSurf, SDL_SRCCOLORKEY, SDL_MapRGB( tempSurf->format, 0, 0xFF, 0xFF ) );
- t->surfTitle=tempSurf;
-
- tempSurf=SDL_DisplayFormat(t->nameWaving.img);
- SDL_FreeSurface(t->nameWaving.img);
- SDL_SetColorKey( tempSurf, SDL_SRCCOLORKEY, SDL_MapRGB( tempSurf->format, 0, 0xFF, 0xFF ) );
- t->nameWaving.img=tempSurf;
-
- return(t);
-}
-
-void setCurrent()
-{
- cm=(msg_t*)listGetItemData(msgList,currentMsgIndex);
-
- cm->stateTicks=0;
- cm->state=MSGSTATE_TITLE_SLIDING_IN;
- cm->rTitle.w=0;
- cm->rTitle.h=0;
- cm->rTitle.x=SCREENW+1;
- cm->rTitle.y=HSCREENH+15;
- cm->nameWaving.x=-(cm->nameWaving.img->w);
- cm->nameWaving.y=HSCREENH+35;
- cm->nameWaving.rotations=2+(cm->nameWaving.img->w/100);
- cm->nameWaving.amount=35;
+ cm=(msg_t*)listGetItemData(msgList,currentMsgIndex);
+
+ cm->stateTicks=0;
+ cm->state=MSGSTATE_TITLE_SLIDING_IN;
+ cm->rTitle.w=0;
+ cm->rTitle.h=0;
+ cm->rTitle.x=SCREENW+1;
+ cm->rTitle.y=HSCREENH+15;
+ cm->nameWaving.x=-(cm->nameWaving.img->w);
+ cm->nameWaving.y=HSCREENH+35;
+ cm->nameWaving.rotations=2+(cm->nameWaving.img->w/100);
+ cm->nameWaving.amount=35;
cm->nameWaving.speed=50;
cm->nameWaving.privRotAmount=0;
-
+
//Setup particle system
- ps.layer=PSYS_LAYER_TOP;
- ps.vel=100;
- ps.life=200;
- ps.lifeVar=100;
- ps.numParticles=0;
- ps.fade=0;
- ps.gravity=0;
- ps.bounce=0;
- ps.srcRect.x=0;
- ps.srcRect.y=0;
-
+ ps.layer=PSYS_LAYER_TOP;
+ ps.vel=100;
+ ps.life=200;
+ ps.lifeVar=100;
+ ps.numParticles=0;
+ ps.fade=0;
+ ps.gravity=0;
+ ps.bounce=0;
+ ps.srcRect.x=0;
+ ps.srcRect.y=0;
+
}
-
-void freeMsg(msg_t* msg)
-{
- SDL_FreeSurface( msg->surfTitle );
- SDL_FreeSurface( msg->nameWaving.img );
-
- free(msg);
-}
-
-void initCredits(SDL_Surface* screen)
+
+void freeMsg(msg_t* msg)
+{
+ SDL_FreeSurface( msg->surfTitle );
+ SDL_FreeSurface( msg->nameWaving.img );
+
+ free(msg);
+}
+
+void initCredits(SDL_Surface* screen)
+{
+ printf("initCredits();\n");
+ msgList=initList();
+ listAddData(msgList, (void*)initMsg("Website","wizznic.sf.net", screen));
+ listAddData(msgList, (void*)initMsg("Code/Gfx/Sfx","Jimmy Christensen", screen));
+ listAddData(msgList, (void*)initMsg("Gfx","ViperMD", screen));
+
+ listAddData(msgList, (void*)initMsg("Music","Sean Hawk", screen));
+ listAddData(msgList, (void*)initMsg("Thx","Farox", screen));
+ listAddData(msgList, (void*)initMsg("Thx","bMan", screen));
+ listAddData(msgList, (void*)initMsg("Thx","KML", screen));
+ listAddData(msgList, (void*)initMsg("Thx","Neil L", screen));
+
+ listAddData(msgList, (void*)initMsg("Greetings","GP32X.com", screen));
+ listAddData(msgList, (void*)initMsg("Greetings","freegamedev.net", screen));
+ listAddData(msgList, (void*)initMsg("Greetings","Qubodup", screen));
+
+ //Set current
+ currentMsgIndex=0;
+ setCurrent();
+ printf("credits initialized.\n");
+}
+
+void clearCredits()
{
- printf("initCredits();\n");
- msgList=initList();
- listAddData(msgList, (void*)initMsg("Website","wizznic.sf.net", screen));
- listAddData(msgList, (void*)initMsg("Code/Gfx/Sfx","Jimmy Christensen", screen));
- listAddData(msgList, (void*)initMsg("Gfx","ViperMD", screen));
-
- listAddData(msgList, (void*)initMsg("Music","Sean Hawk", screen));
- listAddData(msgList, (void*)initMsg("Thx","Farox", screen));
- listAddData(msgList, (void*)initMsg("Thx","bMan", screen));
- listAddData(msgList, (void*)initMsg("Thx","KML", screen));
- listAddData(msgList, (void*)initMsg("Thx","Neil L", screen));
-
- listAddData(msgList, (void*)initMsg("Greetings","GP32X.com", screen));
- listAddData(msgList, (void*)initMsg("Greetings","freegamedev.net", screen));
- listAddData(msgList, (void*)initMsg("Greetings","Qubodup", screen));
-
- //Set current
- currentMsgIndex=0;
- setCurrent();
- printf("credits initialized.\n");
-}
-
-void clearCredits()
+ printf("clearCredits();\n");
+ listItem* it=msgList;
+ while( (it=it->next) )
+ {
+ cm = (msg_t*)it->data;
+ freeMsg(cm);
+ }
+ freeList(msgList);
+ clearParticles();
+}
+
+
+void drawTitle(SDL_Surface* screen, msg_t* m)
{
- printf("clearCredits();\n");
- listItem* it=msgList;
- while( (it=it->next) )
- {
- cm = (msg_t*)it->data;
- freeMsg(cm);
- }
- freeList(msgList);
- clearParticles();
-}
-
-
-void drawTitle(SDL_Surface* screen, msg_t* m)
-{
- ticksToNextPs += getTicks();
-
- if(ticksToNextPs > 60)
- {
+ ticksToNextPs += getTicks();
+
+ if(ticksToNextPs > 60)
+ {
ticksToNextPs=0;
- ps.layer=PSYS_LAYER_TOP;
- ps.bounce=0;
- ps.x=m->rTitle.x;
- ps.y=m->rTitle.y;
- ps.srcImg=m->surfTitle;
- ps.srcRect.w=m->surfTitle->w;
- ps.srcRect.h=m->surfTitle->h;
-
- spawnParticleSystem( &ps );
-
- }
-
- SDL_BlitSurface( m->surfTitle, 0, screen, &m->rTitle );
-}
-
-void runCredits(SDL_Surface* screen)
-{
- switch(cm->state)
- {
+ ps.layer=PSYS_LAYER_TOP;
+ ps.bounce=0;
+ ps.x=m->rTitle.x;
+ ps.y=m->rTitle.y;
+ ps.srcImg=m->surfTitle;
+ ps.srcRect.w=m->surfTitle->w;
+ ps.srcRect.h=m->surfTitle->h;
+
+ spawnParticleSystem( &ps );
+
+ }
+
+ SDL_BlitSurface( m->surfTitle, 0, screen, &m->rTitle );
+}
+
+void runCredits(SDL_Surface* screen)
+{
+ switch(cm->state)
+ {
case MSGSTATE_TITLE_SLIDING_IN:
- cm->rTitle.x -= 10;
- if( cm->rTitle.x <= (HSCREENW-(cm->surfTitle->w/2)) )
- {
- cm->rTitle.x=(HSCREENW-(cm->surfTitle->w/2));
-
- cm->stateTicks += getTicks();
- //wait 250 ms
- if(cm->stateTicks >= 250)
- {
- cm->state=MSGSTATE_NAME_SLIDING_IN;
- cm->stateTicks=0;
- }
- }
- drawTitle(screen, cm);
-
- break;
-
+ cm->rTitle.x -= 10;
+ if( cm->rTitle.x <= (HSCREENW-(cm->surfTitle->w/2)) )
+ {
+ cm->rTitle.x=(HSCREENW-(cm->surfTitle->w/2));
+
+ cm->stateTicks += getTicks();
+ //wait 250 ms
+ if(cm->stateTicks >= 250)
+ {
+ cm->state=MSGSTATE_NAME_SLIDING_IN;
+ cm->stateTicks=0;
+ }
+ }
+ drawTitle(screen, cm);
+
+ break;
+
case MSGSTATE_NAME_SLIDING_IN:
- //Draw title
- drawTitle(screen, cm);
- //Slide in name
- cm->nameWaving.x += 7;
- if( cm->nameWaving.x >= ( HSCREENW-cm->nameWaving.img->w/2 ) )
- {
- cm->nameWaving.x = ( HSCREENW-cm->nameWaving.img->w/2 );
- cm->state=MSGSTATE_NAME_DECREASE_WAVE;
+ //Draw title
+ drawTitle(screen, cm);
+ //Slide in name
+ cm->nameWaving.x += 7;
+ if( cm->nameWaving.x >= ( HSCREENW-cm->nameWaving.img->w/2 ) )
+ {
+ cm->nameWaving.x = ( HSCREENW-cm->nameWaving.img->w/2 );
+ cm->state=MSGSTATE_NAME_DECREASE_WAVE;
}
- waveImg( &cm->nameWaving );
- break;
-
- case MSGSTATE_NAME_DECREASE_WAVE:
- //Draw title
- SDL_BlitSurface( cm->surfTitle, 0, screen, &cm->rTitle );
-
- cm->stateTicks += getTicks();
- if(cm->stateTicks > 0)
- {
- cm->stateTicks=0;
-
- cm->nameWaving.amount--;
- if(cm->nameWaving.amount==0)
- {
- cm->stateTicks=0;
- cm->state=MSGSTATE_NAME_SHAKING;
- //Set
- r.x=cm->nameWaving.x;
- r.y=cm->nameWaving.y;
- }
- }
- waveImg( &cm->nameWaving );
- break;
-
- case MSGSTATE_NAME_SHAKING:
- if(cm->stateTicks<500)
- SDL_BlitSurface( cm->surfTitle, 0, screen, &cm->rTitle );
-
- //shake
- cm->nWander.x=((rand()%6000)-3000)/1000;
- cm->nWander.y=((rand()%4000)-2000)/1000;
-
- if( abs(cm->nameWaving.x - (r.x+cm->nWander.x)) > 5) cm->nWander.x *=-1;
- if( abs(cm->nameWaving.y - (r.y+cm->nWander.y)) > 3) cm->nWander.y *=-1;
-
- r.x += cm->nWander.x;
- r.y += cm->nWander.y;
-
- if(cm->stateTicks <1500)
- SDL_BlitSurface( cm->nameWaving.img, 0, screen, &r );
-
-
- cm->stateTicks += getTicks();
- if(cm->stateTicks >= 500 && cm->stateTicks-getTicks() <= 500)
+ waveImg( &cm->nameWaving );
+ break;
+
+ case MSGSTATE_NAME_DECREASE_WAVE:
+ //Draw title
+ SDL_BlitSurface( cm->surfTitle, 0, screen, &cm->rTitle );
+
+ cm->stateTicks += getTicks();
+ if(cm->stateTicks > 0)
+ {
+ cm->stateTicks=0;
+
+ cm->nameWaving.amount--;
+ if(cm->nameWaving.amount==0)
+ {
+ cm->stateTicks=0;
+ cm->state=MSGSTATE_NAME_SHAKING;
+ //Set
+ r.x=cm->nameWaving.x;
+ r.y=cm->nameWaving.y;
+ }
+ }
+ waveImg( &cm->nameWaving );
+ break;
+
+ case MSGSTATE_NAME_SHAKING:
+ if(cm->stateTicks<500)
+ SDL_BlitSurface( cm->surfTitle, 0, screen, &cm->rTitle );
+
+ //shake
+ cm->nWander.x=((rand()%6000)-3000)/1000;
+ cm->nWander.y=((rand()%4000)-2000)/1000;
+
+ if( abs(cm->nameWaving.x - (r.x+cm->nWander.x)) > 5) cm->nWander.x *=-1;
+ if( abs(cm->nameWaving.y - (r.y+cm->nWander.y)) > 3) cm->nWander.y *=-1;
+
+ r.x += cm->nWander.x;
+ r.y += cm->nWander.y;
+
+ if(cm->stateTicks <1500)
+ SDL_BlitSurface( cm->nameWaving.img, 0, screen, &r );
+
+
+ cm->stateTicks += getTicks();
+ if(cm->stateTicks >= 500 && cm->stateTicks-getTicks() <= 500)
{
ps.layer=PSYS_LAYER_TOP;
- ps.vel=200;
- ps.life=1000;
- ps.lifeVar=500;
-
- spawnParticleSystem( &ps );
- spawnParticleSystem( &ps );
- spawnParticleSystem( &ps );
- spawnParticleSystem( &ps );
- } else if(cm->stateTicks >= 1500 && cm->stateTicks-getTicks() <= 1500)
+ ps.vel=200;
+ ps.life=1000;
+ ps.lifeVar=500;
+
+ spawnParticleSystem( &ps );
+ spawnParticleSystem( &ps );
+ spawnParticleSystem( &ps );
+ spawnParticleSystem( &ps );
+ } else if(cm->stateTicks >= 1500 && cm->stateTicks-getTicks() <= 1500)
{
- ps.layer=PSYS_LAYER_TOP;
- ps.vel=400;
- ps.life=1500;
- ps.lifeVar=500;
- ps.x=cm->nameWaving.x;
- ps.y=cm->nameWaving.y;
- ps.srcImg=cm->nameWaving.img;
- ps.srcRect.w=cm->nameWaving.img->w;
- ps.srcRect.h=cm->nameWaving.img->h;
-
- spawnParticleSystem( &ps );
- spawnParticleSystem( &ps );
-
- } else if(cm->stateTicks > 3000)
- {
- //Next
- cm->state=MSGSTATE_NEXT_MSG;
- }
- break;
-
- case MSGSTATE_NEXT_MSG:
-
- //Update current msg
- currentMsgIndex++;
+ ps.layer=PSYS_LAYER_TOP;
+ ps.vel=400;
+ ps.life=1500;
+ ps.lifeVar=500;
+ ps.x=cm->nameWaving.x;
+ ps.y=cm->nameWaving.y;
+ ps.srcImg=cm->nameWaving.img;
+ ps.srcRect.w=cm->nameWaving.img->w;
+ ps.srcRect.h=cm->nameWaving.img->h;
+
+ spawnParticleSystem( &ps );
+ spawnParticleSystem( &ps );
+
+ } else if(cm->stateTicks > 3000)
+ {
+ //Next
+ cm->state=MSGSTATE_NEXT_MSG;
+ }
+ break;
+
+ case MSGSTATE_NEXT_MSG:
+
+ //Update current msg
+ currentMsgIndex++;
if(currentMsgIndex == listSize(msgList))
- currentMsgIndex=0;
+ currentMsgIndex=0;
+
+ setCurrent();
- setCurrent();
-
break;
- };
-}
+ };
+}
22 credits.h
View
@@ -1,5 +1,5 @@
-#ifndef CREDITS_INCLUDED
-#define CREDITS_INCLUDED
+#ifndef CREDITS_INCLUDED
+#define CREDITS_INCLUDED
/************************************************************************
* This file is part of Wizznic. *
@@ -15,13 +15,13 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
-
-#include <SDL/SDL.h>
-
-void initCredits();
-void clearCredits();
-void runCredits(SDL_Surface* screen);
-
-#endif
+
+#include <SDL/SDL.h>
+
+void initCredits();
+void clearCredits();
+void runCredits(SDL_Surface* screen);
+
+#endif
8 cursor.c
View
@@ -12,7 +12,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "cursor.h"
@@ -40,9 +40,9 @@ void updateCursor(cursorType* c)
c->moving=1;
else
c->moving=0;
-
- //If Cursor is locked to a brick, let the board-code set cursor position
- if(c->lock) return;
+
+ //If Cursor is locked to a brick, let the board-code set cursor position
+ if(c->lock) return;
if(c->px > destX)
{
2  cursor.h
View
@@ -15,7 +15,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "defs.h"
7 defs.h
View
@@ -15,9 +15,13 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
+#ifndef DATADIR
+ #define DATADIR "./"
+#endif
+
#define FIELDSIZE 11
//Bricks
@@ -60,6 +64,7 @@
#include "platform/wiz.h"
#else //Linux, Windows, Default
#include "platform/pc.h"
+ #define PC
#endif
136 draw.c
View
@@ -12,7 +12,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "draw.h"
@@ -20,26 +20,26 @@
#include "defs.h"
#include "settings.h"
#include "input.h"
-
-struct boardGraphics_t graphics;
-
-int initDraw(levelInfo_t* li, SDL_Surface* screen)
-{
+
+struct boardGraphics_t graphics;
+
+int initDraw(levelInfo_t* li, SDL_Surface* screen)
+{
char tempStr[512];
int i,x,y;
-
- //Background image
- graphics.boardImg = loadImg( packGetFile("themes",li->bgFile) );
-
- if(!graphics.boardImg)
- {
- printf("Couldn't load board file:'%s'\n", packGetFile("themes",li->bgFile) );
- cleanUpDraw();
- return(0);
- }
+
+ //Background image
+ graphics.boardImg = loadImg( packGetFile("themes",li->bgFile) );
+
+ if(!graphics.boardImg)
+ {
+ printf("Couldn't load board file:'%s'\n", packGetFile("themes",li->bgFile) );
+ cleanUpDraw();
+ return(0);
+ }
//Tileset
- sprintf(tempStr, "%s.png", li->tileBase);
+ sprintf(tempStr, "%s.png", li->tileBase);
graphics.tileImg = loadImg( packGetFile("themes",tempStr) );
if(!graphics.tileImg)
{
@@ -48,15 +48,15 @@ int initDraw(levelInfo_t* li, SDL_Surface* screen)
return(0);
}
-
- //Cut tiles into sprites
- for(i=0; i < NUMTILES; i++)
- {
- graphics.tiles[i] = cutSprite(graphics.tileImg, i*20, 0, 20,20);
+
+ //Cut tiles into sprites
+ for(i=0; i < NUMTILES; i++)
+ {
+ graphics.tiles[i] = cutSprite(graphics.tileImg, i*20, 0, 20,20);
}
//Single wall (Override tile15 in graphics.tiles)
- sprintf(tempStr, "%s.png", li->wallBase);
+ sprintf(tempStr, "%s.png", li->wallBase);
graphics.wallImg = loadImg( packGetFile("themes",tempStr) );
if(!graphics.wallImg)
{
@@ -71,7 +71,7 @@ int initDraw(levelInfo_t* li, SDL_Surface* screen)
//Extra walls, if they exist, if they don't, default to tile 6 (from 0) in tiles.
sprintf(tempStr, "%s-extra.png", li->wallBase);
- graphics.wallsImg = loadImg( packGetFile("themes",tempStr) );
+ graphics.wallsImg = loadImg( packGetFile("themes",tempStr) );
if(!graphics.wallsImg) printf("Optional GFX missing: '%s'\n", packGetFile("themes",tempStr) );
int r,c; //rows, column, sprite index
i=0;
@@ -93,34 +93,34 @@ int initDraw(levelInfo_t* li, SDL_Surface* screen)
}
}
//Above loop leaves when i==15.
- //Middle-free is 15 = default tile index in image is 15 (starting from 0).
+ //Middle-free is 15 = default tile index in image is 15 (starting from 0).
graphics.walls[15] = cutSprite(graphics.wallImg, 0, 0, 20, 20);
-
- //Explosions, reuse R as frame number index
- for(i=0; i < BRICKSEND; i++)
- {
- //Open explosion
- sprintf(tempStr, "%s%02i.png", li->explBase, i);
+
+ //Explosions, reuse R as frame number index
+ for(i=0; i < BRICKSEND; i++)
+ {
+ //Open explosion
+ sprintf(tempStr, "%s%02i.png", li->explBase, i);
graphics.explImg[i] = loadImg( packGetFile("themes",tempStr) );
-
- if(!graphics.explImg[i] && i==0) printf("Couldn't open '%s'\n",packGetFile("themes",tempStr) );
- if(graphics.explImg[i])
+ if(!graphics.explImg[i] && i==0) printf("Couldn't open '%s'\n",packGetFile("themes",tempStr) );
+
+ if(graphics.explImg[i])
graphics.brickExpl[i] = mkAni(graphics.explImg[i], 30,30, 0);
else
graphics.brickExpl[i] = mkAni(graphics.explImg[0], 30,30, 0);
}
- //Per-Tile animations
- for(i=0; i < NUMTILES; i++)
- {
+ //Per-Tile animations
+ for(i=0; i < NUMTILES; i++)
+ {
sprintf(tempStr, "%s-tile%02i.png", li->tileBase, i);
graphics.aniImg[i] = loadImg( packGetFile("themes",tempStr) );
graphics.tileAni[i] = mkAni(graphics.aniImg[i], 30,30, 80);
-
+
}
-
+
//Cursor
graphics.curImg = loadImg( packGetFile( "themes/cursors",li->cursorFile) );
if( !graphics.curImg )
@@ -151,11 +151,11 @@ int initDraw(levelInfo_t* li, SDL_Surface* screen)
{
graphics.teleColorTable[i] = SDL_MapRGB( screen->format, 0,(int)(255.0-(float)i*f),0 );
}
-
- return(1);
-}
-
-void cleanUpDraw()
+
+ return(1);
+}
+
+void cleanUpDraw()
{
int i;
//Board image
@@ -196,16 +196,16 @@ void cleanUpDraw()
{
if(graphics.walls[i]) free(graphics.walls[i]);
graphics.walls[i]=0;
- }
-
- //Explosion
- for(i=0; i < BRICKSEND; i++)
- {
- //image
+ }
+
+ //Explosion
+ for(i=0; i < BRICKSEND; i++)
+ {
+ //image
if( graphics.explImg[i] ) SDL_FreeSurface( graphics.explImg[i] );
graphics.explImg[i]=0;
- freeAni( graphics.brickExpl[i]);
+ freeAni( graphics.brickExpl[i]);
}
//Countdown
@@ -216,8 +216,8 @@ void cleanUpDraw()
{
if(graphics.countDownSpr[i]) free(graphics.countDownSpr[i]);
graphics.countDownSpr[i]=0;
- }
-}
+ }
+}
/* Permanently disables cursor, used for generating preview images */
#if !defined (GP2X) && !defined (WIZ) && !defined (PANDORA)
@@ -236,7 +236,7 @@ void draw(cursorType* cur, playField* pf, SDL_Surface* screen)
int x,y;
listItem* t; //general purpose, reusable
psysSet_t ps;
-
+
SDL_BlitSurface(graphics.boardImg , NULL, screen, &(setting()->bgPos) );
for(x=0;x<NUMTILES;x++)
@@ -262,21 +262,21 @@ void draw(cursorType* cur, playField* pf, SDL_Surface* screen)
{
//printf("I want to draw %i for(%i,%i) it has sprite: %i\n",pf->board[x][y]->wall,x,y,graphics.walls[pf->board[x][y]->wall]);
drawSprite(screen, graphics.walls[pf->board[x][y]->wall], pf->board[x][y]->pxx, pf->board[x][y]->pxy);
- } else if(graphics.tiles[pf->board[x][y]->type-1])
+ } else if(graphics.tiles[pf->board[x][y]->type-1])
{
if(graphics.tileAni[pf->board[x][y]->type-1])
{
drawAni(screen, graphics.tileAni[pf->board[x][y]->type-1], pf->board[x][y]->pxx-5, pf->board[x][y]->pxy-5);
} else {
drawSprite(screen, graphics.tiles[pf->board[x][y]->type-1], pf->board[x][y]->pxx, pf->board[x][y]->pxy);
- }
+ }
}
} /*else if( pf->board[x][y] && pf->board[x][y]->type == RESERVED )
{
drawSprite(screen, graphics.tiles[RESERVED-1], x*brickSize+boardOffsetX, y*brickSize+boardOffsetY);
}*/
}
- }
+ }
//Draw moving bricks
t=pf->movingList;
@@ -288,7 +288,7 @@ void draw(cursorType* cur, playField* pf, SDL_Surface* screen)
if(graphics.tileAni[b->type-1])
{
drawAni(screen, graphics.tileAni[b->type-1], b->pxx-5, b->pxy-5);
- } else {
+ } else {
drawSprite(screen, graphics.tiles[b->type-1], b->pxx, b->pxy);
}
}
@@ -308,10 +308,10 @@ void draw(cursorType* cur, playField* pf, SDL_Surface* screen)
if(graphics.tileAni[b->type-1])
{
drawAni(screen, graphics.tileAni[b->type-1], b->pxx-5, b->pxy-5);
- } else {
+ } else {
drawSprite(screen, graphics.tiles[b->type-1], b->pxx, b->pxy);
}
- }
+ }
int explFrame = 16*(pf->levelInfo->brick_die_ticks-b->tl)/pf->levelInfo->brick_die_ticks;
@@ -332,8 +332,8 @@ void draw(cursorType* cur, playField* pf, SDL_Surface* screen)
ps.srcImg=graphics.tiles[b->type-1]->img;
ps.srcRect=graphics.tiles[b->type-1]->clip;
spawnParticleSystem(&ps);
- }
-
+ }
+
}
//Teleport overlay
@@ -346,7 +346,7 @@ void draw(cursorType* cur, playField* pf, SDL_Surface* screen)
if(graphics.tileAni[TELESRC-1])
{
drawAni(screen, graphics.tileAni[TELESRC-1], boardOffsetX+20*tp->sx-5, boardOffsetY+20*tp->sy-5);
- } else {
+ } else {
drawSprite(screen, graphics.tiles[TELESRC-1], boardOffsetX+20*tp->sx, boardOffsetY+20*tp->sy);
}
@@ -414,10 +414,10 @@ void drawShowCountDown(SDL_Surface* screen,int i)
}
}
-
-void drawBrick(SDL_Surface* screen, int brickNum, int x, int y)
-{
- drawSprite(screen, graphics.tiles[brickNum-1], x,y);
+
+void drawBrick(SDL_Surface* screen, int brickNum, int x, int y)
+{
+ drawSprite(screen, graphics.tiles[brickNum-1], x,y);
}
struct boardGraphics_t* stealGfxPtr()
@@ -482,4 +482,4 @@ void drawAllTelePaths( SDL_Surface* screen, listItem* l )
t = (telePort_t*)it->data;
drawTelePath(screen, t, 0);
}
-}
+}
36 draw.h
View
@@ -1,4 +1,4 @@
-#ifndef DRAW_H_INCLUDED
+#ifndef DRAW_H_INCLUDED
#define DRAW_H_INCLUDED
/************************************************************************
@@ -15,23 +15,23 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include <SDL/SDL.h>
#include "defs.h"
#include "board.h"
#include "cursor.h"
-#include "sprite.h"
+#include "sprite.h"
#include "list.h"
#include "particles.h"
-#include "levels.h"
+#include "levels.h"
#include "teleport.h"
-#define TELEPATHNUMCOL 32
-struct boardGraphics_t
-{
- SDL_Surface* boardImg;
+#define TELEPATHNUMCOL 32
+struct boardGraphics_t
+{
+ SDL_Surface* boardImg;
SDL_Surface* tileImg;
SDL_Surface* curImg;
SDL_Surface* wallImg;//Single wall
@@ -39,7 +39,7 @@ struct boardGraphics_t
SDL_Surface* explImg[BRICKSEND]; //Brick destroy animations, either one pr tile, or all defaults to 0.
SDL_Surface* aniImg[NUMTILES];
SDL_Surface* countDownImg;
- spriteType* curSpr[2];
+ spriteType* curSpr[2];
spriteType* tiles[NUMTILES];
aniType* brickExpl[BRICKSEND];
@@ -51,22 +51,22 @@ struct boardGraphics_t
//Teleport path animation
int teleColorIndex;
uint32_t teleColorTable[TELEPATHNUMCOL];
-};
-
-int initDraw(levelInfo_t* li, SDL_Surface* screen);
-void cleanUpDraw();
+};
+
+int initDraw(levelInfo_t* li, SDL_Surface* screen);
+void cleanUpDraw();
void draw(cursorType* cur, playField* pf, SDL_Surface* screen);
void drawTelePath( SDL_Surface* screen, telePort_t* tp, int animate );
void drawPath( SDL_Surface* screen, int sx, int sy, int dx, int dy, int animate );
void drawAllTelePaths( SDL_Surface* screen,listItem* tp );
-void drawShowCountDown(SDL_Surface* screen, int i);
-struct boardGraphics_t* stealGfxPtr();
-//For editor
+void drawShowCountDown(SDL_Surface* screen, int i);
+struct boardGraphics_t* stealGfxPtr();
+//For editor
void drawBrick(SDL_Surface* screen, int brickNum, int x, int y);
//For image dumper
#ifndef GP2X
void drawDisableCursor();
-#endif
+#endif
-#endif // DRAW_H_INCLUDED
+#endif // DRAW_H_INCLUDED
14 dumplevelimages.c
View
@@ -12,7 +12,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "dumplevelimages.h"
@@ -57,12 +57,12 @@ void dumplevelimages(SDL_Surface* screen, const char* packName, int dumpStartIma
//Switch off cursor graphics
drawDisableCursor(1);
-
+
//Show the "start image"
- si=0;
- if( pf.levelInfo->startImg && dumpStartImage )
- {
- si = loadImg( packGetFile("themes/", pf.levelInfo->startImg) );
+ si=0;
+ if( pf.levelInfo->startImg && dumpStartImage )
+ {
+ si = loadImg( packGetFile("themes/", pf.levelInfo->startImg) );
}
if(si)
@@ -72,7 +72,7 @@ void dumplevelimages(SDL_Surface* screen, const char* packName, int dumpStartIma
SDL_FreeSurface(si);
} else {
//Draw the image
- draw(&cur,&pf, screen);
+ draw(&cur,&pf, screen);
}
SDL_Flip(screen);
14 dumplevelimages.h
View
@@ -1,4 +1,4 @@
-#ifndef DUMPLEVELIMAGES_H_INCLUDED
+#ifndef DUMPLEVELIMAGES_H_INCLUDED
#define DUMPLEVELIMAGES_H_INCLUDED
/************************************************************************
@@ -15,12 +15,12 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
-
-#include <SDL/SDL.h>
+
+#include <SDL/SDL.h>
void dumplevelimages(SDL_Surface* screen, const char* packName, int dumpStartImage);
-void tgaSave(SDL_Surface* screen, const char* fileName);
+void tgaSave(SDL_Surface* screen, const char* fileName);
void thumblevelimage(SDL_Surface* screen,const char* lvlfile, const char* outimg);
-
-#endif // DUMPLEVELIMAGES_H_INCLUDED
+
+#endif // DUMPLEVELIMAGES_H_INCLUDED
2  game.c
View
@@ -12,7 +12,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "game.h"
16 game.h
View
@@ -1,5 +1,5 @@
-#ifndef GAME_H_INCLUDED
-#define GAME_H_INCLUDED
+#ifndef GAME_H_INCLUDED
+#define GAME_H_INCLUDED
/************************************************************************
* This file is part of Wizznic. *
@@ -15,7 +15,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include <SDL/SDL.h>
@@ -33,9 +33,9 @@
#include "menu.h"
#include "pack.h"
-int initGame(SDL_Surface* screen);
-void cleanUpGame();
-int runGame(SDL_Surface* screen);
+int initGame(SDL_Surface* screen);
+void cleanUpGame();
+int runGame(SDL_Surface* screen);
void setGameState(int state);
-
-#endif // GAME_H_INCLUDED
+
+#endif // GAME_H_INCLUDED
4 input.c
View
@@ -12,7 +12,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "input.h"
@@ -44,7 +44,7 @@ inline void setButton(int btn)
{
button[btn].state=1;
button[btn].time=0;
-}
+}
inline void resetBtnTimer(int btn)
14 input.h
View
@@ -1,5 +1,5 @@
-#ifndef INPUT_H_INCLUDED
-#define INPUT_H_INCLUDED
+#ifndef INPUT_H_INCLUDED
+#define INPUT_H_INCLUDED
/************************************************************************
* This file is part of Wizznic. *
@@ -15,11 +15,11 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include <SDL/SDL.h>
-#include "pointer.h"
+#include "pointer.h"
#include "board.h"
#define C_UP 0
@@ -38,9 +38,9 @@
#define C_BTNVOLDOWN 13
#define C_NUM 14
-inline void setButton(int btn); //Nasty
+inline void setButton(int btn); //Nasty
inline int getButton(int btn);
-inline int getBtnTime(int btn);
+inline int getBtnTime(int btn);
inline void resetBtnTimer(int btn);
inline void resetBtn(int btn);
inline void resetMouseBtn();
@@ -48,4 +48,4 @@ void resetBtnAll();
int runControls();
void initControls();
-#endif // INPUT_H_INCLUDED
+#endif // INPUT_H_INCLUDED
2  leveleditor.c
View
@@ -12,7 +12,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "settings.h"
16 leveleditor.h
View
@@ -1,5 +1,5 @@
-#ifndef LEVELEDITOR_H_INCLUDED
-#define LEVELEDITOR_H_INCLUDED
+#ifndef LEVELEDITOR_H_INCLUDED
+#define LEVELEDITOR_H_INCLUDED
/************************************************************************
* This file is part of Wizznic. *
@@ -15,15 +15,15 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
-
-#include <SDL/SDL.h>
-
+
+#include <SDL/SDL.h>
+
void editorCleanUp();
void editorLoad(const char* fileName, SDL_Surface* screen);
-void editorFileName(const char* fileName);
+void editorFileName(const char* fileName);
int runEditor(SDL_Surface* screen);
-#endif // LEVELEDITOR_H_INCLUDED
+#endif // LEVELEDITOR_H_INCLUDED
98 levels.c
View
@@ -12,7 +12,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "levels.h"
@@ -56,29 +56,29 @@ levelInfo_t* mkLevelInfo(const char* fileName)
//preview file name
sprintf( buf, "%s.png", fileName);
tl->imgFile=malloc( sizeof(char)*( strlen(buf)+1 ) );
- strcpy(tl->imgFile, buf);
-
- //default char map
- strcpy( buf, "charmap" );
- tl->fontName=malloc( sizeof(char)*( strlen(buf)+1) );
+ strcpy(tl->imgFile, buf);
+
+ //default char map
+ strcpy( buf, "charmap" );
+ tl->fontName=malloc( sizeof(char)*( strlen(buf)+1) );
strcpy( tl->fontName, buf );
//Default cursor
strcpy( buf, "cursor.png" );
tl->cursorFile=malloc( sizeof(char)*(strlen(buf)+1) );
strcpy( tl->cursorFile, buf );
-
- //start/stop images
- tl->startImg=0;
+
+ //start/stop images
+ tl->startImg=0;
tl->stopImg=0;
//Default brick die time
tl->brick_die_ticks=500;
- tl->brickDieParticles=1;
-
- //Initiate teleList
- tl->teleList = initList();
+ tl->brickDieParticles=1;
+
+ //Initiate teleList
+ tl->teleList = initList();
//Loop through file
while(fgets(buf, 255, f))
@@ -134,63 +134,63 @@ levelInfo_t* mkLevelInfo(const char* fileName)
{
tl->soundDir=malloc( sizeof(char)*( strlen(val)+1 ) );
strcpy(tl->soundDir, val);
- } else
- if(strcmp("charbase",set)==0)
- {
- free(tl->fontName);
- tl->fontName=malloc( sizeof(char)*( strlen(val)+1 ) );
- strcpy(tl->fontName, val);
- } else
+ } else
+ if(strcmp("charbase",set)==0)
+ {
+ free(tl->fontName);
+ tl->fontName=malloc( sizeof(char)*( strlen(val)+1 ) );
+ strcpy(tl->fontName, val);
+ } else
if(strcmp("cursorfile",set)==0)
{
free( tl->cursorFile );
tl->cursorFile=malloc( sizeof(char)*( strlen(val)+1 ) );
strcpy(tl->cursorFile, val);
} else
- if(strcmp("startimage",set)==0)
- {
+ if(strcmp("startimage",set)==0)
+ {
//Ignore none keyword for start image
if( strcmp( "none", val) != 0)
{
- tl->startImg=malloc( sizeof(char)*( strlen(val)+1 ) );
+ tl->startImg=malloc( sizeof(char)*( strlen(val)+1 ) );
strcpy(tl->startImg, val);
- }
- } else
- if(strcmp("stopimage", set)==0)
- {
+ }
+ } else
+ if(strcmp("stopimage", set)==0)
+ {
//Ignore none keyword for stop image
if( strcmp( "none", val) != 0)
{
- tl->stopImg=malloc( sizeof(char)*( strlen(val)+1 ) );
+ tl->stopImg=malloc( sizeof(char)*( strlen(val)+1 ) );
strcpy(tl->stopImg, val);
- }
+ }
} else
if(strcmp("brickdietime", set)==0)
{
tl->brick_die_ticks=atoi(val);
- } else
+ } else
if(strcmp("brickdieparticles", set)==0)
{
tl->brickDieParticles=atoi(val);
- } else
- if(strcmp("teleport", set)==0)
- {
- teleAddFromString(tl->teleList, val);
+ } else
+ if(strcmp("teleport", set)==0)
+ {
+ teleAddFromString(tl->teleList, val);
}
} //Got a = in the line
} //Not [data]
} //Reading file
//Close file
fclose(f);
- }
-
- if(!gotData)
+ }
+
+ if(!gotData)
{
//The reason we don't tell that there's no [data] section is because this
//function is also used to check for the existance of levels, so it'd always
- //Return "no [data] found for the levelfile name just after the last level in a pack.
- free(tl);
- tl=0;
+ //Return "no [data] found for the levelfile name just after the last level in a pack.
+ free(tl);
+ tl=0;
}
@@ -217,16 +217,16 @@ void makeLevelList(listItem** list, const char* dir)
//List all levels in dir.
while(1)
- {
+ {
sprintf(buf, "%s/levels/level%03i.wzp",dir, i);
tl=mkLevelInfo( buf );
if(tl)
{
- listAddData(*list, (void*)tl);
+ listAddData(*list, (void*)tl);
} else {
break;
}
- i++; //Increment file-number.
+ i++; //Increment file-number.
}
// Add a "Completed" level at the very end of the list
@@ -327,14 +327,14 @@ void freeLevelInfo(levelInfo_t** p)
if( (*p)->wallBase ) free( (*p)->wallBase );
if( (*p)->bgFile ) free( (*p)->bgFile );
if( (*p)->musicFile ) free( (*p)->musicFile );
- if( (*p)->soundDir ) free( (*p)->soundDir );
+ if( (*p)->soundDir ) free( (*p)->soundDir );
if( (*p)->fontName ) free( (*p)->fontName );
if( (*p)->cursorFile ) free( (*p)->cursorFile );
- if( (*p)->startImg ) free( (*p)->startImg );
- if( (*p)->stopImg ) free( (*p)->stopImg );
-
- if( (*p)->teleList ) teleFreeList( (*p)->teleList );
-
+ if( (*p)->startImg ) free( (*p)->startImg );
+ if( (*p)->stopImg ) free( (*p)->stopImg );
+
+ if( (*p)->teleList ) teleFreeList( (*p)->teleList );
+
//Set everything 0 for good measure.
memset( *p, 0, sizeof(levelInfo_t));
14 levels.h
View
@@ -1,4 +1,4 @@
-#ifndef LEVELS_H_INCLUDED
+#ifndef LEVELS_H_INCLUDED
#define LEVELS_H_INCLUDED
/************************************************************************
@@ -15,7 +15,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "list.h"
@@ -32,12 +32,12 @@ struct levelInfo_s
char* wallBase; //dir with wall.png and (optional) walls.png
char* bgFile; //backgroundFile
char* musicFile; //Music file (set by pack.c)
- char* soundDir; //Directory containing soundeffects
+ char* soundDir; //Directory containing soundeffects
char* fontName; //Font
- char* cursorFile;//Cursor
- char* startImg; //img to show before game starts
+ char* cursorFile;//Cursor
+ char* startImg; //img to show before game starts
char* stopImg; //img to show after level completed.
-
+
listItem* teleList; //Initiated by mkLevelInfo
hsEntry_t* hsStats; ///hsEntry level stats. (TODO: Should this be freed by freeLevelInfo? Is it?)
@@ -55,5 +55,5 @@ levelInfo_t* mkLevelInfo(const char* fileName);
void freeLevelInfo(levelInfo_t** p); //given a pointer to the pointer, so it can dereference it properly.
char* userLevelFile(int num);
int getNumUserLevels();
-
+
#endif // LEVELS_H_INCLUDED
4 levelselector.c
View
@@ -12,7 +12,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "levelselector.h"
@@ -116,7 +116,7 @@ void drawPreviewImg(SDL_Surface* screen, SDL_Surface* img, int stats)
g = ((col & img->format->Gmask) >> img->format->Gshift);
b = ((col & img->format->Bmask) >> img->format->Bshift);
- if( !isAlpha(r,g,b) )
+ if( !isAlpha(r,g,b) )
{
//Do b/w
14 levelselector.h
View
@@ -1,5 +1,5 @@
-#ifndef LEVELSELECTOR_H_INCLUDED
-#define LEVELSELECTOR_H_INCLUDED
+#ifndef LEVELSELECTOR_H_INCLUDED
+#define LEVELSELECTOR_H_INCLUDED
/************************************************************************
* This file is part of Wizznic. *
@@ -15,14 +15,14 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "sprite.h"
#include "levels.h"
-
-void levelSelector(SDL_Surface* screen, int l, int stats); //Show the level selector
+
+void levelSelector(SDL_Surface* screen, int l, int stats); //Show the level selector
void drawPreviewImg(SDL_Surface* screen, SDL_Surface* img, int stats);
void resetLevelSelector(); //used for when changing pack
-
-#endif // LEVELSELECTOR_H_INCLUDED
+
+#endif // LEVELSELECTOR_H_INCLUDED
2  list.c
View
@@ -12,7 +12,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "list.h"
14 list.h
View
@@ -1,6 +1,6 @@
-#ifndef LIST_H_INCLUDED
-#define LIST_H_INCLUDED
-
+#ifndef LIST_H_INCLUDED
+#define LIST_H_INCLUDED
+
/************************************************************************
* This file is part of Wizznic. *
* Copyright 2009-2012 Jimmy Christensen <dusted@dusted.dk> *
@@ -15,14 +15,14 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
struct listItemStruct
{
void* data;
struct listItemStruct* next;
-};
+};
typedef struct listItemStruct listItem;
@@ -36,5 +36,5 @@ int listSize(listItem* start);
void* listGetItemData(listItem* start, int index);
-
-#endif // LIST_H_INCLUDED
+
+#endif // LIST_H_INCLUDED
14 loader.h
View
@@ -1,6 +1,6 @@
-#ifndef LOADER_H_INCLUDED
-#define LOADER_H_INCLUDED
-
+#ifndef LOADER_H_INCLUDED
+#define LOADER_H_INCLUDED
+
/************************************************************************
* This file is part of Wizznic. *
* Copyright 2009-2012 Jimmy Christensen <dusted@dusted.dk> *
@@ -15,9 +15,9 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
-//Wait.. WHAT?!
-
-#endif // LOADER_H_INCLUDED
+//Wait.. WHAT?!
+
+#endif // LOADER_H_INCLUDED
2  main.c
View
@@ -12,7 +12,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include <stdio.h>
2  mbrowse.c
View
@@ -12,7 +12,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include <dirent.h>
8 mbrowse.h
View
@@ -1,5 +1,5 @@
-#ifndef MBROWSE_H_INCLUDED
-#define MBROWSE_H_INCLUDED
+#ifndef MBROWSE_H_INCLUDED
+#define MBROWSE_H_INCLUDED
/************************************************************************
* This file is part of Wizznic. *
@@ -15,7 +15,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "list.h"
@@ -33,4 +33,4 @@ void fileListFree();
void fileListMake(const char* path);
listItem* fileList();
-#endif // MBROWSE_H_INCLUDED
+#endif // MBROWSE_H_INCLUDED
2  menu.c
View
@@ -12,7 +12,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "menu.h"
10 menu.h
View
@@ -1,5 +1,5 @@
-#ifndef MENU_H_INCLUDED
-#define MENU_H_INCLUDED
+#ifndef MENU_H_INCLUDED
+#define MENU_H_INCLUDED
/************************************************************************
* This file is part of Wizznic. *
@@ -15,7 +15,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include <SDL/SDL.h>
@@ -26,7 +26,7 @@
#include "player.h"
#include "stars.h"
#include "leveleditor.h"
-#include "particles.h"
+#include "particles.h"
int initMenu(SDL_Surface* screen); //Loads menu graphics
int runMenu();
@@ -34,4 +34,4 @@ void setMenu(int mstate);
void setMenuPosX(int x);
void setMenuPosY(int Y);
int getMenuState();
-#endif // MENU_H_INCLUDED
+#endif // MENU_H_INCLUDED
12 pack.c
View
@@ -12,7 +12,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include <dirent.h>
@@ -90,7 +90,7 @@ void packAdd(const char* packDir)
//Initialize list for playlist
playList = initList();
-
+
//Open packs/packname/info.ini
sprintf(buf, "%s/info.ini", packDir);
f = fopen(buf, "r");
@@ -146,7 +146,7 @@ void packAdd(const char* packDir)
ti->name = malloc( sizeof(char)*(strlen(packDir)+1) );
strcpy(ti->name, packDir);
}
-
+
//Set path
ti->path = malloc( sizeof(char)*(strlen(packDir)+1) );
@@ -238,7 +238,7 @@ void packInit()
ps.packs = initList();
ps.numPacks=0;
- //Add the wizznic pack as nr 0.
+ //Add the wizznic pack as nr 0.
packAdd( DATADIR"packs/000_wizznic" );
pdir = opendir( DATADIR"packs/" );
@@ -308,10 +308,10 @@ void packInit()
buf=0;
printf("initPack(); Added %i packs.\n", listSize(ps.packs));
-
+
//Do not call packSet here, it will be called after setting's are read.
- //Set the packbox graphics ptr 0 before loading it.
+ //Set the packbox graphics ptr 0 before loading it.
ps.packBoxImg=0;
}
10 pack.h
View
@@ -1,5 +1,5 @@
-#ifndef PACK_H_INCLUDED
-#define PACK_H_INCLUDED
+#ifndef PACK_H_INCLUDED
+#define PACK_H_INCLUDED
/************************************************************************
* This file is part of Wizznic. *
@@ -15,7 +15,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include <SDL/SDL.h>
@@ -67,5 +67,5 @@ void drawPackBox(SDL_Surface* screen, int posx, int posy, int packNum);
int isFile(const char* fileName);
int isDir(const char* dirName);
-
-#endif // PACK_H_INCLUDED
+
+#endif // PACK_H_INCLUDED
6 particle.c
View
@@ -12,7 +12,7 @@
* 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/>. *
+ * along with Wizznic. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "particles.h"
@@ -62,7 +62,7 @@ void spawnParticleSystem(psysSet_t* settings)
r = ((col & img->format->Rmask) >> img->format->Rshift);
g = ((col & img->format->Gmask) >> img->format->Gshift);
b = ((col & img->format->Bmask) >> img->format->Bshift);
- if( !isAlpha(r,g,b) )
+ if( !isAlpha(r,g,b) )
{
tSystem->particles[i].color = col;
} else {
@@ -158,7 +158,7 @@ void runParticles(SDL_Surface* screen)
}
//This will not enforce PSYS_LAYER_NODRAW (it should not, no particle systems should be created if they are not to be drawn).
-void runParticlesLayer(SDL_Surface* screen, int layer)
+void runParticlesLayer(SDL_Surface* screen, int layer)
{
if(!setting()->particles) return;
listItem* it = pSystems;
16 particles.h
View
@@ -1,5 +1,5 @@
-#ifndef PARTICLES_H_INCLUDED
-#define PARTICLES_H_INCLUDED
+#ifndef PARTICLES_H_INCLUDED
+#define PARTICLES_H_INCLUDED
/************************************************************************
* This file i