Skip to content

Commit

Permalink
Clean up some old Gfx code
Browse files Browse the repository at this point in the history
I'm probably not goinng to get around to GfxBindingsDescriptor2 when I suspect GfxPlatform is going to die in favor of natural WebGPU when ready.
  • Loading branch information
magcius committed Nov 17, 2024
1 parent 8b26073 commit af2a548
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 33 deletions.
14 changes: 7 additions & 7 deletions src/ZeldaTwilightPrincess/d_kankyo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class dScnKy_env_light_c {
// Time
public curTime: number = 0.0;
public nextTime: number = 0.0;
public timeSpeed: number = 0.012;
public timeAdv: number = 0.012;
public darkTime: number = 0.0;
public calendarDay: number = 0.0;

Expand Down Expand Up @@ -1701,7 +1701,7 @@ function setDaytime(globals: dGlobals, envLight: dScnKy_env_light_c, deltaTimeFr
}

if (dKy_darkworld_check(globals)) {
envLight.darkTime += envLight.timeSpeed * deltaTimeFrames;
envLight.darkTime += envLight.timeAdv * deltaTimeFrames;
if (envLight.darkTime >= 360.0) {
envLight.darkTime = 0.0;
}
Expand All @@ -1713,14 +1713,14 @@ function setDaytime(globals: dGlobals, envLight: dScnKy_env_light_c, deltaTimeFr
if (globals.stageName === "F_SP127" || globals.stageName === "R_SP127") {
if (envLight.curTime >= 300 || envLight.curTime <= 60) {
// increase the time multiple times on these stages
envLight.curTime += envLight.timeSpeed * deltaTimeFrames;
envLight.curTime += envLight.timeSpeed * deltaTimeFrames;
envLight.curTime += envLight.timeAdv * deltaTimeFrames;
envLight.curTime += envLight.timeAdv * deltaTimeFrames;
} else if (envLight.curTime >= 150 && envLight.curTime <= 195) {
envLight.curTime += envLight.timeSpeed * deltaTimeFrames;
envLight.curTime += envLight.timeAdv * deltaTimeFrames;
}
}

envLight.curTime += envLight.timeSpeed * deltaTimeFrames;
envLight.curTime += envLight.timeAdv * deltaTimeFrames;
if (envLight.curTime >= 360.0) {
envLight.curTime = 0.0;
envLight.calendarDay += 1;
Expand Down Expand Up @@ -2113,7 +2113,7 @@ function envcolor_init(globals: dGlobals): void {
envLight.calendarDay = today.getDay();
envLight.curTime = 15 * today.getHours();

envLight.timeSpeed = 0.012;
envLight.timeAdv = 0.012;

colorFromRGBA(envLight.lightStatus[0].Color, 1.0, 0.0, 0.0, 0.0);
colorFromRGBA(envLight.lightStatus[1].Color, 0.0, 0.0, 0.0, 0.0);
Expand Down
26 changes: 0 additions & 26 deletions src/gfx/platform/GfxPlatform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,32 +201,6 @@ export interface GfxBindingsDescriptor {
samplerBindings: GfxSamplerBinding[];
}

export const enum GfxBindingLayoutEntryType {
UniformBuffer,
Sampler,
StorageBuffer,
StorageTexture,
}

interface GfxBindingLayoutEntrySampler extends GfxBindingLayoutSamplerDescriptor {
type: GfxBindingLayoutEntryType.Sampler;
}

interface GfxBindingLayoutEntryBase {
type: GfxBindingLayoutEntryType;
}

type GfxBindingLayoutEntry = GfxBindingLayoutEntryBase | GfxBindingLayoutEntrySampler;

export interface GfxBindingLayoutDescriptor2 {
entries: GfxBindingLayoutEntry[];
}

export interface GfxBindingsDescriptor2 {
bindingLayout: GfxBindingLayoutDescriptor2;
entries: (GfxBufferBinding | GfxSamplerBinding)[];
}

export interface GfxRenderProgramDescriptor {
preprocessedVert: string;
preprocessedFrag: string | null;
Expand Down

0 comments on commit af2a548

Please sign in to comment.