mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-05 00:38:00 +01:00
params: Add ability to disable clear to color before Gamestate_Draw
This commit is contained in:
parent
e536a8bc4f
commit
29aefdb55c
2 changed files with 4 additions and 3 deletions
|
@ -46,7 +46,7 @@ SYMBOL_INTERNAL void SimpleCompositor(struct Game* game) {
|
|||
}
|
||||
|
||||
SYMBOL_INTERNAL void DrawGamestates(struct Game* game) {
|
||||
if (!game->_priv.params.handlers.compositor) {
|
||||
if (!game->_priv.params.disable_bg_clear && !game->_priv.params.handlers.compositor) {
|
||||
ClearScreen(game);
|
||||
}
|
||||
struct Gamestate* tmp = game->_priv.gamestates;
|
||||
|
@ -57,7 +57,7 @@ SYMBOL_INTERNAL void DrawGamestates(struct Game* game) {
|
|||
if ((tmp->loaded) && (tmp->started)) {
|
||||
game->_priv.current_gamestate = tmp;
|
||||
SetFramebufferAsTarget(game);
|
||||
if (game->_priv.params.handlers.compositor) { // don't clear when uncomposited
|
||||
if (!game->_priv.params.disable_bg_clear && game->_priv.params.handlers.compositor) { // don't clear when uncomposited
|
||||
al_reset_clipping_rectangle();
|
||||
al_clear_to_color(game->_priv.bg); // even if everything is going to be redrawn, it optimizes tiled rendering
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ SYMBOL_INTERNAL void DrawGamestates(struct Game* game) {
|
|||
// same as above, but for the loading gamestate
|
||||
game->_priv.current_gamestate = game->_priv.loading.gamestate;
|
||||
SetFramebufferAsTarget(game);
|
||||
if (game->_priv.params.handlers.compositor) {
|
||||
if (!game->_priv.params.disable_bg_clear && game->_priv.params.handlers.compositor) {
|
||||
al_reset_clipping_rectangle();
|
||||
al_clear_to_color(game->_priv.bg);
|
||||
}
|
||||
|
|
|
@ -141,6 +141,7 @@ struct Params {
|
|||
bool integer_scaling; /*!< Ensure that the viewport is zoomed only by integer factors. */
|
||||
bool depth_buffer; /*!< Request a depth buffer for the framebuffer's render target. */
|
||||
bool show_loading_on_launch; /*!< Whether the loading screen should be shown when loading the initial set of gamestates. */
|
||||
bool disable_bg_clear; /*!< If set to true, the gamestate framebuffer won't be cleared to background color before calling Gamestate_Draw. */
|
||||
bool fixed_size; /*!< If set to true, the game's window will not be resizable. */
|
||||
bool no_autopause; /*!< If set to true, engine autopause is forced to be disabled. */
|
||||
int samples; /*!< How many samples should be used for multisampling; 0 to disable. */
|
||||
|
|
Loading…
Reference in a new issue