Curation round 4: popups, Seeds/Random, Game, KeyConfigs, offline NetplayManager, Console, TextureCache, render passes
Six agents took over PopupButtons/PopupQueue/AchievementOverlay, Seeds with the global Random (now seeded from the clock as in the original), Game (g_game exists from Manager::Init on), KeyConfigs, an offline NetplayManager, Console's output and printing, TextureCache, the color-mod and sprite shader passes, mod shaders and reload_resource_paths. An integration pass moved callers to the new APIs (0 errors, 0 warnings with -Wall -Wextra). build/isaac loads the 34 installed mods and stops at ScoreSheet::ScoreSheet in Game's constructor; with the remaining stubs skipped under gdb the intro cutscene plays through and the main menu's frame loop runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ddf913f304
commit
fd8b965350
110 files changed
+6500
-40129
No files matched your search
+17
-23
@@ -2,6 +2,7 @@
|
||||
#include "kage_input.h"
|
||||
#include "log.h"
|
||||
#include "manager.h"
|
||||
#include "render_passes.h"
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
@@ -167,18 +168,12 @@ void color_mod_surface_create()
|
||||
|
||||
// A fresh run's seeds, as Seeds' constructor builds them. Seeds is not taken over yet, and classes.h gives its
|
||||
// constructor no object to build.
|
||||
static void seeds_reset(Seeds&)
|
||||
{
|
||||
reconstruction_missing("Seeds::constructor 009e9290 on MenuManager::seedsObject");
|
||||
}
|
||||
|
||||
// 00986450 Builds the menus with the view at the sheet's origin and the color modifier off, then the surface it renders
|
||||
// through. The other menus' construction, inlined here, is theirs: the ones classes.h declares run here.
|
||||
MenuManager::MenuManager()
|
||||
{
|
||||
fadeInColor = kcolor_argb(BLACK_ARGB);
|
||||
specialSeedsViewPosition = vector_make(0, SPECIAL_SEEDS_VIEW_Y);
|
||||
seeds_reset(seedsObject);
|
||||
Leaderboard::constructor();
|
||||
menuCharacter.constructor();
|
||||
menuOptions.constructor();
|
||||
@@ -236,8 +231,7 @@ void MenuManager::Init()
|
||||
if (manager.persistentGameData.characterMenuShown == CHARACTER_MENU_SHOWN)
|
||||
manager.musicManager.EnableLayer(MUSIC_LAYER_CHARACTER, LAYER_INSTANT);
|
||||
log_printf(LOG_INFO, "Menu Manager Init\n");
|
||||
manager.popupButtons.reset(0);
|
||||
seeds_reset(seedsObject);
|
||||
manager.popupButtons.reset();
|
||||
|
||||
for (int i = 0; i < MENU_COUNT; i++) viewPositionSet[i] = vector_make(VIEW_POSITIONS[i][0], VIEW_POSITIONS[i][1]);
|
||||
viewPositionSet[MENU_SPECIAL_SEEDS] = specialSeedsViewPosition;
|
||||
@@ -308,7 +302,7 @@ void MenuManager::start_game(KColor fadeColor)
|
||||
input_poll_active_device();
|
||||
manager.musicManager.Crossfade(isCharacterMenuShown ? MUSIC_JINGLE_GAME_START_ALT : MUSIC_JINGLE_GAME_START,
|
||||
MUSIC_FADE_RATE);
|
||||
if (seedsObject._gameStartSeed == 0) log_printf(LOG_ASSERT, "Error: Game Start Seed was not set.\n");
|
||||
if (seedsObject.gameStartSeed == 0) log_printf(LOG_ASSERT, "Error: Game Start Seed was not set.\n");
|
||||
loading_images_load();
|
||||
}
|
||||
|
||||
@@ -456,7 +450,7 @@ void MenuManager::Render()
|
||||
graphics.blendMode.SetMode(KAGE::Graphics::BLEND_NORMAL);
|
||||
KAGE::Graphics::ColorQuad paper = KAGE::Graphics::color_quad_rect(
|
||||
vector_make(0, 0), vector_make(g_screenWidth, g_screenHeight), kcolor_argb(MENU_BACKGROUND_ARGB));
|
||||
render_color_shader_pass(&paper);
|
||||
render_color_shader_pass(paper);
|
||||
|
||||
menuTitle.Render();
|
||||
menuChallenge.Render();
|
||||
@@ -493,12 +487,12 @@ void MenuManager::Render()
|
||||
// Slides the popup buttons (back and select) to where the selected menu shows them, or away.
|
||||
void MenuManager::popup_buttons_place()
|
||||
{
|
||||
PopupButton* buttons = g_manager->popupButtons._buttons;
|
||||
auto& buttons = g_manager->popupButtons.buttons;
|
||||
|
||||
if (!isPopupButtonsShown || selectedMenuId == MENU_TITLE)
|
||||
{
|
||||
buttons[0]._targetSlideOffset = BUTTON_HIDDEN;
|
||||
buttons[1]._targetSlideOffset = BUTTON_HIDDEN;
|
||||
buttons[0].targetSlideOffset = BUTTON_HIDDEN;
|
||||
buttons[1].targetSlideOffset = BUTTON_HIDDEN;
|
||||
return;
|
||||
}
|
||||
switch (selectedMenuId)
|
||||
@@ -511,19 +505,19 @@ void MenuManager::popup_buttons_place()
|
||||
case MENU_OPTIONS:
|
||||
case MENU_CONTROLLER_SELECT:
|
||||
case MENU_KEY_CONFIG:
|
||||
buttons[0]._targetSlideOffset = BUTTON_SHOWN;
|
||||
buttons[1]._targetSlideOffset = BUTTON_SHOWN;
|
||||
buttons[0].targetSlideOffset = BUTTON_SHOWN;
|
||||
buttons[1].targetSlideOffset = BUTTON_SHOWN;
|
||||
break;
|
||||
case MENU_DAILY_RUN:
|
||||
case MENU_COLLECTION:
|
||||
case MENU_CUTSCENES:
|
||||
case MENU_BESTIARY:
|
||||
buttons[0]._targetSlideOffset = BUTTON_RAISED;
|
||||
buttons[1]._targetSlideOffset = BUTTON_HIDDEN;
|
||||
buttons[0].targetSlideOffset = BUTTON_RAISED;
|
||||
buttons[1].targetSlideOffset = BUTTON_HIDDEN;
|
||||
break;
|
||||
case MENU_STATS:
|
||||
buttons[0]._targetSlideOffset = BUTTON_SHOWN;
|
||||
buttons[1]._targetSlideOffset = menuStats._isAchievementScreenVisible ? BUTTON_HIDDEN : BUTTON_SHOWN;
|
||||
buttons[0].targetSlideOffset = BUTTON_SHOWN;
|
||||
buttons[1].targetSlideOffset = menuStats._isAchievementScreenVisible ? BUTTON_HIDDEN : BUTTON_SHOWN;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
@@ -554,7 +548,7 @@ void MenuManager::overlay_render()
|
||||
shader_select(COLOR_OFFSET_SHADER);
|
||||
if (menuOverlayImage)
|
||||
{
|
||||
apply_sprite_shader_params(&plain, 1, menuOverlayImage.get(), nullptr);
|
||||
apply_sprite_shader_params(plain, SPRITE_SHADER_COLOR_APPLY, *menuOverlayImage);
|
||||
menuOverlayImage->Render(KAGE::Graphics::color_quad_rect(origin, size, white), unset);
|
||||
}
|
||||
|
||||
@@ -564,7 +558,7 @@ void MenuManager::overlay_render()
|
||||
if (vignetteIntensity <= 0 || !menuOverlayImage) return;
|
||||
|
||||
shader_select(COLOR_OFFSET_SHADER);
|
||||
apply_sprite_shader_params(&plain, 1, menuOverlayImage.get(), nullptr);
|
||||
apply_sprite_shader_params(plain, SPRITE_SHADER_COLOR_APPLY, *menuOverlayImage);
|
||||
menuOverlayImage->Render(KAGE::Graphics::color_quad_rect(origin, size, white),
|
||||
kcolor_make(1, 1, 1, vignetteIntensity));
|
||||
}
|
||||
@@ -611,7 +605,7 @@ void MenuManager::fades_render()
|
||||
{
|
||||
graphics.blendMode.SetMode(KAGE::Graphics::BLEND_NORMAL);
|
||||
KAGE::Graphics::ColorQuad dark = KAGE::Graphics::color_quad_rect(origin, size, kcolor_make(0, 0, 0, fadeOutProgress));
|
||||
render_color_shader_pass(&dark);
|
||||
render_color_shader_pass(dark);
|
||||
Manager::render_loading_icon(fadeOutProgress);
|
||||
}
|
||||
if (!isFadeInActive) return;
|
||||
@@ -620,7 +614,7 @@ void MenuManager::fades_render()
|
||||
KColor color = fadeInColor;
|
||||
color._alpha = fadeInProgress;
|
||||
KAGE::Graphics::ColorQuad fade = KAGE::Graphics::color_quad_rect(origin, size, color);
|
||||
render_color_shader_pass(&fade);
|
||||
render_color_shader_pass(fade);
|
||||
if (fadeInProgress > 0) return;
|
||||
|
||||
isFadeInActive = false;
|
||||
|
||||
Reference in new issue
Block a user