Andras Eisenberger avatar Andras Eisenberger committed e4b1143

Have resolution configurable from Frontier.ini

Comments (0)

Files changed (4)

Terrain/Avatar.cpp

   return anim_id;
 }
 
-void AvatarInit (void)		
+void AvatarInit (void)
 {
 
   desired_cam_distance = IniFloat ("Avatar", "CameraDistance");
 
 }
 
-void AvatarPositionSet (GLvector new_pos)		
+void AvatarPositionSet (GLvector new_pos)
 {
 
   new_pos.z = clamp (new_pos.z, -25.0f, 2048.0f);

Terrain/Frontier.ini

 ShaderNormal=standard.cg
 ShaderTrees=trees.cg
 standard=
+ResolutionX=1600
+ResolutionY=900

Terrain/Render.cpp

   glMatrixMode (GL_PROJECTION);
   glPushMatrix ();
   glLoadIdentity ();
-  glOrtho (left, right, bottom, top, 0.1f, 2048);
+  glOrtho (left, right, bottom, top, 0.1f, 1024.0f);
   glMatrixMode (GL_MODELVIEW);
   glPushMatrix ();
   glLoadIdentity();
 
 }
 
-void RenderInit  (void)		
+void RenderInit (void)
 {
 
   current_ambient = glRgba (0.0f);
 
 #include "Avatar.h"
 #include "Console.h"
+#include "Ini.h"
 #include "Input.h"
 #include "Main.h"
 #include "Render.h"
   }
   SDL_WM_SetIcon (SDL_LoadBMP("Textures/f.bmp"), NULL);
   SDL_WM_SetCaption ("", "");
-  RenderCreate (1600, 900, 32, false);
+  RenderCreate (IniInt ("Settings", "ResolutionX"), IniInt ("Settings", "ResolutionY"), 32, false);
   //RenderCreate (1920, 1200, 32, true);
   //Here we initialize SDL as we would do with any SDL application.
   SDL_Init(SDL_INIT_VIDEO);
   SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
   /*
   if (!screen) {
-	  Log ("Unable to set video mode: %s\n", SDL_GetError());
-  	return false;
+    Log ("Unable to set video mode: %s\n", SDL_GetError());
+    return false;
   }
   return true;
   */
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.