- modified icons to properly work with windows (bothh ico files and vc++ projeect files etc)

This commit is contained in:
Mark Vejvoda 2010-06-25 22:04:40 +00:00
parent 1a8250d2d2
commit 15ee2da57f
18 changed files with 96 additions and 19 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" standalone="yes"?> <?xml version="1.0" standalone="yes"?>
<configuration> <configuration>
<title value="Mega Glest"/> <title value="Mega Glest"/>
<file-name value="glest.ini"/> <file-name value="megaglest.ini"/>
<icon value="true" path="glest.ico"/> <icon value="true" path="glest.ico"/>
<field-groups> <field-groups>
<field-group name="General"> <field-group name="General">

View File

@ -10,8 +10,9 @@ rm -rf $RELEASEDIR
mkdir -p $RELEASEDIR mkdir -p $RELEASEDIR
# copy sources # copy sources
pushd "`pwd`/../../data/glest_game" pushd "`pwd`/../../data/glest_game"
find glest.ico \( -name "*.*" \) -exec cp -p --parents "{}" $RELEASEDIR ';' find megaglest.ico \( -name "*.*" \) -exec cp -p --parents "{}" $RELEASEDIR ';'
find servers.ini \( -name "*.*" \) -exec cp -p --parents "{}" $RELEASEDIR ';' find servers.ini \( -name "*.*" \) -exec cp -p --parents "{}" $RELEASEDIR ';'
find glestkeys.ini \( -name "*.*" \) -exec cp -p --parents "{}" $RELEASEDIR ';'
find data/ \( -name "*.*" \) -exec cp -p --parents "{}" $RELEASEDIR ';' find data/ \( -name "*.*" \) -exec cp -p --parents "{}" $RELEASEDIR ';'
find docs/ \( -name "*.*" \) -exec cp -p --parents "{}" $RELEASEDIR ';' find docs/ \( -name "*.*" \) -exec cp -p --parents "{}" $RELEASEDIR ';'
find maps/ \( -name "*.*" \) -exec cp -p --parents "{}" $RELEASEDIR ';' find maps/ \( -name "*.*" \) -exec cp -p --parents "{}" $RELEASEDIR ';'

View File

@ -132,6 +132,7 @@ if [ $REPACKONLY -eq 0 ]; then
find glest -exec cp -p --parents "{}" $INSTALLDATADIR ';' find glest -exec cp -p --parents "{}" $INSTALLDATADIR ';'
find glest.bin -exec cp -p --parents "{}" ${INSTALLDATADIR}bin ';' find glest.bin -exec cp -p --parents "{}" ${INSTALLDATADIR}bin ';'
find glest.ini -exec cp -p --parents "{}" $INSTALLDATADIR ';' find glest.ini -exec cp -p --parents "{}" $INSTALLDATADIR ';'
find glestkeys.ini -exec cp -p --parents "{}" $INSTALLDATADIR ';'
find glest_configurator -exec cp -p --parents "{}" $INSTALLDATADIR ';' find glest_configurator -exec cp -p --parents "{}" $INSTALLDATADIR ';'
find glest_editor -exec cp -p --parents "{}" $INSTALLDATADIR ';' find glest_editor -exec cp -p --parents "{}" $INSTALLDATADIR ';'
find glest_g3dviewer -exec cp -p --parents "{}" $INSTALLDATADIR ';' find glest_g3dviewer -exec cp -p --parents "{}" $INSTALLDATADIR ';'
@ -146,7 +147,7 @@ if [ $REPACKONLY -eq 0 ]; then
pushd "`pwd`/$megaglest_data_path" pushd "`pwd`/$megaglest_data_path"
find configuration.xml -exec cp -p --parents "{}" $INSTALLDATADIR ';' find configuration.xml -exec cp -p --parents "{}" $INSTALLDATADIR ';'
find glest.ico -exec cp -p --parents "{}" $INSTALLDATADIR ';' find megaglest.ico -exec cp -p --parents "{}" $INSTALLDATADIR ';'
find data/ \( -name "*.*" \) -exec cp -p --parents "{}" $INSTALLDATADIR ';' find data/ \( -name "*.*" \) -exec cp -p --parents "{}" $INSTALLDATADIR ';'
find docs/ \( -name "*.*" \) -exec cp -p --parents "{}" $INSTALLDATADIR ';' find docs/ \( -name "*.*" \) -exec cp -p --parents "{}" $INSTALLDATADIR ';'
find maps/ \( -name "*.*" \) -exec cp -p --parents "{}" $INSTALLDATADIR ';' find maps/ \( -name "*.*" \) -exec cp -p --parents "{}" $INSTALLDATADIR ';'

