2011-m2s3-city-builder/rules/architecture/couleursDimensions.hh

40 lines
1.3 KiB
C++

#ifndef _RULES_ARCHITECTURE_COLULEURSDIMENSIONS_HH_
#define _RULES_ARCHITECTURE_COLULEURSDIMENSIONS_HH_
#include "all_includes.hh"
class Couleurs {
public:
static unsigned int rgb(unsigned char r, unsigned char g, unsigned char b) {
return r * 0x10000 | g* 0x100 | b;
}
static unsigned char r(unsigned int color) { return ((color >> 16) & 0xff); };
static unsigned char g(unsigned int color) { return ((color >> 8) & 0xff); };
static unsigned char b(unsigned int color) { return (color & 0xff); };
static unsigned int mix(unsigned int colorA, unsigned int colorB, float mixA) {
float mixB = 1 - mixA;
return rgb(
r(colorA) * mixA + r(colorB) * mixB,
g(colorA) * mixA + g(colorB) * mixB,
b(colorA) * mixA + b(colorB) * mixB
);
};
static const unsigned int mur = 0xF1E3AD;
static const unsigned int toit = 0x961618;
static const unsigned int route = 0x363636;
static const unsigned int trottoir = 0x666666;
static const unsigned int bordureTrottoir = 0xAAAAAA;
static const unsigned int herbe = 0x0c4010; // 11AA22
static const unsigned int cielHaut = 0x3c14ff;
static const unsigned int cielBas = 0x7F7FFF;
static const unsigned int fog; // définie dans couleurs.cpp .
};
class Dimensions {
public:
static const unsigned int largeurRoute = 200;
static const unsigned int largeurTrottoir = 140;
};
#endif