2015-06-20 17:31:41 +02:00
|
|
|
/*
|
|
|
|
Copyright (C) 2003 Parallel Realities
|
|
|
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
2020-03-05 21:01:46 +01:00
|
|
|
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
2015-06-20 17:31:41 +02:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 3
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2016-08-05 02:26:24 +02:00
|
|
|
#include "SDL.h"
|
2016-08-04 21:58:38 +02:00
|
|
|
|
2016-11-26 00:21:31 +01:00
|
|
|
#include "defs.h"
|
|
|
|
#include "structs.h"
|
|
|
|
|
2016-11-26 06:36:33 +01:00
|
|
|
#include "screen.h"
|
|
|
|
|
2015-06-20 17:31:41 +02:00
|
|
|
Uint32 red;
|
|
|
|
Uint32 darkRed;
|
|
|
|
Uint32 yellow;
|
2020-03-07 06:24:37 +01:00
|
|
|
Uint32 lightYellow;
|
2015-06-20 17:31:41 +02:00
|
|
|
Uint32 darkYellow;
|
|
|
|
Uint32 green;
|
2020-03-07 06:24:37 +01:00
|
|
|
Uint32 lightGreen;
|
2015-06-20 17:31:41 +02:00
|
|
|
Uint32 darkGreen;
|
|
|
|
Uint32 blue;
|
2020-03-07 06:24:37 +01:00
|
|
|
Uint32 lightBlue;
|
|
|
|
Uint32 lighterBlue;
|
2015-06-20 17:31:41 +02:00
|
|
|
Uint32 darkBlue;
|
|
|
|
Uint32 darkerBlue;
|
|
|
|
Uint32 black;
|
|
|
|
Uint32 white;
|
|
|
|
Uint32 lightGrey;
|
|
|
|
Uint32 darkGrey;
|
|
|
|
|
|
|
|
/*
|
|
|
|
Finds the location of the requested color within the palette and returns
|
|
|
|
it's number. This colors are used for drawing rectangles, circle, etc in
|
|
|
|
the correct colors.
|
|
|
|
*/
|
|
|
|
void colors_init()
|
|
|
|
{
|
|
|
|
red = SDL_MapRGB(screen->format, 0xff, 0x00, 0x00);
|
|
|
|
darkRed = SDL_MapRGB(screen->format, 0x66, 0x00, 0x00);
|
|
|
|
|
|
|
|
yellow = SDL_MapRGB(screen->format, 0xff, 0xff, 0x00);
|
2020-03-07 06:24:37 +01:00
|
|
|
lightYellow = SDL_MapRGB(screen->format, 0xff, 0xff, 0x80);
|
2015-06-20 17:31:41 +02:00
|
|
|
darkYellow = SDL_MapRGB(screen->format, 0x66, 0x66, 0x00);
|
|
|
|
|
|
|
|
green = SDL_MapRGB(screen->format, 0x00, 0xff, 0x00);
|
2020-03-07 06:24:37 +01:00
|
|
|
lightGreen = SDL_MapRGB(screen->format, 0x80, 0xff, 0x80);
|
2015-06-20 17:31:41 +02:00
|
|
|
darkGreen = SDL_MapRGB(screen->format, 0x00, 0x66, 0x00);
|
|
|
|
|
|
|
|
blue = SDL_MapRGB(screen->format, 0x00, 0x00, 0xff);
|
2020-03-07 06:24:37 +01:00
|
|
|
lightBlue = SDL_MapRGB(screen->format, 0x99, 0x99, 0xff);
|
|
|
|
lighterBlue = SDL_MapRGB(screen->format, 0xbb, 0xbb, 0xff);
|
|
|
|
darkBlue = SDL_MapRGB(screen->format, 0x00, 0x00, 0xcc);
|
2015-06-20 17:31:41 +02:00
|
|
|
darkerBlue = SDL_MapRGB(screen->format, 0x00, 0x00, 0x44);
|
|
|
|
|
|
|
|
black = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
|
|
|
|
white = SDL_MapRGB(screen->format, 0xff, 0xff, 0xff);
|
|
|
|
lightGrey = SDL_MapRGB(screen->format, 0xcc, 0xcc, 0xcc);
|
|
|
|
darkGrey = SDL_MapRGB(screen->format, 0x99, 0x99, 0x99);
|
|
|
|
}
|