diff --git a/common/lc_model.cpp b/common/lc_model.cpp index d55fe1f1..62e7c102 100644 --- a/common/lc_model.cpp +++ b/common/lc_model.cpp @@ -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) { diff --git a/common/lc_model.h b/common/lc_model.h index a0452129..80a64234 100644 --- a/common/lc_model.h +++ b/common/lc_model.h @@ -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; }; diff --git a/common/lc_profile.cpp b/common/lc_profile.cpp index a11bab06..5f19cab9 100644 --- a/common/lc_profile.cpp +++ b/common/lc_profile.cpp @@ -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 diff --git a/common/lc_profile.h b/common/lc_profile.h index e4693115..f4e0fe02 100644 --- a/common/lc_profile.h +++ b/common/lc_profile.h @@ -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, diff --git a/common/project.cpp b/common/project.cpp index 4e13d7dd..aa50e941 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -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++) { diff --git a/common/project.h b/common/project.h index 795a12d9..d3b4dd03 100644 --- a/common/project.h +++ b/common/project.h @@ -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 diff --git a/common/view.cpp b/common/view.cpp index 2a770e9c..d16f01da 100644 --- a/common/view.cpp +++ b/common/view.cpp @@ -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); diff --git a/qt/lc_qpropertiesdialog.cpp b/qt/lc_qpropertiesdialog.cpp index 3fb209c9..412a9906 100644 --- a/qt/lc_qpropertiesdialog.cpp +++ b/qt/lc_qpropertiesdialog.cpp @@ -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; diff --git a/qt/lc_qpropertiesdialog.ui b/qt/lc_qpropertiesdialog.ui index 8e0f0c64..51c05899 100644 --- a/qt/lc_qpropertiesdialog.ui +++ b/qt/lc_qpropertiesdialog.ui @@ -7,7 +7,7 @@ 0 0 500 - 362 + 442 @@ -17,7 +17,7 @@ - 0 + 1 @@ -105,7 +105,7 @@ - Solid Color + So&lid Color @@ -119,7 +119,7 @@ - Gradient + &Gradient @@ -178,61 +178,13 @@ - - - Fog - - - - - - - - - - - - - - - - Density - - - - - - - - 75 - 16777215 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - Ambient Light - + @@ -257,8 +209,6 @@ - label_20 - fogCheckBox @@ -335,9 +285,6 @@ imageNameEdit imageNameButton imageTileCheckBox - fogCheckBox - fogColorButton - fogDensityEdit ambientColorButton setDefaultCheckBox partsTable