Ignore:
Timestamp:
08/26/14 04:03:10 (11 years ago)
Author:
epyon
Message:
  • nova now compiles again under all three compilers with -Winsane and no warnings
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lua/lua_map_tile.cc

    r319 r323  
    2727
    2828
    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
     39static map_tile* nlua_to_pmap_tile( lua_State* L, int index )
    4040{
    4141        return (map_tile*)luaL_checkudata( L, index, NLUA_MAP_TILE_METATABLE );
    4242}
    4343
    44 void nlua_push_map_tile( lua_State* L, const map_tile& tile )
     44static void nlua_push_map_tile( lua_State* L, const map_tile& tile )
    4545{
    4646        map_tile* result = (map_tile*)lua_newuserdata( L, sizeof(map_tile) );
     
    7979                        if ( lua_isstring( L, -2 ) && lua_objlen( L, -2 ) == 1 )
    8080                        {
    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 ) ) );
    8282                        }
    8383                        // removes 'value'; keeps 'key' for next iteration */
     
    8686        }
    8787
    88         for ( int line = 0; line < tile.size_x; line++ )
    89                 for ( int row = 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 ];
    9292                        // TODO: check for errors
    9393                        tile.data[ row * tile.size_x + line ] = translation[ gylph ];
     
    203203        switch ( nv::random::get().urand( 4 ) )
    204204        {
    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;
    208208        default:
    209209                break;
Note: See TracChangeset for help on using the changeset viewer.