Fix: register D2R resolution profiles with engine, fix null API responses
This commit is contained in:
parent
67f8ec1fe8
commit
4ebed5e3ab
3 changed files with 20 additions and 2 deletions
|
|
@ -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}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue