Skip to content

Commit

Permalink
Fix fullscreen texture scaling with cheat map
Browse files Browse the repository at this point in the history
  • Loading branch information
TollyH committed Dec 2, 2022
1 parent 413342f commit 30fcd10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CSMaze/MazeGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ void FireGun()
_ = SDL_mixer.Mix_PlayChannel(-1, resources.MonsterJumpscareSound, 0);
hasStartedLevel[currentLevel] = false;
}
ScreenDrawing.DrawKillScreen(screen, !isMulti || isCoop ? resources.JumpscareMonsterTexture : resources.PlayerTextures[lastKillerSkin]);
ScreenDrawing.DrawKillScreen(screen, cfg, !isMulti || isCoop ? resources.JumpscareMonsterTexture : resources.PlayerTextures[lastKillerSkin]);
}
// Currently playing
else
Expand Down
8 changes: 5 additions & 3 deletions CSMaze/ScreenDrawing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,12 @@ public static void DrawVictoryScreen(IntPtr screen, IReadOnlyList<(float, float)
/// <summary>
/// Draw the red kill screen with the monster fullscreen. Also used in multiplayer to display the player's killer.
/// </summary>
public static void DrawKillScreen(IntPtr screen, IntPtr jumpscareMonsterTexture)
public static void DrawKillScreen(IntPtr screen, Config cfg, IntPtr jumpscareMonsterTexture)
{
_ = SDL.SDL_SetRenderDrawColor(screen, Red.R, Red.G, Red.B, 255);
_ = SDL.SDL_RenderFillRect(screen, IntPtr.Zero);
_ = SDL.SDL_RenderCopy(screen, jumpscareMonsterTexture, IntPtr.Zero, IntPtr.Zero);
SDL.SDL_Rect dstRect = new() { x = 0, y = 0, w = cfg.ViewportWidth, h = cfg.ViewportHeight };
_ = SDL.SDL_RenderCopy(screen, jumpscareMonsterTexture, IntPtr.Zero, ref dstRect);
}

/// <summary>
Expand Down Expand Up @@ -605,7 +606,8 @@ public static void DrawResetPrompt(IntPtr screen, Config cfg)
/// </summary>
public static void DrawGun(IntPtr screen, Config cfg, IntPtr gunTexture)
{
_ = SDL.SDL_RenderCopy(screen, gunTexture, IntPtr.Zero, IntPtr.Zero);
SDL.SDL_Rect dstRect = new() { x = 0, y = 0, w = cfg.ViewportWidth, h = cfg.ViewportHeight };
_ = SDL.SDL_RenderCopy(screen, gunTexture, IntPtr.Zero, ref dstRect);
_ = SDL_gfx.filledCircleRGBA(screen, (short)(cfg.ViewportWidth / 2), (short)(cfg.ViewportHeight / 2), 5, Black.R, Black.G, Black.B, 255);
_ = SDL_gfx.filledCircleRGBA(screen, (short)(cfg.ViewportWidth / 2), (short)(cfg.ViewportHeight / 2), 3, White.R, White.G, White.B, 255);
}
Expand Down

0 comments on commit 30fcd10

Please sign in to comment.