Beispiel #1
0
void TextureLumpArea::onHeightChanged(wxCommandEvent &event)
{
	if (entry_texheight->GetValue() != _T(""))
	{
		textures[list_textures->GetSelection()].height = atoi(entry_texheight->GetValue().c_str());
		ta_texture->Refresh();
		ta_texture->Update();
		updateScaleLabel();
		change = true;
	}
}
FilterConfig::FilterConfig(QWidget *parent, int filterType, int scaleCount, float scaleFactor, int orientationCount) :
    QDialog(parent),
    ui(new Ui::FilterConfig)
{
    ui->setupUi(this);
    ui->filterTypeComboBox->setCurrentIndex(filterType);
    ui->scaleSlider->setValue(scaleCount);
    updateScaleLabel(scaleCount);
    ui->scaleFactorSlider->setValue(scaleFactor * 100);
    updateScaleFactorLabel(scaleFactor * 100);
    ui->orientationSlider->setValue(orientationCount);
    updateOrientationLabel(orientationCount);
}
Beispiel #3
0
void TextureLumpArea::onYScaleChanged(wxCommandEvent &event)
{
	int sel = list_textures->GetSelection();
	if (sel == -1)
		return;

	if (entry_yscale->GetValue() == _T(""))
		textures[sel].y_scale = 0;
	else
	{
		int temp = atoi(entry_yscale->GetValue().ToAscii());

		if (temp > 255)
			temp = 255;
		if (temp < 0)
			temp = 0;

		textures[sel].y_scale = temp;
	}

	updateScaleLabel();
	change = true;
}
Beispiel #4
0
void TextureLumpArea::onTextureListChange(wxCommandEvent &event)
{
	list_patches->Clear();

	texture_t *tex = &textures[list_textures->GetSelection()];

	ta_texture->setTexture(tex);
	ta_texture->selPatch(-1);
	ta_texture->Refresh();
	ta_texture->Update();

	bool exchange = change;
	entry_texwidth->SetValue(wxString::Format(_T("%d"), tex->width));
	entry_texheight->SetValue(wxString::Format(_T("%d"), tex->height));

	for (int a = 0; a < tex->patches.size(); a++)
		list_patches->Append(tex->patches[a].patch);

	updateScaleLabel();
	entry_xscale->SetValue(wxString::Format(_T("%d"), tex->x_scale));
	entry_yscale->SetValue(wxString::Format(_T("%d"), tex->y_scale));

	change = exchange;
}