View File

@ -55,10 +55,33 @@ Setup.Package
genericname = _("MegaGlest"), genericname = _("MegaGlest"),
tooltip = _("A real time strategy game."), tooltip = _("A real time strategy game."),
builtin_icon = false, builtin_icon = false,
icon = "glest.ico", icon = "megaglest.ico",
commandline = "%0/glest", commandline = "%0/glest",
category = "Game" category = "Game"
} }
Setup.DesktopMenuItem
{
disabled = false,
name = _("MegaGlest Map Editor"),
genericname = _("MegaGlest"),
tooltip = _("A real time strategy game."),
builtin_icon = false,
icon = "editor.ico",
commandline = "%0/editor",
category = "Game"
}
Setup.DesktopMenuItem
{
disabled = false,
name = _("MegaGlest G3D Model Viewer"),
genericname = _("MegaGlest"),
tooltip = _("A real time strategy game."),
builtin_icon = false,
icon = "g3dviewer.ico",
commandline = "%0/g3dviewer",
category = "Game"
}
} }
} }

Binary file not shown.

View File

@ -2,16 +2,16 @@
; General Attributes ; General Attributes
!define APNAME Mega-Glest !define APNAME Mega-Glest
!define APVER 3.3.4 !define APVER 3.3.5
Name "${APNAME} ${APVER}" Name "${APNAME} ${APVER}"
SetCompressor /FINAL /SOLID lzma SetCompressor /FINAL /SOLID lzma
SetCompressorDictSize 64 SetCompressorDictSize 64
OutFile "${APNAME}-Installer-${APVER}_i386_win32.exe" OutFile "${APNAME}-Installer-${APVER}_i386_win32.exe"
Icon "..\glest.ico" Icon "..\megaglest.ico"
UninstallIcon "..\glest.ico" UninstallIcon "..\megaglest.ico"
!define MUI_ICON "..\glest.ico" !define MUI_ICON "..\megaglest.ico"
!define MUI_UNICON "..\glest.ico" !define MUI_UNICON "..\megaglest.ico"
InstallDir "$PROGRAMFILES\${APNAME}_${APVER}" InstallDir "$PROGRAMFILES\${APNAME}_${APVER}"
ShowInstDetails show ShowInstDetails show
BGGradient 0xDF9437 0xffffff BGGradient 0xDF9437 0xffffff
@ -123,8 +123,9 @@ Section "${APNAME} (required)"
File "..\..\..\data\glest_game\glest_configurator.exe" File "..\..\..\data\glest_game\glest_configurator.exe"
File "..\..\..\data\glest_game\g3d_viewer.exe" File "..\..\..\data\glest_game\g3d_viewer.exe"
File "..\..\..\data\glest_game\configuration.xml" File "..\..\..\data\glest_game\configuration.xml"
File "..\..\..\data\glest_game\glest.ico" File "..\..\..\data\glest_game\megaglest.ico"
File "..\..\..\data\glest_game\glest.ini" File "..\..\..\data\glest_game\glest.ini"
File "..\..\..\data\glest_game\glestkeys.ini"
File "..\..\..\data\glest_game\servers.ini" File "..\..\..\data\glest_game\servers.ini"
# File "..\..\..\data\glest_game\dsound.dll" # File "..\..\..\data\glest_game\dsound.dll"
File "..\..\..\data\glest_game\openal32.dll" File "..\..\..\data\glest_game\openal32.dll"
@ -192,8 +193,9 @@ Section "Uninstall"
Delete $INSTDIR\glest_configurator.exe Delete $INSTDIR\glest_configurator.exe
Delete $INSTDIR\g3d_viewer.exe Delete $INSTDIR\g3d_viewer.exe
Delete $INSTDIR\configuration.xml Delete $INSTDIR\configuration.xml
Delete $INSTDIR\glest.ico Delete $INSTDIR\megaglest.ico
Delete $INSTDIR\glest.ini Delete $INSTDIR\glest.ini
Delete $INSTDIR\glestkeys.ini
Delete $INSTDIR\servers.ini Delete $INSTDIR\servers.ini
# Delete $INSTDIR\dsound.dll # Delete $INSTDIR\dsound.dll
Delete $INSTDIR\openal32.dll Delete $INSTDIR\openal32.dll

