Changeset 323


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
Location:
trunk
Files:
44 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv.lua

    r321 r323  
    55        includedirs { "." }
    66        files { "nv/core/**.hh", "nv/interface/**.hh", "nv/detail/**.inc", "src/core/**.cc" }
    7         targetname "nv-core"
    87
    98project "nv-lib"
     
    1413        files { "nv/lib/**.hh", "nv/lib/**.inl", "nv/lib/**.inc", "src/lib/**.cc" }
    1514        links { "nv-core" }
    16         targetname "nv-lib"
    1715
    1816project "nv-curses"
     
    2321        files { "nv/curses/**.hh",  "src/curses/**.cc" }
    2422        links { "nv-core", "nv-lib" }
    25         targetname "nv-curses"
    2623
    2724project "nv-fmod"
     
    3229        files { "nv/fmod/**.hh",    "src/fmod/**.cc" }
    3330        links { "nv-core", "nv-lib" }
    34         targetname "nv-fmod"
    3531
    3632project "nv-sdl"
     
    4137        files { "nv/sdl/**.hh",     "src/sdl/**.cc" }
    4238        links { "nv-core", "nv-lib" }
    43         targetname "nv-sdl"
    4439
    4540project "nv-gl"
     
    5045        files { "nv/gl/**.hh",     "src/gl/**.cc" }
    5146        links { "nv-core", "nv-lib" }
    52         targetname "nv-gl"
    5347
    5448project "nv-lua"
     
    5953        files { "nv/lua/**.hh",     "src/lua/**.cc" }
    6054        links { "nv-core", "nv-lib" }
    61         targetname "nv-lua"
    6255
    6356project "nv-rogue"
     
    6861        files { "nv/rogue/**.hh",     "src/rogue/**.cc" }
    6962        links { "nv-core" }
    70         targetname "nv-rogue"
    7163
    7264project "nv-io"
     
    7769        files { "nv/io/**.hh",     "src/io/**.cc" }
    7870        links { "nv-core" }
    79         targetname "nv-io"
    8071
    8172project "nv-gfx"
     
    8677        files { "nv/gfx/**.hh",  "src/gfx/**.cc" }
    8778        links { "nv-core" }
    88         targetname "nv-gfx"
    8979
    9080project "nv-engine"
     
    9484        includedirs { "." }
    9585        files { "nv/engine/**.hh",  "src/engine/**.cc" }
    96         links { "nv-core", "nv-lua" }
    97         targetname "nv-engine"
     86        links { "nv-core", "nv-lib", "nv-lua" }
    9887
    9988project "nv-formats"
     
    10493        files { "nv/formats/**.hh", "src/formats/**.cc" }
    10594        links { "nv-core", "nv-lib", "nv-io", "nv-gfx" }
    106         targetname "nv-formats"
    10795
    10896project "nv-gui"
     
    112100        includedirs { "." }
    113101        files { "nv/gui/**.hh",     "src/gui/**.cc" }
    114         links { "nv-core", "nv-io", "nv-gfx", "nv-lua" }
    115         targetname "nv-gui"
    116 
    117 project "nv"
    118         location (_ACTION)
    119         language "C++"
    120         kind "StaticLib"
    121         includedirs { "." }
    122         links { "nv-core", "nv-lib", "nv-curses", "nv-sdl", "nv-fmod", "nv-lua", "nv-gl", "nv-rogue", "nv-io", "nv-gfx", "nv-engine", "nv-formats", "nv-gui" }
    123         targetname "nv"
     102        links { "nv-core", "nv-lib", "nv-io", "nv-gfx", "nv-lua" }
    124103
    125104-- injection!
     
    151130                                -- no reasonable way to fix this with abstract
    152131                                -- interfaces.
    153                                 "-Wno-weak-vtables"
     132                                "-Wno-weak-vtables",
     133                                -- this can be reenabled if I find a nice solution
     134                                "-Wno-cast-align",
    154135                        }
    155136                        --buildoptions {
     
    159140                        buildoptions { "-std=c++0x" }
    160141                end
     142        configuration { "windows", "gmake" }
     143                linkoptions { "-mwindows" }
    161144
    162145        configuration "linux"
  • trunk/nv/core/array.hh

    r319 r323  
    1616#include <nv/core/common.hh>
    1717#include <vector>
     18#include <algorithm>
    1819#include <array>
    1920
    2021namespace nv
    2122{
    22         namespace detail
    23         {
    24                 template < typename T >
    25                 class array_base
    26                 {
    27                 public:
    28                         typedef T              value_type;
    29                         typedef T*             iterator;
    30                         typedef const T*       const_iterator;
    31                         typedef T&             reference;
    32                         typedef const T&       const_reference;
    33                         typedef std::size_t    size_type;
    34                         typedef std::ptrdiff_t difference_type;
    35 
    36                         typedef std::reverse_iterator<iterator>       reverse_iterator;
    37                         typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
    38                 };
    39         }
    40 
    4123        using std::vector;
    4224        using std::array;
    4325
    4426        template< class T, std::size_t N >
    45         class static_array : public detail::array_base<T>
     27        class static_array
    4628        {
    4729        public:
     30                typedef T              value_type;
     31                typedef T*             iterator;
     32                typedef const T*       const_iterator;
     33                typedef T&             reference;
     34                typedef const T&       const_reference;
     35                typedef std::size_t    size_type;
     36                typedef std::ptrdiff_t difference_type;
     37
     38                typedef std::reverse_iterator<iterator>       reverse_iterator;
     39                typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
     40
    4841                iterator        begin()        { return m_data; }
    4942                const_iterator  begin()  const { return m_data; }
     
    9992
    10093        template< class T >
    101         class dynamic_array : public detail::array_base<T>
     94        class dynamic_array
    10295        {
    10396        public:
     97                typedef T              value_type;
     98                typedef T*             iterator;
     99                typedef const T*       const_iterator;
     100                typedef T&             reference;
     101                typedef const T&       const_reference;
     102                typedef std::size_t    size_type;
     103                typedef std::ptrdiff_t difference_type;
     104
     105                typedef std::reverse_iterator<iterator>       reverse_iterator;
     106                typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
     107
    104108                dynamic_array()
    105109                        : m_data( nullptr ), m_size(0) {}
  • trunk/nv/core/array2d.hh

    r319 r323  
    337337                                // The end position is either the size limit or the end of either array, whichever is smaller.
    338338                                // Destination start is the beginning of the current destination row (which is dest_start_y + i), offset by dest_start_x.
    339                                 std:copy( source.m_data + ( source_start_y + i ) * source.m_size.x + source_start_x,  // Source Start
     339                                std::copy( source.m_data + ( source_start_y + i ) * source.m_size.x + source_start_x,  // Source Start
    340340                                                  source.m_data + ( source_start_y + i ) * source.m_size.x + min( source.m_size.x, min( source_start_x + size_x, source_start_x + m_size.x - dest_start_x ) ), // Source End
    341341                                                  m_data + (dest_start_y + i) * m_size.x + dest_start_x ); // Destination Start
  • trunk/nv/core/handle.hh

    r319 r323  
    4242                bool is_valid() const { return !is_nil(); }
    4343                T index() const { return m_index; }
    44                 size_t hash() const { return std::hash<T>()( m_counter << IBITS | m_index ); }
     44                size_t hash() const { return std::hash<T>()( T( m_counter << IBITS | m_index ) ); }
    4545        protected:
    4646                T m_index   : IBITS;
     
    8181                                return;
    8282                        }
    83                         m_entries[ m_last_free ].next_free = h.m_index;
     83                        m_entries[ (unsigned)m_last_free ].next_free = h.m_index;
    8484                        m_last_free = h.m_index;
    8585                }
     
    145145                T* insert( handle h )
    146146                {
    147                         resize_indexes_to( h.index() );
    148                         m_indexes[ h.index() ] = m_data.size();
     147                        resize_indexes_to( (index_type) h.index() );
     148                        m_indexes[ h.index() ] = (index_type) m_data.size();
    149149                        m_handles.push_back( h );
    150150                        m_data.emplace_back();
     
    162162                        if ( h.is_nil() || h.index() >= m_indexes.size() ) return nullptr;
    163163                        index_type i = m_indexes[ h.index() ];
    164                         return i >= 0 ? &(m_data[ i ]) : nullptr;
     164                        return i >= 0 ? &(m_data[ (unsigned)i ]) : nullptr;
    165165                }
    166166
     
    171171                        if ( dead_eindex != (sint32)m_data.size()-1 )
    172172                        {
    173                                 m_data[ dead_eindex ]            = m_data.back();
    174                                 m_handles[ dead_eindex ]        = swap_handle;
    175                                 m_indexes[ swap_handle.index() ] = dead_eindex;
     173                                m_data[ (unsigned)dead_eindex ]    = m_data.back();
     174                                m_handles[ (unsigned)dead_eindex ] = swap_handle;
     175                                m_indexes[ swap_handle.index() ]   = dead_eindex;
    176176                        }
    177177                        m_data.pop_back();
     
    207207                                if ( size == 0 ) size = 1;
    208208                                while ( i >= size ) size = size * 2;
    209                                 m_indexes.resize( size, -1 );
     209                                m_indexes.resize( (size_t)size, -1 );
    210210                        }
    211211                }
     
    249249                        if ( h.is_nil() ) return nullptr;
    250250                        sint32 eindex = m_indexes.get_index( h );
    251                         return eindex >= 0 ? &(m_data[ eindex ]) : nullptr;
     251                        return eindex >= 0 ? &(m_data[ (unsigned)eindex ]) : nullptr;
    252252                }
    253253
     
    256256                        if ( h.is_nil() ) return nullptr;
    257257                        sint32 eindex = m_indexes.get_index( h );
    258                         return eindex >= 0 ? &(m_data[ eindex ]) : nullptr;
     258                        return eindex >= 0 ? &(m_data[ (unsigned)eindex ]) : nullptr;
    259259                }
    260260
     
    265265                        if ( dead_eindex != (sint32)m_data.size()-1 )
    266266                        {
    267                                 m_data[ dead_eindex ]    = m_data.back();
    268                                 m_handles[ dead_eindex ] = m_handles.back();
     267                                m_data[ (unsigned)dead_eindex ]    = m_data.back();
     268                                m_handles[ (unsigned)dead_eindex ] = m_handles.back();
    269269                        }
    270270                        m_data.pop_back();
     
    274274                }
    275275
    276                 handle get_handle( index_type i ) const { return m_handles[i]; }
    277                 const value_type& operator[] ( index_type i ) const { return m_data[i]; }
    278                 value_type& operator[] ( index_type i ) { return m_data[i]; }
     276                handle get_handle( index_type i ) const { return m_handles[(unsigned)i]; }
     277                const value_type& operator[] ( index_type i ) const { return m_data[(unsigned)i]; }
     278                value_type& operator[] ( index_type i ) { return m_data[(unsigned)i]; }
    279279                size_t size() const { return m_data.size(); }
    280280
  • trunk/nv/core/range.hh

    r319 r323  
    4747                {
    4848                public:
    49                         range_iterator_base( T value ) : forward_iterator_base( value ) {}
     49                        typedef forward_iterator_base< T > base_class;
     50
     51                        range_iterator_base( T value ) : forward_iterator_base<T>( value ) {}
    5052                        range_iterator_base& operator++ ()
    5153                        {
    52                                 ++m_value;
     54                                ++base_class::m_value;
    5355                                return *this;
    5456                        }
     
    6668                {
    6769                public:
     70                        typedef forward_iterator_base< glm::detail::tvec2<T> > base_class;
     71
    6872                        range2d_iterator_base( glm::detail::tvec2<T> value, T min, T max )
    69                                 : forward_iterator_base( value ), m_min(min), m_max(max) {}
     73                                : forward_iterator_base< glm::detail::tvec2<T> >( value ), m_min(min), m_max(max) {}
    7074                        range2d_iterator_base& operator++ ()
    7175                        {
    72                                 ++m_value.x;
    73                                 if ( m_value.x > m_max )
     76                                ++base_class::m_value.x;
     77                                if ( base_class::m_value.x > m_max )
    7478                                {
    75                                         ++m_value.y;
    76                                         m_value.x = m_min;
     79                                        ++base_class::m_value.y;
     80                                        base_class::m_value.x = m_min;
    7781                                }
    7882                                return *this;
     
    9498                public:
    9599                        typedef typename base_underlying_type<T>::type base_type;
     100                        typedef forward_iterator_base< T > base_class;
     101
    96102                        static const T invalid = T( 0 );
    97103
    98                         bits_iterator_base( T value, T current ) : forward_iterator_base( current ), m_full( value )
     104                        bits_iterator_base( T value, T current ) : forward_iterator_base<T>( current ), m_full( value )
    99105                        {
    100106                                if( !( (base_type)value & (base_type)current ) )
     
    117123                                do
    118124                                {
    119                                         if ( m_value == invalid || m_full <= m_value ) { m_value = invalid; m_full = invalid; break; }
    120                                         m_value = T((base_type)m_value << 1);
    121                                 } while ( !( (base_type)m_full & (base_type)m_value ) );
     125                                        if ( base_class::m_value == invalid || m_full <= base_class::m_value ) { base_class::m_value = invalid; m_full = invalid; break; }
     126                                        base_class::m_value = T((base_type)base_class::m_value << 1);
     127                                } while ( !( (base_type)m_full & (base_type)base_class::m_value ) );
    122128                        }
    123129
     
    213219        auto index( const C& c ) -> range_iterator_provider<decltype( c.size() )>
    214220        {
    215                 return range_iterator_provider( 0, c.size() );
     221                return range_iterator_provider<decltype( c.size() )>( 0, c.size() );
    216222        }
    217223
  • trunk/nv/core/time.hh

    r319 r323  
    115115                typedef typename Timer::value_type value_type;
    116116
    117                 fps_counter_class() : frames(1), last(0) {}
     117                fps_counter_class() : m_frames(1), m_last(0), m_value(0.0f) {}
    118118                bool tick()
    119119                {
    120120                        value_type now = Timer()();
    121                         if ( now - last >= Timer::second )
     121                        if ( now - m_last >= Timer::second )
    122122                        {
    123                                 value = (static_cast<float>(frames) /
    124                                         static_cast<float>(now - last))*Timer::second;
    125                                 frames = 1;
    126                                 last = now;
     123                                m_value = (static_cast<float>(m_frames) /
     124                                        static_cast<float>(now - m_last))*Timer::second;
     125                                m_frames = 1;
     126                                m_last = now;
    127127                                return true;
    128128                        }
    129                         frames++;
     129                        m_frames++;
    130130                        return false;
    131131                }
    132132                f32 fps() const
    133133                {
    134                         return value;
     134                        return m_value;
    135135                }
    136136        private:
    137                 value_type last;
    138                 uint32     frames;
    139                 f32        value;
     137                uint32     m_frames;
     138                value_type m_last;
     139                f32        m_value;
    140140        };
    141141
  • trunk/nv/core/uid.hh

    r319 r323  
    8484        public:
    8585                T* get( uid auid ) const      { return static_cast<T*>( m_store.get( auid ) ); }
    86                 bool remove( uid auid )       { m_store.remove( auid ); }
     86                bool remove( uid auid )       { return m_store.remove( auid ); }
    8787                void insert( T* o, uid auid ) { m_store.insert( o, auid ); }
    8888                uid insert( T* o )            { return m_store.insert( o ); }
     
    9292                 * Retrieves an object and casts it to the specified type.
    9393                 *
    94                  * @tparam T The type to cast to.
     94                 * @tparam U The type to cast to.
    9595                 * @param auid The ID the object is stored under.
    9696                 * @returns An object of the indicated type that was stored at the indicated ID.
  • trunk/nv/curses/curses_terminal.hh

    r319 r323  
    7171                 * Virtual destructor
    7272                 */
    73                 virtual ~curses_terminal();;
     73                virtual ~curses_terminal();
    7474
    7575        protected:
  • trunk/nv/engine/particle_engine.hh

    r320 r323  
    1919namespace nv
    2020{
    21         static const int MAX_PARTICLE_EMMITERS  = 8;
    22         static const int MAX_PARTICLE_AFFECTORS = 8;
     21        static const unsigned MAX_PARTICLE_EMMITERS  = 8;
     22        static const unsigned MAX_PARTICLE_AFFECTORS = 8;
    2323
    2424        struct particle_emmiter_data;
  • trunk/nv/engine/resource_system.hh

    r319 r323  
    3737                void load_all();
    3838                resource_id load_resource( const std::string& id );
     39                virtual ~resource_manager_base() {}
    3940        protected:
    4041                virtual resource_id load_resource( lua::table_guard& table ) = 0;
  • trunk/nv/formats/md5_loader.hh

    r319 r323  
    5252                enum file_type { UNKNOWN, MESH, ANIMATION };
    5353
    54                 md5_loader() : m_nodes( nullptr ), m_type( UNKNOWN ) {}
     54                md5_loader() : m_type( UNKNOWN ), m_nodes( nullptr ) {}
    5555                virtual ~md5_loader();
    5656                virtual bool load( stream& source );
  • trunk/nv/gfx/animation.hh

    r319 r323  
    8686                                        return keyfresult;
    8787                                }
    88                                 for ( int i = 1 ; i < (int)count ; i++ )
     88                                for ( unsigned i = 1 ; i < count ; i++ )
    8989                                {
    90                                         if ( time < fdata[ i * keyfsize ] ) { index0 = i - 1; break; }
     90                                        if ( time < fdata[ i * keyfsize ] ) { index0 = (int)i - 1; break; }
    9191                                }
    9292                                NV_ASSERT( index0 >= 0, "animation time fail!");
    9393                                index1 = index0 + 1;
    94                                 float time0  = fdata[ index0 * keyfsize ];
    95                                 float time1  = fdata[ index1 * keyfsize ];
     94                                float time0  = fdata[ index0 * (int)keyfsize ];
     95                                float time1  = fdata[ index1 * (int)keyfsize ];
    9696                                float delta  = time1 - time0;
    9797                                factor = glm::clamp( (time - time0) / delta, 0.0f, 1.0f );
     
    104104                                        return keyfresult;
    105105                                }
    106                                 index0 = glm::clamp<int>( int( time ), 0, count - 2 );
     106                                index0 = glm::clamp<int>( (int) time, 0, (int)count - 2 );
    107107                                index1 = index0 + 1;
    108108                                factor = glm::clamp<float> ( time - index0, 0.0f, 1.0f );
     
    113113                                ret += nv::interpolate_raw(
    114114                                        desc.slots[slot], factor,
    115                                         fdata + index0 * keyfsize + desc.slots[slot].offset / 4,
    116                                         fdata + index1 * keyfsize + desc.slots[slot].offset / 4,
     115                                        fdata + index0 * (int)keyfsize + desc.slots[slot].offset / 4,
     116                                        fdata + index1 * (int)keyfsize + desc.slots[slot].offset / 4,
    117117                                        result + ret );
    118118                        }
     
    154154                        }
    155155                        return extract_matrix_raw( m_final_key, key );
    156                 };
     156                }
    157157
    158158                transform get_raw_transform( uint32 index ) const
     
    165165                        }
    166166                        return extract_transform_raw( m_final_key, key );
    167                 };
     167                }
    168168
    169169                mat4 get_matrix( float time ) const
     
    176176                        }
    177177                        return extract_matrix_raw( m_final_key, key );
    178                 };
     178                }
    179179
    180180                transform get_transform( float time ) const
     
    187187                        }
    188188                        return extract_transform_raw( m_final_key, key );
    189                 };
     189                }
    190190
    191191                size_t get_channel_count() const { return m_channels.size(); }
  • trunk/nv/gfx/keyframed_mesh.hh

    r319 r323  
    4848                };
    4949
     50                context*     m_context;
     51
    5052                const mesh_data*        m_mesh_data;
    5153                const mesh_nodes_data*  m_tag_map;
    5254                const mesh_raw_channel* m_vchannel;
    5355
    54                 context*     m_context;
    5556                buffer       m_pbuffer;
    5657                vertex_array m_va;
  • trunk/nv/gfx/skeletal_mesh.hh

    r319 r323  
    5858                dynamic_array< transform >   m_pos_offset;
    5959                dynamic_array< transform >   m_bone_offset;
    60 ;
     60
    6161                const mesh_data*             m_data;
    6262                const md5_vtx_pntiw*         m_vtx_data;
  • trunk/nv/gfx/sliced_buffer.hh

    r319 r323  
    205205                context*    m_context;
    206206                buffer      m_buffer;
     207                buffer_type m_type;
    207208                buffer_hint m_hint;
    208                 buffer_type m_type;
    209209                bool        m_full_update;
    210210                vector      m_data;
  • trunk/nv/interface/animation_key.hh

    r319 r323  
    4747                        template<typename C> static char (&test(...))[2];
    4848                public:
    49                         static bool const value = sizeof(test<derived>(0)) == 2;;
     49                        static bool const value = sizeof(test<derived>(0)) == 2;
    5050                };
    5151
     
    6060                        template<typename C> static char (&test(...))[2];
    6161                public:
    62                         static bool const value = sizeof(test<derived>(0)) == 2;;
     62                        static bool const value = sizeof(test<derived>(0)) == 2;
    6363                };
    6464
     
    7373                        template<typename C> static char (&test(...))[2];
    7474                public:
    75                         static bool const value = sizeof(test<derived>(0)) == 2;;
     75                        static bool const value = sizeof(test<derived>(0)) == 2;
    7676                };
    7777
     
    8686                        template<typename C> static char (&test(...))[2];
    8787                public:
    88                         static bool const value = sizeof(test<derived>(0)) == 2;;
     88                        static bool const value = sizeof(test<derived>(0)) == 2;
    8989                };
    9090
     
    9999                        template<typename C> static char (&test(...))[2];
    100100                public:
    101                         static bool const value = sizeof(test<derived>(0)) == 2;;
     101                        static bool const value = sizeof(test<derived>(0)) == 2;
    102102                };
    103103
     
    193193        struct key_descriptor
    194194        {
    195                 key_descriptor_slot slots[ animation_slot::SLOT_MAX_STORE ];
     195                key_descriptor_slot slots[ (uint16)animation_slot::SLOT_MAX_STORE ];
    196196                uint32              count;
    197197                uint32              size;
  • trunk/nv/interface/context.hh

    r319 r323  
    116116                        typedef vertex_slot_info< VTX, SLOT > vinfo;
    117117                        typedef datatype_traits< typename vinfo::value_type > dt_traits;
    118                         add_vertex_buffer( va, SLOT, vb, type_to_enum< dt_traits::base_type >::type, dt_traits::size, vinfo::offset, sizeof( VTX ), false );
     118                        add_vertex_buffer( va, SLOT, vb, type_to_enum< typename dt_traits::base_type >::type, dt_traits::size, vinfo::offset, sizeof( VTX ), false );
    119119                }
    120120
     
    168168                        vertex_array va = create_vertex_array( v, vcount, hint );
    169169                        buffer       ib = create_buffer( INDEX_BUFFER, hint, icount * sizeof( IDX ), i );
    170                         va->set_index_buffer( ib, type_to_enum< IDX >::type, true );
     170                        set_index_buffer( va, ib, type_to_enum< IDX >::type, true );
    171171                        return va;
    172172                }
     
    247247                        if ( info )
    248248                        {
    249                                 NV_ASSERT( info->count < vertex_array_info::MAX_ATTRIBUTES, "MAX_ATTRIBUTES reached!" );
     249                                NV_ASSERT( info->count < (uint16)vertex_array_info::MAX_ATTRIBUTES, "MAX_ATTRIBUTES reached!" );
    250250                                vertex_buffer_attribute& p = info->attr[ info->count ];
    251251                                p.vbuffer    = buf;
  • trunk/nv/interface/device.hh

    r319 r323  
    101101                ivec2        size;
    102102                image_format format;
    103                 sampler      sampler;
     103                sampler      tsampler;
    104104        };
    105105
     
    173173
    174174                template < typename T >
    175                 void set_uniform_array( const string& name, const std::vector<T>& value )
    176                 {
    177                         set_uniform_array( program p, name, (const T*)value.data(), value.size() );
    178                 }
    179 
    180                 template < typename T >
    181175                void set_opt_uniform_array( program p, const string& name, const T* value, uint32 count )
    182176                {
  • trunk/nv/interface/interpolation_template.hh

    r319 r323  
    4141        {
    4242                template < typename T >
    43                 mat4 extract_matrix_slot( const T& ) { static_assert( false, "extract_matrix_slot" ); }
     43                mat4 extract_matrix_slot( const T& ) { static_assert( sizeof( T ) == 0, "extract_matrix_slot" ); return mat4(); }
    4444                template <> inline mat4 extract_matrix_slot( const mat4& m ) { return m; }
    4545                template <> inline mat4 extract_matrix_slot( const transform& m ) { return m.extract(); }
    4646
    4747                template < typename T >
    48                 transform extract_transfrom_slot( const T& ) { static_assert( false, "extract_matrix_slot" ); }
     48                transform extract_transfrom_slot( const T& ) { static_assert( sizeof( T ) == 0, "extract_matrix_slot" ); return transform(); }
    4949                template <> inline transform extract_transfrom_slot( const mat4& m ) { return transform(m); }
    5050                template <> inline transform extract_transfrom_slot( const transform& m ) { return m; }
     
    8585
    8686                template < typename KEY >
    87                 mat4 extract_matrix_prs( const KEY& k, const std::false_type&, const std::false_type&, const std::false_type& )
     87                mat4 extract_matrix_prs( const KEY&, const std::false_type&, const std::false_type&, const std::false_type& )
    8888                { return mat4(); }
    8989                template < typename KEY >
     
    111111
    112112                template < typename KEY >
    113                 transform extract_transform_pr_impl( const KEY& k, const std::false_type&, const std::false_type& ) { return transform(); }
     113                transform extract_transform_pr_impl( const KEY&, const std::false_type&, const std::false_type& ) { return transform(); }
    114114                template < typename KEY >
    115115                transform extract_transform_pr_impl( const KEY& k, const std::true_type&, const std::true_type& ) { return transform( k.position, k.rotation ); }
  • trunk/nv/interface/map_area.hh

    r319 r323  
    3535                virtual bool is_visible( const position& ) const { return true; }
    3636                virtual bool is_explored( const position& ) const { return true; }
    37                 virtual void set_visible( const position&, bool ) {};
    38                 virtual bool is_transparent( const position& ) const { return true; };
     37                virtual void set_visible( const position&, bool ) {}
     38                virtual bool is_transparent( const position& ) const { return true; }
    3939                virtual ~map_area(){}
    4040        };
  • trunk/nv/interface/mesh_data.hh

    r319 r323  
    137137                                        if ( ch->desc.slots[i].vslot == s )
    138138                                        {
    139                                                 return c;
     139                                                return (int)c;
    140140                                        }
    141141                        }
  • trunk/nv/interface/terminal.hh

    r319 r323  
    2525                 * Constructor
    2626                 */
    27                 terminal( dimension size ) : m_size( size ), m_cursor(1,1) {}
     27                terminal( dimension size ) : m_cursor(1,1), m_size( size ) {}
    2828
    2929        /**
     
    8585                 * Virtual destructor
    8686                 */
    87                 virtual ~terminal() {};
     87                virtual ~terminal() {}
    8888
    8989        protected:
  • trunk/nv/interface/vertex.hh

    r319 r323  
    6565                        template<typename C> static char (&test(...))[2];
    6666                public:
    67                         static bool const value = sizeof(test<derived>(0)) == 2;;
     67                        static bool const value = sizeof(test<derived>(0)) == 2;
    6868                };
    6969
     
    238238        struct vertex_descriptor
    239239        {
    240                 vertex_descriptor_slot slots[ slot::SLOT_MAX_STORE ];
     240                vertex_descriptor_slot slots[ (uint16)slot::SLOT_MAX_STORE ];
    241241                uint32                 count;
    242242                uint32                 size;
  • trunk/nv/io/string_table.hh

    r319 r323  
    2727
    2828                string_table( char* data, uint32 size, offset* offsets, index count )
    29                         : m_count( count ), m_size( size ), m_data( data ), m_offsets( offsets )
     29                        : m_data( data ), m_size( size ), m_offsets( offsets ), m_count( count )
    3030                {
    3131
  • trunk/nv/lib/detail/curses_types.inc

    r218 r323  
    2525
    2626#ifdef CURSES_CHTYPE_LONG
     27# ifdef _LP64
    2728# if _LP64
    2829typedef unsigned int chtype;
     30# else
     31typedef unsigned long chtype;  /* 16-bit attr + 16-bit char */
     32# endif
    2933# else
    3034typedef unsigned long chtype;  /* 16-bit attr + 16-bit char */
  • trunk/nv/lib/wx.hh

    r319 r323  
    5959                nv::context* m_context;
    6060                nv::window*  m_window;
    61                 wxTimer*     m_update_timer;
     61                //wxTimer*     m_update_timer;
    6262                bool         m_render;
    6363                wxDECLARE_EVENT_TABLE();
  • trunk/nv/rogue/fov.hh

    r319 r323  
    2525                        virtual void initialize( map_area*, const dimension& size ) = 0;
    2626                        virtual void run( const position& p, uint16 radius ) = 0;
    27 
     27                        virtual ~fov_algorithm() {}
    2828                };
    2929
  • trunk/src/curses/curses_terminal.cc

    r319 r323  
    5858        if ( color > 7 )
    5959        {
    60                 attrset((static_cast<uint32>(color-7) << 24)  & 0xff000000ul | 0x00800000ul);
     60                attrset((static_cast<uint32>(color-7) << 24)  & ( 0xff000000ul | 0x00800000ul ) );
    6161        }
    6262        else
  • trunk/src/engine/particle_engine.cc

    r320 r323  
    577577        case particle_origin::CENTER        : break;
    578578        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;
    580580        case particle_origin::TOP_RIGHT     : lb = vec2(-1.f,-1.f); rt = vec2(); break;
    581581        case particle_origin::CENTER_LEFT   : lb.x = 0.f; rt.x = 1.f; break;
     
    663663{
    664664        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 )
    666666                {
    667667                        particle& pinfo = info->particles[i];
     
    723723                                        {
    724724                                                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 );
    726726                                                float sin_theta = glm::sqrt(1.0f - cos_theta * cos_theta );
    727727                                                float phi       = r.frange( 0.0f, 2*glm::pi<float>() );
  • trunk/src/engine/program_manager.cc

    r319 r323  
    5757                for ( uint32 i = 1; i <= count; ++i )
    5858                {
    59                         std::string include( inctable.get<std::string,int>(i) );
     59                        std::string include( inctable.get<std::string,uint32>(i) );
    6060                        if ( i == count ) out += "#line 1\n";
    6161                        out += nv::slurp( include );
  • trunk/src/engine/resource_system.cc

    r319 r323  
    2929        clear();
    3030        lua::table_guard table( m_lua, get_storage_name() );
    31         uint32 count = table.get_integer( "__counter" );
     31        uint32 count = table.get_unsigned( "__counter" );
    3232        for ( auto i : range( count ) )
    3333        {
  • trunk/src/formats/assimp_loader.cc

    r302 r323  
    1414using namespace nv;
    1515
    16 const int MAX_BONES = 64;
     16const unsigned MAX_BONES = 64;
    1717
    1818struct assimp_plain_vtx
     
    9090        m_mesh_count = 0;
    9191        NV_LOG( nv::LOG_NOTICE, "AssImp loading file..." );
    92         int size = (int)source.size();
     92        size_t size = source.size();
    9393        char* data  = new char[ size ];
    9494        source.read( data, size, 1 );
     
    159159                                        if ( v.boneweight[i] <= 0.0f )
    160160                                        {
    161                                                 v.boneindex[i] = m;
     161                                                v.boneindex[i]  = (int)m;
    162162                                                v.boneweight[i] = bone->mWeights[w].mWeight;
    163163                                                found = true;
     
    289289        for ( unsigned int m = 0; m < m_mesh_count; ++m )
    290290        {
    291                 sint16 translate[MAX_BONES];
     291                uint16 translate[MAX_BONES];
    292292                std::vector< mesh_node_data > bones;
    293293                const aiMesh*  mesh  = scene->mMeshes[ m ];
     
    304304                                {
    305305                                        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();
    307307                                        final_bones.push_back( bone );
    308308                                        names[ bone.name ] = index;
     
    311311                                else
    312312                                {
    313                                         translate[b] = (sint16)iname->second;
     313                                        translate[b] = iname->second;
    314314                                }
    315315                        }
     
    326326                                                if ( vertex.boneweight[i] > 0.0f )
    327327                                                {
    328                                                         vertex.boneindex[i] = translate[vertex.boneindex[i]];
     328                                                        vertex.boneindex[i] = (int)translate[vertex.boneindex[i]];
    329329                                                }
    330330                                        }
  • trunk/src/formats/md3_loader.cc

    r319 r323  
    234234
    235235md3_loader::md3_loader( bool merge_all )
    236         : m_md3( nullptr ), m_merge_all( merge_all )
     236        : m_merge_all( merge_all ), m_md3( nullptr )
    237237{
    238238        if ( !s_normal_ready )
     
    286286{
    287287        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 );
    289289        // TODO: is this brain damaged in efficiency (loop nest order) or what?
    290290        for ( sint32 f = 0; f < md3->header.num_frames; ++f )
     
    322322{
    323323        mesh_data* data = new mesh_data;
    324         release_mesh_frame( data, -1, index );
     324        release_mesh_frame( data, -1, (sint32)index );
    325325        return data;
    326326}
     
    329329{
    330330        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;
    338338
    339339        if ( surface >= 0 )
    340340        {
    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;
    343343        }
    344344        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;
    349349                }
    350350
     
    362362        while ( surf_count > 0 )
    363363        {
    364                 const md3_surface_t& surface = 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 );
    367367
    368368                for (uint32 j = 0; j < vcount; ++j )
    369369                {
    370                         vtx_t[index++].texcoord = md3_texcoord( surface.st[j] );
     370                        vtx_t[index++].texcoord = md3_texcoord( sface.st[j] );
    371371                }
    372372
    373373                for (size_t j = 0; j < tcount; ++j )
    374374                {
    375                         const md3_triangle_t& t = surface.triangles[j];
     375                        const md3_triangle_t& t = sface.triangles[j];
    376376                        icp[iindex++] = static_cast< uint16 >( index_base + t.indexes[0] );
    377377                        icp[iindex++] = static_cast< uint16 >( index_base + t.indexes[1] );
    378378                        icp[iindex++] = static_cast< uint16 >( index_base + t.indexes[2] );
    379379                }
    380                 index_base += surface.header.num_verts;
     380                index_base += sface.header.num_verts;
    381381                ++current_surf;
    382382                --surf_count;
     
    386386        while ( frame_count > 0 )
    387387        {
    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 );
    390390
    391391                while ( surf_count > 0 )
    392392                {
    393                         md3_surface_t& surface = 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 )
    398398                        {
    399                                 md3_vertex_t& v = surface.vertices[j];
     399                                md3_vertex_t& v = sface.vertices[j];
    400400                                vtx_pn[index].position = vec3( v.x * MD3_XYZ_SCALE, v.z * MD3_XYZ_SCALE, v.y * MD3_XYZ_SCALE );
    401401                                vtx_pn[index].normal   = s_normal_cache[ v.normal ];
     
    418418{
    419419        md3_t* md3 = (md3_t*)m_md3;
    420         uint32 node_count = md3->header.num_tags;
     420        uint32 node_count = (uint32)md3->header.num_tags;
    421421        if ( node_count == 0 ) return nullptr;;
    422422        mesh_node_data* nodes = new mesh_node_data[ node_count ];
     
    451451        else
    452452        {
    453                 count = md3->header.num_surfaces;
     453                count = (uint32)md3->header.num_surfaces;
    454454                data = new mesh_data[ count ];
    455455                for ( uint32 i = 0; i < count; ++i )
    456456                {
    457                         release_mesh_frame( &data[i], -1, i );
     457                        release_mesh_frame( &data[i], -1, (sint32)i );
    458458                        data[i].set_name( (char*)md3->surfaces[i].header.name );
    459459                }
  • trunk/src/formats/md5_loader.cc

    r319 r323  
    135135                        mesh_data* mesh = new mesh_data("md5_mesh");
    136136
    137                         int num_verts   = 0;
    138                         int num_tris    = 0;
    139                         int num_weights = 0;
     137                        uint32 num_verts   = 0;
     138                        uint32 num_tris    = 0;
     139                        uint32 num_weights = 0;
    140140
    141141                        discard( sstream, "{" );
     
    170170                                        next_line( sstream );
    171171                                        std::string line;
    172                                         for ( int i = 0; i < num_verts; ++i )
     172                                        for ( uint32 i = 0; i < num_verts; ++i )
    173173                                        {
    174174                                                size_t weight_count;
     
    194194                                        next_line( sstream );
    195195                                        std::string line;
    196                                         for ( int i = 0; i < num_tris; ++i )
     196                                        for ( uint32 i = 0; i < num_tris; ++i )
    197197                                        {
    198198                                                size_t ti0;
     
    214214                                        next_line( sstream );
    215215                                        std::string line;
    216                                         for ( int i = 0; i < num_weights; ++i )
     216                                        for ( uint32 i = 0; i < num_weights; ++i )
    217217                                        {
    218218                                                md5_weight weight;
     
    368368                        if ( j < weight_count )
    369369                        {
    370                                 vdata.boneindex[j]  = weights[start_weight + j].joint_id;
     370                                vdata.boneindex[j]  = (int)weights[start_weight + j].joint_id;
    371371                                vdata.boneweight[j] = weights[start_weight + j].bias;
    372372                        }
  • trunk/src/formats/nmd_loader.cc

    r319 r323  
    242242
    243243                nmd_node_header nheader;
    244                 nheader.parent_id = (uint16)node->parent_id;
     244                nheader.parent_id = node->parent_id;
    245245                nheader.transform = node->transform;
    246246                stream_out.write( &nheader, sizeof( nheader ), 1 );
  • trunk/src/gfx/image.cc

    r319 r323  
    8989        fill( r, 255 );
    9090
    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;
    9393
     94        uint32 rsizex     = static_cast< uint32 >( r.size.x );
     95        uint32 rsizey     = static_cast< uint32 >( r.size.y );
    9496        const uint8* data = idata->get_data();
    95         sint32 depth      = 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;
    9799
    98         for( int y = 0; y < r.size.y; ++y )
     100        for( uint32 y = 0; y < rsizey; ++y )
    99101        {
    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 )
    102104                {
    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 )
    105107                        {
    106108                                m_data[ xy + e ] = data[ y*dstride + x * depth + e ];
  • trunk/src/gfx/mesh_creator.cc

    r302 r323  
    128128                const vertex_descriptor& desc   = channel->desc;
    129129                uint8* raw_data = channel->data;
    130                 int vtx_size = desc.size;
     130                uint32 vtx_size = desc.size;
    131131                int p_offset = -1;
    132132                int n_offset = -1;
     
    135135                        switch ( desc.slots[i].vslot )
    136136                        {
    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;
    140140                                default             : break;
    141141                        }
     
    173173        size_t n_offset = 0;
    174174        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 ];
    176176        for ( uint32 i = 0; i < channel->desc.count; ++i )
    177177                if ( channel->desc.slots[i].vslot == slot::NORMAL )
     
    211211                                if ( desc.slots[i].etype == FLOAT_VECTOR_3 )
    212212                                {
    213                                         p_offset  = desc.slots[i].offset;
     213                                        p_offset  = (int)desc.slots[i].offset;
    214214                                        p_channel = channel;
    215215                                }
     
    217217                        case slot::NORMAL   : if ( desc.slots[i].etype == FLOAT_VECTOR_3 )
    218218                                {
    219                                         n_offset  = desc.slots[i].offset;
     219                                        n_offset  = (int)desc.slots[i].offset;
    220220                                        n_channel = m_data->m_channels[ c ];
    221221                                        n_channel_index = c;
     
    224224                        case slot::TEXCOORD : if ( desc.slots[i].etype == FLOAT_VECTOR_2 )
    225225                                {
    226                                         t_offset  = desc.slots[i].offset;
     226                                        t_offset  = (int)desc.slots[i].offset;
    227227                                        t_channel = channel;
    228228                                }
     
    420420        int och_ti = other->get_channel_index( slot::TEXCOORD );
    421421        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;
    426426        if ( count % size != 0 || ocount % osize != 0 ) return;
    427427        if ( count / size != ocount / osize ) return;
  • trunk/src/gfx/skeletal_mesh.cc

    r319 r323  
    5353                                for ( size_t j = 0; j < 4; ++j )
    5454                                {
    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];
    5757                                        const quat& orient      = m_transform[index].get_orientation();
    5858                                        const transform& offset = m_pos_offset[index];
     
    152152                if ( bi != bone_names.end() )
    153153                {
    154                         bone_id = bi->second;
     154                        bone_id = (sint16)bi->second;
    155155                }
    156156                m_bone_ids[n] = bone_id;
  • trunk/src/gl/gl_device.cc

    r319 r323  
    132132        texture result = m_textures.create();
    133133        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;
    138138        return result;
    139139}
  • trunk/src/gl/gl_enum.cc

    r319 r323  
    232232        case BYTE_VECTOR_3  : return GL_INT_VEC3;
    233233        case BYTE_VECTOR_4  : return GL_INT_VEC4;
    234         NV_RETURN_COVERED_DEFAULT( 0 );
     234        default : return 0; // TODO: throw!
    235235        }
    236236}
  • trunk/src/gl/gl_window.cc

    r319 r323  
    1919
    2020#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;
    2424#endif
    2525
     
    3434                        int capslock = !!(ke.keysym.mod & KMOD_CAPS);
    3535                        if ((shifted ^ capslock) != 0) {
    36                                 kevent.key.ascii = (char8)SDL_toupper(ucode);
     36                                kevent.key.ascii = (char8)SDL_toupper((int)ucode);
    3737                        }
    3838                }
  • trunk/src/lib/gl.cc

    r319 r323  
    1919// for wgl support
    2020#if NV_PLATFORM == NV_WINDOWS
    21 #    ifndef WIN32_LEAN_AND_MEAN
    22 #      define WIN32_LEAN_AND_MEAN 1
    23 #    endif
    2421#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;
    3126#define NV_GL_FUN_EXT NV_GL_FUN
    3227#include <nv/lib/detail/gl_functions.inc>
     
    4136static nv::library gl_library;
    4237static nv::gl_extensions gl_loaded_extensions = nv::gl_extensions(0);
    43 extern "C" void* (NV_GL_APIENTRY *gl_ext_loader) ( const char* ) = nullptr;
     38static void* (NV_GL_APIENTRY *gl_ext_loader) ( const char* ) = nullptr;
    4439static bool gl_library_loaded = false;
    4540static bool wgl_library_loaded = false;
     
    5247};
    5348
    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_EXTENSION
    59 };
     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// };
    6055
    6156
     
    184179        wndClass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    185180
    186         DWORD err = GetLastError();
     181        /*DWORD err = */GetLastError();
    187182        RegisterClass(&wndClass);
    188         err = GetLastError();
     183        /*err = */GetLastError();
    189184
    190185
     
    235230}
    236231
    237 
    238232bool nv::load_gl_extension( gl_extensions extension )
    239233{
  • 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;
  • trunk/src/lua/lua_nova.cc

    r319 r323  
    99#include "nv/lua/lua_raw.hh"
    1010
    11 const char* NV_STATE      = "NV_STATE";
    12 const char* NV_BLUEPRINTS = "NV_BLUEPRINTS";
     11static const char* NV_STATE      = "NV_STATE";
     12static const char* NV_BLUEPRINTS = "NV_BLUEPRINTS";
    1313
    1414// static nv::lua::state* nova_get_state( lua_State * L )
     
    7373                        return true;
    7474                }
     75                break;
    7576        case LUA_TSTRING :
    7677                if ( lua_type( L, ivalue ) != LUA_TTABLE )
     
    8687                lua_concat( L, 3 );
    8788                lua_call( L, 3, 0 );
     89                break;
    8890        case LUA_TNUMBER :
    8991                if (lua_tointeger( L, itype ) != lua_type( L, ivalue ) && lua_tointeger( L, itype ) > 0)
     
    9193                        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 ) ) );
    9294                }
    93 
     95                break;
     96        default : return false;
    9497        }
    9598        return false;
     
    784787
    785788
    786 int luaopen_nova( lua_State * L )
     789static int luaopen_nova( lua_State * L )
    787790{
    788791        lua_createtable( L, 0, 0 );
Note: See TracChangeset for help on using the changeset viewer.