CS: Add rendering prefs and camera FOV

0.6.1-openmw-updates^2
Miloslav Číž 7 years ago
parent 36f4f0ef85
commit 360d786ff2

@ -192,6 +192,9 @@ void CSMPrefs::State::declare()
setRange (0.001, 100.0); setRange (0.001, 100.0);
declareDouble ("rotate-factor", "Free rotation factor", 0.007).setPrecision(4).setRange(0.0001, 0.1); declareDouble ("rotate-factor", "Free rotation factor", 0.007).setPrecision(4).setRange(0.0001, 0.1);
declareCategory ("Rendering");
declareDouble ("camera-fov", "Camera FOV", 90.).setPrecision(5).setRange(10.0, 160.0);
declareCategory ("Tooltips"); declareCategory ("Tooltips");
declareBool ("scene", "Show Tooltips in 3D scenes", true); declareBool ("scene", "Show Tooltips in 3D scenes", true);
declareBool ("scene-hide-basic", "Hide basic 3D scenes tooltips", false); declareBool ("scene-hide-basic", "Hide basic 3D scenes tooltips", false);

@ -84,7 +84,6 @@ CSVPrefs::Dialogue::~Dialogue()
void CSVPrefs::Dialogue::closeEvent (QCloseEvent *event) void CSVPrefs::Dialogue::closeEvent (QCloseEvent *event)
{ {
QMainWindow::closeEvent (event); QMainWindow::closeEvent (event);
CSMPrefs::State::get().save(); CSMPrefs::State::get().save();
} }

@ -66,7 +66,11 @@ RenderWidget::RenderWidget(QWidget *parent, Qt::WindowFlags f)
mView->getCamera()->setGraphicsContext(window); mView->getCamera()->setGraphicsContext(window);
mView->getCamera()->setClearColor( osg::Vec4(0.2, 0.2, 0.6, 1.0) ); mView->getCamera()->setClearColor( osg::Vec4(0.2, 0.2, 0.6, 1.0) );
mView->getCamera()->setViewport( new osg::Viewport(0, 0, traits->width, traits->height) ); mView->getCamera()->setViewport( new osg::Viewport(0, 0, traits->width, traits->height) );
mView->getCamera()->setProjectionMatrixAsPerspective(30.0f, static_cast<double>(traits->width)/static_cast<double>(traits->height), 1.0f, 10000.0f );
mView->getCamera()->setProjectionMatrixAsPerspective(
CSMPrefs::get()["Rendering"]["camera-fov"].toDouble(),
static_cast<double>(traits->width)/static_cast<double>(traits->height),
1.0f, 10000.0f);
SceneUtil::LightManager* lightMgr = new SceneUtil::LightManager; SceneUtil::LightManager* lightMgr = new SceneUtil::LightManager;
lightMgr->setStartLight(1); lightMgr->setStartLight(1);

Loading…
Cancel
Save