Changeset 367 for trunk/src


Ignore:
Timestamp:
05/16/15 23:12:22 (10 years ago)
Author:
epyon
Message:
  • fixed compilation and warnings on gcc
  • slowly removing/merging external includes
Location:
trunk/src
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/string.cc

    r365 r367  
    6666                n /= 10;
    6767        } while ( n > 0 );
    68         if ( n < 0 ) *s++ = '-';
    6968        *s = '\0';
    7069        string_reverse( str, s - 1 );
     
    8079                n /= 10;
    8180        } while ( n > 0 );
    82         if ( n < 0 ) *s++ = '-';
    8381        *s = '\0';
    8482        string_reverse( str, s - 1 );
     
    9189        sprintf_s( str, 64, "%.*g", 6, n );
    9290#else
    93         snprintf( buffer, 64, "%.*g", 6, n );
     91        snprintf( str, 64, "%.*g", 6, n );
    9492#endif
    9593        sprintf( str, "%g", n );
     
    102100        sprintf_s( str, 64, "%.*g", 6, n );
    103101#else
    104         snprintf( buffer, 64, "%.*g", 6, n );
     102        snprintf( str, 64, "%.*g", 6, n );
    105103#endif
    106104        return strlen( str );
  • trunk/src/formats/assimp_loader.cc

    r365 r367  
    77#include "nv/formats/assimp_loader.hh"
    88#include <unordered_map>
    9 #include <glm/gtx/transform.hpp>
    109#include "nv/io/std_stream.hh"
    1110#include "nv/gfx/mesh_creator.hh"
  • trunk/src/formats/md2_loader.cc

    r365 r367  
    77#include "nv/formats/md2_loader.hh"
    88
    9 #include <glm/gtc/constants.hpp>
    109#include "nv/core/logging.hh"
    1110#include <cstring>
  • trunk/src/formats/md3_loader.cc

    r352 r367  
    77#include "nv/formats/md3_loader.hh"
    88
    9 #include <glm/gtc/constants.hpp>
    109#include "nv/core/logging.hh"
    1110#include <cstring>
  • trunk/src/formats/md5_loader.cc

    r323 r367  
    55#include "nv/formats/md5_loader.hh"
    66
    7 #include <glm/gtc/constants.hpp>
    87#include "nv/core/logging.hh"
    98#include "nv/io/std_stream.hh"
    10 #include <cstring>
    119
    1210using namespace nv;
     
    1412static void next_line( std::istream& stream )
    1513{
    16         stream.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );
     14        stream.ignore( 1024*1024, '\n' );
    1715}
    1816
    1917static inline void discard( std::istream& stream, const std::string& token )
    2018{
    21 //      stream.ignore( std::numeric_limits<std::streamsize>::max(), ' ' );
    2219        std::string discarded;
    2320        stream >> discarded;
  • trunk/src/gfx/keyframed_mesh.cc

    r319 r367  
    55#include "nv/gfx/keyframed_mesh.hh"
    66
    7 #include <glm/gtc/matrix_access.hpp>
    8 #include <glm/gtx/matrix_interpolation.hpp>
    97#include "nv/interface/context.hh"
    108#include "nv/interface/device.hh"
    11 
    12 
    139#include "nv/core/logging.hh"
    1410
  • trunk/src/gfx/skeletal_mesh.cc

    r323 r367  
    55#include "nv/gfx/skeletal_mesh.hh"
    66
    7 #include <glm/gtc/matrix_access.hpp>
    8 #include <glm/gtx/matrix_interpolation.hpp>
    97#include "nv/interface/context.hh"
    108#include "nv/interface/device.hh"
    11 
    129
    1310nv::skeletal_mesh_cpu::skeletal_mesh_cpu( context* a_context, const mesh_data* a_mesh_data, const mesh_nodes_data* bones )
  • trunk/src/gfx/texture_atlas.cc

    r319 r367  
    88
    99#include "nv/core/logging.hh"
    10 #include <iostream>
    1110
    1211using namespace nv;
  • trunk/src/gfx/texture_font.cc

    r365 r367  
    66#include "nv/gfx/texture_font.hh"
    77
    8 #include <sstream>
    9 #include <stdexcept>
    108#include "nv/lib/freetype2.hh"
    119#include "nv/core/logging.hh"
     
    126124                if ( error )
    127125                {
    128                         std::stringstream error_msg;
    129                         error_msg << "FT_Error while loading glyphs, error: "
    130                                 << error << " code: " << c;
    131                         NV_THROW( std::runtime_error, error_msg.str().c_str() );
     126                        NV_LOG_ERROR( "FT_Error while loading glyphs, error: ", error, " code: ", c );
     127                        NV_THROW( std::runtime_error, "FT_Error while loading glyphs" );
    132128                }
    133129
     
    144140                if ( r.pos.x < 0 )
    145141                {
    146                         std::stringstream error_msg;
    147                         error_msg << "Atlas full while loading glyphs, "
    148                                 << "r.pos.x: " << r.pos.x << " code: "
    149                                 << c;
    150                         NV_THROW( std::runtime_error, error_msg.str().c_str() );
     142                        NV_LOG_ERROR( "Atlas full while loading glyphs, r.pos.x: ", r.pos.x, " code: ", c );
     143                        NV_THROW( std::runtime_error, "Atlas full while loading glyphs" );
    151144                }
    152145                if (depth == 4)
  • trunk/src/gui/gui_gfx_renderer.cc

    r365 r367  
    66
    77#include "nv/gui/gui_gfx_renderer.hh"
    8 
    9 #include <glm/gtc/matrix_transform.hpp>
    108
    119#include "nv/interface/device.hh"
  • trunk/src/lua/lua_aux.cc

    r319 r367  
    77#include "nv/lua/lua_aux.hh"
    88
    9 #include <utility>
    109#include "nv/lua/lua_raw.hh"
    1110#include "nv/core/random.hh"
     
    117116                        int arg1 = static_cast< int >( luaL_checkinteger( L, 1 ) );
    118117                        int arg2 = static_cast< int >( luaL_checkinteger( L, 2 ) );
    119                         if (arg2 < arg1) std::swap( arg2, arg1 );
    120                         lua_pushinteger( L, nv::random::get().srange( arg1, arg2 ) );
     118                        int result = ( arg2 >= arg1 ? nv::random::get().srange( arg1, arg2 ) : nv::random::get().srange( arg2, arg1 ) );
     119                        lua_pushinteger( L, result );
    121120                }
    122121        }
  • trunk/src/lua/lua_state.cc

    r365 r367  
    356356}
    357357
    358 int lua::state::load_stream( std::istream& stream, string_ref name )
    359 {
    360         NV_LOG_NOTICE( "Loading Lua stream '", name, "'");
    361         return load_string( std::string(
    362                 (std::istreambuf_iterator<char>(stream)),
    363                 std::istreambuf_iterator<char>()), name );
    364 }
    365 
    366358int lua::state::load_file( string_ref filename )
    367359{
     
    380372        }
    381373        return do_current( name, rvalues ) == 0;
    382 }
    383 
    384 bool lua::state::do_stream( std::istream& stream, string_ref name )
    385 {
    386         lua::stack_guard( this );
    387         int result = load_stream(stream,name);
    388         if (result)
    389         {
    390                 NV_LOG_WARNING( "Failed to open stream ", name, ": ", lua_tostring( m_state, -1 ) );
    391                 return false;
    392         }
    393         return do_current( name ) == 0;
    394374}
    395375
  • trunk/src/sdl/sdl_audio.cc

    r365 r367  
    77#include "nv/sdl/sdl_audio.hh"
    88
    9 #include <glm/gtx/vector_angle.hpp>
    10 #include "nv/lib/sdl.hh"
     9#include "nv/core/math.hh"
    1110#include "nv/lib/sdl_mixer.hh"
    1211#include "nv/core/logging.hh"
  • trunk/src/sdl/sdl_window.cc

    r365 r367  
    99#include "nv/lib/sdl.hh"
    1010#include "nv/sdl/sdl_input.hh"
     11#include "nv/gl/gl_context.hh"
    1112
    1213using namespace nv;
Note: See TracChangeset for help on using the changeset viewer.