delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/08/00:02:34

From: "Mars" <mars AT homemail DOT com>
Sender: "Mars" <marsj AT 195 DOT 158 DOT 64 DOT 19>
Reply-To: "Mars" <mars AT homemail DOT com>
Subject: Re: Crash in class when adding new variables
Newsgroups: comp.os.msdos.djgpp
References: <35eec1db DOT 0 AT 195 DOT 158 DOT 64 DOT 19> <35f0e017 DOT 37639438 AT news DOT Austria DOT EU DOT net>
NNTP-Posting-Host: 195.158.64.77
Message-ID: <35f01ace.0@195.158.64.19>
Date: 4 Sep 1998 18:52:30 +0100
Lines: 77
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019