mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- backend update from GZDoom.
This commit is contained in:
parent
58dcf0586b
commit
dff8339ba3
4 changed files with 53 additions and 4 deletions
|
@ -410,6 +410,29 @@ void CalcFullscreenScale(DrawParms *parms, double srcwidth, double srcheight, in
|
|||
}
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(_Screen, GetFullscreenRect)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_FLOAT(virtw);
|
||||
PARAM_FLOAT(virth);
|
||||
PARAM_INT(fsmode);
|
||||
|
||||
if (!twod->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
|
||||
|
||||
DrawParms parms;
|
||||
DoubleRect rect;
|
||||
parms.viewport.width = twod->GetWidth();
|
||||
parms.viewport.height = twod->GetHeight();
|
||||
CalcFullscreenScale(&parms, virtw, virth, fsmode, rect);
|
||||
if (numret >= 1) ret[0].SetFloat(rect.left);
|
||||
if (numret >= 2) ret[1].SetFloat(rect.top);
|
||||
if (numret >= 3) ret[2].SetFloat(rect.width);
|
||||
if (numret >= 4) ret[3].SetFloat(rect.height);
|
||||
return MIN(numret, 4);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Draw parameter parsing
|
||||
|
@ -460,6 +483,13 @@ bool SetTextureParms(F2DDrawer * drawer, DrawParms *parms, FGameTexture *img, do
|
|||
parms->destheight = parms->texheight * CleanYfac;
|
||||
break;
|
||||
|
||||
case DTA_CleanTop:
|
||||
parms->x = (parms->x - 160.0) * CleanXfac + (GetWidth() * 0.5);
|
||||
parms->y = (parms->y) * CleanYfac;
|
||||
parms->destwidth = parms->texwidth * CleanXfac;
|
||||
parms->destheight = parms->texheight * CleanYfac;
|
||||
break;
|
||||
|
||||
case DTA_CleanNoMove:
|
||||
parms->destwidth = parms->texwidth * CleanXfac;
|
||||
parms->destheight = parms->texheight * CleanYfac;
|
||||
|
@ -716,6 +746,7 @@ bool ParseDrawTextureTags(F2DDrawer *drawer, FGameTexture *img, double x, double
|
|||
break;
|
||||
|
||||
case DTA_Clean:
|
||||
case DTA_CleanTop:
|
||||
boolval = ListGetInt(tags);
|
||||
if (boolval)
|
||||
{
|
||||
|
|
|
@ -130,6 +130,7 @@ enum
|
|||
DTA_Rotate,
|
||||
DTA_FlipOffsets, // Flips offsets when using DTA_FlipX and DTA_FlipY, this cannot be automatic due to unexpected behavior with unoffsetted graphics.
|
||||
DTA_Indexed, // Use an indexed texture combined with the given translation.
|
||||
DTA_CleanTop, // Like DTA_Clean but aligns to the top of the screen instead of the center.
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -99,9 +99,9 @@ CUSTOM_CVAR(String, adl_custom_bank, "", CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR
|
|||
FORWARD_STRING_CVAR(adl_custom_bank);
|
||||
}
|
||||
|
||||
CUSTOM_CVAR(Int, adl_volume_model, 3/*ADLMIDI_VolumeModel_DMX*/, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL)
|
||||
CUSTOM_CVAR(Int, adl_volume_model, 0 /*ADLMIDI_VolumeModel_AUTO*/, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL)
|
||||
{
|
||||
FORWARD_CVAR(adl_bank);
|
||||
FORWARD_CVAR(adl_volume_model);
|
||||
}
|
||||
#endif
|
||||
//==========================================================================
|
||||
|
|
|
@ -541,7 +541,7 @@ DEFINE_ACTION_FUNCTION(_CVar, FindCVar)
|
|||
//
|
||||
//
|
||||
//=============================================================================
|
||||
#if 0
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FKeyBindings, SetBind)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FKeyBindings);
|
||||
|
@ -569,6 +569,14 @@ DEFINE_ACTION_FUNCTION(FKeyBindings, NameKeys)
|
|||
ACTION_RETURN_STRING(buffer);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FKeyBindings, NameAllKeys)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_POINTER(array, TArray<int>);
|
||||
auto buffer = C_NameKeys(array->Data(), array->Size(), true);
|
||||
ACTION_RETURN_STRING(buffer);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FKeyBindings, GetKeysForCommand)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FKeyBindings);
|
||||
|
@ -580,6 +588,15 @@ DEFINE_ACTION_FUNCTION(FKeyBindings, GetKeysForCommand)
|
|||
return MIN(numret, 2);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FKeyBindings, GetAllKeysForCommand)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FKeyBindings);
|
||||
PARAM_POINTER(array, TArray<int>);
|
||||
PARAM_STRING(cmd);
|
||||
*array = self->GetKeysForCommand(cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FKeyBindings, UnbindACommand)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FKeyBindings);
|
||||
|
@ -606,7 +623,7 @@ DEFINE_ACTION_FUNCTION(DOptionMenuItemCommand, DoCommand)
|
|||
C_DoCommand(cmd);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
DEFINE_ACTION_FUNCTION(_Console, MidPrint)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
|
|
Loading…
Reference in a new issue