mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
discord: fix merge conflicts
This commit is contained in:
commit
cdbe19e213
@ -1480,7 +1480,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
static struct config_float_setting *populate_settings_float(settings_t *settings, int *size)
|
||||
{
|
||||
unsigned count = 0;
|
||||
struct config_float_setting *tmp = (struct config_float_setting*)malloc((*size + 1) * sizeof(struct config_float_setting));
|
||||
struct config_float_setting *tmp = (struct config_float_setting*)calloc(1, (*size + 1) * sizeof(struct config_float_setting));
|
||||
|
||||
SETTING_FLOAT("video_aspect_ratio", &settings->floats.video_aspect_ratio, true, aspect_ratio, false);
|
||||
SETTING_FLOAT("video_scale", &settings->floats.video_scale, false, 0.0f, false);
|
||||
|
@ -77,7 +77,6 @@ static void handle_discord_join_request(const DiscordUser* request)
|
||||
|
||||
void discord_update(enum discord_presence presence)
|
||||
{
|
||||
rarch_system_info_t *system = runloop_get_system_info();
|
||||
core_info_t *core_info = NULL;
|
||||
bool skip = false;
|
||||
|
||||
|
@ -808,8 +808,7 @@ static bool vulkan_init_filter_chain_preset(vk_t *vk, const char *shader_path)
|
||||
|
||||
static bool vulkan_init_filter_chain(vk_t *vk)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *shader_path = retroarch_get_shader_preset();
|
||||
const char *shader_path = retroarch_get_shader_preset();
|
||||
|
||||
enum rarch_shader_type type = video_shader_parse_type(shader_path, RARCH_SHADER_NONE);
|
||||
|
||||
@ -2228,10 +2227,16 @@ static void vulkan_set_osd_msg(void *data,
|
||||
static uintptr_t vulkan_load_texture(void *video_data, void *data,
|
||||
bool threaded, enum texture_filter_type filter_type)
|
||||
{
|
||||
struct vk_texture *texture = NULL;
|
||||
vk_t *vk = (vk_t*)video_data;
|
||||
struct texture_image *image = (struct texture_image*)data;
|
||||
struct vk_texture *texture = (struct vk_texture*)calloc(1, sizeof(*texture));
|
||||
if (!image || !texture)
|
||||
if (!image)
|
||||
return 0;
|
||||
|
||||
texture = (struct vk_texture*)
|
||||
calloc(1, sizeof(*texture));
|
||||
|
||||
if (!texture)
|
||||
return 0;
|
||||
|
||||
if (!image->pixels || !image->width || !image->height)
|
||||
|
@ -748,6 +748,8 @@ bool video_shader_read_conf_cgp(config_file_t *conf,
|
||||
shader->passes = MIN(shaders, GFX_MAX_SHADERS);
|
||||
attr.i = 0;
|
||||
|
||||
strlcpy(shader->path, conf->path, sizeof(shader->path));
|
||||
|
||||
if (settings->bools.video_shader_watch_files)
|
||||
{
|
||||
if (file_change_data)
|
||||
|
@ -147,6 +147,7 @@ struct video_shader
|
||||
char prefix[64];
|
||||
char script_class[512];
|
||||
char script_path[PATH_MAX_LENGTH];
|
||||
char path[PATH_MAX_LENGTH];
|
||||
char *script; /* Dynamically allocated. Must be free'd. Only used by XML. */
|
||||
|
||||
bool modern; /* Only used for XML shaders. */
|
||||
|
@ -3762,3 +3762,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FAILED,
|
||||
"更新に失敗しました。")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT_CONTRIBUTORS,
|
||||
"作成者")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CURRENT_SHADER,
|
||||
"現在のシェーダー")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MOVE_DOWN,
|
||||
"下へ移動")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MOVE_UP,
|
||||
"上へ移動")
|
||||
|
@ -4264,3 +4264,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FAILED,
|
||||
"Update failed.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT_CONTRIBUTORS,
|
||||
"Contributors")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CURRENT_SHADER,
|
||||
"Current shader")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MOVE_DOWN,
|
||||
"Move Down")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MOVE_UP,
|
||||
"Move Up")
|
||||
|
@ -1987,6 +1987,9 @@ enum msg_hash_enums
|
||||
MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_NIGHTLY,
|
||||
MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FINISHED,
|
||||
MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FAILED,
|
||||
MENU_ENUM_LABEL_VALUE_QT_CURRENT_SHADER,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MOVE_DOWN,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MOVE_UP,
|
||||
|
||||
MENU_LABEL(MIDI_INPUT),
|
||||
MENU_LABEL(MIDI_OUTPUT),
|
||||
|
@ -375,6 +375,7 @@ static void global_free(void)
|
||||
|
||||
static void retroarch_print_features(void)
|
||||
{
|
||||
frontend_driver_attach_console();
|
||||
puts("");
|
||||
puts("Features:");
|
||||
|
||||
@ -451,7 +452,7 @@ static void retroarch_print_features(void)
|
||||
static void retroarch_print_version(void)
|
||||
{
|
||||
char str[255];
|
||||
|
||||
frontend_driver_attach_console();
|
||||
str[0] = '\0';
|
||||
|
||||
fprintf(stderr, "%s: %s -- v%s",
|
||||
@ -473,6 +474,7 @@ static void retroarch_print_version(void)
|
||||
**/
|
||||
static void retroarch_print_help(const char *arg0)
|
||||
{
|
||||
frontend_driver_attach_console();
|
||||
puts("===================================================================");
|
||||
retroarch_print_version();
|
||||
puts("===================================================================");
|
||||
|
@ -814,6 +814,11 @@ static bool content_file_init(
|
||||
|
||||
free(info);
|
||||
}
|
||||
else if (special == NULL)
|
||||
{
|
||||
*error_string = strdup(msg_hash_to_str(MSG_ERROR_LIBRETRO_CORE_REQUIRES_CONTENT));
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -874,7 +879,6 @@ static bool task_load_content(content_ctx_info_t *content_info,
|
||||
|
||||
if (!content_load(content_info))
|
||||
{
|
||||
*error_string = strdup("This core requires a content file, could not load content.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -9,11 +9,14 @@
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QPushButton>
|
||||
#include <QToolButton>
|
||||
|
||||
#include "shaderparamsdialog.h"
|
||||
#include "../ui_qt.h"
|
||||
|
||||
extern "C" {
|
||||
#include <string/stdstring.h>
|
||||
#include "../../../command.h"
|
||||
#ifdef HAVE_MENU
|
||||
#include "../../../menu/menu_shader.h"
|
||||
@ -280,10 +283,103 @@ void ShaderParamsDialog::onScaleComboBoxIndexChanged(int)
|
||||
}
|
||||
}
|
||||
|
||||
void ShaderParamsDialog::onShaderPassMoveDownClicked()
|
||||
{
|
||||
QPushButton *button = qobject_cast<QPushButton*>(sender());
|
||||
QVariant passVariant;
|
||||
struct video_shader *menu_shader = NULL;
|
||||
struct video_shader *video_shader = NULL;
|
||||
int pass = 0;
|
||||
bool ok = false;
|
||||
|
||||
getShaders(&menu_shader, &video_shader);
|
||||
|
||||
if (!button)
|
||||
return;
|
||||
|
||||
passVariant = button->property("pass");
|
||||
|
||||
if (!passVariant.isValid())
|
||||
return;
|
||||
|
||||
pass = passVariant.toInt(&ok);
|
||||
|
||||
if (!ok)
|
||||
return;
|
||||
|
||||
if (pass < 0)
|
||||
return;
|
||||
|
||||
if (video_shader)
|
||||
{
|
||||
if (pass >= static_cast<int>(video_shader->passes) - 1)
|
||||
return;
|
||||
|
||||
std::swap(video_shader->pass[pass], video_shader->pass[pass + 1]);
|
||||
}
|
||||
|
||||
if (menu_shader)
|
||||
{
|
||||
if (pass >= static_cast<int>(menu_shader->passes) - 1)
|
||||
return;
|
||||
|
||||
std::swap(menu_shader->pass[pass], menu_shader->pass[pass + 1]);
|
||||
}
|
||||
|
||||
command_event(CMD_EVENT_SHADERS_APPLY_CHANGES, NULL);
|
||||
}
|
||||
|
||||
void ShaderParamsDialog::onShaderPassMoveUpClicked()
|
||||
{
|
||||
QPushButton *button = qobject_cast<QPushButton*>(sender());
|
||||
QVariant passVariant;
|
||||
struct video_shader *menu_shader = NULL;
|
||||
struct video_shader *video_shader = NULL;
|
||||
int pass = 0;
|
||||
bool ok = false;
|
||||
|
||||
getShaders(&menu_shader, &video_shader);
|
||||
|
||||
if (!button)
|
||||
return;
|
||||
|
||||
passVariant = button->property("pass");
|
||||
|
||||
if (!passVariant.isValid())
|
||||
return;
|
||||
|
||||
pass = passVariant.toInt(&ok);
|
||||
|
||||
if (!ok)
|
||||
return;
|
||||
|
||||
if (pass <= 0)
|
||||
return;
|
||||
|
||||
if (video_shader)
|
||||
{
|
||||
if (pass > static_cast<int>(video_shader->passes) - 1)
|
||||
return;
|
||||
|
||||
std::swap(video_shader->pass[pass - 1], video_shader->pass[pass]);
|
||||
}
|
||||
|
||||
if (menu_shader)
|
||||
{
|
||||
if (pass > static_cast<int>(menu_shader->passes) - 1)
|
||||
return;
|
||||
|
||||
std::swap(menu_shader->pass[pass - 1], menu_shader->pass[pass]);
|
||||
}
|
||||
|
||||
command_event(CMD_EVENT_SHADERS_APPLY_CHANGES, NULL);
|
||||
}
|
||||
|
||||
void ShaderParamsDialog::reload()
|
||||
{
|
||||
struct video_shader *menu_shader = NULL;
|
||||
struct video_shader *video_shader = NULL;
|
||||
const char *shader_path = NULL;
|
||||
int i;
|
||||
unsigned j;
|
||||
|
||||
@ -295,10 +391,24 @@ void ShaderParamsDialog::reload()
|
||||
*/
|
||||
|
||||
if ((video_shader && video_shader->passes == 0) || !video_shader)
|
||||
{
|
||||
setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SHADER_OPTIONS));
|
||||
goto end;
|
||||
}
|
||||
|
||||
clearLayout(m_layout);
|
||||
|
||||
/* Only check video_shader for the path, menu_shader seems stale... e.g. if you remove all the shader passes,
|
||||
* it still has the old path in it, but video_shader does not
|
||||
*/
|
||||
if (!string_is_empty(video_shader->path))
|
||||
{
|
||||
shader_path = video_shader->path;
|
||||
setWindowTitle(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CURRENT_SHADER)) + ": " + QFileInfo(shader_path).fileName());
|
||||
}
|
||||
else
|
||||
setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SHADER_OPTIONS));
|
||||
|
||||
/* NOTE: We assume that parameters are always grouped in order by the pass number, e.g., all parameters for pass 0 come first, then params for pass 1, etc. */
|
||||
for (i = 0; i < static_cast<int>(video_shader->passes); i++)
|
||||
{
|
||||
@ -309,11 +419,33 @@ void ShaderParamsDialog::reload()
|
||||
QHBoxLayout *filterScaleHBoxLayout = NULL;
|
||||
QComboBox *filterComboBox = new QComboBox();
|
||||
QComboBox *scaleComboBox = new QComboBox();
|
||||
QToolButton *moveDownButton = NULL;
|
||||
QToolButton *moveUpButton = NULL;
|
||||
unsigned j = 0;
|
||||
|
||||
filterComboBox->setProperty("pass", i);
|
||||
scaleComboBox->setProperty("pass", i);
|
||||
|
||||
moveDownButton = new QToolButton();
|
||||
moveDownButton->setText("↓");
|
||||
moveDownButton->setProperty("pass", i);
|
||||
|
||||
moveUpButton = new QToolButton();
|
||||
moveUpButton->setText("↑");
|
||||
moveUpButton->setProperty("pass", i);
|
||||
|
||||
/* Can't move down if we're already at the bottom. */
|
||||
if (i < static_cast<int>(video_shader->passes) - 1)
|
||||
connect(moveDownButton, SIGNAL(clicked()), this, SLOT(onShaderPassMoveDownClicked()));
|
||||
else
|
||||
moveDownButton->setDisabled(true);
|
||||
|
||||
/* Can't move up if we're already at the top. */
|
||||
if (i > 0)
|
||||
connect(moveUpButton, SIGNAL(clicked()), this, SLOT(onShaderPassMoveUpClicked()));
|
||||
else
|
||||
moveUpButton->setDisabled(true);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
QString filterLabel = getFilterLabel(j);
|
||||
@ -355,10 +487,18 @@ void ShaderParamsDialog::reload()
|
||||
m_layout->addWidget(groupBox);
|
||||
|
||||
filterScaleHBoxLayout = new QHBoxLayout();
|
||||
filterScaleHBoxLayout->addWidget(new QLabel(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FILTER)));
|
||||
filterScaleHBoxLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Preferred));
|
||||
filterScaleHBoxLayout->addWidget(new QLabel(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FILTER)) + ":"));
|
||||
filterScaleHBoxLayout->addWidget(filterComboBox);
|
||||
filterScaleHBoxLayout->addWidget(new QLabel(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCALE)));
|
||||
filterScaleHBoxLayout->addWidget(new QLabel(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCALE)) + ":"));
|
||||
filterScaleHBoxLayout->addWidget(scaleComboBox);
|
||||
filterScaleHBoxLayout->addSpacerItem(new QSpacerItem(20, 0, QSizePolicy::Preferred, QSizePolicy::Preferred));
|
||||
|
||||
if (moveUpButton)
|
||||
filterScaleHBoxLayout->addWidget(moveUpButton);
|
||||
|
||||
if (moveDownButton)
|
||||
filterScaleHBoxLayout->addWidget(moveDownButton);
|
||||
|
||||
form->addRow("", filterScaleHBoxLayout);
|
||||
|
||||
@ -392,7 +532,7 @@ void ShaderParamsDialog::addShaderParam(struct video_shader_parameter *param, in
|
||||
/* option is basically a bool, so use a checkbox */
|
||||
QCheckBox *checkBox = new QCheckBox(this);
|
||||
checkBox->setChecked(param->current == param->maximum ? true : false);
|
||||
checkBox->setProperty("pass", param->pass);
|
||||
checkBox->setProperty("param", parameter);
|
||||
|
||||
connect(checkBox, SIGNAL(clicked()), this, SLOT(onShaderParamCheckBoxClicked()));
|
||||
|
||||
@ -463,7 +603,7 @@ void ShaderParamsDialog::onShaderParamCheckBoxClicked()
|
||||
if (menu_shader && menu_shader->passes == 0)
|
||||
return;
|
||||
|
||||
paramVariant = checkBox->property("parameter");
|
||||
paramVariant = checkBox->property("param");
|
||||
|
||||
if (paramVariant.isValid())
|
||||
{
|
||||
@ -570,7 +710,6 @@ void ShaderParamsDialog::onShaderParamSpinBoxValueChanged(int value)
|
||||
QSlider *slider = NULL;
|
||||
struct video_shader *menu_shader = NULL;
|
||||
struct video_shader *video_shader = NULL;
|
||||
double newValue = 0.0;
|
||||
|
||||
getShaders(&menu_shader, &video_shader);
|
||||
|
||||
@ -596,6 +735,8 @@ void ShaderParamsDialog::onShaderParamSpinBoxValueChanged(int value)
|
||||
|
||||
if (ok)
|
||||
{
|
||||
double newValue = 0.0;
|
||||
|
||||
if (menu_shader)
|
||||
{
|
||||
struct video_shader_parameter *param = &menu_shader->parameters[parameter];
|
||||
@ -627,8 +768,10 @@ void ShaderParamsDialog::onShaderParamDoubleSpinBoxValueChanged(double value)
|
||||
QVariant sliderVariant;
|
||||
QVariant paramVariant;
|
||||
QSlider *slider = NULL;
|
||||
struct video_shader_parameter *param = NULL;
|
||||
double newValue = 0.0;
|
||||
struct video_shader *menu_shader = NULL;
|
||||
struct video_shader *video_shader = NULL;
|
||||
|
||||
getShaders(&menu_shader, &video_shader);
|
||||
|
||||
if (!doubleSpinBox)
|
||||
return;
|
||||
@ -647,15 +790,34 @@ void ShaderParamsDialog::onShaderParamDoubleSpinBoxValueChanged(double value)
|
||||
|
||||
if (paramVariant.isValid())
|
||||
{
|
||||
param = paramVariant.value<struct video_shader_parameter*>();
|
||||
bool ok = false;
|
||||
int parameter = paramVariant.toInt(&ok);
|
||||
|
||||
if (param)
|
||||
if (ok)
|
||||
{
|
||||
param->current = value;
|
||||
newValue = MainWindow::lerp(param->minimum, param->maximum, 0, 100, param->current);
|
||||
slider->blockSignals(true);
|
||||
slider->setValue(newValue);
|
||||
slider->blockSignals(false);
|
||||
double newValue = 0.0;
|
||||
|
||||
if (menu_shader)
|
||||
{
|
||||
struct video_shader_parameter *param = &menu_shader->parameters[parameter];
|
||||
|
||||
param->current = value;
|
||||
newValue = MainWindow::lerp(param->minimum, param->maximum, 0, 100, param->current);
|
||||
slider->blockSignals(true);
|
||||
slider->setValue(newValue);
|
||||
slider->blockSignals(false);
|
||||
}
|
||||
|
||||
if (video_shader)
|
||||
{
|
||||
struct video_shader_parameter *param = &video_shader->parameters[parameter];
|
||||
|
||||
param->current = value;
|
||||
newValue = MainWindow::lerp(param->minimum, param->maximum, 0, 100, param->current);
|
||||
slider->blockSignals(true);
|
||||
slider->setValue(newValue);
|
||||
slider->blockSignals(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,8 @@ private slots:
|
||||
void onShaderParamDoubleSpinBoxValueChanged(double value);
|
||||
void onFilterComboBoxIndexChanged(int index);
|
||||
void onScaleComboBoxIndexChanged(int index);
|
||||
void onShaderPassMoveDownClicked();
|
||||
void onShaderPassMoveUpClicked();
|
||||
private:
|
||||
QString getFilterLabel(unsigned filter);
|
||||
void addShaderParam(struct video_shader_parameter *param, int parameter, QFormLayout *form);
|
||||
|
@ -223,7 +223,6 @@ CoreInfoWidget::CoreInfoWidget(CoreInfoLabel *label, QWidget *parent) :
|
||||
,m_label(label)
|
||||
,m_scrollArea(new QScrollArea(this))
|
||||
{
|
||||
//m_scrollArea->setFrameShape(QFrame::NoFrame);
|
||||
m_scrollArea->setWidgetResizable(true);
|
||||
m_scrollArea->setWidget(m_label);
|
||||
}
|
||||
@ -601,7 +600,6 @@ void MainWindow::onGridItemClicked(ThumbnailWidget *widget)
|
||||
if (m_currentGridWidget)
|
||||
{
|
||||
m_currentGridWidget->setObjectName("thumbnailWidget");
|
||||
//m_currentGridWidget->setFrameStyle(QFrame::Plain);
|
||||
m_currentGridWidget->style()->unpolish(m_currentGridWidget);
|
||||
m_currentGridWidget->style()->polish(m_currentGridWidget);
|
||||
}
|
||||
|
@ -214,8 +214,8 @@ void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap)
|
||||
void RARCH_LOG_BUFFER(uint8_t *data, size_t size)
|
||||
{
|
||||
unsigned i, offset;
|
||||
int padding = size % 16;
|
||||
uint8_t buf[16];
|
||||
int padding = size % 16;
|
||||
uint8_t buf[16] = {0};
|
||||
|
||||
RARCH_LOG("== %d-byte buffer ==================\n", size);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user