Mail Archives: djgpp/1998/09/08/00:02:34
sparhawk AT eunet DOT at (Gerhard Gruber) wrote:
>Destination: "Mars" <mars AT homemail DOT com>
>=46rom: Gruber Gerhard
>Group: comp.os.msdos.djgpp
>Date: 3 Sep 1998 18:20:43 +0100:
>
>>I have a class containing several (about 10) integer variables,
>
>Did you already read the rplies to your previous post? I, and several =
>other,
>tried to give some hints or tips what you can do. Also more information
=
>would
>be nice. Saying something like "My program doesn't work. Why?" is not =
>really
>helpfull. If it is not to long you could post the source so somebody =
>might
>take a look at it.
>--
>Bye,
> Gerhard
>
>email: sparhawk AT eunet DOT at
> g DOT gruber AT sis DOT co DOT at
>
>Spelling corrections are appreciated.
It was not me. This is another problem.
This is the signiture of the class:
class MapObject
{
BITMAP *picture;
int sizex;
int sizey;
public:
MapObject(BITMAP *pict, int size_x, int size_y);
void drawObject(BITMAP* dest, int x, int y);
};
class GridMap
{
MapObject **map;
int sizex, sizey; // actual size
int visualx, visualy; // visual size shown on screen
int screenx, screeny;
// position of left-hand corner where to begin // displaying grid
BITMAP *display; // output bitmap generally screen
int boxsize; // size of each map square
int count; // used for mouse scrolling
protected:
int curx, cury;
public:
GridMap(int size_x, int size_y, int visual_x, int visual_y,
int screen_x=0, int screen_y=0, BITMAP *disp=screen,
int begin_x=0, int begin_y=0, int box_size=20);
~GridMap();
void setDisplay(BITMAP *new_display);
void moveMap(int new_x, int new_y);
void setVisual(int new_x, int new_y);
MapObject& get(int x, int y);
MapObject* getpt(int x, int y);
void clearMap(MapObject *mo);
void scrollUp(int n);
void scrollDown(int n) ;
void scrollLeft(int n) ;
void scrollRight(int n) ;
void drawGrid() ;
void drawMap() ;
void scrollMouse();
};
- Raw text -