Changeset 204
- Timestamp:
- 08/17/13 21:22:56 (12 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv.lua
r193 r204 15 15 buildoptions { 16 16 "-std=c++11", 17 -- on Mac OS X don't try to use old stdc++ 18 "-stdlib=libc++", 17 19 "-Weverything", 18 20 -- obviously we don't care about C++98 compatibility -
trunk/nv/common.hh
r200 r204 108 108 #include <typeinfo> 109 109 #include <cstddef> 110 #include <cstdint> 110 111 #include <cassert> 111 112 #include <nv/logging.hh> … … 150 151 151 152 // Typedefs for fixed size types. 152 typedef signed charsint8;153 typedef signed shortsint16;154 typedef signed longsint32;155 typedef signed long longsint64;156 157 typedef u nsigned charuint8;158 typedef u nsigned shortuint16;159 typedef u nsigned longuint32;160 typedef u nsigned long longuint64;161 162 typedef unsigned char 163 typedef unsigned short 164 typedef unsigned long 153 typedef int8_t sint8; 154 typedef int16_t sint16; 155 typedef int32_t sint32; 156 typedef int64_t sint64; 157 158 typedef uint8_t uint8; 159 typedef uint16_t uint16; 160 typedef uint32_t uint32; 161 typedef uint64_t uint64; 162 163 typedef unsigned char char8; 164 typedef unsigned short char16; 165 typedef unsigned long char32; 165 166 166 167 typedef float f32; -
trunk/nv/formats/md5_loader.hh
r200 r204 203 203 const md5_tc_buffer& get_texcoords( uint32 mesh_id ) const { return m_meshes[mesh_id].texcoord_buffer; } 204 204 const md5_index_buffer& get_indices ( uint32 mesh_id ) const { return m_meshes[mesh_id].index_buffer; } 205 uint32get_vertex_count( uint32 mesh_id ) const { return m_meshes[mesh_id].position_buffer.size(); }206 uint32get_index_count( uint32 mesh_id ) const { return m_meshes[mesh_id].index_buffer.size(); }205 size_t get_vertex_count( uint32 mesh_id ) const { return m_meshes[mesh_id].position_buffer.size(); } 206 size_t get_index_count( uint32 mesh_id ) const { return m_meshes[mesh_id].index_buffer.size(); } 207 207 protected: 208 208 bool prepare_mesh( md5_mesh& mesh ); -
trunk/nv/gfx/keyframed_mesh.hh
r161 r204 19 19 keyframed_mesh( context* a_context, keyframed_mesh_data* a_data, program* a_program ); 20 20 mat4 get_tag( const std::string& tag ) const; 21 uint32get_max_frames() const;21 size_t get_max_frames() const; 22 22 void set_frame( uint32 frame ); 23 23 void setup_animation( uint32 start, uint32 count, uint32 fps, bool loop ); -
trunk/nv/lua/lua_path.hh
r198 r204 23 23 struct element 24 24 { 25 uint32value;26 uint32length;25 size_t value; 26 size_t length; 27 27 element() : value( 0 ), length( 0 ) {} 28 28 }; … … 90 90 private: 91 91 void parse(); 92 void push( uint32 start, uint32length );93 void push( uint32e );94 void push( const nv::string& p, uint32lenght );95 void push( const char* s, uint32length );92 void push( size_t start, size_t length ); 93 void push( size_t e ); 94 void push( const nv::string& p, size_t lenght ); 95 void push( const char* s, size_t length ); 96 96 private: 97 97 element m_elements[8]; -
trunk/src/formats/md2_loader.cc
r200 r204 357 357 uint32 stats_collision = 0; 358 358 359 std::vector< sint32 > index_translation( md2->header.num_vertices, -1 );359 std::vector< sint32 > index_translation( static_cast< uint32 >( md2->header.num_vertices ), -1 ); 360 360 361 361 m_new_indexes.clear(); -
trunk/src/formats/obj_loader.cc
r198 r204 130 130 }; 131 131 132 s td::size_t mesh_obj_reader::add_face( uint32* vi, uint32* ti, uint32* ni, size_t count )132 size_t mesh_obj_reader::add_face( uint32* vi, uint32* ti, uint32* ni, size_t count ) 133 133 { 134 134 if ( count < 3 ) … … 181 181 std::vector< vec4 >& tg = m_tangent->get(); 182 182 183 s td::size_t count = vp.size();184 s td::size_t tcount = count / 3;183 size_t count = vp.size(); 184 size_t tcount = count / 3; 185 185 186 186 std::vector< vec3 > tan1( count ); … … 188 188 tg.resize( count ); 189 189 190 for (s td::size_t a = 0; a < tcount; ++a )191 { 192 uint32i1 = a * 3;193 uint32i2 = a * 3 + 1;194 uint32i3 = a * 3 + 2;190 for (size_t a = 0; a < tcount; ++a ) 191 { 192 size_t i1 = a * 3; 193 size_t i2 = a * 3 + 1; 194 size_t i3 = a * 3 + 2; 195 195 196 196 // TODO: simplify -
trunk/src/gfx/keyframed_mesh.cc
r183 r204 58 58 } 59 59 60 uint32keyframed_mesh::get_max_frames() const60 size_t keyframed_mesh::get_max_frames() const 61 61 { 62 62 return m_data->get_frame_count(); … … 122 122 void nv::keyframed_mesh::draw( render_state& rstate ) 123 123 { 124 nv::uint32vtx_count = m_data->get_vertex_count();124 size_t vtx_count = m_data->get_vertex_count(); 125 125 if ( m_gpu_last_frame != m_last_frame ) 126 126 { -
trunk/src/gl/gl_texture2d.cc
r160 r204 44 44 void nv::gl_texture2d::bind( size_t slot ) 45 45 { 46 glActiveTexture( GL_TEXTURE0 + s lot);46 glActiveTexture( GL_TEXTURE0 + static_cast< GLenum >( slot ) ); 47 47 glBindTexture( GL_TEXTURE_2D, m_name.get_value() ); 48 48 } -
trunk/src/gui/gui_style.cc
r121 r204 48 48 lua::stack_guard guard( m_lua ); 49 49 if ( !resolve( e, entry, LUA_TNUMBER ) ) return false; 50 i = lua_tointeger( m_lua, -1);50 i = static_cast< int >( lua_tointeger( m_lua, -1 ) ); 51 51 return true; 52 52 } -
trunk/src/lib/gl.cc
r170 r204 37 37 *(void **) (&ext_loader) = gl_library.get("wglGetProcAddress"); 38 38 # define NV_GL_LOAD_EXT( symbol ) *(void **) (&symbol) = ext_loader(#symbol); 39 # elif NV_PLATFORM == NV_LINUX39 # elif (NV_PLATFORM == NV_LINUX || NV_PLATFORM == NV_APPLE) 40 40 # define NV_GL_LOAD( symbol ) *(void **) (&symbol) = gl_library.get(#symbol); 41 41 *(void **) (&ext_loader) = gl_library.get("glXGetProcAddress"); -
trunk/src/logger.cc
r121 r204 229 229 #if NV_PLATFORM == NV_WINDOWS 230 230 m_handle = GetStdHandle( STD_OUTPUT_HANDLE ); 231 #else 232 NV_UNUSED( m_handle ); 231 233 #endif 232 234 } -
trunk/src/lua/lua_area.cc
r198 r204 194 194 static int nlua_area_corners_closure( lua_State* L ) 195 195 { 196 int index = lua_tointeger( L, lua_upvalueindex(2) ) + 1;196 int index = static_cast< int >( lua_tointeger( L, lua_upvalueindex(2) ) + 1 ); 197 197 lua_pushinteger( L, index ); 198 198 lua_replace( L, lua_upvalueindex(2) ); // update … … 223 223 { 224 224 nv::rectangle* a = nlua_to_parea( L, 1 ); 225 a->shrink( lua_tointeger( L, 2) );225 a->shrink( static_cast< int >( lua_tointeger( L, 2 ) ) ); 226 226 return 0; 227 227 } … … 230 230 { 231 231 nv::rectangle* a = nlua_to_parea( L, 1 ); 232 nlua_push_area( L, a->shrinked( lua_tointeger( L, 2) ) );232 nlua_push_area( L, a->shrinked( static_cast< int >( lua_tointeger( L, 2 ) ) ) ); 233 233 return 1; 234 234 } … … 237 237 { 238 238 nv::rectangle* a = nlua_to_parea( L, 1 ); 239 a->expand( lua_tointeger( L, 2) );239 a->expand( static_cast< int >( lua_tointeger( L, 2 ) ) ); 240 240 return 0; 241 241 } … … 244 244 { 245 245 nv::rectangle* a = nlua_to_parea( L, 1 ); 246 nlua_push_area( L, a->expanded( lua_tointeger( L, 2) ) );246 nlua_push_area( L, a->expanded( static_cast< int >( lua_tointeger( L, 2 ) ) ) ); 247 247 return 1; 248 248 } … … 327 327 { 328 328 nv::ivec2 c = nlua_to_coord( L, 1 ); 329 int amount = lua_tointeger( L, 1);329 int amount = static_cast< int >( lua_tointeger( L, 1 ) ); 330 330 nv::ivec2 shift( amount, amount ); 331 331 nlua_push_area( L, nv::rectangle( c - shift, c + shift ) ); -
trunk/src/lua/lua_aux.cc
r198 r204 91 91 static int nluaaux_math_dieroll( lua_State* L ) 92 92 { 93 intdice = luaL_checkinteger( L, 1 );94 intsides = luaL_checkinteger( L, 2 );93 lua_Integer dice = luaL_checkinteger( L, 1 ); 94 lua_Integer sides = luaL_checkinteger( L, 2 ); 95 95 if ( dice < 1 ) luaL_argerror( L, 1, "die count lower than 1!" ); 96 96 if ( sides < 1 ) luaL_argerror( L, 2, "side count lower than 1!" ); … … 109 109 if ( lua_gettop( L ) == 1 ) 110 110 { 111 intarg1 = luaL_checkinteger( L, 1 );111 lua_Integer arg1 = luaL_checkinteger( L, 1 ); 112 112 if ( arg1 < 1 ) arg1 = 1; 113 113 lua_pushunsigned( L, nv::random::get().urange( 1, static_cast<nv::uint32>( arg1 ) ) ); … … 115 115 else 116 116 { 117 int arg1 = luaL_checkinteger( L, 1);118 int arg2 = luaL_checkinteger( L, 2);117 int arg1 = static_cast< int >( luaL_checkinteger( L, 1 ) ); 118 int arg2 = static_cast< int >( luaL_checkinteger( L, 2 ) ); 119 119 if (arg2 < arg1) std::swap( arg2, arg1 ); 120 120 lua_pushinteger( L, nv::random::get().srange( arg1, arg2 ) ); -
trunk/src/lua/lua_path.cc
r198 r204 44 44 } 45 45 46 void lua::path::push( uint32e )46 void lua::path::push( size_t e ) 47 47 { 48 48 m_elements[ m_count ].value = e; … … 51 51 } 52 52 53 void lua::path::push( uint32 start, uint32length )53 void lua::path::push( size_t start, size_t length ) 54 54 { 55 55 m_elements[ m_count ].value = start; … … 58 58 } 59 59 60 void lua::path::push( const char* p, uint32length )60 void lua::path::push( const char* p, size_t length ) 61 61 { 62 62 m_elements[ m_count ].value = m_path.length(); … … 66 66 } 67 67 68 void lua::path::push( const std::string& s, uint32length )68 void lua::path::push( const std::string& s, size_t length ) 69 69 { 70 70 m_elements[ m_count ].value = m_path.length(); -
trunk/src/lua/lua_state.cc
r198 r204 249 249 { 250 250 lua_getfield( L->L, -1, element.c_str() ); 251 intresult = lua_type( L->L, -1 ) == LUA_TNUMBER ? lua_tointeger( L->L, -1 ) : defval;252 lua_pop( L->L, 1 ); 253 return result;251 lua_Integer result = lua_type( L->L, -1 ) == LUA_TNUMBER ? lua_tointeger( L->L, -1 ) : defval; 252 lua_pop( L->L, 1 ); 253 return static_cast< int >( result ); 254 254 } 255 255
Note: See TracChangeset
for help on using the changeset viewer.