Click here to Skip to main content
15,893,381 members
Articles / Programming Languages / C++

CMapEditor

Rate me:
Please Sign up or sign in to vote.
4.00/5 (9 votes)
14 Oct 20032 min read 47.9K   1.2K   15  
A simple and efficient interface for using a multi-level matrix of values.
CMapEditor v. 1.0			//
					//
Copyright (C) 2003 Eugenio Panero.	//
All Rights Reserved.			//
					//
www.eugigames.tk			//
info@eugigames.tk			//
					//	
//////////////////////////////////////////

====================
What is CMapEditor ?
====================

CMapEditor is a simple and efficient interface for using a multi-level a matrix of values. This can be easily used in games or any other program that requires a versatile map structure.

=========================
How do i use CMapEditor ?
=========================

You must include the

	#include "CMapEditor.h"

direction in your file to be able to use CMapEditor. Keep also in mind that CMapEditor requires the <vector> header to be present on your machine.

To initialize a map just use:

	CMapEditor meEditor(WIDTH,HEIGHT,LEVELS);

or

	CMapEditor *meEditor = new CMapEditor(WIDTH,HEIGHT,LEVELS);

To set a cell's value in the map, use:

	meEditor->SetMapValue(X,Y,LEVEL,VALUE)

You can also use advanced operations, such as region fill, or drag-like procedures:

	meEditor->Fill(X,Y,LEVEL,REPLACE_VALUE,VALUE)

and

	meEditor->StartDrag(X,Y,LEVEL)
	meEditor->EndDrag(DX,DY,VALUE)

CMapEditor also supports basic Undo and Redo operations. You can decide what is going to be undone by calling

	meEditor->NextUndo();

before performing other operations. For example:

	meEditor->NextUndo();
	meEditor->SetMapValue(X,Y,LEVEL,VALUE)
	eEditor->Fill(X,Y,LEVEL,REPLACE_VALUE,VALUE)
	...

in this case, the SetMapValue() and the Fill() effects will be undone together. To perform undo and redo, just use:

	meEditor->Undo()

and

	meEditor->Redo()

==========================================================
I found a bug in CMapEditor or i have a comment/suggestion
==========================================================

Please! Send an email to info@eugigames.tk !
	
	

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions