(svn r586) -Fix: [1066114] Code error in win32.c Thanks Shai

-Fix: ttd.vcproj change to hard-set compilation as C, as well as adding WITH_SDL to debug mode. If you don't have SDL just remove that.
pull/155/head
darkvater 20 years ago
parent 989289fadd
commit 8946e92468

@ -46,7 +46,8 @@
BrowseInformation="1" BrowseInformation="1"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
DebugInformationFormat="3"/> DebugInformationFormat="3"
CompileAs="1"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
@ -119,7 +120,8 @@
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
DebugInformationFormat="3" DebugInformationFormat="3"
CallingConvention="1"/> CallingConvention="1"
CompileAs="1"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
@ -170,6 +172,7 @@
CharacterSet="2"> CharacterSet="2">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalOptions="/D &quot;WITH_SDL&quot;"
Optimization="0" Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_PNG" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_PNG"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@ -183,7 +186,8 @@
WarningLevel="3" WarningLevel="3"
WarnAsError="TRUE" WarnAsError="TRUE"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
DebugInformationFormat="4"/> DebugInformationFormat="4"
CompileAs="1"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool

@ -284,8 +284,7 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
return 0; return 0;
} }
case WM_KEYDOWN: case WM_KEYDOWN: {
{
// this is the rewritten ascii input function // this is the rewritten ascii input function
// it disables windows deadkey handling --> more linux like :D // it disables windows deadkey handling --> more linux like :D
unsigned short w = 0; unsigned short w = 0;
@ -294,17 +293,17 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
unsigned int scan = 0; unsigned int scan = 0;
GetKeyboardState(ks); GetKeyboardState(ks);
r = ToAscii(wParam, scan, ks, &w, 0); r = ToAscii(wParam, scan, ks, &w, 0);
if (r=0) w=0; if (r == 0) w = 0; // no translation was possible
_pressed_key = w | MapWindowsKey(wParam) << 16; _pressed_key = w | MapWindowsKey(wParam) << 16;
}
if ((_pressed_key>>16) == ('D' | WKC_CTRL) && !_wnd.fullscreen) { if ((_pressed_key>>16) == ('D' | WKC_CTRL) && !_wnd.fullscreen) {
_double_size ^= 1; _double_size ^= 1;
_wnd.double_size = _double_size; _wnd.double_size = _double_size;
ClientSizeChanged(_wnd.width, _wnd.height); ClientSizeChanged(_wnd.width, _wnd.height);
MarkWholeScreenDirty(); MarkWholeScreenDirty();
} }
break; } break;
case WM_SYSKEYDOWN: /* user presses F10 or Alt, both activating the title-menu */ case WM_SYSKEYDOWN: /* user presses F10 or Alt, both activating the title-menu */

Loading…
Cancel
Save