OSDN Git Service

原作のv1.6へのバージョンアップに対応する修正
[starfighter-jp/starfighter-jp.git] / src / colors.cpp
1 /*
2 Copyright (C) 2003 Parallel Realities
3 Copyright (C) 2011, 2012, 2013 Guus Sliepen
4 Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
5
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 3
9 of the License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include "SDL.h"
21
22 #include "Starfighter.h"
23
24 Uint32 red;
25 Uint32 darkRed;
26 Uint32 yellow;
27 Uint32 darkYellow;
28 Uint32 green;
29 Uint32 darkGreen;
30 Uint32 blue;
31 Uint32 darkBlue;
32 Uint32 darkerBlue;
33 Uint32 black;
34 Uint32 white;
35 Uint32 lightGrey;
36 Uint32 darkGrey;
37
38 /*
39 Finds the location of the requested color within the palette and returns
40 it's number. This colors are used for drawing rectangles, circle, etc in
41 the correct colors.
42 */
43 void colors_init()
44 {
45         red = SDL_MapRGB(screen->format, 0xff, 0x00, 0x00);
46         darkRed = SDL_MapRGB(screen->format, 0x66, 0x00, 0x00);
47
48         yellow = SDL_MapRGB(screen->format, 0xff, 0xff, 0x00);
49         darkYellow = SDL_MapRGB(screen->format, 0x66, 0x66, 0x00);
50
51         green = SDL_MapRGB(screen->format, 0x00, 0xff, 0x00);
52         darkGreen = SDL_MapRGB(screen->format, 0x00, 0x66, 0x00);
53
54         blue = SDL_MapRGB(screen->format, 0x00, 0x00, 0xff);
55         darkBlue = SDL_MapRGB(screen->format, 0x00, 0x00, 0x99);
56         darkerBlue = SDL_MapRGB(screen->format, 0x00, 0x00, 0x44);
57
58         black = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
59         white = SDL_MapRGB(screen->format, 0xff, 0xff, 0xff);
60         lightGrey = SDL_MapRGB(screen->format, 0xcc, 0xcc, 0xcc);
61         darkGrey = SDL_MapRGB(screen->format, 0x99, 0x99, 0x99);
62 }