- Timestamp:
- 05/16/15 23:12:22 (10 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/core/array2d.hh
r365 r367 320 320 if ( dest_start_x + min(size_x, source.m_size.x - source_start_x) > m_size.x || dest_start_y + min(size_y, source.m_size.y - source_start_y) > m_size.y ) 321 321 { 322 NV_LOG_WARNING( "set_sub_array: Source area does not fit in the destination area. Data will be truncated." );322 //NV_LOG_WARNING( "set_sub_array: Source area does not fit in the destination area. Data will be truncated." ); 323 323 } 324 324 -
trunk/nv/core/math.hh
r350 r367 18 18 #include <glm/glm.hpp> 19 19 #include <glm/gtc/matrix_transform.hpp> 20 #include <glm/gtc/matrix_access.hpp> 20 21 #include <glm/gtc/type_ptr.hpp> 21 22 #include <glm/gtc/quaternion.hpp> 23 #include <glm/gtx/rotate_vector.hpp> 24 #include <glm/gtx/vector_angle.hpp> 22 25 23 26 namespace nv -
trunk/nv/core/string.hh
r365 r367 281 281 } 282 282 283 #if NV_COMPILER == NV_GNUC 284 template< typename T > 285 struct string_length : public detail::string_length_impl < 286 typename std::remove_cv < typename std::remove_reference< T >::type >::type > 287 { 288 }; 289 #else 283 290 template< typename T > 284 291 using string_length = detail::string_length_impl < 285 292 typename std::remove_cv < typename std::remove_reference< T >::type >::type >; 293 #endif 286 294 287 295 class string_ref; … … 473 481 474 482 // Non-literal constructors 475 template< typename U , typename std::enable_if<std::is_same<U, const char*>::value>::type* = nullptr>476 inline string_ref( U str ) : string_base( str, std::strlen( str ) ) {}483 template< typename U > 484 inline string_ref( U str, typename std::enable_if<std::is_same<U, const char*>::value>::type* = nullptr ) : string_base( str, std::strlen( str ) ) {} 477 485 478 486 // Non-literal constructors 479 template< typename U , typename std::enable_if<std::is_same<U, char*>::value>::type* = nullptr>480 inline string_ref( U str ) : string_base( str, std::strlen( str ) ) {}487 template< typename U > 488 inline string_ref( U str, typename std::enable_if<std::is_same<U, char*>::value>::type* = nullptr ) : string_base( str, std::strlen( str ) ) {} 481 489 482 490 inline string_ref& operator=( const string_ref &rhs ) -
trunk/nv/gfx/animation.hh
r323 r367 16 16 #include <nv/interface/interpolation_template.hh> 17 17 #include <nv/core/transform.hh> 18 #include <glm/gtc/matrix_transform.hpp>19 18 20 19 namespace nv -
trunk/nv/lua/lua_raw.hh
r319 r367 8 8 9 9 #include <nv/core/common.hh> 10 #include <nv/core/array.hh> 10 11 #include <nv/lib/lua.hh> 11 #include <istream>12 #include <string>13 #include <vector>14 #include <map>15 12 16 13 void nlua_toflags_set( lua_State *L, int index, nv::uint8* data, nv::uint32 count ); -
trunk/nv/lua/lua_state.hh
r361 r367 15 15 #include <nv/core/flags.hh> 16 16 #include <nv/core/handle.hh> 17 #include <istream>18 #include <map>19 17 20 18 #include <nv/lua/lua_handle.hh> … … 193 191 explicit state( lua_State* state ); 194 192 bool do_string( string_ref code, string_ref name, int rvalues = 0 ); 195 bool do_stream( std::istream& stream, string_ref name );196 193 bool do_file( string_ref filename ); 197 194 int get_stack_size(); … … 282 279 283 280 int load_string( string_ref code, string_ref name ); 284 int load_stream( std::istream& stream, string_ref name );285 281 int load_file( string_ref filename ); 286 282 int do_current( string_ref name, int rvalues = 0 ); -
trunk/src/core/string.cc
r365 r367 66 66 n /= 10; 67 67 } while ( n > 0 ); 68 if ( n < 0 ) *s++ = '-';69 68 *s = '\0'; 70 69 string_reverse( str, s - 1 ); … … 80 79 n /= 10; 81 80 } while ( n > 0 ); 82 if ( n < 0 ) *s++ = '-';83 81 *s = '\0'; 84 82 string_reverse( str, s - 1 ); … … 91 89 sprintf_s( str, 64, "%.*g", 6, n ); 92 90 #else 93 snprintf( buffer, 64, "%.*g", 6, n );91 snprintf( str, 64, "%.*g", 6, n ); 94 92 #endif 95 93 sprintf( str, "%g", n ); … … 102 100 sprintf_s( str, 64, "%.*g", 6, n ); 103 101 #else 104 snprintf( buffer, 64, "%.*g", 6, n );102 snprintf( str, 64, "%.*g", 6, n ); 105 103 #endif 106 104 return strlen( str ); -
trunk/src/formats/assimp_loader.cc
r365 r367 7 7 #include "nv/formats/assimp_loader.hh" 8 8 #include <unordered_map> 9 #include <glm/gtx/transform.hpp>10 9 #include "nv/io/std_stream.hh" 11 10 #include "nv/gfx/mesh_creator.hh" -
trunk/src/formats/md2_loader.cc
r365 r367 7 7 #include "nv/formats/md2_loader.hh" 8 8 9 #include <glm/gtc/constants.hpp>10 9 #include "nv/core/logging.hh" 11 10 #include <cstring> -
trunk/src/formats/md3_loader.cc
r352 r367 7 7 #include "nv/formats/md3_loader.hh" 8 8 9 #include <glm/gtc/constants.hpp>10 9 #include "nv/core/logging.hh" 11 10 #include <cstring> -
trunk/src/formats/md5_loader.cc
r323 r367 5 5 #include "nv/formats/md5_loader.hh" 6 6 7 #include <glm/gtc/constants.hpp>8 7 #include "nv/core/logging.hh" 9 8 #include "nv/io/std_stream.hh" 10 #include <cstring>11 9 12 10 using namespace nv; … … 14 12 static void next_line( std::istream& stream ) 15 13 { 16 stream.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );14 stream.ignore( 1024*1024, '\n' ); 17 15 } 18 16 19 17 static inline void discard( std::istream& stream, const std::string& token ) 20 18 { 21 // stream.ignore( std::numeric_limits<std::streamsize>::max(), ' ' );22 19 std::string discarded; 23 20 stream >> discarded; -
trunk/src/gfx/keyframed_mesh.cc
r319 r367 5 5 #include "nv/gfx/keyframed_mesh.hh" 6 6 7 #include <glm/gtc/matrix_access.hpp>8 #include <glm/gtx/matrix_interpolation.hpp>9 7 #include "nv/interface/context.hh" 10 8 #include "nv/interface/device.hh" 11 12 13 9 #include "nv/core/logging.hh" 14 10 -
trunk/src/gfx/skeletal_mesh.cc
r323 r367 5 5 #include "nv/gfx/skeletal_mesh.hh" 6 6 7 #include <glm/gtc/matrix_access.hpp>8 #include <glm/gtx/matrix_interpolation.hpp>9 7 #include "nv/interface/context.hh" 10 8 #include "nv/interface/device.hh" 11 12 9 13 10 nv::skeletal_mesh_cpu::skeletal_mesh_cpu( context* a_context, const mesh_data* a_mesh_data, const mesh_nodes_data* bones ) -
trunk/src/gfx/texture_atlas.cc
r319 r367 8 8 9 9 #include "nv/core/logging.hh" 10 #include <iostream>11 10 12 11 using namespace nv; -
trunk/src/gfx/texture_font.cc
r365 r367 6 6 #include "nv/gfx/texture_font.hh" 7 7 8 #include <sstream>9 #include <stdexcept>10 8 #include "nv/lib/freetype2.hh" 11 9 #include "nv/core/logging.hh" … … 126 124 if ( error ) 127 125 { 128 std::stringstream error_msg; 129 error_msg << "FT_Error while loading glyphs, error: " 130 << error << " code: " << c; 131 NV_THROW( std::runtime_error, error_msg.str().c_str() ); 126 NV_LOG_ERROR( "FT_Error while loading glyphs, error: ", error, " code: ", c ); 127 NV_THROW( std::runtime_error, "FT_Error while loading glyphs" ); 132 128 } 133 129 … … 144 140 if ( r.pos.x < 0 ) 145 141 { 146 std::stringstream error_msg; 147 error_msg << "Atlas full while loading glyphs, " 148 << "r.pos.x: " << r.pos.x << " code: " 149 << c; 150 NV_THROW( std::runtime_error, error_msg.str().c_str() ); 142 NV_LOG_ERROR( "Atlas full while loading glyphs, r.pos.x: ", r.pos.x, " code: ", c ); 143 NV_THROW( std::runtime_error, "Atlas full while loading glyphs" ); 151 144 } 152 145 if (depth == 4) -
trunk/src/gui/gui_gfx_renderer.cc
r365 r367 6 6 7 7 #include "nv/gui/gui_gfx_renderer.hh" 8 9 #include <glm/gtc/matrix_transform.hpp>10 8 11 9 #include "nv/interface/device.hh" -
trunk/src/lua/lua_aux.cc
r319 r367 7 7 #include "nv/lua/lua_aux.hh" 8 8 9 #include <utility>10 9 #include "nv/lua/lua_raw.hh" 11 10 #include "nv/core/random.hh" … … 117 116 int arg1 = static_cast< int >( luaL_checkinteger( L, 1 ) ); 118 117 int arg2 = static_cast< int >( luaL_checkinteger( L, 2 ) ); 119 i f (arg2 < arg1) std::swap( arg2, arg1);120 lua_pushinteger( L, nv::random::get().srange( arg1, arg2 ));118 int result = ( arg2 >= arg1 ? nv::random::get().srange( arg1, arg2 ) : nv::random::get().srange( arg2, arg1 ) ); 119 lua_pushinteger( L, result ); 121 120 } 122 121 } -
trunk/src/lua/lua_state.cc
r365 r367 356 356 } 357 357 358 int lua::state::load_stream( std::istream& stream, string_ref name )359 {360 NV_LOG_NOTICE( "Loading Lua stream '", name, "'");361 return load_string( std::string(362 (std::istreambuf_iterator<char>(stream)),363 std::istreambuf_iterator<char>()), name );364 }365 366 358 int lua::state::load_file( string_ref filename ) 367 359 { … … 380 372 } 381 373 return do_current( name, rvalues ) == 0; 382 }383 384 bool lua::state::do_stream( std::istream& stream, string_ref name )385 {386 lua::stack_guard( this );387 int result = load_stream(stream,name);388 if (result)389 {390 NV_LOG_WARNING( "Failed to open stream ", name, ": ", lua_tostring( m_state, -1 ) );391 return false;392 }393 return do_current( name ) == 0;394 374 } 395 375 -
trunk/src/sdl/sdl_audio.cc
r365 r367 7 7 #include "nv/sdl/sdl_audio.hh" 8 8 9 #include <glm/gtx/vector_angle.hpp> 10 #include "nv/lib/sdl.hh" 9 #include "nv/core/math.hh" 11 10 #include "nv/lib/sdl_mixer.hh" 12 11 #include "nv/core/logging.hh" -
trunk/src/sdl/sdl_window.cc
r365 r367 9 9 #include "nv/lib/sdl.hh" 10 10 #include "nv/sdl/sdl_input.hh" 11 #include "nv/gl/gl_context.hh" 11 12 12 13 using namespace nv;
Note: See TracChangeset
for help on using the changeset viewer.