Changeset 487
- Timestamp:
- 03/08/16 08:05:51 (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 49 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv.lua
r486 r487 151 151 buildoptions { "-std=c++0x" } 152 152 end 153 153 154 configuration { "windows", "gmake" } 154 linkoptions { "-mwindows" } 155 linkoptions { "-Wl,--subsystem,windows" } 156 -- linkoptions { "-mwindows" } 155 157 156 158 configuration "linux" -
trunk/nv/core/ascii_printer.hh
r484 r487 26 26 explicit ascii_printer( terminal * term ); 27 27 28 void print( uchar8ch, const position& p, uint32 color )28 void print( char ch, const position& p, uint32 color ) 29 29 { 30 30 m_terminal->print( p, color, ch ); -
trunk/nv/core/random.hh
r451 r487 51 51 { 52 52 NV_ASSERT( max >= min, "Bad srange argument!" ); 53 return static_cast< sint32 >( urand( static_cast< uint32 >( max - min ) + 1 ) + min ); 53 // this method probably reduces range // 54 uint32 roll = urand( static_cast<uint32>( max - min ) + 1 ); 55 return static_cast< sint32 >( roll ) + min; 54 56 } 55 57 -
trunk/nv/core/resource.hh
r485 r487 36 36 public: 37 37 resource_handler( resource_type_id id ) : m_type_id( id ) {} 38 virtual ~resource_handler() {} 38 39 39 40 protected: … … 41 42 virtual void raw_add( resource_id id, void* value ) = 0; 42 43 virtual void unlock( resource_id id ) = 0; 43 virtual void release( resource_id id ) = 0;44 //virtual void release( resource_id id ) = 0; 44 45 virtual bool exists( resource_id id ) = 0; 45 46 virtual bool load_resource( const string_view& id ) = 0; … … 84 85 constexpr explicit operator bool() const { return is_valid(); } 85 86 resource_lock< T > lock() const { return resource_lock< T >( *this, resource_unchecked() ); } 86 ~resource() 87 { 88 if ( m_handler ) m_handler->release( m_id ); 89 } 90 protected: 87 // ~resource() 88 // { 89 // if ( m_handler ) m_handler->release( m_id ); 90 // } 91 protected: 92 explicit resource( resource_id id ) : m_id( id ), m_handler( nullptr ) {} 93 91 94 resource_id m_id; 92 95 resource_handler* m_handler; … … 134 137 public: 135 138 136 void release( resource_handler* r )137 {138 r->release( m_id );139 m_id = 0;140 }139 // void release( resource_handler* r ) 140 // { 141 // r->release( m_id ); 142 // m_id = 0; 143 // } 141 144 ~resource_handle() 142 145 { … … 158 161 : m_id( r.m_id ) 159 162 , m_handler( r.m_handler ) 160 , m_resource( r.m_handler ? r.m_handler-> lock<T>( r.m_id, false ) : nullptr ) {}163 , m_resource( r.m_handler ? r.m_handler->template lock<T>( r.m_id, false ) : nullptr ) {} 161 164 explicit resource_lock( const resource< T >& r ) 162 165 : m_id( r.m_id ) 163 166 , m_handler( r.m_handler ) 164 , m_resource( r.m_handler-> lock<T>( r.m_id ) ) {}167 , m_resource( r.m_handler->template lock<T>( r.m_id ) ) {} 165 168 explicit resource_lock( const resource_handle< T >& r, resource_handler* handler ) : m_id( r.m_id ), m_handler( handler ), m_resource( handler->raw_lock( r.m_id ) ) {} 166 169 resource_lock( const resource_lock& ) = delete; … … 214 217 auto m = m_handlers.find( resource_type_id( rtti_type_hash<T>::value ) ); 215 218 NV_ASSERT( m != m_handlers.end(), "Resource type unrecognized!" ); 216 if ( m->second->exists( id ) || m->second->load_resource( id ) ) 217 return m->second->create< T >( id ); 219 shash64 hid( id ); 220 if ( m->second->exists( hid ) || m->second->load_resource( id ) ) 221 return m->second->create< T >( hid ); 218 222 NV_ASSERT( false, "resource_manager.get failed!" ); 219 223 return resource< T >(); … … 225 229 auto m = m_handlers.find( resource_type_id( rtti_type_hash<T>::value ) ); 226 230 NV_ASSERT( m != m_handlers.end(), "Resource type unrecognized!" ); 227 if ( m->second->exists( id ) ) 231 shash64 hid( id ); 232 if ( m->second->exists( hid ) ) 228 233 { 229 return m->second->create< T >( id );234 return m->second->create< T >( hid ); 230 235 } 231 236 NV_ASSERT( false, "resource_manager.get failed!" ); -
trunk/nv/core/types.hh
r450 r487 34 34 constexpr thash64() : inherited_type() {} 35 35 constexpr explicit thash64( hash_type value ) : inherited_type( value ) {} 36 constexpr thash64( const thash64& value ) = default;37 36 38 37 template < typename T > … … 211 210 ( is_pointer<field_type>::value ? TF_POINTER : 0 ) | 212 211 ( is_pod<field_type>::value ? TF_SIMPLETYPE : 0 ); 213 f.offset = offset_of( field);212 f.offset = uint32( offset_of( field ) ); 214 213 f.control = nullptr; 215 214 f.enumidx = 0; … … 229 228 ( is_pointer<TFIELD>::value ? TF_POINTER : 0 ) | 230 229 ( is_pod<TFIELD>::value ? TF_SIMPLETYPE : 0 ); 231 f.offset = offset_of( field);230 f.offset = uint32( offset_of( field ) ); 232 231 f.control = nullptr; 233 232 f.enumidx = 0; … … 248 247 ( is_pointer<field_type>::value ? TF_POINTER : 0 ) | 249 248 ( is_pod<field_type>::value ? TF_SIMPLETYPE : 0 ); 250 f.offset = offset_of( field);249 f.offset = uint32( offset_of( field ) ); 251 250 f.control = m_entry->field_names[ control_name ]; 252 251 f.enumidx = static_cast< sint32 >( control_value ); … … 266 265 ( is_pointer<TFIELD>::value ? TF_POINTER : 0 ) | 267 266 ( is_pod<TFIELD>::value ? TF_SIMPLETYPE : 0 ); 268 f.offset = offset_of( field);267 f.offset = uint32( offset_of( field ) ); 269 268 f.control = m_entry->field_names[control_name]; 270 269 f.enumidx = static_cast<sint32>( control_value ); -
trunk/nv/curses/curses_terminal.hh
r395 r487 35 35 * Print a character of the given color to the screen memory 36 36 */ 37 virtual void print( position p, uint32 color, unsignedchar ch );37 virtual void print( position p, uint32 color, char ch ); 38 38 39 39 /** -
trunk/nv/engine/animation.hh
r486 r487 85 85 animator_transition_instance() {} 86 86 87 animator_transition_instance( const animator_transition_data& data, uint32 s ource)88 : animator_transition_data( data ), source( s ource), time( 0.0f )87 animator_transition_instance( const animator_transition_data& data, uint32 src ) 88 : animator_transition_data( data ), source( src ), time( 0.0f ) 89 89 { 90 90 … … 96 96 public: 97 97 vector< animator_transition_instance > m_transitions; 98 uint32 m_current_state;98 sint32 m_current_state; 99 99 float m_time; 100 100 101 101 animator_layer_instance() : m_current_state( 0 ), m_time( 0.0f ) {} 102 void set_state( uint32 state ) { m_current_state = s tate; }103 uint32 get_state() const { return m_current_state; }104 uint32 get_final_state() const102 void set_state( uint32 state ) { m_current_state = sint32( state ); } 103 sint32 get_state() const { return m_current_state; } 104 sint32 get_final_state() const 105 105 { 106 106 if ( m_transitions.size() > 0 ) 107 return m_transitions.back().target;107 return sint32( m_transitions.back().target ); 108 108 return m_current_state; 109 109 } … … 135 135 { 136 136 animator_transition_instance& tr = m_transitions.front(); 137 m_current_state = tr.target;137 m_current_state = sint32( tr.target ); 138 138 tr.time += time; 139 139 if ( tr.time < tr.duration ) break; … … 181 181 for ( uint32 i = 0; i < data->layers.size(); ++i ) 182 182 { 183 m_layers[i].set_state( data->layers[i].def_state);183 m_layers[i].set_state( uint32( data->layers[i].def_state ) ); 184 184 } 185 185 } … … 190 190 } 191 191 192 uint32 base_state() const192 sint32 base_state() const 193 193 { 194 194 // HACK … … 203 203 if ( m_layers[i].m_current_state != -1 ) 204 204 { 205 uint32 last_state = m_layers[i].get_final_state();206 const animator_state_data& state = data->layers[i].states[ last_state];205 sint32 last_state = m_layers[i].get_final_state(); 206 const animator_state_data& state = data->layers[i].states[ uint32( last_state ) ]; 207 207 auto it = state.transitions.find( name ); 208 208 if ( it != state.transitions.end() ) 209 209 { 210 m_layers[i].add_transition( it->second, last_state);210 m_layers[i].add_transition( it->second, uint32( last_state ) ); 211 211 } 212 212 } … … 228 228 { 229 229 const animator_layer_data& layer = data->layers[i]; 230 const animator_state_data& state = layer.states[ m_layers[i].m_current_state];230 const animator_state_data& state = layer.states[ uint32( m_layers[i].m_current_state ) ]; 231 231 if ( state.poses.size() > 0 ) 232 232 animate_state( m_transforms, state, data->layers[i], data->poses, get_frame( state, m_layers[i].m_time ) ); … … 258 258 const animator_layer_instance& linst = m_layers[layer_id]; 259 259 m_layers[layer_id].update( dtime ); 260 if ( m_layers[layer_id].m_transitions.size() > 0 ) 261 { 262 animate_layer( ldata, linst.m_transitions.front(), data->poses, linst.m_time ); 263 } 264 else 265 { 266 const animator_state_data& state = ldata.states[linst.m_current_state]; 267 if ( state.poses.size() > 0 ) 268 animate_state( m_transforms, state, ldata, data->poses, get_frame( state, linst.m_time ) ); 260 if ( linst.m_current_state != -1 ) 261 { 262 if ( m_layers[layer_id].m_transitions.size() > 0 ) 263 { 264 animate_layer( ldata, linst.m_transitions.front(), data->poses, linst.m_time ); 265 } 266 else 267 { 268 const animator_state_data& state = ldata.states[ uint32( linst.m_current_state ) ]; 269 if ( state.poses.size() > 0 ) 270 animate_state( m_transforms, state, ldata, data->poses, get_frame( state, linst.m_time ) ); 271 } 269 272 } 270 273 m_transforms.delocalize( data->poses->get_tree() ); -
trunk/nv/engine/resource_system.hh
r486 r487 77 77 { 78 78 if ( exists( id ) ) 79 return create< T >( id );79 return this->template create< T >( id ); 80 80 else 81 81 { 82 82 if ( this->load_resource( id ) ) 83 83 { 84 return create< T >( id );84 return this->template create< T >( id ); 85 85 } 86 86 } … … 91 91 resource_type get( uint64 id ) 92 92 { 93 if ( exists( shash64( id ) ) ) return create< T >( shash64( id ) );93 if ( exists( shash64( id ) ) ) return this->template create< T >( shash64( id ) ); 94 94 // NV_ASSERT( false, "resource_manager.get failed!" ); 95 95 return resource_type(); … … 120 120 } 121 121 m_store[id] = resource; 122 return create< T >( id );122 return this->template create< T >( id ); 123 123 } 124 124 … … 140 140 } 141 141 142 virtual void unlock( resource_id ) {} ;143 virtual void release( resource_id ) {} ;142 virtual void unlock( resource_id ) {} 143 virtual void release( resource_id ) {} 144 144 virtual void release( stored_type ) {} 145 145 -
trunk/nv/gfx/poses.hh
r486 r487 90 90 pose.m_transforms.resize( m_node_tree.size() ); 91 91 92 for ( sint32 i = 0; i < sint32( m_node_tree.size()); ++i )92 for ( uint32 i = 0; i < m_node_tree.size(); ++i ) 93 93 { 94 94 const data_channel_set* node = nullptr; -
trunk/nv/gfx/skeleton_instance.hh
r486 r487 69 69 } 70 70 71 uint32 size() const { return m_offsets.size(); } ;71 uint32 size() const { return m_offsets.size(); } 72 72 protected: 73 73 dynamic_array< value_type > m_offsets; … … 84 84 void prepare( const mesh_nodes_data* node_data, const data_node_list& bone_data ); 85 85 void prepare( const data_node_list& pose_data, const data_node_list& bone_data ); 86 uint32 size() const { return m_indices.size(); } ;87 uint32 skeleton_size() const { return m_bone_count; } ;86 uint32 size() const { return m_indices.size(); } 87 uint32 skeleton_size() const { return m_bone_count; } 88 88 protected: 89 89 dynamic_array< sint16 > m_indices; -
trunk/nv/interface/data_channel.hh
r482 r487 63 63 const T& extract( uint16 slot_index, uint32 index ) const 64 64 { 65 NV_ASSERT( slot < m_desc.size(), "Bas slot passed to extract!" )65 NV_ASSERT( slot_index < m_desc.size(), "Bas slot passed to extract!" ); 66 66 return *reinterpret_cast<const T*>( m_data + m_desc.element_size()*index + m_desc[slot_index].offset ); 67 67 } -
trunk/nv/interface/image_loader.hh
r486 r487 28 28 virtual image_data* load( stream& ) = 0; 29 29 virtual image_data* load( stream&, image_format format ) = 0; 30 virtual ~image_loader() {} ;30 virtual ~image_loader() {} 31 31 }; 32 32 -
trunk/nv/interface/interpolate.hh
r486 r487 147 147 { 148 148 inline static T interpolate( float f, const T& lhs, const T& rhs ) { return math::slerp( lhs, rhs, f ); } 149 inline static T interpolate( float f, const T& v0, const T& v1, const T& v2, const T& v3) { return math::slerp( v1, v2, f ); }149 inline static T interpolate( float f, const T&, const T& v1, const T& v2, const T& ) { return math::slerp( v1, v2, f ); } 150 150 }; 151 151 … … 209 209 case interpolation::QUADRATIC : return quadratic_interpolator<T>::interpolate( f, ::nv::forward<Args>( args )... ); 210 210 case interpolation::SQUADRATIC : return squad_interpolator<T>::interpolate( f, ::nv::forward<Args>( args )... ); 211 default : case interpolation::NONE: return no_interpolator<T>::interpolate( f, ::nv::forward<Args>( args )... );211 default : return no_interpolator<T>::interpolate( f, ::nv::forward<Args>( args )... ); 212 212 } 213 213 } … … 224 224 case interpolation::QUADRATIC : interpolate_array( result, f, quadratic_interpolator<value_type>( f ), ::nv::forward<Args>( args )... ); break; 225 225 case interpolation::SQUADRATIC : interpolate_array( result, f, squad_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break; 226 default : case interpolation::NONE: interpolate_array( result, f, no_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;226 default : interpolate_array( result, f, no_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break; 227 227 } 228 228 } … … 277 277 case interpolation::QUADRATIC : interpolate_blend( result, f, in, blend_factor, normalized_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break; 278 278 case interpolation::SQUADRATIC : interpolate_blend( result, f, in, blend_factor, spherical_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break; 279 default : case interpolation::NONE: interpolate_blend( result, f, in, blend_factor, no_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;279 default : interpolate_blend( result, f, in, blend_factor, no_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break; 280 280 } 281 281 } -
trunk/nv/interface/mesh_data.hh
r485 r487 65 65 66 66 data_node_list( data_node_list&& other ) 67 : m_ name( other.m_name ), m_data( nv::move( other.m_data ))67 : m_data( nv::move( other.m_data ) ), m_name( other.m_name ) 68 68 { 69 69 } … … 123 123 for ( uint8 n = 0; n < uint8( m_data.size() ); ++n ) 124 124 { 125 if ( m_data[n].parent_id != -1)126 m_children[ m_data[n].parent_id].push( n );125 if ( m_data[n].parent_id >= 0 ) 126 m_children[ uint32( m_data[n].parent_id ) ].push( n ); 127 127 } 128 128 } -
trunk/nv/interface/terminal.hh
r395 r487 36 36 * Print a character of the given color to the screen memory 37 37 */ 38 virtual void print( position p, uint32 color, unsignedchar ch ) = 0;38 virtual void print( position p, uint32 color, char ch ) = 0; 39 39 40 40 /** -
trunk/nv/interface/uniform.hh
r486 r487 27 27 { 28 28 public: 29 uniform_base( datatype type, int location, int length )29 uniform_base( datatype type, int location, size_t length ) 30 30 : m_type( type ), m_location(location), m_length( length ), m_dirty( true ) {} 31 31 bool try_type_check( datatype ) … … 42 42 datatype get_type() const { return m_type; } 43 43 int get_location() const { return m_location; } 44 int get_length() const { return m_length; }44 size_t get_length() const { return m_length; } 45 45 bool is_dirty() const { return m_dirty; } 46 46 void clean() { m_dirty = false; } 47 static uniform_base* create( datatype utype, int location, int length );47 static uniform_base* create( datatype utype, int location, size_t length ); 48 48 virtual ~uniform_base() {} 49 49 protected: 50 50 datatype m_type; 51 51 int m_location; 52 intm_length;52 size_t m_length; 53 53 bool m_dirty; 54 54 }; … … 60 60 typedef T value_type; 61 61 62 uniform( int location, int length )62 uniform( int location, size_t length ) 63 63 : uniform_base( type_to_enum< T >::type, location, length ), m_value( nullptr ) 64 64 { … … 285 285 }; 286 286 287 inline uniform_base* uniform_base::create( datatype utype, int location, int length )287 inline uniform_base* uniform_base::create( datatype utype, int location, size_t length ) 288 288 { 289 289 switch( utype ) -
trunk/nv/lib/assimp.hh
r485 r487 23 23 # define NV_ASSIMP_PATH "libassimp32.so" 24 24 #endif 25 26 typedef nv::size_t size_t; 25 27 26 28 extern "C" { -
trunk/nv/rogue/fov.hh
r455 r487 23 23 virtual bool is_transparent( const position& ) const = 0; 24 24 virtual void set_visible( const position&, bool ) = 0; 25 virtual ~fov_interface() {} 25 26 }; 26 27 -
trunk/nv/stl/algorithm/fill.hh
r402 r487 18 18 #include <nv/stl/iterator.hh> 19 19 #include <nv/stl/type_traits/common.hh> 20 #include <nv/stl/type_traits/properties.hh> 20 21 21 22 namespace nv -
trunk/nv/stl/container/growing_storage.hh
r448 r487 134 134 void push_back( const value_type& e ) 135 135 { 136 if ( try_grow( 1 ) ) copy_construct_object( Storage::data() + m_size- 1, e );136 if ( try_grow( 1 ) ) copy_construct_object( Storage::data() + sint32( m_size ) - 1, e ); 137 137 } 138 138 void push_back( value_type&& e ) 139 139 { 140 if ( try_grow( 1 ) ) move_construct_object( Storage::data() + m_size- 1, forward<value_type>( e ) );140 if ( try_grow( 1 ) ) move_construct_object( Storage::data() + sint32( m_size ) - 1, forward<value_type>( e ) ); 141 141 } 142 142 template < typename... Args > 143 143 void emplace_back( Args&&... args ) 144 144 { 145 if ( try_grow( 1 ) ) construct_object( Storage::data() + m_size- 1, forward<Args>( args )... );145 if ( try_grow( 1 ) ) construct_object( Storage::data() + sint32( m_size ) - 1, forward<Args>( args )... ); 146 146 } 147 147 … … 149 149 { 150 150 if ( m_size == 0 ) return; 151 InitializePolicy::destroy( Storage::data() + m_size- 1 );151 InitializePolicy::destroy( Storage::data() + sint32( m_size ) - 1 ); 152 152 m_size.size( m_size - 1 ); 153 153 } … … 157 157 { 158 158 if ( m_size == 0 ) return iterator(); 159 iterator iend = Storage::data() + m_size;159 iterator iend = Storage::data() + sint32( m_size ); 160 160 InitializePolicy::destroy( position ); 161 161 if ( ( position + 1 ) < iend ) … … 167 167 iterator erase( iterator first, iterator last ) 168 168 { 169 iterator iend = Storage::data() + m_size; 169 NV_ASSERT( first <= last, "Bad arguments passed to erase!" ); 170 iterator iend = Storage::data() + sint32( m_size ); 170 171 InitializePolicy::destroy( first, last ); 171 172 iterator position = raw_alias_copy( last, iend, first ); 172 m_size.size( m_size - ( last - first ) );173 m_size.size( m_size - size_type( last - first ) ); 173 174 return position; 174 175 } … … 178 179 // TODO: distance can't be called on destructive iterators - check 179 180 // and use pushback if needed? 180 size_type d = distance( first, last ); 181 NV_ASSERT( first <= last, "Bad arguments passed to append!" ); 182 size_type d = size_type( distance( first, last ) ); 181 183 size_type old_size = m_size; 182 184 if ( try_grow( d ) ) … … 191 193 { 192 194 iterator iposition = Storage::data() + offset; 193 iterator iend = Storage::data() + m_size- 1;195 iterator iend = Storage::data() + sint32( m_size ) - 1; 194 196 raw_alias_copy( iposition, iend, iposition + 1 ); 195 197 copy_construct_object( iposition, value ); … … 202 204 // TODO: distance can't be called on destructive iterators - check 203 205 // and use pushback if needed? 206 NV_ASSERT( first <= last, "Bad arguments passed to insert!" ); 204 207 ptrdiff_t offset = position - Storage::data(); 205 size_type d = distance( first, last);208 size_type d = size_type( distance( first, last ) ); 206 209 if ( try_grow( d ) ) 207 210 { 208 211 iterator iposition = Storage::data() + offset; 209 iterator iend = Storage::data() + m_size- d;212 iterator iend = Storage::data() + sint32( m_size ) - d; 210 213 raw_alias_copy( iposition, iend, iposition + d ); 211 214 InitializePolicy::copy( first, last, iposition ); … … 217 220 size_type old_size = m_size; 218 221 resize_impl( new_size ); 219 if ( m_size > old_size ) InitializePolicy::initialize( Storage::data() + old_size, Storage::data() + m_size);222 if ( m_size > old_size ) InitializePolicy::initialize( Storage::data() + old_size, Storage::data() + sint32( m_size ) ); 220 223 } 221 224 … … 224 227 size_type old_size = m_size; 225 228 resize_impl( new_size ); 226 if ( m_size > old_size ) uninitialized_construct( Storage::data() + old_size, Storage::data() + m_size);229 if ( m_size > old_size ) uninitialized_construct( Storage::data() + old_size, Storage::data() + sint32( m_size ) ); 227 230 } 228 231 … … 231 234 size_type old_size = m_size; 232 235 resize_impl( new_size ); 233 if ( m_size > old_size ) uninitialized_fill( Storage::data() + old_size, Storage::data() + m_size, value );236 if ( m_size > old_size ) uninitialized_fill( Storage::data() + old_size, Storage::data() + sint32( m_size ), value ); 234 237 } 235 238 … … 249 252 // TODO: distance can't be called on destructive iterators - check 250 253 // and use pushback if needed? 251 if ( m_size > 0 ) InitializePolicy::destroy( Storage::data(), Storage::data() + m_size ); 252 size_type d = distance( first, last ); 254 NV_ASSERT( first <= last, "Bad arguments passed to insert!" ); 255 if ( m_size > 0 ) InitializePolicy::destroy( Storage::data(), Storage::data() + sint32( m_size ) ); 256 size_type d = size_type( distance( first, last ) ); 253 257 if ( try_resize( d, false ) ) 254 258 InitializePolicy::copy( first, last, Storage::data() ); … … 265 269 if ( m_size > 0 ) 266 270 { 267 InitializePolicy::destroy( Storage::data(), Storage::data() + m_size);271 InitializePolicy::destroy( Storage::data(), Storage::data() + sint32( m_size ) ); 268 272 m_size = size_impl_type(); 269 273 } … … 285 289 if ( new_size < old_size ) 286 290 { 287 InitializePolicy::destroy( Storage::data() + new_size, Storage::data() + old_size);291 InitializePolicy::destroy( Storage::data() + sint32( new_size ), Storage::data() + sint32( old_size ) ); 288 292 } 289 293 if ( try_resize( new_size, true ) ) -
trunk/nv/stl/functional/hash.hh
r479 r487 174 174 constexpr hash_value() : m_value( 0 ) {} 175 175 constexpr explicit hash_value( hash_type value ) : m_value( value ) {} 176 constexpr hash_value( const hash_value& ) = default;177 176 178 177 constexpr bool is_valid() const { return m_value != 0; } -
trunk/nv/stl/hash_store.hh
r486 r487 74 74 public: 75 75 typedef hash_table_base< hash_store_entry_policy< T, H > > base_type; 76 typedef typename base_type::iterator iterator; 77 typedef typename base_type::const_iterator const_iterator; 78 typedef typename base_type::insert_return_type insert_return_type; 76 79 typedef H key_type; 77 80 typedef H query_type; -
trunk/nv/stl/math/angle.hh
r471 r487 139 139 140 140 template < typename T, typename enable_if< is_floating_point<T>::value >::type* = nullptr > 141 inline T angle( T a, T y)141 inline T angle( T a, T b ) 142 142 { 143 143 return acos( clamp( dot( a, b ), T( -1 ), T( 1 ) ) ); … … 156 156 const T result( acos( clamp( dot( a, b ), T( -1 ), T( 1 ) ) ) ); 157 157 158 if ( all( epsilon_equal( y, math::rotate( a, result ), T( 0.0001 ) ) ) )158 if ( all( epsilon_equal( b, math::rotate( a, result ), T( 0.0001 ) ) ) ) 159 159 return result; 160 160 else -
trunk/nv/stl/math/exponential.hh
r471 r487 44 44 inline T exp2( T x ) 45 45 { 46 return exp( ln_two<T>() );46 return exp( ln_two<T>() * x ); 47 47 } 48 48 -
trunk/nv/stl/math/matrix_transform.hh
r472 r487 175 175 176 176 tmat4<T> result( T( 0 ) ); 177 result[0][0] = ( static_cast<T>( 2 ) * z Near ) / ( right - left );178 result[1][1] = ( static_cast<T>( 2 ) * z Near ) / ( top - bottom );177 result[0][0] = ( static_cast<T>( 2 ) * z_near ) / ( right - left ); 178 result[1][1] = ( static_cast<T>( 2 ) * z_near ) / ( top - bottom ); 179 179 result[2][2] = ep - static_cast<T>( 1 ); 180 180 result[2][3] = static_cast<T>( -1 ); … … 217 217 { 218 218 NV_ASSERT( delta.x > T( 0 ) && delta.y > T( 0 ), "bad delta passed to pick_matrix!" ); 219 if ( !( delta.x > T( 0 ) && delta.y > T( 0 ) ) ) return result; 220 221 tmat4<T> result( 1 ); 219 if ( !( delta.x > T( 0 ) && delta.y > T( 0 ) ) ) return tmat4<T>( 1 ); 220 222 221 tvec3<T> temp( 223 222 ( T( viewport[2] ) - T( 2 ) * ( center.x - T( viewport[0] ) ) ) / delta.x, … … 226 225 ); 227 226 228 result = translate( result, temp );227 tmat4<T> result = translate( result, temp ); 229 228 return scale( result, tvec3<T>( T( viewport[2] ) / delta.x, T( viewport[3] ) / delta.y, T( 1 ) ) ); 230 229 } -
trunk/nv/stl/math/quaternion.hh
r485 r487 41 41 { 42 42 NV_ASSERT( i >= 0 && i < 4, "index out of range" ); 43 return ( &x )[i] 43 return ( &x )[i]; 44 44 } 45 45 inline const T& operator[]( length_type i ) const 46 46 { 47 47 NV_ASSERT( i >= 0 && i < 4, "index out of range" ); 48 return ( &x )[i] 48 return ( &x )[i]; 49 49 } 50 50 51 51 constexpr tquat() 52 : x( 0 ), y( 0 ), z( 0 ), w( 1 ) {} ;52 : x( 0 ), y( 0 ), z( 0 ), w( 1 ) {} 53 53 constexpr tquat( const tquat<T>& q ) 54 54 : x( q.x ), y( q.y ), z( q.z ), w( q.w ) {} -
trunk/nv/stl/priority_queue.hh
r446 r487 80 80 void emplace( Args&&... args ) 81 81 { 82 m_data.emplace_back( :: std::forward<Args>( args )... );82 m_data.emplace_back( ::nv::forward<Args>( args )... ); 83 83 push_heap( m_data.begin(), m_data.end(), m_compare ); 84 84 } -
trunk/nv/stl/string.hh
r485 r487 134 134 135 135 constexpr explicit string_hash( hash_type value ) : inherited_type( value ) {} 136 constexpr string_hash( const string_hash& value ) = default;137 136 }; 138 137 -
trunk/src/core/ascii_printer.cc
r486 r487 20 20 for ( char c : text ) 21 21 { 22 m_terminal->print( coord, color, static_cast<unsigned char>( c ));22 m_terminal->print( coord, color, c ); 23 23 ++coord.x; 24 24 if ( coord.x >= m_terminal->get_size().x ) break; -
trunk/src/core/io_event.cc
r450 r487 64 64 ; 65 65 66 uint32 counter = 0;67 66 db->create_type<io_event_code>() 68 # define NV_IO_EVENT( id ) .value( #id, counter++)67 # define NV_IO_EVENT( id ) .value( #id, id ) 69 68 # include <nv/detail/io_event_list.inc> 70 69 # undef NV_IO_EVENT -
trunk/src/core/random.cc
r471 r487 22 22 { 23 23 m_state[0] = static_cast<uint32>( seed & mt_full_mask ); 24 for ( inti = 1; i < mersenne_n; i++ )24 for ( uint32 i = 1; i < mersenne_n; i++ ) 25 25 { 26 26 m_state[i] = ( 1812433253UL * ( m_state[i - 1] ^ ( m_state[i - 1] >> 30 ) ) + i ); … … 71 71 72 72 random::random( random::seed_type seed /*= 0 */ ) 73 : m_ remaining( 0 ), m_next( nullptr), m_seeded( 0 )73 : m_next( nullptr ), m_remaining( 0 ), m_seeded( 0 ) 74 74 { 75 75 mt_init( seed == 0 ? randomized_seed() : seed ); -
trunk/src/curses/curses_terminal.cc
r406 r487 53 53 } 54 54 55 void curses_terminal::print( position p, uint32 color, unsignedchar ch )55 void curses_terminal::print( position p, uint32 color, char ch ) 56 56 { 57 57 m_update_needed = true; … … 64 64 attrset((static_cast<uint32>(color+1) << 24) & 0xff000000ul); 65 65 } 66 mvaddch( p.y-1, p.x-1, ch );66 mvaddch( p.y-1, p.x-1, chtype(ch) ); 67 67 ::move( m_cursor.y-1, m_cursor.x-1 ); 68 68 } -
trunk/src/engine/animation.cc
r486 r487 61 61 layer.def_state = -1; 62 62 63 if ( layer.mask != -1)63 if ( layer.mask >= 0 ) 64 64 { 65 65 const auto& tree = animator->poses->get_tree(); 66 66 layer.mask_vector.resize( tree.size(), false ); 67 fill_mask_vector_rec( layer.mask_vector, tree, layer.mask);67 fill_mask_vector_rec( layer.mask_vector, tree, uint32( layer.mask ) ); 68 68 } 69 69 -
trunk/src/formats/assimp_loader.cc
r486 r487 215 215 { 216 216 aiBone* bone = mesh->mBones[m]; 217 for ( unsigned int w=0; w<bone->mNumWeights; w++)217 for ( size_t w=0; w<bone->mNumWeights; w++) 218 218 { 219 219 assimp_skinned_vtx& v = vtx[ bone->mWeights[w].mVertexId ]; 220 220 bool found = false; 221 for ( int i = 0 ; i < 4; ++i )221 for ( size_t i = 0 ; i < 4; ++i ) 222 222 { 223 223 if ( v.boneweight[i] <= 0.0f ) … … 409 409 { 410 410 assimp_skinned_vtx& vertex = channel.data()[v]; 411 for ( int i = 0; i < 4; ++i )411 for ( size_t i = 0; i < 4; ++i ) 412 412 { 413 413 if ( vertex.boneweight[i] > 0.0f ) … … 429 429 mat4 tr = nv::math::inverse( assimp_mat4_cast( m_data->node_by_name[bone_data[i].name]->mTransformation ) ); 430 430 int pid = bone_data[i].parent_id; 431 if ( pid != -1)432 bone_data[i].transform = tr * bone_data[ pid].transform;431 if ( pid >= 0 ) 432 bone_data[i].transform = tr * bone_data[ size_t( pid ) ].transform; 433 433 else 434 434 bone_data[i].transform = tr; … … 492 492 { 493 493 int this_is_incorrect; 494 return m_mesh_count == 0 || m_data->scene->mNumAnimations > 0 && m_data->skeletons.size() == 0; 495 } 496 497 int indent = 0; 494 return m_mesh_count == 0 || ( m_data->scene->mNumAnimations > 0 && m_data->skeletons.size() == 0 ); 495 } 498 496 499 497 void nv::assimp_loader::scan_nodes( const void* node ) const … … 537 535 transform t = nv::transform( nv::assimp_mat4_cast( node->mTransformation ) ); 538 536 539 nodes[ this_id ] = anode ? create_keys( anode, t ) : data_channel_set_creator::create_set( 0 ); 540 541 infos[this_id].name = make_name( name ); 542 infos[this_id].parent_id = parent_id; 537 nodes[ uint32( this_id ) ] = anode ? create_keys( anode, t ) : data_channel_set_creator::create_set( 0 ); 538 infos[ uint32( this_id ) ].name = make_name( name ); 539 infos[ uint32( this_id ) ].parent_id = parent_id; 543 540 // This value is ignored by the create_transformed_keys, but needed by create_direct_keys! 544 541 // TODO: find a common solution! -
trunk/src/formats/nmd_loader.cc
r486 r487 66 66 { 67 67 if ( count == 0 ) return; 68 source.seek( count * sizeof( nmd_attribute), origin::CUR );68 source.seek( long( count * sizeof( nmd_attribute ) ), origin::CUR ); 69 69 } 70 70 … … 220 220 void nv::nmd_dump_bones( stream& stream_out, const data_node_list& nodes ) 221 221 { 222 uint32 total = sizeof( nmd_animation_header ); 223 for ( auto node : nodes ) 224 { 225 total += sizeof( nmd_element_header ); 226 } 222 uint32 total = sizeof( nmd_animation_header ) + sizeof( nmd_element_header ) * nodes.size(); 227 223 228 224 nmd_element_header header; -
trunk/src/gfx/image.cc
r406 r487 26 26 : m_size( size ), m_depth( depth ), m_data( nullptr ) 27 27 { 28 NV_ASSERT( size.x >= 0 && size.y >= 0, "bad parameters passed to image!" ); 28 29 sint32 bsize = m_size.x * m_size.y * static_cast<sint32>( m_depth ); 29 m_data = new uint8[ bsize];30 m_data = new uint8[ size_t( bsize ) ]; 30 31 31 32 if ( reversed ) -
trunk/src/gfx/mesh_creator.cc
r482 r487 265 265 delete[] tangents2; 266 266 267 uint32 n_channel_index = m_data->get_channel_index( slot::NORMAL ); 268 data_channel_set_creator( m_data ).set_channel( n_channel_index, merge_channels( *m_nrm_channel, g_channel ) ); 267 int n_channel_index = m_data->get_channel_index( slot::NORMAL ); 268 NV_ASSERT( n_channel_index >= 0, "Normal channel not found!" ); 269 data_channel_set_creator( m_data ).set_channel( uint32( n_channel_index ), merge_channels( *m_nrm_channel, g_channel ) ); 269 270 initialize(); 270 271 } -
trunk/src/gfx/texture_font.cc
r471 r487 80 80 static uint8* convert_to_rgba(uint8* rgb, const int lines, const int line_count, const int line_bpitch ) 81 81 { 82 uint8* result = new uint8[ lines * line_count * 4];82 uint8* result = new uint8[ static_cast< uint32 >( lines * line_count * 4 ) ]; 83 83 uint8* rgba = result; 84 84 for(int l=0; l<lines; ++l) -
trunk/src/gl/gl_context.cc
r485 r487 216 216 glBindBufferBase( buffer_type_to_enum( info->type ), index, info->glid ); 217 217 else 218 glBindBufferRange( buffer_type_to_enum( info->type ), index, info->glid, offset, size);218 glBindBufferRange( buffer_type_to_enum( info->type ), index, info->glid, static_cast<GLintptr>( offset ), static_cast<GLsizeiptr>( size ) ); 219 219 } 220 220 } … … 790 790 else 791 791 { 792 glDrawArrays( primitive_to_enum(prim), first, static_cast<GLsizei>( count ) );792 glDrawArrays( primitive_to_enum(prim), static_cast<GLint>( first ), static_cast<GLsizei>( count ) ); 793 793 } 794 794 unbind( va ); -
trunk/src/gl/gl_device.cc
r485 r487 358 358 if ( info ) 359 359 { 360 int result = glGetUniformBlockIndex( info->glid, name.data() );361 if ( result >= 0 ) return result;360 GLuint result = glGetUniformBlockIndex( info->glid, name.data() ); 361 if ( result != GL_INVALID_INDEX ) return static_cast<int>( result ); 362 362 if ( fatal ) 363 363 { … … 427 427 if ( ubase->is_dirty() ) 428 428 { 429 int uloc = ubase->get_location(); 429 GLint uloc = ubase->get_location(); 430 GLsizei size = static_cast<GLsizei>( ubase->get_length() ); 430 431 switch( ubase->get_type() ) 431 432 { 432 case FLOAT : glUniform1fv( uloc, ubase->get_length(), static_cast< uniform< enum_to_type< FLOAT >::type >*>( ubase )->get_value() ); break;433 case INT : glUniform1iv( uloc, ubase->get_length(), static_cast< uniform< enum_to_type< INT >::type >*>( ubase )->get_value() ); break;434 case FLOAT_VECTOR_2 : glUniform2fv( uloc, ubase->get_length(), reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_2 >::type >*>( ubase )->get_value())); break;435 case FLOAT_VECTOR_3 : glUniform3fv( uloc, ubase->get_length(), reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_3 >::type >*>( ubase )->get_value())); break;436 case FLOAT_VECTOR_4 : glUniform4fv( uloc, ubase->get_length(), reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_4 >::type >*>( ubase )->get_value())); break;437 case INT_VECTOR_2 : glUniform2iv( uloc, ubase->get_length(), reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_2 >::type >*>( ubase )->get_value())); break;438 case INT_VECTOR_3 : glUniform3iv( uloc, ubase->get_length(), reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_3 >::type >*>( ubase )->get_value())); break;439 case INT_VECTOR_4 : glUniform4iv( uloc, ubase->get_length(), reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_4 >::type >*>( ubase )->get_value())); break;440 case FLOAT_MATRIX_2 : glUniformMatrix2fv( uloc, ubase->get_length(), GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_2 >::type >*>( ubase )->get_value())); break;441 case FLOAT_MATRIX_3 : glUniformMatrix3fv( uloc, ubase->get_length(), GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_3 >::type >*>( ubase )->get_value())); break;442 case FLOAT_MATRIX_4 : glUniformMatrix4fv( uloc, ubase->get_length(), GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_4 >::type >*>( ubase )->get_value())); break;433 case FLOAT : glUniform1fv( uloc, size, static_cast< uniform< enum_to_type< FLOAT >::type >*>( ubase )->get_value() ); break; 434 case INT : glUniform1iv( uloc, size, static_cast< uniform< enum_to_type< INT >::type >*>( ubase )->get_value() ); break; 435 case FLOAT_VECTOR_2 : glUniform2fv( uloc, size, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_2 >::type >*>( ubase )->get_value())); break; 436 case FLOAT_VECTOR_3 : glUniform3fv( uloc, size, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_3 >::type >*>( ubase )->get_value())); break; 437 case FLOAT_VECTOR_4 : glUniform4fv( uloc, size, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_4 >::type >*>( ubase )->get_value())); break; 438 case INT_VECTOR_2 : glUniform2iv( uloc, size, reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_2 >::type >*>( ubase )->get_value())); break; 439 case INT_VECTOR_3 : glUniform3iv( uloc, size, reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_3 >::type >*>( ubase )->get_value())); break; 440 case INT_VECTOR_4 : glUniform4iv( uloc, size, reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_4 >::type >*>( ubase )->get_value())); break; 441 case FLOAT_MATRIX_2 : glUniformMatrix2fv( uloc, size, GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_2 >::type >*>( ubase )->get_value())); break; 442 case FLOAT_MATRIX_3 : glUniformMatrix3fv( uloc, size, GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_3 >::type >*>( ubase )->get_value())); break; 443 case FLOAT_MATRIX_4 : glUniformMatrix4fv( uloc, size, GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_4 >::type >*>( ubase )->get_value())); break; 443 444 default : break; // error? 444 445 } … … 507 508 } 508 509 509 uniform_base* u = uniform_base::create( utype, uni_loc, uni_len);510 uniform_base* u = uniform_base::create( utype, uni_loc, size_t( uni_len ) ); 510 511 NV_ASSERT( u, "Unknown uniform type!" ); 511 512 (*p->m_uniform_map)[ name ] = u; -
trunk/src/gui/gui_ascii_renderer.cc
r444 r487 18 18 bool clear; 19 19 bool border; 20 uchar8border_chars[8];20 char border_chars[8]; 21 21 uint32 border_color; 22 22 uint32 text_color; … … 67 67 er->border_color = uint32( border_color ); 68 68 for ( uint32 i = 0; i < 8 && i < path.length(); i++ ) 69 er->border_chars[i] = static_cast< uchar8 >( path[i] );69 er->border_chars[i] = path[i]; 70 70 } 71 71 } … … 102 102 for ( char c : e->m_text ) 103 103 { 104 m_terminal->print( p, er->text_color, static_cast< unsigned char >( c ));104 m_terminal->print( p, er->text_color, c ); 105 105 ++p.x; 106 106 } -
trunk/src/gui/gui_gfx_renderer.cc
r472 r487 311 311 } 312 312 313 e->m_text;313 // e->m_text; 314 314 if ( !e->m_text.empty() ) 315 315 { -
trunk/src/gui/gui_style.cc
r448 r487 33 33 if ( !resolve( e->m_id, e->m_class, cselector, centry, LUA_TTABLE ) ) return false; 34 34 vec = vec4(); 35 for ( int i = 0; i < 4; ++i )35 for ( size_t i = 0; i < 4; ++i ) 36 36 { 37 lua_rawgeti( m_lua, -1, i +1);37 lua_rawgeti( m_lua, -1, int(i+1) ); 38 38 if ( lua_isnil( m_lua, -1 ) ) return true; 39 39 vec[i] = static_cast< float >( lua_tonumber( m_lua, -1 ) ); -
trunk/src/image/miniz.cc
r486 r487 3 3 4 4 using namespace nv; 5 6 #define MINIZ_NO_TIME 7 #define MINIZ_NO_ZLIB_COMPATIBLE_NAMES 8 9 #define MINIZ_HAS_64BIT_REGISTERS 0 10 #define TINFL_USE_64BIT_BITBUF 0 11 12 #if NV_COMPILER == NV_CLANG 13 #pragma clang diagnostic ignored "-Wunused-macros" 14 #pragma clang diagnostic ignored "-Wold-style-cast" 15 #pragma clang diagnostic ignored "-Wsign-conversion" 16 #endif 5 17 6 18 #if defined( _M_IX86 ) || defined( _M_X64 ) || defined( __i386__ ) || defined( __i386 ) || defined( __i486__ ) || defined( __i486 ) || defined( i386 ) || defined( __ia64__ ) || defined( __x86_64__ ) -
trunk/src/image/png_loader.cc
r486 r487 10 10 11 11 using namespace nv; 12 13 #if NV_COMPILER == NV_CLANG 14 #pragma clang diagnostic ignored "-Wunused-macros" 15 #pragma clang diagnostic ignored "-Wold-style-cast" 16 #pragma clang diagnostic ignored "-Wsign-conversion" 17 #pragma clang diagnostic ignored "-Wreserved-id-macro" 18 #pragma clang diagnostic ignored "-Wmissing-prototypes" 19 #define NULL 0 20 #endif 12 21 13 22 enum … … 322 331 }; 323 332 333 static int iabs( int a ) 334 { 335 return a < 0 ? -a : a; 336 } 337 324 338 static int stbi__paeth( int a, int b, int c ) 325 339 { 326 340 int p = a + b - c; 327 int pa = abs( p - a );328 int pb = abs( p - b );329 int pc = abs( p - c );341 int pa = iabs( p - a ); 342 int pb = iabs( p - b ); 343 int pc = iabs( p - c ); 330 344 if ( pa <= pb && pa <= pc ) return a; 331 345 if ( pb <= pc ) return b; … … 1050 1064 case 3: format.format = RGB; break; 1051 1065 case 4: format.format = RGBA; break; 1052 default: return false;1066 default: return nullptr; 1053 1067 } 1054 1068 size = ivec2( x, y ); -
trunk/src/io/c_stream.cc
r486 r487 50 50 { 51 51 NV_ASSERT( buffer != nullptr && max_count != 0, "Bad parameter passed to write!" ); 52 char* result = ::fgets( buffer, max_count, reinterpret_cast<FILE*>( m_file ) );52 char* result = ::fgets( buffer, static_cast<int>( max_count ), reinterpret_cast<FILE*>( m_file ) ); 53 53 if ( !result ) return false; 54 54 return true; -
trunk/src/lib/gl.cc
r466 r487 161 161 if ( wgl_library_loaded ) return true; 162 162 163 HGLRC ( NV_GL_APIENTRY *wgl_createcontext) (HDC) = nullptr;164 BOOL ( NV_GL_APIENTRY *wgl_makecurrent) (HDC, HGLRC) = nullptr;165 BOOL ( NV_GL_APIENTRY *wgl_deletecontext) (HGLRC) = nullptr;163 HGLRC ( NV_GL_APIENTRY *wgl_createcontext) (HDC) = nullptr; 164 BOOL ( NV_GL_APIENTRY *wgl_makecurrent) (HDC, HGLRC) = nullptr; 165 BOOL ( NV_GL_APIENTRY *wgl_deletecontext) (HGLRC) = nullptr; 166 166 167 167 void_assign( wgl_createcontext, gl_library.get("wglCreateContext") ); -
trunk/src/lua/lua_math.cc
r471 r487 11 11 #include "nv/stl/type_traits/common.hh" 12 12 13 static int nlua_swizzel_lookup[256];13 static size_t nlua_swizzel_lookup[256]; 14 14 15 15 using nv::lua::detail::is_vec; … … 18 18 using nv::lua::detail::push_vec; 19 19 20 inline bool nlua_is_swizzel( const unsigned char* str, int max )20 inline bool nlua_is_swizzel( const unsigned char* str, size_t max ) 21 21 { 22 22 while (*str) … … 279 279 { 280 280 switch (len) { 281 case 2 : { vec2 v2 = to_vec<vec2>(L,3); for ( int i = 0; i<int( len ); ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v2[i]; } return 0;282 case 3 : { vec3 v3 = to_vec<vec3>(L,3); for ( int i = 0; i<int( len ); ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v3[i]; } return 0;283 case 4 : { vec4 v4 = to_vec<vec4>(L,3); for ( int i = 0; i<int( len ); ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v4[i]; } return 0;281 case 2 : { vec2 v2 = to_vec<vec2>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v2[i]; } return 0; 282 case 3 : { vec3 v3 = to_vec<vec3>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v3[i]; } return 0; 283 case 4 : { vec4 v4 = to_vec<vec4>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v4[i]; } return 0; 284 284 default: break; 285 285 } -
trunk/src/stl/assert.cc
r440 r487 28 28 # else // NV_COMPILER 29 29 # if NV_COMPILER == NV_CLANG 30 extern "C" { 31 extern void __assert(const char *, const char *, unsigned int, const char *) NV_NORETURN; 30 // extern "C" { 31 // extern void __assert(const char *, const char *, unsigned int, const char *) NV_NORETURN; 32 // } 33 34 int error_here; 35 static void __assert( const char *, const char *, unsigned int, const char * ) NV_NORETURN 36 { 37 //no-op 32 38 } 39 33 40 #define NV_ASSERT_IMPL __assert 34 41 # else
Note: See TracChangeset
for help on using the changeset viewer.