home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ Games Programming
/
CPPGAMES.ISO
/
thx
/
include
/
scenery.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-08
|
2KB
|
87 lines
// ----------- scenery.h
#ifndef SCENERY_H
#define SCENERY_H
#include "viddir.h"
struct Mice {
short int x1, y1, x2, y2; // screen rectangle
char *cursor; // cursor hotspot(x,y) mask and map
callback func; // function to call if left click
};
#define DECLARE_MOUSECURSORS \
static Mice MouseCursorTable[]; \
virtual Mice *GetMouseCursors() \
{ return MouseCursorTable; }
#define CURSORLIST(scene) \
Mice scene::MouseCursorTable[] = {
#define MOUSE_CURSOR(x1,y1,x2,y2,crs,fn) \
{x1,y1,x2,y2,crs,(callback)fn},
#define ENDCURSORLIST \
{ -1, -1, -1, -1 } \
};
extern char UPCURSOR[];
extern char DNCURSOR[];
extern char RTCURSOR[];
extern char LFCURSOR[];
extern char CNCURSOR[];
extern char ULCURSOR[];
extern char URCURSOR[];
extern char LLCURSOR[];
extern char LRCURSOR[];
extern char DEFAULT[];
#define UPPERLEFTARROWCURSOR ULCURSOR
#define UPARROWCURSOR UPCURSOR
#define UPPERRIGHTARROWCURSOR URCURSOR
#define LEFTARROWCURSOR LFCURSOR
#define CENTERCURSOR CNCURSOR
#define RIGHTARROWCURSOR RTCURSOR
#define LOWERLEFTARROWCURSOR LLCURSOR
#define DOWNARROWCURSOR DNCURSOR
#define LOWERRIGHTARROWCURSOR LRCURSOR
#define DEFAULTCURSOR DEFAULT
const short int ClearEveryTime = -1;
const short int NoTransition = 0;
class SceneryDirector : public VideoDirector {
short int transition;
void show_mousecursor(char *cursor);
void mousemoved(int x, int y, int);
void mouseclicked(int x, int y);
protected:
char *scenery;
Mice *mousecursors;
DECLARE_CUELIST
virtual void display();
virtual void stop_director()
{ quit(); }
virtual void on_escape()
{ stop_director(); }
virtual void on_space()
{ stop_director(); }
virtual void on_enter()
{ stop_director(); }
virtual const Type_info& get_next_director();
virtual void initialize();
virtual Mice *GetMouseCursors()
{ return 0; }
virtual void refresh_display();
virtual void display_original_scenery();
public:
SceneryDirector(char *pcxfile = 0,
short int trans = ClearEveryTime);
virtual ~SceneryDirector()
{ }
};
#endif