1
mk/windoze/g3d_viewer.rc Normal file
View File

@ -0,0 +1 @@
IDI_ICON1 ICON DISCARDABLE "megaglest_g3dviewer.ico"

View File

@ -40,14 +40,14 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="&quot;..\..\source\win32_deps\wxWidgets-2.8.10\lib\vc_lib\mswd&quot;;&quot;..\..\source\win32_deps\wxWidgets-2.8.10\include\msvc&quot;;..\..\source\shared_lib\include\util;..\..\source\shared_lib\include\platform\win32;..\..\source\shared_lib\include\graphics\gl;..\..\source\win32_deps\include;..\..\source\shared_lib\include\graphics;&quot;..\..\source\win32_deps\wxWidgets-2.8.10\include&quot;" AdditionalIncludeDirectories="&quot;..\..\source\win32_deps\wxWidgets-2.8.10\lib\vc_lib\mswd&quot;;&quot;..\..\source\win32_deps\wxWidgets-2.8.10\include\msvc&quot;;..\..\source\shared_lib\include\util;..\..\source\shared_lib\include\platform\win32;..\..\source\shared_lib\include\graphics\gl;..\..\source\win32_deps\include;..\..\source\shared_lib\include\graphics;&quot;..\..\source\win32_deps\wxWidgets-2.8.10\include&quot;;..\..\source\shared_lib\include\platform\sdl;../../source/shared_lib/include/streflop;../../source/shared_lib/include/platform/common;&quot;../../source/win32_deps/SDL-1.2.14/include&quot;;&quot;../../source/win32_deps/curl-7.20.1/include&quot;;..\..\source\glest_game\graphics;..\..\source\shared_lib\include\xml;&quot;../../source/win32_deps/xerces-c-3.0.1/src&quot;;..\..\source\glest_game\global;..\..\source\glest_game\sound;..\..\source\shared_lib\include\sound;..\..\source\glest_game\game"
PreprocessorDefinitions="MWIN;__WXMSW__;__WXDEBUG__" PreprocessorDefinitions="WIN32;_WINDOWS;CURL_STATICLIB"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
UsePrecompiledHeader="1" UsePrecompiledHeader="0"
PrecompiledHeaderThrough="" PrecompiledHeaderThrough=""
PrecompiledHeaderFile="c:\temp\$(TargetName).pch" PrecompiledHeaderFile=""
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
DebugInformationFormat="4" DebugInformationFormat="4"
@ -63,10 +63,10 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="wxbase28d.lib wxbase28d_net.lib wxbase28d_xml.lib wxexpatd.lib wxjpegd.lib wxmsw28d_adv.lib wxmsw28d_aui.lib wxmsw28d_core.lib wxmsw28d_gl.lib wxmsw28d_html.lib wxmsw28d_media.lib wxmsw28d_qa.lib wxmsw28d_richtext.lib wxmsw28d_xrc.lib wxpngd.lib wxregexd.lib wxtiffd.lib wxzlibd.lib ..\libglest.lib kernel32.lib user32.lib gdi32.lib ole32.lib oleaut32.lib comctl32.lib comdlg32.lib uuid.lib advapi32.lib shell32.lib winmm.lib rpcrt4.lib" AdditionalDependencies="wxbase28d.lib wxbase28d_net.lib wxbase28d_xml.lib wxexpatd.lib wxjpegd.lib wxmsw28d_adv.lib wxmsw28d_aui.lib wxmsw28d_core.lib wxmsw28d_gl.lib wxmsw28d_html.lib wxmsw28d_media.lib wxmsw28d_qa.lib wxmsw28d_richtext.lib wxmsw28d_xrc.lib wxpngd.lib wxregexd.lib wxtiffd.lib wxzlibd.lib winmm.lib rpcrt4.lib kernel32.lib user32.lib gdi32.lib ole32.lib oleaut32.lib comctl32.lib comdlg32.lib uuid.lib advapi32.lib shell32.lib libglest.lib Dbghelp.lib sdl.lib sdlmain.lib dxguid.lib libstreflop.lib libcurl.lib ws2_32.lib xerces-c_3d.lib"
OutputFile="$(OutDir)\G3D_Viewer.exe" OutputFile="$(OutDir)\G3D_Viewer.exe"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="..\..\source\win32_deps\lib" AdditionalLibraryDirectories="../../source/win32_deps/lib;&quot;../../build/$(ConfigurationName)/libglest&quot;;../../source/shared_lib/sources/streflop/libstreflop"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
TargetMachine="1" TargetMachine="1"
@ -196,7 +196,7 @@
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
> >
<File <File
RelativePath=".\glest.rc" RelativePath=".\g3d_viewer.rc"
> >
</File> </File>
</Filter> </Filter>

