2008-09-17 12:34:39 +10:00
|
|
|
#ifndef __SHARED_H
|
|
|
|
#define __SHARED_H
|
|
|
|
|
|
|
|
#include <SDL_image.h>
|
|
|
|
#include "defs.h"
|
|
|
|
|
|
|
|
/* functions */
|
2008-10-10 10:49:43 +11:00
|
|
|
int loadlevel(int wnum, int lnum, int wantmonsters);
|
2008-09-17 12:34:39 +10:00
|
|
|
void setdefaults(sprite_t *s);
|
|
|
|
int loadtiletypes(char *filename);
|
2008-09-28 13:18:36 +10:00
|
|
|
sprite_t *addsprite(int id,int x, int y, char *name);
|
2008-09-17 12:34:39 +10:00
|
|
|
tiletype_t *gettileat(int pixx,int pixy, int *tilex, int *tiley);
|
|
|
|
int loadimagesets(void);
|
|
|
|
int isbullet(int id);
|
|
|
|
void flip(void);
|
|
|
|
void killsprite(sprite_t *s);
|
|
|
|
void drawsprite(sprite_t *s);
|
2008-09-17 21:16:19 +10:00
|
|
|
int gettileframecount(int tid);
|
2008-09-17 12:34:39 +10:00
|
|
|
int isfruit(int id);
|
2008-09-27 16:02:42 +10:00
|
|
|
int isflower(int id);
|
|
|
|
int iseffect(int id);
|
2008-10-03 17:37:05 +10:00
|
|
|
int needscollisions(int id);
|
2008-09-27 16:02:42 +10:00
|
|
|
int candoslopes(int sid);
|
|
|
|
int flowertogem(int id);
|
2008-09-17 12:34:39 +10:00
|
|
|
inline void drawpixel16(SDL_Surface *screen, int x, int y, SDL_Color c);
|
|
|
|
inline void drawpixel32(SDL_Surface *screen, int x, int y, SDL_Color c);
|
|
|
|
inline void drawbox16(SDL_Surface *screen, int x1,int y1,int x2,int y2,SDL_Color *c,SDL_Color *fc);
|
|
|
|
void drawline16(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c);
|
|
|
|
int getcolor(SDL_Surface *dest, int x, int y, SDL_Color *col);
|
2008-10-07 16:53:06 +11:00
|
|
|
/*
|
2008-09-17 12:34:39 +10:00
|
|
|
int chartomonster(char ch);
|
|
|
|
char monstertochar(int id);
|
2008-10-07 16:53:06 +11:00
|
|
|
*/
|
2008-09-29 18:32:56 +10:00
|
|
|
tiletype_t *gettile(int uniqid);
|
|
|
|
int getuniq(int tileid);
|
2008-09-17 12:34:39 +10:00
|
|
|
void drawtile(SDL_Surface *s, int x, int y);
|
|
|
|
void initglobals(void);
|
2008-09-28 13:18:36 +10:00
|
|
|
void killtext(text_t *t);
|
2008-09-27 20:50:19 +10:00
|
|
|
int ismonster(int id);
|
2008-09-28 13:18:36 +10:00
|
|
|
void puffin(int willbecome, int x, int y, char *name, int delay);
|
2008-09-17 21:16:19 +10:00
|
|
|
SDL_Surface *loadspriteimage(int spriteid, int frame, char *filename);
|
2008-09-28 14:09:12 +10:00
|
|
|
int getpoints(int id);
|
2008-10-03 17:37:05 +10:00
|
|
|
int randompowerup(void);
|
2008-09-30 17:42:09 +10:00
|
|
|
int loadlevellist(void);
|
2008-10-07 16:53:06 +11:00
|
|
|
int savelevellist(void);
|
2008-10-03 17:37:05 +10:00
|
|
|
int ispermenant(int pid);
|
2008-10-07 16:53:06 +11:00
|
|
|
int isbosslevel(int lev);
|
|
|
|
int isnettable(int monid);
|
|
|
|
int isboss(int monid);
|
|
|
|
int getbosshealth(int mid);
|
|
|
|
void getpixelrgb(SDL_Surface *where, int x, int y, SDL_Color *clr);
|
2008-10-09 14:32:15 +11:00
|
|
|
void doblit(SDL_Surface *src, SDL_Surface *dst, SDL_Rect *dstarea);
|
2008-10-07 20:18:42 +11:00
|
|
|
// for doco
|
|
|
|
void setfruitinfo(void);
|
|
|
|
void setinfo(int id, char *name, char *desc, char *file);
|
|
|
|
void dumpinfo(void);
|
2008-09-17 12:34:39 +10:00
|
|
|
#endif
|
|
|
|
|