Moonlight-XboxOG latest
Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console.
splash_layout.h File Reference

Declares splash screen layout calculations. More...

#include <hal/video.h>
Include dependency graph for splash_layout.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  splash::SplashLayout
 Rectangle used for splash image placement. More...
 

Functions

int splash::calculate_display_width (int screenHeight, const VIDEO_MODE &videoMode, unsigned long encoderSettings)
 Calculate the logical display width for square-pixel UI layout.
 
SplashLayout splash::calculate_logo_destination (int screenWidth, int screenHeight, int logoWidth, int logoHeight, const VIDEO_MODE &videoMode, unsigned long encoderSettings)
 Calculate the centered destination rectangle for the splash logo.
 
float splash::get_display_aspect_ratio (const VIDEO_MODE &videoMode, unsigned long encoderSettings)
 Return the display aspect ratio after encoder corrections.
 
float splash::get_framebuffer_aspect_ratio (const VIDEO_MODE &videoMode)
 Return the framebuffer aspect ratio for a video mode.
 
float splash::get_logo_width_aspect_correction (const VIDEO_MODE &videoMode, unsigned long encoderSettings)
 Return the width correction factor applied before scaling the logo.
 

Detailed Description

Declares splash screen layout calculations.

Function Documentation

◆ calculate_display_width()

int splash::calculate_display_width ( int screenHeight,
const VIDEO_MODE & videoMode,
unsigned long encoderSettings )

Calculate the logical display width for square-pixel UI layout.

When the framebuffer aspect ratio differs from the effective display aspect, this returns the width that should be used for layout before horizontal scaling is applied back onto the framebuffer.

Parameters
screenHeightHeight of the destination surface.
videoModeThe video mode being rendered.
encoderSettingsThe value returned by XVideoGetEncoderSettings().
Returns
The logical display width corresponding to the effective aspect ratio.

◆ calculate_logo_destination()

SplashLayout splash::calculate_logo_destination ( int screenWidth,
int screenHeight,
int logoWidth,
int logoHeight,
const VIDEO_MODE & videoMode,
unsigned long encoderSettings )

Calculate the centered destination rectangle for the splash logo.

Parameters
screenWidthWidth of the destination surface.
screenHeightHeight of the destination surface.
logoWidthWidth of the source logo.
logoHeightHeight of the source logo.
videoModeActive video mode.
encoderSettingsThe value returned by XVideoGetEncoderSettings().
Returns
The scaled and centered destination rectangle.

◆ get_display_aspect_ratio()

float splash::get_display_aspect_ratio ( const VIDEO_MODE & videoMode,
unsigned long encoderSettings )

Return the display aspect ratio after encoder corrections.

Standard-definition framebuffers may need to be displayed with a corrected aspect ratio based on the active encoder settings.

Parameters
videoModeThe video mode being rendered.
encoderSettingsThe value returned by XVideoGetEncoderSettings().
Returns
The effective display aspect ratio.

◆ get_framebuffer_aspect_ratio()

float splash::get_framebuffer_aspect_ratio ( const VIDEO_MODE & videoMode)

Return the framebuffer aspect ratio for a video mode.

Parameters
videoModeThe video mode being rendered.
Returns
The framebuffer width divided by height.

◆ get_logo_width_aspect_correction()

float splash::get_logo_width_aspect_correction ( const VIDEO_MODE & videoMode,
unsigned long encoderSettings )

Return the width correction factor applied before scaling the logo.

Parameters
videoModeThe video mode being rendered.
encoderSettingsThe value returned by XVideoGetEncoderSettings().
Returns
The correction multiplier applied to the source logo width.