Removed fog options.

This commit is contained in:
leozide
2017-04-21 14:17:03 -07:00
parent a219c281f2
commit 8da318037d
9 changed files with 7 additions and 164 deletions
+1 -23
View File
@@ -33,9 +33,6 @@ void lcModelProperties::LoadDefaults()
mBackgroundImage = lcGetProfileString(LC_PROFILE_DEFAULT_BACKGROUND_TEXTURE);
mBackgroundImageTile = lcGetProfileInt(LC_PROFILE_DEFAULT_BACKGROUND_TILE);
mFogEnabled = lcGetProfileInt(LC_PROFILE_DEFAULT_FOG_ENABLED);
mFogDensity = lcGetProfileFloat(LC_PROFILE_DEFAULT_FOG_DENSITY);
mFogColor = lcVector3FromColor(lcGetProfileInt(LC_PROFILE_DEFAULT_FOG_COLOR));
mAmbientColor = lcVector3FromColor(lcGetProfileInt(LC_PROFILE_DEFAULT_AMBIENT_COLOR));
}
@@ -48,9 +45,6 @@ void lcModelProperties::SaveDefaults()
lcSetProfileString(LC_PROFILE_DEFAULT_BACKGROUND_TEXTURE, mBackgroundImage);
lcSetProfileInt(LC_PROFILE_DEFAULT_BACKGROUND_TILE, mBackgroundImageTile);
lcSetProfileInt(LC_PROFILE_DEFAULT_FOG_ENABLED, mFogEnabled);
lcSetProfileFloat(LC_PROFILE_DEFAULT_FOG_DENSITY, mFogDensity);
lcSetProfileInt(LC_PROFILE_DEFAULT_FOG_COLOR, lcColorFromVector3(mFogColor));
lcSetProfileInt(LC_PROFILE_DEFAULT_AMBIENT_COLOR, lcColorFromVector3(mAmbientColor));
}
@@ -97,9 +91,6 @@ void lcModelProperties::SaveLDraw(QTextStream& Stream) const
break;
}
// bool mFogEnabled;
// float mFogDensity;
// lcVector3 mFogColor;
// lcVector3 mAmbientColor;
}
@@ -891,20 +882,7 @@ bool lcModel::LoadBinary(lcFile* file)
if (fv >= 0.7f)
{
file->Seek(16, SEEK_CUR);
file->ReadU32(&rgb, 1);
mProperties.mFogColor[0] = (float)((unsigned char) (rgb))/255;
mProperties.mFogColor[1] = (float)((unsigned char) (((unsigned short) (rgb)) >> 8))/255;
mProperties.mFogColor[2] = (float)((unsigned char) ((rgb) >> 16))/255;
if (fv < 1.0f)
{
file->ReadU32(&rgb, 1);
mProperties.mFogDensity = (float)rgb/100;
}
else
file->ReadFloats(&mProperties.mFogDensity, 1);
file->Seek(24, SEEK_CUR);
if (fv < 1.3f)
{
+1 -5
View File
@@ -53,8 +53,7 @@ public:
mBackgroundImage != Properties.mBackgroundImage || mBackgroundImageTile != Properties.mBackgroundImageTile)
return false;
if (mFogEnabled != Properties.mFogEnabled || mFogDensity != Properties.mFogDensity ||
mFogColor != Properties.mFogColor || mAmbientColor != Properties.mAmbientColor)
if (mAmbientColor != Properties.mAmbientColor)
return false;
return true;
@@ -75,9 +74,6 @@ public:
QString mBackgroundImage;
bool mBackgroundImageTile;
bool mFogEnabled;
float mFogDensity;
lcVector3 mFogColor;
lcVector3 mAmbientColor;
};
-3
View File
@@ -92,9 +92,6 @@ lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] =
lcProfileEntry("Defaults", "Author", ""), // LC_PROFILE_DEFAULT_AUTHOR_NAME
lcProfileEntry("Defaults", "FloorColor", LC_RGB(0, 191, 0)), // LC_PROFILE_DEFAULT_FLOOR_COLOR
lcProfileEntry("Defaults", "FloorTexture", ""), // LC_PROFILE_DEFAULT_FLOOR_TEXTURE
lcProfileEntry("Defaults", "FogEnabled", 0), // LC_PROFILE_DEFAULT_FOG_ENABLED
lcProfileEntry("Defaults", "FogDensity", 0.1f), // LC_PROFILE_DEFAULT_FOG_DENSITY
lcProfileEntry("Defaults", "FogColor", LC_RGB(255, 255, 255)), // LC_PROFILE_DEFAULT_FOG_COLOR
lcProfileEntry("Defaults", "AmbientColor", LC_RGB(75, 75, 75)), // LC_PROFILE_DEFAULT_AMBIENT_COLOR
lcProfileEntry("Defaults", "BackgroundType", LC_BACKGROUND_SOLID), // LC_PROFILE_DEFAULT_BACKGROUND_TYPE
lcProfileEntry("Defaults", "BackgroundColor", LC_RGB(255, 255, 255)), // LC_PROFILE_DEFAULT_BACKGROUND_COLOR
-3
View File
@@ -42,9 +42,6 @@ enum LC_PROFILE_KEY
LC_PROFILE_DEFAULT_AUTHOR_NAME,
LC_PROFILE_DEFAULT_FLOOR_COLOR,
LC_PROFILE_DEFAULT_FLOOR_TEXTURE,
LC_PROFILE_DEFAULT_FOG_ENABLED,
LC_PROFILE_DEFAULT_FOG_DENSITY,
LC_PROFILE_DEFAULT_FOG_COLOR,
LC_PROFILE_DEFAULT_AMBIENT_COLOR,
LC_PROFILE_DEFAULT_BACKGROUND_TYPE,
LC_PROFILE_DEFAULT_BACKGROUND_COLOR,
-40
View File
@@ -720,46 +720,6 @@ void Project::Export3DStudio(const QString& FileName)
File.WriteU32(6);
}
File.WriteU16(0x2200); // CHK_FOG
File.WriteU32(46);
File.WriteFloat(0.0f);
File.WriteFloat(0.0f);
File.WriteFloat(1000.0f);
File.WriteFloat(100.0f);
File.WriteU16(0x0010); // CHK_COLOR_F
File.WriteU32(18);
File.WriteFloats(Properties.mFogColor, 3);
File.WriteU16(0x2210); // CHK_FOG_BGND
File.WriteU32(6);
File.WriteU16(0x2302); // CHK_LAYER_FOG
File.WriteU32(40);
File.WriteFloat(0.0f);
File.WriteFloat(100.0f);
File.WriteFloat(50.0f);
File.WriteU32(0x00100000);
File.WriteU16(0x0010); // CHK_COLOR_F
File.WriteU32(18);
File.WriteFloats(Properties.mFogColor, 3);
File.WriteU16(0x2300); // CHK_DISTANCE_CUE
File.WriteU32(28);
File.WriteFloat(0.0f);
File.WriteFloat(0.0f);
File.WriteFloat(1000.0f);
File.WriteFloat(100.0f);
File.WriteU16(0x2310); // CHK_DICHK_DCUE_BGNDSTANCE_CUE
File.WriteU32(6);
int NumPieces = 0;
for (int PartIdx = 0; PartIdx < ModelParts.GetSize(); PartIdx++)
{
-1
View File
@@ -5,7 +5,6 @@
#include "lc_array.h"
#include "lc_application.h"
#define LC_SCENE_FOG 0x004 // Enable fog
#define LC_SCENE_BG 0x010 // Draw bg image
#define LC_SCENE_BG_TILE 0x040 // Tile bg image
#define LC_SCENE_GRADIENT 0x100 // Draw gradient
-17
View File
@@ -568,27 +568,10 @@ void View::OnDraw()
mContext->SetProjectionMatrix(GetProjectionMatrix());
#ifndef LC_OPENGLES
const lcModelProperties& Properties = mModel->GetProperties();
if (Properties.mFogEnabled)
{
glFogi(GL_FOG_MODE, GL_EXP);
glFogf(GL_FOG_DENSITY, Properties.mFogDensity);
glFogfv(GL_FOG_COLOR, lcVector4(Properties.mFogColor, 1.0f));
glEnable(GL_FOG);
}
#endif
mContext->SetLineWidth(Preferences.mLineWidth);
mScene.Draw(mContext);
#ifndef LC_OPENGLES
if (Properties.mFogEnabled)
glDisable(GL_FOG);
#endif
if (DrawInterface)
{
mScene.DrawInterfaceObjects(mContext);
-14
View File
@@ -13,12 +13,9 @@ lcQPropertiesDialog::lcQPropertiesDialog(QWidget *parent, void *data) :
{
ui->setupUi(this);
ui->fogDensityEdit->setValidator(new QDoubleValidator(ui->fogDensityEdit));
connect(ui->solidColorButton, SIGNAL(clicked()), this, SLOT(colorClicked()));
connect(ui->gradient1ColorButton, SIGNAL(clicked()), this, SLOT(colorClicked()));
connect(ui->gradient2ColorButton, SIGNAL(clicked()), this, SLOT(colorClicked()));
connect(ui->fogColorButton, SIGNAL(clicked()), this, SLOT(colorClicked()));
connect(ui->ambientColorButton, SIGNAL(clicked()), this, SLOT(colorClicked()));
options = (lcPropertiesDialogOptions*)data;
@@ -38,8 +35,6 @@ lcQPropertiesDialog::lcQPropertiesDialog(QWidget *parent, void *data) :
ui->imageNameEdit->setText(options->Properties.mBackgroundImage);
ui->imageTileCheckBox->setChecked(options->Properties.mBackgroundImageTile);
ui->fogCheckBox->setChecked(options->Properties.mFogEnabled);
ui->fogDensityEdit->setText(lcFormatValueLocalized(options->Properties.mFogDensity));
QPixmap pix(12, 12);
@@ -49,8 +44,6 @@ lcQPropertiesDialog::lcQPropertiesDialog(QWidget *parent, void *data) :
ui->gradient1ColorButton->setIcon(pix);
pix.fill(QColor(options->Properties.mBackgroundGradientColor2[0] * 255, options->Properties.mBackgroundGradientColor2[1] * 255, options->Properties.mBackgroundGradientColor2[2] * 255));
ui->gradient2ColorButton->setIcon(pix);
pix.fill(QColor(options->Properties.mFogColor[0] * 255, options->Properties.mFogColor[1] * 255, options->Properties.mFogColor[2] * 255));
ui->fogColorButton->setIcon(pix);
pix.fill(QColor(options->Properties.mAmbientColor[0] * 255, options->Properties.mAmbientColor[1] * 255, options->Properties.mAmbientColor[2] * 255));
ui->ambientColorButton->setIcon(pix);
@@ -156,8 +149,6 @@ void lcQPropertiesDialog::accept()
options->Properties.mBackgroundImage = ui->imageNameEdit->text();
options->Properties.mBackgroundImageTile = ui->imageTileCheckBox->isChecked();
options->Properties.mFogEnabled = ui->fogCheckBox->isChecked();
options->Properties.mFogDensity = lcParseValueLocalized(ui->fogDensityEdit->text());
options->SetDefault = ui->setDefaultCheckBox->isChecked();
QDialog::accept();
@@ -184,11 +175,6 @@ void lcQPropertiesDialog::colorClicked()
color = options->Properties.mBackgroundGradientColor2;
title = tr("Select Background Bottom Color");
}
else if (button == ui->fogColorButton)
{
color = options->Properties.mFogColor;
title = tr("Select Fog Color");
}
else if (button == ui->ambientColorButton)
{
color = options->Properties.mAmbientColor;
+5 -58
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>500</width>
<height>362</height>
<height>442</height>
</rect>
</property>
<property name="windowTitle">
@@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tabSummary">
<attribute name="title">
@@ -105,7 +105,7 @@
<item row="0" column="0">
<widget class="QRadioButton" name="solidRadio">
<property name="text">
<string>Solid Color</string>
<string>So&amp;lid Color</string>
</property>
</widget>
</item>
@@ -119,7 +119,7 @@
<item row="1" column="0">
<widget class="QRadioButton" name="gradientRadio">
<property name="text">
<string>Gradient</string>
<string>&amp;Gradient</string>
</property>
</widget>
</item>
@@ -178,61 +178,13 @@
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="fogCheckBox">
<property name="text">
<string>Fog</string>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QToolButton" name="fogColorButton">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_19">
<property name="text">
<string>Density</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fogDensityEdit">
<property name="maximumSize">
<size>
<width>75</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
<string>Ambient Light</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QToolButton" name="ambientColorButton">
@@ -257,8 +209,6 @@
</layout>
</item>
</layout>
<zorder>label_20</zorder>
<zorder>fogCheckBox</zorder>
</widget>
</item>
<item>
@@ -335,9 +285,6 @@
<tabstop>imageNameEdit</tabstop>
<tabstop>imageNameButton</tabstop>
<tabstop>imageTileCheckBox</tabstop>
<tabstop>fogCheckBox</tabstop>
<tabstop>fogColorButton</tabstop>
<tabstop>fogDensityEdit</tabstop>
<tabstop>ambientColorButton</tabstop>
<tabstop>setDefaultCheckBox</tabstop>
<tabstop>partsTable</tabstop>