ftp.nice.ch/pub/next/games/card/NeXTmj.2.0.s.tar.gz#/NeXTmj/Tile.h

This is Tile.h in view mode; [Download] [Up]

/*
 * This is the base class for tiles.
 *
 $Author$
 $Header$
 *
 $Log$
 */

extern "Objective-C" {
#import	<appkit/NXImage.h>
#import	<appkit/View.h>
}


												// Some tiles need to be shifted by this
												//	amount so that a 3d effect can be
												//	acheived.
#define	TILE_SHIFT	5


												// Each tile is a square.  This constant
												//	reflects the pixels high and wide for
												//	a tile.
#define	TILE_SIZE	64


class Tile {

protected:
												// This is a Image object which is
												//	loaded with a tiff image and used
												//	to display a tile.
	NXImage	*my_tile_image;
												// This member function is called by 
												//	subclasses to load a tiff file for
												//	tile rendering.
	void	loadImageFromFile( const char * );

protected:
												// This function does the actual drawing of
												//	an image to a point on the board.  All
												//	of the drawImage() routine call this.
												// The first parameter is a point on the
												//	board where the tile is drawn, the 
												//	second parameter is the composite
												//	operation.
	void	compositeImage( NXPoint, int );
public:
												// This member function is called by the
												//	Board View to composite the tile a
												//	a location within the view. (The focus
												//	of the view must have been locked 
												//	previously.)
												// This member function must be implemented
												//	in the subclasses since game tiles 
												//	can be highlighted.
	virtual void	drawImage( NXPoint ) = 0;

public:
	Tile( void );
	~Tile( void );
};

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.