Engine:
authorsmxx
Fri, 12 Feb 2010 16:39:22 +0000
changeset 2800 f286d91157b8
parent 2799 558b29bf00c5
child 2801 24739a3bf5e3
Engine: * Added executable icon (Win32 only) * Added window icon * Tiy should redo both as I couldn't get them right (blurred/transparency)
hedgewars/CCHandlers.inc
hedgewars/SDLh.pas
hedgewars/hwengine.ico
hedgewars/hwengine.pas
share/hedgewars/Data/Graphics/hwengine.png
--- 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}
--- 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;
 
Binary file hedgewars/hwengine.ico has changed
--- 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
Binary file share/hedgewars/Data/Graphics/hwengine.png has changed