Skip to content

Commit

Permalink
add custom launcher, remove asi loader
Browse files Browse the repository at this point in the history
  • Loading branch information
xoxor4d committed Dec 13, 2024
1 parent 2a450ea commit 62d4479
Show file tree
Hide file tree
Showing 17 changed files with 353 additions and 37 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 4 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ jobs:

- name: Move build files
run: |
move build/bin/${{matrix.configuration}}/_rtx.asi ./assets/bin/
move build/bin/${{matrix.configuration}}/p2-rtx.pdb ./assets/bin/
move build/bin/${{matrix.configuration}}/p2-rtx.dll ./assets/
move build/bin/${{matrix.configuration}}/p2-rtx.pdb ./assets/
move build/bin/${{matrix.configuration}}/p2-rtx-launcher.exe ./assets/
move build/bin/${{matrix.configuration}}/p2-rtx-launcher.pdb ./assets/
- name: Upload ${{matrix.configuration}}-binaries-p2-rtx
uses: actions/upload-artifact@v4
Expand Down
38 changes: 23 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Please keep that in mind.

<div align="center" markdown="1">

<img src="img/logo.png" alt="Description" width="80%">
<img src=".github/img/logo.png" alt="Description" width="80%">
</div>

<div align="center" markdown="1">
Expand All @@ -49,18 +49,19 @@ If you want to support my work, consider buying me some coffee:

<div align="center" markdown="1">

![img](img/01.png)
![img](img/04.png)
![img](.github/img/01.png)
![img](.github/img/04.png)
</div>

<br>

