Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ include(generated/rexglue.cmake)
# Sources
set(CONDEMNED2RECOMP_SOURCES
src/main.cpp
src/condemned2recomp_iso_installer.cpp
src/ui/acquire_wizard_dialog.cpp
src/ui/wizard_screen.cpp
)

if(WIN32)
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
This is a static recompilation of **Condemned 2: Bloodshot (Xbox 360)** for Native PC built through RexGlue-SDK.

## Installation
* Using [extract-xiso](https://github.com/XboxDev/extract-xiso) or [xdvdfs](https://github.com/antangelo/xdvdfs), extract all game files from your legally owned copy of **Condemned 2: Bloodshot**.
* Run *"condemned2recomp.exe"*. On first launch it asks for the disc image (*.iso*) dumped from your legally owned copy of **Condemned 2: Bloodshot** and extracts the game files into the *"Assets"* folder for you (~7 GiB of free space needed).
* **(Optional)** Configure your graphic settings by modifying *"condemned2recomp.toml"*.

<details>
<summary>Manual installation (alternative)</summary>

* Using [extract-xiso](https://github.com/XboxDev/extract-xiso) or [xdvdfs](https://github.com/antangelo/xdvdfs), extract all game files from your legally owned copy of **Condemned 2: Bloodshot**.
* In the same folder as *"condemned2recomp.exe"*, create a new folder named *"Assets"*.
* Place extracted game files into the *"Assets"* folder.
* **(Optional)** Configure your graphic settings by modifying *"condemned2recomp.toml"*.
* Run *"condemned2recomp.exe"* to start **Condemned 2: Bloodshot**.
* For an unattended/headless install, set the environment variable `CONDEMNED2_INSTALL_ISO` to the path of your disc image before launching.
</details>

## Controls

Expand Down
58 changes: 54 additions & 4 deletions src/condemned2recomp_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@

#pragma once

#include <cstdlib>
#include <functional>
#include <optional>

#include <rex/logging.h>
#include <rex/rex_app.h>

#include "condemned2recomp_iso_installer.h"
#include "ui/wizard_screen.h"

class Condemned2recompApp : public rex::ReXApp {
public:
using rex::ReXApp::ReXApp;
Expand All @@ -20,13 +28,55 @@ class Condemned2recompApp : public rex::ReXApp {
config.gpu_plugin = "xenos";
}

void OnConfigureFonts(ImFontAtlas* atlas) override {
// Scalable fonts for the first-run installer wizard; the SDK default is
// a 10 px bitmap font that upscales poorly to heading sizes.
rex::ui::ConfigureWizardFonts(atlas);
}

void OnConfigurePaths(rex::PathConfig& paths) override {
if (paths.game_data_root.empty()) { // Use default assets directory path if one isn't provided!
const auto assets_dir = paths.config_path.parent_path() / "Assets";
if (std::filesystem::is_regular_file(assets_dir / "default.xex")) {
paths.game_data_root = assets_dir;
}
// Defaulted even when the game files are not there yet, so the
// first-run installer knows where to extract them.
paths.game_data_root = paths.config_path.parent_path() / "Assets";
}
}

// Gate the runtime launch behind the game data: if Assets/default.xex is
// missing, open the disc image installer wizard — the user picks their own
// Condemned 2 .iso and its XDVDFS game partition is extracted into
// game_data_root, so a fresh install is one user action instead of a manual
// extract-xiso run. Mirrors the first-run installer pattern of other
// ReXGlue recomps (LittleBitUA/DownpourRecomp, mchughalex/skate3recomp).
// Honors a CONDEMNED2_INSTALL_ISO env override (path to the .iso) for
// headless installs.
std::optional<rex::PathConfig> OnFinalizePaths(
const rex::PathConfig& defaults,
std::function<void(rex::PathConfig)> resume) override {
rex::PathConfig runtime_paths = defaults;
const auto& game_root = runtime_paths.game_data_root;

if (!condemned2::IsGameDataInstalled(game_root)) {
if (const char* iso = std::getenv("CONDEMNED2_INSTALL_ISO");
iso != nullptr && *iso != '\0') {
std::string error;
REXLOG_INFO("Installing game data from CONDEMNED2_INSTALL_ISO={}", iso);
if (!condemned2::InstallGameDataFromIso(iso, game_root, nullptr, nullptr,
error)) {
REXLOG_ERROR("Automated game data installation failed: {}", error);
}
}
}
if (condemned2::IsGameDataInstalled(game_root)) {
return runtime_paths;
}
REXLOG_INFO(
"Condemned 2: Bloodshot game data not found at {}; launching the "
"disc image installer.",
game_root.string());
condemned2::ShowIsoInstallWizard(imgui_drawer(), std::move(runtime_paths),
std::move(resume));
return std::nullopt;
}

// Override virtual hooks for customization:
Expand Down
Loading