Skip to content

Commit

Permalink
Converted the project to Visual Studio 2013 and made it compilable.
Browse files Browse the repository at this point in the history
  • Loading branch information
eXpl0it3r committed May 24, 2014
1 parent eb2d10e commit 02a1051
Show file tree
Hide file tree
Showing 4 changed files with 210 additions and 19 deletions.
38 changes: 20 additions & 18 deletions Landscape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ extern "C"
#define INITGUID

#define DIRECTINPUT_VERSION 0x0700
//#define DIRECTSOUND_VERSION 0x0700
#define DIRECTDRAW_VERSION 0x0500

#include <windows.h>
Expand All @@ -313,10 +314,11 @@ extern "C"
#include <stdarg.h>
#include <math.h>

#include <fstream.h>
#include <fstream>
#include <fcntl.h>
#include <io.h>

using namespace std;

#include "ddutil.h"
#include "resource.h"
Expand Down Expand Up @@ -472,7 +474,7 @@ HINSTANCE g_hInst = NULL;
BOOL MouseInit = false;

// DirectSound
LPDIRECTSOUND lpds; //DirectSoundObjekt
LPDIRECTSOUND8 lpds; //DirectSoundObjekt
DSBUFFERDESC dsbdesc;
LPDIRECTSOUNDBUFFER lpdsb;
LPDIRECTSOUNDBUFFER lpdsbPrimary;
Expand Down Expand Up @@ -775,13 +777,12 @@ void InitDDraw()
if (ddrval != DD_OK)
goto error;;
// Get exclusive mode
ddrval = lpDD->SetCooperativeLevel( hwnd,DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN );
ddrval = lpDD->SetCooperativeLevel(hwnd, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN );
if(ddrval != DD_OK )
goto error;

// Set the video mode to 800x600x16

