Changeset 529


Ignore:
Timestamp:
01/05/17 13:50:41 (8 years ago)
Author:
epyon
Message:
  • mass update
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/engine/animation.hh

    r524 r529  
    126126                                else
    127127                                {
    128 //                                      duration -= last.time;
    129 //                                      last.time = 0.0f;
    130                                         int hack;
    131                                         m_time = 0.0f;
     128                                        duration -= last.time;
     129                                        last.time = 0.0f;
    132130                                }
    133131                        }
  • trunk/nv/engine/light.hh

    r520 r529  
    132132        {
    133133        public:
    134                 static const unsigned lgeo_vertices = 4;
    135                 static const unsigned lgeo_indices = 6;
     134                static const unsigned lgeo_vertices = 8;
     135                static const unsigned lgeo_indices = 6 * 6;
    136136
    137137                void initialize( uint32 max_size )
     
    146146                uint32 index_stride() const { return lgeo_indices; }
    147147
    148                 void update( array_view< light_data* > lights )
     148                void update( array_view< light_data* > lights, float min_height )
    149149                {
    150150                        uint32 count = nv::min< uint32 >( lights.size(), m_max_size );
     
    152152                        {
    153153                                vec3 nlp = lights[i]->position;
     154
    154155                                float radius = lights[i]->range;
    155                                 nlp.y = 0.1f;
     156                                nlp.y = 0.001f;
    156157                                vec3 r1( radius, 0.0f, radius );
    157158                                vec3 r2( radius, 0.0f, -radius );
     159                                vec3 hlp = lights[i]->position;
     160                                hlp.y = nv::max( hlp.y, min_height );
    158161
    159162                                m_light_data[i * lgeo_vertices + 0] = light_vertex{ vec4( nlp - r1, float( i ) ) };
     
    161164                                m_light_data[i * lgeo_vertices + 2] = light_vertex{ vec4( nlp + r1, float( i ) ) };
    162165                                m_light_data[i * lgeo_vertices + 3] = light_vertex{ vec4( nlp + r2, float( i ) ) };
    163 
    164                                 uint16 indices[lgeo_indices] = { 0, 1, 2, 2, 3, 0 };
     166                                m_light_data[i * lgeo_vertices + 4] = light_vertex{ vec4( hlp - r1, float( i ) ) };
     167                                m_light_data[i * lgeo_vertices + 5] = light_vertex{ vec4( hlp - r2, float( i ) ) };
     168                                m_light_data[i * lgeo_vertices + 6] = light_vertex{ vec4( hlp + r1, float( i ) ) };
     169                                m_light_data[i * lgeo_vertices + 7] = light_vertex{ vec4( hlp + r2, float( i ) ) };
     170
     171
     172                                uint16 indices[lgeo_indices] =
     173                                {
     174                                        2, 1, 0, 0, 3, 2,
     175                                        4, 5, 6, 6, 7, 4,
     176
     177                                        0, 1, 5, 5, 4, 0,
     178                                        1, 2, 6, 6, 5, 1,
     179                                        2, 3, 7, 7, 6, 2,
     180                                        3, 0, 4, 4, 7, 3,
     181                                };
    165182                                for ( uint16 j = 0; j < lgeo_indices; ++j )
    166183                                {
     
    218235                }
    219236
    220                 void update( context* ctx, array_view< light_data* > lights )
     237                void update( context* ctx, array_view< light_data* > lights, float min_height )
    221238                {
    222239                        m_active = nv::min<uint32>( m_geometry.max_size(), lights.size() );
    223240                        if ( m_active == 0 ) return;
    224241                        m_block.update( lights );
    225                         m_geometry.update( lights );
     242                        m_geometry.update( lights, min_height );
    226243
    227244                        m_block.update( ctx );
     
    229246                }
    230247
    231                 void filter_update( context* ctx, array_view< light_data* > lights, shadow_type type )
     248                void filter_update( context* ctx, array_view< light_data* > lights, shadow_type type, float min_height )
    232249                {
    233250                        uint32 count = 0;
     
    241258                                if ( count >= size ) break;
    242259                        }
    243                         update( ctx, array_view< light_data* >( filtered_lights.data(), count ) );
     260                        update( ctx, array_view< light_data* >( filtered_lights.data(), count ), min_height );
    244261                }
    245262
  • trunk/src/engine/default_resource_manager.cc

    r520 r529  
    3737        m_lua->register_enum( "RND_STEP_3",     static_cast<int>( random_dist::STEP_3 ) );
    3838        m_lua->register_enum( "RND_STEP_4",     static_cast<int>( random_dist::STEP_4 ) );
    39         m_lua->register_enum( "RND_LINEAR",     static_cast<int>( random_dist::LINEAR ) );
     39        m_lua->register_enum( "RND_MLINEAR",    static_cast<int>( random_dist::MLINEAR ) );
    4040        m_lua->register_enum( "RND_MGAUSSIAN",  static_cast<int>( random_dist::MGAUSSIAN ) );
    4141        m_lua->register_enum( "RND_MRGAUSSIAN", static_cast<int>( random_dist::MRGAUSSIAN ) );
  • trunk/src/engine/model_manager.cc

    r527 r529  
    135135        node->choice    = model_node_choice( table.get_unsigned( "choice", false ) );
    136136        node->chance    = table.get_float( "chance", 1.0f );
    137         node->weight    = table.get_unsigned( "weight", 1 );
     137        node->weight    = static_cast< uint16 >( table.get_unsigned( "weight", 1 ) );
    138138        node->mesh      = cmesh;
    139139        node->attach_id = attach_id;
  • trunk/src/engine/particle_engine.cc

    r522 r529  
    454454        uint32 ecount = info->data->emitter_count;
    455455        if ( ecount == 0 ) return;
    456 
    457         bool local = model.is_identity();
    458 //      if ( !local )
    459 //      {
    460 //              source = vec3( m_model_matrix[3] );
    461 //              orient = mat3( m_model_matrix );
    462 //      }
    463456
    464457        for ( uint32 i = 0; i < ecount; ++i )
  • trunk/src/engine/resource_system.cc

    r524 r529  
    4444                lua::table_guard sub_table( table, i + 1 );
    4545                string64 id = sub_table.get_string64( "id" );
    46                 NV_ASSERT( m_id_hash.find( id ) == m_id_hash.end(), "HASH COLLISION - ", id, " - ", m_id_hash[id] );
     46                NV_ASSERT( m_id_hash.find( id ) == m_id_hash.end(), "HASH COLLISION" );
    4747                m_id_hash[id] = id;
    4848        }
  • trunk/src/gfx/gfx_terminal.cc

    r520 r529  
    112112};
    113113
    114 gfx_terminal::gfx_terminal( context* ctx, texture t, dimension tsize, dimension psize )
     114gfx_terminal::gfx_terminal( context* ctx, texture t, dimension tsize, dimension /*psize*/ )
    115115        : terminal( tsize ), m_context( ctx )
    116116{
     
    178178}
    179179
    180 bool gfx_terminal::poll( io_event & kevent )
     180bool gfx_terminal::poll( io_event & /*kevent*/ )
    181181{
    182182        return false;
    183183}
    184184
    185 void gfx_terminal::set_cursor( position p )
     185void gfx_terminal::set_cursor( position /*p*/ )
    186186{
    187187}
  • trunk/src/image/png_writer.cc

    r520 r529  
    4747
    4848// initialize a callback-based context
    49 static void stbi__start_write_callbacks( stbi__write_context *s, stbi_write_func *c, void *context )
    50 {
    51         s->func = c;
    52         s->context = context;
    53 }
     49// static void stbi__start_write_callbacks( stbi__write_context *s, stbi_write_func *c, void *context )
     50// {
     51//      s->func = c;
     52//      s->context = context;
     53// }
    5454
    5555typedef unsigned int stbiw_uint32;
     
    6565#define stbi__errpuc(x,y)  ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
    6666
     67/*
    6768static void stbiw__writefv( stbi__write_context *s, const char *fmt, va_list v )
    6869{
     
    139140                        break;
    140141                }
    141                 /* FALLTHROUGH */
     142                // FALLTHROUGH
    142143        case 3:
    143144                stbiw__write3( s, d[1 - rgb_dir], d[1], d[1 + rgb_dir] );
     
    188189        }
    189190}
    190 
     191*/
    191192
    192193static unsigned int stbiw__crc32( unsigned char *buffer, int len )
     
    253254}
    254255
    255 unsigned char * stbi_zlib_compress( unsigned char *data, int data_len, int *out_len, int quality )
     256unsigned char * stbi_zlib_compress( unsigned char *data, int data_len, int *out_len, int /*quality*/ )
    256257{
    257258        unsigned long expected = nv::miniz_bound( data_len );
  • trunk/src/lua/lua_area.cc

    r520 r529  
    285285{
    286286        nv::rectangle* a = to_parea( L, 1 );
    287         push_coord( L, a->ul - a->lr + nv::ivec2(1,1) );
     287        push_coord( L, a->lr - a->ul + nv::ivec2(1,1) );
    288288        return 1;
    289289}
  • trunk/src/lua/lua_math.cc

    r520 r529  
    138138
    139139template< typename T >
     140int nlua_vec_sign( lua_State* L )
     141{
     142        push_vec<T>( L, nv::math::sign( to_vec<T>( L, 1 ) ) );
     143        return 1;
     144}
     145
     146template< typename T >
    140147int nlua_vec_call( lua_State* L )
    141148{
     
    324331        static const struct luaL_Reg nlua_vec_f [] = {
    325332                { "clone",          nlua_vec_clone<T> },
     333                { "sign",           nlua_vec_sign<T> },
    326334                { "get",            nlua_vec_get<T> },
    327335                { "tostring",       nlua_vec_tostring<T> },
  • trunk/src/sdl/sdl_window_manager.cc

    r505 r529  
    4242                char buffer[128];
    4343                sprintf( buffer, "%p", primal_window );
    44                 NV_ASSERT( SDL_SetHint( "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT", buffer ) == SDL_TRUE );
     44                SDL_bool result = SDL_SetHint( "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT", buffer );
     45                NV_UNUSED( result );
     46                NV_ASSERT( result == SDL_TRUE, "SetHint failed!" );
    4547        }
    4648        primal_window = SDL_CreateWindowFrom( sys_w_handle );
Note: See TracChangeset for help on using the changeset viewer.