Camera is now stored to configuration so it is preserved across program shutdown. I don't know how significant this is but eh

Fri, 03 May 2013 18:30:38 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Fri, 03 May 2013 18:30:38 +0300
changeset 152
552e46650a95
parent 151
15fe6c51de54
child 153
03a7bdcce50d

Camera is now stored to configuration so it is preserved across program shutdown. I don't know how significant this is but eh

gldraw.cpp file | annotate | diff | comparison | revisions
gldraw.h file | annotate | diff | comparison | revisions
--- a/gldraw.cpp	Fri May 03 18:14:18 2013 +0300
+++ b/gldraw.cpp	Fri May 03 18:30:38 2013 +0300
@@ -54,6 +54,7 @@
 cfg (int, gl_linethickness, 2);
 cfg (bool, gl_colorbfc, true);
 cfg (bool, gl_selflash, false);
+cfg (int, gl_camera, GLRenderer::Free);
 
 struct CameraIcon {
 	QPixmap* img;
@@ -79,7 +80,7 @@
 GLRenderer::GLRenderer (QWidget* parent) : QGLWidget (parent) {
 	resetAngles ();
 	picking = rangepick = false;
-	m_camera = Free;
+	m_camera = (GLRenderer::Camera) gl_camera.value;
 	drawToolTip = false;
 	
 	pulseTimer = new QTimer (this);
@@ -750,6 +751,12 @@
 }
 
 // =============================================================================
+void GLRenderer::setCamera (const GLRenderer::Camera cam) {
+	m_camera = cam;
+	gl_camera = (int) cam;
+}
+
+// =============================================================================
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 // =============================================================================
 void GLRenderer::updateSelFlash () {
--- a/gldraw.h	Fri May 03 18:14:18 2013 +0300
+++ b/gldraw.h	Fri May 03 18:30:38 2013 +0300
@@ -60,7 +60,7 @@
 	uchar* screencap (ushort& w, ushort& h);
 	
 	GLRenderer::Camera camera () { return m_camera; }
-	void setCamera (const GLRenderer::Camera cam) { m_camera = cam; }
+	void setCamera (const GLRenderer::Camera cam);
 	
 	bool picking;
 	short width, height;

mercurial