Fix: register D2R resolution profiles with engine, fix null API responses

This commit is contained in:
Hoid 2026-02-14 10:46:40 +00:00
parent 67f8ec1fe8
commit 4ebed5e3ab
3 changed files with 20 additions and 2 deletions

View file

@ -61,6 +61,18 @@ func NewEngine(captureSource capture.Source, gamePlugin plugin.Plugin, devMode b
startTime: time.Now(),
}
// Register game-specific resolution profiles with the engine's registry.
// Plugins that support resolution profiles implement this optional interface.
type profileRegistrar interface {
RegisterResolutionProfiles(*resolution.Registry) error
}
if registrar, ok := gamePlugin.(profileRegistrar); ok {
if err := registrar.RegisterResolutionProfiles(engine.resolutionRegistry); err != nil {
return nil, fmt.Errorf("failed to register resolution profiles: %w", err)
}
log.Printf("Registered resolution profiles for %s", gamePlugin.Info().ID)
}
// Create engine services for the plugin
engine.services = &engineServices{engine: engine}