1
mk/windoze/glest.rc Executable file
View File

@ -0,0 +1 @@
IDI_ICON1 ICON DISCARDABLE "megaglest.ico"

View File

@ -0,0 +1 @@
IDI_ICON1 ICON DISCARDABLE "megaglest_editor.ico"

View File

@ -204,7 +204,7 @@
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
> >
<File <File
RelativePath=".\glest.rc" RelativePath=".\glest_editor.rc"
> >
</File> </File>
</Filter> </Filter>

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -115,6 +115,12 @@ MainWindow::MainWindow(const string &modelPath)
CreateStatusBar(); CreateStatusBar();
#ifdef WIN32
wxInitAllImageHandlers();
wxIcon icon("IDI_ICON1");
SetIcon(icon);
#endif
timer = new wxTimer(this); timer = new wxTimer(this);
timer->Start(100); timer->Start(100);
@ -126,6 +132,7 @@ MainWindow::~MainWindow(){
delete model; delete model;
delete timer; delete timer;
delete glCanvas; delete glCanvas;
} }
void MainWindow::init(){ void MainWindow::init(){

View File

@ -289,6 +289,12 @@ MainWindow::MainWindow()
this->panel->SetSizer(boxsizer); this->panel->SetSizer(boxsizer);
this->Layout(); this->Layout();
#ifdef WIN32
wxInitAllImageHandlers();
wxIcon icon("IDI_ICON1");
SetIcon(icon);
#endif
//#ifndef WIN32 //#ifndef WIN32
timer = new wxTimer(this); timer = new wxTimer(this);
timer->Start(100); timer->Start(100);

View File

@ -50,6 +50,8 @@ void message(string message);
bool ask(string message); bool ask(string message);
void exceptionMessage(const exception &excp); void exceptionMessage(const exception &excp);
string getCommandLine(); string getCommandLine();
void init_win32();
void done_win32();
}}//end namespace }}//end namespace

View File

@ -65,9 +65,17 @@ Window::Window() {
lastMouseEvent = 0; lastMouseEvent = 0;
mousePos = Vec2i(0); mousePos = Vec2i(0);
mouseState.clear(); mouseState.clear();
#ifdef WIN32
init_win32();
#endif
} }
Window::~Window() { Window::~Window() {
#ifdef WIN32
done_win32();
#endif
assert(global_window == this); assert(global_window == this);
global_window = 0; global_window = 0;
} }

View File

@ -17,6 +17,7 @@
#include <cassert> #include <cassert>
#include <algorithm> #include <algorithm>
#include <string.h> #include <string.h>
#include "SDL_syswm.h"
#include "leak_dumper.h" #include "leak_dumper.h"
@ -179,4 +180,27 @@ void exceptionMessage(const exception &excp){
// return GetSystemMetrics(SM_CYSCREEN); // return GetSystemMetrics(SM_CYSCREEN);
//} //}
// This lets us set the SDL Window Icon in Windows
// since its a console application
HICON icon;
void init_win32() {
HINSTANCE handle = ::GetModuleHandle(NULL);
icon = ::LoadIcon(handle, "IDI_ICON1");
SDL_SysWMinfo wminfo;
SDL_VERSION(&wminfo.version)
if (SDL_GetWMInfo(&wminfo) != 1)
{
// error: wrong SDL version
}
HWND hwnd = wminfo.window;
::SetClassLong(hwnd, GCL_HICON, (LONG) icon);
}
void done_win32() {
::DestroyIcon(icon);
}
}}//end namespace }}//end namespace