Code review changes

This commit is contained in:
vincent 2013-04-10 08:28:26 +02:00
parent 4f41aab89a
commit bb380e841e
9 changed files with 58 additions and 70 deletions

View file

@ -6,7 +6,6 @@
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
//
#include "InterfaceConfig.h"
#include "FieldOfView.h"
#include "Stars.h"

View file

@ -137,7 +137,7 @@ namespace starfield {
// ww + ww aa = dd
// ww = dd / (1 + aa)
float diag = 2.0f * std::sin(halfPersp);
float near2 = std::cos(halfPersp);
float nearClip = std::cos(halfPersp);
float hw = 0.5f * sqrt(diag * diag / (1.0f + aspect * aspect));
float hh = hw * aspect;
@ -165,11 +165,11 @@ namespace starfield {
#if STARFIELD_DEBUG_LOD
mat4 matrix_debug = glm::translate(
glm::frustum(-hw,hw, -hh,hh, near2,10.0f),
glm::frustum(-hw, hw, -hh, hh, nearClip, 10.0f),
vec3(0.0f, 0.0f, -4.0f)) * glm::affineInverse(matrix);
#endif
matrix = glm::frustum(-hw,hw, -hh,hh, near2,10.0f)
matrix = glm::frustum(-hw,hw, -hh,hh, nearClip,10.0f)
* glm::affineInverse(matrix);
this->_itrOutIndex = (unsigned*) _arrBatchOffs;
@ -374,11 +374,11 @@ namespace starfield {
float halfSlice = 0.5f * slice;
float daz = halfSlice * cos(abs(altitude) - halfSlice);
float dal = halfSlice;
float near2 = cos(_valHalfPersp + sqrt(daz*daz+dal*dal));
float nearClip = cos(_valHalfPersp + sqrt(daz * daz + dal * dal));
// fprintf(stderr, "Stars.cpp: checking tile #%d, w = %f, near = %f\n", i, w, near2);
// fprintf(stderr, "Stars.cpp: checking tile #%d, w = %f, near = %f\n", i, w, nearClip);
return w > near2;
return w > nearClip;
}
void updateVertexCount(Tile* t, BrightnessLevel minBright) {

View file

@ -1,5 +1,5 @@
//
// starfield/renderer/Tiling.h
// starfield/renderer/
// interface
//
// Created by Tobias Schwinger on 3/22/13.
@ -18,13 +18,9 @@
#define lrint(x) (floor(x + (x > 0) ? 0.5 : -0.5))
inline float remainder(float x, float y) { return std::fmod(x, y); }
inline int round(float x) { return (floor(x + 0.5)); }
double log2( double n )
{
// log(n)/log(2) is log2.
return log( n ) / log( 2 );
}
double log2( double n ) { return log( n ) / log( 2 ); }
#else
#include "../starfield/Config.h"
#include "starfield/Config.h"
#endif
namespace starfield {

View file

@ -13,12 +13,10 @@ set(EXTERNAL_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external)
if (WIN32)
# include headers for external libraries and InterfaceConfig.
include_directories(
${EXTERNAL_ROOT_DIR}
)
include_directories(${EXTERNAL_ROOT_DIR})
endif (WIN32)
if (NOT WIN32)
if (NOT WIN32)
find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIRS})
# link target to common, external libraries

View file

@ -11,7 +11,6 @@
#include "PerfStat.h"
#include <cstdio>
#include <string>
#include <map>

View file

@ -1,8 +1,6 @@
#ifdef _WIN32
#include <windows.h>
#define _timeval_
#include "Systime.h"
int gettimeofday( timeval* p_tv, timezone* p_tz )
@ -13,5 +11,4 @@ int gettimeofday( timeval* p_tv, timezone* p_tz )
p_tv->tv_usec = tt % 1000 * 1000;
return 0;
}
#endif

View file

@ -18,7 +18,6 @@
size_t const UrlReader::max_read_ahead = CURL_MAX_WRITE_SIZE;
#else
size_t const UrlReader::max_read_ahead = 0;
#endif
char const* const UrlReader::success = "UrlReader: Success!";