Changeset 496 for trunk


Ignore:
Timestamp:
05/31/16 14:04:24 (9 years ago)
Author:
epyon
Message:
  • type disambiguition in handle.hh
  • tweak to shadowcasting
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/stl/handle.hh

    r495 r496  
    7878        public:
    7979
    80                 typedef HANDLE handle;
     80                typedef HANDLE handle_type;
    8181                typedef typename HANDLE::value_type value_type;
    8282
    8383                handle_manager() : m_first_free( NONE ), m_last_free( NONE ) {}
    8484
    85                 handle create_handle()
     85                handle_type create_handle()
    8686                {
    8787                        typedef handle_operator<HANDLE> hop;
     
    9393                }
    9494
    95                 void free_handle( handle h )
     95                void free_handle( handle_type h )
    9696                {
    9797                        value_type index = h.index();
     
    108108                }
    109109
    110                 bool is_valid( handle h ) const
     110                bool is_valid( handle_type h ) const
    111111                {
    112112                        typedef handle_operator<HANDLE> hop;
     
    149149        {
    150150        public:
    151                 typedef HANDLE              handle;
     151                typedef HANDLE              handle_type;
    152152                typedef TINDEX              index_type;
    153153                packed_index_table() {}
     
    157157                }
    158158
    159                 index_type insert( handle h )
     159                index_type insert( handle_type h )
    160160                {
    161161                        NV_ASSERT( !exists( h ), "Reinserting handle!" );
     
    167167                }
    168168
    169                 bool exists( handle h )
     169                bool exists( handle_type h )
    170170                {
    171171                        if ( h.is_nil() || h.index() >= m_indexes.size() ) return false;
     
    173173                }
    174174
    175                 index_type get( handle h )
     175                index_type get( handle_type h )
    176176                {
    177177                        if ( h.is_nil() || h.index() >= m_indexes.size() ) return -1;
     
    179179                }
    180180
    181                 index_type get( handle h ) const
     181                index_type get( handle_type h ) const
    182182                {
    183183                        if ( h.is_nil() || h.index() >= m_indexes.size() ) return -1;
     
    185185                }
    186186
    187                 index_type remove_swap( handle h )
     187                index_type remove_swap( handle_type h )
    188188                {
    189189                        if ( h.is_nil() || h.index() >= m_indexes.size() || m_indexes[h.index()] == -1 )
    190190                                return -1;
    191                         handle    swap_handle = m_handles.back();
    192                         index_type dead_eindex = m_indexes[h.index()];
     191                        handle_type swap_handle = m_handles.back();
     192                        index_type  dead_eindex = m_indexes[h.index()];
    193193                        if ( dead_eindex != static_cast<index_type>( m_handles.size() - 1 ) )
    194194                        {
     
    209209                }
    210210
    211                 handle get_handle( index_type i ) const { return m_handles[unsigned( i )]; }
     211                handle_type get_handle( index_type i ) const { return m_handles[unsigned( i )]; }
    212212
    213213                size_t size() const { return m_handles.size(); }
     
    225225                }
    226226
    227                 vector< handle >    m_handles;
    228                 vector< index_type > m_indexes;
     227                vector< handle_type > m_handles;
     228                vector< index_type >  m_indexes;
    229229        };
    230230
  • trunk/src/rogue/fov_recursive_shadowcasting.cc

    r454 r496  
    5959                                bool transparent = m_map->is_transparent( c );
    6060
    61                                 if ( dx*dx+dy*dy <= m_radius2 && (m_light_walls || transparent))
     61                                if ( dx*dx+dy*dy <= (m_radius2+1) && (m_light_walls || transparent))
    6262                                {
    6363                                        m_map->set_visible( c, true );
Note: See TracChangeset for help on using the changeset viewer.