- Timestamp:
- 05/26/15 17:35:06 (10 years ago)
- Location:
- trunk/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/curses/curses_terminal.cc
r369 r374 65 65 } 66 66 mvaddch( p.y-1, p.x-1, ch ); 67 move( m_cursor.y-1, m_cursor.x-1 );67 ::move( m_cursor.y-1, m_cursor.x-1 ); 68 68 } 69 69 … … 80 80 m_update_needed = true; 81 81 ::clear(); 82 move( m_cursor.y-1, m_cursor.x-1 );82 ::move( m_cursor.y-1, m_cursor.x-1 ); 83 83 } 84 84 … … 160 160 { 161 161 terminal::set_cursor( p ); 162 move( m_cursor.y-1, m_cursor.x-1 );162 ::move( m_cursor.y-1, m_cursor.x-1 ); 163 163 } 164 164 -
trunk/src/engine/particle_engine.cc
r365 r374 7 7 #include <nv/interface/device.hh> 8 8 #include <nv/core/random.hh> 9 #include <nv/stl/utility.hh> 9 10 #include <nv/lua/lua_glm.hh> 10 11 #include <nv/core/logging.hh> 11 #include <cmath>12 12 13 13 static const char *nv_particle_engine_vertex_shader_world = … … 203 203 if ( datap->average ) 204 204 { 205 float norm_factor = glm::min( factor, 1.0f );205 float norm_factor = nv::min( factor, 1.0f ); 206 206 for ( uint32 i = 0; i < count; ++i ) 207 207 p[i].velocity = datap->force_vector * norm_factor + p[i].velocity * ( 1.0f - norm_factor ); … … 696 696 { 697 697 info->count--; 698 s td::swap( info->particles[i], info->particles[info->count] );698 swap( info->particles[i], info->particles[info->count] ); 699 699 } 700 700 } -
trunk/src/formats/md2_loader.cc
r367 r374 238 238 } 239 239 240 size_t md2_loader::get_max_frames() const240 nv::size_t md2_loader::get_max_frames() const 241 241 { 242 242 return static_cast< size_t >( ((md2_t*)m_md2)->header.num_frames ); -
trunk/src/formats/md3_loader.cc
r367 r374 172 172 source.read( surface->vertices, sizeof( md3_vertex_t ), static_cast<size_t>( surface->header.num_verts * surface->header.num_frames ) ); 173 173 174 if ( source.tell() != static_cast<s td::size_t>( pos + surface->header.ofs_end ) ) return false;174 if ( source.tell() != static_cast<size_t>( pos + surface->header.ofs_end ) ) return false; 175 175 176 176 return true; -
trunk/src/formats/md5_loader.cc
r367 r374 344 344 vtc.tangent = glm::vec3(0); 345 345 346 std::sort( weights + start_weight, weights + start_weight + weight_count, [](const md5_weight& a, const md5_weight& b) -> bool { return a.bias > b.bias; } ); 346 stable_sort( weights + start_weight, weights + start_weight + weight_count, [] ( const md5_weight& a, const md5_weight& b ) -> bool { return a.bias > b.bias; } ); 347 //std::sort( weights + start_weight, weights + start_weight + weight_count, [](const md5_weight& a, const md5_weight& b) -> bool { return a.bias > b.bias; } ); 347 348 348 349 if ( weight_count > 4 ) -
trunk/src/formats/obj_loader.cc
r319 r374 53 53 std::string next_name; 54 54 55 s td::size_t size;56 bool 55 size_t size; 56 bool eof; 57 57 58 58 obj_reader(); … … 172 172 { 173 173 mesh_data_reader( bool normals ) : m_normals( normals ) {} 174 virtual s td::size_t add_face( uint32* vi, uint32* ti, uint32* ni, size_t count )174 virtual size_t add_face( uint32* vi, uint32* ti, uint32* ni, size_t count ) 175 175 { 176 176 if ( count < 3 ) return 0; // TODO : report error? … … 178 178 // TODO : support if normals not present; 179 179 vec3 nullvec; 180 s td::size_t result = 0;180 size_t result = 0; 181 181 // Simple triangulation - obj's shouldn't have more than quads anyway 182 182 … … 278 278 } 279 279 280 for (s td::size_t a = 0; a < count; ++a )280 for (size_t a = 0; a < count; ++a ) 281 281 { 282 282 const vec3& n = m_data[a].normal; -
trunk/src/gfx/image.cc
r323 r374 4 4 5 5 #include "nv/gfx/image.hh" 6 7 #include <algorithm>8 6 9 7 using namespace nv; -
trunk/src/io/c_stream.cc
r319 r374 6 6 #include <sys/stat.h> 7 7 #include "nv/io/c_stream.hh" 8 #include <limits>9 8 10 9 using namespace nv; -
trunk/src/io/std_stream.cc
r319 r374 8 8 9 9 #include "nv/io/std_stream.hh" 10 #include <algorithm> 10 #include "nv/stl/math.hh" 11 #include "nv/stl/utility.hh" 11 12 12 13 using namespace nv; … … 15 16 : m_stream( source ) 16 17 , m_owner( owner ) 17 , m_buffer( std::max(bsize, put_back) + put_back )18 , m_put_back( std::max( put_back, std::size_t( 1 ) ) )18 , m_buffer( nv::max(bsize, put_back) + put_back ) 19 , m_put_back( nv::max( put_back, std::size_t( 1 ) ) ) 19 20 { 20 21 char *end = &m_buffer.front() + m_buffer.size(); -
trunk/src/lib/curses.cc
r319 r374 11 11 #include "nv/core/library.hh" 12 12 13 #define FILE void 13 14 #define NV_CURSES_FUN( rtype, fname, fparams ) rtype (*fname) fparams = nullptr; 14 15 #include <nv/lib/detail/curses_functions.inc> … … 21 22 curses_library.open( path ); 22 23 23 # define NV_CURSES_FUN( rtype, fname, fparams ) *(void **) (& fname) = curses_library.get(#fname);24 # define NV_CURSES_FUN( rtype, fname, fparams ) *(void **) (&::fname) = curses_library.get(#fname); 24 25 # include <nv/lib/detail/curses_functions.inc> 25 26 # undef NV_CURSES_FUN -
trunk/src/lua/lua_area.cc
r368 r374 79 79 { 80 80 nv::rectangle* a = to_parea( L, 1 ); 81 std::size_t l;81 nv::size_t l; 82 82 const char* index = lua_tolstring( L, 2, &l ); 83 83 if ( l == 1 && index[0] == 'a' ) … … 101 101 { 102 102 nv::rectangle* a = to_parea( L, 1 ); 103 std::size_t l;103 nv::size_t l; 104 104 const char* index = lua_tolstring( L, 2, &l ); 105 105 nv::ivec2 value( to_coord( L, 3 ) ); -
trunk/src/lua/lua_map_tile.cc
r369 r374 7 7 #include "nv/lua/lua_map_tile.hh" 8 8 9 #include <numeric>10 9 #include "nv/lua/lua_map_area.hh" 11 10 #include "nv/stl/flags.hh" 11 #include "nv/stl/numeric.hh" 12 #include "nv/stl/algorithm.hh" 12 13 #include "nv/core/random.hh" 13 14 #include "nv/lua/lua_area.hh" … … 59 60 map_tile tile; 60 61 61 tile.size_y = (nv::uint16)( std::count( code.begin(), code.end(), '\n' ) + 1 );62 tile.size_y = (nv::uint16)( nv::count( code.begin(), code.end(), '\n' ) + 1 ); 62 63 tile.size_x = (nv::uint16)( code.find( '\n' ) ); 63 64 if ( tile.size_x == 0 ) … … 236 237 nv::uint16 org_x = tile->size_x; 237 238 nv::uint16 org_y = tile->size_y; 238 nv::uint16 new_x = ( nv::uint16)std::accumulate( sizes_x.begin(), sizes_x.end(), 0 );239 nv::uint16 new_y = ( nv::uint16)std::accumulate( sizes_y.begin(), sizes_y.end(), 0 );239 nv::uint16 new_x = ( nv::uint16 )nv::accumulate( sizes_x.begin(), sizes_x.end(), 0 ); 240 nv::uint16 new_y = ( nv::uint16 )nv::accumulate( sizes_y.begin(), sizes_y.end(), 0 ); 240 241 241 242 nv::uint8* data = new nv::uint8[ new_x * new_y ]; -
trunk/src/stl/string.cc
r368 r374 28 28 } 29 29 30 size_t nv::sint32_to_buffer( sint32 n, char* str )30 nv::size_t nv::sint32_to_buffer( sint32 n, char* str ) 31 31 { 32 32 char* s = str; … … 43 43 } 44 44 45 size_t nv::sint64_to_buffer( sint64 n, char* str )45 nv::size_t nv::sint64_to_buffer( sint64 n, char* str ) 46 46 { 47 47 char* s = str; … … 58 58 } 59 59 60 size_t nv::uint32_to_buffer( uint32 n, char* str )60 nv::size_t nv::uint32_to_buffer( uint32 n, char* str ) 61 61 { 62 62 char* s = str; … … 71 71 } 72 72 73 size_t nv::uint64_to_buffer( uint64 n, char* str )73 nv::size_t nv::uint64_to_buffer( uint64 n, char* str ) 74 74 { 75 75 char* s = str; … … 84 84 } 85 85 86 size_t nv::f32_to_buffer( f32 n, char* str )86 nv::size_t nv::f32_to_buffer( f32 n, char* str ) 87 87 { 88 88 #if NV_COMPILER == NV_MSVC … … 95 95 } 96 96 97 size_t nv::f64_to_buffer( f64 n, char* str )97 nv::size_t nv::f64_to_buffer( f64 n, char* str ) 98 98 { 99 99 #if NV_COMPILER == NV_MSVC
Note: See TracChangeset
for help on using the changeset viewer.