- Timestamp:
- 08/26/14 04:03:10 (11 years ago)
- Location:
- trunk/src
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/curses/curses_terminal.cc
r319 r323 58 58 if ( color > 7 ) 59 59 { 60 attrset((static_cast<uint32>(color-7) << 24) & 0xff000000ul | 0x00800000ul);60 attrset((static_cast<uint32>(color-7) << 24) & ( 0xff000000ul | 0x00800000ul ) ); 61 61 } 62 62 else -
trunk/src/engine/particle_engine.cc
r320 r323 577 577 case particle_origin::CENTER : break; 578 578 case particle_origin::TOP_LEFT : lb = vec2(0.f,-1.f); rt = vec2(1.f,0.f); break; 579 case particle_origin::TOP_CENTER : lb.y = -1.f; rt.y = 0.f; break; break;579 case particle_origin::TOP_CENTER : lb.y = -1.f; rt.y = 0.f; break; 580 580 case particle_origin::TOP_RIGHT : lb = vec2(-1.f,-1.f); rt = vec2(); break; 581 581 case particle_origin::CENTER_LEFT : lb.x = 0.f; rt.x = 1.f; break; … … 663 663 { 664 664 if ( info->count > 0 ) 665 for ( sint32 i = info->count-1; i >= 0; --i )665 for ( sint32 i = (sint32)info->count-1; i >= 0; --i ) 666 666 { 667 667 particle& pinfo = info->particles[i]; … … 723 723 { 724 724 float emission_angle = glm::radians( edata.angle ); 725 float cos_theta = r.frange( cos( emission_angle ), 1.0f );725 float cos_theta = r.frange( glm::cos( emission_angle ), 1.0f ); 726 726 float sin_theta = glm::sqrt(1.0f - cos_theta * cos_theta ); 727 727 float phi = r.frange( 0.0f, 2*glm::pi<float>() ); -
trunk/src/engine/program_manager.cc
r319 r323 57 57 for ( uint32 i = 1; i <= count; ++i ) 58 58 { 59 std::string include( inctable.get<std::string, int>(i) );59 std::string include( inctable.get<std::string,uint32>(i) ); 60 60 if ( i == count ) out += "#line 1\n"; 61 61 out += nv::slurp( include ); -
trunk/src/engine/resource_system.cc
r319 r323 29 29 clear(); 30 30 lua::table_guard table( m_lua, get_storage_name() ); 31 uint32 count = table.get_ integer( "__counter" );31 uint32 count = table.get_unsigned( "__counter" ); 32 32 for ( auto i : range( count ) ) 33 33 { -
trunk/src/formats/assimp_loader.cc
r302 r323 14 14 using namespace nv; 15 15 16 const intMAX_BONES = 64;16 const unsigned MAX_BONES = 64; 17 17 18 18 struct assimp_plain_vtx … … 90 90 m_mesh_count = 0; 91 91 NV_LOG( nv::LOG_NOTICE, "AssImp loading file..." ); 92 int size = (int)source.size();92 size_t size = source.size(); 93 93 char* data = new char[ size ]; 94 94 source.read( data, size, 1 ); … … 159 159 if ( v.boneweight[i] <= 0.0f ) 160 160 { 161 v.boneindex[i] =m;161 v.boneindex[i] = (int)m; 162 162 v.boneweight[i] = bone->mWeights[w].mWeight; 163 163 found = true; … … 289 289 for ( unsigned int m = 0; m < m_mesh_count; ++m ) 290 290 { 291 sint16 translate[MAX_BONES];291 uint16 translate[MAX_BONES]; 292 292 std::vector< mesh_node_data > bones; 293 293 const aiMesh* mesh = scene->mMeshes[ m ]; … … 304 304 { 305 305 NV_ASSERT( final_bones.size() < MAX_BONES, "Too many bones to merge!" ); 306 sint16 index = (sint16)final_bones.size();306 uint16 index = (uint16)final_bones.size(); 307 307 final_bones.push_back( bone ); 308 308 names[ bone.name ] = index; … … 311 311 else 312 312 { 313 translate[b] = (sint16)iname->second;313 translate[b] = iname->second; 314 314 } 315 315 } … … 326 326 if ( vertex.boneweight[i] > 0.0f ) 327 327 { 328 vertex.boneindex[i] = translate[vertex.boneindex[i]];328 vertex.boneindex[i] = (int)translate[vertex.boneindex[i]]; 329 329 } 330 330 } -
trunk/src/formats/md3_loader.cc
r319 r323 234 234 235 235 md3_loader::md3_loader( bool merge_all ) 236 : m_m d3( nullptr ), m_merge_all( merge_all)236 : m_merge_all( merge_all ), m_md3( nullptr ) 237 237 { 238 238 if ( !s_normal_ready ) … … 286 286 { 287 287 md3_t* md3 = (md3_t*)m_md3; 288 key_raw_channel* result = key_raw_channel::create<md3_key>( md3->header.num_frames );288 key_raw_channel* result = key_raw_channel::create<md3_key>( (uint32)md3->header.num_frames ); 289 289 // TODO: is this brain damaged in efficiency (loop nest order) or what? 290 290 for ( sint32 f = 0; f < md3->header.num_frames; ++f ) … … 322 322 { 323 323 mesh_data* data = new mesh_data; 324 release_mesh_frame( data, -1, index );324 release_mesh_frame( data, -1, (sint32)index ); 325 325 return data; 326 326 } … … 329 329 { 330 330 md3_t* md3 = (md3_t*)m_md3; 331 sint32 num_surfaces =md3->header.num_surfaces;332 sint32 num_verts = 0;333 sint32 current_frame = ( frame == -1 ? 0 :frame );334 sint32 frame_count = ( frame == -1 ?md3->header.num_frames : 1 );335 sint32 current_surf = ( surface == -1 ? 0 :surface );336 sint32 surf_count = ( surface == -1 ?md3->header.num_surfaces : 1 );337 sint32 index_count = 0;331 uint32 num_surfaces = (uint32)md3->header.num_surfaces; 332 uint32 num_verts = 0; 333 uint32 current_frame = ( frame == -1 ? 0 : (uint32)frame ); 334 uint32 frame_count = ( frame == -1 ? (uint32)md3->header.num_frames : 1 ); 335 uint32 current_surf = ( surface == -1 ? 0 : (uint32)surface ); 336 uint32 surf_count = ( surface == -1 ? (uint32)md3->header.num_surfaces : 1 ); 337 uint32 index_count = 0; 338 338 339 339 if ( surface >= 0 ) 340 340 { 341 index_count = md3->surfaces[surface].header.num_triangles * 3;342 num_verts = md3->surfaces[surface].header.num_verts;341 index_count = (uint32)md3->surfaces[(uint32)surface].header.num_triangles * 3; 342 num_verts = (uint32)md3->surfaces[(uint32)surface].header.num_verts; 343 343 } 344 344 else 345 for ( sint32 i = 0; i < num_surfaces; ++i )346 { 347 index_count += md3->surfaces[i].header.num_triangles * 3;348 num_verts += md3->surfaces[i].header.num_verts;345 for ( uint32 i = 0; i < num_surfaces; ++i ) 346 { 347 index_count += (uint32)md3->surfaces[i].header.num_triangles * 3; 348 num_verts += (uint32)md3->surfaces[i].header.num_verts; 349 349 } 350 350 … … 362 362 while ( surf_count > 0 ) 363 363 { 364 const md3_surface_t& s urface= md3->surfaces[ current_surf ];365 const uint32 vcount = static_cast< uint32 >( surface.header.num_verts );366 const uint32 tcount = static_cast< uint32 >( surface.header.num_triangles );364 const md3_surface_t& sface = md3->surfaces[ current_surf ]; 365 const uint32 vcount = static_cast< uint32 >( sface.header.num_verts ); 366 const uint32 tcount = static_cast< uint32 >( sface.header.num_triangles ); 367 367 368 368 for (uint32 j = 0; j < vcount; ++j ) 369 369 { 370 vtx_t[index++].texcoord = md3_texcoord( s urface.st[j] );370 vtx_t[index++].texcoord = md3_texcoord( sface.st[j] ); 371 371 } 372 372 373 373 for (size_t j = 0; j < tcount; ++j ) 374 374 { 375 const md3_triangle_t& t = s urface.triangles[j];375 const md3_triangle_t& t = sface.triangles[j]; 376 376 icp[iindex++] = static_cast< uint16 >( index_base + t.indexes[0] ); 377 377 icp[iindex++] = static_cast< uint16 >( index_base + t.indexes[1] ); 378 378 icp[iindex++] = static_cast< uint16 >( index_base + t.indexes[2] ); 379 379 } 380 index_base += s urface.header.num_verts;380 index_base += sface.header.num_verts; 381 381 ++current_surf; 382 382 --surf_count; … … 386 386 while ( frame_count > 0 ) 387 387 { 388 current_surf = ( surface == -1 ? 0 : surface );389 surf_count = ( surface == -1 ? md3->header.num_surfaces : 1 );388 current_surf = ( surface == -1 ? 0 : (uint32)surface ); 389 surf_count = ( surface == -1 ? (uint32)md3->header.num_surfaces : 1 ); 390 390 391 391 while ( surf_count > 0 ) 392 392 { 393 md3_surface_t& s urface= md3->surfaces[current_surf];394 sint32 vcount = surface.header.num_verts;395 sint32 offset= vcount * current_frame;396 sint32 limit= vcount + offset;397 for ( sint32 j = offset; j < limit; ++j )393 md3_surface_t& sface = md3->surfaces[current_surf]; 394 uint32 vcount = (uint32)sface.header.num_verts; 395 uint32 offset = vcount * current_frame; 396 uint32 limit = vcount + offset; 397 for (uint32 j = offset; j < limit; ++j ) 398 398 { 399 md3_vertex_t& v = s urface.vertices[j];399 md3_vertex_t& v = sface.vertices[j]; 400 400 vtx_pn[index].position = vec3( v.x * MD3_XYZ_SCALE, v.z * MD3_XYZ_SCALE, v.y * MD3_XYZ_SCALE ); 401 401 vtx_pn[index].normal = s_normal_cache[ v.normal ]; … … 418 418 { 419 419 md3_t* md3 = (md3_t*)m_md3; 420 uint32 node_count = md3->header.num_tags;420 uint32 node_count = (uint32)md3->header.num_tags; 421 421 if ( node_count == 0 ) return nullptr;; 422 422 mesh_node_data* nodes = new mesh_node_data[ node_count ]; … … 451 451 else 452 452 { 453 count = md3->header.num_surfaces;453 count = (uint32)md3->header.num_surfaces; 454 454 data = new mesh_data[ count ]; 455 455 for ( uint32 i = 0; i < count; ++i ) 456 456 { 457 release_mesh_frame( &data[i], -1, i );457 release_mesh_frame( &data[i], -1, (sint32)i ); 458 458 data[i].set_name( (char*)md3->surfaces[i].header.name ); 459 459 } -
trunk/src/formats/md5_loader.cc
r319 r323 135 135 mesh_data* mesh = new mesh_data("md5_mesh"); 136 136 137 intnum_verts = 0;138 intnum_tris = 0;139 intnum_weights = 0;137 uint32 num_verts = 0; 138 uint32 num_tris = 0; 139 uint32 num_weights = 0; 140 140 141 141 discard( sstream, "{" ); … … 170 170 next_line( sstream ); 171 171 std::string line; 172 for ( inti = 0; i < num_verts; ++i )172 for ( uint32 i = 0; i < num_verts; ++i ) 173 173 { 174 174 size_t weight_count; … … 194 194 next_line( sstream ); 195 195 std::string line; 196 for ( inti = 0; i < num_tris; ++i )196 for ( uint32 i = 0; i < num_tris; ++i ) 197 197 { 198 198 size_t ti0; … … 214 214 next_line( sstream ); 215 215 std::string line; 216 for ( inti = 0; i < num_weights; ++i )216 for ( uint32 i = 0; i < num_weights; ++i ) 217 217 { 218 218 md5_weight weight; … … 368 368 if ( j < weight_count ) 369 369 { 370 vdata.boneindex[j] = weights[start_weight + j].joint_id;370 vdata.boneindex[j] = (int)weights[start_weight + j].joint_id; 371 371 vdata.boneweight[j] = weights[start_weight + j].bias; 372 372 } -
trunk/src/formats/nmd_loader.cc
r319 r323 242 242 243 243 nmd_node_header nheader; 244 nheader.parent_id = (uint16)node->parent_id;244 nheader.parent_id = node->parent_id; 245 245 nheader.transform = node->transform; 246 246 stream_out.write( &nheader, sizeof( nheader ), 1 ); -
trunk/src/gfx/image.cc
r319 r323 89 89 fill( r, 255 ); 90 90 91 sint32 bpos = (r.pos.y*m_size.x + r.pos.x ) * static_cast<sint32>( m_depth );92 sint32 bline = m_size.x*static_cast<sint32>( m_depth );91 uint32 bpos = static_cast< uint32 >( r.pos.y*m_size.x + r.pos.x ) * m_depth; 92 uint32 bline = static_cast< uint32 >( m_size.x ) * m_depth; 93 93 94 uint32 rsizex = static_cast< uint32 >( r.size.x ); 95 uint32 rsizey = static_cast< uint32 >( r.size.y ); 94 96 const uint8* data = idata->get_data(); 95 si nt32depth = idata->get_depth();96 sint32 dstride = r.size.x * static_cast<sint32>( depth );97 size_t depth = idata->get_depth(); 98 uint32 dstride = rsizex * depth; 97 99 98 for( int y = 0; y < r.size.y; ++y )100 for( uint32 y = 0; y < rsizey; ++y ) 99 101 { 100 sint32 pos = bpos + bline * y;101 for( int x = 0; x < r.size.x; ++x )102 uint32 pos = bpos + bline * y; 103 for( uint32 x = 0; x < rsizex; ++x ) 102 104 { 103 sint32 xy = pos + x * m_depth;104 for( int e = 0; e < depth; ++e )105 uint32 xy = pos + x * m_depth; 106 for( size_t e = 0; e < depth; ++e ) 105 107 { 106 108 m_data[ xy + e ] = data[ y*dstride + x * depth + e ]; -
trunk/src/gfx/mesh_creator.cc
r302 r323 128 128 const vertex_descriptor& desc = channel->desc; 129 129 uint8* raw_data = channel->data; 130 intvtx_size = desc.size;130 uint32 vtx_size = desc.size; 131 131 int p_offset = -1; 132 132 int n_offset = -1; … … 135 135 switch ( desc.slots[i].vslot ) 136 136 { 137 case slot::POSITION : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) p_offset = desc.slots[i].offset; break;138 case slot::NORMAL : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) n_offset = desc.slots[i].offset; break;139 case slot::TANGENT : if ( desc.slots[i].etype == FLOAT_VECTOR_4 ) t_offset = desc.slots[i].offset; break;137 case slot::POSITION : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) p_offset = (int)desc.slots[i].offset; break; 138 case slot::NORMAL : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) n_offset = (int)desc.slots[i].offset; break; 139 case slot::TANGENT : if ( desc.slots[i].etype == FLOAT_VECTOR_4 ) t_offset = (int)desc.slots[i].offset; break; 140 140 default : break; 141 141 } … … 173 173 size_t n_offset = 0; 174 174 if ( ch_n == -1 ) return; 175 mesh_raw_channel* channel = m_data->m_channels[ ch_n];175 mesh_raw_channel* channel = m_data->m_channels[ (unsigned) ch_n ]; 176 176 for ( uint32 i = 0; i < channel->desc.count; ++i ) 177 177 if ( channel->desc.slots[i].vslot == slot::NORMAL ) … … 211 211 if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) 212 212 { 213 p_offset = desc.slots[i].offset;213 p_offset = (int)desc.slots[i].offset; 214 214 p_channel = channel; 215 215 } … … 217 217 case slot::NORMAL : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) 218 218 { 219 n_offset = desc.slots[i].offset;219 n_offset = (int)desc.slots[i].offset; 220 220 n_channel = m_data->m_channels[ c ]; 221 221 n_channel_index = c; … … 224 224 case slot::TEXCOORD : if ( desc.slots[i].etype == FLOAT_VECTOR_2 ) 225 225 { 226 t_offset = desc.slots[i].offset;226 t_offset = (int)desc.slots[i].offset; 227 227 t_channel = channel; 228 228 } … … 420 420 int och_ti = other->get_channel_index( slot::TEXCOORD ); 421 421 if ( ch_pi == -1 || ch_ti == -1 ) return; 422 size_t size = m_data->m_channels[ ch_ti ]->count;423 size_t osize = other->m_channels[ och_ti ]->count;424 size_t count = m_data->m_channels[ ch_pi ]->count;425 size_t ocount = other->m_channels[ och_pi ]->count;422 size_t size = m_data->m_channels[ (unsigned)ch_ti ]->count; 423 size_t osize = other->m_channels[ (unsigned)och_ti ]->count; 424 size_t count = m_data->m_channels[ (unsigned)ch_pi ]->count; 425 size_t ocount = other->m_channels[ (unsigned)och_pi ]->count; 426 426 if ( count % size != 0 || ocount % osize != 0 ) return; 427 427 if ( count / size != ocount / osize ) return; -
trunk/src/gfx/skeletal_mesh.cc
r319 r323 53 53 for ( size_t j = 0; j < 4; ++j ) 54 54 { 55 int index =vert.boneindex[j];56 float weight = vert.boneweight[j];55 unsigned index = (unsigned)vert.boneindex[j]; 56 float weight = vert.boneweight[j]; 57 57 const quat& orient = m_transform[index].get_orientation(); 58 58 const transform& offset = m_pos_offset[index]; … … 152 152 if ( bi != bone_names.end() ) 153 153 { 154 bone_id = bi->second;154 bone_id = (sint16)bi->second; 155 155 } 156 156 m_bone_ids[n] = bone_id; -
trunk/src/gl/gl_device.cc
r319 r323 132 132 texture result = m_textures.create(); 133 133 gl_texture_info* info = m_textures.get( result ); 134 info->format = aformat;135 info-> sampler = asampler;136 info->size = size;137 info->glid = glid;134 info->format = aformat; 135 info->tsampler = asampler; 136 info->size = size; 137 info->glid = glid; 138 138 return result; 139 139 } -
trunk/src/gl/gl_enum.cc
r319 r323 232 232 case BYTE_VECTOR_3 : return GL_INT_VEC3; 233 233 case BYTE_VECTOR_4 : return GL_INT_VEC4; 234 NV_RETURN_COVERED_DEFAULT( 0 );234 default : return 0; // TODO: throw! 235 235 } 236 236 } -
trunk/src/gl/gl_window.cc
r319 r323 19 19 20 20 #if NV_SDL_VERSION == NV_SDL_20 21 uint32 ucode = ke.keysym.sym;22 #else 23 uint32 ucode = ke.keysym.unicode;21 uint32 ucode = (uint32)ke.keysym.sym; 22 #else 23 uint32 ucode = (uint32)ke.keysym.unicode; 24 24 #endif 25 25 … … 34 34 int capslock = !!(ke.keysym.mod & KMOD_CAPS); 35 35 if ((shifted ^ capslock) != 0) { 36 kevent.key.ascii = (char8)SDL_toupper( ucode);36 kevent.key.ascii = (char8)SDL_toupper((int)ucode); 37 37 } 38 38 } -
trunk/src/lib/gl.cc
r319 r323 19 19 // for wgl support 20 20 #if NV_PLATFORM == NV_WINDOWS 21 # ifndef WIN32_LEAN_AND_MEAN22 # define WIN32_LEAN_AND_MEAN 123 # endif24 21 #include <windows.h> 25 # undef WIN32_LEAN_AND_MEAN 26 #endif 27 28 // extern added for wgl needs only! 29 #define NV_GL_FUN( rtype, fname, fparams ) extern "C" rtype (NV_GL_APIENTRY *fname) fparams = nullptr; 30 #define NV_GL_FUN_REN( rtype, fname, rname, fparams ) extern "C" rtype (NV_GL_APIENTRY *rname) fparams = nullptr; 22 #endif 23 24 #define NV_GL_FUN( rtype, fname, fparams ) rtype (NV_GL_APIENTRY *fname) fparams = nullptr; 25 #define NV_GL_FUN_REN( rtype, fname, rname, fparams ) rtype (NV_GL_APIENTRY *rname) fparams = nullptr; 31 26 #define NV_GL_FUN_EXT NV_GL_FUN 32 27 #include <nv/lib/detail/gl_functions.inc> … … 41 36 static nv::library gl_library; 42 37 static nv::gl_extensions gl_loaded_extensions = nv::gl_extensions(0); 43 extern "C"void* (NV_GL_APIENTRY *gl_ext_loader) ( const char* ) = nullptr;38 static void* (NV_GL_APIENTRY *gl_ext_loader) ( const char* ) = nullptr; 44 39 static bool gl_library_loaded = false; 45 40 static bool wgl_library_loaded = false; … … 52 47 }; 53 48 54 static const char *gl_extension_ids[] = {55 "UNKNOWN",56 #define NV_GL_EXTENSION( count, id, name ) #id,57 #include <nv/lib/detail/gl_ext/gl_ext_info.inc>58 #undef NV_GL_EXTENSION59 };49 // static const char *gl_extension_ids[] = { 50 // "UNKNOWN", 51 // #define NV_GL_EXTENSION( count, id, name ) #id, 52 // #include <nv/lib/detail/gl_ext/gl_ext_info.inc> 53 // #undef NV_GL_EXTENSION 54 // }; 60 55 61 56 … … 184 179 wndClass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; 185 180 186 DWORD err =GetLastError();181 /*DWORD err = */GetLastError(); 187 182 RegisterClass(&wndClass); 188 err =GetLastError();183 /*err = */GetLastError(); 189 184 190 185 … … 235 230 } 236 231 237 238 232 bool nv::load_gl_extension( gl_extensions extension ) 239 233 { -
trunk/src/lua/lua_map_tile.cc
r319 r323 27 27 28 28 29 bool nlua_is_map_tile( lua_State* L, int index )30 {31 return luaL_testudata( L, index, NLUA_MAP_TILE_METATABLE ) != 0;32 }33 34 map_tile nlua_to_map_tile( lua_State* L, int index )35 {36 return *(map_tile*)luaL_checkudata( L, index, NLUA_MAP_TILE_METATABLE );37 }38 39 map_tile* nlua_to_pmap_tile( lua_State* L, int index )29 // static bool nlua_is_map_tile( lua_State* L, int index ) 30 // { 31 // return luaL_testudata( L, index, NLUA_MAP_TILE_METATABLE ) != 0; 32 // } 33 // 34 // static map_tile nlua_to_map_tile( lua_State* L, int index ) 35 // { 36 // return *(map_tile*)luaL_checkudata( L, index, NLUA_MAP_TILE_METATABLE ); 37 // } 38 39 static map_tile* nlua_to_pmap_tile( lua_State* L, int index ) 40 40 { 41 41 return (map_tile*)luaL_checkudata( L, index, NLUA_MAP_TILE_METATABLE ); 42 42 } 43 43 44 void nlua_push_map_tile( lua_State* L, const map_tile& tile )44 static void nlua_push_map_tile( lua_State* L, const map_tile& tile ) 45 45 { 46 46 map_tile* result = (map_tile*)lua_newuserdata( L, sizeof(map_tile) ); … … 79 79 if ( lua_isstring( L, -2 ) && lua_objlen( L, -2 ) == 1 ) 80 80 { 81 translation[ lua_tostring( L, -2 )[0]] = nv::uint8( map_area->string_to_id( lua_tostring( L, -1 ) ) );81 translation[ (nv::uint8)( lua_tostring( L, -2 )[0] ) ] = nv::uint8( map_area->string_to_id( lua_tostring( L, -1 ) ) ); 82 82 } 83 83 // removes 'value'; keeps 'key' for next iteration */ … … 86 86 } 87 87 88 for ( intline = 0; line < tile.size_x; line++ )89 for ( introw = 0; row < tile.size_y; row++ )90 { 91 nv::char8 gylph = code[ row * ( tile.size_x + 1 ) + line ];88 for ( nv::uint16 line = 0; line < tile.size_x; line++ ) 89 for ( nv::uint16 row = 0; row < tile.size_y; row++ ) 90 { 91 nv::char8 gylph = (nv::char8)code[ row * ( tile.size_x + 1 ) + line ]; 92 92 // TODO: check for errors 93 93 tile.data[ row * tile.size_x + line ] = translation[ gylph ]; … … 203 203 switch ( nv::random::get().urand( 4 ) ) 204 204 { 205 case 1 : nlua_map_tile_flip_x( L ); 206 case 2 : nlua_map_tile_flip_y( L ); 207 case 3 : nlua_map_tile_flip_xy( L ); 205 case 1 : nlua_map_tile_flip_x( L ); break; 206 case 2 : nlua_map_tile_flip_y( L ); break; 207 case 3 : nlua_map_tile_flip_xy( L ); break; 208 208 default: 209 209 break; -
trunk/src/lua/lua_nova.cc
r319 r323 9 9 #include "nv/lua/lua_raw.hh" 10 10 11 const char* NV_STATE = "NV_STATE";12 const char* NV_BLUEPRINTS = "NV_BLUEPRINTS";11 static const char* NV_STATE = "NV_STATE"; 12 static const char* NV_BLUEPRINTS = "NV_BLUEPRINTS"; 13 13 14 14 // static nv::lua::state* nova_get_state( lua_State * L ) … … 73 73 return true; 74 74 } 75 break; 75 76 case LUA_TSTRING : 76 77 if ( lua_type( L, ivalue ) != LUA_TTABLE ) … … 86 87 lua_concat( L, 3 ); 87 88 lua_call( L, 3, 0 ); 89 break; 88 90 case LUA_TNUMBER : 89 91 if (lua_tointeger( L, itype ) != lua_type( L, ivalue ) && lua_tointeger( L, itype ) > 0) … … 91 93 luaL_error( L, "lua.nova - \"%s.%s\" - type mismatch, %s expected, %s found!", lua_tolstring( L, iid, 0 ), lua_tolstring( L, ifield, 0 ), lua_typename( L, lua_tointeger( L, itype ) ), lua_typename( L, lua_type( L, ivalue ) ) ); 92 94 } 93 95 break; 96 default : return false; 94 97 } 95 98 return false; … … 784 787 785 788 786 int luaopen_nova( lua_State * L )789 static int luaopen_nova( lua_State * L ) 787 790 { 788 791 lua_createtable( L, 0, 0 );
Note: See TracChangeset
for help on using the changeset viewer.