1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-05 12:47:53 +02:00

#368 LEVEL3A Gears item

This commit is contained in:
XProger
2022-05-22 16:11:49 +03:00
parent d91a919f56
commit 1baba680d2
8 changed files with 46 additions and 25 deletions

View File

@@ -1491,9 +1491,9 @@ ItemObj* ItemObj::init(Room* room)
// INIT_ITEM( INV_PASSPORT , ??? ); // INIT_ITEM( INV_PASSPORT , ??? );
// INIT_ITEM( INV_COMPASS , ??? ); // INIT_ITEM( INV_COMPASS , ??? );
// INIT_ITEM( INV_HOME , ??? ); // INIT_ITEM( INV_HOME , ??? );
// INIT_ITEM( GEARS_1 , ??? ); INIT_ITEM( GEARS_1 , Gears );
// INIT_ITEM( GEARS_2 , ??? ); INIT_ITEM( GEARS_2 , Gears );
// INIT_ITEM( GEARS_3 , ??? ); INIT_ITEM( GEARS_3 , Gears );
INIT_ITEM( CUT_1 , CinematicObject ); INIT_ITEM( CUT_1 , CinematicObject );
INIT_ITEM( CUT_2 , CinematicObject ); INIT_ITEM( CUT_2 , CinematicObject );
INIT_ITEM( CUT_3 , CinematicObject ); INIT_ITEM( CUT_3 , CinematicObject );

View File

@@ -335,6 +335,23 @@ struct TrapDoor : Object
}; };
struct Gears : Object
{
enum {
STATE_STATIC,
STATE_ROTATE,
};
Gears(Room* room) : Object(room) {}
virtual void update()
{
goalState = isActive() ? STATE_ROTATE : STATE_STATIC;
animProcess();
}
};
struct CinematicObject : Object struct CinematicObject : Object
{ {
CinematicObject(Room* room) : Object(room) CinematicObject(Room* room) : Object(room)

View File

@@ -22,7 +22,6 @@
<ClCompile Include="..\..\fixed\common.cpp" /> <ClCompile Include="..\..\fixed\common.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />
<ClCompile Include="render.iwram.cpp" /> <ClCompile Include="render.iwram.cpp" />
<ClCompile Include="render_span.cpp" />
<ClCompile Include="sound.cpp" /> <ClCompile Include="sound.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -120,6 +119,7 @@
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>__GBA_WIN__;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>__GBA_WIN__;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<DisableSpecificWarnings>26495</DisableSpecificWarnings>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
@@ -136,6 +136,7 @@
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>__GBA_WIN__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>__GBA_WIN__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<DisableSpecificWarnings>26495</DisableSpecificWarnings>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
@@ -154,6 +155,7 @@
<PreprocessorDefinitions>__GBA_WIN__;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>__GBA_WIN__;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DisableSpecificWarnings>26495</DisableSpecificWarnings>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
@@ -175,6 +177,7 @@
<PreprocessorDefinitions>__GBA_WIN__;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>__GBA_WIN__;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DisableSpecificWarnings>26495</DisableSpecificWarnings>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>

View File

@@ -291,6 +291,9 @@ int main(void)
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); DispatchMessage(&msg);
} else { } else {
#ifdef _DEBUG
Sleep(4);
#endif
int32 frame = (GetTickCount() - startTime) / 33; int32 frame = (GetTickCount() - startTime) / 33;
if (GetAsyncKeyState('R')) frame /= 10; if (GetAsyncKeyState('R')) frame /= 10;

View File

@@ -1010,7 +1010,7 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
int sw = GetSystemMetrics(SM_CXSCREEN); int sw = GetSystemMetrics(SM_CXSCREEN);
int sh = GetSystemMetrics(SM_CYSCREEN); int sh = GetSystemMetrics(SM_CYSCREEN);
if (sw <= r.right || sh <= r.bottom) { if (sw <= r.right + 128 || sh <= r.bottom + 128) {
r.right /= 2; r.right /= 2;
r.bottom /= 2; r.bottom /= 2;
} }

View File

@@ -20,15 +20,15 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>NotSet</CharacterSet> <CharacterSet>NotSet</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet> <CharacterSet>NotSet</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
@@ -52,10 +52,7 @@
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\bin\</OutDir> <OutDir>..\..\..\bin\</OutDir>
<GenerateManifest>false</GenerateManifest> <GenerateManifest>false</GenerateManifest>
<LibraryPath>..\..\libs\openvr\;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);</LibraryPath> <IncludePath>..\..\fixed;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<IncludePath>..\..\libs\;..\..\;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<ExcludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(VC_ExecutablePath_x86);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(FxCopDir);$(MSBuild_ExecutablePath);$(VC_LibraryPath_x86);$(SystemRoot)</ExcludePath>
<ExecutablePath>$(VC_ExecutablePath_x86);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
@@ -68,11 +65,11 @@
<AdditionalOptions> <AdditionalOptions>
</AdditionalOptions> </AdditionalOptions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DisableSpecificWarnings>26495</DisableSpecificWarnings>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>glu32.lib;wsock32.lib;d3d9.lib;d3d11.lib;opengl32.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>glu32.lib;opengl32.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -83,7 +80,7 @@
<Optimization>Full</Optimization> <Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>MINIMAL;NOMINMAX;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>__WIN32__;MINIMAL;NOMINMAX;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling> <ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck> <BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -92,17 +89,16 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed> <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<AdditionalOptions>/d2noftol3 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/d2noftol3 %(AdditionalOptions)</AdditionalOptions>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<DisableSpecificWarnings>26495</DisableSpecificWarnings>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>wcrt.lib;wsock32.lib;d3d9.lib;d3d11.lib;opengl32.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<RandomizedBaseAddress>false</RandomizedBaseAddress> <RandomizedBaseAddress>false</RandomizedBaseAddress>
<AssemblyDebug>true</AssemblyDebug> <AssemblyDebug>true</AssemblyDebug>
<AdditionalDependencies>glu32.lib;opengl32.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>

