# HG changeset patch
# User smxx
# Date 1265992762 0
# Node ID f286d91157b82ea22aaa1c46e4c65b6583525b06
# Parent  558b29bf00c5882d31c0d7e3994d4c5a7baa3b68
Engine:
* Added executable icon (Win32 only)
* Added window icon
* Tiy should redo both as I couldn't get them right (blurred/transparency)

diff -r 558b29bf00c5 -r f286d91157b8 hedgewars/CCHandlers.inc
--- a/hedgewars/CCHandlers.inc	Wed Feb 10 22:00:49 2010 +0000
+++ b/hedgewars/CCHandlers.inc	Fri Feb 12 16:39:22 2010 +0000
@@ -613,6 +613,7 @@
 
 procedure chFullScr(var s: shortstring);
 var flags: Longword = 0;
+	ico: PSDL_Surface;
 {$IFDEF DEBUGFILE}
     buf: array[byte] of char;
 {$ENDIF}
@@ -636,7 +637,17 @@
 		cScreenHeight:= cInitHeight
 	end;
 
+	// load window icon
+	ico:= LoadImage(Pathz[ptGraphics] + '/hwengine', ifIgnoreCaps);
+	if ico <> nil then
+		begin
+		SDL_WM_SetIcon(ico, 0);
+		SDL_FreeSurface(ico)
+		end;
+	
+	// set window caption
 	SDL_WM_SetCaption('Hedgewars', nil);
+	
 	if SDLPrimSurface <> nil then
 	begin
 {$IFDEF DEBUGFILE}
diff -r 558b29bf00c5 -r f286d91157b8 hedgewars/SDLh.pas
--- a/hedgewars/SDLh.pas	Wed Feb 10 22:00:49 2010 +0000
+++ b/hedgewars/SDLh.pas	Fri Feb 12 16:39:22 2010 +0000
@@ -654,6 +654,7 @@
 
 function  SDL_ShowCursor(toggle: LongInt): LongInt; cdecl; external SDLLibName;
 
+procedure SDL_WM_SetIcon(icon: PSDL_Surface; mask : byte); cdecl; external SDLLibName;
 procedure SDL_WM_SetCaption(title: PChar; icon: PChar); cdecl; external SDLLibName;
 function  SDL_WM_ToggleFullScreen(surface: PSDL_Surface): LongInt; cdecl; external SDLLibName;
 
diff -r 558b29bf00c5 -r f286d91157b8 hedgewars/hwengine.ico
Binary file hedgewars/hwengine.ico has changed
diff -r 558b29bf00c5 -r f286d91157b8 hedgewars/hwengine.pas
--- a/hedgewars/hwengine.pas	Wed Feb 10 22:00:49 2010 +0000
+++ b/hedgewars/hwengine.pas	Fri Feb 12 16:39:22 2010 +0000
@@ -18,6 +18,10 @@
 
 {$INCLUDE "options.inc"}
 
+{$IFDEF WIN32}
+{$R hwengine.rc}
+{$ENDIF}
+
 {$IFDEF IPHONEOS}
 unit hwengine;
 interface
diff -r 558b29bf00c5 -r f286d91157b8 share/hedgewars/Data/Graphics/hwengine.png
Binary file share/hedgewars/Data/Graphics/hwengine.png has changed