From bb28b25e714007b3d07eb03c07cc965f63ee2fbc Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 18 Dec 2016 14:47:16 +0100 Subject: [PATCH] Merge with develop --- .travis.yml | 9 +- code/nel/include/nel/georges/form.h | 12 +- code/nel/include/nel/georges/form_dfn.h | 26 +- code/nel/include/nel/georges/form_elm.h | 150 +++++------ code/nel/include/nel/georges/form_loader.h | 12 +- code/nel/include/nel/georges/header.h | 6 +- code/nel/include/nel/georges/type.h | 6 +- code/nel/include/nel/georges/u_form_elm.h | 48 ++-- code/nel/include/nel/georges/u_form_loader.h | 6 +- code/nel/src/3d/anim_detail_trav.cpp | 3 + code/nel/src/3d/animation_set_user.cpp | 3 + code/nel/src/3d/async_texture_manager.cpp | 4 + code/nel/src/3d/bezier_patch.cpp | 4 + code/nel/src/3d/bloom_effect.cpp | 4 + code/nel/src/3d/bone.cpp | 3 + code/nel/src/3d/camera.cpp | 3 + code/nel/src/3d/camera_col.cpp | 3 + code/nel/src/3d/channel_mixer.cpp | 4 + code/nel/src/3d/clip_trav.cpp | 3 + code/nel/src/3d/cloud_scape.cpp | 4 + code/nel/src/3d/cloud_scape_user.cpp | 3 + code/nel/src/3d/cluster.cpp | 4 + code/nel/src/3d/coarse_mesh_build.cpp | 4 + code/nel/src/3d/coarse_mesh_manager.cpp | 4 + code/nel/src/3d/computed_string.cpp | 4 + code/nel/src/3d/cube_map_builder.cpp | 3 + code/nel/src/3d/debug_vb.cpp | 4 + code/nel/src/3d/deform_2d.cpp | 4 + code/nel/src/3d/driver.cpp | 4 + code/nel/src/3d/driver_user.cpp | 4 + code/nel/src/3d/driver_user2.cpp | 3 + code/nel/src/3d/dru.cpp | 4 + code/nel/src/3d/event_mouse_listener.cpp | 4 + code/nel/src/3d/fast_ptr_list.cpp | 4 + code/nel/src/3d/fasthls_modifier.cpp | 3 + code/nel/src/3d/flare_model.cpp | 3 + code/nel/src/3d/flare_shape.cpp | 3 + code/nel/src/3d/font_generator.cpp | 4 + code/nel/src/3d/font_manager.cpp | 4 + code/nel/src/3d/frustum.cpp | 4 + code/nel/src/3d/fxaa.cpp | 10 +- code/nel/src/3d/geometry_program.cpp | 4 + code/nel/src/3d/gpu_program_params.cpp | 4 + code/nel/src/3d/heat_haze.cpp | 4 + code/nel/src/3d/height_map.cpp | 3 + code/nel/src/3d/hls_color_texture.cpp | 4 + code/nel/src/3d/hls_texture_bank.cpp | 4 + code/nel/src/3d/hls_texture_manager.cpp | 4 + code/nel/src/3d/hrc_trav.cpp | 3 + code/nel/src/3d/ig_surface_light.cpp | 3 + code/nel/src/3d/ig_surface_light_build.cpp | 4 + code/nel/src/3d/index_buffer.cpp | 4 + code/nel/src/3d/init_3d.cpp | 4 + code/nel/src/3d/instance_group_user.cpp | 4 + code/nel/src/3d/instance_lighter.cpp | 4 + code/nel/src/3d/key.cpp | 3 + code/nel/src/3d/landscape.cpp | 3 + code/nel/src/3d/landscape_collision_grid.cpp | 4 + code/nel/src/3d/landscape_def.cpp | 4 + .../src/3d/landscape_face_vector_manager.cpp | 3 + code/nel/src/3d/landscape_model.cpp | 5 + code/nel/src/3d/landscape_profile.cpp | 3 + code/nel/src/3d/landscape_user.cpp | 4 + code/nel/src/3d/landscape_vegetable_block.cpp | 3 + code/nel/src/3d/landscapeig_manager.cpp | 4 + code/nel/src/3d/landscapevb_allocator.cpp | 4 + code/nel/src/3d/landscapevb_info.cpp | 3 + code/nel/src/3d/light.cpp | 4 + code/nel/src/3d/light_contribution.cpp | 3 + .../src/3d/light_influence_interpolator.cpp | 3 + code/nel/src/3d/light_trav.cpp | 5 +- code/nel/src/3d/light_user.cpp | 3 + code/nel/src/3d/lighting_manager.cpp | 3 + code/nel/src/3d/load_balancing_trav.cpp | 4 + code/nel/src/3d/lod_character_builder.cpp | 3 + code/nel/src/3d/lod_character_instance.cpp | 3 + code/nel/src/3d/lod_character_manager.cpp | 4 + code/nel/src/3d/lod_character_shape.cpp | 3 + code/nel/src/3d/lod_character_shape_bank.cpp | 4 + code/nel/src/3d/lod_character_texture.cpp | 3 + code/nel/src/3d/logic_info.cpp | 3 + code/nel/src/3d/material.cpp | 4 + code/nel/src/3d/mesh.cpp | 3 + code/nel/src/3d/mesh_base.cpp | 3 + code/nel/src/3d/mesh_base_instance.cpp | 4 + code/nel/src/3d/mesh_blender.cpp | 3 + code/nel/src/3d/mesh_block_manager.cpp | 4 + code/nel/src/3d/mesh_geom.cpp | 3 + code/nel/src/3d/mesh_instance.cpp | 4 + code/nel/src/3d/mesh_morpher.cpp | 3 + code/nel/src/3d/mesh_mrm.cpp | 3 + code/nel/src/3d/mesh_mrm_instance.cpp | 4 + code/nel/src/3d/mesh_mrm_skin_template.cpp | 4 + code/nel/src/3d/mesh_mrm_skinned.cpp | 3 + code/nel/src/3d/mesh_mrm_skinned_instance.cpp | 4 + code/nel/src/3d/mesh_mrm_skinned_template.cpp | 4 + code/nel/src/3d/mesh_multi_lod.cpp | 3 + code/nel/src/3d/mesh_multi_lod_instance.cpp | 4 + code/nel/src/3d/meshvp_per_pixel_light.cpp | 3 + code/nel/src/3d/meshvp_wind_tree.cpp | 3 + code/nel/src/3d/mini_col.cpp | 4 + code/nel/src/3d/motion_blur.cpp | 3 + code/nel/src/3d/mrm_builder.cpp | 4 + code/nel/src/3d/mrm_internal.cpp | 3 + code/nel/src/3d/mrm_level_detail.cpp | 3 + code/nel/src/3d/mrm_mesh.cpp | 4 + code/nel/src/3d/nelu.cpp | 3 + code/nel/src/3d/noise_3d.cpp | 4 + code/nel/src/3d/packed_world.cpp | 4 + code/nel/src/3d/packed_zone.cpp | 4 + code/nel/src/3d/particle_system.cpp | 3 + code/nel/src/3d/particle_system_manager.cpp | 3 + code/nel/src/3d/particle_system_model.cpp | 3 + code/nel/src/3d/particle_system_process.cpp | 4 + code/nel/src/3d/particle_system_shape.cpp | 4 + .../nel/src/3d/particle_system_sound_user.cpp | 3 + code/nel/src/3d/patch.cpp | 4 + code/nel/src/3d/patch_lightmap.cpp | 4 + code/nel/src/3d/patch_noise.cpp | 4 + code/nel/src/3d/patch_rdr_pass.cpp | 3 + code/nel/src/3d/patch_render.cpp | 3 + code/nel/src/3d/patch_vegetable.cpp | 4 + code/nel/src/3d/patchdlm_context.cpp | 4 + code/nel/src/3d/patchuv_locator.cpp | 4 + code/nel/src/3d/pixel_program.cpp | 4 + code/nel/src/3d/play_list_manager.cpp | 3 + code/nel/src/3d/play_list_manager_user.cpp | 4 + code/nel/src/3d/play_list_user.cpp | 4 + code/nel/src/3d/point_light.cpp | 4 + code/nel/src/3d/point_light_model.cpp | 3 + code/nel/src/3d/point_light_named.cpp | 3 + code/nel/src/3d/point_light_named_array.cpp | 4 + code/nel/src/3d/portal.cpp | 4 + code/nel/src/3d/primitive_profile.cpp | 3 + code/nel/src/3d/program.cpp | 4 + code/nel/src/3d/ps_allocator.cpp | 4 + code/nel/src/3d/ps_attrib_maker_bin_op.cpp | 3 + code/nel/src/3d/ps_attrib_maker_helper.cpp | 4 + code/nel/src/3d/ps_attrib_maker_template.cpp | 3 + code/nel/src/3d/ps_color.cpp | 3 + code/nel/src/3d/ps_dot.cpp | 4 + code/nel/src/3d/ps_emitter.cpp | 4 + code/nel/src/3d/ps_face.cpp | 3 + code/nel/src/3d/ps_face_look_at.cpp | 3 + code/nel/src/3d/ps_fan_light.cpp | 3 + code/nel/src/3d/ps_float.cpp | 4 + code/nel/src/3d/ps_force.cpp | 4 + code/nel/src/3d/ps_int.cpp | 3 + code/nel/src/3d/ps_light.cpp | 4 + code/nel/src/3d/ps_located.cpp | 4 + code/nel/src/3d/ps_mesh.cpp | 4 + code/nel/src/3d/ps_particle_basic.cpp | 3 + code/nel/src/3d/ps_plane_basis_maker.cpp | 4 + code/nel/src/3d/ps_quad.cpp | 4 + code/nel/src/3d/ps_register_attribs.cpp | 4 +- code/nel/src/3d/ps_register_emitters.cpp | 3 + code/nel/src/3d/ps_register_forces.cpp | 4 + code/nel/src/3d/ps_register_particles.cpp | 3 + code/nel/src/3d/ps_register_zones.cpp | 3 + code/nel/src/3d/ps_ribbon.cpp | 4 + code/nel/src/3d/ps_ribbon_base.cpp | 4 + code/nel/src/3d/ps_ribbon_look_at.cpp | 4 + code/nel/src/3d/ps_shockwave.cpp | 3 + code/nel/src/3d/ps_sound.cpp | 4 + code/nel/src/3d/ps_tail_dot.cpp | 4 + code/nel/src/3d/ps_util.cpp | 3 + code/nel/src/3d/ps_zone.cpp | 4 + code/nel/src/3d/quad_effect.cpp | 4 + code/nel/src/3d/quad_grid.cpp | 4 + code/nel/src/3d/raw_skin.cpp | 4 + code/nel/src/3d/raw_skinned.cpp | 4 + code/nel/src/3d/ray_mesh.cpp | 4 + code/nel/src/3d/register_3d.cpp | 3 + code/nel/src/3d/render_target_manager.cpp | 4 + code/nel/src/3d/render_trav.cpp | 4 + code/nel/src/3d/root_model.cpp | 3 + code/nel/src/3d/scene.cpp | 4 + code/nel/src/3d/scene_group.cpp | 4 + code/nel/src/3d/scene_user.cpp | 4 + code/nel/src/3d/seg_remanence.cpp | 4 +- code/nel/src/3d/seg_remanence_shape.cpp | 3 + code/nel/src/3d/shadow_map.cpp | 4 + code/nel/src/3d/shadow_map_manager.cpp | 4 + code/nel/src/3d/shadow_poly_receiver.cpp | 4 + code/nel/src/3d/shadow_skin.cpp | 4 + code/nel/src/3d/shape.cpp | 3 + code/nel/src/3d/shape_bank.cpp | 4 + code/nel/src/3d/shape_bank_user.cpp | 4 + code/nel/src/3d/shape_info.cpp | 3 + code/nel/src/3d/shifted_triangle_cache.cpp | 3 + code/nel/src/3d/skeleton_model.cpp | 4 + code/nel/src/3d/skeleton_shape.cpp | 4 + code/nel/src/3d/skeleton_spawn_script.cpp | 4 + code/nel/src/3d/skeleton_weight.cpp | 3 + code/nel/src/3d/stereo_debugger.cpp | 4 + code/nel/src/3d/stereo_display.cpp | 4 + code/nel/src/3d/stereo_hmd.cpp | 4 + code/nel/src/3d/stereo_libvr.cpp | 4 + code/nel/src/3d/stereo_ovr.cpp | 4 + code/nel/src/3d/stereo_ovr_04.cpp | 4 + code/nel/src/3d/stereo_ovr_fp.cpp | 4 + code/nel/src/3d/stripifier.cpp | 4 + code/nel/src/3d/surface_light_grid.cpp | 4 + code/nel/src/3d/tangent_space_build.cpp | 3 + code/nel/src/3d/tess_block.cpp | 3 + code/nel/src/3d/tess_face_priority_list.cpp | 4 + code/nel/src/3d/tessellation.cpp | 4 + code/nel/src/3d/text_context.cpp | 4 + code/nel/src/3d/text_context_user.cpp | 3 + code/nel/src/3d/texture.cpp | 3 + code/nel/src/3d/texture_blank.cpp | 3 + code/nel/src/3d/texture_blend.cpp | 4 + code/nel/src/3d/texture_bump.cpp | 3 + code/nel/src/3d/texture_cube.cpp | 3 + code/nel/src/3d/texture_dlm.cpp | 3 + code/nel/src/3d/texture_emboss.cpp | 4 + code/nel/src/3d/texture_far.cpp | 4 + code/nel/src/3d/texture_file.cpp | 4 + code/nel/src/3d/texture_font.cpp | 4 + code/nel/src/3d/texture_grouped.cpp | 4 + code/nel/src/3d/texture_mem.cpp | 3 + code/nel/src/3d/texture_multi_file.cpp | 3 + code/nel/src/3d/texture_near.cpp | 7 +- code/nel/src/3d/tile_bank.cpp | 4 + code/nel/src/3d/tile_element.cpp | 3 + code/nel/src/3d/tile_far_bank.cpp | 4 + code/nel/src/3d/tile_light_influence.cpp | 3 + code/nel/src/3d/tile_lumel.cpp | 4 + code/nel/src/3d/tile_noise_map.cpp | 3 + code/nel/src/3d/tile_vegetable_desc.cpp | 3 + code/nel/src/3d/track.cpp | 4 + code/nel/src/3d/track_keyframer.cpp | 3 + code/nel/src/3d/track_sampled_common.cpp | 3 + .../3d/track_sampled_quat_small_header.cpp | 3 + code/nel/src/3d/track_sampled_vector.cpp | 3 + code/nel/src/3d/transform.cpp | 4 + code/nel/src/3d/transform_shape.cpp | 3 + code/nel/src/3d/transformable.cpp | 3 + code/nel/src/3d/u_bone.cpp | 3 + code/nel/src/3d/u_camera.cpp | 3 + code/nel/src/3d/u_instance.cpp | 4 + code/nel/src/3d/u_instance_material.cpp | 3 + code/nel/src/3d/u_material.cpp | 3 + .../nel/src/3d/u_particle_system_instance.cpp | 3 + code/nel/src/3d/u_point_light.cpp | 4 + code/nel/src/3d/u_shape.cpp | 3 + code/nel/src/3d/u_skeleton.cpp | 3 + code/nel/src/3d/u_transform.cpp | 4 + code/nel/src/3d/u_transformable.cpp | 3 + code/nel/src/3d/u_visual_collision_mesh.cpp | 3 + code/nel/src/3d/u_water.cpp | 3 + code/nel/src/3d/vegetable.cpp | 3 + .../src/3d/vegetable_blend_layer_model.cpp | 4 + code/nel/src/3d/vegetable_clip_block.cpp | 3 + code/nel/src/3d/vegetable_instance_group.cpp | 3 + code/nel/src/3d/vegetable_light_ex.cpp | 3 + code/nel/src/3d/vegetable_quadrant.cpp | 4 + code/nel/src/3d/vegetable_shape.cpp | 3 + code/nel/src/3d/vegetable_sort_block.cpp | 4 + code/nel/src/3d/vegetablevb_allocator.cpp | 4 + code/nel/src/3d/vertex_buffer.cpp | 4 + code/nel/src/3d/vertex_program.cpp | 3 + code/nel/src/3d/vertex_program_parse.cpp | 4 + code/nel/src/3d/vertex_stream_manager.cpp | 4 + code/nel/src/3d/viewport.cpp | 3 + code/nel/src/3d/visual_collision_entity.cpp | 3 + .../src/3d/visual_collision_entity_user.cpp | 3 + code/nel/src/3d/visual_collision_manager.cpp | 3 + .../src/3d/visual_collision_manager_user.cpp | 3 + code/nel/src/3d/visual_collision_mesh.cpp | 3 + code/nel/src/3d/water_env_map_user.cpp | 4 + code/nel/src/3d/water_height_map.cpp | 3 + code/nel/src/3d/water_model.cpp | 3 + code/nel/src/3d/water_shape.cpp | 3 + code/nel/src/3d/zone.cpp | 3 + code/nel/src/3d/zone_corner_smoother.cpp | 3 + code/nel/src/3d/zone_lighter.cpp | 4 + code/nel/src/3d/zone_manager.cpp | 3 + code/nel/src/3d/zone_search.cpp | 14 +- code/nel/src/3d/zone_smoother.cpp | 3 + code/nel/src/3d/zone_symmetrisation.cpp | 4 + code/nel/src/3d/zone_tgt_smoother.cpp | 5 + code/nel/src/georges/form.cpp | 12 +- code/nel/src/georges/form_dfn.cpp | 24 +- code/nel/src/georges/form_elm.cpp | 246 +++++++++--------- code/nel/src/georges/form_loader.cpp | 22 +- code/nel/src/georges/header.cpp | 8 +- code/nel/src/georges/type.cpp | 15 +- .../tools/3d/object_viewer/editable_range.cpp | 2 +- .../3d/plugin_max/nel_export/nel_export.def | 2 +- .../plugin_max/nel_export/nel_export_view.cpp | 2 +- .../tools/georges/georges2csv/georges2csv.cpp | 12 +- .../logic/logic_editor_dll/ConditionPage.cpp | 2 +- .../logic_editor_dll/logic_editorDoc.cpp | 18 +- code/ryzom/client/CMakeLists.txt | 6 +- code/ryzom/client/src/browse_faq.cpp | 2 +- .../src/client_sheets/item_fx_sheet.cpp | 2 +- .../client_sheets/outpost_building_sheet.cpp | 2 +- .../src/client_sheets/race_stats_sheet.cpp | 2 +- .../src/client_sheets/sky_object_sheet.cpp | 2 +- code/ryzom/client/src/commands.cpp | 2 +- code/ryzom/client/src/login.cpp | 2 +- code/ryzom/client/src/misc.cpp | 4 +- .../{upgd_nl.bat => upgd_nl_msvc10.bat} | 25 -- code/ryzom/client/windows/upgd_nl_msvc12.bat | 39 +++ .../common/src/game_share/light_cycle.cpp | 2 +- .../static_light_cycle.cpp | 2 +- code/ryzom/server/src/ai_service/sheets.cpp | 2 +- .../egs_sheets/egs_static_brick.cpp | 4 +- .../egs_sheets/egs_static_game_item.cpp | 2 +- .../egs_sheets/egs_static_game_sheet.cpp | 50 ++-- .../egs_sheets/egs_static_harvestable.cpp | 18 +- .../egs_sheets/egs_static_outpost.cpp | 8 +- .../egs_static_rolemaster_phrase.cpp | 2 +- .../tools/leveldesign/georges_dll/action.cpp | 14 +- .../tools/leveldesign/georges_dll/action.h | 10 +- .../leveldesign/georges_dll/base_dialog.cpp | 2 +- .../leveldesign/georges_dll/form_dialog.cpp | 10 +- .../leveldesign/georges_dll/type_dialog.cpp | 4 +- 319 files changed, 1412 insertions(+), 437 deletions(-) rename code/ryzom/client/windows/{upgd_nl.bat => upgd_nl_msvc10.bat} (59%) create mode 100644 code/ryzom/client/windows/upgd_nl_msvc12.bat diff --git a/.travis.yml b/.travis.yml index c3835f23b..c59df07eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,7 @@ os: matrix: fast_finish: true env: - - CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS:BOOL=off -DWITH_LUA51:BOOL=on -DWITH_LUA52:BOOL=off -DWITH_LUA53:BOOL=off" - - CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS:BOOL=off -DWITH_LUA51:BOOL=off -DWITH_LUA52:BOOL=on -DWITH_LUA53:BOOL=off" - - CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS:BOOL=off -DWITH_LUA51:BOOL=off -DWITH_LUA52:BOOL=off -DWITH_LUA53:BOOL=on" + - CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS=OFF -DWITH_LUA51=ON" - CMAKE_CONFIGURE_OPTIONS="-DCPPTEST_LIBRARY_DEBUG:STRING=/usr/lib/libcpptest.so" CMAKE_BUILD_OPTIONS="--target nel_unit_test -- -j 2" RUN="build/bin/nel_unit_test" @@ -19,10 +17,7 @@ env: addons: apt: packages: - - liblua5.1-0-dev - - liblua5.1-0-dbg - - liblua5.2-0-dev - - liblua5.2-0-dbg + - liblua5.1-dev - libluabind-dev - libcpptest-dev - libogg-dev diff --git a/code/nel/include/nel/georges/form.h b/code/nel/include/nel/georges/form.h index d2b6a2f2d..da5c0ea88 100644 --- a/code/nel/include/nel/georges/form.h +++ b/code/nel/include/nel/georges/form.h @@ -22,7 +22,7 @@ #include "form_elm.h" #include "header.h" -extern bool convertFormFile (const char *oldFileName, const char *newFileName); +extern bool convertFormFile (const std::string &oldFileName, const std::string &newFileName); namespace NLGEORGES { @@ -35,7 +35,7 @@ class UFormElm; class CForm : public UForm { friend class CFormLoader; - friend bool convertFormFile (const char *oldFileName, const char *newFileName); + friend bool convertFormFile (const std::string &oldFileName, const std::string &newFileName); public: enum { HeldElementCount = 4 }; @@ -73,12 +73,12 @@ public: // ** IO functions // Set the filename before saving the form - void write (xmlDocPtr doc, const char *filename); + void write (xmlDocPtr doc, const std::string &filename); // ** Parent access // Insert parent before parent indexed "before". - bool insertParent (uint before, const char *filename, CForm *parent); + bool insertParent (uint before, const std::string &filename, CForm *parent); // Remove a parent from parent list void removeParent (uint parent); @@ -97,7 +97,7 @@ public: const std::string &getFilename () const; // Error handling - void warning (bool exception, const char *function, const char *format, ... ) const; + void warning (bool exception, const std::string &function, const char *format, ... ) const; private: @@ -114,7 +114,7 @@ private: // CFormLoader call it // Set the filename before reading the form - void read (xmlNodePtr node, CFormLoader &loader, CFormDfn *dfn, const char *filename); + void read (xmlNodePtr node, CFormLoader &loader, CFormDfn *dfn, const std::string &filename); // Called by read void readParent (const char *parent, CFormLoader &loader); diff --git a/code/nel/include/nel/georges/form_dfn.h b/code/nel/include/nel/georges/form_dfn.h index a93dcbe48..4e9870043 100644 --- a/code/nel/include/nel/georges/form_dfn.h +++ b/code/nel/include/nel/georges/form_dfn.h @@ -24,7 +24,7 @@ #include "header.h" #include "type.h" -bool convertDfnFile (const char *oldFileName, const char *newFileName); +bool convertDfnFile (const std::string &oldFileName, const std::string &newFileName); namespace NLGEORGES { @@ -41,7 +41,7 @@ class CFormDfn : public UFormDfn friend class CFormElm; friend class CFormLoader; friend class CFormElmStruct; - friend bool convertDfnFile (const char *oldFileName, const char *newFileName); + friend bool convertDfnFile (const std::string &oldFileName, const std::string &newFileName); public: // Default cstr @@ -60,7 +60,7 @@ public: friend class CFormElm; friend class CFormDfn; friend class CFormElmStruct; - friend bool convertDfnFile (const char *oldFileName, const char *newFileName); + friend bool convertDfnFile (const std::string &oldFileName, const std::string &newFileName); public: CEntry () @@ -85,12 +85,12 @@ public: TEntryType getType () const; // Set as a type - void setType (CFormLoader &loader, const char *filename); + void setType (CFormLoader &loader, const std::string &filename); void setType (TEntryType type); // Set as a dfn - void setDfn (CFormLoader &loader, const char *filename); + void setDfn (CFormLoader &loader, const std::string &filename); // Set as a dfn pointer void setDfnPointer (); @@ -99,7 +99,7 @@ public: const std::string &getName () const; // Set element Name - void setName (const char *name); + void setName (const std::string &name); // Get the filename const std::string &getFilename() const; @@ -108,16 +108,16 @@ public: const std::string &getFilenameExt() const; // Set the filename - void setFilename (const char *def); + void setFilename (const std::string &def); // Set the filename extension - void setFilenameExt (const char *ext); + void setFilenameExt (const std::string &ext); // Get default value const std::string &getDefault () const; // Set default value - void setDefault (const char *def); + void setDefault (const std::string &def); // Set array flag void setArrayFlag (bool flag); @@ -167,7 +167,7 @@ public: void removeEntry( uint idx ); // ** IO functions - void write (xmlDocPtr root, const char *filename); + void write (xmlDocPtr root, const std::string &filename); // Count parent DFN uint countParentDfn (uint32 round=0) const; @@ -185,7 +185,7 @@ public: void setNumParent (uint size); // Set a parent - void setParent (uint parent, CFormLoader &loader, const char *filename); + void setParent (uint parent, CFormLoader &loader, const std::string &filename); // Get a parent CFormDfn *getParent (uint parent) const; @@ -232,7 +232,7 @@ public: CFileHeader Header; // Error handling - void warning (bool exception, const char *function, const char *format, ... ) const; + void warning (bool exception, const std::string &function, const char *format, ... ) const; private: // The parents array @@ -249,7 +249,7 @@ private: private: // Read method called by the form loader - void read (xmlNodePtr doc, CFormLoader &loader, bool forceLoad, const char *filename); + void read (xmlNodePtr doc, CFormLoader &loader, bool forceLoad, const std::string &filename); }; } // NLGEORGES diff --git a/code/nel/include/nel/georges/form_elm.h b/code/nel/include/nel/georges/form_elm.h index 2d9e76630..738e6a55a 100644 --- a/code/nel/include/nel/georges/form_elm.h +++ b/code/nel/include/nel/georges/form_elm.h @@ -62,30 +62,30 @@ public: virtual void getFormName (std::string &result, const CFormElm *child=NULL) const = 0; // From UFormElm - virtual bool getNodeByName (const UFormElm **result, const char *name, TWhereIsNode *where, bool verbose, uint32 round=0) const; - virtual bool getNodeByName (UFormElm **result, const char *name, TWhereIsNode *where, bool verbose, uint32 round=0); - virtual bool getValueByName (std::string &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (sint8 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (uint8 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (sint16 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (uint16 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (sint32 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (uint32 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (float &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (double &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (bool &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (NLMISC::CRGBA &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool setValueByName (const char *value, const char *name, bool *created); - virtual bool setValueByName (sint8 value, const char *name, bool *created); - virtual bool setValueByName (uint8 value, const char *name, bool *created); - virtual bool setValueByName (sint16 value, const char *name, bool *created); - virtual bool setValueByName (uint16 value, const char *name, bool *created); - virtual bool setValueByName (sint32 value, const char *name, bool *created); - virtual bool setValueByName (uint32 value, const char *name, bool *created); - virtual bool setValueByName (float value, const char *name, bool *created); - virtual bool setValueByName (double value, const char *name, bool *created); - virtual bool setValueByName (bool value, const char *name, bool *created); - virtual bool setValueByName (NLMISC::CRGBA value, const char *name, bool *created); + virtual bool getNodeByName (const UFormElm **result, const std::string &name, TWhereIsNode *where, bool verbose, uint32 round=0) const; + virtual bool getNodeByName (UFormElm **result, const std::string &name, TWhereIsNode *where, bool verbose, uint32 round=0); + virtual bool getValueByName (std::string &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (sint8 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (uint8 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (sint16 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (uint16 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (sint32 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (uint32 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (float &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (double &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (bool &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (NLMISC::CRGBA &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool setValueByName (const std::string &value, const std::string &name, bool *created); + virtual bool setValueByName (sint8 value, const std::string &name, bool *created); + virtual bool setValueByName (uint8 value, const std::string &name, bool *created); + virtual bool setValueByName (sint16 value, const std::string &name, bool *created); + virtual bool setValueByName (uint16 value, const std::string &name, bool *created); + virtual bool setValueByName (sint32 value, const std::string &name, bool *created); + virtual bool setValueByName (uint32 value, const std::string &name, bool *created); + virtual bool setValueByName (float value, const std::string &name, bool *created); + virtual bool setValueByName (double value, const std::string &name, bool *created); + virtual bool setValueByName (bool value, const std::string &name, bool *created); + virtual bool setValueByName (NLMISC::CRGBA value, const std::string &name, bool *created); virtual UFormElm *getParent () const; virtual const CType *getType (); virtual bool isArray () const; @@ -127,16 +127,16 @@ public: // ** Convert functions - inline bool convertValue (sint8 &result, const char *value) const; - inline bool convertValue (uint8 &result, const char *value) const; - inline bool convertValue (sint16 &result, const char *value) const; - inline bool convertValue (uint16 &result, const char *value) const; - inline bool convertValue (sint32 &result, const char *value) const; - inline bool convertValue (uint32 &result, const char *value) const; - inline bool convertValue (float &result, const char *value) const; - inline bool convertValue (double &result, const char *value) const; - inline bool convertValue (bool &result, const char *value) const; - inline bool convertValue (NLMISC::CRGBA &result, const char *value) const; + inline bool convertValue (sint8 &result, const std::string &value) const; + inline bool convertValue (uint8 &result, const std::string &value) const; + inline bool convertValue (sint16 &result, const std::string &value) const; + inline bool convertValue (uint16 &result, const std::string &value) const; + inline bool convertValue (sint32 &result, const std::string &value) const; + inline bool convertValue (uint32 &result, const std::string &value) const; + inline bool convertValue (float &result, const std::string &value) const; + inline bool convertValue (double &result, const std::string &value) const; + inline bool convertValue (bool &result, const std::string &value) const; + inline bool convertValue (NLMISC::CRGBA &result, const std::string &value) const; // ** Get dependencies virtual void getDependencies (std::set &dependencies) const = 0; @@ -144,7 +144,7 @@ public: // ** Internal node access // Create a node by name. If the node already exists, return it - bool createNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, + bool createNodeByName (const std::string &, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool &created); @@ -153,13 +153,13 @@ public: * Delete a node by name. If the node already exists, return it *Delete its parent if not used */ - bool deleteNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, + bool deleteNodeByName (const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array); // Search for a node by name - bool getNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, + bool getNodeByName (const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool &parentVDfnArray, bool verbose, uint32 round) const; @@ -168,7 +168,7 @@ public: * Insert an array node by name * The index asked must be < the size of the array. */ - bool arrayInsertNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, + bool arrayInsertNodeByName (const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool verbose, uint arrayIndex) const; @@ -177,7 +177,7 @@ public: * Delete an array node by name * The index asked must be < the size of the array. */ - bool arrayDeleteNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, + bool arrayDeleteNodeByName (const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool verbose, uint arrayIndex) const; @@ -199,7 +199,7 @@ protected: * Then, else (*parentDfn / indexDfn ) or *node must be defined. * Other values are for result only. */ - static bool getInternalNodeByName (CForm *form, const char *name, const CFormDfn **parentDfn, uint &indexDfn, + static bool getInternalNodeByName (CForm *form, const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, TNodeAction action, bool &created, bool &parentVDfnArray, bool verbose, uint32 round); @@ -215,7 +215,7 @@ public: static const char* tokenize (const char *name, std::string &str, uint &errorIndex, uint &code); // ** IO functions - virtual xmlNodePtr write (xmlNodePtr node, const CForm *form, const char *structName = NULL, bool forceWrite = false) const = 0; + virtual xmlNodePtr write (xmlNodePtr node, const CForm *form, const std::string &structName = "", bool forceWrite = false) const = 0; protected: @@ -235,8 +235,8 @@ protected: uint32 Round; // Error handling - static void warning (bool exception, const char *formName, const char *formFileName, const char *function, const char *format, ... ); - virtual void warning (bool exception, const char *function, const char *format, ... ) const; + static void warning (bool exception, const std::string &formName, const std::string &formFileName, const std::string &function, const char *format, ... ); + virtual void warning (bool exception, const std::string &function, const char *format, ... ) const; private: // Tokens @@ -298,7 +298,7 @@ public: // From CFormElm bool isUsed (const CForm *form) const; - xmlNodePtr write (xmlNodePtr node, const CForm *form, const char *structName, bool forceWrite = false) const; + xmlNodePtr write (xmlNodePtr node, const CForm *form, const std::string &structName, bool forceWrite = false) const; void unlink (CFormElm *child); void getFormName (std::string &result, const CFormElm *child) const; void getDependencies (std::set &dependencies) const; @@ -310,7 +310,7 @@ public: std::vector Elements; // Error handling - virtual void warning (bool exception, const char *function, const char *format, ... ) const; + virtual void warning (bool exception, const std::string &function, const char *format, ... ) const; }; /** @@ -332,13 +332,13 @@ public: // From CFormElm bool isUsed (const CForm *form) const; - xmlNodePtr write (xmlNodePtr node, const CForm *form, const char *structName, bool forceWrite = false) const; + xmlNodePtr write (xmlNodePtr node, const CForm *form, const std::string &structName, bool forceWrite = false) const; // Call by CFormLoader void read (xmlNodePtr node, CFormLoader &loader, CForm *form); // Error handling - virtual void warning (bool exception, const char *function, const char *format, ... ) const; + virtual void warning (bool exception, const std::string &function, const char *format, ... ) const; }; /** @@ -377,7 +377,7 @@ public: bool getArrayValue (NLMISC::CRGBA &result, uint arrayIndex, TEval evaluate, TWhereIsValue *where) const; // From CFormElm - xmlNodePtr write (xmlNodePtr node, const CForm *form, const char *structName, bool forceWrite = false) const; + xmlNodePtr write (xmlNodePtr node, const CForm *form, const std::string &structName, bool forceWrite = false) const; bool setParent (CFormElm *parent); void unlink (CFormElm *child); bool isUsed (const CForm *form) const; @@ -406,7 +406,7 @@ public: std::vector Elements; // Error handling - virtual void warning (bool exception, const char *function, const char *format, ... ) const; + virtual void warning (bool exception, const std::string &function, const char *format, ... ) const; }; /** @@ -429,7 +429,7 @@ public: const CType *Type; // From CFormElm - xmlNodePtr write (xmlNodePtr node, const CForm *form, const char *structName, bool forceWrite = false) const; + xmlNodePtr write (xmlNodePtr node, const CForm *form, const std::string &structName, bool forceWrite = false) const; bool setParent (CFormElm *parent); void getFormName (std::string &result, const CFormElm *child) const; void getDependencies (std::set &dependencies) const; @@ -453,7 +453,7 @@ public: bool getValue (NLMISC::CRGBA &result, TEval evaluate) const; // Set the value, the elt been used - void setValue (const char *value); + void setValue (const std::string &value); // Get the raw value. Does not care about any parent or default values void getValue (std::string &result) const; @@ -463,14 +463,14 @@ private: std::string Value; // Error handling - virtual void warning (bool exception, const char *function, const char *format, ... ) const; + virtual void warning (bool exception, const std::string &function, const char *format, ... ) const; }; // *************************************************************************** // CFormElm inlines // *************************************************************************** -inline bool CFormElm::convertValue (sint8 &result, const char *value) const +inline bool CFormElm::convertValue (sint8 &result, const std::string &value) const { float tmp; if (NLMISC::fromString(value, tmp)) @@ -482,14 +482,14 @@ inline bool CFormElm::convertValue (sint8 &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in sint8.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in sint8.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (uint8 &result, const char *value) const +inline bool CFormElm::convertValue (uint8 &result, const std::string &value) const { float tmp; if (NLMISC::fromString(value, tmp)) @@ -501,14 +501,14 @@ inline bool CFormElm::convertValue (uint8 &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in uint8.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in uint8.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (sint16 &result, const char *value) const +inline bool CFormElm::convertValue (sint16 &result, const std::string &value) const { float tmp; if (NLMISC::fromString(value, tmp)) @@ -520,14 +520,14 @@ inline bool CFormElm::convertValue (sint16 &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in sint16.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in sint16.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (uint16 &result, const char *value) const +inline bool CFormElm::convertValue (uint16 &result, const std::string &value) const { float tmp; if (NLMISC::fromString(value, tmp)) @@ -539,14 +539,14 @@ inline bool CFormElm::convertValue (uint16 &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in uint16.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in uint16.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (sint32 &result, const char *value) const +inline bool CFormElm::convertValue (sint32 &result, const std::string &value) const { float tmp; if (NLMISC::fromString(value, tmp)) @@ -558,14 +558,14 @@ inline bool CFormElm::convertValue (sint32 &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in sint32.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in sint32.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (uint32 &result, const char *value) const +inline bool CFormElm::convertValue (uint32 &result, const std::string &value) const { float tmp; if (NLMISC::fromString(value, tmp)) @@ -577,14 +577,14 @@ inline bool CFormElm::convertValue (uint32 &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in uint32.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in uint32.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (float &result, const char *value) const +inline bool CFormElm::convertValue (float &result, const std::string &value) const { if (NLMISC::fromString(value, result)) { @@ -593,16 +593,16 @@ inline bool CFormElm::convertValue (float &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in float.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in float.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (double &result, const char *value) const +inline bool CFormElm::convertValue (double &result, const std::string &value) const { - float tmp; + double tmp; if (NLMISC::fromString(value, tmp)) { result = tmp; @@ -611,14 +611,14 @@ inline bool CFormElm::convertValue (double &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in double.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in double.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (bool &result, const char *value) const +inline bool CFormElm::convertValue (bool &result, const std::string &value) const { int tmp; if (NLMISC::fromString(value, tmp)) @@ -628,7 +628,7 @@ inline bool CFormElm::convertValue (bool &result, const char *value) const } else { - std::string temp = NLMISC::toLower(std::string(value)); + std::string temp = NLMISC::toLower(value); if (strcmp (temp.c_str (), "true") == 0) { result = true; @@ -642,17 +642,17 @@ inline bool CFormElm::convertValue (bool &result, const char *value) const } // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in boolean.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in boolean.", value.c_str()); return false; } // *************************************************************************** -inline bool CFormElm::convertValue (NLMISC::CRGBA &result, const char *value) const +inline bool CFormElm::convertValue (NLMISC::CRGBA &result, const std::string &value) const { float r, g, b; - if (sscanf (value, "%f,%f,%f", &r, &g, &b) == 3) + if (sscanf (value.c_str(), "%f,%f,%f", &r, &g, &b) == 3) { NLMISC::clamp (r, 0.f, 255.f); NLMISC::clamp (g, 0.f, 255.f); @@ -664,7 +664,7 @@ inline bool CFormElm::convertValue (NLMISC::CRGBA &result, const char *value) co } // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in RGB color.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in RGB color.", value.c_str()); return false; } diff --git a/code/nel/include/nel/georges/form_loader.h b/code/nel/include/nel/georges/form_loader.h index 75d7152ec..c46d79f22 100644 --- a/code/nel/include/nel/georges/form_loader.h +++ b/code/nel/include/nel/georges/form_loader.h @@ -42,18 +42,18 @@ class CFormLoader : public UFormLoader public: virtual ~CFormLoader(); // From UFormLoader - UForm *loadForm (const char *filename); - UFormDfn *loadFormDfn (const char *filename); - UType *loadFormType (const char *filename); + UForm *loadForm (const std::string &filename); + UFormDfn *loadFormDfn (const std::string &filename); + UType *loadFormType (const std::string &filename); // Load type and formDfn - CType *loadType (const char *filename); - CFormDfn *loadFormDfn (const char *filename, bool forceLoad); + CType *loadType (const std::string &filename); + CFormDfn *loadFormDfn (const std::string &filename, bool forceLoad); private: // Error handling - virtual void warning (bool exception, const char *function, const char *format, ... ) const; + virtual void warning (bool exception, const std::string &function, const char *format, ... ) const; typedef std::map > TTypeMap; typedef std::map > TFormDfnMap; diff --git a/code/nel/include/nel/georges/header.h b/code/nel/include/nel/georges/header.h index 343b2baa1..82a094b3d 100644 --- a/code/nel/include/nel/georges/header.h +++ b/code/nel/include/nel/georges/header.h @@ -44,10 +44,10 @@ public: }; /// Add a log - void addLog (const char *log); + void addLog(const std::string &log); /// Set the comment - void setComments (const char *comments); + void setComments (const std::string &comments); /// Major version number uint32 MajorVersion; @@ -72,7 +72,7 @@ public: static const char *getStateString (TState state); // Error handling - void warning (bool exception, const char *function, const char *format, ... ) const; + void warning (bool exception, const std::string &function, const char *format, ... ) const; }; } // NLGEORGES diff --git a/code/nel/include/nel/georges/type.h b/code/nel/include/nel/georges/type.h index 936506c7c..e1bad7934 100644 --- a/code/nel/include/nel/georges/type.h +++ b/code/nel/include/nel/georges/type.h @@ -80,7 +80,7 @@ public: // Evaluate a node bool getValue (std::string &result, const class CForm *form, const class CFormElmAtom *node, const class CFormDfn &parentDfn, - uint parentIndex, UFormElm::TEval evaluate, uint32 *where, uint32 round, const char *formName) const; + uint parentIndex, UFormElm::TEval evaluate, uint32 *where, uint32 round, const std::string &formName) const; // Definitions class CDefinition @@ -114,8 +114,8 @@ public: private: // Error handling - virtual void warning (bool exception, const char *formName, const char *formFilename, const char *function, const char *format, ... ) const; - virtual void warning2 (bool exception, const char *function, const char *format, ... ) const; + virtual void warning (bool exception, const std::string &formName, const std::string &formFilename, const std::string &function, const char *format, ... ) const; + virtual void warning2 (bool exception, const std::string &function, const char *format, ... ) const; // Type names static const char *TypeNames[]; diff --git a/code/nel/include/nel/georges/u_form_elm.h b/code/nel/include/nel/georges/u_form_elm.h index 6ec80938f..f50582a04 100644 --- a/code/nel/include/nel/georges/u_form_elm.h +++ b/code/nel/include/nel/georges/u_form_elm.h @@ -78,8 +78,8 @@ public: * "position.x" : get the element named x in the struct named position * "entities[2].color" : get the node named color in the second element of the entities array */ - virtual bool getNodeByName (const UFormElm **result, const char *name, TWhereIsNode *where = NULL, bool reserved=true, uint32 round=0) const = 0; - virtual bool getNodeByName (UFormElm **result, const char *name, TWhereIsNode *where = NULL, bool reserved=true, uint32 round=0) = 0; + virtual bool getNodeByName (const UFormElm **result, const std::string &name, TWhereIsNode *where = NULL, bool reserved=true, uint32 round=0) const = 0; + virtual bool getNodeByName (UFormElm **result, const std::string &name, TWhereIsNode *where = NULL, bool reserved=true, uint32 round=0) = 0; /// Where a value has been found @@ -104,19 +104,19 @@ public: * \return true if the result has been filled, false if the value has not been found or the cast has failed or the evaluation has failed. * \see getNodeByName () */ - virtual bool getValueByName (std::string &result, const char *namename, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (sint8 &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (uint8 &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (sint16 &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (uint16 &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (sint32 &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (uint32 &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (float &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (double &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (bool &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (std::string &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (sint8 &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (uint8 &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (sint16 &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (uint16 &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (sint32 &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (uint32 &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (float &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (double &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (bool &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; /// Warning, only R, G and B members are filled, not A. - virtual bool getValueByName (NLMISC::CRGBA &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (NLMISC::CRGBA &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; /** * Set a form value with its name. If the node doesn't exist, it is created. @@ -129,17 +129,17 @@ public: * true if the value has been created, false it the value has been filled. * \return true if the value has been set, false if the value has not been found or hasn't been created. */ - virtual bool setValueByName (const char *value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (sint8 value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (uint8 value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (sint16 value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (uint16 value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (sint32 value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (uint32 value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (float value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (double value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (bool value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (NLMISC::CRGBA value, const char *name, bool *created = NULL) = 0; + virtual bool setValueByName (const std::string &value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (sint8 value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (uint8 value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (sint16 value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (uint16 value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (sint32 value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (uint32 value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (float value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (double value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (bool value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (NLMISC::CRGBA value, const std::string &name, bool *created = NULL) = 0; // ** Array element methods diff --git a/code/nel/include/nel/georges/u_form_loader.h b/code/nel/include/nel/georges/u_form_loader.h index b32f358e0..c1cb30cfb 100644 --- a/code/nel/include/nel/georges/u_form_loader.h +++ b/code/nel/include/nel/georges/u_form_loader.h @@ -43,19 +43,19 @@ public: * * The pointer on the form must be held in a CSmartPtr. Returns NULL if the form can't be loaded. */ - virtual UForm *loadForm (const char *filename) = 0; + virtual UForm *loadForm (const std::string &filename) = 0; /** Load a DFN, use NMISC::CPath to find the file. * * The pointer on the form must be held in a CSmartPtr. Returns NULL if the DFN can't be loaded. */ - virtual UFormDfn *loadFormDfn (const char *filename) = 0; + virtual UFormDfn *loadFormDfn (const std::string &filename) = 0; /** Load a type, use NMISC::CPath to find the file. * * The pointer on the form must be held in a CSmartPtr. Returns NULL if the type can't be loaded. */ - virtual UType *loadFormType (const char *filename) = 0; + virtual UType *loadFormType (const std::string &filename) = 0; /// Create a form loader static UFormLoader *createLoader (); diff --git a/code/nel/src/3d/anim_detail_trav.cpp b/code/nel/src/3d/anim_detail_trav.cpp index dc825b849..563e95da8 100644 --- a/code/nel/src/3d/anim_detail_trav.cpp +++ b/code/nel/src/3d/anim_detail_trav.cpp @@ -26,6 +26,9 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/animation_set_user.cpp b/code/nel/src/3d/animation_set_user.cpp index 9ad16c46a..c1e83f7f3 100644 --- a/code/nel/src/3d/animation_set_user.cpp +++ b/code/nel/src/3d/animation_set_user.cpp @@ -19,6 +19,9 @@ #include "nel/3d/animation_set_user.h" #include "nel/3d/driver_user.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/async_texture_manager.cpp b/code/nel/src/3d/async_texture_manager.cpp index a30bd6eb6..a962c9991 100644 --- a/code/nel/src/3d/async_texture_manager.cpp +++ b/code/nel/src/3d/async_texture_manager.cpp @@ -25,6 +25,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/bezier_patch.cpp b/code/nel/src/3d/bezier_patch.cpp index 7181630f6..099a532d2 100644 --- a/code/nel/src/3d/bezier_patch.cpp +++ b/code/nel/src/3d/bezier_patch.cpp @@ -20,6 +20,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { // *************************************************************************** diff --git a/code/nel/src/3d/bloom_effect.cpp b/code/nel/src/3d/bloom_effect.cpp index c468349ac..18a6ac303 100644 --- a/code/nel/src/3d/bloom_effect.cpp +++ b/code/nel/src/3d/bloom_effect.cpp @@ -33,6 +33,10 @@ using namespace NLMISC; using namespace NL3D; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/bone.cpp b/code/nel/src/3d/bone.cpp index 9adf64fcd..98d26c6ce 100644 --- a/code/nel/src/3d/bone.cpp +++ b/code/nel/src/3d/bone.cpp @@ -20,6 +20,9 @@ #include "nel/3d/anim_ctrl.h" #include "nel/misc/hierarchical_timer.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/camera.cpp b/code/nel/src/3d/camera.cpp index b2c02fe2f..012402b74 100644 --- a/code/nel/src/3d/camera.cpp +++ b/code/nel/src/3d/camera.cpp @@ -19,6 +19,9 @@ #include "nel/3d/camera.h" #include "nel/3d/scene.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/camera_col.cpp b/code/nel/src/3d/camera_col.cpp index 538cb1695..7f7e349d3 100644 --- a/code/nel/src/3d/camera_col.cpp +++ b/code/nel/src/3d/camera_col.cpp @@ -22,6 +22,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/channel_mixer.cpp b/code/nel/src/3d/channel_mixer.cpp index 6e7ab7ba7..bd8a4dff5 100644 --- a/code/nel/src/3d/channel_mixer.cpp +++ b/code/nel/src/3d/channel_mixer.cpp @@ -27,6 +27,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/clip_trav.cpp b/code/nel/src/3d/clip_trav.cpp index b75abe61e..fc8fa4872 100644 --- a/code/nel/src/3d/clip_trav.cpp +++ b/code/nel/src/3d/clip_trav.cpp @@ -37,6 +37,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/cloud_scape.cpp b/code/nel/src/3d/cloud_scape.cpp index 77d046eec..5c40d89ec 100644 --- a/code/nel/src/3d/cloud_scape.cpp +++ b/code/nel/src/3d/cloud_scape.cpp @@ -23,6 +23,10 @@ // ------------------------------------------------------------------------------------------------ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/cloud_scape_user.cpp b/code/nel/src/3d/cloud_scape_user.cpp index 5570ed7eb..1a18a26fa 100644 --- a/code/nel/src/3d/cloud_scape_user.cpp +++ b/code/nel/src/3d/cloud_scape_user.cpp @@ -22,6 +22,9 @@ #include "nel/3d/cloud_scape.h" #include "nel/3d/scene.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/cluster.cpp b/code/nel/src/3d/cluster.cpp index d78468e61..312042364 100644 --- a/code/nel/src/3d/cluster.cpp +++ b/code/nel/src/3d/cluster.cpp @@ -28,6 +28,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/coarse_mesh_build.cpp b/code/nel/src/3d/coarse_mesh_build.cpp index fec5f0b3f..966f389b4 100644 --- a/code/nel/src/3d/coarse_mesh_build.cpp +++ b/code/nel/src/3d/coarse_mesh_build.cpp @@ -23,6 +23,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/coarse_mesh_manager.cpp b/code/nel/src/3d/coarse_mesh_manager.cpp index 6ba8b3ec6..2d4792263 100644 --- a/code/nel/src/3d/coarse_mesh_manager.cpp +++ b/code/nel/src/3d/coarse_mesh_manager.cpp @@ -28,6 +28,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/computed_string.cpp b/code/nel/src/3d/computed_string.cpp index 6bc1be856..a8f7743b3 100644 --- a/code/nel/src/3d/computed_string.cpp +++ b/code/nel/src/3d/computed_string.cpp @@ -32,6 +32,10 @@ using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/cube_map_builder.cpp b/code/nel/src/3d/cube_map_builder.cpp index 6e319b59e..60aec6cdd 100644 --- a/code/nel/src/3d/cube_map_builder.cpp +++ b/code/nel/src/3d/cube_map_builder.cpp @@ -26,6 +26,9 @@ +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/debug_vb.cpp b/code/nel/src/3d/debug_vb.cpp index 39e01b646..b1aebe6e0 100644 --- a/code/nel/src/3d/debug_vb.cpp +++ b/code/nel/src/3d/debug_vb.cpp @@ -19,6 +19,10 @@ #include "nel/3d/vertex_buffer.h" #include "nel/3d/index_buffer.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/deform_2d.cpp b/code/nel/src/3d/deform_2d.cpp index 7a4ffb507..f36f61820 100644 --- a/code/nel/src/3d/deform_2d.cpp +++ b/code/nel/src/3d/deform_2d.cpp @@ -27,6 +27,10 @@ #include "nel/3d/dru.h" #include "nel/3d/material.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/driver.cpp b/code/nel/src/3d/driver.cpp index 3ba0178f2..36d783e78 100644 --- a/code/nel/src/3d/driver.cpp +++ b/code/nel/src/3d/driver.cpp @@ -28,6 +28,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/driver_user.cpp b/code/nel/src/3d/driver_user.cpp index b236223b7..d1a747478 100644 --- a/code/nel/src/3d/driver_user.cpp +++ b/code/nel/src/3d/driver_user.cpp @@ -40,6 +40,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/driver_user2.cpp b/code/nel/src/3d/driver_user2.cpp index 1b46ab607..e24391a1c 100644 --- a/code/nel/src/3d/driver_user2.cpp +++ b/code/nel/src/3d/driver_user2.cpp @@ -37,6 +37,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/dru.cpp b/code/nel/src/3d/dru.cpp index fd3e77404..15ccbfe01 100644 --- a/code/nel/src/3d/dru.cpp +++ b/code/nel/src/3d/dru.cpp @@ -46,6 +46,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/event_mouse_listener.cpp b/code/nel/src/3d/event_mouse_listener.cpp index cb9fb142e..d81b2bfd4 100644 --- a/code/nel/src/3d/event_mouse_listener.cpp +++ b/code/nel/src/3d/event_mouse_listener.cpp @@ -24,6 +24,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/fast_ptr_list.cpp b/code/nel/src/3d/fast_ptr_list.cpp index 753824dae..c9cab1069 100644 --- a/code/nel/src/3d/fast_ptr_list.cpp +++ b/code/nel/src/3d/fast_ptr_list.cpp @@ -20,6 +20,10 @@ using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/fasthls_modifier.cpp b/code/nel/src/3d/fasthls_modifier.cpp index 2790e1442..cae414f2c 100644 --- a/code/nel/src/3d/fasthls_modifier.cpp +++ b/code/nel/src/3d/fasthls_modifier.cpp @@ -26,6 +26,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/flare_model.cpp b/code/nel/src/3d/flare_model.cpp index c48e754cf..f070bdcec 100644 --- a/code/nel/src/3d/flare_model.cpp +++ b/code/nel/src/3d/flare_model.cpp @@ -30,6 +30,9 @@ #include "nel/misc/common.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/flare_shape.cpp b/code/nel/src/3d/flare_shape.cpp index a3a1d135f..e8f74dc4e 100644 --- a/code/nel/src/3d/flare_shape.cpp +++ b/code/nel/src/3d/flare_shape.cpp @@ -24,6 +24,9 @@ #include "nel/3d/shape_bank.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/font_generator.cpp b/code/nel/src/3d/font_generator.cpp index ce8048f15..0adf29418 100644 --- a/code/nel/src/3d/font_generator.cpp +++ b/code/nel/src/3d/font_generator.cpp @@ -58,6 +58,10 @@ const char* err_msg; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { FT_Library CFontGenerator::_Library = NULL; diff --git a/code/nel/src/3d/font_manager.cpp b/code/nel/src/3d/font_manager.cpp index 7b503099b..3b77a2100 100644 --- a/code/nel/src/3d/font_manager.cpp +++ b/code/nel/src/3d/font_manager.cpp @@ -32,6 +32,10 @@ using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/frustum.cpp b/code/nel/src/3d/frustum.cpp index 356673a92..36d28ebb0 100644 --- a/code/nel/src/3d/frustum.cpp +++ b/code/nel/src/3d/frustum.cpp @@ -23,6 +23,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/fxaa.cpp b/code/nel/src/3d/fxaa.cpp index 1eff22501..d37a159ef 100644 --- a/code/nel/src/3d/fxaa.cpp +++ b/code/nel/src/3d/fxaa.cpp @@ -49,11 +49,17 @@ using namespace std; namespace NL3D { namespace { - #include "fxaa_program.h" - } /* anonymous namespace */ +} + +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + +namespace NL3D { + CFXAA::CFXAA(NL3D::UDriver *driver) : m_Driver(driver), m_VP(NULL), m_PP(NULL), m_Width(~0), m_Height(~0) { nldebug("3D: Create FXAA"); diff --git a/code/nel/src/3d/geometry_program.cpp b/code/nel/src/3d/geometry_program.cpp index 8f785b6c6..985309a55 100644 --- a/code/nel/src/3d/geometry_program.cpp +++ b/code/nel/src/3d/geometry_program.cpp @@ -27,6 +27,10 @@ #include "nel/3d/driver.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/gpu_program_params.cpp b/code/nel/src/3d/gpu_program_params.cpp index f46ba8713..f7cc6654d 100644 --- a/code/nel/src/3d/gpu_program_params.cpp +++ b/code/nel/src/3d/gpu_program_params.cpp @@ -41,6 +41,10 @@ using namespace std; // using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { const size_t CGPUProgramParams::s_End = -1; diff --git a/code/nel/src/3d/heat_haze.cpp b/code/nel/src/3d/heat_haze.cpp index c42942fe7..03ea4dc06 100644 --- a/code/nel/src/3d/heat_haze.cpp +++ b/code/nel/src/3d/heat_haze.cpp @@ -22,6 +22,10 @@ #include "nel/3d/deform_2d.h" #include "nel/misc/vector_2f.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/height_map.cpp b/code/nel/src/3d/height_map.cpp index 505145376..4236cd15e 100644 --- a/code/nel/src/3d/height_map.cpp +++ b/code/nel/src/3d/height_map.cpp @@ -21,6 +21,9 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/hls_color_texture.cpp b/code/nel/src/3d/hls_color_texture.cpp index 4afd1c5ea..16766b202 100644 --- a/code/nel/src/3d/hls_color_texture.cpp +++ b/code/nel/src/3d/hls_color_texture.cpp @@ -27,6 +27,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/hls_texture_bank.cpp b/code/nel/src/3d/hls_texture_bank.cpp index bc7cc7c1f..d7e213cf4 100644 --- a/code/nel/src/3d/hls_texture_bank.cpp +++ b/code/nel/src/3d/hls_texture_bank.cpp @@ -21,6 +21,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/hls_texture_manager.cpp b/code/nel/src/3d/hls_texture_manager.cpp index 147238ae7..586ec53ce 100644 --- a/code/nel/src/3d/hls_texture_manager.cpp +++ b/code/nel/src/3d/hls_texture_manager.cpp @@ -22,6 +22,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/hrc_trav.cpp b/code/nel/src/3d/hrc_trav.cpp index 9d79ac55d..a4cbc525a 100644 --- a/code/nel/src/3d/hrc_trav.cpp +++ b/code/nel/src/3d/hrc_trav.cpp @@ -23,6 +23,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ig_surface_light.cpp b/code/nel/src/3d/ig_surface_light.cpp index efd5e89a4..ef4a59a46 100644 --- a/code/nel/src/3d/ig_surface_light.cpp +++ b/code/nel/src/3d/ig_surface_light.cpp @@ -18,6 +18,9 @@ #include "nel/3d/ig_surface_light.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ig_surface_light_build.cpp b/code/nel/src/3d/ig_surface_light_build.cpp index 33a5a33b0..70d66c388 100644 --- a/code/nel/src/3d/ig_surface_light_build.cpp +++ b/code/nel/src/3d/ig_surface_light_build.cpp @@ -23,6 +23,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/index_buffer.cpp b/code/nel/src/3d/index_buffer.cpp index 7bb2e1cd5..e99b1e1e3 100644 --- a/code/nel/src/3d/index_buffer.cpp +++ b/code/nel/src/3d/index_buffer.cpp @@ -23,6 +23,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { // *************************************************************************** diff --git a/code/nel/src/3d/init_3d.cpp b/code/nel/src/3d/init_3d.cpp index b2bf2c05e..e34702b74 100644 --- a/code/nel/src/3d/init_3d.cpp +++ b/code/nel/src/3d/init_3d.cpp @@ -22,6 +22,10 @@ #include "nel/3d/scene.h" #include "nel/3d/register_3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace { static bool _Initialized = false; diff --git a/code/nel/src/3d/instance_group_user.cpp b/code/nel/src/3d/instance_group_user.cpp index 651e54094..536e14e94 100644 --- a/code/nel/src/3d/instance_group_user.cpp +++ b/code/nel/src/3d/instance_group_user.cpp @@ -29,6 +29,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/instance_lighter.cpp b/code/nel/src/3d/instance_lighter.cpp index d21f80e4e..8e7c16294 100644 --- a/code/nel/src/3d/instance_lighter.cpp +++ b/code/nel/src/3d/instance_lighter.cpp @@ -28,6 +28,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/key.cpp b/code/nel/src/3d/key.cpp index e1722bf23..561041175 100644 --- a/code/nel/src/3d/key.cpp +++ b/code/nel/src/3d/key.cpp @@ -18,6 +18,9 @@ #include "nel/3d/key.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/landscape.cpp b/code/nel/src/3d/landscape.cpp index b54bffa28..8112053d7 100644 --- a/code/nel/src/3d/landscape.cpp +++ b/code/nel/src/3d/landscape.cpp @@ -41,6 +41,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D diff --git a/code/nel/src/3d/landscape_collision_grid.cpp b/code/nel/src/3d/landscape_collision_grid.cpp index 07b509a68..1636fc6bd 100644 --- a/code/nel/src/3d/landscape_collision_grid.cpp +++ b/code/nel/src/3d/landscape_collision_grid.cpp @@ -24,6 +24,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/landscape_def.cpp b/code/nel/src/3d/landscape_def.cpp index ac545d04b..0c463e167 100644 --- a/code/nel/src/3d/landscape_def.cpp +++ b/code/nel/src/3d/landscape_def.cpp @@ -23,6 +23,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/landscape_face_vector_manager.cpp b/code/nel/src/3d/landscape_face_vector_manager.cpp index 955ac3587..0ba4b07cf 100644 --- a/code/nel/src/3d/landscape_face_vector_manager.cpp +++ b/code/nel/src/3d/landscape_face_vector_manager.cpp @@ -23,6 +23,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/landscape_model.cpp b/code/nel/src/3d/landscape_model.cpp index ca90bae2e..017b82e51 100644 --- a/code/nel/src/3d/landscape_model.cpp +++ b/code/nel/src/3d/landscape_model.cpp @@ -23,9 +23,14 @@ #include "nel/3d/cluster.h" #include "nel/3d/scene.h" #include "nel/3d/light_trav.h" + using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/landscape_profile.cpp b/code/nel/src/3d/landscape_profile.cpp index 97ccba0b5..3f20ac4d8 100644 --- a/code/nel/src/3d/landscape_profile.cpp +++ b/code/nel/src/3d/landscape_profile.cpp @@ -18,6 +18,9 @@ #include "nel/3d/landscape_profile.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/landscape_user.cpp b/code/nel/src/3d/landscape_user.cpp index fd1bc3747..76d73583f 100644 --- a/code/nel/src/3d/landscape_user.cpp +++ b/code/nel/src/3d/landscape_user.cpp @@ -24,6 +24,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/landscape_vegetable_block.cpp b/code/nel/src/3d/landscape_vegetable_block.cpp index 593725828..ec015916b 100644 --- a/code/nel/src/3d/landscape_vegetable_block.cpp +++ b/code/nel/src/3d/landscape_vegetable_block.cpp @@ -27,6 +27,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/landscapeig_manager.cpp b/code/nel/src/3d/landscapeig_manager.cpp index 500373360..10eab0f60 100644 --- a/code/nel/src/3d/landscapeig_manager.cpp +++ b/code/nel/src/3d/landscapeig_manager.cpp @@ -36,6 +36,10 @@ H_AUTO_DECL ( NL3D_Unload_Zone_IG ) #define NL3D_HAUTO_LAND_MNGR_LOAD_ZONEIG H_AUTO_USE( NL3D_Load_Zone_IG ) #define NL3D_HAUTO_LAND_MNGR_UNLOAD_ZONEIG H_AUTO_USE( NL3D_Unload_Zone_IG ) +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/landscapevb_allocator.cpp b/code/nel/src/3d/landscapevb_allocator.cpp index c6815ea05..81a91fb12 100644 --- a/code/nel/src/3d/landscapevb_allocator.cpp +++ b/code/nel/src/3d/landscapevb_allocator.cpp @@ -24,6 +24,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/landscapevb_info.cpp b/code/nel/src/3d/landscapevb_info.cpp index 46d666ea7..f5955e622 100644 --- a/code/nel/src/3d/landscapevb_info.cpp +++ b/code/nel/src/3d/landscapevb_info.cpp @@ -20,6 +20,9 @@ #include "nel/3d/vertex_buffer.h" #include "nel/3d/landscapevb_allocator.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/light.cpp b/code/nel/src/3d/light.cpp index bd190dc00..ba887a447 100644 --- a/code/nel/src/3d/light.cpp +++ b/code/nel/src/3d/light.cpp @@ -20,6 +20,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/light_contribution.cpp b/code/nel/src/3d/light_contribution.cpp index 9e7e3d1ce..240b540b9 100644 --- a/code/nel/src/3d/light_contribution.cpp +++ b/code/nel/src/3d/light_contribution.cpp @@ -18,6 +18,9 @@ #include "nel/3d/light_contribution.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/light_influence_interpolator.cpp b/code/nel/src/3d/light_influence_interpolator.cpp index 2875abaac..d6e90bd18 100644 --- a/code/nel/src/3d/light_influence_interpolator.cpp +++ b/code/nel/src/3d/light_influence_interpolator.cpp @@ -20,6 +20,9 @@ #include "nel/misc/debug.h" #include "nel/3d/point_light_named.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/light_trav.cpp b/code/nel/src/3d/light_trav.cpp index 0e31d1558..42c2e2aa5 100644 --- a/code/nel/src/3d/light_trav.cpp +++ b/code/nel/src/3d/light_trav.cpp @@ -27,12 +27,13 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { -using namespace NLMISC; - // *************************************************************************** CLightTrav::CLightTrav(bool bSmallScene) : LightingManager(bSmallScene) { diff --git a/code/nel/src/3d/light_user.cpp b/code/nel/src/3d/light_user.cpp index 14f5b463a..a74e2bd02 100644 --- a/code/nel/src/3d/light_user.cpp +++ b/code/nel/src/3d/light_user.cpp @@ -18,6 +18,9 @@ #include "nel/3d/light_user.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/lighting_manager.cpp b/code/nel/src/3d/lighting_manager.cpp index 0f528d5fb..dcf6eff80 100644 --- a/code/nel/src/3d/lighting_manager.cpp +++ b/code/nel/src/3d/lighting_manager.cpp @@ -28,6 +28,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/load_balancing_trav.cpp b/code/nel/src/3d/load_balancing_trav.cpp index a9f289d11..1e983a2a5 100644 --- a/code/nel/src/3d/load_balancing_trav.cpp +++ b/code/nel/src/3d/load_balancing_trav.cpp @@ -32,6 +32,10 @@ using namespace NLMISC; #define NL3D_DEFAULT_LOADBALANCING_VALUE_SMOOTHER 50 #define NL3D_LOADBALANCING_SMOOTHER_MAX_RATIO 1.1f +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/lod_character_builder.cpp b/code/nel/src/3d/lod_character_builder.cpp index 6b0b6e51b..05eef0b30 100644 --- a/code/nel/src/3d/lod_character_builder.cpp +++ b/code/nel/src/3d/lod_character_builder.cpp @@ -27,6 +27,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/lod_character_instance.cpp b/code/nel/src/3d/lod_character_instance.cpp index 7c0d7a0b9..09940184b 100644 --- a/code/nel/src/3d/lod_character_instance.cpp +++ b/code/nel/src/3d/lod_character_instance.cpp @@ -18,6 +18,9 @@ #include "nel/3d/lod_character_instance.h" #include "nel/3d/lod_character_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/lod_character_manager.cpp b/code/nel/src/3d/lod_character_manager.cpp index 48c2a500f..92dee846a 100644 --- a/code/nel/src/3d/lod_character_manager.cpp +++ b/code/nel/src/3d/lod_character_manager.cpp @@ -34,6 +34,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/lod_character_shape.cpp b/code/nel/src/3d/lod_character_shape.cpp index 02d15ce03..21e1cce7f 100644 --- a/code/nel/src/3d/lod_character_shape.cpp +++ b/code/nel/src/3d/lod_character_shape.cpp @@ -28,6 +28,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/lod_character_shape_bank.cpp b/code/nel/src/3d/lod_character_shape_bank.cpp index 018b336f3..f8fdd1a22 100644 --- a/code/nel/src/3d/lod_character_shape_bank.cpp +++ b/code/nel/src/3d/lod_character_shape_bank.cpp @@ -23,6 +23,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/lod_character_texture.cpp b/code/nel/src/3d/lod_character_texture.cpp index 5876da48f..2f91861d2 100644 --- a/code/nel/src/3d/lod_character_texture.cpp +++ b/code/nel/src/3d/lod_character_texture.cpp @@ -18,6 +18,9 @@ #include "std3d.h" #include "nel/3d/lod_character_texture.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/logic_info.cpp b/code/nel/src/3d/logic_info.cpp index 4202eb863..7599b0917 100644 --- a/code/nel/src/3d/logic_info.cpp +++ b/code/nel/src/3d/logic_info.cpp @@ -18,6 +18,9 @@ #include "nel/3d/logic_info.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/material.cpp b/code/nel/src/3d/material.cpp index 3204a620d..3cae5dd30 100644 --- a/code/nel/src/3d/material.cpp +++ b/code/nel/src/3d/material.cpp @@ -24,6 +24,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/mesh.cpp b/code/nel/src/3d/mesh.cpp index 3595c962d..eddb86391 100644 --- a/code/nel/src/3d/mesh.cpp +++ b/code/nel/src/3d/mesh.cpp @@ -36,6 +36,9 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/mesh_base.cpp b/code/nel/src/3d/mesh_base.cpp index f355b7271..3e11e7bfe 100644 --- a/code/nel/src/3d/mesh_base.cpp +++ b/code/nel/src/3d/mesh_base.cpp @@ -25,6 +25,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/mesh_base_instance.cpp b/code/nel/src/3d/mesh_base_instance.cpp index 566bebbb1..33037393e 100644 --- a/code/nel/src/3d/mesh_base_instance.cpp +++ b/code/nel/src/3d/mesh_base_instance.cpp @@ -29,6 +29,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/mesh_blender.cpp b/code/nel/src/3d/mesh_blender.cpp index 866ba5048..ec4b74015 100644 --- a/code/nel/src/3d/mesh_blender.cpp +++ b/code/nel/src/3d/mesh_blender.cpp @@ -20,6 +20,9 @@ #include "nel/3d/driver.h" #include "nel/misc/fast_floor.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/mesh_block_manager.cpp b/code/nel/src/3d/mesh_block_manager.cpp index c672e6436..64a24cbfb 100644 --- a/code/nel/src/3d/mesh_block_manager.cpp +++ b/code/nel/src/3d/mesh_block_manager.cpp @@ -21,6 +21,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/mesh_geom.cpp b/code/nel/src/3d/mesh_geom.cpp index 53eac4967..e8a34f4c5 100644 --- a/code/nel/src/3d/mesh_geom.cpp +++ b/code/nel/src/3d/mesh_geom.cpp @@ -19,6 +19,9 @@ #include "nel/3d/mesh_geom.h" #include "nel/3d/mesh_block_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/mesh_instance.cpp b/code/nel/src/3d/mesh_instance.cpp index 5ce134675..eef6e92a5 100644 --- a/code/nel/src/3d/mesh_instance.cpp +++ b/code/nel/src/3d/mesh_instance.cpp @@ -26,6 +26,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/mesh_morpher.cpp b/code/nel/src/3d/mesh_morpher.cpp index 39f44a130..4840f36a2 100644 --- a/code/nel/src/3d/mesh_morpher.cpp +++ b/code/nel/src/3d/mesh_morpher.cpp @@ -24,6 +24,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/mesh_mrm.cpp b/code/nel/src/3d/mesh_mrm.cpp index e5b61c966..64646ebc1 100644 --- a/code/nel/src/3d/mesh_mrm.cpp +++ b/code/nel/src/3d/mesh_mrm.cpp @@ -38,6 +38,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/mesh_mrm_instance.cpp b/code/nel/src/3d/mesh_mrm_instance.cpp index d97de135f..94acd1fe8 100644 --- a/code/nel/src/3d/mesh_mrm_instance.cpp +++ b/code/nel/src/3d/mesh_mrm_instance.cpp @@ -27,6 +27,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/mesh_mrm_skin_template.cpp b/code/nel/src/3d/mesh_mrm_skin_template.cpp index 63a0b67e8..792b8c5dc 100644 --- a/code/nel/src/3d/mesh_mrm_skin_template.cpp +++ b/code/nel/src/3d/mesh_mrm_skin_template.cpp @@ -20,6 +20,10 @@ #include "std3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + // ace: before including this, #define this define to use it // the goal is to be able to compile every .cpp file with no // special case (GNU/Linux needs) diff --git a/code/nel/src/3d/mesh_mrm_skinned.cpp b/code/nel/src/3d/mesh_mrm_skinned.cpp index 11a1b41fc..ebe50d3ec 100644 --- a/code/nel/src/3d/mesh_mrm_skinned.cpp +++ b/code/nel/src/3d/mesh_mrm_skinned.cpp @@ -39,6 +39,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/mesh_mrm_skinned_instance.cpp b/code/nel/src/3d/mesh_mrm_skinned_instance.cpp index a07cb5875..02c277571 100644 --- a/code/nel/src/3d/mesh_mrm_skinned_instance.cpp +++ b/code/nel/src/3d/mesh_mrm_skinned_instance.cpp @@ -27,6 +27,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/mesh_mrm_skinned_template.cpp b/code/nel/src/3d/mesh_mrm_skinned_template.cpp index 5d1b2f582..c6d25810e 100644 --- a/code/nel/src/3d/mesh_mrm_skinned_template.cpp +++ b/code/nel/src/3d/mesh_mrm_skinned_template.cpp @@ -20,6 +20,10 @@ #include "std3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + // *************************************************************************** // *************************************************************************** // Raw "Vertex/Normal only" ApplySkin methods. diff --git a/code/nel/src/3d/mesh_multi_lod.cpp b/code/nel/src/3d/mesh_multi_lod.cpp index e26632f6e..f200e2bc6 100644 --- a/code/nel/src/3d/mesh_multi_lod.cpp +++ b/code/nel/src/3d/mesh_multi_lod.cpp @@ -35,6 +35,9 @@ using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/mesh_multi_lod_instance.cpp b/code/nel/src/3d/mesh_multi_lod_instance.cpp index c6c8fa237..cf7805788 100644 --- a/code/nel/src/3d/mesh_multi_lod_instance.cpp +++ b/code/nel/src/3d/mesh_multi_lod_instance.cpp @@ -25,6 +25,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/meshvp_per_pixel_light.cpp b/code/nel/src/3d/meshvp_per_pixel_light.cpp index 9c5285bbd..6bbcec5c6 100644 --- a/code/nel/src/3d/meshvp_per_pixel_light.cpp +++ b/code/nel/src/3d/meshvp_per_pixel_light.cpp @@ -29,6 +29,9 @@ #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/meshvp_wind_tree.cpp b/code/nel/src/3d/meshvp_wind_tree.cpp index 1e3d215a3..1b81af721 100644 --- a/code/nel/src/3d/meshvp_wind_tree.cpp +++ b/code/nel/src/3d/meshvp_wind_tree.cpp @@ -28,6 +28,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/mini_col.cpp b/code/nel/src/3d/mini_col.cpp index 8b847afbf..e2c266349 100644 --- a/code/nel/src/3d/mini_col.cpp +++ b/code/nel/src/3d/mini_col.cpp @@ -19,9 +19,13 @@ #include "nel/3d/mini_col.h" #include "nel/misc/aabbox.h" #include "nel/3d/quad_grid.h" + using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/motion_blur.cpp b/code/nel/src/3d/motion_blur.cpp index e9fe1fdab..410ac8610 100644 --- a/code/nel/src/3d/motion_blur.cpp +++ b/code/nel/src/3d/motion_blur.cpp @@ -23,6 +23,9 @@ #include "nel/3d/texture_blank.h" #include "nel/3d/material.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/mrm_builder.cpp b/code/nel/src/3d/mrm_builder.cpp index 3035aa78b..b035cae88 100644 --- a/code/nel/src/3d/mrm_builder.cpp +++ b/code/nel/src/3d/mrm_builder.cpp @@ -18,9 +18,13 @@ #include "nel/3d/mrm_builder.h" #include "nel/3d/mrm_parameters.h" + using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/mrm_internal.cpp b/code/nel/src/3d/mrm_internal.cpp index b524fcf08..75a83874d 100644 --- a/code/nel/src/3d/mrm_internal.cpp +++ b/code/nel/src/3d/mrm_internal.cpp @@ -23,6 +23,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/mrm_level_detail.cpp b/code/nel/src/3d/mrm_level_detail.cpp index 3314ec76e..4943b6e09 100644 --- a/code/nel/src/3d/mrm_level_detail.cpp +++ b/code/nel/src/3d/mrm_level_detail.cpp @@ -19,6 +19,9 @@ #include "nel/3d/mrm_level_detail.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/mrm_mesh.cpp b/code/nel/src/3d/mrm_mesh.cpp index 0ad2f127f..03cdebeee 100644 --- a/code/nel/src/3d/mrm_mesh.cpp +++ b/code/nel/src/3d/mrm_mesh.cpp @@ -21,6 +21,10 @@ using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/nelu.cpp b/code/nel/src/3d/nelu.cpp index 6417e5abc..8cb6e0968 100644 --- a/code/nel/src/3d/nelu.cpp +++ b/code/nel/src/3d/nelu.cpp @@ -30,6 +30,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/noise_3d.cpp b/code/nel/src/3d/noise_3d.cpp index 5900e4750..3c5257c49 100644 --- a/code/nel/src/3d/noise_3d.cpp +++ b/code/nel/src/3d/noise_3d.cpp @@ -20,6 +20,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/packed_world.cpp b/code/nel/src/3d/packed_world.cpp index 15d59c724..f1ad22ab2 100644 --- a/code/nel/src/3d/packed_world.cpp +++ b/code/nel/src/3d/packed_world.cpp @@ -23,6 +23,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/packed_zone.cpp b/code/nel/src/3d/packed_zone.cpp index 1c6bf4817..dbc9b2d1d 100644 --- a/code/nel/src/3d/packed_zone.cpp +++ b/code/nel/src/3d/packed_zone.cpp @@ -35,6 +35,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/particle_system.cpp b/code/nel/src/3d/particle_system.cpp index 34b75d427..b50ffa8a2 100644 --- a/code/nel/src/3d/particle_system.cpp +++ b/code/nel/src/3d/particle_system.cpp @@ -45,6 +45,9 @@ #define CHECK_INTEGRITY #endif +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif diff --git a/code/nel/src/3d/particle_system_manager.cpp b/code/nel/src/3d/particle_system_manager.cpp index e2e0eed8d..5778b2898 100644 --- a/code/nel/src/3d/particle_system_manager.cpp +++ b/code/nel/src/3d/particle_system_manager.cpp @@ -21,6 +21,9 @@ #include "nel/3d/scene.h" #include "nel/3d/skeleton_model.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/particle_system_model.cpp b/code/nel/src/3d/particle_system_model.cpp index 8b7f7d142..7736b7233 100644 --- a/code/nel/src/3d/particle_system_model.cpp +++ b/code/nel/src/3d/particle_system_model.cpp @@ -32,6 +32,9 @@ +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/particle_system_process.cpp b/code/nel/src/3d/particle_system_process.cpp index b0340ea0b..8150d56d1 100644 --- a/code/nel/src/3d/particle_system_process.cpp +++ b/code/nel/src/3d/particle_system_process.cpp @@ -19,6 +19,10 @@ #include "nel/3d/particle_system_process.h" #include "nel/3d/particle_system.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + uint PSEnterLeaveDepth = 0; uint PSEnterLeaveMaxDepth = 1; std::string PSCurrName; diff --git a/code/nel/src/3d/particle_system_shape.cpp b/code/nel/src/3d/particle_system_shape.cpp index 7acbea6d4..94851c3eb 100644 --- a/code/nel/src/3d/particle_system_shape.cpp +++ b/code/nel/src/3d/particle_system_shape.cpp @@ -33,6 +33,10 @@ #include "nel/3d/ps_face_look_at.h" #include "nel/3d/ps_force.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/particle_system_sound_user.cpp b/code/nel/src/3d/particle_system_sound_user.cpp index b2ea9587e..5916bc964 100644 --- a/code/nel/src/3d/particle_system_sound_user.cpp +++ b/code/nel/src/3d/particle_system_sound_user.cpp @@ -23,6 +23,9 @@ #include "nel/3d/u_ps_sound_interface.h" #include "nel/3d/u_ps_sound_impl.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/patch.cpp b/code/nel/src/3d/patch.cpp index 4b0253ead..29f960a28 100644 --- a/code/nel/src/3d/patch.cpp +++ b/code/nel/src/3d/patch.cpp @@ -38,6 +38,10 @@ using namespace NLMISC; // Define this to remove user color (debug) // #define NEL_FORCE_NO_USER_COLOR +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/patch_lightmap.cpp b/code/nel/src/3d/patch_lightmap.cpp index bc14c7917..7a47085dd 100644 --- a/code/nel/src/3d/patch_lightmap.cpp +++ b/code/nel/src/3d/patch_lightmap.cpp @@ -30,9 +30,13 @@ #include "nel/misc/fast_floor.h" #include "nel/3d/light_influence_interpolator.h" #include "nel/3d/patchdlm_context.h" + using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/patch_noise.cpp b/code/nel/src/3d/patch_noise.cpp index ed87f2fe0..f0a491346 100644 --- a/code/nel/src/3d/patch_noise.cpp +++ b/code/nel/src/3d/patch_noise.cpp @@ -26,9 +26,13 @@ #include "nel/misc/common.h" #include "nel/3d/tile_noise_map.h" #include "nel/3d/patchuv_locator.h" + using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/patch_rdr_pass.cpp b/code/nel/src/3d/patch_rdr_pass.cpp index ada89ce35..607d8b4cf 100644 --- a/code/nel/src/3d/patch_rdr_pass.cpp +++ b/code/nel/src/3d/patch_rdr_pass.cpp @@ -19,6 +19,9 @@ #include "nel/3d/patch_rdr_pass.h" #include "nel/3d/index_buffer.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/patch_render.cpp b/code/nel/src/3d/patch_render.cpp index 59978a94d..de5d0b4ec 100644 --- a/code/nel/src/3d/patch_render.cpp +++ b/code/nel/src/3d/patch_render.cpp @@ -32,6 +32,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/patch_vegetable.cpp b/code/nel/src/3d/patch_vegetable.cpp index 6729d3625..385b6f615 100644 --- a/code/nel/src/3d/patch_vegetable.cpp +++ b/code/nel/src/3d/patch_vegetable.cpp @@ -33,6 +33,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/patchdlm_context.cpp b/code/nel/src/3d/patchdlm_context.cpp index f7d2236e8..54a34dd92 100644 --- a/code/nel/src/3d/patchdlm_context.cpp +++ b/code/nel/src/3d/patchdlm_context.cpp @@ -31,6 +31,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/patchuv_locator.cpp b/code/nel/src/3d/patchuv_locator.cpp index 697ccfb72..b4743c4c1 100644 --- a/code/nel/src/3d/patchuv_locator.cpp +++ b/code/nel/src/3d/patchuv_locator.cpp @@ -21,6 +21,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/pixel_program.cpp b/code/nel/src/3d/pixel_program.cpp index 120e7def6..a11344055 100644 --- a/code/nel/src/3d/pixel_program.cpp +++ b/code/nel/src/3d/pixel_program.cpp @@ -27,6 +27,10 @@ #include "nel/3d/driver.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/play_list_manager.cpp b/code/nel/src/3d/play_list_manager.cpp index 636336cf3..0648984c5 100644 --- a/code/nel/src/3d/play_list_manager.cpp +++ b/code/nel/src/3d/play_list_manager.cpp @@ -18,6 +18,9 @@ #include "nel/3d/play_list_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/play_list_manager_user.cpp b/code/nel/src/3d/play_list_manager_user.cpp index c6991e914..4248a753f 100644 --- a/code/nel/src/3d/play_list_manager_user.cpp +++ b/code/nel/src/3d/play_list_manager_user.cpp @@ -21,6 +21,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/play_list_user.cpp b/code/nel/src/3d/play_list_user.cpp index 9f9d0c688..6f2a2773d 100644 --- a/code/nel/src/3d/play_list_user.cpp +++ b/code/nel/src/3d/play_list_user.cpp @@ -26,6 +26,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/point_light.cpp b/code/nel/src/3d/point_light.cpp index e441e198e..ff0527689 100644 --- a/code/nel/src/3d/point_light.cpp +++ b/code/nel/src/3d/point_light.cpp @@ -24,6 +24,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/point_light_model.cpp b/code/nel/src/3d/point_light_model.cpp index df7e38234..17bb18619 100644 --- a/code/nel/src/3d/point_light_model.cpp +++ b/code/nel/src/3d/point_light_model.cpp @@ -25,6 +25,9 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/point_light_named.cpp b/code/nel/src/3d/point_light_named.cpp index ffee29eb8..f4a6a9cac 100644 --- a/code/nel/src/3d/point_light_named.cpp +++ b/code/nel/src/3d/point_light_named.cpp @@ -18,6 +18,9 @@ #include "nel/3d/point_light_named.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/point_light_named_array.cpp b/code/nel/src/3d/point_light_named_array.cpp index 0b91d7c46..460da282e 100644 --- a/code/nel/src/3d/point_light_named_array.cpp +++ b/code/nel/src/3d/point_light_named_array.cpp @@ -23,6 +23,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/portal.cpp b/code/nel/src/3d/portal.cpp index 62df832db..096dcd129 100644 --- a/code/nel/src/3d/portal.cpp +++ b/code/nel/src/3d/portal.cpp @@ -29,6 +29,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/primitive_profile.cpp b/code/nel/src/3d/primitive_profile.cpp index ea23dbe1d..06b0c3bae 100644 --- a/code/nel/src/3d/primitive_profile.cpp +++ b/code/nel/src/3d/primitive_profile.cpp @@ -18,6 +18,9 @@ #include "nel/3d/primitive_profile.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/program.cpp b/code/nel/src/3d/program.cpp index 738b57550..7758feec6 100644 --- a/code/nel/src/3d/program.cpp +++ b/code/nel/src/3d/program.cpp @@ -42,6 +42,10 @@ using namespace std; // using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { // *************************************************************************** diff --git a/code/nel/src/3d/ps_allocator.cpp b/code/nel/src/3d/ps_allocator.cpp index dd79c750f..eb01e4754 100644 --- a/code/nel/src/3d/ps_allocator.cpp +++ b/code/nel/src/3d/ps_allocator.cpp @@ -18,6 +18,10 @@ #include "nel/3d/particle_system_process.h" #include "nel/3d/ps_allocator.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { #ifdef PS_FAST_ALLOC diff --git a/code/nel/src/3d/ps_attrib_maker_bin_op.cpp b/code/nel/src/3d/ps_attrib_maker_bin_op.cpp index 8c029e407..a4e91163d 100644 --- a/code/nel/src/3d/ps_attrib_maker_bin_op.cpp +++ b/code/nel/src/3d/ps_attrib_maker_bin_op.cpp @@ -18,6 +18,9 @@ #include "nel/3d/ps_attrib_maker_bin_op.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ps_attrib_maker_helper.cpp b/code/nel/src/3d/ps_attrib_maker_helper.cpp index da1b96f94..56dd0ec84 100644 --- a/code/nel/src/3d/ps_attrib_maker_helper.cpp +++ b/code/nel/src/3d/ps_attrib_maker_helper.cpp @@ -17,6 +17,10 @@ #include "std3d.h" #include "nel/3d/ps_attrib_maker_helper.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ps_attrib_maker_template.cpp b/code/nel/src/3d/ps_attrib_maker_template.cpp index 7790b8052..66fe5912d 100644 --- a/code/nel/src/3d/ps_attrib_maker_template.cpp +++ b/code/nel/src/3d/ps_attrib_maker_template.cpp @@ -18,6 +18,9 @@ #include "nel/3d/ps_attrib_maker_template.h" #include "nel/misc/system_info.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ps_color.cpp b/code/nel/src/3d/ps_color.cpp index f8014fe67..4fbda508a 100644 --- a/code/nel/src/3d/ps_color.cpp +++ b/code/nel/src/3d/ps_color.cpp @@ -19,6 +19,9 @@ #include "nel/3d/ps_color.h" #include "nel/3d/ps_register_color_attribs.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ps_dot.cpp b/code/nel/src/3d/ps_dot.cpp index 3711ff50e..bf1f51b4d 100644 --- a/code/nel/src/3d/ps_dot.cpp +++ b/code/nel/src/3d/ps_dot.cpp @@ -25,6 +25,10 @@ #include "nel/misc/fast_mem.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ps_emitter.cpp b/code/nel/src/3d/ps_emitter.cpp index a976ea5c4..7fb5a6516 100644 --- a/code/nel/src/3d/ps_emitter.cpp +++ b/code/nel/src/3d/ps_emitter.cpp @@ -22,6 +22,10 @@ #include "nel/3d/dru.h" #include "nel/3d/particle_system.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ps_face.cpp b/code/nel/src/3d/ps_face.cpp index 818522897..0d3ce6482 100644 --- a/code/nel/src/3d/ps_face.cpp +++ b/code/nel/src/3d/ps_face.cpp @@ -25,6 +25,9 @@ #include "nel/misc/quat.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ps_face_look_at.cpp b/code/nel/src/3d/ps_face_look_at.cpp index 32cd7c248..d6ac0ec0f 100644 --- a/code/nel/src/3d/ps_face_look_at.cpp +++ b/code/nel/src/3d/ps_face_look_at.cpp @@ -25,6 +25,9 @@ #include "nel/misc/fast_floor.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ps_fan_light.cpp b/code/nel/src/3d/ps_fan_light.cpp index 7f4f789a0..6296373b6 100644 --- a/code/nel/src/3d/ps_fan_light.cpp +++ b/code/nel/src/3d/ps_fan_light.cpp @@ -25,6 +25,9 @@ #include "nel/3d/debug_vb.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ps_float.cpp b/code/nel/src/3d/ps_float.cpp index 079b98e43..f4f0a7226 100644 --- a/code/nel/src/3d/ps_float.cpp +++ b/code/nel/src/3d/ps_float.cpp @@ -20,6 +20,10 @@ #include "nel/3d/ps_register_float_attribs.h" #include "nel/misc/fast_floor.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ps_force.cpp b/code/nel/src/3d/ps_force.cpp index bbef28663..bf0ca662d 100644 --- a/code/nel/src/3d/ps_force.cpp +++ b/code/nel/src/3d/ps_force.cpp @@ -28,6 +28,10 @@ #include "nel/3d/ps_util.h" #include "nel/3d/ps_misc.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ps_int.cpp b/code/nel/src/3d/ps_int.cpp index 8c19bb0c0..ff1f3cc4a 100644 --- a/code/nel/src/3d/ps_int.cpp +++ b/code/nel/src/3d/ps_int.cpp @@ -19,6 +19,9 @@ #include "nel/3d/ps_int.h" #include "nel/3d/ps_register_int_attribs.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ps_light.cpp b/code/nel/src/3d/ps_light.cpp index 3cbe644be..034a5bfcb 100644 --- a/code/nel/src/3d/ps_light.cpp +++ b/code/nel/src/3d/ps_light.cpp @@ -25,6 +25,10 @@ #include "nel/misc/matrix.h" #include "nel/misc/vector.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ps_located.cpp b/code/nel/src/3d/ps_located.cpp index 6572a5b23..5f9920eda 100644 --- a/code/nel/src/3d/ps_located.cpp +++ b/code/nel/src/3d/ps_located.cpp @@ -48,6 +48,10 @@ #define CHECK_PS_INTEGRITY #endif +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ps_mesh.cpp b/code/nel/src/3d/ps_mesh.cpp index 655534c6c..8a9429a7d 100644 --- a/code/nel/src/3d/ps_mesh.cpp +++ b/code/nel/src/3d/ps_mesh.cpp @@ -34,6 +34,10 @@ #include "nel/misc/stream.h" #include "nel/misc/path.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ps_particle_basic.cpp b/code/nel/src/3d/ps_particle_basic.cpp index c2d6b6357..42e4d31c6 100644 --- a/code/nel/src/3d/ps_particle_basic.cpp +++ b/code/nel/src/3d/ps_particle_basic.cpp @@ -25,6 +25,9 @@ #include "nel/3d/particle_system.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ps_plane_basis_maker.cpp b/code/nel/src/3d/ps_plane_basis_maker.cpp index f1ca718b9..bdc99cd18 100644 --- a/code/nel/src/3d/ps_plane_basis_maker.cpp +++ b/code/nel/src/3d/ps_plane_basis_maker.cpp @@ -20,6 +20,10 @@ #include "nel/3d/ps_plane_basis_maker.h" #include "nel/3d/ps_register_plane_basis_attribs.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ps_quad.cpp b/code/nel/src/3d/ps_quad.cpp index c517063e0..295c31c93 100644 --- a/code/nel/src/3d/ps_quad.cpp +++ b/code/nel/src/3d/ps_quad.cpp @@ -24,6 +24,10 @@ #include "nel/3d/particle_system.h" #include "nel/3d/ps_iterator.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ps_register_attribs.cpp b/code/nel/src/3d/ps_register_attribs.cpp index 184c2f467..7fb616178 100644 --- a/code/nel/src/3d/ps_register_attribs.cpp +++ b/code/nel/src/3d/ps_register_attribs.cpp @@ -25,7 +25,9 @@ #include "nel/3d/ps_register_plane_basis_attribs.h" - +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ps_register_emitters.cpp b/code/nel/src/3d/ps_register_emitters.cpp index f5c0def3a..e2793f388 100644 --- a/code/nel/src/3d/ps_register_emitters.cpp +++ b/code/nel/src/3d/ps_register_emitters.cpp @@ -21,6 +21,9 @@ #include "nel/3d/ps_emitter.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ps_register_forces.cpp b/code/nel/src/3d/ps_register_forces.cpp index cb41f1fb8..7d9b1bcff 100644 --- a/code/nel/src/3d/ps_register_forces.cpp +++ b/code/nel/src/3d/ps_register_forces.cpp @@ -19,6 +19,10 @@ #include "nel/3d/ps_util.h" #include "nel/3d/ps_force.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { void CPSUtil::registerForces() diff --git a/code/nel/src/3d/ps_register_particles.cpp b/code/nel/src/3d/ps_register_particles.cpp index 6809d8c66..adbce5d36 100644 --- a/code/nel/src/3d/ps_register_particles.cpp +++ b/code/nel/src/3d/ps_register_particles.cpp @@ -22,6 +22,9 @@ #include "nel/3d/ps_particle2.h" #include "nel/3d/ps_mesh.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ps_register_zones.cpp b/code/nel/src/3d/ps_register_zones.cpp index 8996eaf99..73b28c0fb 100644 --- a/code/nel/src/3d/ps_register_zones.cpp +++ b/code/nel/src/3d/ps_register_zones.cpp @@ -21,6 +21,9 @@ #include "nel/3d/ps_zone.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ps_ribbon.cpp b/code/nel/src/3d/ps_ribbon.cpp index 00a3d1310..06bb08787 100644 --- a/code/nel/src/3d/ps_ribbon.cpp +++ b/code/nel/src/3d/ps_ribbon.cpp @@ -24,6 +24,10 @@ #include "nel/3d/texture_mem.h" #include "nel/misc/matrix.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ps_ribbon_base.cpp b/code/nel/src/3d/ps_ribbon_base.cpp index 8f602b931..a3f70253b 100644 --- a/code/nel/src/3d/ps_ribbon_base.cpp +++ b/code/nel/src/3d/ps_ribbon_base.cpp @@ -22,6 +22,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ps_ribbon_look_at.cpp b/code/nel/src/3d/ps_ribbon_look_at.cpp index 7fece0e3d..2e03acaf6 100644 --- a/code/nel/src/3d/ps_ribbon_look_at.cpp +++ b/code/nel/src/3d/ps_ribbon_look_at.cpp @@ -22,6 +22,10 @@ #include "nel/3d/driver.h" #include "nel/3d/debug_vb.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ps_shockwave.cpp b/code/nel/src/3d/ps_shockwave.cpp index 44f91d208..dc94f5f96 100644 --- a/code/nel/src/3d/ps_shockwave.cpp +++ b/code/nel/src/3d/ps_shockwave.cpp @@ -24,6 +24,9 @@ #include "nel/3d/particle_system.h" #include "nel/3d/debug_vb.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ps_sound.cpp b/code/nel/src/3d/ps_sound.cpp index a1705d907..873b3ed34 100644 --- a/code/nel/src/3d/ps_sound.cpp +++ b/code/nel/src/3d/ps_sound.cpp @@ -23,6 +23,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ps_tail_dot.cpp b/code/nel/src/3d/ps_tail_dot.cpp index cf9baa016..69caa8f71 100644 --- a/code/nel/src/3d/ps_tail_dot.cpp +++ b/code/nel/src/3d/ps_tail_dot.cpp @@ -25,6 +25,10 @@ #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { static NLMISC::CRGBA GradientB2W[] = {NLMISC::CRGBA(0, 0, 0, 0), NLMISC::CRGBA(255, 255, 255, 255) }; diff --git a/code/nel/src/3d/ps_util.cpp b/code/nel/src/3d/ps_util.cpp index 94d67c777..b25f10e10 100644 --- a/code/nel/src/3d/ps_util.cpp +++ b/code/nel/src/3d/ps_util.cpp @@ -39,6 +39,9 @@ #include "nel/3d/particle_system_shape.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/ps_zone.cpp b/code/nel/src/3d/ps_zone.cpp index 30349906f..55a65d68f 100644 --- a/code/nel/src/3d/ps_zone.cpp +++ b/code/nel/src/3d/ps_zone.cpp @@ -32,6 +32,10 @@ #include #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/quad_effect.cpp b/code/nel/src/3d/quad_effect.cpp index a6c75c99d..63fd0565c 100644 --- a/code/nel/src/3d/quad_effect.cpp +++ b/code/nel/src/3d/quad_effect.cpp @@ -20,6 +20,10 @@ #include #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/quad_grid.cpp b/code/nel/src/3d/quad_grid.cpp index fca3ab95e..0240b4d0f 100644 --- a/code/nel/src/3d/quad_grid.cpp +++ b/code/nel/src/3d/quad_grid.cpp @@ -17,6 +17,10 @@ #include "std3d.h" #include "nel/3d/quad_grid.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { NLMISC::CPolygon2D CQuadGridBase::_ScaledPoly; diff --git a/code/nel/src/3d/raw_skin.cpp b/code/nel/src/3d/raw_skin.cpp index 5ed069d50..e6788aa71 100644 --- a/code/nel/src/3d/raw_skin.cpp +++ b/code/nel/src/3d/raw_skin.cpp @@ -20,6 +20,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/raw_skinned.cpp b/code/nel/src/3d/raw_skinned.cpp index 3625ea928..5f05d5fb2 100644 --- a/code/nel/src/3d/raw_skinned.cpp +++ b/code/nel/src/3d/raw_skinned.cpp @@ -20,6 +20,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/ray_mesh.cpp b/code/nel/src/3d/ray_mesh.cpp index ca6b9b09d..3ba3461ee 100644 --- a/code/nel/src/3d/ray_mesh.cpp +++ b/code/nel/src/3d/ray_mesh.cpp @@ -26,6 +26,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/register_3d.cpp b/code/nel/src/3d/register_3d.cpp index 2e9edbf41..82ac4502e 100644 --- a/code/nel/src/3d/register_3d.cpp +++ b/code/nel/src/3d/register_3d.cpp @@ -45,6 +45,9 @@ #include "nel/3d/packed_zone.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/render_target_manager.cpp b/code/nel/src/3d/render_target_manager.cpp index 4b552c62e..8112686fb 100644 --- a/code/nel/src/3d/render_target_manager.cpp +++ b/code/nel/src/3d/render_target_manager.cpp @@ -46,6 +46,10 @@ using namespace std; // using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { struct CRenderTargetDescInt diff --git a/code/nel/src/3d/render_trav.cpp b/code/nel/src/3d/render_trav.cpp index 0a9aa7a5f..cab2e3c00 100644 --- a/code/nel/src/3d/render_trav.cpp +++ b/code/nel/src/3d/render_trav.cpp @@ -39,6 +39,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/root_model.cpp b/code/nel/src/3d/root_model.cpp index cf6d68876..b1ff66cc8 100644 --- a/code/nel/src/3d/root_model.cpp +++ b/code/nel/src/3d/root_model.cpp @@ -19,6 +19,9 @@ #include "nel/3d/root_model.h" #include "nel/3d/scene.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/scene.cpp b/code/nel/src/3d/scene.cpp index 7c552efd4..25d9695c0 100644 --- a/code/nel/src/3d/scene.cpp +++ b/code/nel/src/3d/scene.cpp @@ -66,6 +66,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + #define NL3D_SCENE_COARSE_MANAGER_TEXTURE "nel_coarse_texture.tga" diff --git a/code/nel/src/3d/scene_group.cpp b/code/nel/src/3d/scene_group.cpp index c5f6f24dc..c060c4c5d 100644 --- a/code/nel/src/3d/scene_group.cpp +++ b/code/nel/src/3d/scene_group.cpp @@ -36,6 +36,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/scene_user.cpp b/code/nel/src/3d/scene_user.cpp index 0df2439de..c581c5c68 100644 --- a/code/nel/src/3d/scene_user.cpp +++ b/code/nel/src/3d/scene_user.cpp @@ -34,6 +34,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/seg_remanence.cpp b/code/nel/src/3d/seg_remanence.cpp index e0f9a52ae..be0b0d0cf 100644 --- a/code/nel/src/3d/seg_remanence.cpp +++ b/code/nel/src/3d/seg_remanence.cpp @@ -29,7 +29,9 @@ - +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/seg_remanence_shape.cpp b/code/nel/src/3d/seg_remanence_shape.cpp index cb70f8baa..f31b2c0b2 100644 --- a/code/nel/src/3d/seg_remanence_shape.cpp +++ b/code/nel/src/3d/seg_remanence_shape.cpp @@ -24,6 +24,9 @@ #include "nel/misc/bsphere.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/shadow_map.cpp b/code/nel/src/3d/shadow_map.cpp index 15f9b28e4..a9cad0496 100644 --- a/code/nel/src/3d/shadow_map.cpp +++ b/code/nel/src/3d/shadow_map.cpp @@ -26,6 +26,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/shadow_map_manager.cpp b/code/nel/src/3d/shadow_map_manager.cpp index e3f8fde99..c592b5a07 100644 --- a/code/nel/src/3d/shadow_map_manager.cpp +++ b/code/nel/src/3d/shadow_map_manager.cpp @@ -31,6 +31,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/shadow_poly_receiver.cpp b/code/nel/src/3d/shadow_poly_receiver.cpp index 3c832209e..7091310f7 100644 --- a/code/nel/src/3d/shadow_poly_receiver.cpp +++ b/code/nel/src/3d/shadow_poly_receiver.cpp @@ -27,6 +27,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/shadow_skin.cpp b/code/nel/src/3d/shadow_skin.cpp index 717d81f74..204e39d91 100644 --- a/code/nel/src/3d/shadow_skin.cpp +++ b/code/nel/src/3d/shadow_skin.cpp @@ -25,6 +25,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/shape.cpp b/code/nel/src/3d/shape.cpp index cf61185cd..6b0db63b8 100644 --- a/code/nel/src/3d/shape.cpp +++ b/code/nel/src/3d/shape.cpp @@ -25,6 +25,9 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/shape_bank.cpp b/code/nel/src/3d/shape_bank.cpp index 08eb867b5..1b34039eb 100644 --- a/code/nel/src/3d/shape_bank.cpp +++ b/code/nel/src/3d/shape_bank.cpp @@ -27,6 +27,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/shape_bank_user.cpp b/code/nel/src/3d/shape_bank_user.cpp index eb059d51b..5ded42d0d 100644 --- a/code/nel/src/3d/shape_bank_user.cpp +++ b/code/nel/src/3d/shape_bank_user.cpp @@ -25,6 +25,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/shape_info.cpp b/code/nel/src/3d/shape_info.cpp index 8a4d9cf80..d3a8a4df3 100644 --- a/code/nel/src/3d/shape_info.cpp +++ b/code/nel/src/3d/shape_info.cpp @@ -28,6 +28,9 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/shifted_triangle_cache.cpp b/code/nel/src/3d/shifted_triangle_cache.cpp index c98c5b103..85cf1313a 100644 --- a/code/nel/src/3d/shifted_triangle_cache.cpp +++ b/code/nel/src/3d/shifted_triangle_cache.cpp @@ -17,6 +17,9 @@ #include "std3d.h" #include "nel/3d/shifted_triangle_cache.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/skeleton_model.cpp b/code/nel/src/3d/skeleton_model.cpp index 8fbab5568..94b6fb896 100644 --- a/code/nel/src/3d/skeleton_model.cpp +++ b/code/nel/src/3d/skeleton_model.cpp @@ -36,6 +36,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/skeleton_shape.cpp b/code/nel/src/3d/skeleton_shape.cpp index 386b9ad1f..230915407 100644 --- a/code/nel/src/3d/skeleton_shape.cpp +++ b/code/nel/src/3d/skeleton_shape.cpp @@ -24,6 +24,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/skeleton_spawn_script.cpp b/code/nel/src/3d/skeleton_spawn_script.cpp index b77d044fc..d950b43a3 100644 --- a/code/nel/src/3d/skeleton_spawn_script.cpp +++ b/code/nel/src/3d/skeleton_spawn_script.cpp @@ -27,6 +27,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/skeleton_weight.cpp b/code/nel/src/3d/skeleton_weight.cpp index ba037236a..2f9c412c1 100644 --- a/code/nel/src/3d/skeleton_weight.cpp +++ b/code/nel/src/3d/skeleton_weight.cpp @@ -19,6 +19,9 @@ #include "nel/3d/skeleton_weight.h" #include "nel/misc/stream.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/stereo_debugger.cpp b/code/nel/src/3d/stereo_debugger.cpp index 138f8e3ae..c0c36eb74 100644 --- a/code/nel/src/3d/stereo_debugger.cpp +++ b/code/nel/src/3d/stereo_debugger.cpp @@ -47,6 +47,10 @@ using namespace std; // using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { namespace { diff --git a/code/nel/src/3d/stereo_display.cpp b/code/nel/src/3d/stereo_display.cpp index dede3fbf6..6ff13b54c 100644 --- a/code/nel/src/3d/stereo_display.cpp +++ b/code/nel/src/3d/stereo_display.cpp @@ -42,6 +42,10 @@ using namespace std; // using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { IStereoDisplay::IStereoDisplay() diff --git a/code/nel/src/3d/stereo_hmd.cpp b/code/nel/src/3d/stereo_hmd.cpp index 207965636..d5f29d107 100644 --- a/code/nel/src/3d/stereo_hmd.cpp +++ b/code/nel/src/3d/stereo_hmd.cpp @@ -38,6 +38,10 @@ using namespace std; // using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { IStereoHMD::IStereoHMD() diff --git a/code/nel/src/3d/stereo_libvr.cpp b/code/nel/src/3d/stereo_libvr.cpp index 2f31beac4..d8c843dbf 100644 --- a/code/nel/src/3d/stereo_libvr.cpp +++ b/code/nel/src/3d/stereo_libvr.cpp @@ -54,6 +54,10 @@ extern "C" { using namespace std; // using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { extern const char *g_StereoOVR_fp40; //TODO: what? diff --git a/code/nel/src/3d/stereo_ovr.cpp b/code/nel/src/3d/stereo_ovr.cpp index 103b44696..69a2b0db0 100644 --- a/code/nel/src/3d/stereo_ovr.cpp +++ b/code/nel/src/3d/stereo_ovr.cpp @@ -68,6 +68,10 @@ using namespace std; // using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { extern const char *g_StereoOVR_fp40; diff --git a/code/nel/src/3d/stereo_ovr_04.cpp b/code/nel/src/3d/stereo_ovr_04.cpp index fcccc2f6b..2f382a176 100644 --- a/code/nel/src/3d/stereo_ovr_04.cpp +++ b/code/nel/src/3d/stereo_ovr_04.cpp @@ -68,6 +68,10 @@ using namespace std; // using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { namespace { diff --git a/code/nel/src/3d/stereo_ovr_fp.cpp b/code/nel/src/3d/stereo_ovr_fp.cpp index 84a74598e..c9ca3c1cc 100644 --- a/code/nel/src/3d/stereo_ovr_fp.cpp +++ b/code/nel/src/3d/stereo_ovr_fp.cpp @@ -23,6 +23,10 @@ limitations under the License. #include "std3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { const char *g_StereoOVR_fp40 = "!!ARBfp1.0\n" diff --git a/code/nel/src/3d/stripifier.cpp b/code/nel/src/3d/stripifier.cpp index 96ac4e211..6453cbd1b 100644 --- a/code/nel/src/3d/stripifier.cpp +++ b/code/nel/src/3d/stripifier.cpp @@ -25,6 +25,10 @@ using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/surface_light_grid.cpp b/code/nel/src/3d/surface_light_grid.cpp index 9a4731c00..deec090a4 100644 --- a/code/nel/src/3d/surface_light_grid.cpp +++ b/code/nel/src/3d/surface_light_grid.cpp @@ -27,6 +27,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/tangent_space_build.cpp b/code/nel/src/3d/tangent_space_build.cpp index 8a1b1100a..f99a7537b 100644 --- a/code/nel/src/3d/tangent_space_build.cpp +++ b/code/nel/src/3d/tangent_space_build.cpp @@ -23,6 +23,9 @@ #include "nel/misc/triangle.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/tess_block.cpp b/code/nel/src/3d/tess_block.cpp index 3b3c7ec92..917e06a23 100644 --- a/code/nel/src/3d/tess_block.cpp +++ b/code/nel/src/3d/tess_block.cpp @@ -20,6 +20,9 @@ #include "nel/3d/patch_rdr_pass.h" #include "nel/3d/landscape_face_vector_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/tess_face_priority_list.cpp b/code/nel/src/3d/tess_face_priority_list.cpp index 8746a4791..a49c9af75 100644 --- a/code/nel/src/3d/tess_face_priority_list.cpp +++ b/code/nel/src/3d/tess_face_priority_list.cpp @@ -26,6 +26,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/tessellation.cpp b/code/nel/src/3d/tessellation.cpp index b683725a3..451e1013b 100644 --- a/code/nel/src/3d/tessellation.cpp +++ b/code/nel/src/3d/tessellation.cpp @@ -23,9 +23,13 @@ #include "nel/3d/landscape_profile.h" #include "nel/3d/landscape.h" #include "nel/3d/patchdlm_context.h" + using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/text_context.cpp b/code/nel/src/3d/text_context.cpp index 1cca5145a..a28c3e7a1 100644 --- a/code/nel/src/3d/text_context.cpp +++ b/code/nel/src/3d/text_context.cpp @@ -19,6 +19,10 @@ #include "nel/3d/text_context.h" #include "nel/3d/font_generator.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { // ------------------------------------------------------------------------------------------------ diff --git a/code/nel/src/3d/text_context_user.cpp b/code/nel/src/3d/text_context_user.cpp index 441d463f5..1834a93ce 100644 --- a/code/nel/src/3d/text_context_user.cpp +++ b/code/nel/src/3d/text_context_user.cpp @@ -19,6 +19,9 @@ #include "nel/3d/text_context_user.h" #include "nel/misc/hierarchical_timer.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/texture.cpp b/code/nel/src/3d/texture.cpp index bd01f7650..3e248e521 100644 --- a/code/nel/src/3d/texture.cpp +++ b/code/nel/src/3d/texture.cpp @@ -20,6 +20,9 @@ #include "nel/3d/driver.h" #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/texture_blank.cpp b/code/nel/src/3d/texture_blank.cpp index f9b2b1210..febf30079 100644 --- a/code/nel/src/3d/texture_blank.cpp +++ b/code/nel/src/3d/texture_blank.cpp @@ -18,6 +18,9 @@ #include "nel/3d/texture_blank.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/texture_blend.cpp b/code/nel/src/3d/texture_blend.cpp index 765766119..0d85664d6 100644 --- a/code/nel/src/3d/texture_blend.cpp +++ b/code/nel/src/3d/texture_blend.cpp @@ -19,6 +19,10 @@ #include "nel/3d/texture_blend.h" #include "nel/misc/common.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/texture_bump.cpp b/code/nel/src/3d/texture_bump.cpp index 887167de6..adc425c37 100644 --- a/code/nel/src/3d/texture_bump.cpp +++ b/code/nel/src/3d/texture_bump.cpp @@ -20,6 +20,9 @@ +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/texture_cube.cpp b/code/nel/src/3d/texture_cube.cpp index 809bff5fa..f754aa2a0 100644 --- a/code/nel/src/3d/texture_cube.cpp +++ b/code/nel/src/3d/texture_cube.cpp @@ -25,6 +25,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/texture_dlm.cpp b/code/nel/src/3d/texture_dlm.cpp index 3e7695936..ab7168827 100644 --- a/code/nel/src/3d/texture_dlm.cpp +++ b/code/nel/src/3d/texture_dlm.cpp @@ -24,6 +24,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/texture_emboss.cpp b/code/nel/src/3d/texture_emboss.cpp index 55d5d85a9..1c9733bda 100644 --- a/code/nel/src/3d/texture_emboss.cpp +++ b/code/nel/src/3d/texture_emboss.cpp @@ -19,6 +19,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { // *********************************************************************************************************** diff --git a/code/nel/src/3d/texture_far.cpp b/code/nel/src/3d/texture_far.cpp index d51d8fe43..594a79131 100644 --- a/code/nel/src/3d/texture_far.cpp +++ b/code/nel/src/3d/texture_far.cpp @@ -29,6 +29,10 @@ using namespace NLMISC; using namespace NL3D; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { CRGBA CTextureFar::_LightmapExpanded[NL_NUM_PIXELS_ON_FAR_TILE_EDGE*NL_MAX_TILES_BY_PATCH_EDGE*NL_NUM_PIXELS_ON_FAR_TILE_EDGE*NL_MAX_TILES_BY_PATCH_EDGE]; diff --git a/code/nel/src/3d/texture_file.cpp b/code/nel/src/3d/texture_file.cpp index bed3b36d7..a30b21bb1 100644 --- a/code/nel/src/3d/texture_file.cpp +++ b/code/nel/src/3d/texture_file.cpp @@ -21,9 +21,13 @@ #include "nel/misc/path.h" #include "nel/misc/debug.h" #include "nel/misc/hierarchical_timer.h" + using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/texture_font.cpp b/code/nel/src/3d/texture_font.cpp index 4e9e3a0a4..cf46d025d 100644 --- a/code/nel/src/3d/texture_font.cpp +++ b/code/nel/src/3d/texture_font.cpp @@ -28,6 +28,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/texture_grouped.cpp b/code/nel/src/3d/texture_grouped.cpp index 1df0c7c7d..b6d42f3b1 100644 --- a/code/nel/src/3d/texture_grouped.cpp +++ b/code/nel/src/3d/texture_grouped.cpp @@ -23,6 +23,10 @@ #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { std::map CTextureGrouped::_NameToSize; diff --git a/code/nel/src/3d/texture_mem.cpp b/code/nel/src/3d/texture_mem.cpp index 9a51bd9ab..e2881e88e 100644 --- a/code/nel/src/3d/texture_mem.cpp +++ b/code/nel/src/3d/texture_mem.cpp @@ -21,6 +21,9 @@ #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/texture_multi_file.cpp b/code/nel/src/3d/texture_multi_file.cpp index 5968df550..b2316cc73 100644 --- a/code/nel/src/3d/texture_multi_file.cpp +++ b/code/nel/src/3d/texture_multi_file.cpp @@ -19,6 +19,9 @@ #include "nel/3d/texture_multi_file.h" #include "nel/3d/texture_file.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/texture_near.cpp b/code/nel/src/3d/texture_near.cpp index 6c430f74e..e39279dd1 100644 --- a/code/nel/src/3d/texture_near.cpp +++ b/code/nel/src/3d/texture_near.cpp @@ -15,11 +15,14 @@ // along with this program. If not, see . #include "std3d.h" - - #include "nel/3d/texture_near.h" + using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/tile_bank.cpp b/code/nel/src/3d/tile_bank.cpp index 23075448e..e222f061f 100644 --- a/code/nel/src/3d/tile_bank.cpp +++ b/code/nel/src/3d/tile_bank.cpp @@ -29,6 +29,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/tile_element.cpp b/code/nel/src/3d/tile_element.cpp index 52216749e..6f89abf61 100644 --- a/code/nel/src/3d/tile_element.cpp +++ b/code/nel/src/3d/tile_element.cpp @@ -19,6 +19,9 @@ #include "nel/3d/tile_element.h" #include "nel/misc/debug.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/tile_far_bank.cpp b/code/nel/src/3d/tile_far_bank.cpp index e62903904..d8eceb21e 100644 --- a/code/nel/src/3d/tile_far_bank.cpp +++ b/code/nel/src/3d/tile_far_bank.cpp @@ -23,6 +23,10 @@ using namespace NLMISC; // Define this to force white far texture (debug) // #define NEL_FORCE_WHITE_FAR_TEXTURE +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/tile_light_influence.cpp b/code/nel/src/3d/tile_light_influence.cpp index 55a44af66..53bc2e096 100644 --- a/code/nel/src/3d/tile_light_influence.cpp +++ b/code/nel/src/3d/tile_light_influence.cpp @@ -19,6 +19,9 @@ #include "nel/3d/tile_light_influence.h" #include "nel/misc/debug.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/tile_lumel.cpp b/code/nel/src/3d/tile_lumel.cpp index 41f770b6e..7eaa80199 100644 --- a/code/nel/src/3d/tile_lumel.cpp +++ b/code/nel/src/3d/tile_lumel.cpp @@ -20,6 +20,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/tile_noise_map.cpp b/code/nel/src/3d/tile_noise_map.cpp index 7d68d6a71..7b0d22dda 100644 --- a/code/nel/src/3d/tile_noise_map.cpp +++ b/code/nel/src/3d/tile_noise_map.cpp @@ -18,6 +18,9 @@ #include "nel/3d/tile_noise_map.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/tile_vegetable_desc.cpp b/code/nel/src/3d/tile_vegetable_desc.cpp index bad4ed517..849f19503 100644 --- a/code/nel/src/3d/tile_vegetable_desc.cpp +++ b/code/nel/src/3d/tile_vegetable_desc.cpp @@ -24,6 +24,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/track.cpp b/code/nel/src/3d/track.cpp index bf4dcddf5..a73186525 100644 --- a/code/nel/src/3d/track.cpp +++ b/code/nel/src/3d/track.cpp @@ -23,6 +23,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/track_keyframer.cpp b/code/nel/src/3d/track_keyframer.cpp index a3af79f1a..d3b5f6fb4 100644 --- a/code/nel/src/3d/track_keyframer.cpp +++ b/code/nel/src/3d/track_keyframer.cpp @@ -18,6 +18,9 @@ #include "nel/3d/track_keyframer.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/track_sampled_common.cpp b/code/nel/src/3d/track_sampled_common.cpp index 372cf4f45..2fb7fc132 100644 --- a/code/nel/src/3d/track_sampled_common.cpp +++ b/code/nel/src/3d/track_sampled_common.cpp @@ -25,6 +25,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/track_sampled_quat_small_header.cpp b/code/nel/src/3d/track_sampled_quat_small_header.cpp index c9826d423..cb0a28f3b 100644 --- a/code/nel/src/3d/track_sampled_quat_small_header.cpp +++ b/code/nel/src/3d/track_sampled_quat_small_header.cpp @@ -23,6 +23,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/track_sampled_vector.cpp b/code/nel/src/3d/track_sampled_vector.cpp index 2e52764d2..3e19cac64 100644 --- a/code/nel/src/3d/track_sampled_vector.cpp +++ b/code/nel/src/3d/track_sampled_vector.cpp @@ -22,6 +22,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/transform.cpp b/code/nel/src/3d/transform.cpp index 0ec65360d..559a3c355 100644 --- a/code/nel/src/3d/transform.cpp +++ b/code/nel/src/3d/transform.cpp @@ -29,6 +29,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/transform_shape.cpp b/code/nel/src/3d/transform_shape.cpp index 5c9f730b7..014e997ab 100644 --- a/code/nel/src/3d/transform_shape.cpp +++ b/code/nel/src/3d/transform_shape.cpp @@ -31,6 +31,9 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/transformable.cpp b/code/nel/src/3d/transformable.cpp index 0061975bf..30ef19e36 100644 --- a/code/nel/src/3d/transformable.cpp +++ b/code/nel/src/3d/transformable.cpp @@ -19,6 +19,9 @@ #include "nel/3d/transformable.h" #include "nel/3d/channel_mixer.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/u_bone.cpp b/code/nel/src/3d/u_bone.cpp index 680411af7..1f0369929 100644 --- a/code/nel/src/3d/u_bone.cpp +++ b/code/nel/src/3d/u_bone.cpp @@ -19,6 +19,9 @@ #include "nel/3d/bone.h" #include "nel/3d/u_bone.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/u_camera.cpp b/code/nel/src/3d/u_camera.cpp index ec1a88eda..0a052205f 100644 --- a/code/nel/src/3d/u_camera.cpp +++ b/code/nel/src/3d/u_camera.cpp @@ -19,6 +19,9 @@ #include "nel/3d/u_camera.h" #include "nel/3d/camera.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/u_instance.cpp b/code/nel/src/3d/u_instance.cpp index 08ecb9933..cb2a273ed 100644 --- a/code/nel/src/3d/u_instance.cpp +++ b/code/nel/src/3d/u_instance.cpp @@ -29,6 +29,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/u_instance_material.cpp b/code/nel/src/3d/u_instance_material.cpp index b22cd5301..ba870a7fe 100644 --- a/code/nel/src/3d/u_instance_material.cpp +++ b/code/nel/src/3d/u_instance_material.cpp @@ -23,6 +23,9 @@ #include "nel/3d/texture_mem.h" #include "nel/3d/texture_file.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/u_material.cpp b/code/nel/src/3d/u_material.cpp index e881bbada..b6b9dccc4 100644 --- a/code/nel/src/3d/u_material.cpp +++ b/code/nel/src/3d/u_material.cpp @@ -22,6 +22,9 @@ #include "nel/3d/texture_user.h" #include "nel/3d/driver_user.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/u_particle_system_instance.cpp b/code/nel/src/3d/u_particle_system_instance.cpp index 77dee0ded..ea5794b19 100644 --- a/code/nel/src/3d/u_particle_system_instance.cpp +++ b/code/nel/src/3d/u_particle_system_instance.cpp @@ -22,6 +22,9 @@ #include "nel/3d/ps_emitter.h" #include "nel/3d/particle_system_model.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/u_point_light.cpp b/code/nel/src/3d/u_point_light.cpp index 8643a1ae0..5f4d8da97 100644 --- a/code/nel/src/3d/u_point_light.cpp +++ b/code/nel/src/3d/u_point_light.cpp @@ -23,6 +23,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/u_shape.cpp b/code/nel/src/3d/u_shape.cpp index 9f746dad0..eb179375e 100644 --- a/code/nel/src/3d/u_shape.cpp +++ b/code/nel/src/3d/u_shape.cpp @@ -25,6 +25,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/u_skeleton.cpp b/code/nel/src/3d/u_skeleton.cpp index b470f879c..e5dd29f4d 100644 --- a/code/nel/src/3d/u_skeleton.cpp +++ b/code/nel/src/3d/u_skeleton.cpp @@ -27,6 +27,9 @@ #include "nel/3d/scene.h" #include "nel/3d/shape_bank.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/u_transform.cpp b/code/nel/src/3d/u_transform.cpp index 8466c1e38..141986782 100644 --- a/code/nel/src/3d/u_transform.cpp +++ b/code/nel/src/3d/u_transform.cpp @@ -30,6 +30,10 @@ H_AUTO_DECL( NL3D_Transform_Set_Cluster_System ) using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/u_transformable.cpp b/code/nel/src/3d/u_transformable.cpp index 26f84c746..4561cce32 100644 --- a/code/nel/src/3d/u_transformable.cpp +++ b/code/nel/src/3d/u_transformable.cpp @@ -19,6 +19,9 @@ #include "nel/3d/u_transformable.h" #include "nel/3d/transformable.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/u_visual_collision_mesh.cpp b/code/nel/src/3d/u_visual_collision_mesh.cpp index 92f8d4af6..e51c89105 100644 --- a/code/nel/src/3d/u_visual_collision_mesh.cpp +++ b/code/nel/src/3d/u_visual_collision_mesh.cpp @@ -19,6 +19,9 @@ #include "nel/3d/u_visual_collision_mesh.h" #include "nel/3d/visual_collision_mesh.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/u_water.cpp b/code/nel/src/3d/u_water.cpp index 138a1f340..69326c87c 100644 --- a/code/nel/src/3d/u_water.cpp +++ b/code/nel/src/3d/u_water.cpp @@ -22,6 +22,9 @@ #include "nel/3d/water_model.h" #include "nel/3d/driver_user.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/vegetable.cpp b/code/nel/src/3d/vegetable.cpp index b1c708900..b6acf831f 100644 --- a/code/nel/src/3d/vegetable.cpp +++ b/code/nel/src/3d/vegetable.cpp @@ -25,6 +25,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/vegetable_blend_layer_model.cpp b/code/nel/src/3d/vegetable_blend_layer_model.cpp index 44754add2..9c3b9dd54 100644 --- a/code/nel/src/3d/vegetable_blend_layer_model.cpp +++ b/code/nel/src/3d/vegetable_blend_layer_model.cpp @@ -28,6 +28,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/vegetable_clip_block.cpp b/code/nel/src/3d/vegetable_clip_block.cpp index cf0d60e59..87d7b7535 100644 --- a/code/nel/src/3d/vegetable_clip_block.cpp +++ b/code/nel/src/3d/vegetable_clip_block.cpp @@ -18,6 +18,9 @@ #include "nel/3d/vegetable_clip_block.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/vegetable_instance_group.cpp b/code/nel/src/3d/vegetable_instance_group.cpp index debd78763..2e48f740a 100644 --- a/code/nel/src/3d/vegetable_instance_group.cpp +++ b/code/nel/src/3d/vegetable_instance_group.cpp @@ -18,6 +18,9 @@ #include "nel/3d/vegetable_instance_group.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/vegetable_light_ex.cpp b/code/nel/src/3d/vegetable_light_ex.cpp index e663bddda..dc2109e96 100644 --- a/code/nel/src/3d/vegetable_light_ex.cpp +++ b/code/nel/src/3d/vegetable_light_ex.cpp @@ -19,6 +19,9 @@ #include "nel/3d/vegetable_light_ex.h" #include "nel/3d/point_light_named.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/vegetable_quadrant.cpp b/code/nel/src/3d/vegetable_quadrant.cpp index 1246a1a0c..ac83e0a99 100644 --- a/code/nel/src/3d/vegetable_quadrant.cpp +++ b/code/nel/src/3d/vegetable_quadrant.cpp @@ -22,6 +22,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/vegetable_shape.cpp b/code/nel/src/3d/vegetable_shape.cpp index 7d9991b65..3e4c2b7f0 100644 --- a/code/nel/src/3d/vegetable_shape.cpp +++ b/code/nel/src/3d/vegetable_shape.cpp @@ -24,6 +24,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/vegetable_sort_block.cpp b/code/nel/src/3d/vegetable_sort_block.cpp index cbd82aa2b..1ba562cda 100644 --- a/code/nel/src/3d/vegetable_sort_block.cpp +++ b/code/nel/src/3d/vegetable_sort_block.cpp @@ -25,6 +25,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/vegetablevb_allocator.cpp b/code/nel/src/3d/vegetablevb_allocator.cpp index fa5aea364..ff5dc293f 100644 --- a/code/nel/src/3d/vegetablevb_allocator.cpp +++ b/code/nel/src/3d/vegetablevb_allocator.cpp @@ -25,6 +25,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/vertex_buffer.cpp b/code/nel/src/3d/vertex_buffer.cpp index 8315b46da..bdc9d495f 100644 --- a/code/nel/src/3d/vertex_buffer.cpp +++ b/code/nel/src/3d/vertex_buffer.cpp @@ -20,8 +20,12 @@ #include "nel/misc/vector.h" #include "nel/misc/fast_mem.h" #include "nel/3d/driver.h" + using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/vertex_program.cpp b/code/nel/src/3d/vertex_program.cpp index d0c0cfb79..dc717b825 100644 --- a/code/nel/src/3d/vertex_program.cpp +++ b/code/nel/src/3d/vertex_program.cpp @@ -20,6 +20,9 @@ #include "nel/3d/driver.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/vertex_program_parse.cpp b/code/nel/src/3d/vertex_program_parse.cpp index 259e72b41..f4598659b 100644 --- a/code/nel/src/3d/vertex_program_parse.cpp +++ b/code/nel/src/3d/vertex_program_parse.cpp @@ -17,6 +17,10 @@ #include "std3d.h" #include "nel/3d/vertex_program_parse.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + enum TArguments { #ifdef NL_LITTLE_ENDIAN diff --git a/code/nel/src/3d/vertex_stream_manager.cpp b/code/nel/src/3d/vertex_stream_manager.cpp index 0acb54144..74d2727dd 100644 --- a/code/nel/src/3d/vertex_stream_manager.cpp +++ b/code/nel/src/3d/vertex_stream_manager.cpp @@ -22,6 +22,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/viewport.cpp b/code/nel/src/3d/viewport.cpp index b84d1d713..6eccdeaca 100644 --- a/code/nel/src/3d/viewport.cpp +++ b/code/nel/src/3d/viewport.cpp @@ -21,6 +21,9 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/visual_collision_entity.cpp b/code/nel/src/3d/visual_collision_entity.cpp index dcae15aef..8f3b97e68 100644 --- a/code/nel/src/3d/visual_collision_entity.cpp +++ b/code/nel/src/3d/visual_collision_entity.cpp @@ -29,6 +29,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/visual_collision_entity_user.cpp b/code/nel/src/3d/visual_collision_entity_user.cpp index 89b44f22f..d13ca57c2 100644 --- a/code/nel/src/3d/visual_collision_entity_user.cpp +++ b/code/nel/src/3d/visual_collision_entity_user.cpp @@ -20,6 +20,9 @@ #include "nel/3d/driver_user.h" #include "nel/misc/hierarchical_timer.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/visual_collision_manager.cpp b/code/nel/src/3d/visual_collision_manager.cpp index c5c45578f..6d914464f 100644 --- a/code/nel/src/3d/visual_collision_manager.cpp +++ b/code/nel/src/3d/visual_collision_manager.cpp @@ -28,6 +28,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/visual_collision_manager_user.cpp b/code/nel/src/3d/visual_collision_manager_user.cpp index 800080706..b1ae7923d 100644 --- a/code/nel/src/3d/visual_collision_manager_user.cpp +++ b/code/nel/src/3d/visual_collision_manager_user.cpp @@ -19,6 +19,9 @@ #include "nel/3d/visual_collision_manager_user.h" #include "nel/3d/u_visual_collision_mesh.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/visual_collision_mesh.cpp b/code/nel/src/3d/visual_collision_mesh.cpp index 3217a560f..8de722a2b 100644 --- a/code/nel/src/3d/visual_collision_mesh.cpp +++ b/code/nel/src/3d/visual_collision_mesh.cpp @@ -26,6 +26,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif // TestYoyo. external debug flag bool TESTYOYO_VCM_RedShadow= false; diff --git a/code/nel/src/3d/water_env_map_user.cpp b/code/nel/src/3d/water_env_map_user.cpp index d1f9e9961..446ade3b8 100644 --- a/code/nel/src/3d/water_env_map_user.cpp +++ b/code/nel/src/3d/water_env_map_user.cpp @@ -19,6 +19,10 @@ #include "nel/3d/u_scene.h" #include "nel/3d/u_camera.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { ////////////////////// diff --git a/code/nel/src/3d/water_height_map.cpp b/code/nel/src/3d/water_height_map.cpp index 38ca1cacf..d608dfc43 100644 --- a/code/nel/src/3d/water_height_map.cpp +++ b/code/nel/src/3d/water_height_map.cpp @@ -24,6 +24,9 @@ #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/water_model.cpp b/code/nel/src/3d/water_model.cpp index e6ae132e1..d65ad582d 100644 --- a/code/nel/src/3d/water_model.cpp +++ b/code/nel/src/3d/water_model.cpp @@ -36,6 +36,9 @@ using NLMISC::CVector2f; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/water_shape.cpp b/code/nel/src/3d/water_shape.cpp index f5e26b8d7..df5e6dadf 100644 --- a/code/nel/src/3d/water_shape.cpp +++ b/code/nel/src/3d/water_shape.cpp @@ -26,6 +26,9 @@ #include "nel/3d/water_height_map.h" #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/zone.cpp b/code/nel/src/3d/zone.cpp index 263c61539..029f6da81 100644 --- a/code/nel/src/3d/zone.cpp +++ b/code/nel/src/3d/zone.cpp @@ -30,6 +30,9 @@ using namespace std; // define it only for debug bind. //#define NL3D_DEBUG_DONT_BIND_PATCH +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/zone_corner_smoother.cpp b/code/nel/src/3d/zone_corner_smoother.cpp index 430c6929f..568d4c6a3 100644 --- a/code/nel/src/3d/zone_corner_smoother.cpp +++ b/code/nel/src/3d/zone_corner_smoother.cpp @@ -19,6 +19,9 @@ #include "nel/3d/zone_corner_smoother.h" #include "nel/3d/patchuv_locator.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/zone_lighter.cpp b/code/nel/src/3d/zone_lighter.cpp index c70ad0ba2..78abf5a05 100644 --- a/code/nel/src/3d/zone_lighter.cpp +++ b/code/nel/src/3d/zone_lighter.cpp @@ -51,6 +51,10 @@ using namespace std; // Define this to render the zbuffers into a bitmap zbuffer and save it into a jpeg // #define SAVE_ZBUFFER "c:/temp" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + #define DEFAULT_JITTER 0.4f #define DEFAULT_ZBUFFER_LANDSCAPE_SIZE 32768 #define DEFAULT_ZBUFFER_OBJECT_SIZE (32768*3) diff --git a/code/nel/src/3d/zone_manager.cpp b/code/nel/src/3d/zone_manager.cpp index 34a670b5e..1f9e61214 100644 --- a/code/nel/src/3d/zone_manager.cpp +++ b/code/nel/src/3d/zone_manager.cpp @@ -23,6 +23,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/zone_search.cpp b/code/nel/src/3d/zone_search.cpp index f850d4377..71704d37f 100644 --- a/code/nel/src/3d/zone_search.cpp +++ b/code/nel/src/3d/zone_search.cpp @@ -23,6 +23,9 @@ using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { @@ -58,8 +61,6 @@ CZoneSearch::CZoneSearch() */ pair CZoneSearch::getZoneName(uint x, uint y, uint cx, uint cy) { - char name[13]; - uint zoneY = y / _SizeZoneY + 1; uint zoneX = x / _SizeZoneX; @@ -71,9 +72,7 @@ pair CZoneSearch::getZoneName(uint x, uint y, uint cx, uint cy) char firstLetter = zoneX / 26 + 'A'; char secondLetter = zoneX % 26 + 'A'; - sprintf(name, "%d_%c%c.zonel", zoneY, firstLetter, secondLetter); - - return std::pair(string(name), distance); + return std::pair(NLMISC::toString("%u_%c%c.zonel", zoneY, firstLetter, secondLetter), distance); } @@ -211,12 +210,9 @@ void CZoneSearch::getListZoneId (uint x, uint y, uint sizeArea, vector & std::string CZoneSearch::getZoneNameFromId (uint16 zoneid) { - char name[16]; - sint x = zoneid & 255; sint y = zoneid >> 8; - sprintf (name, "%d_%c%c.zonel", y+1, (char)('A'+(x/26)), (char)('A'+(x%26))); - return string(name); + return NLMISC::toString("%d_%c%c.zonel", y + 1, (char)('A' + (x / 26)), (char)('A' + (x % 26))); } diff --git a/code/nel/src/3d/zone_smoother.cpp b/code/nel/src/3d/zone_smoother.cpp index 2ae360933..6fd108ac7 100644 --- a/code/nel/src/3d/zone_smoother.cpp +++ b/code/nel/src/3d/zone_smoother.cpp @@ -18,6 +18,9 @@ #include "nel/3d/zone_smoother.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/zone_symmetrisation.cpp b/code/nel/src/3d/zone_symmetrisation.cpp index a12daa972..51b00b3f3 100644 --- a/code/nel/src/3d/zone_symmetrisation.cpp +++ b/code/nel/src/3d/zone_symmetrisation.cpp @@ -22,6 +22,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/zone_tgt_smoother.cpp b/code/nel/src/3d/zone_tgt_smoother.cpp index 865d72609..1a4902203 100644 --- a/code/nel/src/3d/zone_tgt_smoother.cpp +++ b/code/nel/src/3d/zone_tgt_smoother.cpp @@ -18,9 +18,14 @@ #include "nel/3d/zone_tgt_smoother.h" #include "nel/misc/plane.h" + using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/georges/form.cpp b/code/nel/src/georges/form.cpp index 5a23441ee..6ec949078 100644 --- a/code/nel/src/georges/form.cpp +++ b/code/nel/src/georges/form.cpp @@ -104,10 +104,10 @@ CForm::~CForm () // *************************************************************************** -void CForm::write (xmlDocPtr doc, const char *filename) +void CForm::write (xmlDocPtr doc, const std::string &filename) { // Save the filename - if (filename) + if (!filename.empty()) _Filename = CFile::getFilename (filename); // Create the first node @@ -176,7 +176,7 @@ void CForm::readParent (const char *parent, CFormLoader &loader) // *************************************************************************** -void CForm::read (xmlNodePtr node, CFormLoader &loader, CFormDfn *dfn, const char *filename) +void CForm::read (xmlNodePtr node, CFormLoader &loader, CFormDfn *dfn, const std::string &filename) { // Save the filename _Filename = CFile::getFilename (filename); @@ -271,7 +271,7 @@ void CForm::write (class NLMISC::IStream &stream) // *************************************************************************** -bool CForm::insertParent (uint before, const char *filename, CForm *parent) +bool CForm::insertParent (uint before, const std::string &filename, CForm *parent) { // Set or reset ? nlassert (parent); @@ -346,7 +346,7 @@ const std::string &CForm::getFilename () const // *************************************************************************** -void CForm::warning (bool exception, const char *function, const char *format, ... ) const +void CForm::warning (bool exception, const std::string &function, const char *format, ... ) const { // Make a buffer string va_list args; @@ -356,7 +356,7 @@ void CForm::warning (bool exception, const char *function, const char *format, . va_end( args ); // Set the warning - NLGEORGES::warning (exception, "(CForm::%s) in form (%s) : %s", function, _Filename.c_str (), buffer); + NLGEORGES::warning (exception, "(CForm::%s) in form (%s) : %s", function.c_str(), _Filename.c_str (), buffer); } // *************************************************************************** diff --git a/code/nel/src/georges/form_dfn.cpp b/code/nel/src/georges/form_dfn.cpp index 114a3aaf1..86733470c 100644 --- a/code/nel/src/georges/form_dfn.cpp +++ b/code/nel/src/georges/form_dfn.cpp @@ -56,7 +56,7 @@ void CFormDfn::removeEntry( uint idx ) // *************************************************************************** -void CFormDfn::write (xmlDocPtr doc, const char *filename) +void CFormDfn::write (xmlDocPtr doc, const std::string &filename) { // Save filename _Filename = CFile::getFilename (filename); @@ -121,7 +121,7 @@ void CFormDfn::write (xmlDocPtr doc, const char *filename) // *************************************************************************** -void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const char *filename) +void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const std::string &filename) { // Save filename _Filename = CFile::getFilename (filename); @@ -459,9 +459,9 @@ void CFormDfn::setNumParent (uint size) // *************************************************************************** -void CFormDfn::setParent (uint parent, CFormLoader &loader, const char *filename) +void CFormDfn::setParent (uint parent, CFormLoader &loader, const std::string &filename) { - if (strcmp (filename, "")==0) + if (filename.empty()) Parents[parent].Parent = NULL; else Parents[parent].Parent = loader.loadFormDfn (filename, false); @@ -470,7 +470,7 @@ void CFormDfn::setParent (uint parent, CFormLoader &loader, const char *filename // *************************************************************************** -void CFormDfn::CEntry::setType (CFormLoader &loader, const char *filename) +void CFormDfn::CEntry::setType (CFormLoader &loader, const std::string &filename) { TypeElement = EntryType; Dfn = NULL; @@ -485,7 +485,7 @@ void CFormDfn::CEntry::setType( TEntryType type ) // *************************************************************************** -void CFormDfn::CEntry::setDfn (CFormLoader &loader, const char *filename) +void CFormDfn::CEntry::setDfn (CFormLoader &loader, const std::string &filename) { TypeElement = EntryDfn; Filename = filename; @@ -512,7 +512,7 @@ const std::string &CFormDfn::CEntry::getName () const // *************************************************************************** -void CFormDfn::CEntry::setName (const char *name) +void CFormDfn::CEntry::setName (const std::string &name) { Name = name; } @@ -526,7 +526,7 @@ const std::string &CFormDfn::CEntry::getDefault () const // *************************************************************************** -void CFormDfn::CEntry::setDefault (const char *def) +void CFormDfn::CEntry::setDefault (const std::string &def) { Default = def; } @@ -561,7 +561,7 @@ const std::string &CFormDfn::CEntry::getFilename() const // *************************************************************************** -void CFormDfn::CEntry::setFilename (const char *def) +void CFormDfn::CEntry::setFilename (const std::string &def) { Filename = def; } @@ -849,14 +849,14 @@ const std::string &CFormDfn::CEntry::getFilenameExt() const // *************************************************************************** -void CFormDfn::CEntry::setFilenameExt (const char *ext) +void CFormDfn::CEntry::setFilenameExt (const std::string &ext) { FilenameExt = ext; } // *************************************************************************** -void CFormDfn::warning (bool exception, const char *function, const char *format, ... ) const +void CFormDfn::warning (bool exception, const std::string &function, const char *format, ... ) const { // Make a buffer string va_list args; @@ -866,7 +866,7 @@ void CFormDfn::warning (bool exception, const char *function, const char *format va_end( args ); // Set the warning - NLGEORGES::warning (exception, "(CFormDfn::%s) in form DFN (%s) : %s", function, _Filename.c_str (), buffer); + NLGEORGES::warning (exception, "(CFormDfn::%s) in form DFN (%s) : %s", function.c_str(), _Filename.c_str (), buffer); } // *************************************************************************** diff --git a/code/nel/src/georges/form_elm.cpp b/code/nel/src/georges/form_elm.cpp index 1c752b0bc..86ad9c142 100644 --- a/code/nel/src/georges/form_elm.cpp +++ b/code/nel/src/georges/form_elm.cpp @@ -356,7 +356,7 @@ CForm *CFormElm::getForm () const // *************************************************************************** -bool CFormElm::getNodeByName (UFormElm **result, const char *name, TWhereIsNode *where, bool verbose, uint32 round) +bool CFormElm::getNodeByName (UFormElm **result, const std::string &name, TWhereIsNode *where, bool verbose, uint32 round) { const UFormElm *resultConst = NULL; if (((const UFormElm*)this)->getNodeByName (&resultConst, name, where, verbose, round)) @@ -369,7 +369,7 @@ bool CFormElm::getNodeByName (UFormElm **result, const char *name, TWhereIsNode // *************************************************************************** -bool CFormElm::getNodeByName (const UFormElm **result, const char *name, TWhereIsNode *where, bool verbose, uint32 round) const +bool CFormElm::getNodeByName (const UFormElm **result, const std::string &name, TWhereIsNode *where, bool verbose, uint32 round) const { // The parent Dfn const CFormDfn *parentDfn; @@ -402,7 +402,7 @@ bool CFormElm::getNodeByName (const UFormElm **result, const char *name, TWhereI // *************************************************************************** -bool CFormElm::getValueByName (string& result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round) const +bool CFormElm::getValueByName (string& result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round) const { // The parent Dfn const CFormDfn *parentDfn; @@ -430,13 +430,13 @@ bool CFormElm::getValueByName (string& result, const char *name, TEval evaluate, else { // Error message - warning (false, "getValueByName", "The node (%s) is not an atom element. Can't return a value.", name); + warning (false, "getValueByName", "The node (%s) is not an atom element. Can't return a value.", name.c_str()); } } else { // Error message - warning (false, "getValueByName", "Can't find the node (%s).", name); + warning (false, "getValueByName", "Can't find the node (%s).", name.c_str()); } // Error @@ -445,13 +445,13 @@ bool CFormElm::getValueByName (string& result, const char *name, TEval evaluate, // *************************************************************************** -bool CFormElm::getValueByName (sint8 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round) const +bool CFormElm::getValueByName (sint8 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round) const { // Get the string value string value; if (getValueByName (value, name, evaluate, where, round)) { - return convertValue (result, value.c_str ()); + return convertValue (result, value); } return false; @@ -459,13 +459,13 @@ bool CFormElm::getValueByName (sint8 &result, const char *name, TEval evaluate, // *************************************************************************** -bool CFormElm::getValueByName (uint8 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round) const +bool CFormElm::getValueByName (uint8 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round) const { // Get the string value string value; if (getValueByName (value, name, evaluate, where, round)) { - return convertValue (result, value.c_str ()); + return convertValue (result, value); } return false; @@ -473,13 +473,13 @@ bool CFormElm::getValueByName (uint8 &result, const char *name, TEval evaluate, // *************************************************************************** -bool CFormElm::getValueByName (sint16 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round) const +bool CFormElm::getValueByName (sint16 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round) const { // Get the string value string value; if (getValueByName (value, name, evaluate, where, round)) { - return convertValue (result, value.c_str ()); + return convertValue (result, value); } return false; @@ -487,13 +487,13 @@ bool CFormElm::getValueByName (sint16 &result, const char *name, TEval evaluate, // *************************************************************************** -bool CFormElm::getValueByName (uint16 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round) const +bool CFormElm::getValueByName (uint16 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round) const { // Get the string value string value; if (getValueByName (value, name, evaluate, where, round)) { - return convertValue (result, value.c_str ()); + return convertValue (result, value); } return false; @@ -501,13 +501,13 @@ bool CFormElm::getValueByName (uint16 &result, const char *name, TEval evaluate, // *************************************************************************** -bool CFormElm::getValueByName (sint32 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round) const +bool CFormElm::getValueByName (sint32 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round) const { // Get the string value string value; if (getValueByName (value, name, evaluate, where, round)) { - return convertValue (result, value.c_str ()); + return convertValue (result, value); } return false; @@ -515,13 +515,13 @@ bool CFormElm::getValueByName (sint32 &result, const char *name, TEval evaluate, // *************************************************************************** -bool CFormElm::getValueByName (uint32 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round) const +bool CFormElm::getValueByName (uint32 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round) const { // Get the string value string value; if (getValueByName (value, name, evaluate, where, round)) { - return convertValue (result, value.c_str ()); + return convertValue (result, value); } return false; @@ -529,13 +529,13 @@ bool CFormElm::getValueByName (uint32 &result, const char *name, TEval evaluate, // *************************************************************************** -bool CFormElm::getValueByName (float &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round) const +bool CFormElm::getValueByName (float &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round) const { // Get the string value string value; if (getValueByName (value, name, evaluate, where, round)) { - return convertValue (result, value.c_str ()); + return convertValue (result, value); } return false; @@ -543,13 +543,13 @@ bool CFormElm::getValueByName (float &result, const char *name, TEval evaluate, // *************************************************************************** -bool CFormElm::getValueByName (double &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round) const +bool CFormElm::getValueByName(double &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round) const { // Get the string value string value; if (getValueByName (value, name, evaluate, where, round)) { - return convertValue (result, value.c_str ()); + return convertValue (result, value); } return false; @@ -557,13 +557,13 @@ bool CFormElm::getValueByName (double &result, const char *name, TEval evaluate, // *************************************************************************** -bool CFormElm::getValueByName (bool &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round) const +bool CFormElm::getValueByName (bool &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round) const { // Get the string value string value; if (getValueByName (value, name, evaluate, where, round)) { - return convertValue (result, value.c_str ()); + return convertValue (result, value); } return false; @@ -571,13 +571,13 @@ bool CFormElm::getValueByName (bool &result, const char *name, TEval evaluate, T // *************************************************************************** -bool CFormElm::getValueByName (NLMISC::CRGBA &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round) const +bool CFormElm::getValueByName (NLMISC::CRGBA &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round) const { // Get the string value string value; if (getValueByName (value, name, evaluate, where, round)) { - return convertValue (result, value.c_str ()); + return convertValue (result, value); } return false; @@ -592,7 +592,7 @@ UFormElm *CFormElm::getParent () const // *************************************************************************** -bool CFormElm::createNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, +bool CFormElm::createNodeByName (const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool &created) @@ -608,7 +608,7 @@ bool CFormElm::createNodeByName (const char *name, const CFormDfn **parentDfn, u // *************************************************************************** -bool CFormElm::deleteNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, +bool CFormElm::deleteNodeByName (const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array) @@ -625,7 +625,7 @@ bool CFormElm::deleteNodeByName (const char *name, const CFormDfn **parentDfn, u // *************************************************************************** -bool CFormElm::getNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, +bool CFormElm::getNodeByName (const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool &parentVDfnArray, bool verbose, uint32 round) const @@ -641,7 +641,7 @@ bool CFormElm::getNodeByName (const char *name, const CFormDfn **parentDfn, uint // *************************************************************************** -bool CFormElm::arrayInsertNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, +bool CFormElm::arrayInsertNodeByName (const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool verbose, uint arrayIndex) const @@ -715,7 +715,7 @@ bool CFormElm::arrayInsertNodeByName (const char *name, const CFormDfn **parentD // *************************************************************************** -bool CFormElm::arrayDeleteNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, +bool CFormElm::arrayDeleteNodeByName (const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool verbose, uint arrayIndex) const @@ -760,7 +760,7 @@ bool CFormElm::arrayDeleteNodeByName (const char *name, const CFormDfn **parentD // *************************************************************************** -bool CFormElm::getInternalNodeByName (CForm *form, const char *name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, TNodeAction action, bool &created, bool &parentVDfnArray, bool verbose, uint32 round) +bool CFormElm::getInternalNodeByName (CForm *form, const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, TNodeAction action, bool &created, bool &parentVDfnArray, bool verbose, uint32 round) { // *** Init output variables created = false; @@ -815,7 +815,7 @@ bool CFormElm::getInternalNodeByName (CForm *form, const char *name, const CForm // *** Parsing variables // Current token start and end - const char *startToken = name; + const char *startToken = name.c_str(); const char *endToken; // Current token start @@ -909,7 +909,7 @@ bool CFormElm::getInternalNodeByName (CForm *form, const char *name, const CForm // Get the virtual node by name UFormElm *uelm; - if (parentPtr->getRootNode ().getNodeByName (&uelm, formName.c_str (), NULL, verbose, round+1) && uelm) + if (parentPtr->getRootNode ().getNodeByName (&uelm, formName, NULL, verbose, round+1) && uelm) { // Value node ? if (uelm->isVirtualStruct ()) @@ -1134,7 +1134,7 @@ bool CFormElm::getInternalNodeByName (CForm *form, const char *name, const CForm case TokenString: { // To int - if (sscanf (token.c_str(), "%d", &arrayIndex)!=1) + if (!fromString(token, arrayIndex)) { // Error message smprintf (error, 512, "Keyword (%s) is not an array index.", token.c_str()); @@ -1406,7 +1406,7 @@ exit:; bool arrayParent; bool createdParent; bool parentVDfnArray; - if (getInternalNodeByName (parentPtr, formName.c_str (), &parentDfnParent, indexDfnParent, &nodeDfnParent, &nodeTypeParent, &nodeParent, typeParent, arrayParent, action, createdParent, parentVDfnArray, false, round+1)) + if (getInternalNodeByName (parentPtr, formName, &parentDfnParent, indexDfnParent, &nodeDfnParent, &nodeTypeParent, &nodeParent, typeParent, arrayParent, action, createdParent, parentVDfnArray, false, round+1)) { // Node found ? if (nodeParent) @@ -1466,7 +1466,7 @@ exit:; // Turn around.. string formName; (*node)->getFormName (formName); - warning (false, formName.c_str (), form->getFilename ().c_str(), "getInternalNodeByName", "Recursive call on the same node (%s), look for loop references or inheritances.", name); + warning (false, formName, form->getFilename (), "getInternalNodeByName", "Recursive call on the same node (%s), look for loop references or inheritances.", name.c_str()); return false; } } @@ -1476,7 +1476,7 @@ exit:; nlassert (*error); // Get the best form name - warning (false, currentName.c_str (), form->getFilename ().c_str(), "getInternalNodeByName", "Getting the node (%s) : %s", name, error); + warning (false, currentName, form->getFilename (), "getInternalNodeByName", "Getting the node (%s) : %s", name.c_str(), error); } return !errorAppend; @@ -1534,7 +1534,7 @@ void CFormElm::unlink (CFormElm * /* child */) // *************************************************************************** -bool CFormElm::setValueByName (const char *value, const char *name, bool *created) +bool CFormElm::setValueByName(const std::string &value, const std::string &name, bool *created) { // The parent Dfn const CFormDfn *parentDfn; @@ -1567,13 +1567,13 @@ bool CFormElm::setValueByName (const char *value, const char *name, bool *create else { // Error message - warning (false, "setValueByName", "The node (%s) is not an atom element. Can't set the value.", name); + warning (false, "setValueByName", "The node (%s) is not an atom element. Can't set the value.", name.c_str()); } } else { // Error message - warning (false, "setValueByName", "Can't created / set the node (%s).", name); + warning (false, "setValueByName", "Can't created / set the node (%s).", name.c_str()); // Created flag if (created) @@ -1586,70 +1586,70 @@ bool CFormElm::setValueByName (const char *value, const char *name, bool *create // *************************************************************************** -bool CFormElm::setValueByName (sint8 value, const char *name, bool *created) +bool CFormElm::setValueByName (sint8 value, const std::string &name, bool *created) { - return setValueByName (toString (value).c_str (), name, created); + return setValueByName (toString (value), name, created); } // *************************************************************************** -bool CFormElm::setValueByName (uint8 value, const char *name, bool *created) +bool CFormElm::setValueByName (uint8 value, const std::string &name, bool *created) { - return setValueByName (toString (value).c_str (), name, created); + return setValueByName (toString (value), name, created); } // *************************************************************************** -bool CFormElm::setValueByName (sint16 value, const char *name, bool *created) +bool CFormElm::setValueByName (sint16 value, const std::string &name, bool *created) { - return setValueByName (toString (value).c_str (), name, created); + return setValueByName (toString (value), name, created); } // *************************************************************************** -bool CFormElm::setValueByName (uint16 value, const char *name, bool *created) +bool CFormElm::setValueByName (uint16 value, const std::string &name, bool *created) { - return setValueByName (toString (value).c_str (), name, created); + return setValueByName (toString (value), name, created); } // *************************************************************************** -bool CFormElm::setValueByName (sint32 value, const char *name, bool *created) +bool CFormElm::setValueByName(sint32 value, const std::string &name, bool *created) { - return setValueByName (toString (value).c_str (), name, created); + return setValueByName (toString (value), name, created); } // *************************************************************************** -bool CFormElm::setValueByName (uint32 value, const char *name, bool *created) +bool CFormElm::setValueByName (uint32 value, const std::string &name, bool *created) { - return setValueByName (toString (value).c_str (), name, created); + return setValueByName (toString (value), name, created); } // *************************************************************************** -bool CFormElm::setValueByName (float value, const char *name, bool *created) +bool CFormElm::setValueByName (float value, const std::string &name, bool *created) { - return setValueByName (toString (value).c_str (), name, created); + return setValueByName (toString (value), name, created); } // *************************************************************************** -bool CFormElm::setValueByName (double value, const char *name, bool *created) +bool CFormElm::setValueByName (double value, const std::string &name, bool *created) { - return setValueByName (toString (value).c_str (), name, created); + return setValueByName (toString (value), name, created); } // *************************************************************************** -bool CFormElm::setValueByName (bool value, const char *name, bool *created) +bool CFormElm::setValueByName (bool value, const std::string &name, bool *created) { - return setValueByName (toString (value).c_str (), name, created); + return setValueByName (toString (value), name, created); } // *************************************************************************** -bool CFormElm::setValueByName (NLMISC::CRGBA value, const char *name, bool *created) +bool CFormElm::setValueByName (NLMISC::CRGBA value, const std::string &name, bool *created) { char tmp[512]; smprintf (tmp, 512, "%d,%d,%d", value.R, value.G, value.B); @@ -1658,7 +1658,7 @@ bool CFormElm::setValueByName (NLMISC::CRGBA value, const char *name, bool *crea // *************************************************************************** -void CFormElm::warning (bool exception, const char *formName, const char *formFileName, const char *function, const char *format, ... ) +void CFormElm::warning (bool exception, const std::string &formName, const std::string &formFileName, const std::string &function, const char *format, ... ) { // Make a buffer string va_list args; @@ -1668,19 +1668,19 @@ void CFormElm::warning (bool exception, const char *formName, const char *formFi va_end( args ); // Set the warning - NLGEORGES::warning (exception, "(CFormElm::%s) on node (%s) in form (%s) : %s", function, formName, formFileName, buffer); + NLGEORGES::warning (exception, "(CFormElm::%s) on node (%s) in form (%s) : %s", function.c_str(), formName.c_str(), formFileName.c_str(), buffer); } // *************************************************************************** -void CFormElm::warning (bool exception, const char *function, const char *format, ... ) const +void CFormElm::warning (bool exception, const std::string &function, const char *format, ... ) const { va_list args; va_start( args, format ); string formName; getFormName (formName); - warning (exception, formName.c_str (), getForm ()->getFilename ().c_str (), function, format, args); + warning (exception, formName, getForm ()->getFilename (), function, format, args); va_end( args ); } @@ -1741,7 +1741,7 @@ bool CFormElmStruct::getStructNodeName (uint element, string &result) const } else { - warning (false, "getStructNodeName", "Index (%d) out of bound (%d).", element, Elements.size() ); + warning (false, "getStructNodeName", "Index (%u) out of bound (%u).", element, (uint)Elements.size() ); return false; } } @@ -1757,7 +1757,7 @@ bool CFormElmStruct::getStructNode (uint element, const UFormElm **result) const } else { - warning (false, "getStructNode", "Index (%d) out of bound (%d).", element, Elements.size() ); + warning (false, "getStructNode", "Index (%u) out of bound (%u).", element, (uint)Elements.size() ); return false; } } @@ -1780,14 +1780,14 @@ bool CFormElmStruct::getStructNode (uint element, UFormElm **result) } else { - warning (false, "getStructNode", "Index (%d) out of bound (%d).", element, Elements.size() ); + warning (false, "getStructNode", "Index (%u) out of bound (%u).", element, (uint)Elements.size() ); return false; } } // *************************************************************************** -xmlNodePtr CFormElmStruct::write (xmlNodePtr root, const CForm *form, const char *structName, bool forceWrite) const +xmlNodePtr CFormElmStruct::write (xmlNodePtr root, const CForm *form, const std::string &structName, bool forceWrite) const { // Is used ? if (isUsed (form) || forceWrite) @@ -1796,10 +1796,10 @@ xmlNodePtr CFormElmStruct::write (xmlNodePtr root, const CForm *form, const cha xmlNodePtr node = xmlNewChild ( root, NULL, (const xmlChar*)"STRUCT", NULL); // Element name - if (structName != NULL) + if (!structName.empty()) { // Struct name - xmlSetProp (node, (const xmlChar*)"Name", (const xmlChar*)structName); + xmlSetProp (node, (const xmlChar*)"Name", (const xmlChar*)structName.c_str()); } // For each elements of the structure @@ -1808,7 +1808,7 @@ xmlNodePtr CFormElmStruct::write (xmlNodePtr root, const CForm *form, const cha { // Create a node if it exist if (Elements[elm].Element) - Elements[elm].Element->write (node, form, Elements[elm].Name.c_str()); + Elements[elm].Element->write (node, form, Elements[elm].Name); } // Return the new node @@ -1905,8 +1905,8 @@ void CFormElmStruct::read (xmlNodePtr node, CFormLoader &loader, const CFormDfn else { // Make a warning message - warning (false, "read", "In block line %p, node (%s) type in DFN have changed.", - child->content, child->name); + warning (false, "read", "In block line %u, node (%s) type in DFN have changed.", + (uint)child->line, child->name); } } else @@ -1918,8 +1918,8 @@ void CFormElmStruct::read (xmlNodePtr node, CFormLoader &loader, const CFormDfn } // Throw exception - warning (true, "read", "XML Syntax error in block line %p, node (%s) name should be STRUCT, ATOM or ARRAY.", - child->content, child->name); + warning (true, "read", "XML Syntax error in block line %u, node (%s) name should be STRUCT, ATOM or ARRAY.", + (uint)child->line, child->name); } } @@ -2101,7 +2101,7 @@ void CFormElmStruct::getFormName (std::string &result, const CFormElm *child) co // *************************************************************************** -void CFormElmStruct::warning (bool exception, const char *function, const char *format, ... ) const +void CFormElmStruct::warning (bool exception, const std::string &function, const char *format, ... ) const { // Make a buffer string va_list args; @@ -2113,7 +2113,7 @@ void CFormElmStruct::warning (bool exception, const char *function, const char * // Set the warning string formName; getFormName (formName, NULL); - NLGEORGES::warning (exception, "(CFormElmStruct::%s) on node (%s) in form (%s) : %s", function, formName.c_str (), Form->getFilename ().c_str (), buffer); + NLGEORGES::warning (exception, "(CFormElmStruct::%s) on node (%s) in form (%s) : %s", function.c_str(), formName.c_str (), Form->getFilename ().c_str (), buffer); } // *************************************************************************** @@ -2142,7 +2142,7 @@ CFormElmVirtualStruct::CFormElmVirtualStruct (CForm *form, CFormElm *parentNode, // *************************************************************************** -xmlNodePtr CFormElmVirtualStruct::write (xmlNodePtr root, const CForm *form, const char *structName, bool forceWrite) const +xmlNodePtr CFormElmVirtualStruct::write (xmlNodePtr root, const CForm *form, const std::string &structName, bool forceWrite) const { // Is used ? if (isUsed (form) || forceWrite) @@ -2154,10 +2154,10 @@ xmlNodePtr CFormElmVirtualStruct::write (xmlNodePtr root, const CForm *form, co xmlSetProp (node, (const xmlChar*)"DfnName", (const xmlChar*)DfnFilename.c_str()); // Element name - if (structName != NULL) + if (!structName.empty()) { // Struct name - xmlSetProp (node, (const xmlChar*)"Name", (const xmlChar*)structName); + xmlSetProp (node, (const xmlChar*)"Name", (const xmlChar*)structName.c_str()); } // For each elements of the structure @@ -2166,7 +2166,7 @@ xmlNodePtr CFormElmVirtualStruct::write (xmlNodePtr root, const CForm *form, co { // Create a node if it exist if (Elements[elm].Element) - Elements[elm].Element->write (node, form, Elements[elm].Name.c_str()); + Elements[elm].Element->write (node, form, Elements[elm].Name); } // Return the new node @@ -2190,7 +2190,7 @@ void CFormElmVirtualStruct::read (xmlNodePtr node, CFormLoader &loader, CForm *f xmlFree ((void*)filename); // Load the dfn - FormDfn = loader.loadFormDfn (DfnFilename.c_str (), false); + FormDfn = loader.loadFormDfn (DfnFilename, false); if (!FormDfn) { // Throw exception @@ -2200,8 +2200,8 @@ void CFormElmVirtualStruct::read (xmlNodePtr node, CFormLoader &loader, CForm *f else { // Throw exception - warning (true, "read", "XML Syntax error in virtual struct in block line %p, should have a DfnName property.", - node->content); + warning (true, "read", "XML Syntax error in virtual struct in block line %u, should have a DfnName property.", + (uint)node->line); } // Read the parent @@ -2232,7 +2232,7 @@ bool CFormElmVirtualStruct::isUsed (const CForm * /* form */) const // *************************************************************************** -void CFormElmVirtualStruct::warning (bool exception, const char *function, const char *format, ... ) const +void CFormElmVirtualStruct::warning (bool exception, const std::string &function, const char *format, ... ) const { // Make a buffer string va_list args; @@ -2244,7 +2244,7 @@ void CFormElmVirtualStruct::warning (bool exception, const char *function, const // Set the warning string formName; getFormName (formName, NULL); - NLGEORGES::warning (exception, "(CFormElmVirtualStruct::%s) on node (%s) in form (%s) : %s", function, formName.c_str (), Form->getFilename ().c_str (), buffer); + NLGEORGES::warning (exception, "(CFormElmVirtualStruct::%s) on node (%s) in form (%s) : %s", function.c_str(), formName.c_str (), Form->getFilename ().c_str (), buffer); } // *************************************************************************** @@ -2304,7 +2304,7 @@ bool CFormElmArray::getArrayNode (const UFormElm **result, uint arrayIndex) cons } else { - warning (false, "getArrayNode", "Index (%d) out of bound (%d).", arrayIndex, Elements.size() ); + warning (false, "getArrayNode", "Index (%u) out of bound (%u).", arrayIndex, (uint)Elements.size() ); return false; } } @@ -2323,7 +2323,7 @@ bool CFormElmArray::getArrayNodeName (std::string &result, uint arrayIndex) cons } else { - warning (false, "getArrayNodeName", "Index (%d) out of bound (%d).", arrayIndex, Elements.size() ); + warning (false, "getArrayNodeName", "Index (%u) out of bound (%u).", arrayIndex, (uint)Elements.size() ); return false; } } @@ -2339,7 +2339,7 @@ bool CFormElmArray::getArrayNode (UFormElm **result, uint arrayIndex) } else { - warning (false, "getArrayNode", "Index (%d) out of bound (%d).", arrayIndex, Elements.size() ); + warning (false, "getArrayNode", "Index (%u) out of bound (%u).", arrayIndex, (uint)Elements.size() ); return false; } } @@ -2351,11 +2351,11 @@ bool CFormElmArray::getArrayValue (std::string &result, uint arrayIndex, TEval e { if (arrayIndex >= Elements.size()) { - warning (false, "getArrayValue", "Access out of bound, trying to access array index %u, array size is %u.", arrayIndex, Elements.size()); + warning (false, "getArrayValue", "Access out of bound, trying to access array index %u, array size is %u.", arrayIndex, (uint)Elements.size()); } else if (Type) { - return (Type->getValue (result, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, NULL)); + return (Type->getValue (result, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, "")); } else { @@ -2372,9 +2372,9 @@ bool CFormElmArray::getArrayValue (sint8 &result, uint arrayIndex, TEval evaluat if (Type) { string str; - if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, NULL)) + if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, "")) { - return convertValue (result, str.c_str ()); + return convertValue (result, str); } } else @@ -2392,9 +2392,9 @@ bool CFormElmArray::getArrayValue (uint8 &result, uint arrayIndex, TEval evaluat if (Type) { string str; - if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, NULL)) + if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, "")) { - return convertValue (result, str.c_str ()); + return convertValue (result, str); } } else @@ -2412,9 +2412,9 @@ bool CFormElmArray::getArrayValue (sint16 &result, uint arrayIndex, TEval evalua if (Type) { string str; - if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, NULL)) + if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, "")) { - return convertValue (result, str.c_str ()); + return convertValue (result, str); } } else @@ -2432,9 +2432,9 @@ bool CFormElmArray::getArrayValue (uint16 &result, uint arrayIndex, TEval evalua if (Type) { string str; - if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, NULL)) + if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, "")) { - return convertValue (result, str.c_str ()); + return convertValue (result, str); } } else @@ -2452,9 +2452,9 @@ bool CFormElmArray::getArrayValue (sint32 &result, uint arrayIndex, TEval evalua if (Type) { string str; - if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, NULL)) + if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, "")) { - return convertValue (result, str.c_str ()); + return convertValue (result, str); } } else @@ -2472,9 +2472,9 @@ bool CFormElmArray::getArrayValue (uint32 &result, uint arrayIndex, TEval evalua if (Type) { string str; - if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, NULL)) + if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, "")) { - return convertValue (result, str.c_str ()); + return convertValue (result, str); } } else @@ -2492,9 +2492,9 @@ bool CFormElmArray::getArrayValue (float &result, uint arrayIndex, TEval evaluat if (Type) { string str; - if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, NULL)) + if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, "")) { - return convertValue (result, str.c_str ()); + return convertValue (result, str); } } else @@ -2512,9 +2512,9 @@ bool CFormElmArray::getArrayValue (double &result, uint arrayIndex, TEval evalua if (Type) { string str; - if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, NULL)) + if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, "")) { - return convertValue (result, str.c_str ()); + return convertValue (result, str); } } else @@ -2532,9 +2532,9 @@ bool CFormElmArray::getArrayValue (bool &result, uint arrayIndex, TEval evaluate if (Type) { string str; - if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, NULL)) + if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, "")) { - return convertValue (result, str.c_str ()); + return convertValue (result, str); } } else @@ -2552,9 +2552,9 @@ bool CFormElmArray::getArrayValue (NLMISC::CRGBA &result, uint arrayIndex, TEval if (Type) { string str; - if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, NULL)) + if (Type->getValue (str, Form, safe_cast (Elements[arrayIndex].Element), *ParentDfn, ParentIndex, evaluate, (uint32*)where, NLGEORGES_FIRST_ROUND, "")) { - return convertValue (result, str.c_str ()); + return convertValue (result, str); } } else @@ -2567,7 +2567,7 @@ bool CFormElmArray::getArrayValue (NLMISC::CRGBA &result, uint arrayIndex, TEval // *************************************************************************** -xmlNodePtr CFormElmArray::write (xmlNodePtr root, const CForm *form, const char *structName, bool forceWrite) const +xmlNodePtr CFormElmArray::write (xmlNodePtr root, const CForm *form, const std::string &structName, bool forceWrite) const { // Arrau is used ? if (isUsed (form) || forceWrite) @@ -2576,10 +2576,10 @@ xmlNodePtr CFormElmArray::write (xmlNodePtr root, const CForm *form, const char xmlNodePtr node = xmlNewChild ( root, NULL, (const xmlChar*)"ARRAY", NULL); // Element name - if (structName != NULL) + if (!structName.empty()) { // Struct name - xmlSetProp (node, (const xmlChar*)"Name", (const xmlChar*)structName); + xmlSetProp (node, (const xmlChar*)"Name", (const xmlChar*)structName.c_str()); } // For each elements of the structure @@ -2588,7 +2588,7 @@ xmlNodePtr CFormElmArray::write (xmlNodePtr root, const CForm *form, const char { // Create a node if (Elements[elm].Element) - Elements[elm].Element->write (node, form, Elements[elm].Name.empty ()?NULL:Elements[elm].Name.c_str (), true); + Elements[elm].Element->write (node, form, Elements[elm].Name, true); } // Return the new node @@ -2760,7 +2760,7 @@ void CFormElmArray::getFormName (std::string &result, const CFormElm *child) con // *************************************************************************** -void CFormElmArray::warning (bool exception, const char *function, const char *format, ... ) const +void CFormElmArray::warning (bool exception, const std::string &function, const char *format, ... ) const { // Make a buffer string va_list args; @@ -2772,7 +2772,7 @@ void CFormElmArray::warning (bool exception, const char *function, const char *f // Set the warning string formName; getFormName (formName, NULL); - NLGEORGES::warning (exception, "(CFormElmArray::%s) on node (%s) in form (%s) : %s", function, formName.c_str (), Form->getFilename ().c_str (), buffer); + NLGEORGES::warning (exception, "(CFormElmArray::%s) on node (%s) in form (%s) : %s", function.c_str(), formName.c_str (), Form->getFilename ().c_str (), buffer); } // *************************************************************************** @@ -2979,7 +2979,7 @@ bool CFormElmAtom::getValue (NLMISC::CRGBA &result, TEval evaluate) const // *************************************************************************** -xmlNodePtr CFormElmAtom::write (xmlNodePtr root, const CForm *form, const char *structName, bool forceWrite) const +xmlNodePtr CFormElmAtom::write (xmlNodePtr root, const CForm *form, const std::string &structName, bool forceWrite) const { // Atom is used ? if (isUsed (form) || forceWrite) @@ -2988,16 +2988,16 @@ xmlNodePtr CFormElmAtom::write (xmlNodePtr root, const CForm *form, const char xmlNodePtr node = xmlNewChild ( root, NULL, (const xmlChar*)"ATOM", NULL); // Element name - if (structName != NULL) + if (!structName.empty()) { // Struct name - xmlSetProp (node, (const xmlChar*)"Name", (const xmlChar*)structName); + xmlSetProp (node, (const xmlChar*)"Name", (const xmlChar*)structName.c_str()); } // The value if (!Value.empty ()) { - if (COXml::isStringValidForProperties (Value.c_str ())) + if (COXml::isStringValidForProperties (Value)) xmlSetProp (node, (const xmlChar*)"Value", (const xmlChar*)Value.c_str()); else { @@ -3049,7 +3049,7 @@ void CFormElmAtom::read (xmlNodePtr node, CFormLoader &/* loader */, const CType // *************************************************************************** -void CFormElmAtom::setValue (const char *value) +void CFormElmAtom::setValue (const std::string &value) { Value = value; } @@ -3077,7 +3077,7 @@ void CFormElmAtom::getFormName (std::string &result, const CFormElm *child) cons // *************************************************************************** -void CFormElmAtom::warning (bool exception, const char *function, const char *format, ... ) const +void CFormElmAtom::warning (bool exception, const std::string &function, const char *format, ... ) const { // Make a buffer string va_list args; @@ -3089,7 +3089,7 @@ void CFormElmAtom::warning (bool exception, const char *function, const char *fo // Set the warning string formName; getFormName (formName, NULL); - NLGEORGES::warning (exception, "(CFormElmAtom::%s) on node (%s) in form (%s) : %s", function, formName.c_str (), Form->getFilename ().c_str (), buffer); + NLGEORGES::warning (exception, "(CFormElmAtom::%s) on node (%s) in form (%s) : %s", function.c_str(), formName.c_str (), Form->getFilename ().c_str (), buffer); } // *************************************************************************** diff --git a/code/nel/src/georges/form_loader.cpp b/code/nel/src/georges/form_loader.cpp index dd0becf62..154fb9e0d 100644 --- a/code/nel/src/georges/form_loader.cpp +++ b/code/nel/src/georges/form_loader.cpp @@ -60,10 +60,10 @@ CFormLoader::~CFormLoader() { } -CType *CFormLoader::loadType (const char *filename) +CType *CFormLoader::loadType (const std::string &filename) { // Lower string filename - string lowerStr = toLower((string)filename); + string lowerStr = toLower(filename); lowerStr = CFile::getFilename (lowerStr); // Already in the map ? @@ -98,7 +98,7 @@ CType *CFormLoader::loadType (const char *filename) else { // Output error - warning (false, "loadType", "Can't open the form file (%s).", filename); + warning (false, "loadType", "Can't open the form file (%s).", filename.c_str()); // Delete the type delete type; @@ -108,7 +108,7 @@ CType *CFormLoader::loadType (const char *filename) catch (const Exception &e) { // Output error - warning (false, "loadType", "Error while loading the form (%s): %s", filename, e.what()); + warning (false, "loadType", "Error while loading the form (%s): %s", filename.c_str(), e.what()); // Delete the type delete type; @@ -130,10 +130,10 @@ CType *CFormLoader::loadType (const char *filename) // *************************************************************************** -CFormDfn *CFormLoader::loadFormDfn (const char *filename, bool forceLoad) +CFormDfn *CFormLoader::loadFormDfn (const std::string &filename, bool forceLoad) { // Lower string filename - string lowerStr = toLower((string)filename); + string lowerStr = toLower(filename); lowerStr = CFile::getFilename (lowerStr); // Already in the map ? @@ -196,7 +196,7 @@ CFormDfn *CFormLoader::loadFormDfn (const char *filename, bool forceLoad) // *************************************************************************** -UForm *CFormLoader::loadForm (const char *filename) +UForm *CFormLoader::loadForm (const std::string &filename) { // Lower string filename string lowerStr = toLower((string)filename); @@ -237,7 +237,7 @@ UForm *CFormLoader::loadForm (const char *filename) name += ".dfn"; // Load the dfn - CFormDfn *dfn = loadFormDfn (name.c_str (), false); + CFormDfn *dfn = loadFormDfn (name, false); if (dfn) { // Open the file @@ -293,21 +293,21 @@ UForm *CFormLoader::loadForm (const char *filename) // *************************************************************************** -UFormDfn *CFormLoader::loadFormDfn (const char *filename) +UFormDfn *CFormLoader::loadFormDfn (const std::string &filename) { return loadFormDfn (filename, false); } // *************************************************************************** -UType *CFormLoader::loadFormType (const char *filename) +UType *CFormLoader::loadFormType (const std::string &filename) { return loadType (filename); } // *************************************************************************** -void CFormLoader::warning (bool exception, const char *function, const char *format, ... ) const +void CFormLoader::warning (bool exception, const std::string &function, const char *format, ... ) const { // Make a buffer string va_list args; diff --git a/code/nel/src/georges/header.cpp b/code/nel/src/georges/header.cpp index a2df85cd3..fcafd10e4 100644 --- a/code/nel/src/georges/header.cpp +++ b/code/nel/src/georges/header.cpp @@ -76,7 +76,7 @@ void CFileHeader::write (xmlNodePtr node) const // *************************************************************************** -void CFileHeader::addLog (const char *log) +void CFileHeader::addLog (const std::string &log) { time_t t; time (&t); @@ -92,7 +92,7 @@ void CFileHeader::addLog (const char *log) // *************************************************************************** -void CFileHeader::setComments (const char *comments) +void CFileHeader::setComments (const std::string &comments) { Comments = comments; } @@ -215,7 +215,7 @@ const char *CFileHeader::getStateString (TState state) // *************************************************************************** -void CFileHeader::warning (bool exception, const char *function, const char *format, ... ) const +void CFileHeader::warning (bool exception, const std::string &function, const char *format, ... ) const { // Make a buffer string va_list args; @@ -225,7 +225,7 @@ void CFileHeader::warning (bool exception, const char *function, const char *for va_end( args ); // Set the warning - NLGEORGES::warning (exception, "(CFileHeader::%s) : %s", function, buffer); + NLGEORGES::warning (exception, "(CFileHeader::%s) : %s", function.c_str(), buffer); } // *************************************************************************** diff --git a/code/nel/src/georges/type.cpp b/code/nel/src/georges/type.cpp index 5867f1282..951acc3e0 100644 --- a/code/nel/src/georges/type.cpp +++ b/code/nel/src/georges/type.cpp @@ -326,6 +326,7 @@ public: Type = type; Form = form; } + virtual CEvalNumExpr::TReturnState evalValue (const char *value, double &result, uint32 round) { // If a form is available @@ -412,7 +413,7 @@ public: result = res.empty ()?0:1; return CEvalNumExpr::NoError; } - else if (((const CFormElm&)Form->getRootNode ()).convertValue (result, res.c_str ())) + else if (((const CFormElm&)Form->getRootNode ()).convertValue (result, res)) { return CEvalNumExpr::NoError; } @@ -535,7 +536,7 @@ void buildError (char *msg, uint offset) // *************************************************************************** -bool CType::getValue (string &result, const CForm *form, const CFormElmAtom *node, const CFormDfn &parentDfn, uint parentIndex, UFormElm::TEval evaluate, uint32 *where, uint32 round, const char *formName) const +bool CType::getValue (string &result, const CForm *form, const CFormElmAtom *node, const CFormDfn &parentDfn, uint parentIndex, UFormElm::TEval evaluate, uint32 *where, uint32 round, const std::string &formName) const { if (round > NLGEORGES_MAX_RECURSION) { @@ -721,7 +722,7 @@ bool CType::getValue (string &result, const CForm *form, const CFormElmAtom *nod UFormDfn::TEntryType type; // Search for the node - if (((const CFormElm&)form->getRootNode ()).getNodeByName (valueName.c_str (), &parentDfn, parentIndex, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, false, round+1)) + if (((const CFormElm&)form->getRootNode ()).getNodeByName (valueName, &parentDfn, parentIndex, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, false, round+1)) { // End, return the current index if (type == UFormDfn::EntryType) @@ -809,7 +810,7 @@ bool CType::uiCompatible (TType type, TUI ui) // *************************************************************************** -void CType::warning (bool exception, const char *formName, const char *formFilename, const char *function, const char *format, ... ) const +void CType::warning (bool exception, const std::string &formName, const std::string &formFilename, const std::string &function, const char *format, ... ) const { // Make a buffer string va_list args; @@ -819,12 +820,12 @@ void CType::warning (bool exception, const char *formName, const char *formFilen va_end( args ); // Set the warning - NLGEORGES::warning (exception, "(CType::%s) In form (%s) in node (%s) : %s", function, formFilename, formName, buffer); + NLGEORGES::warning (exception, "(CType::%s) In form (%s) in node (%s) : %s", function.c_str(), formFilename.c_str(), formName.c_str(), buffer); } // *************************************************************************** -void CType::warning2 (bool exception, const char *function, const char *format, ... ) const +void CType::warning2 (bool exception, const std::string &function, const char *format, ... ) const { // Make a buffer string va_list args; @@ -834,7 +835,7 @@ void CType::warning2 (bool exception, const char *function, const char *format, va_end( args ); // Set the warning - NLGEORGES::warning (exception, "(CType::%s) : %s", function, buffer); + NLGEORGES::warning (exception, "(CType::%s) : %s", function.c_str(), buffer); } // *************************************************************************** diff --git a/code/nel/tools/3d/object_viewer/editable_range.cpp b/code/nel/tools/3d/object_viewer/editable_range.cpp index 525d15ab7..28806fc31 100644 --- a/code/nel/tools/3d/object_viewer/editable_range.cpp +++ b/code/nel/tools/3d/object_viewer/editable_range.cpp @@ -159,7 +159,7 @@ void CEditableRange::OnUpdateValue() void CEditableRange::emptyDialog(void) { - m_Value = CString(""); + m_Value.Empty(); m_SliderPos = 0; UpdateData(FALSE); } diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.def b/code/nel/tools/3d/plugin_max/nel_export/nel_export.def index cd87c4dc0..8e50aaeed 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.def +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.def @@ -1,4 +1,4 @@ -LIBRARY nelexport.dlu +;LIBRARY nelexport.dlu EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp index ba4fe5769..adfba5a98 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp @@ -106,7 +106,7 @@ void regsiterOVPath () //#elif defined (NL_RELEASE_DEBUG) // HMODULE hModule = GetModuleHandle("object_viewer_dll_rd.dll"); #else - HMODULE hModule = GetModuleHandle("object_viewer_dll_r.dll"); + HMODULE hModule = GetModuleHandle(_T("object_viewer_dll_r.dll")); #endif if (!hModule) { ::MessageBox(NULL, _T("'hModule' failed at '") __FUNCTION__ _T("' in file '") __FILE__ _T(" on line ") NL_MACRO_TO_STR(__LINE__), _T("NeL Export"), MB_OK | MB_ICONERROR); return; } TCHAR sModulePath[256]; diff --git a/code/nel/tools/georges/georges2csv/georges2csv.cpp b/code/nel/tools/georges/georges2csv/georges2csv.cpp index 131e5961c..92be57ebc 100644 --- a/code/nel/tools/georges/georges2csv/georges2csv.cpp +++ b/code/nel/tools/georges/georges2csv/georges2csv.cpp @@ -405,7 +405,7 @@ void scanFiles(const CSString &filespec) } else { - if (form->getRootNode ().getValueByName(valueString,fields[i]._name.c_str(),fields[i]._evaluated,&where)) //fieldForm->getValue(valueString,fields[i]._evaluated)) + if (form->getRootNode ().getValueByName(valueString,fields[i]._name, fields[i]._evaluated, &where)) //fieldForm->getValue(valueString,fields[i]._evaluated)) ;//addQuotesRoundString (valueString); else setErrorString (valueString, fields[i]._evaluated, where); @@ -422,7 +422,7 @@ void scanFiles(const CSString &filespec) // UFormElm::TWhereIsValue where; // -// bool result=form->getRootNode ().getValueByName(s,fields[i]._name.c_str(),fields[i]._evaluated,&where); +// bool result=form->getRootNode ().getValueByName(s,fields[i]._name, fields[i]._evaluated,&where); // if (!result) // { // if (fields[i]._evaluated) @@ -1122,8 +1122,8 @@ void convertCsvFile( const string &file, bool generate, const string& sheetType } //nldebug( "%s: %s '%s'", args[0].c_str(), var.c_str(), memberVal.c_str() ); // need to put the value at the correct index. - const std::string fieldName=NLMISC::toString("%s[%d]", var.c_str(), currentMemberIndex).c_str(); - const_cast(rootForm).setValueByName(memberVal.c_str(), fieldName.c_str()); + const std::string fieldName=NLMISC::toString("%s[%u]", var.c_str(), currentMemberIndex).c_str(); + const_cast(rootForm).setValueByName(memberVal, fieldName); isModified=true; displayed = true; } @@ -1132,7 +1132,7 @@ void convertCsvFile( const string &file, bool generate, const string& sheetType if (!isNewSheet) { string test; - if ( rootForm.getValueByName(test,var.c_str()) + if ( rootForm.getValueByName(test, var) && test==memberVal ) { continue; @@ -1140,7 +1140,7 @@ void convertCsvFile( const string &file, bool generate, const string& sheetType } //nldebug( "%s: %s '%s'", args[0].c_str(), var.c_str(), memberVal.c_str() ); - const_cast(rootForm).setValueByName(memberVal.c_str(), var.c_str()); + const_cast(rootForm).setValueByName(memberVal, var); isModified=true; displayed = true; } diff --git a/code/nel/tools/logic/logic_editor_dll/ConditionPage.cpp b/code/nel/tools/logic/logic_editor_dll/ConditionPage.cpp index 60beeec25..64f0b985b 100644 --- a/code/nel/tools/logic/logic_editor_dll/ConditionPage.cpp +++ b/code/nel/tools/logic/logic_editor_dll/ConditionPage.cpp @@ -272,7 +272,7 @@ void CConditionPage::addCondition( CLogic_editorDoc *pDoc, CCondition * conditio CCondition *pCondition; if (pDoc->m_conditions.Lookup( condition->m_sName, (void*&)pCondition)) { - AfxMessageBox("A condition with this name already exist..."); + AfxMessageBox(_T("A condition with this name already exist...")); return; } diff --git a/code/nel/tools/logic/logic_editor_dll/logic_editorDoc.cpp b/code/nel/tools/logic/logic_editor_dll/logic_editorDoc.cpp index baf34938c..de2e75e23 100644 --- a/code/nel/tools/logic/logic_editor_dll/logic_editorDoc.cpp +++ b/code/nel/tools/logic/logic_editor_dll/logic_editorDoc.cpp @@ -488,7 +488,7 @@ BOOL CLogic_editorDoc::OnSaveDocument( LPCTSTR fileName ) { variable = m_variables.GetNext( pos ); CLogicVariable logicVariable; - logicVariable.setName( string((LPCSTR)variable) ); + logicVariable.setName(tStrToUtf8(variable)); logicStateMachine.addVariable( logicVariable ); } @@ -502,7 +502,7 @@ BOOL CLogic_editorDoc::OnSaveDocument( LPCTSTR fileName ) CLogicCounter logicCounter; cCounterToCLogicCounter( *pCounter, logicCounter ); // set the logic counter name - logicCounter.setName( (LPCSTR)eltName ); + logicCounter.setName(tStrToUtf8(eltName)); // add the logic counter logicStateMachine.addCounter( logicCounter ); } @@ -517,7 +517,7 @@ BOOL CLogic_editorDoc::OnSaveDocument( LPCTSTR fileName ) CLogicCondition logicCondition; cConditionToCLogicCondition( *pCondition, logicCondition ); // set the logic condition name - logicCondition.setName( (LPCSTR)eltName ); + logicCondition.setName(tStrToUtf8(eltName)); // add the logic condition logicStateMachine.addCondition( logicCondition ); } @@ -532,7 +532,7 @@ BOOL CLogic_editorDoc::OnSaveDocument( LPCTSTR fileName ) CLogicState logicState; cStateToCLogicState( *pState, logicState ); // set the logic state's name - logicState.setName( (LPCSTR)eltName ); + logicState.setName(tStrToUtf8(eltName)); // add the logic state logicStateMachine.addState( logicState ); } @@ -542,14 +542,14 @@ BOOL CLogic_editorDoc::OnSaveDocument( LPCTSTR fileName ) if(pos != NULL) { m_states.GetNextAssoc( pos, eltName, (void*&)pState ); - logicStateMachine.setCurrentState( string((LPCSTR)eltName) ); + logicStateMachine.setCurrentState(tStrToUtf8(eltName)); } else { - logicStateMachine.setCurrentState( string("") ); + logicStateMachine.setCurrentState(""); } // set the name of the state machine - logicStateMachine.setName( string(fileName) ); + logicStateMachine.setName(tStrToUtf8(fileName)); // Check exceptions @@ -559,7 +559,7 @@ BOOL CLogic_editorDoc::OnSaveDocument( LPCTSTR fileName ) COFile file; // Open the file - file.open (fileName); + file.open (tStrToUtf8(fileName)); // Create the XML stream COXml output; @@ -625,7 +625,7 @@ BOOL CLogic_editorDoc::load( LPCTSTR fileName ) CIFile file; // Open the file - file.open (fileName); + file.open (tStrToUtf8(fileName)); // Create the XML stream CIXml xmlfileIn; diff --git a/code/ryzom/client/CMakeLists.txt b/code/ryzom/client/CMakeLists.txt index a17e216d6..43897c905 100644 --- a/code/ryzom/client/CMakeLists.txt +++ b/code/ryzom/client/CMakeLists.txt @@ -15,7 +15,11 @@ IF(WITH_RYZOM_CLIENT) IF(APPLE) INSTALL(FILES macosx/upgd_nl.sh DESTINATION ${RYZOM_GAMES_PREFIX}) ELSEIF(WIN32) - INSTALL(FILES windows/upgd_nl.bat DESTINATION ${RYZOM_GAMES_PREFIX}) + IF(MSVC10) + INSTALL(FILES windows/upgd_nl_msvc10.bat DESTINATION ${RYZOM_GAMES_PREFIX} RENAME upgd_nl.bat) + ELSEIF(MSVC12) + INSTALL(FILES windows/upgd_nl_msvc12.bat DESTINATION ${RYZOM_GAMES_PREFIX} RENAME upgd_nl.bat) + ENDIF() ELSE() INSTALL(FILES unix/upgd_nl.sh DESTINATION ${RYZOM_GAMES_PREFIX}) ENDIF() diff --git a/code/ryzom/client/src/browse_faq.cpp b/code/ryzom/client/src/browse_faq.cpp index cdf830fe8..ec0d7906d 100644 --- a/code/ryzom/client/src/browse_faq.cpp +++ b/code/ryzom/client/src/browse_faq.cpp @@ -60,6 +60,6 @@ void browseFAQ(NLMISC::CConfigFile &cf) } else { - openURL(url.c_str()); + openURL(url); } } diff --git a/code/ryzom/client/src/client_sheets/item_fx_sheet.cpp b/code/ryzom/client/src/client_sheets/item_fx_sheet.cpp index c58bc601f..bfd671bca 100644 --- a/code/ryzom/client/src/client_sheets/item_fx_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/item_fx_sheet.cpp @@ -54,7 +54,7 @@ void CItemFXSheet::build(const NLGEORGES::UFormElm &item, const std::string &pre item.getValueByName(AttackFXRot.z, (prefix + "AttackFXRot.Z").c_str()); item.getValueByName(ImpactFXDelay, (prefix + "ImpactFXDelay").c_str()); const NLGEORGES::UFormElm *array = NULL; - if (item.getNodeByName(&array, (prefix + "StaticFXs").c_str()) && array) + if (item.getNodeByName(&array, prefix + "StaticFXs") && array) { uint count; nlverify(array->getArraySize(count)); diff --git a/code/ryzom/client/src/client_sheets/outpost_building_sheet.cpp b/code/ryzom/client/src/client_sheets/outpost_building_sheet.cpp index 8c8f3ea8c..667f982f4 100644 --- a/code/ryzom/client/src/client_sheets/outpost_building_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/outpost_building_sheet.cpp @@ -75,7 +75,7 @@ void COutpostBuildingSheet::build(const NLGEORGES::UFormElm &root) // Get Mps sheets const UFormElm *pMp; uint32 i = 0; - while (pDriller->getNodeByName(&pMp, ("mp" + NLMISC::toString(i)).c_str()) && pMp) + while (pDriller->getNodeByName(&pMp, "mp" + NLMISC::toString(i)) && pMp) { string sTmp; pMp->getValueByName(sTmp, "name"); diff --git a/code/ryzom/client/src/client_sheets/race_stats_sheet.cpp b/code/ryzom/client/src/client_sheets/race_stats_sheet.cpp index 651e9a8ec..63240cd67 100644 --- a/code/ryzom/client/src/client_sheets/race_stats_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/race_stats_sheet.cpp @@ -226,7 +226,7 @@ void CRaceStatsSheet::buildGroundFXs(const NLGEORGES::UFormElm &item, const std: { // ground fxs const NLGEORGES::UFormElm *elm; - if(item.getNodeByName(&elm, name.c_str()) && elm) + if(item.getNodeByName(&elm, name) && elm) { // Check array. if(elm->isArray()) diff --git a/code/ryzom/client/src/client_sheets/sky_object_sheet.cpp b/code/ryzom/client/src/client_sheets/sky_object_sheet.cpp index 70304dc00..6173feb23 100644 --- a/code/ryzom/client/src/client_sheets/sky_object_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/sky_object_sheet.cpp @@ -48,7 +48,7 @@ void CSkyObjectSheet::CColorGradientInfoSheet::build(const NLGEORGES::UFormElm & { item.getValueByName(TargetTextureStage, (prefix + "TargetTextureStage").c_str()); const NLGEORGES::UFormElm *elm = NULL; - if(item.getNodeByName (&elm, (prefix + "WeatherToGradient").c_str()) && elm) + if(item.getNodeByName (&elm, prefix + "WeatherToGradient") && elm) { uint numBitmaps; nlverify (elm->getArraySize (numBitmaps)); diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 6ea0b055b..51e57373b 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -3910,7 +3910,7 @@ NLMISC_COMMAND (url, "launch a browser to the specified url", "") if (args.size () != 1) return false; - return openURL(args[0].c_str()); + return openURL(args[0]); } NLMISC_COMMAND( reconnect, "Reconnect to the same shard (self Far TP)", "") diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 109b72de8..9b84c5922 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -1977,7 +1977,7 @@ class CAHOpenURL : public IActionHandler url += LoginCustomParameters; } - openURL(url.c_str()); + openURL(url); nlinfo("openURL %s", url.c_str()); } diff --git a/code/ryzom/client/src/misc.cpp b/code/ryzom/client/src/misc.cpp index 332d7b2d5..0f87b8037 100644 --- a/code/ryzom/client/src/misc.cpp +++ b/code/ryzom/client/src/misc.cpp @@ -234,10 +234,10 @@ void readStringArray(const std::string &filename, NLGEORGES::UFormLoader *formLo if(elmt->getArrayValue(stringName, i)) container.insert(make_pair(nodeName, stringName)); else - nlwarning("readStringArray: no string associated to the node '%d(%s)'.", i, nodeName.c_str()); + nlwarning("readStringArray: no string associated to the node '%u(%s)'.", i, nodeName.c_str()); } else - nlwarning("readStringArray: node '%d', index valid.", i); + nlwarning("readStringArray: node '%u', index valid.", i); } } } diff --git a/code/ryzom/client/windows/upgd_nl.bat b/code/ryzom/client/windows/upgd_nl_msvc10.bat similarity index 59% rename from code/ryzom/client/windows/upgd_nl.bat rename to code/ryzom/client/windows/upgd_nl_msvc10.bat index 60ae2987c..5dcb42592 100644 --- a/code/ryzom/client/windows/upgd_nl.bat +++ b/code/ryzom/client/windows/upgd_nl_msvc10.bat @@ -27,27 +27,6 @@ if exist %ROOTPATH%\msvcr100_win64.dll ( copy /Y %ROOTPATH%\msvcr100_win64.dll %ROOTPATH%\msvcr100.dll ) -rem VC++ 2013 now -if exist %ROOTPATH%\msvcp120_win32.dll ( - if exist %ROOTPATH%\msvcp120.dll del %ROOTPATH%\msvcp120.dll - copy /Y %ROOTPATH%\msvcp120_win32.dll %ROOTPATH%\msvcp120.dll -) - -if exist %ROOTPATH%\msvcr120_win32.dll ( - if exist %ROOTPATH%\msvcr120.dll del %ROOTPATH%\msvcr120.dll - copy /Y %ROOTPATH%\msvcr120_win32.dll %ROOTPATH%\msvcr120.dll -) - -if exist %ROOTPATH%\msvcp120_win64.dll ( - if exist %ROOTPATH%\msvcp120.dll del %ROOTPATH%\msvcp120.dll - copy /Y %ROOTPATH%\msvcp120_win64.dll %ROOTPATH%\msvcp120.dll -) - -if exist %ROOTPATH%\msvcr120_win64.dll ( - if exist %ROOTPATH%\msvcr120.dll del %ROOTPATH%\msvcr120.dll - copy /Y %ROOTPATH%\msvcr120_win64.dll %ROOTPATH%\msvcr120.dll -) - if exist %ROOTPATH%\..\ryzom_installer_qt_r.exe ( if exist %ROOTPATH%\..\ryzom_installer_qt_r.exe del %ROOTPATH%\..\ryzom_installer_qt_r.exe copy /Y %ROOTPATH%\ryzom_installer_qt_r.exe %ROOTPATH%\.. @@ -55,10 +34,6 @@ if exist %ROOTPATH%\..\ryzom_installer_qt_r.exe ( copy /Y %ROOTPATH%\msvcp100.dll %ROOTPATH%\.. if exist %ROOTPATH%\..\msvcr100.dll del %ROOTPATH%\..\msvcr100.dll copy /Y %ROOTPATH%\msvcr100.dll %ROOTPATH%\.. - if exist %ROOTPATH%\..\msvcp120.dll del %ROOTPATH%\..\msvcp120.dll - copy /Y %ROOTPATH%\msvcp120.dll %ROOTPATH%\.. - if exist %ROOTPATH%\..\msvcr120.dll del %ROOTPATH%\..\msvcr120.dll - copy /Y %ROOTPATH%\msvcr120.dll %ROOTPATH%\.. ) :end diff --git a/code/ryzom/client/windows/upgd_nl_msvc12.bat b/code/ryzom/client/windows/upgd_nl_msvc12.bat new file mode 100644 index 000000000..abff3fe66 --- /dev/null +++ b/code/ryzom/client/windows/upgd_nl_msvc12.bat @@ -0,0 +1,39 @@ +@echo off + +if "x%ROOTPATH%x" == "xx" ( + echo upgd_nl.bat can only be launched from updt_nl.bat + goto end +) + +rem We used this hack because to client 2.1 to 3.0 patch, +rem VC++ 2013 DLLs are using the same name and are deleted during patch +if exist %ROOTPATH%\msvcp120_win32.dll ( + if exist %ROOTPATH%\msvcp120.dll del %ROOTPATH%\msvcp120.dll + copy /Y %ROOTPATH%\msvcp120_win32.dll %ROOTPATH%\msvcp120.dll +) + +if exist %ROOTPATH%\msvcr120_win32.dll ( + if exist %ROOTPATH%\msvcr120.dll del %ROOTPATH%\msvcr120.dll + copy /Y %ROOTPATH%\msvcr120_win32.dll %ROOTPATH%\msvcr120.dll +) + +if exist %ROOTPATH%\msvcp120_win64.dll ( + if exist %ROOTPATH%\msvcp120.dll del %ROOTPATH%\msvcp120.dll + copy /Y %ROOTPATH%\msvcp120_win64.dll %ROOTPATH%\msvcp120.dll +) + +if exist %ROOTPATH%\msvcr120_win64.dll ( + if exist %ROOTPATH%\msvcr120.dll del %ROOTPATH%\msvcr120.dll + copy /Y %ROOTPATH%\msvcr120_win64.dll %ROOTPATH%\msvcr120.dll +) + +if exist %ROOTPATH%\..\ryzom_installer_qt_r.exe ( + if exist %ROOTPATH%\..\ryzom_installer_qt_r.exe del %ROOTPATH%\..\ryzom_installer_qt_r.exe + copy /Y %ROOTPATH%\ryzom_installer_qt_r.exe %ROOTPATH%\.. + if exist %ROOTPATH%\..\msvcp120.dll del %ROOTPATH%\..\msvcp120.dll + copy /Y %ROOTPATH%\msvcp120.dll %ROOTPATH%\.. + if exist %ROOTPATH%\..\msvcr120.dll del %ROOTPATH%\..\msvcr120.dll + copy /Y %ROOTPATH%\msvcr120.dll %ROOTPATH%\.. +) + +:end diff --git a/code/ryzom/common/src/game_share/light_cycle.cpp b/code/ryzom/common/src/game_share/light_cycle.cpp index f8dddaea2..472357979 100644 --- a/code/ryzom/common/src/game_share/light_cycle.cpp +++ b/code/ryzom/common/src/game_share/light_cycle.cpp @@ -62,7 +62,7 @@ void CLightCycle::build(const NLGEORGES::UFormElm &item) for(uint k = 0; k < EGSPD::CSeason::Invalid; ++k) { const NLGEORGES::UFormElm *seasonsItem; - if (item.getNodeByName(&seasonsItem, EGSPD::CSeason::toString( (EGSPD::CSeason::TSeason) k).c_str()) && seasonsItem) + if (item.getNodeByName(&seasonsItem, EGSPD::CSeason::toString( (EGSPD::CSeason::TSeason) k)) && seasonsItem) { SeasonLightCycle[k].build(*seasonsItem); } diff --git a/code/ryzom/common/src/game_share/time_weather_season/static_light_cycle.cpp b/code/ryzom/common/src/game_share/time_weather_season/static_light_cycle.cpp index cf3c0e762..52f0e0592 100644 --- a/code/ryzom/common/src/game_share/time_weather_season/static_light_cycle.cpp +++ b/code/ryzom/common/src/game_share/time_weather_season/static_light_cycle.cpp @@ -46,7 +46,7 @@ void CStaticLightCycle::readGeorges( const NLMISC::CSmartPtr & for( uint i = 0; i < NbSeasons; ++i ) { UFormElm* SeasonElt = NULL; - if( ! ( root.getNodeByName( &SeasonElt, season[ i ].c_str() ) && SeasonElt ) ) + if( ! ( root.getNodeByName( &SeasonElt, season[ i ] ) && SeasonElt ) ) { nlwarning(" can get node %s in sheet %s", season[ i ].c_str(), sheetId.toString().c_str() ); } diff --git a/code/ryzom/server/src/ai_service/sheets.cpp b/code/ryzom/server/src/ai_service/sheets.cpp index 24a56328e..b8a444d58 100644 --- a/code/ryzom/server/src/ai_service/sheets.cpp +++ b/code/ryzom/server/src/ai_service/sheets.cpp @@ -258,7 +258,7 @@ void AISHEETS::CCreature::calcFightAndVisualValues(std::string* left, std::strin void AISHEETS::CCreature::parseFightConfig(NLGEORGES::UForm const* form, std::string const& fightConfigString, uint32 actionListIndex, NLMISC::CDbgPtr& fightConfig) { NLGEORGES::UFormElm const* actionListNode = NULL; - const_cast(form->getRootNode()).getNodeByName(&actionListNode, fightConfigString.c_str()); + const_cast(form->getRootNode()).getNodeByName(&actionListNode, fightConfigString); if (actionListNode) { diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp index 92356286a..b51031750 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp @@ -1754,10 +1754,10 @@ void CStaticBrick::loadFaber( const UFormElm &root, const CSheetId &sheetId ) for (uint i = 1 ; i <= 5 ; ++i) { propName = "faber.Create.MP "+toString(i); - if (root.getValueByName( value, propName.c_str() ) && !value.empty() ) + if (root.getValueByName( value, propName ) && !value.empty() ) { propName = "faber.Create.Quantity "+toString(i); - if ( root.getValueByName( quantity, propName.c_str() ) && quantity > 0) + if ( root.getValueByName( quantity, propName ) && quantity > 0) { CFaber::TRawMaterial mp; mp.MpType = RM_FABER_TYPE::toFaberType( value ); diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.cpp b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.cpp index 42517c190..8e81aa2cc 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.cpp +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.cpp @@ -249,7 +249,7 @@ void CStaticItem::init(bool doDelete) CraftingToolType = TOOL_TYPE::Unknown; Origin = ITEM_ORIGIN::UNKNOWN; - Sack = std::string(""); + Sack.clear(); Stackable = 1; Color = -2; SlotCount = 0; diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_sheet.cpp b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_sheet.cpp index 0cc44399d..a88ae94eb 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_sheet.cpp +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_sheet.cpp @@ -688,7 +688,7 @@ void CStaticCreatures::readGeorges( const NLMISC::CSmartPtr &f for( i = 0; i < SLOT_EQUIPMENT::NB_SLOT_EQUIPMENT; ++i ) { root.getValueByName( sheetName, (string("Basics.Equipment.") + SLOT_EQUIPMENT::toString( (SLOT_EQUIPMENT::TSlotEquipment) i ) + string(".Item" )).c_str() ); - if( sheetName != string("") && sheetName.find(".item") != std::string::npos ) + if( !sheetName.empty() && sheetName.find(".item") != std::string::npos ) { sheet = CSheetId( sheetName ); _Items[ i ].IdSheet = sheet.asInt(); @@ -1770,12 +1770,12 @@ void CStaticCharacters::readGeorges( const NLMISC::CSmartPtr & for( i = 0; i < SLOT_EQUIPMENT::NB_SLOT_EQUIPMENT; ++i ) { - root.getValueByName( sheetName, (string("Basics.Equipment.") + SLOT_EQUIPMENT::toString( (SLOT_EQUIPMENT::TSlotEquipment) i ) + string(".Item" )).c_str() ); - if( sheetName != string("") ) + root.getValueByName( sheetName, "Basics.Equipment." + SLOT_EQUIPMENT::toString( (SLOT_EQUIPMENT::TSlotEquipment) i ) + ".Item" ); + if (!sheetName.empty()) { sheet = CSheetId( sheetName ); Items[ i ].IdSheet = sheet.asInt(); - root.getValueByName( Items[ i ].Quality, (string("Basics.Equipment.") + SLOT_EQUIPMENT::toString( (SLOT_EQUIPMENT::TSlotEquipment) i ) + string(".Quality")).c_str() ); + root.getValueByName( Items[ i ].Quality, "Basics.Equipment." + SLOT_EQUIPMENT::toString( (SLOT_EQUIPMENT::TSlotEquipment) i ) + ".Quality" ); } else { @@ -1789,12 +1789,12 @@ void CStaticCharacters::readGeorges( const NLMISC::CSmartPtr & /////////////////////////////////////////////////////// /* for( i = 0; i < NB_SHEATH; ++i ) { - root.getValueByName( sheetName, (string("Basics.Equipment.Sheath") + toString( i ) + string("LeftHand.Item" )).c_str() ); - if( sheetName != string("") ) + root.getValueByName( sheetName, "Basics.Equipment.Sheath" + toString( i ) + "LeftHand.Item" ); + if( !sheetName.empty() ) { sheet = CSheetId( sheetName ); Sheaths[ i ].Left.IdSheet = sheet.asInt(); - root.getValueByName( Sheaths[ i ].Left.Quality, (string("Basics.Equipment.Sheath") + toString( i ) + string("LeftHand.Quality")).c_str() ); + root.getValueByName( Sheaths[ i ].Left.Quality, "Basics.Equipment.Sheath" + toString( i ) + "LeftHand.Quality" ); } else { @@ -1802,12 +1802,12 @@ void CStaticCharacters::readGeorges( const NLMISC::CSmartPtr & Sheaths[ i ].Left.Quality = 0; } - root.getValueByName( sheetName, (string("Basics.Equipment.Sheath") + toString( i ) + string("RightHand.Item" )).c_str() ); - if( sheetName != string("") ) + root.getValueByName( sheetName, "Basics.Equipment.Sheath" + toString( i ) + "RightHand.Item" ); + if( !sheetName.empty() ) { sheet = CSheetId( sheetName ); Sheaths[ i ].Right.IdSheet = sheet.asInt(); - root.getValueByName( Sheaths[ i ].Right.Quality, (string("Basics.Equipment.Sheath") + toString( i ) + string("RightHand.Quality")).c_str() ); + root.getValueByName( Sheaths[ i ].Right.Quality, "Basics.Equipment.Sheath" + toString( i ) + "RightHand.Quality" ); } else { @@ -1815,12 +1815,12 @@ void CStaticCharacters::readGeorges( const NLMISC::CSmartPtr & Sheaths[ i ].Right.Quality = 0; } - root.getValueByName( sheetName, (string("Basics.Equipment.Sheath") + toString( i ) + string("Ammo0.Item" )).c_str() ); - if( sheetName != string("") ) + root.getValueByName( sheetName, "Basics.Equipment.Sheath" + toString( i ) + "Ammo0.Item" ); + if( !sheetName.empty() ) { sheet = CSheetId( sheetName ); Sheaths[ i ].Ammo0.IdSheet = sheet.asInt(); - root.getValueByName( Sheaths[ i ].Ammo0.Quality, (string("Basics.Equipment.Sheath") + toString( i ) + string("Ammo0.Quality")).c_str() ); + root.getValueByName( Sheaths[ i ].Ammo0.Quality, "Basics.Equipment.Sheath" + toString( i ) + "Ammo0.Quality" ); } else { @@ -1828,12 +1828,12 @@ void CStaticCharacters::readGeorges( const NLMISC::CSmartPtr & Sheaths[ i ].Ammo0.Quality = 0; } - root.getValueByName( sheetName, (string("Basics.Equipment.Sheath") + toString( i ) + string("Ammo1.Item" )).c_str() ); - if( sheetName != string("") ) + root.getValueByName( sheetName, "Basics.Equipment.Sheath" + toString( i ) + "Ammo1.Item" ); + if( !sheetName.empty() ) { sheet = CSheetId( sheetName ); Sheaths[ i ].Ammo1.IdSheet = sheet.asInt(); - root.getValueByName( Sheaths[ i ].Ammo1.Quality, (string("Basics.Equipment.Sheath") + toString( i ) + string("Ammo1.Quality")).c_str() ); + root.getValueByName( Sheaths[ i ].Ammo1.Quality, "Basics.Equipment.Sheath" + toString( i ) + "Ammo1.Quality" ); } else { @@ -1841,12 +1841,12 @@ void CStaticCharacters::readGeorges( const NLMISC::CSmartPtr & Sheaths[ i ].Ammo1.Quality = 0; } - root.getValueByName( sheetName, (string("Basics.Equipment.Sheath") + toString( i ) + string("Ammo2.Item" )).c_str() ); - if( sheetName != string("") ) + root.getValueByName( sheetName, "Basics.Equipment.Sheath" + toString( i ) + "Ammo2.Item" ); + if( !sheetName.empty() ) { sheet = CSheetId( sheetName ); Sheaths[ i ].Ammo2.IdSheet = sheet.asInt(); - root.getValueByName( Sheaths[ i ].Ammo2.Quality, (string("Basics.Equipment.Sheath") + toString( i ) + string("Ammo2.Quality")).c_str() ); + root.getValueByName( Sheaths[ i ].Ammo2.Quality, "Basics.Equipment.Sheath" + toString( i ) + "Ammo2.Quality" ); } else { @@ -2202,7 +2202,7 @@ void CStaticRaceStats::readGeorges( const NLMISC::CSmartPtr &f int i; for( i = 0; i < CHARACTERISTICS::NUM_CHARACTERISTICS; ++i ) { - root.getValueByName( Characteristics[ (CHARACTERISTICS::TCharacteristics)i ], ( string("Characteristics.") + CHARACTERISTICS::toString( (CHARACTERISTICS::TCharacteristics)i ) ).c_str() ); + root.getValueByName( Characteristics[ (CHARACTERISTICS::TCharacteristics)i ], "Characteristics." + CHARACTERISTICS::toString( (CHARACTERISTICS::TCharacteristics)i ) ); } /////////////////////////////////////////////////////// @@ -2210,7 +2210,7 @@ void CStaticRaceStats::readGeorges( const NLMISC::CSmartPtr &f /////////////////////////////////////////////////////// for( i = 0; i < SCORES::NUM_SCORES; ++i ) { - root.getValueByName( Scores[ i ], ( string("Scores.") + SCORES::toString( i ) ).c_str(), UFormElm::Formula ); + root.getValueByName( Scores[ i ], "Scores." + SCORES::toString( i ), UFormElm::Formula ); } /////////////////////////////////////////////////////// @@ -2306,7 +2306,7 @@ void CStaticRole::readGeorgesSentenceAndEquipment( UFormElm& root, const NLMISC: { string value; const UFormElm *sentenceArray = NULL; - if (root.getNodeByName (&sentenceArray, SentenceString.c_str()) && sentenceArray) + if (root.getNodeByName (&sentenceArray, SentenceString) && sentenceArray) { // Get array size uint size; @@ -2352,12 +2352,12 @@ void CStaticRole::readGeorgesSentenceAndEquipment( UFormElm& root, const NLMISC: for( int i = 0; i < SLOT_EQUIPMENT::NB_SLOT_EQUIPMENT; ++i ) { - root.getValueByName( sheetName, ( EquipmentString + string(".") + SLOT_EQUIPMENT::toString( (SLOT_EQUIPMENT::TSlotEquipment) i ) + string(".Item" )).c_str() ); - if( sheetName != string("") ) + root.getValueByName( sheetName, EquipmentString + "." + SLOT_EQUIPMENT::toString( (SLOT_EQUIPMENT::TSlotEquipment) i ) + ".Item" ); + if (!sheetName.empty()) { sheet = CSheetId( sheetName ); Items[ i ].IdSheet = sheet.asInt(); - root.getValueByName( Items[ i ].Quality, ( EquipmentString + string(".") + SLOT_EQUIPMENT::toString( (SLOT_EQUIPMENT::TSlotEquipment) i ) + string(".Quality")).c_str() ); + root.getValueByName( Items[ i ].Quality, EquipmentString + "." + SLOT_EQUIPMENT::toString( (SLOT_EQUIPMENT::TSlotEquipment) i ) + ".Quality" ); } else { diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_harvestable.cpp b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_harvestable.cpp index 4aad89e50..283361617 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_harvestable.cpp +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_harvestable.cpp @@ -83,8 +83,8 @@ static void getVarListFromParents (const NLGEORGES::UForm *form, std::setgetRootNode(); NLGEORGES::UFormElm *elem=NULL; - const_cast(&item)->getNodeByName(&elem, varName.c_str()); - if (elem!=NULL) // item.getValueByName(temp, varName.c_str())) + const_cast(&item)->getNodeByName(&elem, varName); + if (elem!=NULL) // item.getValueByName(temp, varName)) { varList.insert (elem); } @@ -123,7 +123,7 @@ void CStaticHarvestable::loadFromGeorges( const UForm &form, const NLMISC::CShee */ { string value; - if ( form.getRootNode().getValueByName( value, (string("Harvest.")+"Skill").c_str() ) + if ( form.getRootNode().getValueByName( value, "Harvest.Skill" ) && !value.empty() ) { _HarvestSkill = SKILLS::toSkill( value ); @@ -139,22 +139,22 @@ void CStaticHarvestable::loadFromGeorges( const UForm &form, const NLMISC::CShee const string mpName=NLMISC::toString("MP%u",i); CStaticCreatureRawMaterial mp; - if( form.getRootNode().getValueByName( mp.MpCommon.AssociatedItemName, ("Harvest." +mpName+".AssociatedItem").c_str()) + if( form.getRootNode().getValueByName( mp.MpCommon.AssociatedItemName, "Harvest." +mpName+".AssociatedItem") && !mp.MpCommon.AssociatedItemName.empty() ) { if (VerboseQuartering) nldebug("QRTR: %s=%s", mpName.c_str(), mp.MpCommon.AssociatedItemName.c_str()); - form.getRootNode().getValueByName( mp.MpCommon.Name, ("Harvest." +mpName+".Name").c_str() ); + form.getRootNode().getValueByName( mp.MpCommon.Name, "Harvest." +mpName+".Name" ); uint16 sheetQuantity; - form.getRootNode().getValueByName( sheetQuantity, ("Harvest." +mpName+".Quantity").c_str() ); + form.getRootNode().getValueByName( sheetQuantity, "Harvest." +mpName+".Quantity" ); if ( sheetQuantity != 0 ) { nlwarning( "Quantity set to %hu in %s", sheetQuantity, sheetId.toString().c_str() ); } - form.getRootNode().getValueByName( mp.MpCommon.MinQuality, ("Harvest." +mpName+".MinQuality").c_str() ); - form.getRootNode().getValueByName( mp.MpCommon.MaxQuality, ("Harvest." +mpName+".MaxQuality").c_str() ); - // harvest->getValueByName( mp.PresenceProbabilities, (mpName+".PresenceProbabilities").c_str() ); + form.getRootNode().getValueByName( mp.MpCommon.MinQuality, "Harvest." +mpName+".MinQuality" ); + form.getRootNode().getValueByName( mp.MpCommon.MaxQuality, "Harvest." +mpName+".MaxQuality" ); + // harvest->getValueByName( mp.PresenceProbabilities, mpName+".PresenceProbabilities" ); mp.ItemId = mp.MpCommon.AssociatedItemName; if ( mp.MpCommon.MinQuality == 0) diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_outpost.cpp b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_outpost.cpp index f6223423f..146d4bae3 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_outpost.cpp +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_outpost.cpp @@ -142,12 +142,12 @@ void CStaticOutpostBuilding::CDriller::readGeorges (const NLGEORGES::UFormElm *p TotalMP = 0.0f; for (uint i = 0; i < 20; ++i) { - string namePath = NLMISC::toString("mp%d.name", i); - string quantityPath = NLMISC::toString("mp%d.quantity", i); + string namePath = NLMISC::toString("mp%u.name", i); + string quantityPath = NLMISC::toString("mp%u.quantity", i); string name; float quantity; - pElt->getValueByName (name, namePath.c_str()); - pElt->getValueByName (quantity, quantityPath.c_str()); + pElt->getValueByName (name, namePath); + pElt->getValueByName (quantity, quantityPath); if(!name.empty() && quantity>0.f) { CSheetId mpSheetId = CSheetId(name); diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_rolemaster_phrase.cpp b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_rolemaster_phrase.cpp index 563f117d3..8d69ce24d 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_rolemaster_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_rolemaster_phrase.cpp @@ -41,7 +41,7 @@ void CStaticRolemasterPhrase::readGeorges (const NLMISC::CSmartPtrgetRootNode().getValueByName( sbrickSheetName, toString( "brick %u", i ).c_str() ); + bool res = form->getRootNode().getValueByName( sbrickSheetName, toString( "brick %u", i ) ); if ( (! res) || sbrickSheetName.empty() ) { ++i; diff --git a/code/ryzom/tools/leveldesign/georges_dll/action.cpp b/code/ryzom/tools/leveldesign/georges_dll/action.cpp index 86eb13080..64fee10f6 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/action.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/action.cpp @@ -44,7 +44,7 @@ IAction::IAction (TTypeAction type, uint selId, uint slot) // *************************************************************************** -void IAction::setLabel (const char *logLabel, CGeorgesEditDoc &doc) +void IAction::setLabel (const std::string &logLabel, CGeorgesEditDoc &doc) { _LogLabel = logLabel; @@ -75,7 +75,7 @@ bool IAction::doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, bool fi // *************************************************************************** -void IAction::update (bool updateLeftView, TUpdateRightView rightViewFlag, CGeorgesEditDoc &doc, const char *_FormName) +void IAction::update (bool updateLeftView, TUpdateRightView rightViewFlag, CGeorgesEditDoc &doc, const std::string &_FormName) { // Right and left view CGeorgesEditView *rightView = doc.getRightView (); @@ -129,7 +129,7 @@ void IAction::update (bool updateLeftView, TUpdateRightView rightViewFlag, CGeor // *************************************************************************** -CActionString::CActionString (IAction::TTypeAction type, const char *newValue, CGeorgesEditDoc &doc, const char *formName, const char *userData, uint selId, uint slot) : IAction (type, selId, slot) +CActionString::CActionString (IAction::TTypeAction type, const std::string &newValue, CGeorgesEditDoc &doc, const std::string &formName, const std::string &userData, uint selId, uint slot) : IAction (type, selId, slot) { // Set the new value _NewValue = newValue; @@ -145,7 +145,9 @@ CActionString::CActionString (IAction::TTypeAction type, const char *newValue, C CType *type = doc.getTypePtr (); _OldValue = toString ((int)(type->Type)); setLabel ("Type Type", doc); - _Log[1] = type->getTypeName ((UType::TType)atoi (newValue)); + uint ttype; + fromString(newValue, ttype); + _Log[1] = type->getTypeName ((UType::TType)ttype); } break; case TypeUI: @@ -153,7 +155,9 @@ CActionString::CActionString (IAction::TTypeAction type, const char *newValue, C CType *type = doc.getTypePtr (); _OldValue = toString ((int)(type->UIType)); setLabel ("Type UI", doc); - _Log[1] = type->getUIName ((CType::TUI)atoi (newValue)); + uint ttype; + fromString(newValue, ttype); + _Log[1] = type->getUIName ((CType::TUI)ttype); } break; case TypeDefault: diff --git a/code/ryzom/tools/leveldesign/georges_dll/action.h b/code/ryzom/tools/leveldesign/georges_dll/action.h index 317f81e1a..95af8015e 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/action.h +++ b/code/ryzom/tools/leveldesign/georges_dll/action.h @@ -59,7 +59,7 @@ protected: IAction (TTypeAction type, uint selId, uint slot); // Init log label - void setLabel (const char *logLabel, CGeorgesEditDoc &doc); + void setLabel (const std::string &logLabel, CGeorgesEditDoc &doc); public: @@ -96,7 +96,7 @@ protected: UpdateValues, Redraw }; - void update (bool updateLeftView, TUpdateRightView rightView, CGeorgesEditDoc &doc, const char *_FormName); + void update (bool updateLeftView, TUpdateRightView rightView, CGeorgesEditDoc &doc, const std::string &_FormName); }; // String modification action @@ -105,7 +105,7 @@ class CActionString : public IAction public: // Constructor - CActionString (IAction::TTypeAction type, const char *newValue, CGeorgesEditDoc &doc, const char *formName, const char *userData, uint selId, uint slot); + CActionString(IAction::TTypeAction type, const std::string &newValue, CGeorgesEditDoc &doc, const std::string &formName, const std::string &userData, uint selId, uint slot); protected: @@ -165,7 +165,7 @@ class CActionBuffer : public IAction public: // Constructor - CActionBuffer (IAction::TTypeAction type, const uint8 *buffer, uint bufferSize, CGeorgesEditDoc &doc, const char *formName, const char *userData, uint selId, uint slot); + CActionBuffer (IAction::TTypeAction type, const uint8 *buffer, uint bufferSize, CGeorgesEditDoc &doc, const std::string &formName, const std::string &userData, uint selId, uint slot); protected: @@ -182,4 +182,4 @@ protected: virtual bool doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, bool firstTime); }; -#endif GEORGES_EDIT_ACTION_H +#endif diff --git a/code/ryzom/tools/leveldesign/georges_dll/base_dialog.cpp b/code/ryzom/tools/leveldesign/georges_dll/base_dialog.cpp index de8ccdf68..a29c9f7d7 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/base_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/base_dialog.cpp @@ -232,7 +232,7 @@ BOOL CBaseDialog::PreTranslateMessage(MSG* pMsg) void CBaseDialog::setEditTextMultiLine (CEdit &edit, const std::string &text) { - edit.SetWindowText (utf8ToTStr(addSlashR(text))); + edit.SetWindowText (utf8ToTStr(NLMISC::addSlashR(text))); } void CBaseDialog::onOpenSelected() diff --git a/code/ryzom/tools/leveldesign/georges_dll/form_dialog.cpp b/code/ryzom/tools/leveldesign/georges_dll/form_dialog.cpp index 25d10f9d2..2b8309ed2 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/form_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/form_dialog.cpp @@ -1292,14 +1292,14 @@ void IFormWidget::updateLabel () UFormElm::TWhereIsValue where; CForm *form=doc->getFormPtr (); CFormElm *elm = doc->getRootNode (getSlot ()); - nlverify (elm->getValueByName (result, FormName.c_str (), UFormElm::NoEval, &where)); + nlverify (elm->getValueByName (result, FormName, UFormElm::NoEval, &where)); // Get the value evaluated std::string resultEvaluated; #ifdef TEST_EVAL_FORMULA - bool error = !elm->getValueByName (resultEvaluated, FormName.c_str (), UFormElm::Formula, &where); + bool error = !elm->getValueByName (resultEvaluated, FormName, UFormElm::Formula, &where); #else // TEST_EVAL_FORMULA - bool error = !elm->getValueByName (resultEvaluated, FormName.c_str (), UFormElm::Eval, &where); + bool error = !elm->getValueByName (resultEvaluated, FormName, UFormElm::Eval, &where); #endif // TEST_EVAL_FORMULA // Complete the array ? @@ -1688,10 +1688,10 @@ void CFormMemCombo::getFromDocument (CForm &form) if ((SrcType == TypeForm) || (SrcType == TypeType)) { string result; - if (doc->getRootNode(getSlot ())->getValueByName (result, FormName.c_str(), UFormElm::NoEval, NULL)) + if (doc->getRootNode(getSlot ())->getValueByName (result, FormName, UFormElm::NoEval, NULL)) { Combo.UpdateData (); - Combo.SetWindowText (result.c_str()); + Combo.SetWindowText (utf8ToTStr(result)); Combo.UpdateData (FALSE); updateLabel (); } diff --git a/code/ryzom/tools/leveldesign/georges_dll/type_dialog.cpp b/code/ryzom/tools/leveldesign/georges_dll/type_dialog.cpp index f03347654..53698ea8f 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/type_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/type_dialog.cpp @@ -517,9 +517,9 @@ void CTypeDialog::setPredefToDocument () // Add the label and value str = Predef.ListCtrl.GetItemText (predef, 0); - stringVector[predef][0] = (const char*)str; + stringVector[predef][0] = tStrToUtf8(str); str = Predef.ListCtrl.GetItemText (predef, 1); - stringVector[predef][1] = (const char*)str; + stringVector[predef][1] = tStrToUtf8(str); } doc->modify (new CActionStringVectorVector (IAction::TypePredef, stringVector, *doc,