Skip to content

Commit

Permalink
#368 LEVEL3A Gears item
Browse files Browse the repository at this point in the history
  • Loading branch information
XProger committed May 22, 2022
1 parent d91a919 commit 1baba68
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 25 deletions.
6 changes: 3 additions & 3 deletions src/fixed/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -1491,9 +1491,9 @@ ItemObj* ItemObj::init(Room* room)
// INIT_ITEM( INV_PASSPORT , ??? );
// INIT_ITEM( INV_COMPASS , ??? );
// INIT_ITEM( INV_HOME , ??? );
// INIT_ITEM( GEARS_1 , ??? );
// INIT_ITEM( GEARS_2 , ??? );
// INIT_ITEM( GEARS_3 , ??? );
INIT_ITEM( GEARS_1 , Gears );
INIT_ITEM( GEARS_2 , Gears );
INIT_ITEM( GEARS_3 , Gears );
INIT_ITEM( CUT_1 , CinematicObject );
INIT_ITEM( CUT_2 , CinematicObject );
INIT_ITEM( CUT_3 , CinematicObject );
Expand Down
17 changes: 17 additions & 0 deletions src/fixed/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
CinematicObject(Room* room) : Object(room)
Expand Down
5 changes: 4 additions & 1 deletion src/platform/gba/OpenLara.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<ClCompile Include="..\..\fixed\common.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="render.iwram.cpp" />
<ClCompile Include="render_span.cpp" />
<ClCompile Include="sound.cpp" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -120,6 +119,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>__GBA_WIN__;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<DisableSpecificWarnings>26495</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -136,6 +136,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>__GBA_WIN__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<DisableSpecificWarnings>26495</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -154,6 +155,7 @@
<PreprocessorDefinitions>__GBA_WIN__;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DisableSpecificWarnings>26495</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -175,6 +177,7 @@
<PreprocessorDefinitions>__GBA_WIN__;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DisableSpecificWarnings>26495</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down
3 changes: 3 additions & 0 deletions src/platform/gba/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ int main(void)
TranslateMessage(&msg);
DispatchMessage(&msg);
} else {
#ifdef _DEBUG
Sleep(4);
#endif
int32 frame = (GetTickCount() - startTime) / 33;
if (GetAsyncKeyState('R')) frame /= 10;

Expand Down
2 changes: 1 addition & 1 deletion src/platform/win/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi

int sw = GetSystemMetrics(SM_CXSCREEN);
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.bottom /= 2;
}
Expand Down
20 changes: 8 additions & 12 deletions src/platform/win_fixed/OpenLara.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand All @@ -52,10 +52,7 @@
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\bin\</OutDir>
<GenerateManifest>false</GenerateManifest>
<LibraryPath>..\..\libs\openvr\;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);</LibraryPath>
<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>
<IncludePath>..\..\fixed;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand All @@ -68,11 +65,11 @@
<AdditionalOptions>
</AdditionalOptions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DisableSpecificWarnings>26495</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<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>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -83,7 +80,7 @@
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<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>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
Expand All @@ -92,17 +89,16 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<AdditionalOptions>/d2noftol3 %(AdditionalOptions)</AdditionalOptions>
<WholeProgramOptimization>true</WholeProgramOptimization>
<DisableSpecificWarnings>26495</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<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>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<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>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
7 changes: 6 additions & 1 deletion src/platform/win_fixed/OpenLara.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
<ItemGroup>
<ClCompile Include="main.cpp" />
<ClCompile Include="..\..\fixed\common.cpp" />
<ClCompile Include="..\..\fixed\render\gl1.cpp" />
<ClCompile Include="sound.cpp" />
<ClCompile Include="..\..\fixed\render\gl1.cpp">
<Filter>render</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="OpenLara.rc" />
Expand Down Expand Up @@ -42,5 +44,8 @@
<Filter Include="fmt">
<UniqueIdentifier>{f297223e-368f-46b9-9f41-3e8075cbc5c2}</UniqueIdentifier>
</Filter>
<Filter Include="render">
<UniqueIdentifier>{fe1fca63-da0d-4e31-b8c4-1d61eb02d01b}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
11 changes: 4 additions & 7 deletions src/platform/win_fixed/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,10 @@ void* osLoadLevel(const char* name)
return (void*)levelData;
}

#ifdef _DEBUG
int main(void) {
#else
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
int argc = (lpCmdLine && strlen(lpCmdLine)) ? 2 : 1;
const char* argv[] = { "", lpCmdLine };
#endif
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
// int argc = (lpCmdLine && strlen(lpCmdLine)) ? 2 : 1;
// const char* argv[] = { "", lpCmdLine };

RECT r = { 0, 0, FRAME_WIDTH, FRAME_HEIGHT };

Expand Down

0 comments on commit 1baba68

Please sign in to comment.