mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-22 05:40:15 -06:00
add option to toggle filtering
This commit is contained in:
@ -35,6 +35,7 @@ int ScreenRotation;
|
|||||||
int ScreenGap;
|
int ScreenGap;
|
||||||
int ScreenLayout;
|
int ScreenLayout;
|
||||||
int ScreenSizing;
|
int ScreenSizing;
|
||||||
|
int ScreenFilter;
|
||||||
|
|
||||||
int DirectBoot;
|
int DirectBoot;
|
||||||
|
|
||||||
@ -88,6 +89,7 @@ ConfigEntry ConfigFile[] =
|
|||||||
{"ScreenGap", 0, &ScreenGap, 0, NULL, 0},
|
{"ScreenGap", 0, &ScreenGap, 0, NULL, 0},
|
||||||
{"ScreenLayout", 0, &ScreenLayout, 0, NULL, 0},
|
{"ScreenLayout", 0, &ScreenLayout, 0, NULL, 0},
|
||||||
{"ScreenSizing", 0, &ScreenSizing, 0, NULL, 0},
|
{"ScreenSizing", 0, &ScreenSizing, 0, NULL, 0},
|
||||||
|
{"ScreenFilter", 0, &ScreenFilter, 1, NULL, 0},
|
||||||
|
|
||||||
{"DirectBoot", 0, &DirectBoot, 1, NULL, 0},
|
{"DirectBoot", 0, &DirectBoot, 1, NULL, 0},
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ extern int ScreenRotation;
|
|||||||
extern int ScreenGap;
|
extern int ScreenGap;
|
||||||
extern int ScreenLayout;
|
extern int ScreenLayout;
|
||||||
extern int ScreenSizing;
|
extern int ScreenSizing;
|
||||||
|
extern int ScreenFilter;
|
||||||
|
|
||||||
extern int DirectBoot;
|
extern int DirectBoot;
|
||||||
|
|
||||||
|
@ -505,7 +505,7 @@ _UI_EXTERN void uiDrawRestore(uiDrawContext *c);
|
|||||||
// bitmap API
|
// bitmap API
|
||||||
_UI_EXTERN uiDrawBitmap* uiDrawNewBitmap(uiDrawContext* c, int width, int height);
|
_UI_EXTERN uiDrawBitmap* uiDrawNewBitmap(uiDrawContext* c, int width, int height);
|
||||||
_UI_EXTERN void uiDrawBitmapUpdate(uiDrawBitmap* bmp, const void* data);
|
_UI_EXTERN void uiDrawBitmapUpdate(uiDrawBitmap* bmp, const void* data);
|
||||||
_UI_EXTERN void uiDrawBitmapDraw(uiDrawContext* c, uiDrawBitmap* bmp, uiRect* srcrect, uiRect* dstrect, bool filter);
|
_UI_EXTERN void uiDrawBitmapDraw(uiDrawContext* c, uiDrawBitmap* bmp, uiRect* srcrect, uiRect* dstrect, int filter);
|
||||||
_UI_EXTERN void uiDrawFreeBitmap(uiDrawBitmap* bmp);
|
_UI_EXTERN void uiDrawFreeBitmap(uiDrawBitmap* bmp);
|
||||||
|
|
||||||
// TODO manage the use of Text, Font, and TextFont, and of the uiDrawText prefix in general
|
// TODO manage the use of Text, Font, and TextFont, and of the uiDrawText prefix in general
|
||||||
|
@ -185,7 +185,7 @@ void uiDrawBitmapUpdate(uiDrawBitmap* bmp, const void* data)
|
|||||||
cairo_surface_mark_dirty(bmp->bmp);
|
cairo_surface_mark_dirty(bmp->bmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiDrawBitmapDraw(uiDrawContext* c, uiDrawBitmap* bmp, uiRect* srcrect, uiRect* dstrect, bool filter)
|
void uiDrawBitmapDraw(uiDrawContext* c, uiDrawBitmap* bmp, uiRect* srcrect, uiRect* dstrect, int filter)
|
||||||
{
|
{
|
||||||
cairo_save(c->cr);
|
cairo_save(c->cr);
|
||||||
cairo_rectangle(c->cr, dstrect->X, dstrect->Y, dstrect->Width, dstrect->Height);
|
cairo_rectangle(c->cr, dstrect->X, dstrect->Y, dstrect->Width, dstrect->Height);
|
||||||
|
@ -555,7 +555,7 @@ void uiDrawBitmapUpdate(uiDrawBitmap* bmp, const void* data)
|
|||||||
bmp->bmp->CopyFromMemory(&rekt, data, bmp->Stride);
|
bmp->bmp->CopyFromMemory(&rekt, data, bmp->Stride);
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiDrawBitmapDraw(uiDrawContext* c, uiDrawBitmap* bmp, uiRect* srcrect, uiRect* dstrect, bool filter)
|
void uiDrawBitmapDraw(uiDrawContext* c, uiDrawBitmap* bmp, uiRect* srcrect, uiRect* dstrect, int filter)
|
||||||
{
|
{
|
||||||
D2D_RECT_F _srcrect = D2D1::RectF(srcrect->X, srcrect->Y, srcrect->X+srcrect->Width, srcrect->Y+srcrect->Height);
|
D2D_RECT_F _srcrect = D2D1::RectF(srcrect->X, srcrect->Y, srcrect->X+srcrect->Width, srcrect->Y+srcrect->Height);
|
||||||
D2D_RECT_F _dstrect = D2D1::RectF(dstrect->X, dstrect->Y, dstrect->X+dstrect->Width, dstrect->Y+dstrect->Height);
|
D2D_RECT_F _dstrect = D2D1::RectF(dstrect->X, dstrect->Y, dstrect->X+dstrect->Width, dstrect->Y+dstrect->Height);
|
||||||
|
@ -310,12 +310,12 @@ void OnAreaDraw(uiAreaHandler* handler, uiArea* area, uiAreaDrawParams* params)
|
|||||||
|
|
||||||
uiDrawSave(params->Context);
|
uiDrawSave(params->Context);
|
||||||
uiDrawTransform(params->Context, &TopScreenTrans);
|
uiDrawTransform(params->Context, &TopScreenTrans);
|
||||||
uiDrawBitmapDraw(params->Context, ScreenBitmap, &top, &TopScreenRect);
|
uiDrawBitmapDraw(params->Context, ScreenBitmap, &top, &TopScreenRect, Config::ScreenFilter==1);
|
||||||
uiDrawRestore(params->Context);
|
uiDrawRestore(params->Context);
|
||||||
|
|
||||||
uiDrawSave(params->Context);
|
uiDrawSave(params->Context);
|
||||||
uiDrawTransform(params->Context, &BottomScreenTrans);
|
uiDrawTransform(params->Context, &BottomScreenTrans);
|
||||||
uiDrawBitmapDraw(params->Context, ScreenBitmap, &bot, &BottomScreenRect);
|
uiDrawBitmapDraw(params->Context, ScreenBitmap, &bot, &BottomScreenRect, Config::ScreenFilter==1);
|
||||||
uiDrawRestore(params->Context);
|
uiDrawRestore(params->Context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -937,6 +937,13 @@ void OnSetScreenSizing(uiMenuItem* item, uiWindow* window, void* param)
|
|||||||
uiMenuItemSetChecked(MenuItem_ScreenSizing[i], i==ScreenSizing);
|
uiMenuItemSetChecked(MenuItem_ScreenSizing[i], i==ScreenSizing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnSetScreenFiltering(uiMenuItem* item, uiWindow* window, void* blarg)
|
||||||
|
{
|
||||||
|
int chk = uiMenuItemChecked(item);
|
||||||
|
if (chk != 0) Config::ScreenFilter = 1;
|
||||||
|
else Config::ScreenFilter = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ApplyNewSettings()
|
void ApplyNewSettings()
|
||||||
{
|
{
|
||||||
@ -1101,6 +1108,9 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
uiMenuAppendSubmenu(menu, submenu);
|
uiMenuAppendSubmenu(menu, submenu);
|
||||||
}
|
}
|
||||||
|
menuitem = uiMenuAppendCheckItem(menu, "Screen filtering");
|
||||||
|
uiMenuItemOnClicked(menuitem, OnSetScreenFiltering, NULL);
|
||||||
|
uiMenuItemSetChecked(menuitem, Config::ScreenFilter==1);
|
||||||
|
|
||||||
uiMenuItemSetChecked(MenuItem_ScreenRot[ScreenRotation], 1);
|
uiMenuItemSetChecked(MenuItem_ScreenRot[ScreenRotation], 1);
|
||||||
uiMenuItemSetChecked(MenuItem_ScreenGap[ScreenGap], 1);
|
uiMenuItemSetChecked(MenuItem_ScreenGap[ScreenGap], 1);
|
||||||
|
Reference in New Issue
Block a user