ddrval = lpDD->SetDisplayMode( MAXX, MAXY, 16, 0, 0);
ddrval = lpDD->SetDisplayMode( MAXX, MAXY, 32, 0, 0);
if(ddrval != DD_OK)
{
switch(ddrval)
Expand Down Expand Up @@ -931,7 +932,7 @@ void InitDInput()
DirectInputCreate(g_hInst, DIRECTINPUT_VERSION, &g_pDI, NULL); //DirectInput
g_pDI->CreateDevice(GUID_SysMouse, &g_pMouse, NULL); //Mousepointer
g_pMouse->SetDataFormat(&c_dfDIMouse); //MausDateninformation einstellen
g_pMouse->SetCooperativeLevel(hwnd,DISCL_EXCLUSIVE | DISCL_FOREGROUND); //Exklusive Maus
g_pMouse->SetCooperativeLevel(hwnd,DISCL_NONEXCLUSIVE | DISCL_FOREGROUND); //Exklusive Maus

g_pDI->CreateDevice(GUID_SysKeyboard, &g_pKey, NULL); //Keyboard einrichten
g_pKey->SetDataFormat(&c_dfDIKeyboard); //Datenformat auf KeyBoard umschalten
Expand All @@ -945,7 +946,7 @@ void InitDSound()

Soundzustand = 1; //Sound anschalten

hr = DirectSoundCreate(NULL, &lpds, NULL); //DirectSound-Objekt machen
hr = DirectSoundCreate8(NULL, &lpds, NULL); //DirectSound-Objekt machen
if (hr != DD_OK)
{
Soundzustand = -1;
Expand Down Expand Up @@ -1080,7 +1081,7 @@ void SaveGame()
short i;

ofstream ofs( "save.dat", ios::binary );
if (ofs == NULL) return;
if (!ofs) return;

ofs.write( (char*)Scape, sizeof(Scape) );
ofs.write( (char*)&Guy, sizeof(Guy) );
Expand Down Expand Up @@ -1111,8 +1112,8 @@ bool LoadGame()
{
short i;

ifstream ifs( "save.dat", ios::binary | ios::nocreate);
if (ifs == NULL) return(false);
ifstream ifs( "save.dat", ios::binary); // | ios::nocreate);
if (!ifs) return(false);

ifs.read( (char*)Scape, sizeof(Scape) );
ifs.read( (char*)&Guy, sizeof(Guy) );
Expand Down Expand Up @@ -3409,7 +3410,7 @@ void InitStructs()
Frage = -1;
LastBild = 100;
Bild = 0;
time(&Zeit);
Zeit = time(nullptr);
Spielbeenden = false;
MousePosition.x = MAXX /2;
MousePosition.y = MAXY /2;
Expand Down Expand Up @@ -10305,13 +10306,13 @@ short Refresh()

if (Spielzustand == SZNICHTS)
{
Spielzustand = SZLOGO;
Spielzustand = SZLOGO;
InitStructs(); //Nur zum Wavinitialisieren
}
while(1)
{
Bild++;
time(&Zeitsave);
Zeitsave = time(nullptr);
if (Zeit+5 < Zeitsave)
{
Zeit = Zeitsave;
Expand All @@ -10337,7 +10338,7 @@ short Refresh()

Animationen(); //Animationen weiterschalten
if (!Guy.Aktiv) Event(Guy.Aktion); //Aktionen starten
if (Guy.Pos.x != RouteStart.x) ZeigeIntro(); //Bild auffrischen (if-Abfrage nötig (seltsamerweise))
if (Guy.Pos.x == RouteStart.x) ZeigeIntro(); //Bild auffrischen (if-Abfrage nötig (seltsamerweise))

}
else if (Spielzustand == SZSPIEL)
Expand Down Expand Up @@ -10378,7 +10379,8 @@ long FAR PASCAL WindowProc( HWND hWnd, UINT message,
switch( message )
{
case WM_ACTIVATEAPP:
bActive = wParam;
bActive = wParam;
SetAcquire();
break;

case WM_ACTIVATE: // sent when window changes active state
Expand Down Expand Up @@ -10432,11 +10434,11 @@ static BOOL doInit( HINSTANCE hInstance, int nCmdShow )
WS_EX_TOPMOST,
NAME,
TITLE,
WS_POPUP,
WS_POPUP,
0,
0,
GetSystemMetrics( SM_CXSCREEN ),
GetSystemMetrics( SM_CYSCREEN ),
GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN),
NULL,
NULL,
hInstance,
Expand Down
3 changes: 2 additions & 1 deletion Landscape.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
//#include "afxres.h"
#include <winres.h>

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
Expand Down
20 changes: 20 additions & 0 deletions Landscape.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Landscape", "Landscape.vcxproj", "{B47831E3-7517-6403-F657-B2601A03C3F1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B47831E3-7517-6403-F657-B2601A03C3F1}.Debug|Win32.ActiveCfg = Debug|Win32
{B47831E3-7517-6403-F657-B2601A03C3F1}.Debug|Win32.Build.0 = Debug|Win32
{B47831E3-7517-6403-F657-B2601A03C3F1}.Release|Win32.ActiveCfg = Release|Win32
{B47831E3-7517-6403-F657-B2601A03C3F1}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
168 changes: 168 additions & 0 deletions Landscape.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<SccProjectName />
<SccLocalPath />
<ProjectGuid>{B47831E3-7517-6403-F657-B2601A03C3F1}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>.\Debug\</OutDir>
<IntDir>.\Debug\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>.\Release\</OutDir>
<IntDir>.\Release\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<FunctionLevelLinking>false</FunctionLevelLinking>
<Optimization>Disabled</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<MinimalRebuild>true</MinimalRebuild>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AssemblerListingLocation>.\Debug\</AssemblerListingLocation>
<BrowseInformation>true</BrowseInformation>
<PrecompiledHeaderOutputFile>.\Debug\Landscape.pch</PrecompiledHeaderOutputFile>
<ObjectFileName>.\Debug\</ObjectFileName>
<ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
</ClCompile>
<Midl>
<SuppressStartupBanner>true</SuppressStartupBanner>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TypeLibraryName>.\Debug\Landscape.tlb</TypeLibraryName>
<MkTypLibCompatible>true</MkTypLibCompatible>
<RedirectOutputAndErrors>NUL</RedirectOutputAndErrors>
<TargetEnvironment>Win32</TargetEnvironment>
</Midl>
<ResourceCompile>
<Culture>0x0407</Culture>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug\Landscape.bsc</OutputFile>
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OutputFile>.\Debug\Landscape.exe</OutputFile>
<AdditionalDependencies>dsound.lib;winmm.lib;dxguid.lib;ddraw.lib;dinput.lib;xinput.lib;dinput8.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86;C:\Users\Lukas\Downloads\S;</AdditionalLibraryDirectories>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<Optimization>MaxSpeed</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AssemblerListingLocation>.\Release\</AssemblerListingLocation>
<BrowseInformation>true</BrowseInformation>
<PrecompiledHeaderOutputFile>.\Release\Landscape.pch</PrecompiledHeaderOutputFile>
<ObjectFileName>.\Release\</ObjectFileName>
<ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
</ClCompile>
<Midl>
<SuppressStartupBanner>true</SuppressStartupBanner>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TypeLibraryName>.\Release\Landscape.tlb</TypeLibraryName>
<MkTypLibCompatible>true</MkTypLibCompatible>
<RedirectOutputAndErrors>NUL</RedirectOutputAndErrors>
<TargetEnvironment>Win32</TargetEnvironment>
</Midl>
<ResourceCompile>
<Culture>0x0407</Culture>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release\Landscape.bsc</OutputFile>
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<SubSystem>Windows</SubSystem>
<OutputFile>Release/Schiffbruch.exe</OutputFile>
<AdditionalDependencies>odbc32.lib;odbccp32.lib;dxguid.lib;ddraw.lib;dinput.lib;dsound.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<CustomBuild Include="Animation.BMP" />
<CustomBuild Include="Bau.BMP" />
<CustomBuild Include="Baum.bmp" />
<CustomBuild Include="Buttons.bmp" />
<CustomBuild Include="credits.bmp" />
<CustomBuild Include="Cursor.BMP" />
<CustomBuild Include="GuyAni.BMP" />
<CustomBuild Include="icon1.ico" />
<CustomBuild Include="Inventar.bmp" />
<CustomBuild Include="Landscape.ico" />
<CustomBuild Include="Logo.bmp" />
<CustomBuild Include="Misc.BMP" />
<CustomBuild Include="Panel.BMP" />
<CustomBuild Include="Papier.BMP" />
<CustomBuild Include="Schrift.BMP" />
<CustomBuild Include="Schrift1.BMP" />
<CustomBuild Include="Schrift2.bmp" />
<CustomBuild Include="Sonne.BMP" />
<CustomBuild Include="Textfeld.bmp" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="ddutil.cpp" />
<ClCompile Include="Landscape.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="ddutil.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Landscape.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

0 comments on commit 02a1051

Please sign in to comment.