Skip to content

Commit

Permalink
Half Life 2: Upgrade to 2024 edition
Browse files Browse the repository at this point in the history
Improved HDR and other things.
  • Loading branch information
magcius committed Nov 23, 2024
1 parent 961bd52 commit 6d91be2
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 30 deletions.
4 changes: 0 additions & 4 deletions src/SourceEngine/Scenes_FileDrops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export async function createKitchenSinkSourceFilesytem(dataFetcher: DataFetcher)
const filesystem = new SourceFileSystem(dataFetcher);
// Mount all the things!
await Promise.all([
// filesystem.createVPKMount(`CounterStrikeGO/pak01`),
filesystem.createVPKMount(`CounterStrikeSource/cstrike_pak`),
filesystem.createVPKMount(`TeamFortress2/tf/tf2_textures`),
filesystem.createVPKMount(`TeamFortress2/tf/tf2_misc`),
Expand All @@ -19,9 +18,6 @@ export async function createKitchenSinkSourceFilesytem(dataFetcher: DataFetcher)
filesystem.createVPKMount(`Portal2/portal2_dlc2/pak01`),
filesystem.createVPKMount(`Portal/portal_pak`),
filesystem.createVPKMount(`GarrysMod/garrysmod`),
// filesystem.createGMAMount(`GarrysMod/YukiTheater/base-content.gma`),
// filesystem.createGMAMount(`GarrysMod/YukiTheater/social-content.gma`),
// filesystem.createGMAMount(`GarrysMod/YukiTheater/content.gma`),
filesystem.createVPKMount(`HalfLife2Ep1/ep1_pak`),
filesystem.createVPKMount(`HalfLife2Ep2/ep2_pak`),
filesystem.createVPKMount(`HalfLife2DM/hl2mp_pak`),
Expand Down
14 changes: 7 additions & 7 deletions src/SourceEngine/Scenes_HalfLife2.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@

import { GfxDevice } from "../gfx/platform/GfxPlatform.js";
import { SceneContext, SceneDesc, SceneGroup } from "../SceneBase.js";
import { SourceFileSystem, SourceLoadContext } from "./Main.js";
import { createScene } from "./Scenes.js";

const pathRoot = `HalfLife2_2024`;
const pathHL2 = `${pathRoot}/hl2`;

class HalfLife2SceneDesc implements SceneDesc {
constructor(public id: string, public name: string = id) {
}

public async createScene(device: GfxDevice, context: SceneContext) {
const filesystem = await context.dataShare.ensureObject(`${pathBase}/SourceFileSystem`, async () => {
const filesystem = await context.dataShare.ensureObject(`${pathHL2}/SourceFileSystem`, async () => {
const filesystem = new SourceFileSystem(context.dataFetcher);
await Promise.all([
filesystem.createVPKMount(`${pathBase}/hl2_textures`),
filesystem.createVPKMount(`${pathBase}/hl2_misc`),
filesystem.createVPKMount(`${pathHL2}/hl2_textures`),
filesystem.createVPKMount(`${pathHL2}/hl2_misc`),
]);
return filesystem;
});

const loadContext = new SourceLoadContext(filesystem);
return createScene(context, loadContext, this.id, `${pathBase}/maps/${this.id}.bsp`);
return createScene(context, loadContext, this.id, `${pathHL2}/maps/${this.id}.bsp`);
}
}

const pathBase = `HalfLife2`;

const id = 'HalfLife2';
const name = 'Half-Life 2';
// https://developer.valvesoftware.com/wiki/Half-Life_2_map_reference
Expand Down
14 changes: 8 additions & 6 deletions src/SourceEngine/Scenes_HalfLife2Ep1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@ import { SceneContext, SceneDesc, SceneGroup } from "../SceneBase.js";
import { SourceFileSystem, SourceLoadContext } from "./Main.js";
import { createScene } from "./Scenes.js";

const pathBase = `HalfLife2Ep1`;
const pathRoot = `HalfLife2_2024`;
const pathHL2 = `${pathRoot}/hl2`;
const pathEp1 = `${pathRoot}/episodic`;

class HalfLife2Ep1SceneDesc implements SceneDesc {
constructor(public id: string, public name: string = id) {
}

public async createScene(device: GfxDevice, context: SceneContext) {
const filesystem = await context.dataShare.ensureObject(`${pathBase}/SourceFileSystem`, async () => {
const filesystem = await context.dataShare.ensureObject(`${pathEp1}/SourceFileSystem`, async () => {
const filesystem = new SourceFileSystem(context.dataFetcher);
await Promise.all([
filesystem.createVPKMount(`${pathBase}/ep1_pak`),
filesystem.createVPKMount(`HalfLife2/hl2_textures`),
filesystem.createVPKMount(`HalfLife2/hl2_misc`),
filesystem.createVPKMount(`${pathEp1}/ep1_pak`),
filesystem.createVPKMount(`${pathHL2}/hl2_textures`),
filesystem.createVPKMount(`${pathHL2}/hl2_misc`),
]);
return filesystem;
});

const loadContext = new SourceLoadContext(filesystem);
return createScene(context, loadContext, this.id, `${pathBase}/maps/${this.id}.bsp`);
return createScene(context, loadContext, this.id, `${pathEp1}/maps/${this.id}.bsp`);
}
}

Expand Down
17 changes: 10 additions & 7 deletions src/SourceEngine/Scenes_HalfLife2Ep2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,29 @@ import { SceneContext, SceneDesc, SceneGroup } from "../SceneBase.js";
import { SourceFileSystem, SourceLoadContext } from "./Main.js";
import { createScene } from "./Scenes.js";

const pathBase = `HalfLife2Ep2`;
const pathRoot = `HalfLife2_2024`;
const pathHL2 = `${pathRoot}/hl2`;
const pathEp1 = `${pathRoot}/episodic`;
const pathEp2 = `${pathRoot}/ep2`;

class HalfLife2Ep2SceneDesc implements SceneDesc {
constructor(public id: string, public name: string = id) {
}

public async createScene(device: GfxDevice, context: SceneContext) {
const filesystem = await context.dataShare.ensureObject(`${pathBase}/SourceFileSystem`, async () => {
const filesystem = await context.dataShare.ensureObject(`${pathEp2}/SourceFileSystem`, async () => {
const filesystem = new SourceFileSystem(context.dataFetcher);
await Promise.all([
filesystem.createVPKMount(`HalfLife2Ep2/ep2_pak`),
filesystem.createVPKMount(`HalfLife2Ep1/ep1_pak`),
filesystem.createVPKMount(`HalfLife2/hl2_textures`),
filesystem.createVPKMount(`HalfLife2/hl2_misc`),
filesystem.createVPKMount(`${pathEp2}/ep2_pak`),
filesystem.createVPKMount(`${pathEp1}/ep1_pak`),
filesystem.createVPKMount(`${pathHL2}/hl2_textures`),
filesystem.createVPKMount(`${pathHL2}/hl2_misc`),
]);
return filesystem;
});

const loadContext = new SourceLoadContext(filesystem);
return createScene(context, loadContext, this.id, `${pathBase}/maps/${this.id}.bsp`);
return createScene(context, loadContext, this.id, `${pathEp2}/maps/${this.id}.bsp`);
}
}

Expand Down
14 changes: 8 additions & 6 deletions src/SourceEngine/Scenes_HalfLife2LostCoast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@ import { SceneContext, SceneDesc, SceneGroup } from "../SceneBase.js";
import { SourceFileSystem, SourceLoadContext } from "./Main.js";
import { createScene } from "./Scenes.js";

const pathBase = `HalfLife2LostCoast`;
const pathRoot = `HalfLife2_2024`;
const pathHL2 = `${pathRoot}/hl2`;
const pathLostCoast = `${pathRoot}/lostcoast`;

class HalfLife2LostCoastSceneDesc implements SceneDesc {
constructor(public id: string, public name: string = id) {
}

public async createScene(device: GfxDevice, context: SceneContext) {
const filesystem = await context.dataShare.ensureObject(`${pathBase}/SourceFileSystem`, async () => {
const filesystem = await context.dataShare.ensureObject(`${pathLostCoast}/SourceFileSystem`, async () => {
const filesystem = new SourceFileSystem(context.dataFetcher);
await Promise.all([
filesystem.createVPKMount(`${pathBase}/lostcoast_pak`),
filesystem.createVPKMount(`HalfLife2/hl2_textures`),
filesystem.createVPKMount(`HalfLife2/hl2_misc`),
filesystem.createVPKMount(`${pathLostCoast}/lostcoast_pak`),
filesystem.createVPKMount(`${pathHL2}/hl2_textures`),
filesystem.createVPKMount(`${pathHL2}/hl2_misc`),
]);
return filesystem;
});

const loadContext = new SourceLoadContext(filesystem);
return createScene(context, loadContext, this.id, `${pathBase}/maps/${this.id}.bsp`);
return createScene(context, loadContext, this.id, `${pathLostCoast}/maps/${this.id}.bsp`);
}
}

Expand Down

0 comments on commit 6d91be2

Please sign in to comment.