| acc78225 |
sago007 |
2015-12-29 18:10 |
1 |
/* |
| acc78225 |
sago007 |
2015-12-29 18:10 |
2 |
=========================================================================== |
| acc78225 |
sago007 |
2015-12-29 18:10 |
3 |
blockattack - Block Attack - Rise of the Blocks |
| acc78225 |
sago007 |
2015-12-29 18:10 |
4 |
Copyright (C) 2005-2015 Poul Sander |
| acc78225 |
sago007 |
2015-12-29 18:10 |
5 |
|
| acc78225 |
sago007 |
2015-12-29 18:10 |
6 |
This program is free software: you can redistribute it and/or modify |
| acc78225 |
sago007 |
2015-12-29 18:10 |
7 |
it under the terms of the GNU General Public License as published by |
| acc78225 |
sago007 |
2015-12-29 18:10 |
8 |
the Free Software Foundation, either version 2 of the License, or |
| acc78225 |
sago007 |
2015-12-29 18:10 |
9 |
(at your option) any later version. |
| acc78225 |
sago007 |
2015-12-29 18:10 |
10 |
|
| acc78225 |
sago007 |
2015-12-29 18:10 |
11 |
This program is distributed in the hope that it will be useful, |
| acc78225 |
sago007 |
2015-12-29 18:10 |
12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| acc78225 |
sago007 |
2015-12-29 18:10 |
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| acc78225 |
sago007 |
2015-12-29 18:10 |
14 |
GNU General Public License for more details. |
| acc78225 |
sago007 |
2015-12-29 18:10 |
15 |
|
| acc78225 |
sago007 |
2015-12-29 18:10 |
16 |
You should have received a copy of the GNU General Public License |
| acc78225 |
sago007 |
2015-12-29 18:10 |
17 |
along with this program. If not, see http://www.gnu.org/licenses/ |
| acc78225 |
sago007 |
2015-12-29 18:10 |
18 |
|
| acc78225 |
sago007 |
2015-12-29 18:10 |
19 |
Source information and contacts persons can be found at |
| acc78225 |
sago007 |
2015-12-29 18:10 |
20 |
http://blockattack.net |
| acc78225 |
sago007 |
2015-12-29 18:10 |
21 |
=========================================================================== |
| acc78225 |
sago007 |
2015-12-29 18:10 |
22 |
*/ |
| acc78225 |
sago007 |
2015-12-29 18:10 |
23 |
|
| acc78225 |
sago007 |
2015-12-29 18:10 |
24 |
#include "icon.hpp" |
| acc78225 |
sago007 |
2015-12-29 18:10 |
25 |
#include "icon.h" |
| acc78225 |
sago007 |
2015-12-29 18:10 |
26 |
|
| acc78225 |
sago007 |
2015-12-29 18:10 |
27 |
void SetSDLIcon(SDL_Window* window) |
| acc78225 |
sago007 |
2015-12-29 18:10 |
28 |
{ |
| acc78225 |
sago007 |
2015-12-29 18:10 |
29 |
SDL_Surface* surface = SDL_CreateRGBSurfaceFrom( |
| acc78225 |
sago007 |
2015-12-29 18:10 |
30 |
(void *)gimp_image.pixel_data, |
| acc78225 |
sago007 |
2015-12-29 18:10 |
31 |
gimp_image.width, |
| acc78225 |
sago007 |
2015-12-29 18:10 |
32 |
gimp_image.height, |
| acc78225 |
sago007 |
2015-12-29 18:10 |
33 |
gimp_image.bytes_per_pixel * 8, |
| acc78225 |
sago007 |
2015-12-29 18:10 |
34 |
gimp_image.bytes_per_pixel * gimp_image.width, |
| acc78225 |
sago007 |
2015-12-29 18:10 |
35 |
#if SDL_BYTEORDER == SDL_BIG_ENDIAN |
| acc78225 |
sago007 |
2015-12-29 18:10 |
36 |
0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF |
| acc78225 |
sago007 |
2015-12-29 18:10 |
37 |
#else |
| acc78225 |
sago007 |
2015-12-29 18:10 |
38 |
0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 |
| acc78225 |
sago007 |
2015-12-29 18:10 |
39 |
#endif |
| acc78225 |
sago007 |
2015-12-29 18:10 |
40 |
); |
| acc78225 |
sago007 |
2015-12-29 18:10 |
41 |
SDL_SetWindowIcon(window, surface); |
| acc78225 |
sago007 |
2015-12-29 18:10 |
42 |
SDL_FreeSurface(surface); |
| acc78225 |
sago007 |
2015-12-29 18:10 |
43 |
|
| acc78225 |
sago007 |
2015-12-29 18:10 |
44 |
} |