- Timestamp:
- 02/04/14 03:50:28 (11 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/formats/md2_loader.hh
r224 r228 14 14 #define NV_MD2_LOADER_HH 15 15 16 #include <nv/common.hh> 16 17 #include <unordered_map> 17 18 #include <vector> 18 #include <nv/common.hh>19 19 #include <nv/interface/mesh_loader.hh> 20 20 -
trunk/nv/formats/md3_loader.hh
r224 r228 14 14 #define NV_MD3_LOADER_HH 15 15 16 #include <nv/common.hh> 16 17 #include <unordered_map> 17 18 #include <vector> 18 #include <nv/common.hh>19 19 #include <nv/gfx/mesh_data.hh> 20 20 #include <nv/interface/mesh_loader.hh> -
trunk/nv/formats/md5_loader.hh
r226 r228 14 14 #define NV_MD5_LOADER_HH 15 15 16 #include <nv/common.hh> 16 17 #include <unordered_map> 17 18 #include <vector> 18 #include <nv/common.hh>19 19 #include <nv/interface/mesh_loader.hh> 20 20 -
trunk/nv/gfx/image.hh
r121 r228 69 69 void fill( uint8 value ); 70 70 /** 71 * Fills the region with a given value. 72 * 73 * @arg[in] r : Region to be filled. 74 * @arg[in] value : Value to fill. 75 */ 76 void fill( region r, uint8 value, int stride = 0 ); 77 /** 71 78 * Just like fill, but a region can be specified. 72 79 * … … 76 83 */ 77 84 void set_region( region r, const uint8 * data, int stride = 0 ); 85 86 /** 87 * Just like fill, but a region can be specified. Checks for data depth, 88 * and converts if needed. 89 * 90 * @arg[in] r : Region to be filled. 91 * @arg[in] data : Data to fill the region 92 */ 93 void set_region( region r, const image_data* idata ); 94 78 95 /** 79 96 * Default destructor. Deallocates data. -
trunk/nv/gl/gl_device.hh
r153 r228 21 21 public: 22 22 gl_device(); 23 virtual window* create_window( uint16 width, uint16 height );23 virtual window* create_window( uint16 width, uint16 height, bool fullscreen ); 24 24 virtual program* create_program( const string& vs_source, const string& fs_source ); 25 25 virtual vertex_buffer* create_vertex_buffer( buffer_hint hint, size_t size, const void* source = nullptr ); -
trunk/nv/gl/gl_window.hh
r171 r228 22 22 { 23 23 public: 24 gl_window( device* dev, uint16 width, uint16 height );24 gl_window( device* dev, uint16 width, uint16 height, bool fullscreen = false ); 25 25 uint16 get_width() const; 26 26 uint16 get_height() const; -
trunk/nv/interface/device.hh
r153 r228 28 28 { 29 29 public: 30 virtual window* create_window( uint16 width, uint16 height ) = 0;30 virtual window* create_window( uint16 width, uint16 height, bool fullscreen ) = 0; 31 31 virtual program* create_program( const string& vs_source, const string& fs_source ) = 0; 32 32 virtual vertex_buffer* create_vertex_buffer( buffer_hint hint, size_t size, const void* source = nullptr ) = 0; -
trunk/nv/lua/lua_state.hh
r217 r228 12 12 #define NV_LUA_HH 13 13 14 #include <nv/common.hh> 14 15 #include <istream> 15 16 #include <map> 16 #include <nv/common.hh>17 17 #include <nv/flags.hh> 18 18 #include <nv/types.hh> … … 141 141 register_native_function( detail::function_wrapper< F, f >, name ); 142 142 } 143 144 template < typename C, typename F, F* f > 145 void register_function( const char* name ) 146 { 147 register_native_function( detail::object_method_wrapper< C, F, f >, name ); 148 } 149 143 150 protected: 144 151 bool is_defined( const path& p, bool global ); -
trunk/nv/lua/lua_values.hh
r213 r228 221 221 { 222 222 typedef typename type_degrade<T>::type degraded; 223 p = pass_traits<degraded>::to( L, -1 );223 p = (T)pass_traits<degraded>::to( L, -1 ); 224 224 detail::pop_and_discard(L, 1); 225 225 } … … 229 229 typedef typename type_degrade<T>::type degraded; 230 230 T ret; 231 ret = pass_traits<degraded>::to( L, -1 );231 ret = (T)pass_traits<degraded>::to( L, -1 ); 232 232 detail::pop_and_discard(L, 1); 233 233 return ret; -
trunk/nv/random.hh
r175 r228 8 8 #define NV_RANDOM_HH 9 9 10 #include <nv/common.hh> 10 11 #include <random> 11 #include <nv/common.hh>12 12 #include <nv/math.hh> 13 13 -
trunk/src/gfx/image.cc
r128 r228 48 48 } 49 49 50 void image::fill( region r, uint8 value, int stride ) 51 { 52 if ( stride == 0 ) stride = r.size.x * static_cast<sint32>( m_depth ); 53 54 sint32 bpos = (r.pos.y*m_size.x + r.pos.x ) * static_cast<sint32>( m_depth ); 55 sint32 bline = m_size.x*static_cast<sint32>( m_depth ); 56 57 for( int i = 0; i < r.size.y; ++i ) 58 { 59 // TODO: test 60 std::fill( m_data + bpos + bline * i, m_data + bpos + bline * i + stride, value ); 61 } 62 } 63 64 50 65 void image::set_region( region r, const uint8 * data, int stride ) 51 66 { … … 64 79 } 65 80 81 void image::set_region( region r, const image_data* idata ) 82 { 83 if ( idata->get_depth() == m_depth ) 84 { 85 set_region( r, idata->get_data() ); 86 return; 87 } 88 89 fill( r, 255 ); 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 ); 93 94 const uint8* data = idata->get_data(); 95 sint32 depth = idata->get_depth(); 96 sint32 dstride = r.size.x * static_cast<sint32>( depth ); 97 98 for( int y = 0; y < r.size.y; ++y ) 99 { 100 sint32 pos = bpos + bline * y; 101 for( int x = 0; x < r.size.x; ++x ) 102 { 103 sint32 xy = pos + x * m_depth; 104 for( int e = 0; e < depth; ++e ) 105 { 106 m_data[ xy + e ] = data[ y*dstride + x * depth + e ]; 107 } 108 } 109 } 110 } 111 112 66 113 image::~image() 67 114 { -
trunk/src/gl/gl_device.cc
r184 r228 15 15 using namespace nv; 16 16 17 window* gl_device::create_window( uint16 width, uint16 height )17 window* gl_device::create_window( uint16 width, uint16 height, bool fullscreen ) 18 18 { 19 return new gl_window( this, width, height );19 return new gl_window( this, width, height, fullscreen ); 20 20 } 21 21 -
trunk/src/gl/gl_window.cc
r184 r228 203 203 204 204 205 gl_window::gl_window( device* dev, uint16 width, uint16 height )205 gl_window::gl_window( device* dev, uint16 width, uint16 height, bool fullscreen ) 206 206 : m_device( dev ), m_width( width ), m_height( height ), m_title("NV Engine"), m_handle( nullptr ) 207 207 { 208 208 #if NV_SDL_VERSION == NV_SDL_12 209 209 uint32 flags = SDL_OPENGL; 210 if (fullscreen) flags |= SDL_FULLSCREEN; 210 211 m_handle = SDL_SetVideoMode( width, height, 32, flags ); 211 212 #elif NV_SDL_VERSION == NV_SDL_20 212 213 uint32 flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN; 214 if (fullscreen) flags |= SDL_FULLSCREEN; 213 215 m_handle = SDL_CreateWindow("Nova Engine", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 214 216 width, height, flags ); -
trunk/src/lua/lua_map_tile.cc
r221 r228 130 130 { 131 131 nv::uint8 c = tile->data[ y * tile->size_x + x ]; 132 if ( c != 0 ) area->set_cell( coord + nv::ivec2( x, y ), tile->data[ y * tile->size_x + x ]);132 if ( c != 0 ) area->set_cell( coord + nv::ivec2( x, y ), c ); 133 133 } 134 134 -
trunk/src/lua/lua_state.cc
r217 r228 234 234 for(; lib->func != NULL; lib++) 235 235 { 236 lib->func( m_state ); 236 lua_pushcfunction( m_state, lib->func ); 237 lua_call(m_state, 0, 1); 238 lua_setglobal( m_state, lib->name ); 237 239 } 238 240 register_nova( this );
Note: See TracChangeset
for help on using the changeset viewer.