Files @ r4300:642b2431578b
Branch filter:

Location: cpp/openttd-patchpack/source/slope.h

truelight
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
- New optional landscape generator (TerraGenesis Perlin)
- Load heightmaps (either BMP or PNG)
- Progress dialog while generating worlds (no longer a 'hanging' screen)
- New dialogs for NewGame, Create Scenario and Play Heightmap
- Easier to configure your landscape
- More things to configure (tree-placer, ..)
- Speedup of world generation
- New console command 'restart': restart the map EXACTLY as it was when you
first started it (needs a game made after or with this commit)
- New console command 'getseed': get the seed of your map and share it with
others (of course only works with generated maps)
- Many new, world generation related, things
- Many internal cleanups and rewrites
Many tnx to those people who helped making this:
Belugas, DaleStan, glx, KUDr, RichK67, Rubidium, and TrueLight (alfabetic)
Many tnx to those who helped testing:
Arnau, Bjarni, and tokai (alfabetic)
And to all other people who helped testing and sending comments / bugs
Stats: 673 lines changed, 3534 new lines, 79 new strings
/* $Id$ */

#ifndef SLOPE_H
#define SLOPE_H

typedef enum Slope {
	SLOPE_FLAT  = 0x00,
	SLOPE_W     = 0x01,
	SLOPE_S     = 0x02,
	SLOPE_E     = 0x04,
	SLOPE_N     = 0x08,
	SLOPE_STEEP = 0x10,
	SLOPE_NW = SLOPE_N | SLOPE_W,
	SLOPE_SW = SLOPE_S | SLOPE_W,
	SLOPE_SE = SLOPE_S | SLOPE_E,
	SLOPE_NE = SLOPE_N | SLOPE_E,
	SLOPE_EW = SLOPE_E | SLOPE_W,
	SLOPE_NS = SLOPE_N | SLOPE_S,
	SLOPE_ELEVATED = SLOPE_N | SLOPE_E | SLOPE_S | SLOPE_W,
	SLOPE_NWS = SLOPE_N | SLOPE_W | SLOPE_S,
	SLOPE_WSE = SLOPE_W | SLOPE_S | SLOPE_E,
	SLOPE_SEN = SLOPE_S | SLOPE_E | SLOPE_N,
	SLOPE_ENW = SLOPE_E | SLOPE_N | SLOPE_W,
	SLOPE_STEEP_W = SLOPE_STEEP | SLOPE_NWS,
	SLOPE_STEEP_S = SLOPE_STEEP | SLOPE_WSE,
	SLOPE_STEEP_E = SLOPE_STEEP | SLOPE_SEN,
	SLOPE_STEEP_N = SLOPE_STEEP | SLOPE_ENW
} Slope;

static inline bool IsSteepSlope(Slope s)
{
	return (s & SLOPE_STEEP) != 0;
}

static inline Slope ComplementSlope(Slope s)
{
	assert(!IsSteepSlope(s));
	return (Slope)(0xF ^ s);
}

#endif