View File

@@ -3,8 +3,10 @@
<ItemGroup> <ItemGroup>
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />
<ClCompile Include="..\..\fixed\common.cpp" /> <ClCompile Include="..\..\fixed\common.cpp" />
<ClCompile Include="..\..\fixed\render\gl1.cpp" />
<ClCompile Include="sound.cpp" /> <ClCompile Include="sound.cpp" />
<ClCompile Include="..\..\fixed\render\gl1.cpp">
<Filter>render</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="OpenLara.rc" /> <ResourceCompile Include="OpenLara.rc" />
@@ -42,5 +44,8 @@
<Filter Include="fmt"> <Filter Include="fmt">
<UniqueIdentifier>{f297223e-368f-46b9-9f41-3e8075cbc5c2}</UniqueIdentifier> <UniqueIdentifier>{f297223e-368f-46b9-9f41-3e8075cbc5c2}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="render">
<UniqueIdentifier>{fe1fca63-da0d-4e31-b8c4-1d61eb02d01b}</UniqueIdentifier>
</Filter>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -225,13 +225,10 @@ void* osLoadLevel(const char* name)
return (void*)levelData; return (void*)levelData;
} }
#ifdef _DEBUG int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
int main(void) { {
#else // int argc = (lpCmdLine && strlen(lpCmdLine)) ? 2 : 1;
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // const char* argv[] = { "", lpCmdLine };
int argc = (lpCmdLine && strlen(lpCmdLine)) ? 2 : 1;
const char* argv[] = { "", lpCmdLine };
#endif
RECT r = { 0, 0, FRAME_WIDTH, FRAME_HEIGHT }; RECT r = { 0, 0, FRAME_WIDTH, FRAME_HEIGHT };