# Usage / Installation
- Download the latest [release](https://github.com/xoxor4d/p2-rtx/releases) and follow instructions found there.
- The `.zip` with the commit hash contains the compatibility mod and the `_remix_mod.zip` contains a base remix-mod required to get portals to work (and a few emissive textures etc.)
> - The `.zip` with the commit hash contains the files to make the game compatibile with RTX Remix
> - The `_remix_mod.zip` contains a base remix-mod required to get portals to work (and a few emissive textures etc.)
- To avoid rebuilding the sound cache on first startup, copy `_master.cache` from
`root/portal2/maps/soundcache` to `root/portal2_dlc3/maps/soundcache`
- Start the game by executing `_start_portal2_rtx.bat`
- Start the game by executing `p2-rtx-launcher.exe`
- The window title should change to `Portal 2 - RTX` followed by the GitHub commit number if successful

- [Set graphic options](#graphic-settings) ⚠️
Expand All @@ -75,7 +76,6 @@ If you want to support my work, consider buying me some coffee:
- See the [Wiki](https://github.com/xoxor4d/p2-rtx/wiki/Compatibility-Mod-Feature-Guide) for in-depth guides on features that come with the compatibility mod 🍓
- Current releases ship with a [custom build of the remix-dxvk runtime](https://github.com/xoxor4d/dxvk-remix/tree/combine/pairs_mask_rs) which includes necessary changes
for Portal 2 (`bin/.trex/d3d9.dll`)
- Releases also include [Ultimate-ASI-Loader](https://github.com/ThirteenAG/Ultimate-ASI-Loader/releases) (`bin/winmm.dll`)

<br>

Expand All @@ -85,16 +85,24 @@ for Portal 2 (`bin/.trex/d3d9.dll`)
<br>

#### ⚠️ Troubleshooting:
- Unable to load `_rtx.asi`:
Download and install [DirectX End-User Runtimes (June 2010)](https://www.microsoft.com/en-ie/download/details.aspx?id=8109)
- Launcher not working? - Try a different way of loading:
> - Download [Ultimate-ASI-Loader](https://github.com/ThirteenAG/Ultimate-ASI-Loader/releases) (32 bit), rename `dinput8.dll` to `winmm.dll` and place it into the bin folder (`Path-To-Portal2/bin/winmm.dll`)
> - Rename `p2-rtx.dll` to `p2-rtx.asi` and place it into the bin folder mentioned above
> - Right click Portal 2 on Steam and open settings - add the following start-up options:
> `-novid -disable_d3d9_hacks -limitvsconst -disallowhwmorph -softparticlesdefaultoff -no_compressed_verts +mat_phong 1`
> - Start the game from Steam
- Missing dependencies or similar error:
> - Download and install [DirectX End-User Runtimes (June 2010)](https://www.microsoft.com/en-ie/download/details.aspx?id=8109)
- Portals not showing up or looking incorrect:
Make sure that you installed the `_remix_mod.zip`. See [Issue #13](https://github.com/xoxor4d/p2-rtx/issues/13)
> - Make sure that you installed the `_remix_mod.zip`. See [Issue #13](https://github.com/xoxor4d/p2-rtx/issues/13)
- Game is too dark, sunlight is leaking on certain maps, textures look flat:
This is not an issue with the compatibility mod itself. It's up to the people modding the game using the remix toolset to place proper lights and overhaul textures and meshes.
> - This is not an issue with the compatibility mod itself. It's up to the people modding the game using the remix toolset to place proper lights and overhaul textures and meshes.
- Look at [Closed Issues](https://github.com/xoxor4d/p2-rtx/issues?q=is%3Aissue+is%3Aclosed) or [Discussions](https://github.com/xoxor4d/p2-rtx/discussions) to see if people had similar issues
- Other Issue?
> - Look at [Closed Issues](https://github.com/xoxor4d/p2-rtx/issues?q=is%3Aissue+is%3Aclosed) or [Discussions](https://github.com/xoxor4d/p2-rtx/discussions) to see if people had similar issues
<br>

Expand All @@ -111,9 +119,9 @@ This is not an issue with the compatibility mod itself. It's up to the people mo

<div align="center" markdown="1">

![img](img/02.png)
![img](img/03.png)
![img](img/05.png)
![img](.github/img/02.png)
![img](.github/img/03.png)
![img](.github/img/05.png)
</div>


Expand All @@ -125,5 +133,5 @@ This is not an issue with the compatibility mod itself. It's up to the people mo

<div align="center" markdown="1">

<img src="img/settings.png" alt="Description" width="70%">
<img src=".github/img/settings.png" alt="Description" width="70%">
</div>
1 change: 0 additions & 1 deletion assets/_start_portal2_rtx.bat

This file was deleted.

Binary file removed assets/bin/winmm.dll
Binary file not shown.
78 changes: 62 additions & 16 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ newaction {
versionHeader:write("\n")
versionHeader:write("// Version transformed for RC files\n")
versionHeader:write("#define VERSION_PRODUCT_RC " .. table.concat(vertonumarr(tagName, revNumber, 3), ",") .. "\n")
versionHeader:write("#define VERSION_PRODUCT " .. cstrquote(table.concat(vertonumarr(tagName, revNumber, 3), ".")) .. "\n")
versionHeader:write("#define VERSION_FILE_RC " .. table.concat(vertonumarr(tagName, revNumber, 4), ",") .. "\n")
versionHeader:write("#define VERSION_FILE " .. cstrquote(table.concat(vertonumarr(tagName, revNumber, 4), ".")) .. "\n")
versionHeader:write("#define VERSION_PRODUCT " .. gitDescribeOutputQuoted .. "\n")
versionHeader:write("#define VERSION_FILE_RC " .. table.concat(vertonumarr(tagName, revNumber, 3), ",") .. "\n")
versionHeader:write("#define VERSION_FILE " .. gitDescribeOutputQuoted .. "\n")
versionHeader:write("\n")
versionHeader:write("// Alias definitions\n")
versionHeader:write("#define VERSION GIT_DESCRIBE\n")
Expand Down Expand Up @@ -214,7 +214,7 @@ dependencies.load()

workspace "p2-rtx"

startproject "p2-rtx"
startproject "p2-rtx-launcher"
location "./build"
objdir "%{wks.location}/obj"
targetdir "%{wks.location}/bin/%{cfg.buildcfg}"
Expand Down Expand Up @@ -331,6 +331,8 @@ workspace "p2-rtx"
"./src/**.cpp",
}

removefiles { "./src/launcher/**" }

includedirs {
"%{prj.location}/src",
"./src",
Expand All @@ -344,23 +346,23 @@ workspace "p2-rtx"
"/Zm100 -Zm100"
}

debugargs { "-novid -disable_d3d9_hacks -limitvsconst -disallowhwmorph -softparticlesdefaultoff -no_compressed_verts +mat_phong 1" }
-- debugargs { "-novid -disable_d3d9_hacks -limitvsconst -disallowhwmorph -softparticlesdefaultoff -no_compressed_verts +mat_phong 1" }

filter "configurations:Debug or configurations:Release"
if(os.getenv("PORTAL2_ROOT")) then
print ("Setup paths using environment variable 'PORTAL2_ROOT' :: '" .. os.getenv("PORTAL2_ROOT") .. "'")
targetdir(os.getenv("PORTAL2_ROOT") .. "/" .. "bin")
targetdir(os.getenv("PORTAL2_ROOT"))
debugdir (os.getenv("PORTAL2_ROOT"))
debugcommand (os.getenv("PORTAL2_ROOT") .. "/" .. "portal2.exe")
debugcommand (os.getenv("PORTAL2_ROOT") .. "/" .. "p2-rtx-launcher.exe")
end
filter {}

filter "configurations:Dev"
if(os.getenv("PORTAL2_SEC_ROOT")) then
print ("Setup paths using environment variable 'PORTAL2_SEC_ROOT' :: '" .. os.getenv("PORTAL2_SEC_ROOT") .. "'")
targetdir(os.getenv("PORTAL2_SEC_ROOT") .. "/" .. "bin")
targetdir(os.getenv("PORTAL2_SEC_ROOT"))
debugdir (os.getenv("PORTAL2_SEC_ROOT"))
debugcommand (os.getenv("PORTAL2_SEC_ROOT") .. "/" .. "portal2.exe")
debugcommand (os.getenv("PORTAL2_SEC_ROOT") .. "/" .. "p2-rtx-launcher.exe")
end
filter {}

Expand All @@ -378,16 +380,60 @@ workspace "p2-rtx"
"popd",
}

-- Post-build
postbuildcommands {
"echo ----------------------------",
"echo Rename \"p2-rtx.dll\" to \"_rtx.asi\"",
"MOVE /Y \"$(TargetDir)p2-rtx.dll\" \"$(TargetDir)_rtx.asi\"",
}

dependencies.imports()

group "Dependencies"
dependencies.projects()
group ""


project "p2-rtx-launcher"
kind "ConsoleApp"
language "C++"

dependson { "p2-rtx" }

files { "src/launcher/**"}
flags { "NoPCH" }

linkoptions {
"/PDBCompress"
}

resincludedirs {
"$(ProjectDir)src/launcher/res"
}

includedirs {
"%{prj.location}/src"
}

filter "configurations:Debug or configurations:Release"
if(os.getenv("PORTAL2_ROOT")) then
print ("Setup paths using environment variable 'PORTAL2_ROOT' :: '" .. os.getenv("PORTAL2_ROOT") .. "'")
targetdir(os.getenv("PORTAL2_ROOT"))
debugdir (os.getenv("PORTAL2_ROOT"))
debugcommand (os.getenv("PORTAL2_ROOT") .. "/" .. "p2-rtx-launcher.exe")
end
filter {}

filter "configurations:Dev"
if(os.getenv("PORTAL2_SEC_ROOT")) then
print ("Setup paths using environment variable 'PORTAL2_SEC_ROOT' :: '" .. os.getenv("PORTAL2_SEC_ROOT") .. "'")
targetdir(os.getenv("PORTAL2_SEC_ROOT"))
debugdir (os.getenv("PORTAL2_SEC_ROOT"))
debugcommand (os.getenv("PORTAL2_SEC_ROOT") .. "/" .. "p2-rtx-launcher.exe")
end
filter {}

-- Pre-build
prebuildcommands {
"pushd %{_MAIN_SCRIPT_DIR}",
"tools\\premake5 generate-buildinfo",
"popd",
}

-- Post-build
postbuildcommands {
"MOVE /Y \"$(TargetDir)p2-rtx-launcher.exe\" \"$(TargetDir)p2-rtx-launcher.exe\"",
}
3 changes: 0 additions & 3 deletions src/Resource.rc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

#define STRINGIZE_(x) #x
#define STRINGIZE(x) STRINGIZE_(x)

#define VERSION_RC STRINGIZE(BF2RTX_BUILDNUMBER)

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
Expand Down
2 changes: 2 additions & 0 deletions src/components/modules/main_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2189,12 +2189,14 @@ namespace components

main_module::~main_module()
{
#if 0
// release textures
components::model_render::init_texture_addons(true);

// release d3d font
if (d3d_font) {
d3d_font->Release();
}
#endif
}
}
Loading

0 comments on commit 62d4479

Please sign in to comment.