From 3b8025724842b71f4f4520a6b19b48ea2fb4e683 Mon Sep 17 00:00:00 2001 From: nitrocaster Date: Fri, 4 Dec 2015 22:41:38 +0300 Subject: [PATCH] Refactor GameObject class hierarchy. --- src/Layers/xrRender/LightTrack.cpp | 8 +- src/Layers/xrRender/LightTrack.h | 4 +- .../3DFluid/dx103DFluidObstacles.cpp | 2 +- src/Layers/xrRenderPC_R1/FStaticRender.cpp | 6 +- src/Layers/xrRenderPC_R1/GlowManager.cpp | 2 +- src/Layers/xrRenderPC_R1/LightProjector.cpp | 4 +- src/Layers/xrRenderPC_R2/r2_R_render.cpp | 2 +- src/Layers/xrRenderPC_R3/r3_R_render.cpp | 2 +- src/Layers/xrRenderPC_R4/r4_R_render.cpp | 2 +- src/xrCDB/ISpatial.cpp | 2 +- src/xrCDB/ISpatial.h | 9 +- src/xrCDB/xr_area.cpp | 10 +- src/xrCDB/xr_area.h | 24 +- src/xrCDB/xr_area_query.cpp | 2 +- src/xrCDB/xr_area_raypick.cpp | 26 +- src/xrCDB/xr_collide_defs.h | 12 +- src/xrEngine/CameraBase.cpp | 2 +- src/xrEngine/CameraBase.h | 8 +- src/xrEngine/CustomHUD.h | 2 +- src/xrEngine/EngineAPI.h | 2 +- src/xrEngine/Feel_Sound.h | 4 +- src/xrEngine/Feel_Touch.cpp | 18 +- src/xrEngine/Feel_Touch.h | 18 +- src/xrEngine/Feel_Vision.cpp | 24 +- src/xrEngine/Feel_Vision.h | 30 +- src/xrEngine/ICollidable.h | 4 +- src/xrEngine/IGame_Level.cpp | 9 +- src/xrEngine/IGame_Level.h | 12 +- src/xrEngine/IGame_ObjectPool.cpp | 19 +- src/xrEngine/IGame_ObjectPool.h | 10 +- src/xrEngine/IRenderable.h | 2 +- src/xrEngine/ISheduled.cpp | 2 +- src/xrEngine/ISheduled.h | 2 +- src/xrEngine/ObjectDump.cpp | 44 +- src/xrEngine/ObjectDump.h | 12 +- src/xrEngine/Rain.cpp | 4 +- src/xrEngine/cf_dynamic_mesh.cpp | 6 +- src/xrEngine/cf_dynamic_mesh.h | 2 +- src/xrEngine/pure_relcase.h | 2 +- src/xrEngine/thunderbolt.cpp | 2 +- src/xrEngine/x_ray.cpp | 10 +- src/xrEngine/xr_collide_form.cpp | 12 +- src/xrEngine/xr_collide_form.h | 20 +- src/xrEngine/xr_efflensflare.cpp | 9 +- src/xrEngine/xr_ioc_cmd.cpp | 1 + src/xrEngine/xr_object.cpp | 462 +--------------- src/xrEngine/xr_object.h | 475 ++++++++++------ src/xrEngine/xr_object_list.cpp | 79 ++- src/xrEngine/xr_object_list.h | 45 +- src/xrGame/ActivatingCharCollisionDelay.cpp | 2 +- src/xrGame/Actor.cpp | 12 +- src/xrGame/Actor.h | 30 +- src/xrGame/ActorCondition.cpp | 2 +- src/xrGame/ActorHelmet.cpp | 8 +- src/xrGame/ActorVehicle.cpp | 2 +- src/xrGame/Actor_Events.cpp | 10 +- src/xrGame/Actor_Feel.cpp | 32 +- src/xrGame/Actor_Movement.cpp | 2 +- src/xrGame/Actor_Network.cpp | 8 +- src/xrGame/Actor_Weapon.cpp | 4 +- src/xrGame/BastArtifact.cpp | 8 +- src/xrGame/BastArtifact.h | 6 +- src/xrGame/BlackDrops.cpp | 2 +- src/xrGame/BlackGraviArtifact.cpp | 14 +- src/xrGame/BlackGraviArtifact.h | 8 +- src/xrGame/Bolt.cpp | 2 +- src/xrGame/BreakableObject.cpp | 2 +- src/xrGame/CameraFirstEye.cpp | 2 +- src/xrGame/CameraFirstEye.h | 2 +- src/xrGame/CameraLook.cpp | 6 +- src/xrGame/CameraLook.h | 8 +- src/xrGame/Car.cpp | 10 +- src/xrGame/Car.h | 6 +- src/xrGame/CarInput.cpp | 2 +- src/xrGame/CharacterPhysicsSupport.cpp | 14 +- src/xrGame/CharacterPhysicsSupport.h | 8 +- src/xrGame/ClimableObject.cpp | 2 +- src/xrGame/CustomDetector.cpp | 2 +- src/xrGame/CustomDetector.h | 8 +- src/xrGame/CustomMonster.cpp | 24 +- src/xrGame/CustomMonster.h | 20 +- src/xrGame/CustomOutfit.cpp | 8 +- src/xrGame/CustomZone.cpp | 10 +- src/xrGame/CustomZone.h | 10 +- src/xrGame/DBG_Car.cpp | 4 +- src/xrGame/DestroyablePhysicsObject.cpp | 2 +- src/xrGame/Entity.cpp | 12 +- src/xrGame/Entity.h | 6 +- src/xrGame/EntityCondition.cpp | 2 +- src/xrGame/EntityCondition.h | 6 +- src/xrGame/Explosive.cpp | 8 +- src/xrGame/Explosive.h | 6 +- src/xrGame/ExplosiveItem.cpp | 4 +- src/xrGame/ExplosiveItem.h | 2 +- src/xrGame/ExplosiveRocket.cpp | 2 +- src/xrGame/ExplosiveRocket.h | 2 +- src/xrGame/GameObject.cpp | 510 ++++++++++++++--- src/xrGame/GameObject.h | 520 ++++++++++-------- src/xrGame/GamePersistent.cpp | 10 +- src/xrGame/GlobalFeelTouch.cpp | 6 +- src/xrGame/GlobalFeelTouch.hpp | 4 +- src/xrGame/GraviZone.cpp | 2 +- src/xrGame/GraviZone.h | 2 +- src/xrGame/Grenade.cpp | 2 +- src/xrGame/Grenade.h | 2 +- src/xrGame/HUDManager.cpp | 8 +- src/xrGame/HUDManager.h | 2 +- src/xrGame/HUDTarget.cpp | 4 +- src/xrGame/HUDTarget.h | 2 +- src/xrGame/HairsZone.cpp | 2 +- src/xrGame/HangingLamp.cpp | 2 +- src/xrGame/Helicopter.cpp | 2 +- src/xrGame/Helicopter2.cpp | 4 +- src/xrGame/Hit.cpp | 2 +- src/xrGame/Hit.h | 6 +- src/xrGame/HitMarker.cpp | 2 +- src/xrGame/HitMarker.h | 2 +- src/xrGame/HudSound.cpp | 6 +- src/xrGame/HudSound.h | 4 +- src/xrGame/Inventory.cpp | 6 +- src/xrGame/InventoryBox.cpp | 6 +- src/xrGame/InventoryBox.h | 2 +- src/xrGame/Level.cpp | 14 +- src/xrGame/Level.h | 6 +- src/xrGame/Level_Bullet_Manager.cpp | 2 +- src/xrGame/Level_Bullet_Manager.h | 4 +- src/xrGame/Level_bullet_manager_firetrace.cpp | 12 +- src/xrGame/Level_input.cpp | 8 +- src/xrGame/Level_network.cpp | 8 +- src/xrGame/Level_network_Demo.cpp | 6 +- src/xrGame/Level_network_Demo.h | 6 +- src/xrGame/Level_network_messages.cpp | 2 +- src/xrGame/Level_network_spawn.cpp | 2 +- src/xrGame/MPPlayersBag.cpp | 4 +- src/xrGame/Mincer.cpp | 8 +- src/xrGame/Mincer.h | 4 +- src/xrGame/Missile.cpp | 4 +- src/xrGame/Missile.h | 2 +- src/xrGame/PDA.cpp | 18 +- src/xrGame/PDA.h | 12 +- src/xrGame/PHDebug.cpp | 18 +- src/xrGame/PHDebug.h | 12 +- src/xrGame/PHMovementControl.cpp | 6 +- src/xrGame/PHMovementControl.h | 8 +- src/xrGame/PHScriptCall.h | 16 +- src/xrGame/ParticlesPlayer.cpp | 14 +- src/xrGame/ParticlesPlayer.h | 10 +- src/xrGame/PhysicsShellHolder.cpp | 2 +- src/xrGame/RadioactiveZone.cpp | 4 +- src/xrGame/RadioactiveZone.h | 4 +- src/xrGame/ShootingObject.cpp | 2 +- src/xrGame/ShootingObject.h | 2 +- src/xrGame/Spectator.cpp | 16 +- src/xrGame/Spectator.h | 4 +- src/xrGame/UIDialogHolder.cpp | 8 +- src/xrGame/Weapon.cpp | 4 +- src/xrGame/WeaponBinoculars.cpp | 2 +- src/xrGame/WeaponBinoculars.h | 2 +- src/xrGame/WeaponBinocularsVision.cpp | 10 +- src/xrGame/WeaponBinocularsVision.h | 6 +- src/xrGame/WeaponKnife.cpp | 10 +- src/xrGame/WeaponKnife.h | 4 +- src/xrGame/WeaponStatMgun.cpp | 2 +- src/xrGame/WeaponStatMgunFire.cpp | 2 +- src/xrGame/actor_memory.cpp | 2 +- src/xrGame/actor_memory.h | 2 +- src/xrGame/actor_mp_client.cpp | 4 +- src/xrGame/actor_mp_client.h | 2 +- src/xrGame/agent_corpse_manager.cpp | 6 +- src/xrGame/agent_corpse_manager.h | 2 +- src/xrGame/agent_enemy_manager.cpp | 6 +- src/xrGame/agent_enemy_manager.h | 2 +- src/xrGame/agent_explosive_manager.cpp | 2 +- src/xrGame/agent_explosive_manager.h | 4 +- src/xrGame/agent_location_manager.cpp | 2 +- src/xrGame/agent_location_manager.h | 6 +- src/xrGame/agent_location_manager_inline.h | 6 +- src/xrGame/agent_manager.cpp | 2 +- src/xrGame/agent_manager.h | 2 +- src/xrGame/agent_manager_planner.cpp | 2 +- src/xrGame/agent_manager_planner.h | 4 +- src/xrGame/agent_member_manager.cpp | 2 +- src/xrGame/agent_member_manager.h | 2 +- src/xrGame/agent_memory_manager.cpp | 4 +- src/xrGame/agent_memory_manager.h | 4 +- src/xrGame/ai/crow/ai_crow.cpp | 6 +- src/xrGame/ai/crow/ai_crow.h | 4 +- src/xrGame/ai/monsters/ai_monster_defs.h | 4 +- src/xrGame/ai/monsters/ai_monster_squad.cpp | 2 +- src/xrGame/ai/monsters/ai_monster_squad.h | 2 +- .../ai/monsters/ai_monster_squad_manager.cpp | 2 +- .../ai/monsters/ai_monster_squad_manager.h | 2 +- src/xrGame/ai/monsters/ai_monster_utils.cpp | 4 +- src/xrGame/ai/monsters/ai_monster_utils.h | 4 +- src/xrGame/ai/monsters/anomaly_detector.cpp | 2 +- src/xrGame/ai/monsters/anomaly_detector.h | 6 +- .../ai/monsters/basemonster/base_monster.cpp | 10 +- .../ai/monsters/basemonster/base_monster.h | 20 +- .../basemonster/base_monster_feel.cpp | 12 +- .../ai/monsters/bloodsucker/bloodsucker.cpp | 2 +- .../ai/monsters/bloodsucker/bloodsucker.h | 2 +- .../bloodsucker/bloodsucker_attack_state.h | 2 +- .../bloodsucker/bloodsucker_predator.h | 2 +- .../bloodsucker_state_capture_jump.h | 2 +- .../bloodsucker/bloodsucker_state_manager.h | 2 +- .../bloodsucker/bloodsucker_vampire.h | 2 +- .../bloodsucker_vampire_approach.h | 2 +- .../bloodsucker/bloodsucker_vampire_execute.h | 2 +- .../bloodsucker/bloodsucker_vampire_hide.h | 2 +- .../bloodsucker/bloodsucker_vampire_inline.h | 2 +- .../ai/monsters/boar/boar_state_manager.h | 2 +- src/xrGame/ai/monsters/burer/burer.cpp | 10 +- src/xrGame/ai/monsters/burer/burer.h | 6 +- .../ai/monsters/burer/burer_state_attack.h | 2 +- .../burer/burer_state_attack_antiaim.h | 2 +- .../monsters/burer/burer_state_attack_gravi.h | 2 +- .../burer/burer_state_attack_run_around.h | 2 +- .../burer/burer_state_attack_shield.h | 2 +- .../monsters/burer/burer_state_attack_tele.h | 6 +- .../burer/burer_state_attack_tele_inline.h | 2 +- .../ai/monsters/burer/burer_state_manager.h | 2 +- src/xrGame/ai/monsters/cat/cat.cpp | 2 +- .../ai/monsters/cat/cat_state_manager.h | 2 +- .../monsters/chimera/chimera_attack_state.h | 2 +- .../chimera/chimera_attack_state_inline.h | 2 +- .../monsters/chimera/chimera_state_manager.h | 2 +- .../monsters/chimera/chimera_state_threaten.h | 2 +- .../chimera/chimera_state_threaten_roar.h | 2 +- src/xrGame/ai/monsters/control_direction.cpp | 2 +- src/xrGame/ai/monsters/control_direction.h | 2 +- .../ai/monsters/control_direction_base.cpp | 2 +- .../ai/monsters/control_direction_base.h | 2 +- src/xrGame/ai/monsters/control_jump.cpp | 10 +- src/xrGame/ai/monsters/control_jump.h | 12 +- src/xrGame/ai/monsters/control_manager.h | 2 +- .../ai/monsters/control_manager_custom.cpp | 4 +- .../ai/monsters/control_manager_custom.h | 6 +- .../ai/monsters/controller/controller.cpp | 4 +- .../ai/monsters/controller/controller.h | 4 +- .../controller/controller_psy_hit.cpp | 2 +- .../controller/controller_state_attack.h | 2 +- .../controller/controller_state_attack_camp.h | 2 +- .../controller/controller_state_attack_hide.h | 2 +- .../controller_state_attack_hide_lite.h | 2 +- .../controller_state_attack_moveout.h | 2 +- .../controller/controller_state_manager.h | 2 +- src/xrGame/ai/monsters/dog/dog.cpp | 2 +- src/xrGame/ai/monsters/dog/dog.h | 2 +- .../ai/monsters/dog/dog_state_manager.h | 2 +- .../ai/monsters/flesh/flesh_state_manager.h | 2 +- .../fracture/fracture_state_manager.h | 2 +- .../group_states/group_state_attack.h | 2 +- .../group_states/group_state_attack_inline.h | 2 +- .../group_states/group_state_attack_run.h | 2 +- .../group_states/group_state_custom.h | 2 +- .../monsters/group_states/group_state_eat.h | 2 +- .../group_states/group_state_eat_drag.h | 2 +- .../group_states/group_state_eat_eat.h | 2 +- .../group_states/group_state_eat_eat_inline.h | 2 +- .../group_states/group_state_eat_inline.h | 2 +- .../group_state_hear_danger_sound.h | 2 +- .../group_state_home_point_attack.h | 2 +- .../monsters/group_states/group_state_panic.h | 2 +- .../group_states/group_state_panic_run.h | 2 +- .../monsters/group_states/group_state_rest.h | 2 +- .../group_states/group_state_rest_idle.h | 2 +- .../group_state_squad_move_to_radius.h | 4 +- .../ai/monsters/group_states/state_adapter.h | 2 +- .../ai/monsters/monster_corpse_manager.cpp | 2 +- .../ai/monsters/monster_corpse_manager.h | 2 +- .../ai/monsters/monster_corpse_memory.cpp | 2 +- .../ai/monsters/monster_corpse_memory.h | 2 +- .../ai/monsters/monster_enemy_manager.cpp | 2 +- .../ai/monsters/monster_enemy_manager.h | 2 +- .../ai/monsters/monster_enemy_memory.cpp | 2 +- src/xrGame/ai/monsters/monster_enemy_memory.h | 2 +- src/xrGame/ai/monsters/monster_hit_memory.cpp | 12 +- src/xrGame/ai/monsters/monster_hit_memory.h | 8 +- .../ai/monsters/monster_sound_memory.cpp | 10 +- src/xrGame/ai/monsters/monster_sound_memory.h | 10 +- .../ai/monsters/monster_state_manager.h | 2 +- .../ai/monsters/poltergeist/poltergeist.cpp | 4 +- .../ai/monsters/poltergeist/poltergeist.h | 16 +- .../poltergeist/poltergeist_ability.cpp | 2 +- .../poltergeist/poltergeist_flame_thrower.cpp | 6 +- .../poltergeist_state_attack_hidden.h | 2 +- .../poltergeist/poltergeist_state_manager.h | 2 +- .../poltergeist/poltergeist_telekinesis.cpp | 8 +- .../pseudodog/pseudodog_state_manager.h | 2 +- src/xrGame/ai/monsters/pseudodog/psy_dog.cpp | 8 +- src/xrGame/ai/monsters/pseudodog/psy_dog.h | 4 +- .../pseudodog/psy_dog_state_manager.h | 2 +- .../pseudodog/psy_dog_state_psy_attack.h | 2 +- .../pseudodog/psy_dog_state_psy_attack_hide.h | 2 +- .../ai/monsters/pseudogigant/pseudo_gigant.h | 2 +- .../pseudogigant/pseudogigant_state_manager.h | 2 +- src/xrGame/ai/monsters/psy_aura.h | 2 +- src/xrGame/ai/monsters/rats/ai_rat.cpp | 8 +- src/xrGame/ai/monsters/rats/ai_rat.h | 12 +- src/xrGame/ai/monsters/rats/ai_rat_feel.cpp | 6 +- src/xrGame/ai/monsters/rats/ai_rat_fire.cpp | 2 +- .../ai/monsters/rats/ai_rat_templates.cpp | 14 +- src/xrGame/ai/monsters/scanning_ability.h | 2 +- .../ai/monsters/scanning_ability_inline.h | 2 +- src/xrGame/ai/monsters/snork/snork.cpp | 4 +- src/xrGame/ai/monsters/snork/snork_jump.cpp | 4 +- src/xrGame/ai/monsters/snork/snork_jump.h | 2 +- .../ai/monsters/snork/snork_state_manager.h | 2 +- src/xrGame/ai/monsters/state.h | 2 +- src/xrGame/ai/monsters/state_inline.h | 2 +- src/xrGame/ai/monsters/state_manager.h | 2 +- .../ai/monsters/states/monster_state_attack.h | 2 +- .../states/monster_state_attack_camp.h | 2 +- .../monster_state_attack_camp_stealout.h | 2 +- .../states/monster_state_attack_melee.h | 2 +- .../states/monster_state_attack_on_run.h | 2 +- .../states/monster_state_attack_run.h | 2 +- .../states/monster_state_attack_run_attack.h | 2 +- .../states/monster_state_controlled.h | 2 +- .../states/monster_state_controlled_follow.h | 2 +- .../ai/monsters/states/monster_state_eat.h | 2 +- .../monsters/states/monster_state_eat_drag.h | 2 +- .../monsters/states/monster_state_eat_eat.h | 2 +- .../states/monster_state_eat_eat_inline.h | 2 +- .../states/monster_state_eat_inline.h | 2 +- .../states/monster_state_find_enemy.h | 2 +- .../states/monster_state_find_enemy_angry.h | 2 +- .../states/monster_state_find_enemy_look.h | 2 +- .../states/monster_state_find_enemy_run.h | 2 +- .../states/monster_state_find_enemy_walk.h | 2 +- .../states/monster_state_hear_danger_sound.h | 2 +- .../states/monster_state_hear_int_sound.h | 2 +- .../states/monster_state_help_sound.h | 2 +- .../ai/monsters/states/monster_state_hitted.h | 2 +- .../states/monster_state_hitted_hide.h | 2 +- .../states/monster_state_hitted_moveout.h | 2 +- .../states/monster_state_home_point_attack.h | 2 +- .../states/monster_state_home_point_danger.h | 2 +- .../states/monster_state_home_point_rest.h | 2 +- .../ai/monsters/states/monster_state_panic.h | 2 +- .../monsters/states/monster_state_panic_run.h | 2 +- .../ai/monsters/states/monster_state_rest.h | 2 +- .../monsters/states/monster_state_rest_fun.h | 2 +- .../monsters/states/monster_state_rest_idle.h | 2 +- .../states/monster_state_rest_sleep.h | 2 +- .../states/monster_state_rest_walk_graph.h | 2 +- .../states/monster_state_smart_terrain_task.h | 2 +- ...ster_state_smart_terrain_task_graph_walk.h | 2 +- .../states/monster_state_squad_rest.h | 2 +- .../states/monster_state_squad_rest_follow.h | 2 +- .../ai/monsters/states/monster_state_steal.h | 2 +- .../ai/monsters/states/state_custom_action.h | 2 +- .../states/state_custom_action_look.h | 2 +- .../monsters/states/state_hide_from_point.h | 2 +- .../ai/monsters/states/state_hit_object.h | 2 +- .../monsters/states/state_hit_object_inline.h | 6 +- .../ai/monsters/states/state_look_point.h | 2 +- .../states/state_look_unprotected_area.h | 2 +- .../ai/monsters/states/state_move_to_point.h | 4 +- .../states/state_move_to_restrictor.h | 2 +- .../monsters/states/state_test_look_actor.h | 2 +- .../ai/monsters/states/state_test_state.h | 4 +- src/xrGame/ai/monsters/telekinesis.cpp | 2 +- src/xrGame/ai/monsters/telekinesis.h | 4 +- src/xrGame/ai/monsters/telekinesis_inline.h | 2 +- .../tushkano/tushkano_state_manager.h | 2 +- src/xrGame/ai/monsters/zombie/zombie.cpp | 2 +- .../monsters/zombie/zombie_state_attack_run.h | 2 +- .../ai/monsters/zombie/zombie_state_manager.h | 2 +- src/xrGame/ai/phantom/phantom.cpp | 4 +- src/xrGame/ai/phantom/phantom.h | 6 +- src/xrGame/ai/stalker/ai_stalker.cpp | 4 +- src/xrGame/ai/stalker/ai_stalker.h | 34 +- src/xrGame/ai/stalker/ai_stalker_debug.cpp | 6 +- src/xrGame/ai/stalker/ai_stalker_events.cpp | 14 +- src/xrGame/ai/stalker/ai_stalker_feel.cpp | 10 +- src/xrGame/ai/stalker/ai_stalker_fire.cpp | 16 +- src/xrGame/ai/trader/ai_trader.cpp | 8 +- src/xrGame/ai/trader/ai_trader.h | 8 +- src/xrGame/attachment_owner.cpp | 2 +- src/xrGame/base_client_classes_script.cpp | 36 +- src/xrGame/base_client_classes_wrappers.h | 31 +- src/xrGame/best_scores_helper.h | 2 +- src/xrGame/car_memory.cpp | 2 +- src/xrGame/car_memory.h | 2 +- src/xrGame/character_shell_control.cpp | 2 +- src/xrGame/character_shell_control.h | 2 +- src/xrGame/client_spawn_manager.cpp | 6 +- src/xrGame/client_spawn_manager.h | 6 +- src/xrGame/console_commands.cpp | 6 +- src/xrGame/console_commands_mp.cpp | 6 +- src/xrGame/control_action.h | 2 +- src/xrGame/control_action_inline.h | 2 +- src/xrGame/damage_manager.cpp | 2 +- src/xrGame/damage_manager.h | 2 +- src/xrGame/danger_location.h | 4 +- src/xrGame/danger_location_inline.h | 2 +- src/xrGame/danger_manager.cpp | 6 +- src/xrGame/danger_manager.h | 2 +- src/xrGame/danger_object.h | 6 +- src/xrGame/danger_object_inline.h | 4 +- src/xrGame/danger_object_location.cpp | 2 +- src/xrGame/danger_object_location.h | 2 +- src/xrGame/death_anims_predicates.cpp | 6 +- src/xrGame/doors_manager.cpp | 2 +- src/xrGame/eatable_item_object.cpp | 2 +- src/xrGame/enemy_manager.cpp | 4 +- src/xrGame/enemy_manager.h | 2 +- src/xrGame/entity_alive.cpp | 4 +- src/xrGame/entity_alive.h | 4 +- src/xrGame/faster_than_bullets_time.cpp | 2 +- src/xrGame/game_cl_artefacthunt.cpp | 14 +- src/xrGame/game_cl_artefacthunt.h | 4 +- src/xrGame/game_cl_base.cpp | 4 +- src/xrGame/game_cl_base.h | 4 +- .../game_cl_base_weapon_usage_statistic.cpp | 14 +- src/xrGame/game_cl_capture_the_artefact.cpp | 8 +- src/xrGame/game_cl_capture_the_artefact.h | 2 +- ..._capture_the_artefact_captions_manager.cpp | 2 +- ..._cl_capture_the_artefact_messages_menu.cpp | 2 +- src/xrGame/game_cl_deathmatch.cpp | 10 +- src/xrGame/game_cl_deathmatch.h | 2 +- src/xrGame/game_cl_deathmatch_buywnd.cpp | 2 +- src/xrGame/game_cl_mp.cpp | 12 +- src/xrGame/game_cl_mp_messages_menu.cpp | 2 +- src/xrGame/game_cl_teamdeathmatch.cpp | 8 +- src/xrGame/game_events_handler.h | 2 +- src/xrGame/game_state_accumulator.cpp | 14 +- src/xrGame/game_state_accumulator.h | 4 +- src/xrGame/game_sv_artefacthunt.cpp | 6 +- src/xrGame/game_sv_base.cpp | 4 +- src/xrGame/game_sv_capture_the_artefact.cpp | 6 +- src/xrGame/game_sv_capture_the_artefact.h | 4 +- src/xrGame/game_sv_deathmatch.cpp | 8 +- src/xrGame/game_sv_deathmatch.h | 6 +- src/xrGame/game_sv_mp.cpp | 6 +- src/xrGame/harvest_time.cpp | 2 +- src/xrGame/helicopter.h | 6 +- src/xrGame/hit_memory_manager.cpp | 12 +- src/xrGame/hit_memory_manager.h | 8 +- src/xrGame/ik_foot_collider.cpp | 4 +- src/xrGame/imotion_position.cpp | 4 +- src/xrGame/inventory_item.cpp | 2 +- src/xrGame/inventory_owner_info.cpp | 2 +- src/xrGame/inventory_quickswitch.cpp | 2 +- src/xrGame/item_manager.cpp | 2 +- src/xrGame/item_manager.h | 2 +- src/xrGame/level_changer.cpp | 8 +- src/xrGame/level_changer.h | 4 +- src/xrGame/level_debug.cpp | 4 +- src/xrGame/level_debug.h | 8 +- src/xrGame/level_graph_debug2.cpp | 2 +- src/xrGame/map_location.cpp | 12 +- src/xrGame/map_spot.cpp | 2 +- src/xrGame/material_manager.cpp | 2 +- src/xrGame/material_manager.h | 4 +- src/xrGame/memory_manager.cpp | 12 +- src/xrGame/memory_manager.h | 12 +- src/xrGame/movement_manager.h | 2 +- src/xrGame/moving_object.cpp | 4 +- src/xrGame/moving_object.h | 6 +- src/xrGame/moving_objects.h | 6 +- src/xrGame/moving_objects_impl.h | 2 +- src/xrGame/moving_objects_static.cpp | 2 +- src/xrGame/object_handler_planner.cpp | 4 +- src/xrGame/object_handler_planner.h | 6 +- src/xrGame/object_handler_planner_impl.h | 2 +- src/xrGame/obstacles_query.cpp | 2 +- src/xrGame/obstacles_query.h | 2 +- src/xrGame/physic_item.cpp | 2 +- src/xrGame/player_hud.cpp | 2 +- src/xrGame/player_state_param.h | 2 +- src/xrGame/restricted_object.cpp | 2 +- src/xrGame/reward_event_generator.cpp | 2 +- src/xrGame/reward_event_generator.h | 2 +- src/xrGame/reward_event_handler.h | 2 +- src/xrGame/rewarding_events_handlers.cpp | 2 +- src/xrGame/rewarding_events_handlers.h | 2 +- src/xrGame/script_binder.cpp | 2 +- src/xrGame/script_binder.h | 2 +- src/xrGame/script_entity.cpp | 2 +- src/xrGame/script_entity.h | 2 +- src/xrGame/script_game_object.h | 2 +- src/xrGame/script_game_object2.cpp | 2 +- .../script_game_object_inventory_owner.cpp | 2 +- src/xrGame/script_monster_action.cpp | 2 +- src/xrGame/script_monster_action.h | 2 +- src/xrGame/script_movement_action.cpp | 2 +- src/xrGame/script_movement_action.h | 2 +- src/xrGame/script_object_action.cpp | 2 +- src/xrGame/script_object_action.h | 2 +- src/xrGame/script_watch_action.cpp | 2 +- src/xrGame/script_watch_action.h | 2 +- src/xrGame/script_zone.cpp | 14 +- src/xrGame/script_zone.h | 8 +- src/xrGame/sight_action.cpp | 6 +- src/xrGame/sight_action.h | 4 +- src/xrGame/sight_manager.cpp | 2 +- src/xrGame/sight_manager.h | 2 +- src/xrGame/sight_manager_target.cpp | 2 +- src/xrGame/smart_cover_object.h | 2 +- src/xrGame/sound_memory_manager.cpp | 16 +- src/xrGame/sound_memory_manager.h | 10 +- src/xrGame/sound_player.cpp | 2 +- src/xrGame/sound_player.h | 6 +- src/xrGame/space_restriction_composition.cpp | 2 +- src/xrGame/spectator_camera_first_eye.cpp | 2 +- src/xrGame/spectator_camera_first_eye.h | 2 +- src/xrGame/stalker_alife_actions.cpp | 2 +- src/xrGame/stalker_animation_script.h | 2 +- src/xrGame/stalker_animation_script_inline.h | 2 +- src/xrGame/stalker_anomaly_actions.cpp | 4 +- src/xrGame/stalker_kill_wounded_actions.cpp | 2 +- src/xrGame/stalker_movement_manager_base.cpp | 2 +- src/xrGame/stalker_movement_manager_base.h | 2 +- .../stalker_movement_manager_obstacles.cpp | 2 +- .../stalker_movement_manager_obstacles.h | 2 +- .../stalker_movement_manager_smart_cover.cpp | 2 +- .../stalker_movement_manager_smart_cover.h | 2 +- src/xrGame/static_obstacles_avoider.cpp | 2 +- src/xrGame/static_obstacles_avoider.h | 2 +- src/xrGame/team_base_zone.cpp | 6 +- src/xrGame/team_base_zone.h | 6 +- src/xrGame/trade.h | 2 +- src/xrGame/trajectories.cpp | 8 +- src/xrGame/trajectories.h | 4 +- src/xrGame/ui/UIActorMenuInventory.cpp | 2 +- src/xrGame/ui/UIHudStatesWnd.cpp | 2 +- src/xrGame/vision_client.cpp | 4 +- src/xrGame/vision_client.h | 8 +- src/xrGame/visual_memory_manager.cpp | 28 +- src/xrGame/visual_memory_manager.h | 16 +- src/xrGame/wallmark_manager.cpp | 2 +- src/xrGame/wallmark_manager.h | 2 +- src/xrGame/xrServer_svclient_validation.cpp | 2 +- src/xrPhysics/IColisiondamageInfo.h | 2 +- src/xrPhysics/PHCapture.cpp | 4 +- src/xrPhysics/PHObject.cpp | 9 +- src/xrPhysics/PHSimpleCharacter.cpp | 16 +- src/xrPhysics/PHSimpleCharacter.h | 2 +- src/xrPhysics/debug_output.cpp | 6 +- src/xrPhysics/debug_output.h | 6 +- src/xrServerEntities/smart_cast.h | 10 +- src/xrServerEntities/smart_cast_impl1.h | 2 +- src/xrServerEntities/smart_cast_impl2.h | 2 +- src/xrServerEntities/xrServer_Space.h | 2 +- src/xrSound/Sound.h | 28 +- src/xrSound/SoundRender_Core.cpp | 8 +- src/xrSound/SoundRender_Core.h | 8 +- 549 files changed, 2465 insertions(+), 2345 deletions(-) diff --git a/src/Layers/xrRender/LightTrack.cpp b/src/Layers/xrRender/LightTrack.cpp index e7898338b0f..1ac40159b01 100644 --- a/src/Layers/xrRender/LightTrack.cpp +++ b/src/Layers/xrRender/LightTrack.cpp @@ -183,7 +183,7 @@ void CROS_impl::update (IRenderable* O) VERIFY (dynamic_cast (O->renderable_ROS())); //float dt = Device.fTimeDelta; - CObject* _object = dynamic_cast (O); + IGameObject* _object = dynamic_cast (O); // select sample, randomize position inside object vis_data &vis = O->GetRenderData().visual->getVisData(); @@ -360,7 +360,7 @@ void CROS_impl::update_smooth (IRenderable* O) } } -void CROS_impl::calc_sun_value(Fvector& position, CObject* _object) +void CROS_impl::calc_sun_value(Fvector& position, IGameObject* _object) { #if RENDER==R_R1 @@ -377,7 +377,7 @@ void CROS_impl::calc_sun_value(Fvector& position, CObject* _object) } } -void CROS_impl::calc_sky_hemi_value(Fvector& position, CObject* _object) +void CROS_impl::calc_sky_hemi_value(Fvector& position, IGameObject* _object) { // hemi-tracing if (MODE & IRender_ObjectSpecific::TRACE_HEMI) @@ -419,7 +419,7 @@ void CROS_impl::calc_sky_hemi_value(Fvector& position, CObject* _object) void CROS_impl::prepare_lights(Fvector& position, IRenderable* O) { - CObject* _object = dynamic_cast (O); + IGameObject* _object = dynamic_cast (O); float dt = Device.fTimeDelta; vis_data &vis = O->GetRenderData().visual->getVisData(); diff --git a/src/Layers/xrRender/LightTrack.h b/src/Layers/xrRender/LightTrack.h index c7dccd3289b..92e7fbe842a 100644 --- a/src/Layers/xrRender/LightTrack.h +++ b/src/Layers/xrRender/LightTrack.h @@ -111,10 +111,10 @@ class CROS_impl : public IRender_ObjectSpecific static inline void accum_hemi(float* hemi_cube, Fvector3& dir, float scale); //Calculates sun part of ambient occlusion - void calc_sun_value(Fvector& position, CObject* _object); + void calc_sun_value(Fvector& position, IGameObject* _object); //Calculates sky part of ambient occlusion - void calc_sky_hemi_value(Fvector& position, CObject* _object); + void calc_sky_hemi_value(Fvector& position, IGameObject* _object); //prepares static or hemisphere lights for ambient occlusion calculations void prepare_lights(Fvector& position, IRenderable* O); diff --git a/src/Layers/xrRenderDX10/3DFluid/dx103DFluidObstacles.cpp b/src/Layers/xrRenderDX10/3DFluid/dx103DFluidObstacles.cpp index 50f97149a5b..ba6645d4935 100644 --- a/src/Layers/xrRenderDX10/3DFluid/dx103DFluidObstacles.cpp +++ b/src/Layers/xrRenderDX10/3DFluid/dx103DFluidObstacles.cpp @@ -204,7 +204,7 @@ void dx103DFluidObstacles::ProcessDynamicObstacles( const dx103DFluidData &Fluid // renderable //IRenderable* renderable = spatial->dcast_Renderable (); //if (0==renderable) continue; // unknown, but renderable object (r1_glow???) - CObject* pObject = spatial->dcast_CObject(); + IGameObject* pObject = spatial->dcast_GameObject(); if (!pObject) continue; const IObjectPhysicsCollision* pCollision = pObject->physics_collision(); diff --git a/src/Layers/xrRenderPC_R1/FStaticRender.cpp b/src/Layers/xrRenderPC_R1/FStaticRender.cpp index 6cb2719baba..342dc30b08d 100644 --- a/src/Layers/xrRenderPC_R1/FStaticRender.cpp +++ b/src/Layers/xrRenderPC_R1/FStaticRender.cpp @@ -266,7 +266,7 @@ void CRender::set_Object (IRenderable* O ) VERIFY (g_bRendering); val_pObject = O; // NULL is OK, trust me :) if (val_pObject) { - VERIFY(dynamic_cast(O)||dynamic_cast(O)); + VERIFY(dynamic_cast(O)||dynamic_cast(O)); if (O->GetRenderData().pROS) { VERIFY(dynamic_cast(O->GetRenderData().pROS)); } } if (PHASE_NORMAL==phase) { @@ -288,7 +288,7 @@ void CRender::apply_object (IRenderable* O ) if (0==O) return ; if (PHASE_NORMAL==phase && O->renderable_ROS()) { CROS_impl& LT = *((CROS_impl*)O->GetRenderData().pROS); - VERIFY(dynamic_cast(O)||dynamic_cast(O)); + VERIFY(dynamic_cast(O)||dynamic_cast(O)); VERIFY(dynamic_cast(O->GetRenderData().pROS)); float o_hemi = 0.5f*LT.get_hemi (); float o_sun = 0.5f*LT.get_sun (); @@ -445,7 +445,7 @@ void CRender::Calculate () if (lstRenderables.size()) uID_LTRACK = uLastLTRACK%lstRenderables.size(); // update light-vis for current entity / actor - CObject* O = g_pGameLevel->CurrentViewEntity(); + IGameObject* O = g_pGameLevel->CurrentViewEntity(); if (O) { CROS_impl* R = (CROS_impl*) O->ROS(); if (R) R->update (O); diff --git a/src/Layers/xrRenderPC_R1/GlowManager.cpp b/src/Layers/xrRenderPC_R1/GlowManager.cpp index fb5de1b0cc3..abf76fb78bd 100644 --- a/src/Layers/xrRenderPC_R1/GlowManager.cpp +++ b/src/Layers/xrRenderPC_R1/GlowManager.cpp @@ -197,7 +197,7 @@ void CGlowManager::Render () void CGlowManager::render_sw () { // 0. save main view and disable - CObject* o_main = g_pGameLevel->CurrentViewEntity(); + IGameObject* o_main = g_pGameLevel->CurrentViewEntity(); // 1. Test some number of glows Fvector start = Device.vCameraPosition; diff --git a/src/Layers/xrRenderPC_R1/LightProjector.cpp b/src/Layers/xrRenderPC_R1/LightProjector.cpp index 32d4234de83..53add8bad38 100644 --- a/src/Layers/xrRenderPC_R1/LightProjector.cpp +++ b/src/Layers/xrRenderPC_R1/LightProjector.cpp @@ -80,7 +80,7 @@ void CLightProjector::set_object (IRenderable* O) else { spatial->spatial_updatesector (); if (0==spatial->GetSpatialData().sector) { - CObject* obj = dynamic_cast(O); + IGameObject* obj = dynamic_cast(O); if (obj) Msg ("! Invalid object '%s' position. Outside of sector structure.",obj->cName().c_str()); current = 0; } @@ -218,7 +218,7 @@ void CLightProjector::calculate () v.sub (v_Cs,v_C);; #ifdef DEBUG if ((v.x*v.x+v.y*v.y+v.z*v.z)<=flt_zero) { - CObject* OO = dynamic_cast(R.O); + IGameObject* OO = dynamic_cast(R.O); Msg("Object[%s] Visual[%s] has invalid position. ",*OO->cName(),*OO->cNameVisual()); Fvector cc; OO->Center(cc); diff --git a/src/Layers/xrRenderPC_R2/r2_R_render.cpp b/src/Layers/xrRenderPC_R2/r2_R_render.cpp index 2e09e3ae2b5..6e05e7f8f8b 100644 --- a/src/Layers/xrRenderPC_R2/r2_R_render.cpp +++ b/src/Layers/xrRenderPC_R2/r2_R_render.cpp @@ -42,7 +42,7 @@ void CRender::render_main (Fmatrix& m_ViewProjection, bool _fportals) if (lstRenderables.size()) uID_LTRACK = uLastLTRACK%lstRenderables.size(); // update light-vis for current entity / actor - CObject* O = g_pGameLevel->CurrentViewEntity(); + IGameObject* O = g_pGameLevel->CurrentViewEntity(); if (O) { CROS_impl* R = (CROS_impl*) O->ROS(); if (R) R->update (O); diff --git a/src/Layers/xrRenderPC_R3/r3_R_render.cpp b/src/Layers/xrRenderPC_R3/r3_R_render.cpp index 5cc3e8d28ae..cf065201e5a 100644 --- a/src/Layers/xrRenderPC_R3/r3_R_render.cpp +++ b/src/Layers/xrRenderPC_R3/r3_R_render.cpp @@ -44,7 +44,7 @@ void CRender::render_main (Fmatrix& m_ViewProjection, bool _fportals) if (lstRenderables.size()) uID_LTRACK = uLastLTRACK%lstRenderables.size(); // update light-vis for current entity / actor - CObject* O = g_pGameLevel->CurrentViewEntity(); + IGameObject* O = g_pGameLevel->CurrentViewEntity(); if (O) { CROS_impl* R = (CROS_impl*) O->ROS(); if (R) R->update (O); diff --git a/src/Layers/xrRenderPC_R4/r4_R_render.cpp b/src/Layers/xrRenderPC_R4/r4_R_render.cpp index ca3015e1b42..0b72cca4ab3 100644 --- a/src/Layers/xrRenderPC_R4/r4_R_render.cpp +++ b/src/Layers/xrRenderPC_R4/r4_R_render.cpp @@ -45,7 +45,7 @@ void CRender::render_main (Fmatrix& m_ViewProjection, bool _fportals) if (lstRenderables.size()) uID_LTRACK = uLastLTRACK%lstRenderables.size(); // update light-vis for current entity / actor - CObject* O = g_pGameLevel->CurrentViewEntity(); + IGameObject* O = g_pGameLevel->CurrentViewEntity(); if (O) { CROS_impl* R = (CROS_impl*) O->ROS(); if (R) R->update (O); diff --git a/src/xrCDB/ISpatial.cpp b/src/xrCDB/ISpatial.cpp index b4ee8c38a48..71e8e22d339 100644 --- a/src/xrCDB/ISpatial.cpp +++ b/src/xrCDB/ISpatial.cpp @@ -260,7 +260,7 @@ void ISpatial_DB::insert (ISpatial* S) BOOL bValid = _valid(S->GetSpatialData().sphere.R) && _valid(S->GetSpatialData().sphere.P); if (!bValid) { - CObject* O = dynamic_cast(S); + IGameObject* O = dynamic_cast(S); if (O) Debug.fatal(DEBUG_INFO,"Invalid OBJECT position or radius (%s)",O->cName().c_str()); else { CPS_Instance* P = dynamic_cast(S); diff --git a/src/xrCDB/ISpatial.h b/src/xrCDB/ISpatial.h index 8834ff5e86f..469d4a17c4e 100644 --- a/src/xrCDB/ISpatial.h +++ b/src/xrCDB/ISpatial.h @@ -58,7 +58,7 @@ enum ////////////////////////////////////////////////////////////////////////// // Fast type conversion -//class CObject; +//class IGameObject; //class IRenderable; //class IRender_Light; // @@ -68,6 +68,7 @@ enum class ISpatial_NODE; class IRender_Sector; class ISpatial_DB; +class IGameObject; namespace Feel { class Sound; } class IRenderable; class IRender_Light; @@ -95,7 +96,7 @@ class ISpatial virtual void spatial_move() = 0; virtual Fvector spatial_sector_point() = 0; virtual void spatial_updatesector() = 0; - virtual CObject *dcast_CObject() = 0; + virtual IGameObject *dcast_GameObject() = 0; virtual Feel::Sound *dcast_FeelSound() = 0; virtual IRenderable *dcast_Renderable() = 0; virtual IRender_Light *dcast_Light() = 0; @@ -103,7 +104,7 @@ class ISpatial inline ISpatial::~ISpatial() {} -class XRCDB_API SpatialBase : public ISpatial +class XRCDB_API SpatialBase : public virtual ISpatial { public: SpatialData spatial; @@ -125,7 +126,7 @@ class XRCDB_API SpatialBase : public ISpatial spatial_updatesector_internal () ; } - virtual CObject *dcast_CObject() override { return 0; } + virtual IGameObject *dcast_GameObject() override { return 0; } virtual Feel::Sound *dcast_FeelSound() override { return 0; } virtual IRenderable *dcast_Renderable() override { return 0; } virtual IRender_Light *dcast_Light() override { return 0; } diff --git a/src/xrCDB/xr_area.cpp b/src/xrCDB/xr_area.cpp index ed0510c1909..4415c83077d 100644 --- a/src/xrCDB/xr_area.cpp +++ b/src/xrCDB/xr_area.cpp @@ -46,7 +46,7 @@ CObjectSpace::~CObjectSpace ( ) //---------------------------------------------------------------------- //---------------------------------------------------------------------- -int CObjectSpace::GetNearest ( xr_vector& q_spatial, xr_vector& q_nearest, const Fvector &point, float range, CObject* ignore_object ) +int CObjectSpace::GetNearest ( xr_vector& q_spatial, xr_vector& q_nearest, const Fvector &point, float range, IGameObject* ignore_object ) { q_spatial.clear_not_free ( ); // Query objects @@ -59,7 +59,7 @@ int CObjectSpace::GetNearest ( xr_vector& q_spatial, xr_vector::iterator it = q_spatial.begin (); xr_vector::iterator end = q_spatial.end (); for (; it!=end; it++) { - CObject* O = (*it)->dcast_CObject (); + IGameObject* O = (*it)->dcast_GameObject (); if (0==O) continue; if (O==ignore_object) continue; Fsphere mS = { O->GetSpatialData().sphere.P, O->GetSpatialData().sphere.R }; @@ -70,7 +70,7 @@ int CObjectSpace::GetNearest ( xr_vector& q_spatial, xr_vector& q_nearest, const Fvector &point, float range, CObject* ignore_object ) +IC int CObjectSpace::GetNearest ( xr_vector& q_nearest, const Fvector &point, float range, IGameObject* ignore_object ) { return ( GetNearest( @@ -84,9 +84,9 @@ IC int CObjectSpace::GetNearest ( xr_vector& q_nearest, const Fvector } //---------------------------------------------------------------------- -IC int CObjectSpace::GetNearest( xr_vector& q_nearest, ICollisionForm* obj, float range) +IC int CObjectSpace::GetNearest( xr_vector& q_nearest, ICollisionForm* obj, float range) { - CObject* O = obj->Owner (); + IGameObject* O = obj->Owner (); return GetNearest( q_nearest, O->GetSpatialData().sphere.P, range + O->GetSpatialData().sphere.R, O ); } diff --git a/src/xrCDB/xr_area.h b/src/xrCDB/xr_area.h index 5fbeeb75646..fb7e3124f15 100644 --- a/src/xrCDB/xr_area.h +++ b/src/xrCDB/xr_area.h @@ -7,7 +7,7 @@ // refs class ISpatial; class ICollisionForm; -class CObject; +class IGameObject; #include "Include/xrRender/FactoryPtr.h" #include "Include/xrRender/ObjectSpaceRender.h" @@ -39,11 +39,11 @@ class XRCDB_API CObjectSpace #endif private: - BOOL _RayTest ( const Fvector &start, const Fvector &dir, float range, collide::rq_target tgt, collide::ray_cache* cache, CObject* ignore_object); - BOOL _RayPick ( const Fvector &start, const Fvector &dir, float range, collide::rq_target tgt, collide::rq_result& R, CObject* ignore_object ); - BOOL _RayQuery ( collide::rq_results& dest, const collide::ray_defs& rq, collide::rq_callback* cb, LPVOID user_data, collide::test_callback* tb, CObject* ignore_object); - BOOL _RayQuery2 ( collide::rq_results& dest, const collide::ray_defs& rq, collide::rq_callback* cb, LPVOID user_data, collide::test_callback* tb, CObject* ignore_object); - BOOL _RayQuery3 ( collide::rq_results& dest, const collide::ray_defs& rq, collide::rq_callback* cb, LPVOID user_data, collide::test_callback* tb, CObject* ignore_object); + BOOL _RayTest ( const Fvector &start, const Fvector &dir, float range, collide::rq_target tgt, collide::ray_cache* cache, IGameObject* ignore_object); + BOOL _RayPick ( const Fvector &start, const Fvector &dir, float range, collide::rq_target tgt, collide::rq_result& R, IGameObject* ignore_object ); + BOOL _RayQuery ( collide::rq_results& dest, const collide::ray_defs& rq, collide::rq_callback* cb, LPVOID user_data, collide::test_callback* tb, IGameObject* ignore_object); + BOOL _RayQuery2 ( collide::rq_results& dest, const collide::ray_defs& rq, collide::rq_callback* cb, LPVOID user_data, collide::test_callback* tb, IGameObject* ignore_object); + BOOL _RayQuery3 ( collide::rq_results& dest, const collide::ray_defs& rq, collide::rq_callback* cb, LPVOID user_data, collide::test_callback* tb, IGameObject* ignore_object); public: CObjectSpace ( ); ~CObjectSpace ( ); @@ -53,13 +53,13 @@ class XRCDB_API CObjectSpace void Load ( IReader* R, CDB::build_callback build_callback ); void Create ( Fvector* verts, CDB::TRI* tris, const hdrCFORM &H, CDB::build_callback build_callback ); // Occluded/No - BOOL RayTest ( const Fvector &start, const Fvector &dir, float range, collide::rq_target tgt, collide::ray_cache* cache, CObject* ignore_object); + BOOL RayTest ( const Fvector &start, const Fvector &dir, float range, collide::rq_target tgt, collide::ray_cache* cache, IGameObject* ignore_object); // Game raypick (nearest) - returns object and addititional params - BOOL RayPick ( const Fvector &start, const Fvector &dir, float range, collide::rq_target tgt, collide::rq_result& R, CObject* ignore_object ); + BOOL RayPick ( const Fvector &start, const Fvector &dir, float range, collide::rq_target tgt, collide::rq_result& R, IGameObject* ignore_object ); // General collision query - BOOL RayQuery ( collide::rq_results& dest, const collide::ray_defs& rq, collide::rq_callback* cb, LPVOID user_data, collide::test_callback* tb, CObject* ignore_object); + BOOL RayQuery ( collide::rq_results& dest, const collide::ray_defs& rq, collide::rq_callback* cb, LPVOID user_data, collide::test_callback* tb, IGameObject* ignore_object); BOOL RayQuery ( collide::rq_results& dest, ICollisionForm* target, const collide::ray_defs& rq); bool BoxQuery ( Fvector const & box_center, @@ -68,9 +68,9 @@ class XRCDB_API CObjectSpace Fvector const & box_sizes, xr_vector * out_tris ); - int GetNearest ( xr_vector& q_nearest, ICollisionForm *obj, float range ); - int GetNearest ( xr_vector& q_nearest, const Fvector &point, float range, CObject* ignore_object ); - int GetNearest ( xr_vector& q_spatial, xr_vector& q_nearest, const Fvector &point, float range, CObject* ignore_object ); + int GetNearest ( xr_vector& q_nearest, ICollisionForm *obj, float range ); + int GetNearest ( xr_vector& q_nearest, const Fvector &point, float range, IGameObject* ignore_object ); + int GetNearest ( xr_vector& q_spatial, xr_vector& q_nearest, const Fvector &point, float range, IGameObject* ignore_object ); CDB::TRI* GetStaticTris () { return Static.get_tris(); } Fvector* GetStaticVerts () { return Static.get_verts(); } diff --git a/src/xrCDB/xr_area_query.cpp b/src/xrCDB/xr_area_query.cpp index 6636a02e8f2..cf6f030153b 100644 --- a/src/xrCDB/xr_area_query.cpp +++ b/src/xrCDB/xr_area_query.cpp @@ -88,7 +88,7 @@ void CObjectSpace::BoxQuery (collide::rq_results& r_dest, const Fbox& B, const F for (u32 o_it=0; o_itdcast_CObject (); + IGameObject* collidable = spatial->dcast_GameObject (); if (0==collidable) continue; collidable->collidable.model->_BoxQuery (B,M,flags); } diff --git a/src/xrCDB/xr_area_raypick.cpp b/src/xrCDB/xr_area_raypick.cpp index 108c348a655..f36cf101fbc 100644 --- a/src/xrCDB/xr_area_raypick.cpp +++ b/src/xrCDB/xr_area_raypick.cpp @@ -21,7 +21,7 @@ using namespace collide; //-------------------------------------------------------------------------------- // RayTest - Occluded/No //-------------------------------------------------------------------------------- -BOOL CObjectSpace::RayTest ( const Fvector &start, const Fvector &dir, float range, collide::rq_target tgt, collide::ray_cache* cache, CObject* ignore_object) +BOOL CObjectSpace::RayTest ( const Fvector &start, const Fvector &dir, float range, collide::rq_target tgt, collide::ray_cache* cache, IGameObject* ignore_object) { lock.Enter (); BOOL _ret = _RayTest(start,dir,range,tgt,cache,ignore_object); @@ -29,7 +29,7 @@ BOOL CObjectSpace::RayTest ( const Fvector &start, const Fvector &dir, float ran lock.Leave (); return _ret; } -BOOL CObjectSpace::_RayTest ( const Fvector &start, const Fvector &dir, float range, collide::rq_target tgt, collide::ray_cache* cache, CObject* ignore_object) +BOOL CObjectSpace::_RayTest ( const Fvector &start, const Fvector &dir, float range, collide::rq_target tgt, collide::ray_cache* cache, IGameObject* ignore_object) { VERIFY (_abs(dir.magnitude()-1)dcast_CObject (); + IGameObject* collidable = spatial->dcast_GameObject (); if (collidable && (collidable!=ignore_object)) { ECollisionFormType tp = collidable->GetCForm()->Type(); if ((tgt&(rqtObject|rqtObstacle))&&(tp==cftObject)&&collidable->GetCForm()->_RayQuery(Q,r_temp)) return TRUE; @@ -98,7 +98,7 @@ BOOL CObjectSpace::_RayTest ( const Fvector &start, const Fvector &dir, float ra //-------------------------------------------------------------------------------- // RayPick //-------------------------------------------------------------------------------- -BOOL CObjectSpace::RayPick ( const Fvector &start, const Fvector &dir, float range, rq_target tgt, rq_result& R, CObject* ignore_object) +BOOL CObjectSpace::RayPick ( const Fvector &start, const Fvector &dir, float range, rq_target tgt, rq_result& R, IGameObject* ignore_object) { lock.Enter (); BOOL _res = _RayPick(start,dir,range,tgt,R,ignore_object); @@ -106,7 +106,7 @@ BOOL CObjectSpace::RayPick ( const Fvector &start, const Fvector &dir, float ran lock.Leave (); return _res; } -BOOL CObjectSpace::_RayPick ( const Fvector &start, const Fvector &dir, float range, rq_target tgt, rq_result& R, CObject* ignore_object) +BOOL CObjectSpace::_RayPick ( const Fvector &start, const Fvector &dir, float range, rq_target tgt, rq_result& R, IGameObject* ignore_object) { r_temp.r_clear (); R.O = 0; R.range = range; R.element = -1; @@ -125,7 +125,7 @@ BOOL CObjectSpace::_RayPick ( const Fvector &start, const Fvector &dir, float ra // Determine visibility for dynamic part of scene for (u32 o_it=0; o_itdcast_CObject(); + IGameObject* collidable = spatial->dcast_GameObject(); if (0==collidable) continue; if (collidable==ignore_object) continue; ECollisionFormType tp = collidable->GetCForm()->Type(); @@ -152,7 +152,7 @@ BOOL CObjectSpace::_RayPick ( const Fvector &start, const Fvector &dir, float ra //-------------------------------------------------------------------------------- // RayQuery //-------------------------------------------------------------------------------- -BOOL CObjectSpace::RayQuery (collide::rq_results& dest, const collide::ray_defs& R, collide::rq_callback* CB, LPVOID user_data, collide::test_callback* tb, CObject* ignore_object) +BOOL CObjectSpace::RayQuery (collide::rq_results& dest, const collide::ray_defs& R, collide::rq_callback* CB, LPVOID user_data, collide::test_callback* tb, IGameObject* ignore_object) { lock.Enter (); BOOL _res = _RayQuery2(dest,R,CB,user_data,tb,ignore_object); @@ -160,7 +160,7 @@ BOOL CObjectSpace::RayQuery (collide::rq_results& dest, const collide::ray_defs lock.Leave (); return (_res); } -BOOL CObjectSpace::_RayQuery2 (collide::rq_results& r_dest, const collide::ray_defs& R, collide::rq_callback* CB, LPVOID user_data, collide::test_callback* tb, CObject* ignore_object) +BOOL CObjectSpace::_RayQuery2 (collide::rq_results& r_dest, const collide::ray_defs& R, collide::rq_callback* CB, LPVOID user_data, collide::test_callback* tb, IGameObject* ignore_object) { // initialize query r_dest.r_clear (); @@ -188,7 +188,7 @@ BOOL CObjectSpace::_RayQuery2 (collide::rq_results& r_dest, const collide::ray_d // Traverse object database g_SpatialSpace->q_ray (r_spatial,0,d_flags,R.start,R.dir,R.range); for (u32 o_it=0; o_itdcast_CObject(); + IGameObject* collidable = r_spatial[o_it]->dcast_GameObject(); if (0==collidable) continue; if (collidable==ignore_object) continue; ICollisionForm* cform = collidable->GetCForm(); @@ -212,7 +212,7 @@ BOOL CObjectSpace::_RayQuery2 (collide::rq_results& r_dest, const collide::ray_d return r_dest.r_count(); } -BOOL CObjectSpace::_RayQuery3 (collide::rq_results& r_dest, const collide::ray_defs& R, collide::rq_callback* CB, LPVOID user_data, collide::test_callback* tb, CObject* ignore_object) +BOOL CObjectSpace::_RayQuery3 (collide::rq_results& r_dest, const collide::ray_defs& R, collide::rq_callback* CB, LPVOID user_data, collide::test_callback* tb, IGameObject* ignore_object) { // initialize query r_dest.r_clear (); @@ -255,7 +255,7 @@ BOOL CObjectSpace::_RayQuery3 (collide::rq_results& r_dest, const collide::ray_d // Traverse object database g_SpatialSpace->q_ray (r_spatial,0,d_flags,d_rd.start,d_rd.dir,d_rd.range); for (u32 o_it=0; o_itdcast_CObject(); + IGameObject* collidable = r_spatial[o_it]->dcast_GameObject(); if (0==collidable) continue; if (collidable==ignore_object) continue; ICollisionForm* cform = collidable->GetCForm(); @@ -289,7 +289,7 @@ BOOL CObjectSpace::_RayQuery3 (collide::rq_results& r_dest, const collide::ray_d return r_dest.r_count() ; } -BOOL CObjectSpace::_RayQuery (collide::rq_results& r_dest, const collide::ray_defs& R, collide::rq_callback* CB, LPVOID user_data, collide::test_callback* tb, CObject* ignore_object) +BOOL CObjectSpace::_RayQuery (collide::rq_results& r_dest, const collide::ray_defs& R, collide::rq_callback* CB, LPVOID user_data, collide::test_callback* tb, IGameObject* ignore_object) { #ifdef DEBUG if (R.rangeq_ray (r_spatial,0,d_flags,d_rd.start,d_rd.dir,d_rd.range); // Determine visibility for dynamic part of scene for (u32 o_it=0; o_itdcast_CObject(); + IGameObject* collidable = r_spatial[o_it]->dcast_GameObject(); if (0==collidable) continue; if (collidable==ignore_object) continue; ICollisionForm* cform = collidable->GetCForm(); diff --git a/src/xrCDB/xr_collide_defs.h b/src/xrCDB/xr_collide_defs.h index 51dd783e465..bd9d2132070 100644 --- a/src/xrCDB/xr_collide_defs.h +++ b/src/xrCDB/xr_collide_defs.h @@ -4,7 +4,7 @@ #include "xrcdb.h" -class CObject; +class IGameObject; namespace collide { struct tri { @@ -81,10 +81,10 @@ namespace collide }; struct rq_result { - CObject* O; // if NULL - static + IGameObject* O; // if NULL - static float range; // range to intersection int element; // номер кости/номер треугольника - IC rq_result& set (CObject* _O, float _range, int _element) + IC rq_result& set (IGameObject* _O, float _range, int _element) { O = _O; range = _range; @@ -93,7 +93,7 @@ namespace collide } IC BOOL set_if_less (CDB::RESULT* I){if (I->rangerange,I->id); return TRUE;}else return FALSE;} IC BOOL set_if_less (rq_result* R){if (R->rangeO,R->range,R->element); return TRUE;}else return FALSE;} - IC BOOL set_if_less (CObject* _who, float _range, int _element) { if (_range=0);} }; DEFINE_VECTOR (rq_result,rqVec,rqIt); @@ -104,7 +104,7 @@ namespace collide rqVec results; static bool r_sort_pred (const rq_result& a, const rq_result& b) { return a.rangeObjectSpace.GetNearest(q_nearest, C, R, NULL); - xr_vector::iterator n_begin = q_nearest.begin(); - xr_vector::iterator n_end = q_nearest.end(); + xr_vector::iterator n_begin = q_nearest.begin(); + xr_vector::iterator n_end = q_nearest.end(); if (n_end != n_begin) { // Process results (NEW) - for (xr_vector::iterator it = n_begin; it != n_end; it++) + for (xr_vector::iterator it = n_begin; it != n_end; it++) { - CObject* O = *it; + IGameObject* O = *it; if (O->getDestroy()) continue; // Don't touch candidates for destroy if (!feel_touch_contact(O)) continue; // Actual contact @@ -73,7 +73,7 @@ void Touch::feel_touch_update(Fvector& C, float R) // Process results (DELETE) for (int d = 0; dgetDestroy() || !feel_touch_contact(O) || (std::find(n_begin, n_end, O) == n_end)) // Don't touch candidates for destroy { // _delete_ @@ -86,9 +86,9 @@ void Touch::feel_touch_update(Fvector& C, float R) //. Engine.Sheduler.Slice (); } -void Touch::feel_touch_relcase(CObject* O) +void Touch::feel_touch_relcase(IGameObject* O) { - xr_vector::iterator I = std::find(feel_touch.begin(), feel_touch.end(), O); + xr_vector::iterator I = std::find(feel_touch.begin(), feel_touch.end(), O); if (I != feel_touch.end()) { feel_touch.erase(I); diff --git a/src/xrEngine/Feel_Touch.h b/src/xrEngine/Feel_Touch.h index 6d58dc5f322..6960b8d107e 100644 --- a/src/xrEngine/Feel_Touch.h +++ b/src/xrEngine/Feel_Touch.h @@ -2,7 +2,7 @@ #include "pure_relcase.h" -class ENGINE_API CObject; +class ENGINE_API IGameObject; namespace Feel { class ENGINE_API Touch : private pure_relcase @@ -11,27 +11,27 @@ class ENGINE_API Touch : private pure_relcase public: struct DenyTouch { - CObject* O; + IGameObject* O; DWORD Expire; }; protected: xr_vector feel_touch_disable; public: - xr_vector feel_touch; - xr_vector q_nearest; + xr_vector feel_touch; + xr_vector q_nearest; public: - void __stdcall feel_touch_relcase(CObject* O); + void __stdcall feel_touch_relcase(IGameObject* O); public: Touch(); virtual ~Touch(); - virtual bool feel_touch_contact(CObject* O); + virtual bool feel_touch_contact(IGameObject* O); virtual void feel_touch_update(Fvector& P, float R); - virtual void feel_touch_deny(CObject* O, DWORD T); - virtual void feel_touch_new(CObject* O) { }; - virtual void feel_touch_delete(CObject* O) { }; + virtual void feel_touch_deny(IGameObject* O, DWORD T); + virtual void feel_touch_new(IGameObject* O) { }; + virtual void feel_touch_delete(IGameObject* O) { }; }; }; diff --git a/src/xrEngine/Feel_Vision.cpp b/src/xrEngine/Feel_Vision.cpp index eaec226aa12..0ddaba55956 100644 --- a/src/xrEngine/Feel_Vision.cpp +++ b/src/xrEngine/Feel_Vision.cpp @@ -9,7 +9,7 @@ namespace Feel { -Vision::Vision(CObject const* owner) : +Vision::Vision(IGameObject const* owner) : pure_relcase(&Vision::feel_vision_relcase), m_owner(owner) { @@ -42,7 +42,7 @@ IC BOOL feel_vision_callback(collide::rq_result& result, LPVOID params) } return (fp->vis > fp->vis_threshold); } -void Vision::o_new(CObject* O) +void Vision::o_new(IGameObject* O) { feel_visible.push_back(feel_visible_Item()); feel_visible_Item& I = feel_visible.back(); @@ -55,7 +55,7 @@ void Vision::o_new(CObject* O) I.cp_LP = O->get_new_local_point_on_mesh(I.bone_id); I.cp_LAST = O->get_last_local_point_on_mesh(I.cp_LP, I.bone_id); } -void Vision::o_delete(CObject* O) +void Vision::o_delete(IGameObject* O) { xr_vector::iterator I = feel_visible.begin(), TE = feel_visible.end(); for (; I != TE; I++) @@ -74,9 +74,9 @@ void Vision::feel_vision_clear() feel_visible.clear(); } -void Vision::feel_vision_relcase(CObject* object) +void Vision::feel_vision_relcase(IGameObject* object) { - xr_vector::iterator Io; + xr_vector::iterator Io; Io = std::find(seen.begin(), seen.end(), object); if (Io != seen.end()) seen.erase(Io); Io = std::find(query.begin(), query.end(), object); @@ -107,28 +107,28 @@ void Vision::feel_vision_query(Fmatrix& mFull, Fvector& P) for (u32 o_it = 0; o_it < r_spatial.size(); o_it++) { ISpatial* spatial = r_spatial[o_it]; - CObject* object = spatial->dcast_CObject(); + IGameObject* object = spatial->dcast_GameObject(); if (object && feel_vision_isRelevant(object)) seen.push_back(object); } if (seen.size()>1) { std::sort(seen.begin(), seen.end()); - xr_vector::iterator end = std::unique(seen.begin(), seen.end()); + xr_vector::iterator end = std::unique(seen.begin(), seen.end()); if (end != seen.end()) seen.erase(end, seen.end()); } } -void Vision::feel_vision_update(CObject* parent, Fvector& P, float dt, float vis_threshold) +void Vision::feel_vision_update(IGameObject* parent, Fvector& P, float dt, float vis_threshold) { // B-A = objects, that become visible if (!seen.empty()) { - xr_vector::iterator E = std::remove(seen.begin(), seen.end(), parent); + xr_vector::iterator E = std::remove(seen.begin(), seen.end(), parent); seen.resize(E - seen.begin()); { diff.resize(_max(seen.size(), query.size())); - xr_vector::iterator E = std::set_difference( + xr_vector::iterator E = std::set_difference( seen.begin(), seen.end(), query.begin(), query.end(), diff.begin()); @@ -142,7 +142,7 @@ void Vision::feel_vision_update(CObject* parent, Fvector& P, float dt, float vis if (!query.empty()) { diff.resize(_max(seen.size(), query.size())); - xr_vector::iterator E = std::set_difference( + xr_vector::iterator E = std::set_difference( query.begin(), query.end(), seen.begin(), seen.end(), diff.begin()); @@ -238,7 +238,7 @@ void Vision::o_trace(Fvector& P, float dt, float vis_threshold) if (*i == I->O) continue; - CObject const* object = (*i)->dcast_CObject(); + IGameObject const* object = (*i)->dcast_GameObject(); RQR.r_clear(); if (object && object->GetCForm() && !object->GetCForm()->_RayQuery(RD, RQR)) continue; diff --git a/src/xrEngine/Feel_Vision.h b/src/xrEngine/Feel_Vision.h index 30849745b89..85b91a4ce83 100644 --- a/src/xrEngine/Feel_Vision.h +++ b/src/xrEngine/Feel_Vision.h @@ -5,7 +5,7 @@ #include "pure_relcase.h" class IRender_Sector; -class CObject; +class IGameObject; class ISpatial; namespace Feel @@ -19,18 +19,18 @@ class ENGINE_API Vision : private pure_relcase { friend class pure_relcase; private: - xr_vector seen; - xr_vector query; - xr_vector diff; + xr_vector seen; + xr_vector query; + xr_vector diff; collide::rq_results RQR; xr_vector r_spatial; - CObject const* m_owner; + IGameObject const* m_owner; - void o_new(CObject* E); - void o_delete(CObject* E); + void o_new(IGameObject* E); + void o_delete(IGameObject* E); void o_trace(Fvector& P, float dt, float vis_threshold); public: - Vision(CObject const* owner); + Vision(IGameObject const* owner); virtual ~Vision(); struct feel_visible_Item { @@ -39,7 +39,7 @@ class ENGINE_API Vision : private pure_relcase Fvector cp_LR_src; Fvector cp_LR_dst; Fvector cp_LAST; // last point found to be visible - CObject* O; + IGameObject* O; float fuzzy; // note range: (-1[no]..1[yes]) float Cache_vis; u16 bone_id; @@ -48,15 +48,15 @@ class ENGINE_API Vision : private pure_relcase public: void feel_vision_clear(); void feel_vision_query(Fmatrix& mFull, Fvector& P); - void feel_vision_update(CObject* parent, Fvector& P, float dt, float vis_threshold); - void __stdcall feel_vision_relcase(CObject* object); - void feel_vision_get(xr_vector& R) + void feel_vision_update(IGameObject* parent, Fvector& P, float dt, float vis_threshold); + void __stdcall feel_vision_relcase(IGameObject* object); + void feel_vision_get(xr_vector& R) { R.clear(); xr_vector::iterator I = feel_visible.begin(), E = feel_visible.end(); for (; I != E; I++) if (positive(I->fuzzy)) R.push_back(I->O); } - Fvector feel_vision_get_vispoint(CObject* _O) + Fvector feel_vision_get_vispoint(IGameObject* _O) { xr_vector::iterator I = feel_visible.begin(), E = feel_visible.end(); for (; I != E; I++) if (_O == I->O) @@ -67,7 +67,7 @@ class ENGINE_API Vision : private pure_relcase VERIFY2(0, "There is no such object in the potentially visible list"); return Fvector().set(flt_max, flt_max, flt_max); } - virtual bool feel_vision_isRelevant(CObject* O) = 0; - virtual float feel_vision_mtl_transp(CObject* O, u32 element) = 0; + virtual bool feel_vision_isRelevant(IGameObject* O) = 0; + virtual float feel_vision_mtl_transp(IGameObject* O, u32 element) = 0; }; }; diff --git a/src/xrEngine/ICollidable.h b/src/xrEngine/ICollidable.h index 9393168b875..55fb3143926 100644 --- a/src/xrEngine/ICollidable.h +++ b/src/xrEngine/ICollidable.h @@ -11,8 +11,8 @@ class ICollidable }; inline ICollidable::~ICollidable() {} -// XXX: merge into CObject -class ENGINE_API CollidableBase : public ICollidable +// XXX: merge into IGameObject +class ENGINE_API CollidableBase : public virtual ICollidable { public: CollidableBase(); diff --git a/src/xrEngine/IGame_Level.cpp b/src/xrEngine/IGame_Level.cpp index 892cd97725a..9c82c57c122 100644 --- a/src/xrEngine/IGame_Level.cpp +++ b/src/xrEngine/IGame_Level.cpp @@ -11,6 +11,7 @@ #include "CameraManager.h" #include "xr_object.h" #include "Feel_Sound.h" +#include "xrServerEntities/smart_cast.h" ENGINE_API IGame_Level* g_pGameLevel = NULL; extern BOOL g_bLoaded; @@ -111,7 +112,7 @@ bool IGame_Level::Load(u32 dwNum) // HUD + Environment if (!g_hud) - g_hud = (CCustomHUD*)NEW_INSTANCE(CLSID_HUDMANAGER); + g_hud = smart_cast(NEW_INSTANCE(CLSID_HUDMANAGER)); // Render-level Load GlobalEnv.Render->level_Load(LL_Stream); @@ -229,7 +230,7 @@ void CServerInfo::AddItem(shared_str& name_, LPCSTR value_, u32 color_) } } -void IGame_Level::SetEntity(CObject* O) +void IGame_Level::SetEntity(IGameObject* O) { if (pCurrentEntity) pCurrentEntity->On_LostEntity(); @@ -240,7 +241,7 @@ void IGame_Level::SetEntity(CObject* O) pCurrentEntity = pCurrentViewEntity = O; } -void IGame_Level::SetViewEntity(CObject* O) +void IGame_Level::SetViewEntity(IGameObject* O) { if (pCurrentViewEntity) pCurrentViewEntity->On_LostEntity(); @@ -284,7 +285,7 @@ void IGame_Level::SoundEvent_Register(ref_sound_data_ptr S, float range) { Feel::Sound* L = (*it)->dcast_FeelSound(); if (0 == L) continue; - CObject* CO = (*it)->dcast_CObject(); + IGameObject* CO = (*it)->dcast_GameObject(); VERIFY(CO); if (CO->getDestroy()) continue; diff --git a/src/xrEngine/IGame_Level.h b/src/xrEngine/IGame_Level.h index 44b4a8f97d7..57e3a29c40d 100644 --- a/src/xrEngine/IGame_Level.h +++ b/src/xrEngine/IGame_Level.h @@ -48,8 +48,8 @@ class ENGINE_API IGame_Level : { protected: // Network interface - CObject* pCurrentEntity; - CObject* pCurrentViewEntity; + IGameObject* pCurrentEntity; + IGameObject* pCurrentViewEntity; // Static sounds xr_vector Sounds_Random; @@ -102,10 +102,10 @@ class ENGINE_API IGame_Level : virtual void net_StartPlayDemo() = 0; // Main interface - CObject* CurrentEntity(void) const { return pCurrentEntity; } - CObject* CurrentViewEntity(void) const { return pCurrentViewEntity; } - void SetEntity(CObject* O);// { pCurrentEntity=pCurrentViewEntity=O; } - void SetViewEntity(CObject* O);// { pCurrentViewEntity=O; } + IGameObject* CurrentEntity(void) const { return pCurrentEntity; } + IGameObject* CurrentViewEntity(void) const { return pCurrentViewEntity; } + void SetEntity(IGameObject* O);// { pCurrentEntity=pCurrentViewEntity=O; } + void SetViewEntity(IGameObject* O);// { pCurrentViewEntity=O; } void SoundEvent_Register(ref_sound_data_ptr S, float range); void SoundEvent_Dispatch(); diff --git a/src/xrEngine/IGame_ObjectPool.cpp b/src/xrEngine/IGame_ObjectPool.cpp index 9368e3ed7f0..8cdcab1f309 100644 --- a/src/xrEngine/IGame_ObjectPool.cpp +++ b/src/xrEngine/IGame_ObjectPool.cpp @@ -3,6 +3,7 @@ #include "IGame_Persistent.h" #include "IGame_ObjectPool.h" #include "xr_object.h" +#include "xrServerEntities/smart_cast.h" IGame_ObjectPool::IGame_ObjectPool(void) { @@ -29,7 +30,7 @@ void IGame_ObjectPool::prefetch() const CInifile::Item& item = *I; CLASS_ID CLS = pSettings->r_clsid(item.first.c_str(), "class"); p_count++; - CObject* pObject = (CObject*)NEW_INSTANCE(CLS); + IGameObject* pObject = smart_cast(NEW_INSTANCE(CLS)); pObject->Load(item.first.c_str()); VERIFY2(pObject->cNameSect().c_str(), item.first.c_str()); m_PrefetchObjects.push_back(pObject); @@ -49,16 +50,16 @@ void IGame_ObjectPool::clear() m_PrefetchObjects.clear(); } -CObject* IGame_ObjectPool::create(LPCSTR name) +IGameObject* IGame_ObjectPool::create(LPCSTR name) { CLASS_ID CLS = pSettings->r_clsid(name, "class"); - CObject* O = (CObject*)NEW_INSTANCE(CLS); + IGameObject* O = smart_cast(NEW_INSTANCE(CLS)); O->cNameSect_set(name); O->Load(name); return O; } -void IGame_ObjectPool::destroy(CObject* O) +void IGame_ObjectPool::destroy(IGameObject* O) { xr_delete(O); } @@ -85,7 +86,7 @@ count += (count==0)?1:0; R_ASSERT2 ((count>0) && (count<=128), "Too many objects for prefetching"); p_count += count; for (int c=0; cLoad (item.first.c_str()); VERIFY2 (pObject->cNameSect().c_str(),item.first.c_str()); map_POOL.insert (mk_pair(pObject->cNameSect(),pObject)); @@ -113,27 +114,27 @@ xr_delete (it->second); map_POOL.clear(); } -CObject* IGame_ObjectPool::create ( LPCSTR name ) +IGameObject* IGame_ObjectPool::create ( LPCSTR name ) { string256 l_name; POOL_IT it = map_POOL.find (shared_str(strlwr(xr_strcpy(l_name,name)))); if (it!=map_POOL.end()) { // Instance found -CObject* O = it->second; +IGameObject* O = it->second; map_POOL.erase (it); return O; } else { // Create and load _new instance // Msg ("! Uncached loading '%s'...",name); CLASS_ID CLS = pSettings->r_clsid (name,"class"); -CObject* O = (CObject*) NEW_INSTANCE (CLS); +IGameObject* O = (IGameObject*) NEW_INSTANCE (CLS); O->Load (name); return O; } } -void IGame_ObjectPool::destroy ( CObject* O ) +void IGame_ObjectPool::destroy ( IGameObject* O ) { map_POOL.insert (mk_pair(O->cNameSect(),O)); } diff --git a/src/xrEngine/IGame_ObjectPool.h b/src/xrEngine/IGame_ObjectPool.h index da912a4a808..afd4165a9de 100644 --- a/src/xrEngine/IGame_ObjectPool.h +++ b/src/xrEngine/IGame_ObjectPool.h @@ -1,7 +1,7 @@ #pragma once // refs -class ENGINE_API CObject; +class ENGINE_API IGameObject; //----------------------------------------------------------------------------------------------------------- class ENGINE_API IGame_ObjectPool @@ -13,20 +13,20 @@ class ENGINE_API IGame_ObjectPool IC bool operator()(const shared_str& x, const shared_str& y) const { return xr_strcmp(x,y)<0; } }; - typedef xr_multimap POOL; + typedef xr_multimap POOL; typedef POOL::iterator POOL_IT; private: POOL map_POOL; */ - typedef xr_vector ObjectVec; + typedef xr_vector ObjectVec; typedef ObjectVec::iterator ObjectVecIt; ObjectVec m_PrefetchObjects; public: void prefetch(); void clear(); - CObject* create(LPCSTR name); - void destroy(CObject* O); + IGameObject* create(LPCSTR name); + void destroy(IGameObject* O); IGame_ObjectPool(); virtual ~IGame_ObjectPool(); diff --git a/src/xrEngine/IRenderable.h b/src/xrEngine/IRenderable.h index e549d128d44..82552a9aaea 100644 --- a/src/xrEngine/IRenderable.h +++ b/src/xrEngine/IRenderable.h @@ -28,7 +28,7 @@ class IRenderable inline IRenderable::~IRenderable() {} -class ENGINE_API RenderableBase : public IRenderable +class ENGINE_API RenderableBase : public virtual IRenderable { public: RenderData renderable; diff --git a/src/xrEngine/ISheduled.cpp b/src/xrEngine/ISheduled.cpp index f4ec374aa58..8d602b28768 100644 --- a/src/xrEngine/ISheduled.cpp +++ b/src/xrEngine/ISheduled.cpp @@ -44,7 +44,7 @@ void ScheduledBase::shedule_Update(u32 dt) if (shedule.dbg_startframe == shedule.dbg_update_shedule) { LPCSTR name = "unknown"; - CObject* O = dynamic_cast (this); + IGameObject* O = dynamic_cast (this); if (O) name = *O->cName(); Debug.fatal(DEBUG_INFO, "'shedule_Update' called twice per frame for %s", name); } diff --git a/src/xrEngine/ISheduled.h b/src/xrEngine/ISheduled.h index ced648345b4..cceb2b8ff7c 100644 --- a/src/xrEngine/ISheduled.h +++ b/src/xrEngine/ISheduled.h @@ -28,7 +28,7 @@ class ISheduled inline ISheduled::~ISheduled() {} -class ENGINE_API ScheduledBase : public ISheduled +class ENGINE_API ScheduledBase : public virtual ISheduled { public: SchedulerData shedule; diff --git a/src/xrEngine/ObjectDump.cpp b/src/xrEngine/ObjectDump.cpp index bcef6745c76..ca56b425175 100644 --- a/src/xrEngine/ObjectDump.cpp +++ b/src/xrEngine/ObjectDump.cpp @@ -3,7 +3,7 @@ #ifdef DEBUG #include "ObjectDump.h" -ENGINE_API std::string dbg_object_base_dump_string(const CObject* obj) +ENGINE_API std::string dbg_object_base_dump_string(const IGameObject* obj) { if (!obj) return make_string("object: NULL ptr"); @@ -13,7 +13,7 @@ ENGINE_API std::string dbg_object_base_dump_string(const CObject* obj) obj->Visual() ? obj->cNameVisual().c_str() : "none"); } -ENGINE_API std::string dbg_object_poses_dump_string(const CObject* obj) +ENGINE_API std::string dbg_object_poses_dump_string(const IGameObject* obj) { if (!obj) return std::string(""); @@ -22,14 +22,14 @@ ENGINE_API std::string dbg_object_poses_dump_string(const CObject* obj) std::string buf(""); for (u32 i = 0; i < ps_size; ++i) { - const CObject::SavedPosition& svp = obj->ps_Element(i); + const GameObjectSavedPosition& svp = obj->ps_Element(i); buf += (make_string(" \n %d, time: %d pos: %s ", i, svp.dwTime, get_string(svp.vPosition).c_str())); } return make_string("\n XFORM: %s \n position stack : %s \n, ", get_string(obj->XFORM()).c_str(), buf.c_str()); } -ENGINE_API std::string dbg_object_visual_geom_dump_string(const CObject* obj) +ENGINE_API std::string dbg_object_visual_geom_dump_string(const IGameObject* obj) { if (!obj || !obj->Visual()) return std::string(""); @@ -60,23 +60,33 @@ ENGINE_API std::string dbg_object_visual_geom_dump_string(const CObject* obj) u32 dwFrame_UpdateCL; u32 dwFrame_AsCrow; */ -ENGINE_API std::string dbg_object_props_dump_string(const CObject* obj) +ENGINE_API std::string dbg_object_props_dump_string(const IGameObject* obj) { if (!obj) return std::string(""); - CObject::ObjectProperties props; + GameObjectProperties props; obj->DBGGetProps(props); - - return make_string(" net_ID :%d, bActiveCounter :%d, bEnabled :%s, bVisible :%s, bDestroy :%s, \n net_Local %s, net_Ready :%s, net_SV_Update :%s, crow :%s, bPreDestroy : %s ", - props.net_ID, props.bActiveCounter, get_string(bool(!!props.bEnabled)).c_str(), get_string(bool(!!props.bVisible)).c_str(), - get_string(bool(!!props.bDestroy)).c_str(), get_string(bool(!!props.net_Local)).c_str(), get_string(bool(!!props.net_Ready)).c_str(), - get_string(bool(!!props.net_SV_Update)).c_str(), get_string(bool(!!props.crow)).c_str(), get_string(bool(!!props.bPreDestroy)).c_str() - ) - + - make_string("\n dbg_update_cl: %d, dwFrame_UpdateCL: %d, dwFrame_AsCrow :%d, Device.dwFrame :%d, Device.dwTimeGlobal: %d \n", - obj->dbg_update_cl, obj->dwFrame_UpdateCL, obj->dwFrame_AsCrow, Device.dwFrame, Device.dwTimeGlobal); + const char *format = " " + "net_ID :%d, bActiveCounter :%d, bEnabled :%s, bVisible :%s, bDestroy :%s, \n " + "net_Local %s, net_Ready :%s, net_SV_Update :%s, crow :%s, bPreDestroy : %s \n " + "dbg_update_cl: %d, dwFrame_UpdateCL: %d, dwFrame_AsCrow :%d, Device.dwFrame :%d, Device.dwTimeGlobal: %d \n"; + auto enabled = get_string(bool(!!props.bEnabled)).c_str(); + auto visible = get_string(bool(!!props.bVisible)).c_str(); + auto destroy = get_string(bool(!!props.bDestroy)).c_str(); + auto netLocal = get_string(bool(!!props.net_Local)).c_str(); + auto netReady = get_string(bool(!!props.net_Ready)).c_str(); + auto netSvUpdate = get_string(bool(!!props.net_SV_Update)).c_str(); + auto crow = get_string(bool(!!props.crow)).c_str(); + auto preDestroy = get_string(bool(!!props.bPreDestroy)).c_str(); + auto updateFrameDbg = obj->GetDbgUpdateFrame(); + auto updateFrame = obj->GetUpdateFrame(); + auto updateFrameCrow = obj->GetCrowUpdateFrame(); + return make_string(format, + props.net_ID, props.bActiveCounter, enabled, visible, destroy, + netLocal, netReady, netSvUpdate, crow, preDestroy, + updateFrameDbg, updateFrame, updateFrameCrow, Device.dwFrame, Device.dwTimeGlobal); } -ENGINE_API std::string dbg_object_full_dump_string(const CObject* obj) +ENGINE_API std::string dbg_object_full_dump_string(const IGameObject* obj) { return dbg_object_base_dump_string(obj) + dbg_object_props_dump_string(obj) + @@ -84,7 +94,7 @@ ENGINE_API std::string dbg_object_full_dump_string(const CObject* obj) dbg_object_visual_geom_dump_string(obj); } -ENGINE_API std::string dbg_object_full_capped_dump_string(const CObject* obj) +ENGINE_API std::string dbg_object_full_capped_dump_string(const IGameObject* obj) { return std::string("\n object dump: \n") + dbg_object_full_dump_string(obj); diff --git a/src/xrEngine/ObjectDump.h b/src/xrEngine/ObjectDump.h index e9f7bfdfa0b..275074f68a9 100644 --- a/src/xrEngine/ObjectDump.h +++ b/src/xrEngine/ObjectDump.h @@ -1,10 +1,10 @@ #pragma once #ifdef DEBUG -ENGINE_API std::string dbg_object_base_dump_string(const CObject* obj); -ENGINE_API std::string dbg_object_poses_dump_string(const CObject* obj); -ENGINE_API std::string dbg_object_visual_geom_dump_string(const CObject* obj); -ENGINE_API std::string dbg_object_props_dump_string(const CObject* obj); -ENGINE_API std::string dbg_object_full_dump_string(const CObject* obj); -ENGINE_API std::string dbg_object_full_capped_dump_string(const CObject* obj); +ENGINE_API std::string dbg_object_base_dump_string(const IGameObject* obj); +ENGINE_API std::string dbg_object_poses_dump_string(const IGameObject* obj); +ENGINE_API std::string dbg_object_visual_geom_dump_string(const IGameObject* obj); +ENGINE_API std::string dbg_object_props_dump_string(const IGameObject* obj); +ENGINE_API std::string dbg_object_full_dump_string(const IGameObject* obj); +ENGINE_API std::string dbg_object_full_capped_dump_string(const IGameObject* obj); #endif \ No newline at end of file diff --git a/src/xrEngine/Rain.cpp b/src/xrEngine/Rain.cpp index bdffb6242b2..ce8ddfbedaf 100644 --- a/src/xrEngine/Rain.cpp +++ b/src/xrEngine/Rain.cpp @@ -100,7 +100,7 @@ BOOL CEffect_Rain::RayPick(const Fvector& s, const Fvector& d, float& range, col Tools->RayPick (s,d,range); #else collide::rq_result RQ; - CObject* E = g_pGameLevel->CurrentViewEntity(); + IGameObject* E = g_pGameLevel->CurrentViewEntity(); bRes = g_pGameLevel->ObjectSpace.RayPick(s, d, range, tgt, RQ, E); if (bRes) range = RQ.range; #endif @@ -138,7 +138,7 @@ void CEffect_Rain::OnFrame() float factor = g_pGamePersistent->Environment().CurrentEnv->rain_density; static float hemi_factor = 0.f; #ifndef _EDITOR - CObject* E = g_pGameLevel->CurrentViewEntity(); + IGameObject* E = g_pGameLevel->CurrentViewEntity(); if (E&&E->renderable_ROS()) { // hemi_factor = 1.f-2.0f*(0.3f-_min(_min(1.f,E->renderable_ROS()->get_luminocity_hemi()),0.3f)); diff --git a/src/xrEngine/cf_dynamic_mesh.cpp b/src/xrEngine/cf_dynamic_mesh.cpp index be5a5a7c37f..dafcfe654f4 100644 --- a/src/xrEngine/cf_dynamic_mesh.cpp +++ b/src/xrEngine/cf_dynamic_mesh.cpp @@ -25,10 +25,10 @@ BOOL CCF_DynamicMesh::_RayQuery(const collide::ray_defs& Q, collide::rq_results& struct spick { const collide::ray_defs& Q; - const CObject& obj; + const IGameObject& obj; IKinematics& K; - spick(const collide::ray_defs& Q_, const CObject& obj_, IKinematics& K_) : Q(Q_), obj(obj_), K(K_) + spick(const collide::ray_defs& Q_, const IGameObject& obj_, IKinematics& K_) : Q(Q_), obj(obj_), K(K_) { } @@ -54,7 +54,7 @@ BOOL CCF_DynamicMesh::_RayQuery(const collide::ray_defs& Q, collide::rq_results& } private: spick& operator = (spick&) { NODEFAULT; return *this; } - } pick((collide::ray_defs&) (Q), (const CObject&)(*owner), (IKinematics&)(*K)); + } pick((collide::ray_defs&) (Q), (const IGameObject&)(*owner), (IKinematics&)(*K)); R.r_results().erase(std::remove_if(R.r_results().begin() + s_count, R.r_results().end(), pick), R.r_results().end()); /* diff --git a/src/xrEngine/cf_dynamic_mesh.h b/src/xrEngine/cf_dynamic_mesh.h index 683f250cba7..43d9c45872d 100644 --- a/src/xrEngine/cf_dynamic_mesh.h +++ b/src/xrEngine/cf_dynamic_mesh.h @@ -8,7 +8,7 @@ class ENGINE_API CCF_DynamicMesh : { typedef CCF_Skeleton inherited; public: - CCF_DynamicMesh(CObject* _owner) :CCF_Skeleton(_owner) {}; + CCF_DynamicMesh(IGameObject* _owner) :CCF_Skeleton(_owner) {}; virtual BOOL _RayQuery(const collide::ray_defs& Q, collide::rq_results& R); }; \ No newline at end of file diff --git a/src/xrEngine/pure_relcase.h b/src/xrEngine/pure_relcase.h index da86cbaa655..9b5548491a9 100644 --- a/src/xrEngine/pure_relcase.h +++ b/src/xrEngine/pure_relcase.h @@ -7,7 +7,7 @@ class ENGINE_API pure_relcase int m_ID; public: template - pure_relcase(void (xr_stdcall class_type::* function_to_bind)(CObject*)) + pure_relcase(void (xr_stdcall class_type::* function_to_bind)(IGameObject*)) { R_ASSERT(g_pGameLevel); class_type* self = static_cast(this); diff --git a/src/xrEngine/thunderbolt.cpp b/src/xrEngine/thunderbolt.cpp index ae08fa8ee31..96db648c0f0 100644 --- a/src/xrEngine/thunderbolt.cpp +++ b/src/xrEngine/thunderbolt.cpp @@ -162,7 +162,7 @@ BOOL CEffect_Thunderbolt::RayPick(const Fvector& s, const Fvector& d, float& dis bRes = Tools->RayPick(s, d, dist, 0, 0); #else collide::rq_result RQ; - CObject* E = g_pGameLevel->CurrentViewEntity(); + IGameObject* E = g_pGameLevel->CurrentViewEntity(); bRes = g_pGameLevel->ObjectSpace.RayPick(s, d, dist, collide::rqtBoth, RQ, E); if (bRes) dist = RQ.range; else diff --git a/src/xrEngine/x_ray.cpp b/src/xrEngine/x_ray.cpp index e0b4773fe91..c7168c89454 100644 --- a/src/xrEngine/x_ray.cpp +++ b/src/xrEngine/x_ray.cpp @@ -24,6 +24,7 @@ #include #include "xrSASH.h" +#include "xrServerEntities/smart_cast.h" //--------------------------------------------------------------------- ENGINE_API CInifile* pGameIni = NULL; @@ -363,7 +364,8 @@ void Startup() //#endif LALib.OnCreate(); pApp = xr_new(); - g_pGamePersistent = (IGame_Persistent*)NEW_INSTANCE(CLSID_GAME_PERSISTANT); + g_pGamePersistent = smart_cast(NEW_INSTANCE(CLSID_GAME_PERSISTANT)); + VERIFY(g_pGamePersistent); g_SpatialSpace = xr_new("Spatial obj"); g_SpatialSpacePhysic = xr_new("Spatial phys"); @@ -1027,7 +1029,8 @@ void CApplication::OnEvent(EVENT E, u64 P1, u64 P2) //----------------------------------------------------------- g_pGamePersistent->PreStart(op_server); //----------------------------------------------------------- - g_pGameLevel = (IGame_Level*)NEW_INSTANCE(CLSID_GAME_LEVEL); + g_pGameLevel = smart_cast(NEW_INSTANCE(CLSID_GAME_LEVEL)); + VERIFY(g_pGameLevel); pApp->LoadBegin(); g_pGamePersistent->Start(op_server); g_pGameLevel->net_Start(op_server, op_client); @@ -1074,7 +1077,8 @@ void CApplication::OnEvent(EVENT E, u64 P1, u64 P2) Console->Hide(); Device.Reset(false); - g_pGameLevel = (IGame_Level*)NEW_INSTANCE(CLSID_GAME_LEVEL); + g_pGameLevel = smart_cast(NEW_INSTANCE(CLSID_GAME_LEVEL)); + VERIFY(g_pGameLevel); shared_str server_options = g_pGameLevel->OpenDemoFile(demo_file); //----------------------------------------------------------- diff --git a/src/xrEngine/xr_collide_form.cpp b/src/xrEngine/xr_collide_form.cpp index 434468c63ac..202f6cbb455 100644 --- a/src/xrEngine/xr_collide_form.cpp +++ b/src/xrEngine/xr_collide_form.cpp @@ -26,7 +26,7 @@ using namespace collide; // Class : CXR_CFObject // Purpose : stores collision form //---------------------------------------------------------------------- -ICollisionForm::ICollisionForm(CObject* _owner, ECollisionFormType tp) +ICollisionForm::ICollisionForm(IGameObject* _owner, ECollisionFormType tp) { owner = _owner; m_type = tp; @@ -108,7 +108,7 @@ IC bool RAYvsCYLINDER(const Fcylinder& c_cylinder, const Fvector& S, const Fvect return ((rp_res == Fcylinder::rpOriginOutside) || (!bCull && (rp_res == Fcylinder::rpOriginInside))); } -CCF_Skeleton::CCF_Skeleton(CObject* O) : ICollisionForm(O, cftObject) +CCF_Skeleton::CCF_Skeleton(IGameObject* O) : ICollisionForm(O, cftObject) { //getVisData IRenderVisual* pVisual = O->Visual(); @@ -278,7 +278,7 @@ BOOL CCF_Skeleton::_RayQuery(const collide::ray_defs& Q, collide::rq_results& R) } //---------------------------------------------------------------------------------- -CCF_EventBox::CCF_EventBox(CObject* O) : ICollisionForm(O, cftShape) +CCF_EventBox::CCF_EventBox(IGameObject* O) : ICollisionForm(O, cftShape) { Fvector A[8], B[8]; A[0].set(-1, -1, -1); @@ -310,7 +310,7 @@ CCF_EventBox::CCF_EventBox(CObject* O) : ICollisionForm(O, cftShape) Planes[5].build(B[1], B[0], B[6]); } -BOOL CCF_EventBox::Contact(CObject* O) +BOOL CCF_EventBox::Contact(IGameObject* O) { IRenderVisual* V = O->Visual(); vis_data& vis = V->getVisData(); @@ -338,7 +338,7 @@ void CCF_EventBox::_BoxQuery(const Fbox& B, const Fmatrix& M, u32 flags) //---------------------------------------------------------------------------------- //---------------------------------------------------------------------------------- //---------------------------------------------------------------------------------- -CCF_Shape::CCF_Shape(CObject* _owner) : ICollisionForm(_owner, cftShape) +CCF_Shape::CCF_Shape(IGameObject* _owner) : ICollisionForm(_owner, cftShape) { } BOOL CCF_Shape::_RayQuery(const collide::ray_defs& Q, collide::rq_results& R) @@ -478,7 +478,7 @@ void CCF_Shape::ComputeBounds() if (bCalcSphere) bv_box.getsphere(bv_sphere.P, bv_sphere.R); } -BOOL CCF_Shape::Contact(CObject* O) +BOOL CCF_Shape::Contact(IGameObject* O) { // Build object-sphere in World-Space Fsphere S; diff --git a/src/xrEngine/xr_collide_form.h b/src/xrEngine/xr_collide_form.h index 957b328f9da..0fc5628027b 100644 --- a/src/xrEngine/xr_collide_form.h +++ b/src/xrEngine/xr_collide_form.h @@ -4,7 +4,7 @@ #include "xrCDB/xr_collide_defs.h" // refs -class ENGINE_API CObject; +class ENGINE_API IGameObject; class ENGINE_API CInifile; // t-defs @@ -25,7 +25,7 @@ struct clQueryTri struct clQueryCollision { - xr_vector objects; // affected objects + xr_vector objects; // affected objects xr_vector tris; // triangles (if queried) xr_vector boxes; // boxes/ellipsoids (if queried) xr_vector spheres; // spheres (if queried) @@ -85,7 +85,7 @@ class ENGINE_API ICollisionForm { friend class CObjectSpace; protected: - CObject* owner; // владелец + IGameObject* owner; // владелец u32 dwQueryID; protected: Fbox bv_box; // (Local) BBox объекта @@ -93,13 +93,13 @@ class ENGINE_API ICollisionForm private: ECollisionFormType m_type; public: - ICollisionForm(CObject* _owner, ECollisionFormType tp); + ICollisionForm(IGameObject* _owner, ECollisionFormType tp); virtual ~ICollisionForm(); virtual BOOL _RayQuery(const collide::ray_defs& Q, collide::rq_results& R) = 0; //virtual void _BoxQuery ( const Fbox& B, const Fmatrix& M, u32 flags) = 0; - IC CObject* Owner() const { return owner; } + IC IGameObject* Owner() const { return owner; } const Fbox& getBBox() const { return bv_box; } float getRadius() const { return bv_sphere.R; } const Fsphere& getSphere() const { return bv_sphere; } @@ -146,7 +146,7 @@ class ENGINE_API CCF_Skeleton : public ICollisionForm void BuildState(); void BuildTopLevel(); public: - CCF_Skeleton(CObject* _owner); + CCF_Skeleton(IGameObject* _owner); virtual BOOL _RayQuery(const collide::ray_defs& Q, collide::rq_results& R); bool _ElementCenter(u16 elem_id, Fvector& e_center); @@ -161,12 +161,12 @@ class ENGINE_API CCF_EventBox : public ICollisionForm private: Fplane Planes[6]; public: - CCF_EventBox(CObject* _owner); + CCF_EventBox(IGameObject* _owner); virtual BOOL _RayQuery(const collide::ray_defs& Q, collide::rq_results& R); //virtual void _BoxQuery ( const Fbox& B, const Fmatrix& M, u32 flags); - BOOL Contact(CObject* O); + BOOL Contact(IGameObject* O); }; class ENGINE_API CCF_Shape : public ICollisionForm @@ -188,7 +188,7 @@ class ENGINE_API CCF_Shape : public ICollisionForm }; xr_vector shapes; public: - CCF_Shape(CObject* _owner); + CCF_Shape(IGameObject* _owner); virtual BOOL _RayQuery(const collide::ray_defs& Q, collide::rq_results& R); //virtual void _BoxQuery ( const Fbox& B, const Fmatrix& M, u32 flags); @@ -196,7 +196,7 @@ class ENGINE_API CCF_Shape : public ICollisionForm void add_sphere(Fsphere& S); void add_box(Fmatrix& B); void ComputeBounds(); - BOOL Contact(CObject* O); + BOOL Contact(IGameObject* O); xr_vector& Shapes() { return shapes; } }; diff --git a/src/xrEngine/xr_efflensflare.cpp b/src/xrEngine/xr_efflensflare.cpp index 0cdba1a6903..8cddbcb0afb 100644 --- a/src/xrEngine/xr_efflensflare.cpp +++ b/src/xrEngine/xr_efflensflare.cpp @@ -197,8 +197,7 @@ IC BOOL material_callback(collide::rq_result& result, LPVOID params) if (result.O) { vis = 0.f; - //CKinematics*K=PKinematics(result.O->renderable.visual); - IKinematics* K = PKinematics(result.O->renderable.visual); + IKinematics* K = PKinematics(result.O->GetRenderData().visual); if (K && (result.element > 0)) vis = g_pGamePersistent->MtlTransparent(K->LL_GetData(u16(result.element)).game_mtl_idx); } @@ -377,7 +376,7 @@ void CLensFlare::OnFrame(shared_str id) vecSx.mul(vecX, fScale); vecSy.mul(vecY, fScale); - CObject* o_main = g_pGameLevel->CurrentViewEntity(); + IGameObject* o_main = g_pGameLevel->CurrentViewEntity(); R_ASSERT(_valid(vSunDir)); STranspParam TP(&m_ray_cache[0], Device.vCameraPosition, vSunDir, 1000.f, EPS_L); @@ -426,7 +425,7 @@ void CLensFlare::OnFrame(shared_str id) blend_lerp(fBlend, fVisResult, BLEND_DEC_SPEED, Device.fTimeDelta); /* - CObject* o_main = g_pGameLevel->CurrentViewEntity(); + IGameObject* o_main = g_pGameLevel->CurrentViewEntity(); STranspParam TP (&m_ray_cache,Device.vCameraPosition,vSunDir,1000.f,EPS_L); collide::ray_defs RD (TP.P,TP.D,TP.f,CDB::OPT_CULL,collide::rqtBoth); if (m_ray_cache.result&&m_ray_cache.similar(TP.P,TP.D,TP.f)){ @@ -447,7 +446,7 @@ void CLensFlare::OnFrame(shared_str id) blend_lerp(fBlend,TP.vis,BLEND_DEC_SPEED,Device.fTimeDelta); */ /* - CObject* o_main = g_pGameLevel->CurrentViewEntity(); + IGameObject* o_main = g_pGameLevel->CurrentViewEntity(); STranspParam TP (this,Device.vCameraPosition,vSunDir,1000.f,EPS_L); collide::ray_defs RD (TP.P,TP.D,TP.f,CDB::OPT_CULL,collide::rqtBoth); if (m_ray_cache.result&&m_ray_cache.similar(TP.P,TP.D,TP.f)){ diff --git a/src/xrEngine/xr_ioc_cmd.cpp b/src/xrEngine/xr_ioc_cmd.cpp index df72d152ae2..7e9dc4b3008 100644 --- a/src/xrEngine/xr_ioc_cmd.cpp +++ b/src/xrEngine/xr_ioc_cmd.cpp @@ -12,6 +12,7 @@ #include "CustomHUD.h" #include "xr_object.h" +#include "xr_object_list.h" xr_token* vid_quality_token = NULL; diff --git a/src/xrEngine/xr_object.cpp b/src/xrEngine/xr_object.cpp index 4f92a57e46f..f63a87b2a7a 100644 --- a/src/xrEngine/xr_object.cpp +++ b/src/xrEngine/xr_object.cpp @@ -1,479 +1,21 @@ #include "stdafx.h" #include "IGame_Level.h" - #include "xr_object.h" #include "xrCDB/xr_area.h" #include "Render.h" #include "Common/LevelStructure.hpp" #include "Include/xrRender/RenderVisual.h" #include "Include/xrRender/Kinematics.h" - #include "x_ray.h" #include "GameFont.h" - #include "mp_logging.h" #include "xr_collide_form.h" -#pragma warning(push) -#pragma warning(disable:4995) -#include -#pragma warning(pop) - -#pragma intrinsic(_InterlockedCompareExchange) - -inline void CObjectList::o_crow(CObject* O) +inline void CObjectList::o_crow(IGameObject* O) { Objects& crows = get_crows(); VERIFY(std::find(crows.begin(), crows.end(), O) == crows.end()); crows.push_back(O); - O->dwFrame_AsCrow = Device.dwFrame; -} - -void CObject::MakeMeCrow() -{ - if (Props.crow) - return; - - if (!processing_enabled()) - return; - - u32 const device_frame_id = Device.dwFrame; - u32 const object_frame_id = dwFrame_AsCrow; - if ( - (u32)_InterlockedCompareExchange( - (long*)&dwFrame_AsCrow, - device_frame_id, - object_frame_id - ) == device_frame_id - ) - return; - - VERIFY(dwFrame_AsCrow == device_frame_id); - - Props.crow = 1; - g_pGameLevel->Objects.o_crow(this); -} - -void CObject::cName_set(shared_str N) -{ - NameObject = N; -} -void CObject::cNameSect_set(shared_str N) -{ - NameSection = N; -} - -void CObject::cNameVisual_set(shared_str N) -{ - // check if equal - if (*N && *NameVisual) - if (N == NameVisual) return; - - // replace model - if (*N && N[0]) - { - IRenderVisual* old_v = renderable.visual; - - NameVisual = N; - renderable.visual = GlobalEnv.Render->model_Create(*N); - - IKinematics* old_k = old_v ? old_v->dcast_PKinematics() : NULL; - IKinematics* new_k = renderable.visual->dcast_PKinematics(); - - /* - if(old_k && new_k){ - new_k->Update_Callback = old_k->Update_Callback; - new_k->Update_Callback_Param = old_k->Update_Callback_Param; - } - */ - if (old_k && new_k) - { - new_k->SetUpdateCallback(old_k->GetUpdateCallback()); - new_k->SetUpdateCallbackParam(old_k->GetUpdateCallbackParam()); - } - - GlobalEnv.Render->model_Delete(old_v); - } - else - { - GlobalEnv.Render->model_Delete(renderable.visual); - NameVisual = 0; - } - OnChangeVisual(); -} - -// flagging -void CObject::processing_activate() -{ - VERIFY3(255 != Props.bActiveCounter, "Invalid sequence of processing enable/disable calls: overflow", *cName()); - Props.bActiveCounter++; - if (0 == (Props.bActiveCounter - 1)) g_pGameLevel->Objects.o_activate(this); -} -void CObject::processing_deactivate() -{ - VERIFY3(0 != Props.bActiveCounter, "Invalid sequence of processing enable/disable calls: underflow", *cName()); - Props.bActiveCounter--; - if (0 == Props.bActiveCounter) g_pGameLevel->Objects.o_sleep(this); -} - -void CObject::setEnabled(BOOL _enabled) -{ - if (_enabled) - { - Props.bEnabled = 1; - if (CForm) spatial.type |= STYPE_COLLIDEABLE; - } - else - { - Props.bEnabled = 0; - spatial.type &= ~STYPE_COLLIDEABLE; - } -} -void CObject::setVisible(BOOL _visible) -{ - if (_visible) - { - // Parent should control object visibility itself (??????) - Props.bVisible = 1; - if (renderable.visual) spatial.type |= STYPE_RENDERABLE; - } - else - { - Props.bVisible = 0; - spatial.type &= ~STYPE_RENDERABLE; - } -} - -//void CObject::Center (Fvector& C) const { VERIFY2(renderable.visual,*cName()); renderable.xform.transform_tiny(C,renderable.visual->vis.sphere.P); } -void CObject::Center(Fvector& C) const { VERIFY2(renderable.visual, *cName()); renderable.xform.transform_tiny(C, renderable.visual->getVisData().sphere.P); } -//float CObject::Radius () const { VERIFY2(renderable.visual,*cName()); return renderable.visual->vis.sphere.R; } -float CObject::Radius() const { VERIFY2(renderable.visual, *cName()); return renderable.visual->getVisData().sphere.R; } -//const Fbox& CObject::BoundingBox () const { VERIFY2(renderable.visual,*cName()); return renderable.visual->vis.box; } -const Fbox& CObject::BoundingBox() const { VERIFY2(renderable.visual, *cName()); return renderable.visual->getVisData().box; } - -//---------------------------------------------------------------------- -// Class : CXR_Object -// Purpose : -//---------------------------------------------------------------------- -CObject::CObject() : - SpatialBase(g_SpatialSpace), - dwFrame_AsCrow(u32(-1)) -{ - // Transform - Props.storage = 0; - - Parent = NULL; - - NameObject = NULL; - NameSection = NULL; - NameVisual = NULL; - -#ifdef DEBUG - shedule.dbg_update_shedule = u32(-1) / 2; - dbg_update_cl = u32(-1) / 2; -#endif -} - -CObject::~CObject() -{ - cNameVisual_set(0); - cName_set(0); - cNameSect_set(0); -} - -void CObject::Load(LPCSTR section) -{ - // Name - R_ASSERT(section); - cName_set(section); - cNameSect_set(section); - - // Visual and light-track - if (pSettings->line_exist(section, "visual")) - { - string_path tmp; - xr_strcpy(tmp, pSettings->r_string(section, "visual")); - if (strext(tmp)) - *strext(tmp) = 0; - xr_strlwr(tmp); - - cNameVisual_set(tmp); - } - setVisible(false); -} - -BOOL CObject::net_Spawn(CSE_Abstract* data) -{ - PositionStack.clear(); - - VERIFY(_valid(renderable.xform)); - - if (0 == Visual() && pSettings->line_exist(cNameSect(), "visual")) - cNameVisual_set(pSettings->r_string(cNameSect(), "visual")); - - if (0 == CForm) - { - if (pSettings->line_exist(cNameSect(), "cform")) - { - VERIFY3(*NameVisual, "Model isn't assigned for object, but cform requisted", *cName()); - CForm = xr_new(this); - } - } - - R_ASSERT(spatial.space); - spatial_register(); - - if (register_schedule()) - shedule_register(); - - // reinitialize flags - processing_activate(); - setDestroy(false); - - MakeMeCrow(); - - return TRUE; -} - -void CObject::net_Destroy() -{ - VERIFY(getDestroy()); - xr_delete(CForm); - if (register_schedule()) - shedule_unregister(); - - spatial_unregister(); - // setDestroy (true); - // remove visual - cNameVisual_set(0); -} - -////////////////////////////////////////////////////////////////////////// -const float base_spu_epsP = 0.05f; -const float base_spu_epsR = 0.05f; -void CObject::spatial_update(float eps_P, float eps_R) -{ - // - BOOL bUpdate = FALSE; - if (PositionStack.empty()) - { - // Empty - bUpdate = TRUE; - PositionStack.push_back(SavedPosition()); - PositionStack.back().dwTime = Device.dwTimeGlobal; - PositionStack.back().vPosition = Position(); - } - else - { - if (PositionStack.back().vPosition.similar(Position(), eps_P)) - { - // Just update time - PositionStack.back().dwTime = Device.dwTimeGlobal; - } - else - { - // Register _new_ record - bUpdate = TRUE; - if (PositionStack.size() < 4) - { - PositionStack.push_back(SavedPosition()); - } - else - { - PositionStack[0] = PositionStack[1]; - PositionStack[1] = PositionStack[2]; - PositionStack[2] = PositionStack[3]; - } - PositionStack.back().dwTime = Device.dwTimeGlobal; - PositionStack.back().vPosition = Position(); - } - } - - if (bUpdate) - { - spatial_move(); - } - else - { - if (spatial.node_ptr) - { - // Object registered! - if (!fsimilar(Radius(), spatial.sphere.R, eps_R)) spatial_move(); - else - { - Fvector C; - Center(C); - if (!C.similar(spatial.sphere.P, eps_P)) spatial_move(); - } - // else nothing to do :_) - } - } -} - -// Updates -void CObject::UpdateCL() -{ - // consistency check -#ifdef DEBUG - VERIFY2(_valid(renderable.xform), *cName()); - - if (Device.dwFrame == dbg_update_cl) Debug.fatal(DEBUG_INFO, "'UpdateCL' called twice per frame for %s", *cName()); - dbg_update_cl = Device.dwFrame; - - if (Parent && spatial.node_ptr) Debug.fatal(DEBUG_INFO, "Object %s has parent but is still registered inside spatial DB", *cName()); - - if ((0 == CForm) && (spatial.type&STYPE_COLLIDEABLE)) Debug.fatal(DEBUG_INFO, "Object %s registered as 'collidable' but has no collidable model", *cName()); -#endif - - spatial_update(base_spu_epsP * 5, base_spu_epsR * 5); - - // crow - if (Parent == g_pGameLevel->CurrentViewEntity()) - MakeMeCrow(); - else if (AlwaysTheCrow()) - MakeMeCrow(); - else - { - float dist = Device.vCameraPosition.distance_to_sqr(Position()); - if (dist < CROW_RADIUS*CROW_RADIUS) - MakeMeCrow(); - else if ((Visual() && Visual()->getVisData().hom_frame + 2 > Device.dwFrame) && (dist < CROW_RADIUS2*CROW_RADIUS2)) - MakeMeCrow(); - } -} - -void CObject::shedule_Update(u32 T) -{ - // consistency check - // Msg ("-SUB-:[%x][%s] CObject::shedule_Update",dynamic_cast(this),*cName()); - ScheduledBase::shedule_Update(T); - spatial_update(base_spu_epsP * 1, base_spu_epsR * 1); - - // Always make me crow on shedule-update - // Makes sure that update-cl called at least with freq of shedule-update - MakeMeCrow(); - /* - if (AlwaysTheCrow()) MakeMeCrow (); - else if (Device.vCameraPosition.distance_to_sqr(Position()) < CROW_RADIUS*CROW_RADIUS) MakeMeCrow (); - */ -} - -void CObject::spatial_register() -{ - Center(spatial.sphere.P); - spatial.sphere.R = Radius(); - SpatialBase::spatial_register(); -} - -void CObject::spatial_unregister() -{ - SpatialBase::spatial_unregister(); -} - -void CObject::spatial_move() -{ - Center(spatial.sphere.P); - spatial.sphere.R = Radius(); - SpatialBase::spatial_move(); -} - -CObject::SavedPosition CObject::ps_Element(u32 ID) const -{ - VERIFY(ID < ps_Size()); - return PositionStack[ID]; -} - -void CObject::renderable_Render() -{ - MakeMeCrow(); -} - -CObject* CObject::H_SetParent(CObject* new_parent, bool just_before_destroy) -{ - if (new_parent == Parent) return new_parent; - - CObject* old_parent = Parent; - - VERIFY2((new_parent == 0) || (old_parent == 0), "Before set parent - execute H_SetParent(0)"); - - // if (Parent) Parent->H_ChildRemove (this); - if (0 == old_parent) OnH_B_Chield(); // before attach - else OnH_B_Independent(just_before_destroy); // before detach - if (new_parent) spatial_unregister(); - else spatial_register(); - Parent = new_parent; - if (0 == old_parent) OnH_A_Chield(); // after attach - else OnH_A_Independent(); // after detach - // if (Parent) Parent->H_ChildAdd (this); - MakeMeCrow(); - return old_parent; -} - -void CObject::OnH_A_Chield() -{ -} -void CObject::OnH_B_Chield() -{ - setVisible(false); -} -void CObject::OnH_A_Independent() -{ - setVisible(true); + O->SetCrowUpdateFrame(Device.dwFrame); } - -void CObject::OnH_B_Independent(bool just_before_destroy) -{ -} - -void CObject::setDestroy(BOOL _destroy) -{ - if (_destroy == (BOOL)Props.bDestroy) - return; - - Props.bDestroy = _destroy ? 1 : 0; - if (_destroy) - { - g_pGameLevel->Objects.register_object_to_destroy(this); -#ifdef DEBUG - extern BOOL debug_destroy; - if (debug_destroy) - Msg("cl setDestroy [%d][%d]", ID(), Device.dwFrame); -#endif -#ifdef MP_LOGGING - Msg("cl setDestroy [%d][%d]", ID(), Device.dwFrame); -#endif //#ifdef MP_LOGGING - } - else - VERIFY(!g_pGameLevel->Objects.registered_object_to_destroy(this)); -} - -Fvector CObject::get_new_local_point_on_mesh(u16& bone_id) const -{ - bone_id = u16(-1); - return Fvector().random_dir().mul(.7f); -} - -Fvector CObject::get_last_local_point_on_mesh(Fvector const& local_point, u16 const bone_id) const -{ - VERIFY(bone_id == u16(-1)); - - Fvector result; - // Fetch data - Fmatrix mE; - const Fmatrix& M = XFORM(); - const Fbox& B = CForm->getBBox(); - - // Build OBB + Ellipse and X-form point - Fvector c, r; - Fmatrix T, mR, mS; - B.getcenter(c); - B.getradius(r); - T.translate(c); - mR.mul_43(M, T); - mS.scale(r); - mE.mul_43(mR, mS); - mE.transform_tiny(result, local_point); - - return result; -} \ No newline at end of file diff --git a/src/xrEngine/xr_object.h b/src/xrEngine/xr_object.h index 354f3639809..8f3a8be5380 100644 --- a/src/xrEngine/xr_object.h +++ b/src/xrEngine/xr_object.h @@ -8,6 +8,11 @@ #include "ICollidable.h" #include "EngineAPI.h" #include "device.h" + +#include "xrServerEntities/xrServer_Space.h" +#include "xrGame/game_object_space.h" +#include "xrServerEntities/alife_space.h" + // refs //class ENGINE_API IRender_Visual; class ENGINE_API IRender_Sector; @@ -19,199 +24,335 @@ class CSE_Abstract; //----------------------------------------------------------------------------------------------------------- #define CROW_RADIUS (30.f) #define CROW_RADIUS2 (60.f) -//----------------------------------------------------------------------------------------------------------- -// CObject -//----------------------------------------------------------------------------------------------------------- class IPhysicsShell; xr_pure_interface IObjectPhysicsCollision; -// XXX: merge into CGameObject -#pragma pack(push,4) -class ENGINE_API CObject : - public FactoryObjectBase, - public SpatialBase, - public ScheduledBase, - public RenderableBase, - public CollidableBase + +class CAttachmentOwner; +class CInventoryOwner; +class CInventoryItem; +class CEntity; +class CEntityAlive; +class CActor; +class CGameObject; // XXX: remove +class CCustomZone; +class CPhysicsShellHolder; +class IInputReceiver; +class CParticlesPlayer; +class CArtefact; +class CCustomMonster; +class CAI_Stalker; +class CScriptEntity; +class CWeapon; +class CExplosive; +class CSpaceRestrictor; +class CAttachableItem; +class CHolderCustom; +class CBaseMonster; +class CBlend; +struct SHit; +class CScriptGameObject; +class CAI_ObjectLocation; +class CScriptBinderObject; +class ai_obstacle; +class animation_movement_controller; + +template +class CScriptCallbackEx; + +struct GameObjectSavedPosition { -public: - struct SavedPosition - { - u32 dwTime; - Fvector vPosition; - }; - union ObjectProperties + u32 dwTime; + Fvector vPosition; +}; + +union GameObjectProperties +{ + struct { - struct - { - u32 net_ID : 16; - u32 bActiveCounter : 8; - u32 bEnabled : 1; - u32 bVisible : 1; - u32 bDestroy : 1; - u32 net_Local : 1; - u32 net_Ready : 1; - u32 net_SV_Update : 1; - u32 crow : 1; - u32 bPreDestroy : 1; - }; - u32 storage; + u32 net_ID : 16; + u32 bActiveCounter : 8; + u32 bEnabled : 1; + u32 bVisible : 1; + u32 bDestroy : 1; + u32 net_Local : 1; + u32 net_Ready : 1; + u32 net_SV_Update : 1; + u32 crow : 1; + u32 bPreDestroy : 1; }; -private: - BENCH_SEC_SCRAMBLEMEMBER1 - BENCH_SEC_SCRAMBLEVTBL2 - // Some property variables - ObjectProperties Props; - shared_str NameObject; - shared_str NameSection; - shared_str NameVisual; -protected: - // Parentness - CObject* Parent; + u32 storage; +}; - // Geometric (transformation) - svector PositionStack; +class IGameObject : + public virtual IFactoryObject, + public virtual ISpatial, + public virtual ISheduled, + public virtual IRenderable, + public virtual ICollidable +{ public: -#ifdef DEBUG - u32 dbg_update_cl; -#endif - u32 dwFrame_UpdateCL; - u32 dwFrame_AsCrow; + using visual_callback = void (__stdcall *)(IKinematics *); + using CALLBACK_VECTOR = svector; + using CALLBACK_VECTOR_IT = CALLBACK_VECTOR::iterator; + using CScriptCallbackExVoid = CScriptCallbackEx; + //typedef xr_map CALLBACK_MAP; + //typedef CALLBACK_MAP::iterator CALLBACK_MAP_IT; + virtual ~IGameObject() = 0; + // derived interfaces: some functions declared as final in base classes + // IFactoryObject + //virtual CLASS_ID &GetClassId() override = 0; + //virtual IFactoryObject *_construct() override = 0; + // ~IFactoryObject + // ISpatial + //virtual bool spatial_inside() override = 0; + //virtual void spatial_register() override = 0; + //virtual void spatial_unregister() override = 0; + //virtual void spatial_move() override = 0; + //virtual Fvector spatial_sector_point() override = 0; + //virtual void spatial_updatesector() override = 0; + //virtual IGameObject *dcast_GameObject() override = 0; + //virtual Feel::Sound *dcast_FeelSound() override = 0; + //virtual IRenderable *dcast_Renderable() override = 0; + //virtual IRender_Light *dcast_Light() override = 0; + // ~ISpatial + // IScheduled + //virtual SchedulerData &GetSchedulerData() override = 0; + //virtual float shedule_Scale() override = 0; + //virtual void shedule_Update(u32 dt) override = 0; // Called by sheduler + //virtual shared_str shedule_Name() const override = 0; + //virtual bool shedule_Needed() override = 0; + // ~ISheduled + // IRenderable + //virtual RenderData &GetRenderData() override = 0; + //virtual void renderable_Render() override = 0; + //virtual IRender_ObjectSpecific *renderable_ROS() override = 0; + //virtual BOOL renderable_ShadowGenerate() override = 0; + //virtual BOOL renderable_ShadowReceive() override = 0; + // ~IRenderable + // ICollidable + //virtual void SetCForm(ICollisionForm *cform) override = 0; + //virtual ICollisionForm *GetCForm() const override = 0; + // ~ICollidable + + virtual u32 GetDbgUpdateFrame() const = 0; + virtual void SetDbgUpdateFrame(u32 value) = 0; + virtual u32 GetUpdateFrame() const = 0; + virtual void SetUpdateFrame(u32 value) = 0; + virtual u32 GetCrowUpdateFrame() const = 0; + virtual void SetCrowUpdateFrame(u32 value) = 0; // Crow-MODE // if (object_is_visible) // if (object_is_near) // if (object_is_crow_always) #ifdef DEBUG - void DBGGetProps(ObjectProperties& p) const { p = Props; } + virtual void DBGGetProps(GameObjectProperties &p) const = 0; #endif - void MakeMeCrow(); - - ICF void IAmNotACrowAnyMore() { Props.crow = false; } - virtual BOOL AlwaysTheCrow() { return FALSE; } - ICF bool AmICrow() const { return !!Props.crow; } - + virtual void MakeMeCrow() = 0; + virtual void IAmNotACrowAnyMore() = 0; + virtual BOOL AlwaysTheCrow() = 0; + virtual bool AmICrow() const = 0; // Network - ICF BOOL Local() const { return Props.net_Local; } - ICF BOOL Remote() const { return !Props.net_Local; } - ICF u16 ID() const { return Props.net_ID; } - ICF void setID(u16 _ID) { Props.net_ID = _ID; } - virtual BOOL Ready() { return Props.net_Ready; } - BOOL GetTmpPreDestroy() const { return Props.bPreDestroy; } - void SetTmpPreDestroy(BOOL b) { Props.bPreDestroy = b; } - virtual float shedule_Scale() { return Device.vCameraPosition.distance_to(Position()) / 200.f; } - virtual bool shedule_Needed() { return processing_enabled(); }; - + virtual BOOL Local() const = 0; + virtual BOOL Remote() const = 0; + virtual u16 ID() const = 0; + virtual void setID(u16 id) = 0; + virtual BOOL Ready() = 0; + virtual BOOL GetTmpPreDestroy() const = 0; + virtual void SetTmpPreDestroy(BOOL b) = 0; // Parentness - IC CObject* H_Parent() { return Parent; } - IC const CObject* H_Parent() const { return Parent; } - CObject* H_Root() { return Parent ? Parent->H_Root() : this; } - const CObject* H_Root() const { return Parent ? Parent->H_Root() : this; } - CObject* H_SetParent(CObject* O, bool just_before_destroy = false); - + virtual IGameObject *H_Parent() = 0; + virtual const IGameObject *H_Parent() const = 0; + virtual IGameObject *H_Root() = 0; + virtual const IGameObject *H_Root() const = 0; + virtual IGameObject *H_SetParent(IGameObject *obj, bool justBeforeDestroy = false) = 0; // Geometry xform - virtual void Center(Fvector& C) const; - IC const Fmatrix& XFORM() const { VERIFY(_valid(renderable.xform)); return renderable.xform; } - ICF Fmatrix& XFORM() { return renderable.xform; } - virtual void spatial_register(); - virtual void spatial_unregister(); - virtual void spatial_move(); - void spatial_update(float eps_P, float eps_R); - - ICF Fvector& Direction() { return renderable.xform.k; } - ICF const Fvector& Direction() const { return renderable.xform.k; } - ICF Fvector& Position() { return renderable.xform.c; } - ICF const Fvector& Position() const { return renderable.xform.c; } - virtual float Radius() const; - virtual const Fbox& BoundingBox() const; - - IC IRender_Sector* Sector() { return H_Root()->GetSpatialData().sector; } - IC IRender_ObjectSpecific* ROS() { return renderable_ROS(); } - virtual BOOL renderable_ShadowGenerate() { return TRUE; } - virtual BOOL renderable_ShadowReceive() { return TRUE; } - + virtual void Center(Fvector ¢er) const = 0; + virtual const Fmatrix &XFORM() const = 0; + virtual Fmatrix &XFORM() = 0; + virtual void spatial_update(float eps_P, float eps_R) = 0; + virtual Fvector& Direction() = 0; + virtual const Fvector& Direction() const = 0; + virtual Fvector& Position() = 0; + virtual const Fvector& Position() const = 0; + virtual float Radius() const = 0; + virtual const Fbox& BoundingBox() const = 0; + virtual IRender_Sector* Sector() = 0; + virtual IRender_ObjectSpecific* ROS() = 0; // Accessors and converters - ICF IRenderVisual* Visual() const { return renderable.visual; } - virtual CObject* dcast_CObject() { return this; } - virtual IRenderable* dcast_Renderable() { return this; } - virtual void OnChangeVisual() { } - virtual IPhysicsShell* physics_shell() { return 0; } - - virtual const IObjectPhysicsCollision* physics_collision() { return 0; } + virtual IRenderVisual* Visual() const = 0; + virtual void OnChangeVisual() = 0; + virtual IPhysicsShell* physics_shell() = 0; + virtual const IObjectPhysicsCollision* physics_collision() = 0; // Name management - ICF shared_str cName() const { return NameObject; } - void cName_set(shared_str N); - ICF shared_str cNameSect() const { return NameSection; } - ICF LPCSTR cNameSect_str() const { return NameSection.c_str(); } - void cNameSect_set(shared_str N); - ICF shared_str cNameVisual() const { return NameVisual; } - void cNameVisual_set(shared_str N); - virtual shared_str shedule_Name() const { return cName(); }; - + virtual shared_str cName() const = 0; + virtual void cName_set(shared_str N) = 0; + virtual shared_str cNameSect() const = 0; + virtual LPCSTR cNameSect_str() const = 0; + virtual void cNameSect_set(shared_str N) = 0; + virtual shared_str cNameVisual() const = 0; + virtual void cNameVisual_set(shared_str N) = 0; // Properties - void processing_activate(); // request to enable UpdateCL - void processing_deactivate(); // request to disable UpdateCL - bool processing_enabled() { return 0 != Props.bActiveCounter; } - - void setVisible(BOOL _visible); - ICF BOOL getVisible() const { return Props.bVisible; } - void setEnabled(BOOL _enabled); - ICF BOOL getEnabled() const { return Props.bEnabled; } - void setDestroy(BOOL _destroy); - ICF BOOL getDestroy() const { return Props.bDestroy; } - ICF void setLocal(BOOL _local) { Props.net_Local = _local ? 1 : 0; } - ICF BOOL getLocal() const { return Props.net_Local; } - ICF void setSVU(BOOL _svu) { Props.net_SV_Update = _svu ? 1 : 0; } - ICF BOOL getSVU() const { return Props.net_SV_Update; } - ICF void setReady(BOOL _ready) { Props.net_Ready = _ready ? 1 : 0; } - ICF BOOL getReady() const { return Props.net_Ready; } - - //--------------------------------------------------------------------- - CObject(); - virtual ~CObject(); - - virtual void Load(LPCSTR section); - + virtual void processing_activate() = 0; // request to enable UpdateCL + virtual void processing_deactivate() = 0; // request to disable UpdateCL + virtual bool processing_enabled() = 0; + virtual void setVisible(BOOL _visible) = 0; + virtual BOOL getVisible() const = 0; + virtual void setEnabled(BOOL _enabled) = 0; + virtual BOOL getEnabled() const = 0; + virtual void setDestroy(BOOL _destroy) = 0; + virtual BOOL getDestroy() const = 0; + virtual void setLocal(BOOL _local) = 0; + virtual BOOL getLocal() const = 0; + virtual void setSVU(BOOL _svu) = 0; + virtual BOOL getSVU() const = 0; + virtual void setReady(BOOL _ready) = 0; + virtual BOOL getReady() const = 0; + // ~Properties + virtual void Load(LPCSTR section) = 0; // Update - virtual void shedule_Update(u32 dt); // Called by sheduler - virtual void renderable_Render(); - - virtual void UpdateCL(); // Called each frame, so no need for dt - virtual BOOL net_Spawn(CSE_Abstract* data); - virtual void net_Destroy(); - virtual void net_Export(NET_Packet& P) {}; // export to server - virtual void net_Import(NET_Packet& P) {}; // import from server - virtual void net_ImportInput(NET_Packet& P) {}; - virtual BOOL net_Relevant() { return FALSE; }; // relevant for export to server - virtual void net_MigrateInactive(NET_Packet& P) { Props.net_Local = FALSE; }; - virtual void net_MigrateActive(NET_Packet& P) { Props.net_Local = TRUE; }; - virtual void net_Relcase(CObject* O) { }; // destroy all links to another objects - + virtual void UpdateCL() = 0; // Called each frame, so no need for dt // Position stack - IC u32 ps_Size() const { return PositionStack.size(); } - virtual SavedPosition ps_Element(u32 ID) const; - virtual void ForceTransform(const Fmatrix& m) {}; - + virtual u32 ps_Size() const = 0; + virtual GameObjectSavedPosition ps_Element(u32 id) const = 0; + virtual void ForceTransform(const Fmatrix &m) = 0; // HUD - virtual void OnHUDDraw(CCustomHUD* hud) {}; - + virtual void OnHUDDraw(CCustomHUD *hud) = 0; // Active/non active - virtual void OnH_B_Chield(); // before - virtual void OnH_B_Independent(bool just_before_destroy); - virtual void OnH_A_Chield(); // after - virtual void OnH_A_Independent(); - - virtual void On_SetEntity() {}; - virtual void On_LostEntity() {}; - -public: - virtual bool register_schedule() const { return true; } - -public: - virtual Fvector get_new_local_point_on_mesh(u16& bone_id) const; - virtual Fvector get_last_local_point_on_mesh(Fvector const& last_point, u16 bone_id) const; + virtual void OnH_B_Chield() = 0;// before + virtual void OnH_B_Independent(bool justBeforeDestroy) = 0; + virtual void OnH_A_Chield() = 0; // after + virtual void OnH_A_Independent() = 0; + virtual void On_SetEntity() = 0; + virtual void On_LostEntity() = 0; + virtual bool register_schedule() const = 0; + virtual Fvector get_new_local_point_on_mesh(u16 &boneId) const = 0; + virtual Fvector get_last_local_point_on_mesh(const Fvector &lastPoint, u16 boneId) const = 0; + // CGameObject + // functions used for avoiding most of the smart_cast + virtual CAttachmentOwner *cast_attachment_owner() = 0; + virtual CInventoryOwner *cast_inventory_owner() = 0; + virtual CInventoryItem *cast_inventory_item() = 0; + virtual CEntity *cast_entity() = 0; + virtual CEntityAlive *cast_entity_alive() = 0; + virtual CActor *cast_actor() = 0; + virtual CGameObject *cast_game_object() = 0; + virtual CCustomZone *cast_custom_zone() = 0; + virtual CPhysicsShellHolder *cast_physics_shell_holder() = 0; + virtual IInputReceiver *cast_input_receiver() = 0; + virtual CParticlesPlayer *cast_particles_player() = 0; + virtual CArtefact *cast_artefact() = 0; + virtual CCustomMonster *cast_custom_monster() = 0; + virtual CAI_Stalker *cast_stalker() = 0; + virtual CScriptEntity *cast_script_entity() = 0; + virtual CWeapon *cast_weapon() = 0; + virtual CExplosive *cast_explosive() = 0; + virtual CSpaceRestrictor *cast_restrictor() = 0; + virtual CAttachableItem *cast_attachable_item() = 0; + virtual CHolderCustom *cast_holder_custom() = 0; + virtual CBaseMonster *cast_base_monster() = 0; + virtual bool feel_touch_on_contact(IGameObject *obj) = 0; + // Utilities + // XXX: move out + //static void u_EventGen(NET_Packet& P, u32 type, u32 dest); + //static void u_EventSend(NET_Packet& P, u32 dwFlags = DPNSEND_GUARANTEED); + // Methods + //object serialization + virtual void net_Save(NET_Packet &packet) = 0; + virtual void net_Load(IReader &reader) = 0; + virtual BOOL net_SaveRelevant() = 0; + virtual void net_Export(NET_Packet &packet) = 0; // export to server + virtual void net_Import(NET_Packet &packet) = 0; // import from server + virtual BOOL net_Spawn(CSE_Abstract *entity) = 0; + virtual void net_Destroy() = 0; + virtual void net_ImportInput(NET_Packet &packet) = 0; + virtual BOOL net_Relevant() = 0; // relevant for export to server + virtual void net_MigrateInactive(NET_Packet &packet) = 0; + virtual void net_MigrateActive(NET_Packet &packet) = 0; + virtual void net_Relcase(IGameObject *obj) = 0; // destroy all links to another objects + virtual void save(NET_Packet &packet) = 0; + virtual void load(IReader &reader) = 0; + virtual void OnEvent(NET_Packet &packet, u16 type) = 0; + virtual void Hit(SHit *hit) = 0; + virtual void SetHitInfo(IGameObject *who, IGameObject *weapon, s16 element, Fvector pos, Fvector dir) = 0; + virtual BOOL BonePassBullet(int boneId) = 0; + // игровое имя объекта + virtual LPCSTR Name() const = 0; + virtual bool IsVisibleForZones() = 0; + virtual bool NeedToDestroyObject() const = 0; + virtual void DestroyObject() = 0; + // animation_movement_controller + virtual void create_anim_mov_ctrl(CBlend *blend, Fmatrix *startPos, bool localAnimation) = 0; + virtual void destroy_anim_mov_ctrl() = 0; + virtual void update_animation_movement_controller() = 0; + virtual bool animation_movement_controlled() const = 0; + virtual const animation_movement_controller *animation_movement() const = 0; + virtual animation_movement_controller *animation_movement() = 0; + // Game-specific events + virtual BOOL UsedAI_Locations() = 0; + virtual BOOL TestServerFlag(u32 flag) const = 0; + virtual bool can_validate_position_on_spawn() = 0; +#ifdef DEBUG + virtual void OnRender() = 0; +#endif + virtual void reinit() = 0; + virtual void reload(LPCSTR section) = 0; + // network + virtual bool object_removed() const = 0; + virtual void make_Interpolation() = 0; // interpolation from last visible to corrected position/rotation + virtual void PH_B_CrPr() = 0; // actions & operations before physic correction-prediction steps + virtual void PH_I_CrPr() = 0; // actions & operations after correction before prediction steps +#ifdef DEBUG + virtual void PH_Ch_CrPr() = 0; + virtual void dbg_DrawSkeleton() = 0; +#endif + virtual void PH_A_CrPr() = 0; // actions & operations after phisic correction-prediction steps + virtual void CrPr_SetActivationStep(u32 step) = 0; + virtual u32 CrPr_GetActivationStep() = 0; + virtual void CrPr_SetActivated(bool activate) = 0; + virtual bool CrPr_IsActivated() = 0; + // ~network + virtual const SRotation Orientation() const = 0; + virtual bool use_parent_ai_locations() const = 0; + virtual void add_visual_callback(visual_callback callback) = 0; + virtual void remove_visual_callback(visual_callback callback) = 0; + virtual CALLBACK_VECTOR &visual_callbacks() = 0; + virtual CScriptGameObject *lua_game_object() const = 0; + virtual int clsid() const = 0; + virtual CInifile *spawn_ini() = 0; + virtual CAI_ObjectLocation &ai_location() const = 0; + virtual u32 spawn_time() const = 0; + virtual const ALife::_STORY_ID &story_id() const = 0; + virtual u32 ef_creature_type() const = 0; + virtual u32 ef_equipment_type() const = 0; + virtual u32 ef_main_weapon_type() const = 0; + virtual u32 ef_anomaly_type() const = 0; + virtual u32 ef_weapon_type() const = 0; + virtual u32 ef_detector_type() const = 0; + virtual bool natural_weapon() const = 0; + virtual bool natural_detector() const = 0; + virtual bool use_center_to_aim() const = 0; + virtual void MoveTo(const Fvector &pos) = 0; + virtual CScriptCallbackExVoid &callback(GameObject::ECallbackType type) const = 0; + virtual LPCSTR visual_name(CSE_Abstract *entity) = 0; + virtual void On_B_NotCurrentEntity() = 0; + virtual bool is_ai_obstacle() const = 0; + virtual ai_obstacle &obstacle() const = 0; + virtual void on_matrix_change(const Fmatrix &prev) = 0; + // UsableScriptObject functions + virtual bool use(IGameObject *obj) = 0; + //строчка появляющаяся при наведении на объект (если NULL, то нет) + virtual LPCSTR tip_text() = 0; + virtual void set_tip_text(LPCSTR text) = 0; + virtual void set_tip_text_default() = 0; + // можно ли использовать объект стандартным (не скриптовым) образом + virtual bool nonscript_usable() = 0; + virtual void set_nonscript_usable(bool usable) = 0; + virtual CScriptBinderObject *GetScriptBinderObject() = 0; + virtual void SetScriptBinderObject(CScriptBinderObject *obj) = 0; }; -#pragma pack(pop) +inline IGameObject::~IGameObject() {} #endif //__XR_OBJECT_H__ diff --git a/src/xrEngine/xr_object_list.cpp b/src/xrEngine/xr_object_list.cpp index 1c7143f8cc6..0c9fd23d3b2 100644 --- a/src/xrEngine/xr_object_list.cpp +++ b/src/xrEngine/xr_object_list.cpp @@ -18,10 +18,10 @@ class fClassEQ CLASS_ID cls; public: fClassEQ(CLASS_ID C) : cls(C) {}; - IC bool operator() (CObject* O) { return cls == O->CLS_ID; } + IC bool operator() (IGameObject* O) { return cls == O->GetClassId(); } }; #ifdef DEBUG -BOOL debug_destroy = TRUE; +ENGINE_API BOOL debug_destroy = TRUE; #endif void CObjectList::DumpStatistics(IGameFont &font, IPerformanceAlert *alert) @@ -41,7 +41,7 @@ CObjectList::CObjectList() : m_owner_thread_id(GetCurrentThreadId()) { statsFrame = u32(-1); - ZeroMemory(map_NETID, 0xffff * sizeof(CObject*)); + ZeroMemory(map_NETID, 0xffff * sizeof(IGameObject*)); } CObjectList::~CObjectList() @@ -52,7 +52,7 @@ CObjectList::~CObjectList() //. R_ASSERT ( map_NETID.empty() ); } -CObject* CObjectList::FindObjectByName(shared_str name) +IGameObject* CObjectList::FindObjectByName(shared_str name) { for (Objects::iterator I = objects_active.begin(); I != objects_active.end(); I++) if ((*I)->cName().equal(name)) return (*I); @@ -60,12 +60,12 @@ CObject* CObjectList::FindObjectByName(shared_str name) if ((*I)->cName().equal(name)) return (*I); return NULL; } -CObject* CObjectList::FindObjectByName(LPCSTR name) +IGameObject* CObjectList::FindObjectByName(LPCSTR name) { return FindObjectByName(shared_str(name)); } -CObject* CObjectList::FindObjectByCLS_ID(CLASS_ID cls) +IGameObject* CObjectList::FindObjectByCLS_ID(CLASS_ID cls) { { Objects::iterator O = std::find_if(objects_active.begin(), objects_active.end(), fClassEQ(cls)); @@ -80,7 +80,7 @@ CObject* CObjectList::FindObjectByCLS_ID(CLASS_ID cls) } -void CObjectList::o_remove(Objects& v, CObject* O) +void CObjectList::o_remove(Objects& v, IGameObject* O) { //. if(O->ID()==1026) //. { @@ -92,14 +92,14 @@ void CObjectList::o_remove(Objects& v, CObject* O) //. Msg("---o_remove[%s][%d]", O->cName().c_str(), O->ID() ); } -void CObjectList::o_activate(CObject* O) +void CObjectList::o_activate(IGameObject* O) { VERIFY(O && O->processing_enabled()); o_remove(objects_sleeping, O); objects_active.push_back(O); O->MakeMeCrow(); } -void CObjectList::o_sleep(CObject* O) +void CObjectList::o_sleep(IGameObject* O) { VERIFY(O && !O->processing_enabled()); o_remove(objects_active, O); @@ -107,9 +107,9 @@ void CObjectList::o_sleep(CObject* O) O->MakeMeCrow(); } -void CObjectList::SingleUpdate(CObject* O) +void CObjectList::SingleUpdate(IGameObject* O) { - if (Device.dwFrame == O->dwFrame_UpdateCL) + if (Device.dwFrame == O->GetUpdateFrame()) { #ifdef DEBUG // if (O->getDestroy()) @@ -132,13 +132,13 @@ void CObjectList::SingleUpdate(CObject* O) if (O->H_Parent()) SingleUpdate(O->H_Parent()); stats.Updated++; - O->dwFrame_UpdateCL = Device.dwFrame; + O->SetUpdateFrame(Device.dwFrame); // Msg ("[%d][0x%08x]IAmNotACrowAnyMore (CObjectList::SingleUpdate)", Device.dwFrame, dynamic_cast(O)); O->UpdateCL(); - VERIFY3(O->dbg_update_cl == Device.dwFrame, "Broken sequence of calls to 'UpdateCL'", *O->cName()); + VERIFY3(O->GetDbgUpdateFrame()==Device.dwFrame, "Broken sequence of calls to 'UpdateCL'", *O->cName()); #if 0//ndef DEBUG __try { @@ -152,8 +152,8 @@ void CObjectList::SingleUpdate(CObject* O) } __except (EXCEPTION_EXECUTE_HANDLER) { - CObject* parent_obj = O->H_Parent(); - CObject* root_obj = O->H_Root(); + IGameObject* parent_obj = O->H_Parent(); + IGameObject* root_obj = O->H_Root(); Msg ("! ERROR: going to crush: [%d:%s], section[%s], parent_obj_addr[0x%08x], root_obj_addr[0x%08x]",O->ID(),*O->cName(),*O->cNameSect(), *((u32*)&parent_obj), *((u32*)&root_obj)); if (parent_obj) { @@ -263,20 +263,20 @@ void CObjectList::Update(bool bForce) stats.Total = objects_active.size() + objects_sleeping.size(); u32 const objects_count = workload->size(); - CObject** objects = (CObject**)_alloca(objects_count*sizeof(CObject*)); + IGameObject** objects = (IGameObject**)_alloca(objects_count*sizeof(IGameObject*)); std::copy(workload->begin(), workload->end(), objects); crows.clear_not_free(); - CObject** b = objects; - CObject** e = objects + objects_count; - for (CObject** i = b; i != e; ++i) + IGameObject** b = objects; + IGameObject** e = objects + objects_count; + for (IGameObject** i = b; i != e; ++i) { (*i)->IAmNotACrowAnyMore(); - (*i)->dwFrame_AsCrow = u32(-1); + (*i)->SetCrowUpdateFrame(u32(-1)); } - for (CObject** i = b; i != e; ++i) + for (IGameObject** i = b; i != e; ++i) SingleUpdate(*i); stats.Update.End(); @@ -314,7 +314,7 @@ void CObjectList::Update(bool bForce) // Destroy for (int it = destroy_queue.size() - 1; it >= 0; it--) { - CObject* O = destroy_queue[it]; + IGameObject* O = destroy_queue[it]; // Msg ("Object [%x]", O); #ifdef DEBUG if (debug_destroy) @@ -327,26 +327,23 @@ void CObjectList::Update(bool bForce) } } -void CObjectList::net_Register(CObject* O) +void CObjectList::net_Register(IGameObject* O) { R_ASSERT(O); R_ASSERT(O->ID() < 0xffff); map_NETID[O->ID()] = O; - - - //. map_NETID.insert(mk_pair(O->ID(),O)); //Msg ("-------------------------------- Register: %s",O->cName()); } -void CObjectList::net_Unregister(CObject* O) +void CObjectList::net_Unregister(IGameObject* O) { //R_ASSERT (O->ID() < 0xffff); if (O->ID() < 0xffff) //demo_spectator can have 0xffff map_NETID[O->ID()] = NULL; /* - xr_map::iterator it = map_NETID.find(O->ID()); + xr_map::iterator it = map_NETID.find(O->ID()); if ((it!=map_NETID.end()) && (it->second == O)) { // Msg ("-------------------------------- Unregster: %s",O->cName()); map_NETID.erase(it); @@ -364,7 +361,7 @@ u32 CObjectList::net_Export(NET_Packet* _Packet, u32 start, u32 max_object_size) u32 position; for (; start < objects_active.size() + objects_sleeping.size(); start++) { - CObject* P = (start < objects_active.size()) ? objects_active[start] : objects_sleeping[start - objects_active.size()]; + IGameObject* P = (start < objects_active.size()) ? objects_active[start] : objects_sleeping[start - objects_active.size()]; if (P->net_Relevant() && !P->getDestroy()) { Packet.w_u16(u16(P->ID())); @@ -408,7 +405,7 @@ void CObjectList::net_Import(NET_Packet* Packet) Packet->r_u16(ID); u8 size; Packet->r_u8(size); - CObject* P = net_Find(ID); + IGameObject* P = net_Find(ID); if (P) { @@ -426,10 +423,10 @@ void CObjectList::net_Import(NET_Packet* Packet) } /* -CObject* CObjectList::net_Find(u16 ID) +IGameObject* CObjectList::net_Find(u16 ID) { -xr_map::iterator it = map_NETID.find(ID); +xr_map::iterator it = map_NETID.find(ID); return (it==map_NETID.end())?0:it->second; } */ @@ -446,7 +443,7 @@ void CObjectList::Unload() // Destroy objects while (objects_sleeping.size()) { - CObject* O = objects_sleeping.back(); + IGameObject* O = objects_sleeping.back(); Msg("! [%x] s[%4d]-[%s]-[%s]", O, O->ID(), *O->cNameSect(), *O->cName()); O->setDestroy(true); @@ -459,7 +456,7 @@ void CObjectList::Unload() } while (objects_active.size()) { - CObject* O = objects_active.back(); + IGameObject* O = objects_active.back(); Msg("! [%x] a[%4d]-[%s]-[%s]", O, O->ID(), *O->cNameSect(), *O->cName()); O->setDestroy(true); @@ -472,15 +469,15 @@ void CObjectList::Unload() } } -CObject* CObjectList::Create(LPCSTR name) +IGameObject* CObjectList::Create(LPCSTR name) { - CObject* O = g_pGamePersistent->ObjectPool.create(name); + IGameObject* O = g_pGamePersistent->ObjectPool.create(name); // Msg("CObjectList::Create [%x]%s", O, name); objects_sleeping.push_back(O); return O; } -void CObjectList::Destroy(CObject* O) +void CObjectList::Destroy(IGameObject* O) { if (0 == O) return; net_Unregister(O); @@ -593,7 +590,7 @@ bool CObjectList::dump_all_objects() return false; } -void CObjectList::register_object_to_destroy(CObject* object_to_destroy) +void CObjectList::register_object_to_destroy(IGameObject* object_to_destroy) { VERIFY(!registered_object_to_destroy(object_to_destroy)); // Msg("CObjectList::register_object_to_destroy [%x]", object_to_destroy); @@ -603,7 +600,7 @@ void CObjectList::register_object_to_destroy(CObject* object_to_destroy) Objects::iterator it_e = objects_active.end(); for (; it != it_e; ++it) { - CObject* O = *it; + IGameObject* O = *it; if (!O->getDestroy() && O->H_Parent() == object_to_destroy) { Msg("setDestroy called, but not-destroyed child found parent[%d] child[%d]", object_to_destroy->ID(), O->ID(), Device.dwFrame); @@ -615,7 +612,7 @@ void CObjectList::register_object_to_destroy(CObject* object_to_destroy) it_e = objects_sleeping.end(); for (; it != it_e; ++it) { - CObject* O = *it; + IGameObject* O = *it; if (!O->getDestroy() && O->H_Parent() == object_to_destroy) { Msg("setDestroy called, but not-destroyed child found parent[%d] child[%d]", object_to_destroy->ID(), O->ID(), Device.dwFrame); @@ -625,7 +622,7 @@ void CObjectList::register_object_to_destroy(CObject* object_to_destroy) } #ifdef DEBUG -bool CObjectList::registered_object_to_destroy(const CObject* object_to_destroy) const +bool CObjectList::registered_object_to_destroy(const IGameObject* object_to_destroy) const { return ( std::find( diff --git a/src/xrEngine/xr_object_list.h b/src/xrEngine/xr_object_list.h index 0539e972bbf..0f95ac85046 100644 --- a/src/xrEngine/xr_object_list.h +++ b/src/xrEngine/xr_object_list.h @@ -1,8 +1,11 @@ #ifndef __XR_OBJECT_LIST_H__ #define __XR_OBJECT_LIST_H__ -// refs -class ENGINE_API CObject; +#ifdef DEBUG +extern ENGINE_API BOOL debug_destroy; +#endif + +class IGameObject; class NET_Packet; class ENGINE_API CObjectList @@ -30,8 +33,8 @@ class ENGINE_API CObjectList { Update.FrameEnd(); } }; private: - CObject* map_NETID[0xffff]; - typedef xr_vector Objects; + IGameObject* map_NETID[0xffff]; + typedef xr_vector Objects; Objects destroy_queue; Objects objects_active; Objects objects_sleeping; @@ -41,7 +44,7 @@ class ENGINE_API CObjectList u32 statsFrame; public: - typedef fastdelegate::FastDelegate1 RELCASE_CALLBACK; + typedef fastdelegate::FastDelegate1 RELCASE_CALLBACK; struct SRelcasePair { int* m_ID; @@ -66,27 +69,27 @@ class ENGINE_API CObjectList CObjectList(); ~CObjectList(); - CObject* FindObjectByName(shared_str name); - CObject* FindObjectByName(LPCSTR name); - CObject* FindObjectByCLS_ID(CLASS_ID cls); + IGameObject* FindObjectByName(shared_str name); + IGameObject* FindObjectByName(LPCSTR name); + IGameObject* FindObjectByCLS_ID(CLASS_ID cls); void Load(); void Unload(); - CObject* Create(LPCSTR name); - void Destroy(CObject* O); + IGameObject* Create(LPCSTR name); + void Destroy(IGameObject* O); private: - void SingleUpdate(CObject* O); + void SingleUpdate(IGameObject* O); public: void Update(bool bForce); - void net_Register(CObject* O); - void net_Unregister(CObject* O); + void net_Register(IGameObject* O); + void net_Unregister(IGameObject* O); u32 net_Export(NET_Packet* P, u32 _start, u32 _count); // return next start void net_Import(NET_Packet* P); - ICF CObject* net_Find(u16 ID) const + ICF IGameObject* net_Find(u16 ID) const { if (ID == u16(-1)) return (0); @@ -94,12 +97,12 @@ class ENGINE_API CObjectList return (map_NETID[ID]); } - void o_crow(CObject* O); - void o_remove(Objects& v, CObject* O); - void o_activate(CObject* O); - void o_sleep(CObject* O); + void o_crow(IGameObject* O); + void o_remove(Objects& v, IGameObject* O); + void o_activate(IGameObject* O); + void o_sleep(IGameObject* O); IC u32 o_count() { return objects_active.size() + objects_sleeping.size(); }; - IC CObject* o_get_by_iterator(u32 _it) + IC IGameObject* o_get_by_iterator(u32 _it) { if (_it < objects_active.size()) return objects_active[_it]; else return objects_sleeping[_it - objects_active.size()]; @@ -107,9 +110,9 @@ class ENGINE_API CObjectList bool dump_all_objects(); public: - void register_object_to_destroy(CObject* object_to_destroy); + void register_object_to_destroy(IGameObject* object_to_destroy); #ifdef DEBUG - bool registered_object_to_destroy(const CObject* object_to_destroy) const; + bool registered_object_to_destroy(const IGameObject* object_to_destroy) const; #endif // #ifdef DEBUG private: diff --git a/src/xrGame/ActivatingCharCollisionDelay.cpp b/src/xrGame/ActivatingCharCollisionDelay.cpp index 729f49f272f..3cd782e505d 100644 --- a/src/xrGame/ActivatingCharCollisionDelay.cpp +++ b/src/xrGame/ActivatingCharCollisionDelay.cpp @@ -39,7 +39,7 @@ bool activating_character_delay::do_position_correct() CPHMovementControl *m = char_support.movement(); VERIFY( m ); - CObject *obj = m->ParentObject(); + IGameObject *obj = m->ParentObject(); #ifdef DEBUG CEntityAlive* e_alife =smart_cast(obj); VERIFY(e_alife); diff --git a/src/xrGame/Actor.cpp b/src/xrGame/Actor.cpp index 0e35e078879..a556f5edc87 100644 --- a/src/xrGame/Actor.cpp +++ b/src/xrGame/Actor.cpp @@ -547,8 +547,8 @@ void CActor::Hit(SHit* pHDS) !g_dedicated_server && (HDS.hit_type == ALife::eHitTypeFireWound) ) { - CObject* pLastHitter = Level().Objects.net_Find(m_iLastHitterID); - CObject* pLastHittingWeapon = Level().Objects.net_Find(m_iLastHittingWeaponID); + IGameObject* pLastHitter = Level().Objects.net_Find(m_iLastHitterID); + IGameObject* pLastHittingWeapon = Level().Objects.net_Find(m_iLastHittingWeaponID); HitSector (pLastHitter, pLastHittingWeapon); } @@ -629,7 +629,7 @@ void CActor::Hit(SHit* pHDS) void CActor::HitMark (float P, Fvector dir, - CObject* who_object, + IGameObject* who_object, s16 element, Fvector position_in_bone_space, float impulse, @@ -696,7 +696,7 @@ void CActor::HitMark (float P, }//if hit_type } -void CActor::HitSignal(float perc, Fvector& vLocalDir, CObject* who, s16 element) +void CActor::HitSignal(float perc, Fvector& vLocalDir, IGameObject* who, s16 element) { if (g_Alive()) { @@ -719,7 +719,7 @@ void CActor::HitSignal(float perc, Fvector& vLocalDir, CObject* who, s16 element } } void start_tutorial(LPCSTR name); -void CActor::Die (CObject* who) +void CActor::Die (IGameObject* who) { #ifdef DEBUG Msg("--- Actor [%s] dies !", this->Name()); @@ -950,7 +950,7 @@ void CActor::UpdateCL () if(m_feel_touch_characters>0) { - for(xr_vector::iterator it = feel_touch.begin(); it != feel_touch.end(); it++) + for(xr_vector::iterator it = feel_touch.begin(); it != feel_touch.end(); it++) { CPhysicsShellHolder *sh = smart_cast(*it); if(sh&&sh->character_physics_support()) diff --git a/src/xrGame/Actor.h b/src/xrGame/Actor.h index bfad459fa2f..e45edbef28f 100644 --- a/src/xrGame/Actor.h +++ b/src/xrGame/Actor.h @@ -101,7 +101,7 @@ class CActor: // Render virtual void renderable_Render (); virtual BOOL renderable_ShadowGenerate (); - virtual void feel_sound_new (CObject* who, int type, CSound_UserDataPtr user_data, const Fvector& Position, float power); + virtual void feel_sound_new (IGameObject* who, int type, CSound_UserDataPtr user_data, const Fvector& Position, float power); virtual Feel::Sound* dcast_FeelSound () { return this; } float m_snd_noise; #ifdef DEBUG @@ -166,12 +166,12 @@ struct SDefNewsMsg{ virtual void OnPlayHeadShotParticle (NET_Packet P); - virtual void Die (CObject* who); + virtual void Die (IGameObject* who); virtual void Hit (SHit* pHDS); virtual void PHHit (SHit &H); - virtual void HitSignal (float P, Fvector &vLocalDir, CObject* who, s16 element); - void HitSector (CObject* who, CObject* weapon); - void HitMark (float P, Fvector dir, CObject* who, s16 element, Fvector position_in_bone_space, float impulse, ALife::EHitType hit_type); + virtual void HitSignal (float P, Fvector &vLocalDir, IGameObject* who, s16 element); + void HitSector (IGameObject* who, IGameObject* weapon); + void HitMark (float P, Fvector dir, IGameObject* who, s16 element, Fvector position_in_bone_space, float impulse, ALife::EHitType hit_type); void Feel_Grenade_Update( float rad ); @@ -333,10 +333,10 @@ struct SDefNewsMsg{ CActorCameraManager* m_pActorEffector; static float f_Ladder_cam_limit; public: - virtual void feel_touch_new (CObject* O); - virtual void feel_touch_delete (CObject* O); - virtual bool feel_touch_contact (CObject* O); - virtual bool feel_touch_on_contact (CObject* O); + virtual void feel_touch_new (IGameObject* O); + virtual void feel_touch_delete (IGameObject* O); + virtual bool feel_touch_contact (IGameObject* O); + virtual bool feel_touch_on_contact (IGameObject* O); CGameObject* ObjectWeLookingAt () {return m_pObjectWeLookingAt;} CInventoryOwner* PersonWeLookingAt () {return m_pPersonWeLookingAt;} @@ -369,7 +369,7 @@ struct SDefNewsMsg{ float m_fPickupInfoRadius; void PickupModeUpdate (); - void PickupInfoDraw (CObject* object); + void PickupInfoDraw (IGameObject* object); void PickupModeUpdate_COD (); ////////////////////////////////////////////////////////////////////////// @@ -490,8 +490,8 @@ struct SDefNewsMsg{ virtual void net_Import ( NET_Packet& P); // import from server virtual void net_Destroy (); virtual BOOL net_Relevant ();// { return getSVU() | getLocal(); }; // relevant for export to server - virtual void net_Relcase ( CObject* O ); // - virtual void xr_stdcall on_requested_spawn (CObject *object); + virtual void net_Relcase ( IGameObject* O ); // + virtual void xr_stdcall on_requested_spawn (IGameObject *object); //object serialization virtual void save (NET_Packet &output_packet); virtual void load (IReader &input_packet); @@ -627,7 +627,7 @@ virtual bool can_validate_position_on_spawn (){return false;} Fvector m_AutoPickUp_AABB_Offset; void Check_for_AutoPickUp (); - void SelectBestWeapon (CObject* O); + void SelectBestWeapon (IGameObject* O); public: void SetWeaponHideState (u16 State, bool bSet); private://IPhysicsShellHolder @@ -660,7 +660,7 @@ virtual void HideAllWeapons ( bool v ){ SetWeaponHideState(INV_STATE_BLOCK virtual bool Check_for_BackStab_Bone (u16 element); public: - virtual void SetHitInfo (CObject* who, CObject* weapon, s16 element, Fvector Pos, Fvector Dir); + virtual void SetHitInfo (IGameObject* who, IGameObject* weapon, s16 element, Fvector Pos, Fvector Dir); virtual void OnHitHealthLoss (float NewHealth); virtual void OnCriticalHitHealthLoss (); @@ -706,7 +706,7 @@ virtual void HideAllWeapons ( bool v ){ SetWeaponHideState(INV_STATE_BLOCK private: collide::rq_results RQR; - BOOL CanPickItem (const CFrustum& frustum, const Fvector& from, CObject* item); + BOOL CanPickItem (const CFrustum& frustum, const Fvector& from, IGameObject* item); xr_vector ISpatialResult; private: diff --git a/src/xrGame/ActorCondition.cpp b/src/xrGame/ActorCondition.cpp index b5d9e352739..c70d4cccfb6 100644 --- a/src/xrGame/ActorCondition.cpp +++ b/src/xrGame/ActorCondition.cpp @@ -334,7 +334,7 @@ void CActorCondition::AffectDamage_InjuriousMaterialAndMonstersInfluence() if ( pda ) { - typedef xr_vector monsters; + typedef xr_vector monsters; for ( monsters::const_iterator it = pda->feel_touch.begin(); it != pda->feel_touch.end(); diff --git a/src/xrGame/ActorHelmet.cpp b/src/xrGame/ActorHelmet.cpp index 78926154953..8f3425e4aa5 100644 --- a/src/xrGame/ActorHelmet.cpp +++ b/src/xrGame/ActorHelmet.cpp @@ -59,9 +59,9 @@ void CHelmet::Load(LPCSTR section) void CHelmet::ReloadBonesProtection() { - CObject* parent = H_Parent(); + IGameObject* parent = H_Parent(); if(IsGameTypeSingle()) - parent = smart_cast(Level().CurrentViewEntity()); + parent = smart_cast(Level().CurrentViewEntity()); if(parent && parent->Visual() && m_BonesProtectionSect.size()) m_boneProtection->reload( m_BonesProtectionSect, smart_cast(parent->Visual())); @@ -197,9 +197,9 @@ bool CHelmet::install_upgrade_impl( LPCSTR section, bool test ) void CHelmet::AddBonesProtection(LPCSTR bones_section) { - CObject* parent = H_Parent(); + IGameObject* parent = H_Parent(); if(IsGameTypeSingle()) - parent = smart_cast(Level().CurrentViewEntity()); + parent = smart_cast(Level().CurrentViewEntity()); if ( parent && parent->Visual() && m_BonesProtectionSect.size() ) m_boneProtection->add(bones_section, smart_cast( parent->Visual() ) ); diff --git a/src/xrGame/ActorVehicle.cpp b/src/xrGame/ActorVehicle.cpp index 37adfd23818..2950b87defc 100644 --- a/src/xrGame/ActorVehicle.cpp +++ b/src/xrGame/ActorVehicle.cpp @@ -130,7 +130,7 @@ bool CActor::use_Vehicle(CHolderCustom* object) } } -void CActor::on_requested_spawn(CObject *object) +void CActor::on_requested_spawn(IGameObject *object) { CCar * car= smart_cast(object); attach_Vehicle(car); diff --git a/src/xrGame/Actor_Events.cpp b/src/xrGame/Actor_Events.cpp index accd207450e..d224475ced7 100644 --- a/src/xrGame/Actor_Events.cpp +++ b/src/xrGame/Actor_Events.cpp @@ -34,7 +34,7 @@ void CActor::OnEvent(NET_Packet& P, u16 type) case GE_OWNERSHIP_TAKE: { P.r_u16 (id); - CObject* Obj = Level().Objects.net_Find (id); + IGameObject* Obj = Level().Objects.net_Find (id); // R_ASSERT2( Obj, make_string("GE_OWNERSHIP_TAKE: Object not found. object_id = [%d]", id).c_str() ); VERIFY2 ( Obj, make_string("GE_OWNERSHIP_TAKE: Object not found. object_id = [%d]", id).c_str() ); @@ -53,7 +53,7 @@ void CActor::OnEvent(NET_Packet& P, u16 type) if( inventory().CanTakeItem(smart_cast(_GO)) ) { - Obj->H_SetParent (smart_cast(this)); + Obj->H_SetParent (smart_cast(this)); #ifdef MP_LOGGING string64 act; @@ -84,7 +84,7 @@ void CActor::OnEvent(NET_Packet& P, u16 type) case GE_OWNERSHIP_REJECT: { P.r_u16 (id); - CObject* Obj = Level().Objects.net_Find (id); + IGameObject* Obj = Level().Objects.net_Find (id); // R_ASSERT2( Obj, make_string("GE_OWNERSHIP_REJECT: Object not found, id = %d", id).c_str() ); VERIFY2 ( Obj, make_string("GE_OWNERSHIP_REJECT: Object not found, id = %d", id).c_str() ); @@ -185,7 +185,7 @@ void CActor::OnEvent(NET_Packet& P, u16 type) case GEG_PLAYER_ACTIVATEARTEFACT: { P.r_u16 (id); - CObject* Obj = Level().Objects.net_Find (id); + IGameObject* Obj = Level().Objects.net_Find (id); // R_ASSERT2( Obj, make_string("GEG_PLAYER_ITEM_EAT(use): Object not found. object_id = [%d]", id).c_str() ); VERIFY2 ( Obj, make_string("GEG_PLAYER_ITEM_EAT(use): Object not found. object_id = [%d]", id).c_str() ); @@ -291,7 +291,7 @@ void CActor::OnEvent(NET_Packet& P, u16 type) case GEG_PLAYER_ATTACH_HOLDER: { u16 id = P.r_u16(); - CObject* O = Level().Objects.net_Find (id); + IGameObject* O = Level().Objects.net_Find (id); if (!O){ Msg("! Error: No object to attach holder [%d]", id); break; diff --git a/src/xrGame/Actor_Feel.cpp b/src/xrGame/Actor_Feel.cpp index 4376a4a7c54..c235eb3a805 100644 --- a/src/xrGame/Actor_Feel.cpp +++ b/src/xrGame/Actor_Feel.cpp @@ -19,20 +19,20 @@ #define PICKUP_INFO_COLOR 0xFFDDDDDD -void CActor::feel_touch_new (CObject* O) +void CActor::feel_touch_new (IGameObject* O) { CPhysicsShellHolder* sh=smart_cast(O); if(sh&&sh->character_physics_support()) m_feel_touch_characters++; } -void CActor::feel_touch_delete (CObject* O) +void CActor::feel_touch_delete (IGameObject* O) { CPhysicsShellHolder* sh=smart_cast(O); if(sh&&sh->character_physics_support()) m_feel_touch_characters--; } -bool CActor::feel_touch_contact (CObject *O) +bool CActor::feel_touch_contact (IGameObject *O) { CInventoryItem *item = smart_cast(O); CInventoryOwner *inventory_owner = smart_cast(O); @@ -50,7 +50,7 @@ bool CActor::feel_touch_contact (CObject *O) return (false); } -bool CActor::feel_touch_on_contact (CObject *O) +bool CActor::feel_touch_on_contact (IGameObject *O) { CCustomZone *custom_zone = smart_cast(O); if (!custom_zone) @@ -75,7 +75,7 @@ ICF static BOOL info_trace_callback(collide::rq_result& result, LPVOID params) return TRUE; }else { //check obstacle flag - if(result.O->spatial.type&STYPE_OBSTACLE) + if(result.O->GetSpatialData().type&STYPE_OBSTACLE) bOverlaped = TRUE; return TRUE; @@ -91,7 +91,7 @@ ICF static BOOL info_trace_callback(collide::rq_result& result, LPVOID params) return FALSE; } -BOOL CActor::CanPickItem(const CFrustum& frustum, const Fvector& from, CObject* item) +BOOL CActor::CanPickItem(const CFrustum& frustum, const Fvector& from, IGameObject* item) { if(!item->getVisible()) return FALSE; @@ -136,7 +136,7 @@ void CActor::PickupModeUpdate() CFrustum frustum; frustum.CreateFromMatrix(Device.mFullTransform, FRUSTUM_P_LRTB|FRUSTUM_P_FAR); - for(xr_vector::iterator it = feel_touch.begin(); it != feel_touch.end(); it++) + for(xr_vector::iterator it = feel_touch.begin(); it != feel_touch.end(); it++) { if (CanPickItem(frustum, Device.vCameraPosition, *it)) PickupInfoDraw(*it); @@ -167,17 +167,17 @@ void CActor::PickupModeUpdate_COD () for (u32 o_it=0; o_it (spatial->dcast_CObject ()); + CInventoryItem* pIItem = smart_cast (spatial->dcast_GameObject ()); if (0 == pIItem) continue; if (pIItem->object().H_Parent() != NULL) continue; if (!pIItem->CanTake()) continue; if ( smart_cast( &pIItem->object() ) ) continue; - CGrenade* pGrenade = smart_cast (spatial->dcast_CObject ()); + CGrenade* pGrenade = smart_cast (spatial->dcast_GameObject ()); if (pGrenade && !pGrenade->Useful()) continue; - CMissile* pMissile = smart_cast (spatial->dcast_CObject ()); + CMissile* pMissile = smart_cast (spatial->dcast_GameObject ()); if (pMissile && !pMissile->Useful()) continue; Fvector A, B, tmp; @@ -247,11 +247,11 @@ void CActor::Check_for_AutoPickUp() for (u32 o_it=0; o_it (spatial->dcast_CObject()); + CInventoryItem* pIItem = smart_cast (spatial->dcast_GameObject()); if (0 == pIItem) continue; if (!pIItem->CanTake()) continue; - if (Level().m_feel_deny.is_object_denied(spatial->dcast_CObject()) ) continue; + if (Level().m_feel_deny.is_object_denied(spatial->dcast_GameObject()) ) continue; CGrenade* pGrenade = smart_cast (pIItem); @@ -274,7 +274,7 @@ void CActor::Check_for_AutoPickUp() } -void CActor::PickupInfoDraw(CObject* object) +void CActor::PickupInfoDraw(IGameObject* object) { LPCSTR draw_str = NULL; @@ -302,7 +302,7 @@ void CActor::PickupInfoDraw(CObject* object) UI().Font().pFontLetterica16Russian->Out (x,y,draw_str); } -void CActor::feel_sound_new(CObject* who, int type, CSound_UserDataPtr user_data, const Fvector& Position, float power) +void CActor::feel_sound_new(IGameObject* who, int type, CSound_UserDataPtr user_data, const Fvector& Position, float power) { if(who == this) m_snd_noise = _max(m_snd_noise, power); @@ -321,8 +321,8 @@ void CActor::Feel_Grenade_Update( float rad ) q_nearest.clear_not_free(); g_pGameLevel->ObjectSpace.GetNearest( q_nearest, pos_actor, rad, NULL ); - xr_vector::iterator it_b = q_nearest.begin(); - xr_vector::iterator it_e = q_nearest.end(); + xr_vector::iterator it_b = q_nearest.begin(); + xr_vector::iterator it_e = q_nearest.end(); // select only grenade for ( ; it_b != it_e; ++it_b ) diff --git a/src/xrGame/Actor_Movement.cpp b/src/xrGame/Actor_Movement.cpp index 7a04ae028b0..58d4d8fa25f 100644 --- a/src/xrGame/Actor_Movement.cpp +++ b/src/xrGame/Actor_Movement.cpp @@ -298,7 +298,7 @@ void CActor::g_cl_CheckControls(u32 mstate_wf, Fvector &vControlAccel, float &Ju if(state_anm) { //play moving cam effect - CActor* control_entity = static_cast_checked(Level().CurrentControlEntity()); + CActor* control_entity = smart_cast(Level().CurrentControlEntity()); R_ASSERT2 (control_entity, "current control entity is NULL"); CEffectorCam* ec = control_entity->Cameras().GetCamEffector(eCEActorMoving); if(NULL==ec) diff --git a/src/xrGame/Actor_Network.cpp b/src/xrGame/Actor_Network.cpp index 6c6e29784c8..e8a9ed98772 100644 --- a/src/xrGame/Actor_Network.cpp +++ b/src/xrGame/Actor_Network.cpp @@ -757,7 +757,7 @@ void CActor::net_Destroy () destroy_physics_shell( actor_camera_shell ); } -void CActor::net_Relcase (CObject* O) +void CActor::net_Relcase (IGameObject* O) { VERIFY(O); @@ -1767,7 +1767,7 @@ BOOL CActor::net_SaveRelevant() } -void CActor::SetHitInfo (CObject* who, CObject* weapon, s16 element, Fvector Pos, Fvector Dir) +void CActor::SetHitInfo (IGameObject* who, IGameObject* weapon, s16 element, Fvector Pos, Fvector Dir) { m_iLastHitterID = (who!= NULL) ? who->ID() : u16(-1); m_iLastHittingWeaponID = (weapon != NULL) ? weapon->ID() : u16(-1); @@ -1805,8 +1805,8 @@ void CActor::OnCriticalHitHealthLoss () { if (GameID() == eGameIDSingle || !OnServer()) return; - CObject* pLastHitter = Level().Objects.net_Find(m_iLastHitterID); - CObject* pLastHittingWeapon = Level().Objects.net_Find(m_iLastHittingWeaponID); + IGameObject* pLastHitter = Level().Objects.net_Find(m_iLastHitterID); + IGameObject* pLastHittingWeapon = Level().Objects.net_Find(m_iLastHittingWeaponID); #ifdef DEBUG Msg("%s killed by hit from %s %s", diff --git a/src/xrGame/Actor_Weapon.cpp b/src/xrGame/Actor_Weapon.cpp index 6782b35720f..3282a93779b 100644 --- a/src/xrGame/Actor_Weapon.cpp +++ b/src/xrGame/Actor_Weapon.cpp @@ -119,7 +119,7 @@ static u16 BestWeaponSlots [] = { GRENADE_SLOT , // 3 KNIFE_SLOT , // 0 }; -void CActor::SelectBestWeapon (CObject* O) +void CActor::SelectBestWeapon (IGameObject* O) { if (!O) return; if ( IsGameTypeSingle() ) return; @@ -178,7 +178,7 @@ void CActor::SelectBestWeapon (CObject* O) #define ENEMY_HIT_SPOT "mp_hit_sector_location" BOOL g_bShowHitSectors = TRUE; -void CActor::HitSector(CObject* who, CObject* weapon) +void CActor::HitSector(IGameObject* who, IGameObject* weapon) { if (!g_bShowHitSectors) return; if (!g_Alive()) return; diff --git a/src/xrGame/BastArtifact.cpp b/src/xrGame/BastArtifact.cpp index 66429789eeb..25d6b91f37e 100644 --- a/src/xrGame/BastArtifact.cpp +++ b/src/xrGame/BastArtifact.cpp @@ -203,7 +203,7 @@ void CBastArtefact::UpdateCLChild() //void CBastArtefact::Hit(float P, Fvector &dir, -// CObject* who, s16 element, +// IGameObject* who, s16 element, // Fvector position_in_object_space, // float impulse, // ALife::EHitType hit_type) @@ -238,7 +238,7 @@ bool CBastArtefact::Useful() const } -void CBastArtefact::feel_touch_new(CObject* O) +void CBastArtefact::feel_touch_new(IGameObject* O) { CEntityAlive* pEntityAlive = smart_cast(O); @@ -248,7 +248,7 @@ void CBastArtefact::feel_touch_new(CObject* O) } } -void CBastArtefact::feel_touch_delete(CObject* O) +void CBastArtefact::feel_touch_delete(IGameObject* O) { CEntityAlive* pEntityAlive = smart_cast(O); @@ -260,7 +260,7 @@ void CBastArtefact::feel_touch_delete(CObject* O) } } -bool CBastArtefact::feel_touch_contact(CObject* O) +bool CBastArtefact::feel_touch_contact(IGameObject* O) { CEntityAlive* pEntityAlive = smart_cast(O); diff --git a/src/xrGame/BastArtifact.h b/src/xrGame/BastArtifact.h index 025a4dab7bf..61f2cbff08b 100644 --- a/src/xrGame/BastArtifact.h +++ b/src/xrGame/BastArtifact.h @@ -35,9 +35,9 @@ class CBastArtefact : public CArtefact, virtual bool Useful() const; - virtual void feel_touch_new (CObject* O); - virtual void feel_touch_delete (CObject* O); - virtual bool feel_touch_contact (CObject* O); + virtual void feel_touch_new (IGameObject* O); + virtual void feel_touch_delete (IGameObject* O); + virtual bool feel_touch_contact (IGameObject* O); bool IsAttacking() {return NULL!=m_AttakingEntity;} diff --git a/src/xrGame/BlackDrops.cpp b/src/xrGame/BlackDrops.cpp index 6be15e4b52c..73cfeef76b2 100644 --- a/src/xrGame/BlackDrops.cpp +++ b/src/xrGame/BlackDrops.cpp @@ -8,7 +8,7 @@ #include "xrPhysics/PhysicsShell.h" -CBlackDrops::CBlackDrops(void) +CBlackDrops::CBlackDrops(void) { } diff --git a/src/xrGame/BlackGraviArtifact.cpp b/src/xrGame/BlackGraviArtifact.cpp index a9a09dab3f3..1d6d590b5e2 100644 --- a/src/xrGame/BlackGraviArtifact.cpp +++ b/src/xrGame/BlackGraviArtifact.cpp @@ -77,7 +77,7 @@ struct SRP return obj==O; } }; -void CBlackGraviArtefact::net_Relcase(CObject* O) +void CBlackGraviArtefact::net_Relcase(IGameObject* O) { inherited::net_Relcase(O); //for vector @@ -116,7 +116,7 @@ void CBlackGraviArtefact::UpdateCLChild() } //void CBlackGraviArtefact::Hit(float P, Fvector &dir, -// CObject* who, s16 element, +// IGameObject* who, s16 element, // Fvector position_in_object_space, // float impulse, // ALife::EHitType hit_type) @@ -134,7 +134,7 @@ void CBlackGraviArtefact::Hit (SHit* pHDS) inherited::Hit(&HDS); } -void CBlackGraviArtefact::feel_touch_new(CObject* O) +void CBlackGraviArtefact::feel_touch_new(IGameObject* O) { CPhysicsShellHolder* pGameObject = smart_cast(O); CArtefact* pArtefact = smart_cast(O); @@ -145,9 +145,9 @@ void CBlackGraviArtefact::feel_touch_new(CObject* O) } } -void CBlackGraviArtefact::feel_touch_delete(CObject* O) +void CBlackGraviArtefact::feel_touch_delete(IGameObject* O) { - CGameObject* pGameObject = static_cast(O); + CGameObject* pGameObject = smart_cast(O); CArtefact* pArtefact = smart_cast(O); if(pGameObject && !pArtefact) @@ -158,9 +158,9 @@ void CBlackGraviArtefact::feel_touch_delete(CObject* O) } } -bool CBlackGraviArtefact::feel_touch_contact(CObject* O) +bool CBlackGraviArtefact::feel_touch_contact(IGameObject* O) { - CGameObject* pGameObject = static_cast(O); + CGameObject* pGameObject = smart_cast(O); if(pGameObject) return true; diff --git a/src/xrGame/BlackGraviArtifact.h b/src/xrGame/BlackGraviArtifact.h index 54200abf7c4..da093a7ac70 100644 --- a/src/xrGame/BlackGraviArtifact.h +++ b/src/xrGame/BlackGraviArtifact.h @@ -28,12 +28,12 @@ class CBlackGraviArtefact: public CGraviArtefact, virtual void Hit (SHit* pHDS); - virtual void feel_touch_new (CObject* O); - virtual void feel_touch_delete (CObject* O); - virtual bool feel_touch_contact (CObject* O); + virtual void feel_touch_new (IGameObject* O); + virtual void feel_touch_delete (IGameObject* O); + virtual bool feel_touch_contact (IGameObject* O); protected: - virtual void net_Relcase (CObject* O ); + virtual void net_Relcase (IGameObject* O ); virtual void UpdateCLChild (); //гравитационный удар по всем объектам в зоне досягаемости diff --git a/src/xrGame/Bolt.cpp b/src/xrGame/Bolt.cpp index 92229e0a9c2..1a76ac57c35 100644 --- a/src/xrGame/Bolt.cpp +++ b/src/xrGame/Bolt.cpp @@ -16,7 +16,7 @@ CBolt::~CBolt(void) void CBolt::OnH_A_Chield() { inherited::OnH_A_Chield(); - CObject* o= H_Parent()->H_Parent(); + IGameObject* o= H_Parent()->H_Parent(); if(o)SetInitiator(o->ID()); } diff --git a/src/xrGame/BreakableObject.cpp b/src/xrGame/BreakableObject.cpp index 20d0bb1fa76..1d50e142754 100644 --- a/src/xrGame/BreakableObject.cpp +++ b/src/xrGame/BreakableObject.cpp @@ -76,7 +76,7 @@ void CBreakableObject::enable_notificate() if(b_resived_damage)ProcessDamage(); } -//void CBreakableObject::Hit(float P,Fvector &dir, CObject* who,s16 element, +//void CBreakableObject::Hit(float P,Fvector &dir, IGameObject* who,s16 element, // Fvector p_in_object_space, float impulse, ALife::EHitType hit_type) void CBreakableObject::Hit (SHit* pHDS) { diff --git a/src/xrGame/CameraFirstEye.cpp b/src/xrGame/CameraFirstEye.cpp index 5b801a31c15..62d75ef6519 100644 --- a/src/xrGame/CameraFirstEye.cpp +++ b/src/xrGame/CameraFirstEye.cpp @@ -9,7 +9,7 @@ // Construction/Destruction ////////////////////////////////////////////////////////////////////// -CCameraFirstEye::CCameraFirstEye(CObject* p, u32 flags ) : CCameraBase(p, flags),lookat_active(false) +CCameraFirstEye::CCameraFirstEye(IGameObject* p, u32 flags ) : CCameraBase(p, flags),lookat_active(false) { } diff --git a/src/xrGame/CameraFirstEye.h b/src/xrGame/CameraFirstEye.h index 0d9e81052da..d863b4fc209 100644 --- a/src/xrGame/CameraFirstEye.h +++ b/src/xrGame/CameraFirstEye.h @@ -10,7 +10,7 @@ class CCameraFirstEye : public CCameraBase bool lookat_active; void UpdateLookat (); public: - CCameraFirstEye ( CObject* p, u32 flags=0); + CCameraFirstEye ( IGameObject* p, u32 flags=0); virtual ~CCameraFirstEye( ); virtual void Load (LPCSTR section); diff --git a/src/xrGame/CameraLook.cpp b/src/xrGame/CameraLook.cpp index 74a92a6f510..a20e3f2f40b 100644 --- a/src/xrGame/CameraLook.cpp +++ b/src/xrGame/CameraLook.cpp @@ -6,7 +6,7 @@ #include "xr_level_controller.h" #include "actor.h" -CCameraLook::CCameraLook(CObject* p, u32 flags ) +CCameraLook::CCameraLook(IGameObject* p, u32 flags ) :CCameraBase(p, flags) { } @@ -106,10 +106,10 @@ void CCameraLook2::Update(Fvector& point, Fvector&) for (; v_it!=vVisibles.end(); ++v_it) { - const CObject* _object_ = (*v_it).m_object; + const IGameObject* _object_ = (*v_it).m_object; if (!Actor()->memory().visual().visible_now(smart_cast(_object_))) continue; - CObject* object_ = const_cast(_object_); + IGameObject* object_ = const_cast(_object_); CEntityAlive* EA = smart_cast(object_); diff --git a/src/xrGame/CameraLook.h b/src/xrGame/CameraLook.h index eefb7e0bc5f..3cfa6e1b94c 100644 --- a/src/xrGame/CameraLook.h +++ b/src/xrGame/CameraLook.h @@ -9,7 +9,7 @@ class CCameraLook : public CCameraBase Fvector2 lim_zoom; float dist, prev_d; public: - CCameraLook ( CObject* p, u32 flags=0); + CCameraLook ( IGameObject* p, u32 flags=0); virtual ~CCameraLook ( ); virtual void Load (LPCSTR section); virtual void Move ( int cmd, float val=0, float factor=1.0f ); @@ -28,12 +28,12 @@ class CCameraLook2 : public CCameraLook public: static Fvector m_cam_offset; protected: - CObject* m_locked_enemy; + IGameObject* m_locked_enemy; Fvector2 m_autoaim_inertion_yaw; Fvector2 m_autoaim_inertion_pitch; void UpdateAutoAim (); public: - CCameraLook2 ( CObject* p, u32 flags=0):CCameraLook(p, flags){m_locked_enemy=NULL;}; + CCameraLook2 ( IGameObject* p, u32 flags=0):CCameraLook(p, flags){m_locked_enemy=NULL;}; virtual ~CCameraLook2 (){} virtual void OnActivate ( CCameraBase* old_cam ); virtual void Update ( Fvector& point, Fvector& noise_dangle ); @@ -44,7 +44,7 @@ class CCameraFixedLook : public CCameraLook { typedef CCameraLook inherited; public: - CCameraFixedLook(CObject* p, u32 flags=0) : CCameraLook(p, flags) {}; + CCameraFixedLook(IGameObject* p, u32 flags=0) : CCameraLook(p, flags) {}; virtual ~CCameraFixedLook() {}; virtual void Load (LPCSTR section); virtual void Move (int cmd, float val=0, float factor=1.0f); diff --git a/src/xrGame/Car.cpp b/src/xrGame/Car.cpp index 74686ba5e8c..b79b5138a02 100644 --- a/src/xrGame/Car.cpp +++ b/src/xrGame/Car.cpp @@ -518,7 +518,7 @@ void CCar::OnHUDDraw (CCustomHUD* /**hud*/) #endif } -//void CCar::Hit(float P,Fvector &dir,CObject * who,s16 element,Fvector p_in_object_space, float impulse, ALife::EHitType hit_type) +//void CCar::Hit(float P,Fvector &dir,IGameObject * who,s16 element,Fvector p_in_object_space, float impulse, ALife::EHitType hit_type) void CCar::Hit (SHit* pHDS) { @@ -1688,7 +1688,7 @@ void CCar::OnEvent(NET_Packet& P, u16 type) case GE_OWNERSHIP_TAKE: { P.r_u16 (id); - CObject* O = Level().Objects.net_Find (id); + IGameObject* O = Level().Objects.net_Find (id); if( GetInventory()->CanTakeItem(smart_cast(O)) ) { O->H_SetParent(this); @@ -1706,7 +1706,7 @@ void CCar::OnEvent(NET_Packet& P, u16 type) case GE_OWNERSHIP_REJECT: { P.r_u16 (id); - CObject* O = Level().Objects.net_Find (id); + IGameObject* O = Level().Objects.net_Find (id); bool just_before_destroy = !P.r_eof() && P.r_u8(); O->SetTmpPreDestroy (just_before_destroy); @@ -1969,7 +1969,7 @@ void CCar::GetRayExplosionSourcePos(Fvector &pos) { random_point_in_object_box(pos,this); } -void CCar::net_Relcase(CObject* O) +void CCar::net_Relcase(IGameObject* O) { CExplosive::net_Relcase(O); inherited::net_Relcase(O); @@ -2019,7 +2019,7 @@ u32 CCar::ExplodeTime () else return 0; } -void CCar:: Die (CObject* who) +void CCar:: Die (IGameObject* who) { inherited::Die(who); CarExplode(); diff --git a/src/xrGame/Car.h b/src/xrGame/Car.h index 8604c98abf0..f32a95bda24 100644 --- a/src/xrGame/Car.h +++ b/src/xrGame/Car.h @@ -515,7 +515,7 @@ IC size_t CurrentTransmission (){return m_current_transmission_num;} static void cb_Steer (CBoneInstance* B); virtual void Hit (SHit* pHDS); - virtual void Die (CObject* who); + virtual void Die (IGameObject* who); virtual void PHHit (SHit &H); bool WheelHit (float P,s16 element,ALife::EHitType hit_type); bool DoorHit (float P,s16 element,ALife::EHitType hit_type); @@ -556,7 +556,7 @@ IC size_t CurrentTransmission (){return m_current_transmission_num;} virtual void net_Import (NET_Packet& P); // import from server virtual BOOL net_Relevant () { return getLocal(); }; // relevant for export to server virtual BOOL UsedAI_Locations (); - virtual void net_Relcase (CObject* O ); + virtual void net_Relcase (IGameObject* O ); // Input virtual void OnMouseMove (int x, int y); virtual void OnKeyboardPress (int dik); @@ -582,7 +582,7 @@ IC size_t CurrentTransmission (){return m_current_transmission_num;} virtual float SetfHealth (float value) {return CEntity::SetfHealth(value);}; // Hits - virtual void HitSignal (float /**HitAmount/**/, Fvector& /**local_dir/**/, CObject* /**who/**/, s16 /**element/**/) {}; + virtual void HitSignal (float /**HitAmount/**/, Fvector& /**local_dir/**/, IGameObject* /**who/**/, s16 /**element/**/) {}; virtual void HitImpulse (float /**amount/**/, Fvector& /**vWorldDir/**/, Fvector& /**vLocalDir/**/) {}; virtual void g_fireParams (const CHudItem* /**pHudItem/**/, Fvector& /**P/**/, Fvector& /**D/**/) {}; virtual u16 Initiator (); diff --git a/src/xrGame/CarInput.cpp b/src/xrGame/CarInput.cpp index d1961dafa62..bbd8ba9161f 100644 --- a/src/xrGame/CarInput.cpp +++ b/src/xrGame/CarInput.cpp @@ -228,7 +228,7 @@ bool CCar::isObjectVisible (CScriptGameObject* O_) Msg("Attempt to call CCar::isObjectVisible method wihth passed NULL parameter"); return false; } - CObject* O = &O_->object(); + IGameObject* O = &O_->object(); Fvector dir_to_object; Fvector to_point; O->Center(to_point); diff --git a/src/xrGame/CharacterPhysicsSupport.cpp b/src/xrGame/CharacterPhysicsSupport.cpp index 2203fef1cd9..0824c73d6e5 100644 --- a/src/xrGame/CharacterPhysicsSupport.cpp +++ b/src/xrGame/CharacterPhysicsSupport.cpp @@ -575,9 +575,9 @@ IC void CCharacterPhysicsSupport:: UpdateDeathAnims () } } #ifdef DEBUG -void DBG_PhysBones( CObject &O ); -void DBG_DrawBones( CObject &O ); -void DBG_DrawBind ( CObject &O ); +void DBG_PhysBones( IGameObject &O ); +void DBG_DrawBones( IGameObject &O ); +void DBG_DrawBind ( IGameObject &O ); BOOL dbg_draw_character_bones =false; BOOL dbg_draw_character_physics =false; BOOL dbg_draw_character_binds =false; @@ -859,7 +859,7 @@ void CCharacterPhysicsSupport::update_animation_collision ( ) #ifdef DEBUG BOOL dbg_draw_ragdoll_spawn = FALSE; #endif -void CCharacterPhysicsSupport::ActivateShell ( CObject* who ) +void CCharacterPhysicsSupport::ActivateShell ( IGameObject* who ) { R_ASSERT( _valid(m_EntityAlife.Position( )) ); Fvector start;start.set( m_EntityAlife.Position( ) ); @@ -1061,7 +1061,7 @@ void CCharacterPhysicsSupport:: AddActiveWeaponCollision () //DBG_ClosedCashedDraw( 50000 ); } -void CCharacterPhysicsSupport:: CreateShell ( CObject* who, Fvector& dp, Fvector & velocity ) +void CCharacterPhysicsSupport:: CreateShell ( IGameObject* who, Fvector& dp, Fvector & velocity ) { xr_delete( m_collision_activating_delay ); xr_delete( m_interactive_animation ); @@ -1174,7 +1174,7 @@ void CCharacterPhysicsSupport:: CreateShell ( CObject* who, Fvector& dp, Fv m_pPhysicsShell->SetIgnoreSmall(); AddActiveWeaponCollision(); } -void CCharacterPhysicsSupport:: EndActivateFreeShell ( CObject* who, const Fvector& inital_entity_position, const Fvector& dp, const Fvector & velocity ) +void CCharacterPhysicsSupport:: EndActivateFreeShell ( IGameObject* who, const Fvector& inital_entity_position, const Fvector& dp, const Fvector & velocity ) { VERIFY ( m_pPhysicsShell ); VERIFY( m_eState==esDead ); @@ -1329,7 +1329,7 @@ void CCharacterPhysicsSupport::DestroyIKController() xr_delete(m_ik_controller); } -void CCharacterPhysicsSupport::in_NetRelcase(CObject* O) +void CCharacterPhysicsSupport::in_NetRelcase(IGameObject* O) { m_PhysicMovementControl->NetRelcase( O ); diff --git a/src/xrGame/CharacterPhysicsSupport.h b/src/xrGame/CharacterPhysicsSupport.h index ee62daa8a59..6a7547b59a5 100644 --- a/src/xrGame/CharacterPhysicsSupport.h +++ b/src/xrGame/CharacterPhysicsSupport.h @@ -134,7 +134,7 @@ IC CIKLimbsController *ik_controller ( ) { return m_ik_controller; } void in_NetSpawn ( CSE_Abstract* e ) ; void in_NetDestroy ( ) ; void destroy_imotion ( ); - void in_NetRelcase ( CObject* O ) ; + void in_NetRelcase ( IGameObject* O ) ; void in_Init ( ) ; void in_Load ( LPCSTR section ) ; void in_Hit ( SHit &H, bool is_killing=false ); @@ -167,13 +167,13 @@ virtual ~CCharacterPhysicsSupport ( ) ; private: void CreateSkeleton ( CPhysicsShell* &pShell ) ; - void ActivateShell ( CObject* who ) ; - void CreateShell ( CObject* who, Fvector& dp, Fvector & velocity ) ; + void ActivateShell ( IGameObject* who ) ; + void CreateShell ( IGameObject* who, Fvector& dp, Fvector & velocity ) ; void AddActiveWeaponCollision (); void RemoveActiveWeaponCollision (); void bone_chain_disable (u16 bone, u16 r_bone, IKinematics &K); void bone_fix_clear (); - void EndActivateFreeShell ( CObject* who, const Fvector& inital_entity_position, const Fvector& dp, const Fvector & velocity ) ; + void EndActivateFreeShell ( IGameObject* who, const Fvector& inital_entity_position, const Fvector& dp, const Fvector & velocity ) ; void KillHit ( SHit &H ) ; static void DeathAnimCallback ( CBlend *B ) ; void CreateIKController ( ) ; diff --git a/src/xrGame/ClimableObject.cpp b/src/xrGame/ClimableObject.cpp index 0d73a2dbe32..fe91c344aaf 100644 --- a/src/xrGame/ClimableObject.cpp +++ b/src/xrGame/ClimableObject.cpp @@ -86,7 +86,7 @@ BOOL CClimableObject:: net_Spawn ( CSE_Abstract* DC) shift.mul(f_min_width); XFORM().transform_dir(shift); - CObject::Position().sub(shift); + Position().sub(shift); m_box.xform_set(Fidentity); m_pStaticShell = P_BuildLeaderGeomShell(this, ObjectContactCallback, m_box ); diff --git a/src/xrGame/CustomDetector.cpp b/src/xrGame/CustomDetector.cpp index 2678e7ef4da..1483747489a 100644 --- a/src/xrGame/CustomDetector.cpp +++ b/src/xrGame/CustomDetector.cpp @@ -339,7 +339,7 @@ void CCustomDetector::UpdateNightVisionMode(bool b_on) { } -bool CAfList::feel_touch_contact (CObject* O) +bool CAfList::feel_touch_contact (IGameObject* O) { TypesMapIt it = m_TypesMap.find(O->cNameSect()); diff --git a/src/xrGame/CustomDetector.h b/src/xrGame/CustomDetector.h index 3aa92038f3d..6b8dde1386c 100644 --- a/src/xrGame/CustomDetector.h +++ b/src/xrGame/CustomDetector.h @@ -46,7 +46,7 @@ class CDetectList : public Feel::Touch ItemsMap m_ItemInfos; protected: - virtual void feel_touch_new (CObject* O) + virtual void feel_touch_new (IGameObject* O) { K* pK = smart_cast(O); R_ASSERT (pK); @@ -55,7 +55,7 @@ class CDetectList : public Feel::Touch m_ItemInfos[pK].snd_time = 0.0f; m_ItemInfos[pK].curr_ref = &(it->second); } - virtual void feel_touch_delete (CObject* O) + virtual void feel_touch_delete (IGameObject* O) { K* pK = smart_cast(O); R_ASSERT (pK); @@ -103,7 +103,7 @@ class CDetectList : public Feel::Touch class CAfList :public CDetectList { protected: - virtual bool feel_touch_contact (CObject* O); + virtual bool feel_touch_contact (IGameObject* O); public: CAfList ():m_af_rank(0){} int m_af_rank; @@ -169,7 +169,7 @@ class CCustomDetector : public CHudItemObject class CZoneList : public CDetectList { protected: - virtual bool feel_touch_contact( CObject* O ); + virtual bool feel_touch_contact( IGameObject* O ); public: CZoneList(); virtual ~CZoneList(); diff --git a/src/xrGame/CustomMonster.cpp b/src/xrGame/CustomMonster.cpp index bc4b9af349e..fea5c212f5a 100644 --- a/src/xrGame/CustomMonster.cpp +++ b/src/xrGame/CustomMonster.cpp @@ -565,7 +565,7 @@ void CCustomMonster::UpdatePositionAnimation() STOP_PROFILE } -BOOL CCustomMonster::feel_visible_isRelevant (CObject* O) +BOOL CCustomMonster::feel_visible_isRelevant (IGameObject* O) { CEntityAlive* E = smart_cast (O); if (0==E) return FALSE; @@ -680,11 +680,11 @@ void CCustomMonster::UpdateCamera() g_pGameLevel->Cameras().Update(eye_matrix.c,eye_matrix.k,eye_matrix.j,new_fov,.75f,new_range,0); } -void CCustomMonster::HitSignal(float /**perc/**/, Fvector& /**vLocalDir/**/, CObject* /**who/**/) +void CCustomMonster::HitSignal(float /**perc/**/, Fvector& /**vLocalDir/**/, IGameObject* /**who/**/) { } -void CCustomMonster::Die (CObject* who) +void CCustomMonster::Die (IGameObject* who) { inherited::Die (who); //Level().RemoveMapLocationByID(this->ID()); @@ -786,7 +786,7 @@ void CCustomMonster::Exec_Action(float /**dt/**/) { } -//void CCustomMonster::Hit(float P, Fvector &dir,CObject* who, s16 element,Fvector position_in_object_space, float impulse, ALife::EHitType hit_type) +//void CCustomMonster::Hit(float P, Fvector &dir,IGameObject* who, s16 element,Fvector position_in_object_space, float impulse, ALife::EHitType hit_type) void CCustomMonster::Hit (SHit* pHDS) { if (!invulnerable()) @@ -859,7 +859,7 @@ void CCustomMonster::PitchCorrection() } -bool CCustomMonster::feel_touch_on_contact (CObject *O) +bool CCustomMonster::feel_touch_on_contact (IGameObject *O) { CCustomZone *custom_zone = smart_cast(O); if (!custom_zone) @@ -874,7 +874,7 @@ bool CCustomMonster::feel_touch_on_contact (CObject *O) return (false); } -bool CCustomMonster::feel_touch_contact (CObject *O) +bool CCustomMonster::feel_touch_contact (IGameObject *O) { CCustomZone *custom_zone = smart_cast(O); if (!custom_zone) @@ -904,17 +904,17 @@ void CCustomMonster::load_killer_clsids(LPCSTR section) m_killer_clsids.push_back (TEXT2CLSID(_GetItem(killers,i,temp))); } -bool CCustomMonster::is_special_killer(CObject *obj) +bool CCustomMonster::is_special_killer(IGameObject *obj) { - return (obj && (std::find(m_killer_clsids.begin(),m_killer_clsids.end(),obj->CLS_ID) != m_killer_clsids.end())); + return (obj && (std::find(m_killer_clsids.begin(),m_killer_clsids.end(),obj->GetClassId()) != m_killer_clsids.end())); } -float CCustomMonster::feel_vision_mtl_transp(CObject* O, u32 element) +float CCustomMonster::feel_vision_mtl_transp(IGameObject* O, u32 element) { return (memory().visual().feel_vision_mtl_transp(O,element)); } -void CCustomMonster::feel_sound_new (CObject* who, int type, CSound_UserDataPtr user_data, const Fvector &position, float power) +void CCustomMonster::feel_sound_new (IGameObject* who, int type, CSound_UserDataPtr user_data, const Fvector &position, float power) { // Lain: added if (!g_Alive()) @@ -995,7 +995,7 @@ IFactoryObject *CCustomMonster::_construct() return (this); } -void CCustomMonster::net_Relcase (CObject *object) +void CCustomMonster::net_Relcase (IGameObject *object) { inherited::net_Relcase (object); memory().remove_links (object); @@ -1099,7 +1099,7 @@ bool CCustomMonster::update_critical_wounded (const u16 &bone_id, const float &p #ifdef DEBUG extern void dbg_draw_frustum (float FOV, float _FAR, float A, Fvector &P, Fvector &D, Fvector &U); -void draw_visiblity_rays (CCustomMonster *self, const CObject *object, collide::rq_results& rq_storage); +void draw_visiblity_rays (CCustomMonster *self, const IGameObject *object, collide::rq_results& rq_storage); void CCustomMonster::OnRender() { diff --git a/src/xrGame/CustomMonster.h b/src/xrGame/CustomMonster.h index 8c97012f71f..d2070791b1c 100644 --- a/src/xrGame/CustomMonster.h +++ b/src/xrGame/CustomMonster.h @@ -114,8 +114,8 @@ class CCustomMonster : u32 NET_Time; // server time of last update //------------------------------ - virtual bool feel_touch_on_contact (CObject *); - virtual bool feel_touch_contact (CObject *); + virtual bool feel_touch_on_contact (IGameObject *); + virtual bool feel_touch_contact (IGameObject *); // utils void mk_orientation ( Fvector& dir, Fmatrix& mR ); void mk_rotation ( Fvector& dir, SRotation &R); @@ -142,9 +142,9 @@ class CCustomMonster : virtual IFactoryObject *_construct (); virtual BOOL net_Spawn ( CSE_Abstract* DC); - virtual void Die ( CObject* who); + virtual void Die ( IGameObject* who); - virtual void HitSignal ( float P, Fvector& vLocalDir, CObject* who); + virtual void HitSignal ( float P, Fvector& vLocalDir, IGameObject* who); virtual void g_WeaponBones (int &/**L/**/, int &/**R1/**/, int &/**R2/**/) {}; virtual void shedule_Update ( u32 DT ); virtual void UpdateCL ( ); @@ -152,7 +152,7 @@ class CCustomMonster : // Network virtual void net_Export (NET_Packet& P); // export to server virtual void net_Import (NET_Packet& P); // import from server - virtual void net_Relcase (CObject* O); + virtual void net_Relcase (IGameObject* O); virtual void SelectAnimation ( const Fvector& _view, const Fvector& _move, float speed ) = 0; @@ -175,8 +175,8 @@ class CCustomMonster : virtual float ffGetRange () const {return eye_range;} void set_fov (float new_fov); void set_range (float new_range); -// virtual void feel_touch_new (CObject *O); - virtual BOOL feel_visible_isRelevant (CObject *O); +// virtual void feel_touch_new (IGameObject *O); + virtual BOOL feel_visible_isRelevant (IGameObject *O); virtual Feel::Sound* dcast_FeelSound () { return this; } virtual void Hit (SHit* pHDS); @@ -215,11 +215,11 @@ class CCustomMonster : virtual CScriptEntity* cast_script_entity () {return this;} void load_killer_clsids (LPCSTR section); - bool is_special_killer (CObject *obj); + bool is_special_killer (IGameObject *obj); IC CMemoryManager &memory () const; - virtual float feel_vision_mtl_transp (CObject* O, u32 element); - virtual void feel_sound_new (CObject* who, int type, CSound_UserDataPtr user_data, const Fvector &Position, float power); + virtual float feel_vision_mtl_transp (IGameObject* O, u32 element); + virtual void feel_sound_new (IGameObject* who, int type, CSound_UserDataPtr user_data, const Fvector &Position, float power); virtual bool useful (const CItemManager *manager, const CGameObject *object) const; virtual float evaluate (const CItemManager *manager, const CGameObject *object) const; diff --git a/src/xrGame/CustomOutfit.cpp b/src/xrGame/CustomOutfit.cpp index a8ffcc11f6b..e662bca7d1d 100644 --- a/src/xrGame/CustomOutfit.cpp +++ b/src/xrGame/CustomOutfit.cpp @@ -113,9 +113,9 @@ void CCustomOutfit::Load(LPCSTR section) void CCustomOutfit::ReloadBonesProtection() { - CObject* parent = H_Parent(); + IGameObject* parent = H_Parent(); if(IsGameTypeSingle()) - parent = smart_cast(Level().CurrentViewEntity()); + parent = smart_cast(Level().CurrentViewEntity()); if(parent && parent->Visual() && m_BonesProtectionSect.size()) m_boneProtection->reload( m_BonesProtectionSect, smart_cast(parent->Visual())); @@ -347,9 +347,9 @@ bool CCustomOutfit::install_upgrade_impl( LPCSTR section, bool test ) void CCustomOutfit::AddBonesProtection(LPCSTR bones_section) { - CObject* parent = H_Parent(); + IGameObject* parent = H_Parent(); if(IsGameTypeSingle()) - parent = smart_cast(Level().CurrentViewEntity()); + parent = smart_cast(Level().CurrentViewEntity()); if ( parent && parent->Visual() && m_BonesProtectionSect.size() ) m_boneProtection->add(bones_section, smart_cast( parent->Visual() ) ); diff --git a/src/xrGame/CustomZone.cpp b/src/xrGame/CustomZone.cpp index 0b28a38cd21..edb14c3b6f5 100644 --- a/src/xrGame/CustomZone.cpp +++ b/src/xrGame/CustomZone.cpp @@ -566,7 +566,7 @@ void CCustomZone::CheckForAwaking() SwitchZoneState(eZoneStateAwaking); } -void CCustomZone::feel_touch_new (CObject* O) +void CCustomZone::feel_touch_new (IGameObject* O) { // if(smart_cast(O) && O == Level().CurrentEntity()) // m_pLocalActor = smart_cast(O); @@ -604,7 +604,7 @@ void CCustomZone::feel_touch_new (CObject* O) } }; -void CCustomZone::feel_touch_delete(CObject* O) +void CCustomZone::feel_touch_delete(IGameObject* O) { CGameObject* pGameObject =smart_cast(O); if(!pGameObject->getDestroy()) @@ -620,7 +620,7 @@ void CCustomZone::feel_touch_delete(CObject* O) } } -bool CCustomZone::feel_touch_contact(CObject* O) +bool CCustomZone::feel_touch_contact(IGameObject* O) { if (smart_cast(O)) return FALSE; if (smart_cast(O)) return FALSE; @@ -1270,7 +1270,7 @@ void CCustomZone::CreateHit ( u16 id_to, }; } -void CCustomZone::net_Relcase(CObject* O) +void CCustomZone::net_Relcase(IGameObject* O) { CGameObject* GO = smart_cast(O); OBJECT_INFO_VEC_IT it = std::find(m_ObjectInfoMap.begin(),m_ObjectInfoMap.end(), GO); @@ -1391,7 +1391,7 @@ void CCustomZone::GoEnabledState() u_EventSend (P); } -bool CCustomZone::feel_touch_on_contact (CObject *O) +bool CCustomZone::feel_touch_on_contact (IGameObject *O) { if ((spatial.type | STYPE_VISIBLEFORAI) != spatial.type) return (false); diff --git a/src/xrGame/CustomZone.h b/src/xrGame/CustomZone.h index 27fc82b2c5d..67f77275e87 100644 --- a/src/xrGame/CustomZone.h +++ b/src/xrGame/CustomZone.h @@ -57,13 +57,13 @@ class CCustomZone : public CSpaceRestrictor, virtual void shedule_Update (u32 dt); virtual void enter_Zone (SZoneObjectInfo& io); virtual void exit_Zone (SZoneObjectInfo& io); - virtual void feel_touch_new (CObject* O); - virtual void feel_touch_delete (CObject* O); - virtual bool feel_touch_contact (CObject* O); - virtual bool feel_touch_on_contact (CObject* O); + virtual void feel_touch_new (IGameObject* O); + virtual void feel_touch_delete (IGameObject* O); + virtual bool feel_touch_contact (IGameObject* O); + virtual bool feel_touch_on_contact (IGameObject* O); float effective_radius (float nearest_shape_radius); - virtual void net_Relcase (CObject* O); + virtual void net_Relcase (IGameObject* O); virtual void OnEvent (NET_Packet& P, u16 type); float GetMaxPower () {return m_fMaxPower;} diff --git a/src/xrGame/DBG_Car.cpp b/src/xrGame/DBG_Car.cpp index 3bffe43cf52..e1bcdc89a39 100644 --- a/src/xrGame/DBG_Car.cpp +++ b/src/xrGame/DBG_Car.cpp @@ -17,7 +17,7 @@ void CCar::InitDebug() } void CCar::DbgSheduleUpdate() { - if(ph_dbg_draw_mask.test(phDbgDrawCarPlots)&&m_pPhysicsShell&&OwnerActor()&&static_cast(Owner())==Level().CurrentViewEntity()) + if(ph_dbg_draw_mask.test(phDbgDrawCarPlots)&&m_pPhysicsShell&&OwnerActor()&&static_cast(Owner())==Level().CurrentViewEntity()) { DbgCreatePlots(); } @@ -105,7 +105,7 @@ void CCar::DBgClearPlots() void CCar::DbgUbdateCl() { - if(m_pPhysicsShell&&OwnerActor()&&static_cast(Owner())==Level().CurrentViewEntity()) + if(m_pPhysicsShell&&OwnerActor()&&static_cast(Owner())==Level().CurrentViewEntity()) { if(ph_dbg_draw_mask.test(phDbgDrawCarDynamics)) { diff --git a/src/xrGame/DestroyablePhysicsObject.cpp b/src/xrGame/DestroyablePhysicsObject.cpp index e5c3c1f3b88..8cc1b87a0d7 100644 --- a/src/xrGame/DestroyablePhysicsObject.cpp +++ b/src/xrGame/DestroyablePhysicsObject.cpp @@ -70,7 +70,7 @@ BOOL CDestroyablePhysicsObject::net_Spawn(CSE_Abstract* DC) return res; } -//void CDestroyablePhysicsObject::Hit (float P,Fvector &dir,CObject *who,s16 element,Fvector p_in_object_space, float impulse, ALife::EHitType hit_type) +//void CDestroyablePhysicsObject::Hit (float P,Fvector &dir,IGameObject *who,s16 element,Fvector p_in_object_space, float impulse, ALife::EHitType hit_type) void CDestroyablePhysicsObject::Hit (SHit* pHDS) { SHit HDS = *pHDS; diff --git a/src/xrGame/Entity.cpp b/src/xrGame/Entity.cpp index 1c0026b2bd9..fa1af8effe0 100644 --- a/src/xrGame/Entity.cpp +++ b/src/xrGame/Entity.cpp @@ -58,7 +58,7 @@ void CEntity::OnEvent (NET_Packet& P, u16 type) u32 cl; P.r_u16 (id); P.r_u32 (cl); - CObject *who = Level().Objects.net_Find (id); + IGameObject *who = Level().Objects.net_Find (id); if (who && !IsGameTypeSingle()) { if (this!=who) /*if(bDebug) */ Msg( "%s killed by %s ...", cName().c_str(), who->cName().c_str() ); @@ -70,7 +70,7 @@ void CEntity::OnEvent (NET_Packet& P, u16 type) } } -void CEntity::Die(CObject* who) +void CEntity::Die(IGameObject* who) { if (!AlreadyDie()) set_death_time(); set_ready_to_save (); @@ -100,7 +100,7 @@ float CEntity::CalcCondition(float hit) -//void CEntity::Hit (float perc, Fvector &dir, CObject* who, s16 element,Fvector position_in_object_space, float impulse, ALife::EHitType hit_type) +//void CEntity::Hit (float perc, Fvector &dir, IGameObject* who, s16 element,Fvector position_in_object_space, float impulse, ALife::EHitType hit_type) void CEntity::Hit (SHit* pHDS) { @@ -251,10 +251,10 @@ void CEntity::KillEntity(u16 whoID) if (m_killer_id != ALife::_OBJECT_ID(-1)) { Msg ("! Entity [%s][%s] already has killer with id %d, but new killer id arrived - %d",*cNameSect(),*cName(),m_killer_id,whoID); - CObject *old_killer = Level().Objects.net_Find(m_killer_id); + IGameObject *old_killer = Level().Objects.net_Find(m_killer_id); Msg ("! Old killer is %s",old_killer ? *old_killer->cName() : "unknown"); - CObject *new_killer = Level().Objects.net_Find(whoID); + IGameObject *new_killer = Level().Objects.net_Find(whoID); Msg ("! New killer is %s",new_killer ? *new_killer->cName() : "unknown"); VERIFY (m_killer_id == ALife::_OBJECT_ID(-1)); @@ -280,7 +280,7 @@ void CEntity::KillEntity(u16 whoID) } }; -//void CEntity::KillEntity(CObject* who) +//void CEntity::KillEntity(IGameObject* who) //{ // VERIFY (who); // if (who) KillEntity(who->ID()); diff --git a/src/xrGame/Entity.h b/src/xrGame/Entity.h index 7169923a278..60a78747065 100644 --- a/src/xrGame/Entity.h +++ b/src/xrGame/Entity.h @@ -93,11 +93,11 @@ class CEntity : // Health calculations virtual void Hit (SHit* pHDS); - virtual void HitSignal (float P, Fvector &local_dir, CObject* who, s16 element) = 0; + virtual void HitSignal (float P, Fvector &local_dir, IGameObject* who, s16 element) = 0; virtual void HitImpulse (float P, Fvector &vWorldDir, Fvector& vLocalDir) = 0; - virtual void Die (CObject* who); -// void KillEntity (CObject* who); + virtual void Die (IGameObject* who); +// void KillEntity (IGameObject* who); void KillEntity (u16 whoID); // Events diff --git a/src/xrGame/EntityCondition.cpp b/src/xrGame/EntityCondition.cpp index 9fe9ea81bca..1697976020c 100644 --- a/src/xrGame/EntityCondition.cpp +++ b/src/xrGame/EntityCondition.cpp @@ -630,7 +630,7 @@ void CEntityCondition::SConditionChangeV::load(LPCSTR sect, LPCSTR prefix) m_fV_HealthRestore = READ_IF_EXISTS(pSettings,r_float,sect, str,0.0f); } -void CEntityCondition::remove_links (const CObject *object) +void CEntityCondition::remove_links (const IGameObject *object) { if (m_pWho != object) return; diff --git a/src/xrGame/EntityCondition.h b/src/xrGame/EntityCondition.h index b8ac9e8945f..ffe505a802a 100644 --- a/src/xrGame/EntityCondition.h +++ b/src/xrGame/EntityCondition.h @@ -101,7 +101,7 @@ class CEntityCondition: public CEntityConditionSimple, public CHitImmunity virtual void LoadCondition (LPCSTR section); virtual void LoadTwoHitsDeathParams (LPCSTR section); - virtual void remove_links (const CObject *object); + virtual void remove_links (const IGameObject *object); virtual void save (NET_Packet &output_packet); virtual void load (IReader &input_packet); @@ -144,7 +144,7 @@ class CEntityCondition: public CEntityConditionSimple, public CHitImmunity //скорость потери крови из всех открытых ран float BleedingSpeed (); - CObject* GetWhoHitLastTime () {return m_pWho;} + IGameObject* GetWhoHitLastTime () {return m_pWho;} u16 GetWhoHitLastTimeID () {return m_iWhoID;} CWound* AddWound (float hit_power, ALife::EHitType hit_type, u16 element); @@ -250,7 +250,7 @@ class CEntityCondition: public CEntityConditionSimple, public CHitImmunity u64 m_iLastTimeCalled; float m_fDeltaTime; //кто нанес последний хит - CObject* m_pWho; + IGameObject* m_pWho; u16 m_iWhoID; //для передачи параметров из DamageManager diff --git a/src/xrGame/Explosive.cpp b/src/xrGame/Explosive.cpp index 99264369de9..991151e22de 100644 --- a/src/xrGame/Explosive.cpp +++ b/src/xrGame/Explosive.cpp @@ -290,7 +290,7 @@ float CExplosive::ExplosionEffect(collide::rq_results& storage, CExplosive*exp_o return effect/TEST_RAYS_PER_OBJECT; } -float CExplosive::TestPassEffect(const Fvector &source_p, const Fvector &dir,float range,float ef_radius,collide::rq_results& storage, CObject* blasted_obj) +float CExplosive::TestPassEffect(const Fvector &source_p, const Fvector &dir,float range,float ef_radius,collide::rq_results& storage, IGameObject* blasted_obj) { float sq_ef_radius=ef_radius*ef_radius; float dist_factor = sq_ef_radius/(range*range*(exp_dist_extinction_factor-1.f)+sq_ef_radius); @@ -401,9 +401,9 @@ void CExplosive::Explode() for (u32 o_it=0; o_itdcast_CObject()); + // feel_touch_new(spatial->dcast_GameObject()); - CPhysicsShellHolder *pGameObject = smart_cast(spatial->dcast_CObject()); + CPhysicsShellHolder *pGameObject = smart_cast(spatial->dcast_GameObject()); if(pGameObject && cast_game_object()->ID() != pGameObject->ID()) m_blasted_objects.push_back(pGameObject); } @@ -752,7 +752,7 @@ void CExplosive::ActivateExplosionBox(const Fvector &size,Fvector &in_out_pos) ActivateShapeExplosive( self_obj, size, m_vExplodeSize, in_out_pos ); if(self_shell&&self_shell->isActive())self_shell->EnableCollision(); } -void CExplosive::net_Relcase(CObject* O) +void CExplosive::net_Relcase(IGameObject* O) { if (GameID() == eGameIDSingle) { diff --git a/src/xrGame/Explosive.h b/src/xrGame/Explosive.h index 62fba3ac101..33478b970ca 100644 --- a/src/xrGame/Explosive.h +++ b/src/xrGame/Explosive.h @@ -28,7 +28,7 @@ class CExplosive : virtual void Load(CInifile const * ini,LPCSTR section); virtual void net_Destroy (); - virtual void net_Relcase (CObject* O); + virtual void net_Relcase (IGameObject* O); virtual void UpdateCL(); virtual void Explode(); virtual void ExplodeParams (const Fvector& pos, const Fvector& dir); @@ -70,7 +70,7 @@ static void GetRaySourcePos (CExplosive *exp_obj,const Fvector &expl_centr void ExplodeWaveProcessObject(collide::rq_results& storage,CPhysicsShellHolder*sh); void ExplodeWaveProcess (); -static float TestPassEffect (const Fvector &source_p, const Fvector &dir,float range,float ef_radius,collide::rq_results& storage, CObject* blasted_obj); +static float TestPassEffect (const Fvector &source_p, const Fvector &dir,float range,float ef_radius,collide::rq_results& storage, IGameObject* blasted_obj); void LightCreate (); void LightDestroy (); protected: @@ -160,7 +160,7 @@ static float TestPassEffect (const Fvector &source_p, const Fvector &dir,f } effector; }; -IC void random_point_in_object_box(Fvector &out_pos,CObject* obj) +IC void random_point_in_object_box(Fvector &out_pos,IGameObject* obj) { const Fbox &l_b1 = obj->BoundingBox(); Fvector l_c, l_d;l_b1.get_CD(l_c,l_d); diff --git a/src/xrGame/ExplosiveItem.cpp b/src/xrGame/ExplosiveItem.cpp index dec9b8cc5e9..a25a7d08da8 100644 --- a/src/xrGame/ExplosiveItem.cpp +++ b/src/xrGame/ExplosiveItem.cpp @@ -31,7 +31,7 @@ void CExplosiveItem::net_Destroy() CExplosive::net_Destroy(); } -//void CExplosiveItem::Hit(float P, Fvector &dir, CObject* who, s16 element, +//void CExplosiveItem::Hit(float P, Fvector &dir, IGameObject* who, s16 element, // Fvector position_in_object_space, float impulse, // ALife::EHitType hit_type) void CExplosiveItem::Hit (SHit* pHDS) @@ -87,7 +87,7 @@ void CExplosiveItem::renderable_Render() { inherited::renderable_Render(); } -void CExplosiveItem::net_Relcase(CObject* O ) +void CExplosiveItem::net_Relcase(IGameObject* O ) { CExplosive::net_Relcase(O); inherited::net_Relcase(O); diff --git a/src/xrGame/ExplosiveItem.h b/src/xrGame/ExplosiveItem.h index 2ac66613ec0..ddace2d07e8 100644 --- a/src/xrGame/ExplosiveItem.h +++ b/src/xrGame/ExplosiveItem.h @@ -26,7 +26,7 @@ class CExplosiveItem: virtual void net_Destroy () ; virtual void net_Export (NET_Packet& P) {CInventoryItemObject::net_Export(P);} virtual void net_Import (NET_Packet& P) {CInventoryItemObject::net_Import(P);} - virtual void net_Relcase (CObject* O ) ; + virtual void net_Relcase (IGameObject* O ) ; virtual CGameObject *cast_game_object () {return this;} virtual CExplosive* cast_explosive () {return this;} virtual IDamageSource* cast_IDamageSource () {return CExplosive::cast_IDamageSource();} diff --git a/src/xrGame/ExplosiveRocket.cpp b/src/xrGame/ExplosiveRocket.cpp index bfa719b44f8..266dbda5316 100644 --- a/src/xrGame/ExplosiveRocket.cpp +++ b/src/xrGame/ExplosiveRocket.cpp @@ -180,7 +180,7 @@ bool CExplosiveRocket::Useful () const { return (inherited::Useful()); } -void CExplosiveRocket::net_Relcase(CObject* O ) +void CExplosiveRocket::net_Relcase(IGameObject* O ) { CExplosive::net_Relcase(O); inherited::net_Relcase(O); diff --git a/src/xrGame/ExplosiveRocket.h b/src/xrGame/ExplosiveRocket.h index b82448a8cbd..f05fa3be381 100644 --- a/src/xrGame/ExplosiveRocket.h +++ b/src/xrGame/ExplosiveRocket.h @@ -34,7 +34,7 @@ class CExplosiveRocket : virtual void Load (LPCSTR section); virtual BOOL net_Spawn (CSE_Abstract* DC); virtual void net_Destroy (); - virtual void net_Relcase (CObject* O ); + virtual void net_Relcase (IGameObject* O ); virtual void OnH_A_Independent (); virtual void OnH_B_Independent (bool just_before_destroy); virtual void UpdateCL (); diff --git a/src/xrGame/GameObject.cpp b/src/xrGame/GameObject.cpp index 8e88e366cbf..d936b0a0d6b 100644 --- a/src/xrGame/GameObject.cpp +++ b/src/xrGame/GameObject.cpp @@ -38,6 +38,13 @@ #include "doors_door.h" #include "doors.h" +#pragma warning(push) +#pragma warning(disable:4995) +#include +#pragma warning(pop) + +#pragma intrinsic(_InterlockedCompareExchange) + extern MagicBox3 MagicMinBox (int iQuantity, const Fvector* akPoint); #ifdef DEBUG @@ -47,12 +54,28 @@ extern MagicBox3 MagicMinBox (int iQuantity, const Fvector* akPoint); ENGINE_API bool g_dedicated_server; -CGameObject::CGameObject () : scriptBinder(this) +static const float base_spu_epsP = 0.05f; +static const float base_spu_epsR = 0.05f; + +CGameObject::CGameObject () : + SpatialBase(g_SpatialSpace), + scriptBinder(this) { + dwFrame_AsCrow = u32(-1); + Props.storage = 0; + Parent = nullptr; + NameObject = nullptr; + NameSection = nullptr; + NameVisual = nullptr; +#ifdef DEBUG + shedule.dbg_update_shedule = u32(-1)/2; + dbg_update_cl = u32(-1)/2; +#endif + // ~IGameObject ctor // CUsableScriptObject init m_bNonscriptUsable = true; set_tip_text_default(); - // ~ + // m_ai_obstacle = 0; init (); @@ -76,6 +99,156 @@ CGameObject::~CGameObject () xr_delete (m_ai_location); xr_delete (m_callbacks); xr_delete (m_ai_obstacle); + cNameVisual_set(0); + cName_set(0); + cNameSect_set(0); +} + +void CGameObject::MakeMeCrow() +{ + if (Props.crow) + return; + if (!processing_enabled()) + return; + u32 const device_frame_id = Device.dwFrame; + u32 const object_frame_id = dwFrame_AsCrow; + if ((u32)_InterlockedCompareExchange((long*)&dwFrame_AsCrow, device_frame_id, object_frame_id)==device_frame_id) + return; + VERIFY(dwFrame_AsCrow==device_frame_id); + Props.crow = 1; + g_pGameLevel->Objects.o_crow(this); +} + +void CGameObject::cName_set(shared_str N) +{ NameObject = N; } + +void CGameObject::cNameSect_set(shared_str N) +{ NameSection = N; } + +void CGameObject::cNameVisual_set(shared_str N) +{ + // check if equal + if (*N && *NameVisual) + if (N==NameVisual) return; + // replace model + if (*N && N[0]) + { + IRenderVisual* old_v = renderable.visual; + NameVisual = N; + renderable.visual = GlobalEnv.Render->model_Create(*N); + IKinematics* old_k = old_v ? old_v->dcast_PKinematics() : NULL; + IKinematics* new_k = renderable.visual->dcast_PKinematics(); + /* + if(old_k && new_k){ + new_k->Update_Callback = old_k->Update_Callback; + new_k->Update_Callback_Param = old_k->Update_Callback_Param; + } + */ + if (old_k && new_k) + { + new_k->SetUpdateCallback(old_k->GetUpdateCallback()); + new_k->SetUpdateCallbackParam(old_k->GetUpdateCallbackParam()); + } + GlobalEnv.Render->model_Delete(old_v); + } + else + { + GlobalEnv.Render->model_Delete(renderable.visual); + NameVisual = 0; + } + OnChangeVisual(); +} + +// flagging +void CGameObject::processing_activate() +{ + VERIFY3(255!=Props.bActiveCounter, "Invalid sequence of processing enable/disable calls: overflow", *cName()); + Props.bActiveCounter++; + if (!(Props.bActiveCounter-1)) + g_pGameLevel->Objects.o_activate(this); +} + +void CGameObject::processing_deactivate() +{ + VERIFY3(Props.bActiveCounter, "Invalid sequence of processing enable/disable calls: underflow", *cName()); + Props.bActiveCounter--; + if (!Props.bActiveCounter) + g_pGameLevel->Objects.o_sleep(this); +} + +void CGameObject::setEnabled(BOOL _enabled) +{ + if (_enabled) + { + Props.bEnabled = 1; + if (CForm) + spatial.type |= STYPE_COLLIDEABLE; + } + else + { + Props.bEnabled = 0; + spatial.type &= ~STYPE_COLLIDEABLE; + } +} + +void CGameObject::setVisible(BOOL _visible) +{ + if (_visible) + { + // Parent should control object visibility itself (??????) + Props.bVisible = 1; + if (renderable.visual) spatial.type |= STYPE_RENDERABLE; + } + else + { + Props.bVisible = 0; + spatial.type &= ~STYPE_RENDERABLE; + } +} + +void CGameObject::Center(Fvector& C) const +{ + VERIFY2(renderable.visual, *cName()); + renderable.xform.transform_tiny(C, renderable.visual->getVisData().sphere.P); +} + +float CGameObject::Radius() const +{ + VERIFY2(renderable.visual, *cName()); + return renderable.visual->getVisData().sphere.R; +} + +const Fbox& CGameObject::BoundingBox() const +{ + VERIFY2(renderable.visual, *cName()); + return renderable.visual->getVisData().box; +} + +void CGameObject::Load(LPCSTR section) +{ + // Name + R_ASSERT(section); + cName_set(section); + cNameSect_set(section); + // Visual and light-track + if (pSettings->line_exist(section, "visual")) + { + string_path tmp; + xr_strcpy(tmp, pSettings->r_string(section, "visual")); + if (strext(tmp)) + *strext(tmp) = 0; + xr_strlwr(tmp); + cNameVisual_set(tmp); + } + setVisible(false); + // ~ + ISpatial* self = smart_cast (this); + if (self) + { + // #pragma todo("to Dima: All objects are visible for AI ???") + // self->spatial.type |= STYPE_VISIBLEFORAI; + self->GetSpatialData().type &= ~STYPE_REACTTOSOUND; + } } void CGameObject::init () @@ -86,17 +259,6 @@ void CGameObject::init () m_spawned = false; } -void CGameObject::Load(LPCSTR section) -{ - inherited::Load (section); - ISpatial* self = smart_cast (this); - if (self) { - // #pragma todo("to Dima: All objects are visible for AI ???") - // self->spatial.type |= STYPE_VISIBLEFORAI; - self->GetSpatialData().type &= ~STYPE_REACTTOSOUND; - } -} - void CGameObject::reinit () { m_visual_callback.clear (); @@ -128,8 +290,16 @@ void CGameObject::net_Destroy () m_script_clsid = -1; if (Visual() && smart_cast(Visual())) smart_cast(Visual())->Callback (0,0); - - inherited::net_Destroy (); + // + VERIFY(getDestroy()); + xr_delete(CForm); + if (register_schedule()) + shedule_unregister(); + spatial_unregister(); + // setDestroy (true); // commented in original src + // remove visual + cNameVisual_set(0); + // ~ setReady (FALSE); if (Level().IsDemoPlayStarted() && ID() == u16(-1)) @@ -188,8 +358,8 @@ void CGameObject::OnEvent (NET_Packet& P, u16 type) P.r_float (ap); } - CObject* Hitter = Level().Objects.net_Find(id); - CObject* Weapon = Level().Objects.net_Find(weapon_id); + IGameObject* Hitter = Level().Objects.net_Find(id); + IGameObject* Weapon = Level().Objects.net_Find(weapon_id); SHit HDS = SHit(power, dir, Hitter, element, position_in_bone_space, impulse, (ALife::EHitType)hit_type, ap); */ @@ -197,8 +367,8 @@ void CGameObject::OnEvent (NET_Packet& P, u16 type) HDS.PACKET_TYPE = type; HDS.Read_Packet_Cont(P); // Msg("Hit received: %d[%d,%d]", HDS.whoID, HDS.weaponID, HDS.BulletID); - CObject* Hitter = Level().Objects.net_Find(HDS.whoID); - CObject* Weapon = Level().Objects.net_Find(HDS.weaponID); + IGameObject* Hitter = Level().Objects.net_Find(HDS.whoID); + IGameObject* Weapon = Level().Objects.net_Find(HDS.weaponID); HDS.who = Hitter; if (!HDS.who) { @@ -406,10 +576,29 @@ BOOL CGameObject::net_Spawn (CSE_Abstract* DC) } } } - inherited::net_Spawn (DC); - + // + PositionStack.clear(); + VERIFY(_valid(renderable.xform)); + if (0 == Visual() && pSettings->line_exist(cNameSect(), "visual")) + cNameVisual_set(pSettings->r_string(cNameSect(), "visual")); + if (0 == CForm) + { + if (pSettings->line_exist(cNameSect(), "cform")) + { + VERIFY3(*NameVisual, "Model isn't assigned for object, but cform requisted", *cName()); + CForm = xr_new(this); + } + } + R_ASSERT(spatial.space); + spatial_register(); + if (register_schedule()) + shedule_register(); + // reinitialize flags + processing_activate(); + setDestroy(false); + MakeMeCrow(); + // ~ m_bObjectRemoved = false; - spawn_supplies (); #ifdef DEBUG if(ph_dbg_draw_mask1.test(ph_m1_DbgTrackObject)&&stricmp(PH_DBG_ObjectTrackName(),*cName())==0) @@ -567,7 +756,7 @@ void CGameObject::setup_parent_ai_locations(bool assign_position) { // CGameObject *l_tpGameObject = static_cast(H_Root()); VERIFY (H_Parent()); - CGameObject *l_tpGameObject = static_cast(H_Parent()); + CGameObject *l_tpGameObject = smart_cast(H_Parent()); VERIFY (l_tpGameObject); // get parent's position @@ -640,6 +829,18 @@ void CGameObject::validate_ai_locations (bool decrement_reference) update_ai_locations (decrement_reference); } +void CGameObject::spatial_register() +{ + Center(spatial.sphere.P); + spatial.sphere.R = Radius(); + SpatialBase::spatial_register(); +} + +void CGameObject::spatial_unregister() +{ + SpatialBase::spatial_unregister(); +} + void CGameObject::spatial_move () { if (H_Parent()) @@ -647,8 +848,69 @@ void CGameObject::spatial_move () else if (Visual()) validate_ai_locations (); + // + Center(spatial.sphere.P); + spatial.sphere.R = Radius(); + SpatialBase::spatial_move(); +} + +void CGameObject::spatial_update(float eps_P, float eps_R) +{ + // + BOOL bUpdate = FALSE; + if (PositionStack.empty()) + { + // Empty + bUpdate = TRUE; + PositionStack.push_back(GameObjectSavedPosition()); + PositionStack.back().dwTime = Device.dwTimeGlobal; + PositionStack.back().vPosition = Position(); + } + else + { + if (PositionStack.back().vPosition.similar(Position(), eps_P)) + { + // Just update time + PositionStack.back().dwTime = Device.dwTimeGlobal; + } + else + { + // Register _new_ record + bUpdate = TRUE; + if (PositionStack.size() < 4) + { + PositionStack.push_back(GameObjectSavedPosition()); + } + else + { + PositionStack[0] = PositionStack[1]; + PositionStack[1] = PositionStack[2]; + PositionStack[2] = PositionStack[3]; + } + PositionStack.back().dwTime = Device.dwTimeGlobal; + PositionStack.back().vPosition = Position(); + } + } - inherited::spatial_move (); + if (bUpdate) + { + spatial_move(); + } + else + { + if (spatial.node_ptr) + { + // Object registered! + if (!fsimilar(Radius(), spatial.sphere.R, eps_R)) spatial_move(); + else + { + Fvector C; + Center(C); + if (!C.similar(spatial.sphere.P, eps_P)) spatial_move(); + } + // else nothing to do :_) + } + } } #ifdef DEBUG @@ -688,9 +950,109 @@ void CGameObject::dbg_DrawSkeleton () } #endif +IGameObject *CGameObject::H_SetParent(IGameObject* new_parent, bool just_before_destroy) +{ + if (new_parent==Parent) + return new_parent; + IGameObject *old_parent = Parent; + VERIFY2(!new_parent || !old_parent, "Before set parent - execute H_SetParent(0)"); + // if (Parent) Parent->H_ChildRemove (this); + if (!old_parent) + OnH_B_Chield(); // before attach + else + OnH_B_Independent(just_before_destroy); // before detach + if (new_parent) + spatial_unregister(); + else + spatial_register(); + Parent = new_parent; + if (!old_parent) + OnH_A_Chield(); // after attach + else + OnH_A_Independent(); // after detach + // if (Parent) Parent->H_ChildAdd (this); + MakeMeCrow(); + return old_parent; +} + +void CGameObject::OnH_A_Chield() +{ +} + +void CGameObject::OnH_B_Chield() +{ + // + setVisible(false); + // ~ + ///PHSetPushOut();???? +} + +void CGameObject::OnH_A_Independent() +{ + setVisible(true); +} + +void CGameObject::OnH_B_Independent(bool just_before_destroy) +{ + setup_parent_ai_locations (false); + CGameObject *parent = smart_cast(H_Parent()); + VERIFY (parent); + if (ai().get_level_graph() && ai().level_graph().valid_vertex_id(parent->ai_location().level_vertex_id())) + validate_ai_locations (false); +} + +void CGameObject::setDestroy(BOOL _destroy) +{ + if (_destroy==(BOOL)Props.bDestroy) + return; + Props.bDestroy = _destroy ? 1 : 0; + if (_destroy) + { + g_pGameLevel->Objects.register_object_to_destroy(this); +#ifdef DEBUG + if (debug_destroy) + Msg("cl setDestroy [%d][%d]", ID(), Device.dwFrame); +#endif +#ifdef MP_LOGGING + Msg("cl setDestroy [%d][%d]", ID(), Device.dwFrame); +#endif //#ifdef MP_LOGGING + } + else + VERIFY(!g_pGameLevel->Objects.registered_object_to_destroy(this)); +} + +Fvector CGameObject::get_new_local_point_on_mesh(u16& bone_id) const +{ + bone_id = u16(-1); + return Fvector().random_dir().mul(.7f); +} + +Fvector CGameObject::get_last_local_point_on_mesh(Fvector const& local_point, u16 const bone_id) const +{ + VERIFY(bone_id == u16(-1)); + Fvector result; + // Fetch data + Fmatrix mE; + const Fmatrix& M = XFORM(); + const Fbox& B = CForm->getBBox(); + // Build OBB + Ellipse and X-form point + Fvector c, r; + Fmatrix T, mR, mS; + B.getcenter(c); + B.getradius(r); + T.translate(c); + mR.mul_43(M, T); + mS.scale(r); + mE.mul_43(mR, mS); + mE.transform_tiny(result, local_point); + return result; +} + void CGameObject::renderable_Render () { - inherited::renderable_Render(); + // + MakeMeCrow(); + // ~ GlobalEnv.Render->set_Transform (&XFORM()); GlobalEnv.Render->add_Visual (Visual()); Visual()->getVisData().hom_frame = Device.dwFrame; @@ -703,10 +1065,10 @@ float CGameObject::renderable_Ambient () } */ -CObject::SavedPosition CGameObject::ps_Element(u32 ID) const +GameObjectSavedPosition CGameObject::ps_Element(u32 ID) const { VERIFY(ID(H_Parent()); - VERIFY (parent); - if (ai().get_level_graph() && ai().level_graph().valid_vertex_id(parent->ai_location().level_vertex_id())) - validate_ai_locations (false); -} BOOL CGameObject::UsedAI_Locations() { @@ -753,7 +1098,7 @@ BOOL CGameObject::TestServerFlag(u32 Flag) const return (m_server_flags.test(Flag)); } -void CGameObject::add_visual_callback (visual_callback *callback) +void CGameObject::add_visual_callback (visual_callback callback) { VERIFY (smart_cast(Visual())); CALLBACK_VECTOR_IT I = std::find(visual_callbacks().begin(),visual_callbacks().end(),callback); @@ -764,7 +1109,7 @@ void CGameObject::add_visual_callback (visual_callback *callback) m_visual_callback.push_back (callback); } -void CGameObject::remove_visual_callback (visual_callback *callback) +void CGameObject::remove_visual_callback (visual_callback callback) { CALLBACK_VECTOR_IT I = std::find(m_visual_callback.begin(),m_visual_callback.end(),callback); VERIFY (I != m_visual_callback.end()); @@ -784,13 +1129,10 @@ void CGameObject::SetKinematicsCallback (bool set) void VisualCallback (IKinematics *tpKinematics) { - CGameObject *game_object = static_cast(static_cast(tpKinematics->GetUpdateCallbackParam())); - VERIFY (game_object); - - CGameObject::CALLBACK_VECTOR_IT I = game_object->visual_callbacks().begin(); - CGameObject::CALLBACK_VECTOR_IT E = game_object->visual_callbacks().end(); - for ( ; I != E; ++I) - (*I) (tpKinematics); + CGameObject *game_object = smart_cast(static_cast(tpKinematics->GetUpdateCallbackParam())); + VERIFY(game_object); + for (auto cb : game_object->visual_callbacks()) + cb(tpKinematics); } CScriptGameObject *CGameObject::lua_game_object () const @@ -835,10 +1177,20 @@ void CGameObject::shedule_Update (u32 dt) #endif // #ifndef MASTER_GOLD DestroyObject (); } - - // Msg ("-SUB-:[%x][%s] CGameObject::shedule_Update",smart_cast(this),*cName()); - inherited::shedule_Update (dt); - + // Msg("-SUB-:[%x][%s] CGameObject::shedule_Update",smart_cast(this),*cName()); + // IGameObject::shedule_Update(dt); + // consistency check + // Msg ("-SUB-:[%x][%s] IGameObject::shedule_Update",dynamic_cast(this),*cName()); + ScheduledBase::shedule_Update(dt); + spatial_update(base_spu_epsP*1, base_spu_epsR*1); + // Always make me crow on shedule-update + // Makes sure that update-cl called at least with freq of shedule-update + MakeMeCrow(); + /* + if (AlwaysTheCrow()) MakeMeCrow (); + else if (Device.vCameraPosition.distance_to_sqr(Position()) < CROW_RADIUS*CROW_RADIUS) MakeMeCrow (); + */ + // ~ if(!g_dedicated_server) scriptBinder.shedule_Update(dt); } @@ -899,9 +1251,8 @@ u32 CGameObject::ef_detector_type () const return (u32(-1)); } -void CGameObject::net_Relcase (CObject* O) +void CGameObject::net_Relcase (IGameObject* O) { - inherited::net_Relcase (O); if(!g_dedicated_server) scriptBinder.net_Relcase (O); } @@ -943,7 +1294,6 @@ bool CGameObject::is_ai_obstacle () const void CGameObject::OnChangeVisual ( ) { - inherited::OnChangeVisual( ); if ( m_anim_mov_ctrl ) destroy_anim_mov_ctrl( ); } @@ -1020,8 +1370,31 @@ IC bool similar (const Fmatrix &_0, const Fmatrix &_1, const float &epsilon void CGameObject::UpdateCL () { - inherited::UpdateCL (); - + // IGameObject::UpdateCL(); + // consistency check +#ifdef DEBUG + VERIFY2(_valid(renderable.xform), *cName()); + if (Device.dwFrame==dbg_update_cl) + Debug.fatal(DEBUG_INFO, "'UpdateCL' called twice per frame for %s", *cName()); + dbg_update_cl = Device.dwFrame; + if (Parent && spatial.node_ptr) + Debug.fatal(DEBUG_INFO, "Object %s has parent but is still registered inside spatial DB", *cName()); + if (!CForm && (spatial.type&STYPE_COLLIDEABLE)) + Debug.fatal(DEBUG_INFO, "Object %s registered as 'collidable' but has no collidable model", *cName()); +#endif + spatial_update(base_spu_epsP*5, base_spu_epsR*5); + // crow + if (Parent==g_pGameLevel->CurrentViewEntity() || AlwaysTheCrow()) + MakeMeCrow(); + else + { + float dist = Device.vCameraPosition.distance_to_sqr(Position()); + if (distgetVisData().hom_frame+2 > Device.dwFrame) && distm_door) + VERIFY(obj); + CScriptGameObject *scriptObj = lua_game_object(); + if (scriptObj && scriptObj->m_door) { - if (obj->m_door->is_blocked(doors::door_state_open) || obj->m_door->is_blocked(doors::door_state_closed)) + doors::door *door = scriptObj->m_door; + if (door->is_blocked(doors::door_state_open) || door->is_blocked(doors::door_state_closed)) return false; } - callback(GameObject::eUseObject)(obj, who_use->lua_game_object()); + callback(GameObject::eUseObject)(scriptObj, obj->lua_game_object()); return true; } diff --git a/src/xrGame/GameObject.h b/src/xrGame/GameObject.h index ce4f0582ca2..d638adf4839 100644 --- a/src/xrGame/GameObject.h +++ b/src/xrGame/GameObject.h @@ -48,278 +48,320 @@ class IKinematics; template class CScriptCallbackEx; -class CGameObject : public CObject +#pragma pack(push,4) +class CGameObject : + public IGameObject, + public FactoryObjectBase, + public SpatialBase, + public ScheduledBase, + public RenderableBase, + public CollidableBase { private: - typedef CObject inherited; + BENCH_SEC_SCRAMBLEMEMBER1 + BENCH_SEC_SCRAMBLEVTBL2 + // Some property variables + GameObjectProperties Props; + shared_str NameObject; + shared_str NameSection; + shared_str NameVisual; +protected: + // Parentness + IGameObject *Parent; + // Geometric (transformation) + svector PositionStack; +#ifdef DEBUG + u32 dbg_update_cl; +#endif + u32 dwFrame_UpdateCL; + u32 dwFrame_AsCrow; +private: shared_str m_sTipText; bool m_bNonscriptUsable; - bool m_spawned; - Flags32 m_server_flags; - CAI_ObjectLocation *m_ai_location; - ALife::_STORY_ID m_story_id; - animation_movement_controller *m_anim_mov_ctrl; + bool m_spawned; + Flags32 m_server_flags; + CAI_ObjectLocation *m_ai_location; + ALife::_STORY_ID m_story_id; + animation_movement_controller *m_anim_mov_ctrl; + bool m_bCrPr_Activated; + u32 m_dwCrPr_ActivationStep; + mutable CScriptGameObject *m_lua_game_object; + int m_script_clsid; + u32 m_spawn_time; + typedef xr_map CALLBACK_MAP; + typedef CALLBACK_MAP::iterator CALLBACK_MAP_IT; + CALLBACK_MAP *m_callbacks; + ai_obstacle *m_ai_obstacle; + Fmatrix m_previous_matrix; + CALLBACK_VECTOR m_visual_callback; protected: CScriptBinder scriptBinder; - //время удаления объекта - bool m_bObjectRemoved; + bool m_bObjectRemoved; + CInifile *m_ini_file; public: CGameObject(); virtual ~CGameObject(); -public: + // XXX: review + virtual u32 GetDbgUpdateFrame() const override { return dbg_update_cl; } + virtual void SetDbgUpdateFrame(u32 value) override { dbg_update_cl = value; } + virtual u32 GetUpdateFrame() const override { return dwFrame_UpdateCL; } + virtual void SetUpdateFrame(u32 value) override { dwFrame_UpdateCL = value; } + virtual u32 GetCrowUpdateFrame() const override { return dwFrame_AsCrow; } + virtual void SetCrowUpdateFrame(u32 value) override { dwFrame_AsCrow = value; } +#ifdef DEBUG + virtual void DBGGetProps(GameObjectProperties &p) const override { p = Props; } +#endif + virtual void MakeMeCrow() override; + virtual void IAmNotACrowAnyMore() override { Props.crow = false; } + virtual BOOL AlwaysTheCrow() override { return FALSE; } + virtual bool AmICrow() const override { return !!Props.crow; } + // Network + virtual BOOL Local() const override { return Props.net_Local; } + virtual BOOL Remote() const override { return !Props.net_Local; } + virtual u16 ID() const override { return Props.net_ID; } + virtual void setID(u16 _ID) override { Props.net_ID = _ID; } + virtual BOOL GetTmpPreDestroy() const override { return Props.bPreDestroy; } + virtual void SetTmpPreDestroy(BOOL b) override { Props.bPreDestroy = b; } + virtual float shedule_Scale() override { return Device.vCameraPosition.distance_to(Position())/200.f; } + virtual bool shedule_Needed() override; + virtual void shedule_Update(u32 dt) override; + // Parentness + virtual IGameObject *H_Parent() override { return Parent; } + virtual const IGameObject *H_Parent() const override { return Parent; } + virtual IGameObject *H_Root() override { return Parent ? Parent->H_Root() : this; } + virtual const IGameObject *H_Root() const override { return Parent ? Parent->H_Root() : this; } + virtual IGameObject *H_SetParent(IGameObject *O, bool just_before_destroy = false) override; + // Geometry xform + virtual void Center(Fvector &C) const override; + virtual const Fmatrix &XFORM() const override + { + VERIFY(_valid(renderable.xform)); + return renderable.xform; + } + virtual Fmatrix &XFORM() override { return renderable.xform; } + virtual void spatial_register() override; + virtual void spatial_unregister() override; + virtual void spatial_move() override; + virtual void spatial_update(float eps_P, float eps_R) override; + virtual IGameObject *dcast_GameObject() override { return this; } + virtual IRenderable *dcast_Renderable() override { return this; } + virtual Fvector& Direction() override { return renderable.xform.k; } + virtual const Fvector& Direction() const override { return renderable.xform.k; } + virtual Fvector& Position() override { return renderable.xform.c; } + virtual const Fvector& Position() const override { return renderable.xform.c; } + virtual float Radius() const override; + virtual const Fbox& BoundingBox() const override; + virtual IRender_Sector* Sector() override { return H_Root()->GetSpatialData().sector; } + virtual IRender_ObjectSpecific* ROS() override { return RenderableBase::renderable_ROS(); } + virtual BOOL renderable_ShadowGenerate() override { return TRUE; } + virtual BOOL renderable_ShadowReceive() override { return TRUE; } + // Accessors and converters + virtual IRenderVisual *Visual() const override { return renderable.visual; } + virtual IPhysicsShell *physics_shell() override { return nullptr; } + virtual const IObjectPhysicsCollision *physics_collision() override { return nullptr; } + // Name management + virtual shared_str cName() const override { return NameObject; } + virtual void cName_set(shared_str N) override; + virtual shared_str cNameSect() const override { return NameSection; } + virtual LPCSTR cNameSect_str() const override { return NameSection.c_str(); } + virtual void cNameSect_set(shared_str N) override; + virtual shared_str cNameVisual() const override { return NameVisual; } + virtual void cNameVisual_set(shared_str N) override; + virtual shared_str shedule_Name() const override { return cName(); }; + // Properties + virtual void processing_activate() override; // request to enable UpdateCL + virtual void processing_deactivate() override; // request to disable UpdateCL + virtual bool processing_enabled() override { return !!Props.bActiveCounter; } + virtual void setVisible(BOOL _visible) override; + virtual BOOL getVisible() const override { return Props.bVisible; } + virtual void setEnabled(BOOL _enabled) override; + virtual BOOL getEnabled() const override { return Props.bEnabled; } + virtual void setDestroy(BOOL _destroy) override; + virtual BOOL getDestroy() const override { return Props.bDestroy; } + virtual void setLocal(BOOL _local) override { Props.net_Local = _local ? 1 : 0; } + virtual BOOL getLocal() const override { return Props.net_Local; } + virtual void setSVU(BOOL _svu) override { Props.net_SV_Update = _svu ? 1 : 0; } + virtual BOOL getSVU() const override { return Props.net_SV_Update; } + virtual void setReady(BOOL _ready) override { Props.net_Ready = _ready ? 1 : 0; } + virtual BOOL getReady() const override { return Props.net_Ready; } //functions used for avoiding most of the smart_cast - virtual CAttachmentOwner* cast_attachment_owner () {return NULL;} - virtual CInventoryOwner* cast_inventory_owner () {return NULL;} - virtual CInventoryItem* cast_inventory_item () {return NULL;} - virtual CEntity* cast_entity () {return NULL;} - virtual CEntityAlive* cast_entity_alive () {return NULL;} - virtual CActor* cast_actor () {return NULL;} - virtual CGameObject* cast_game_object () {return this;} - virtual CCustomZone* cast_custom_zone () {return NULL;} - virtual CPhysicsShellHolder* cast_physics_shell_holder () {return NULL;} - virtual IInputReceiver* cast_input_receiver () {return NULL;} - virtual CParticlesPlayer* cast_particles_player () {return NULL;} - virtual CArtefact* cast_artefact () {return NULL;} - virtual CCustomMonster* cast_custom_monster () {return NULL;} - virtual CAI_Stalker* cast_stalker () {return NULL;} - virtual CScriptEntity* cast_script_entity () {return NULL;} - virtual CWeapon* cast_weapon () {return NULL;} - virtual CExplosive* cast_explosive () {return NULL;} - virtual CSpaceRestrictor* cast_restrictor () {return NULL;} - virtual CAttachableItem* cast_attachable_item () {return NULL;} - virtual CHolderCustom* cast_holder_custom () {return NULL;} - virtual CBaseMonster* cast_base_monster () {return NULL;} - -public: - virtual bool feel_touch_on_contact (CObject *) {return TRUE;} - -public: - CInifile *m_ini_file; - + virtual CAttachmentOwner *cast_attachment_owner() override { return NULL; } + virtual CInventoryOwner *cast_inventory_owner() override { return NULL; } + virtual CInventoryItem *cast_inventory_item() override { return NULL; } + virtual CEntity *cast_entity() override { return NULL; } + virtual CEntityAlive *cast_entity_alive() override { return NULL; } + virtual CActor *cast_actor() override { return NULL; } + virtual CGameObject *cast_game_object() override { return this; } + virtual CCustomZone *cast_custom_zone() override { return NULL; } + virtual CPhysicsShellHolder *cast_physics_shell_holder() override { return NULL; } + virtual IInputReceiver *cast_input_receiver() override { return NULL; } + virtual CParticlesPlayer *cast_particles_player() override { return NULL; } + virtual CArtefact *cast_artefact() override { return NULL; } + virtual CCustomMonster *cast_custom_monster() override { return NULL; } + virtual CAI_Stalker *cast_stalker() override { return NULL; } + virtual CScriptEntity *cast_script_entity() override { return NULL; } + virtual CWeapon *cast_weapon() override { return NULL; } + virtual CExplosive *cast_explosive() override { return NULL; } + virtual CSpaceRestrictor *cast_restrictor() override { return NULL; } + virtual CAttachableItem *cast_attachable_item() override { return NULL; } + virtual CHolderCustom *cast_holder_custom() override { return NULL; } + virtual CBaseMonster *cast_base_monster() override { return NULL; } + virtual bool feel_touch_on_contact(IGameObject *) override { return TRUE; } // Utilities - static void u_EventGen (NET_Packet& P, u32 type, u32 dest ); - static void u_EventSend (NET_Packet& P, u32 dwFlags = DPNSEND_GUARANTEED ); - + // XXX: move out + static void u_EventGen(NET_Packet &P, u32 type, u32 dest); + static void u_EventSend(NET_Packet &P, u32 dwFlags = DPNSEND_GUARANTEED); // Methods - virtual void Load (LPCSTR section); - virtual BOOL net_Spawn (CSE_Abstract* DC); - virtual void net_Destroy (); - virtual void net_Relcase ( CObject* O ); - virtual void UpdateCL ( ); - virtual void OnChangeVisual ( ); + virtual void Load(LPCSTR section) override; + virtual void UpdateCL() override; // Called each frame, so no need for dt + virtual void OnChangeVisual() override; //object serialization - virtual void net_Save (NET_Packet &net_packet); - virtual void net_Load (IReader &ireader); - virtual BOOL net_SaveRelevant (); - virtual void save (NET_Packet &output_packet); - virtual void load (IReader &input_packet); - - virtual BOOL net_Relevant () { return getLocal(); } // send messages only if active and local - virtual void spatial_move (); - virtual BOOL Ready () { return getReady(); } // update only if active and fully initialized by/for network -// virtual float renderable_Ambient (); - - virtual void shedule_Update (u32 dt); - virtual bool shedule_Needed (); - - virtual void renderable_Render (); - virtual void OnEvent (NET_Packet& P, u16 type); - virtual void Hit (SHit* pHDS) {}; - virtual void SetHitInfo (CObject* who, CObject* weapon, s16 element, Fvector Pos, Fvector Dir) {}; - virtual BOOL BonePassBullet (int boneID) { return FALSE; } - - - //игровое имя объекта - virtual LPCSTR Name () const; + virtual void net_Save(NET_Packet &packet) override; + virtual void net_Load(IReader &reader) override; + virtual BOOL net_SaveRelevant() override; + virtual void net_Export(NET_Packet &packet) override {} // export to server + virtual void net_Import(NET_Packet &packet) override {} // import from server + virtual BOOL net_Spawn(CSE_Abstract *entity) override; + virtual void net_Destroy() override; + virtual void net_ImportInput(NET_Packet &packet) override {} + virtual BOOL net_Relevant() override { return getLocal(); } // send messages only if active and local + virtual void net_MigrateInactive(NET_Packet &packet) override { Props.net_Local = FALSE; } + virtual void net_MigrateActive(NET_Packet &packet) override { Props.net_Local = TRUE; } + virtual void net_Relcase(IGameObject *O) override; // destroy all links to another objects + virtual void save(NET_Packet &output_packet) override; + virtual void load(IReader &input_packet); + // Position stack + virtual u32 ps_Size() const override { return PositionStack.size(); } + virtual GameObjectSavedPosition ps_Element(u32 ID) const override; + virtual void ForceTransform(const Fmatrix &m) override {} + virtual void OnHUDDraw(CCustomHUD *hud) override {} + virtual BOOL Ready() override { return getReady(); } // update only if active and fully initialized by/for network - //virtual void OnH_A_Independent (); - virtual void OnH_B_Chield (); - virtual void OnH_B_Independent (bool just_before_destroy); - - virtual bool IsVisibleForZones () { return true; } -/////////////////////////////////////////////////////////////////////// - virtual bool NeedToDestroyObject () const; - virtual void DestroyObject (); -/////////////////////////////////////////////////////////////////////// - - // Position stack - virtual SavedPosition ps_Element (u32 ID) const; - - void setup_parent_ai_locations(bool assign_position = true); - void validate_ai_locations(bool decrement_reference = true); - - //animation_movement_controller - virtual void create_anim_mov_ctrl ( CBlend *b, Fmatrix *start_pose, bool local_animation ); - virtual void destroy_anim_mov_ctrl ( ); - void update_animation_movement_controller(); - bool animation_movement_controlled ( ) const ; -const animation_movement_controller* animation_movement ( ) const { return m_anim_mov_ctrl; } - animation_movement_controller* animation_movement ( ) { return m_anim_mov_ctrl; } + virtual void renderable_Render() override; + virtual void OnEvent(NET_Packet &P, u16 type) override; + virtual void Hit(SHit *pHDS) override {} + virtual void SetHitInfo(IGameObject *who, IGameObject *weapon, s16 element, Fvector Pos, Fvector Dir) override {} + virtual BOOL BonePassBullet(int boneID) override { return FALSE; } + //игровое имя объекта + virtual LPCSTR Name() const override; + // Active/non active + virtual void OnH_B_Chield() override; // before + virtual void OnH_B_Independent(bool just_before_destroy) override; + virtual void OnH_A_Chield() override; // after + virtual void OnH_A_Independent() override; + virtual void On_SetEntity() override {} + virtual void On_LostEntity() override {} + virtual bool register_schedule() const override { return true; } + virtual Fvector get_new_local_point_on_mesh(u16 &bone_id) const override; + virtual Fvector get_last_local_point_on_mesh(const Fvector &last_point, u16 bone_id) const override; + virtual bool IsVisibleForZones() override { return true; } + virtual bool NeedToDestroyObject() const override; + virtual void DestroyObject() override; + // animation_movement_controller + virtual void create_anim_mov_ctrl(CBlend *b, Fmatrix *start_pose, bool local_animation) override; + virtual void destroy_anim_mov_ctrl() override; + virtual void update_animation_movement_controller(); + virtual bool animation_movement_controlled() const override; + virtual const animation_movement_controller *animation_movement() const override { return m_anim_mov_ctrl; } + virtual animation_movement_controller *animation_movement() override { return m_anim_mov_ctrl; } // Game-specific events - - virtual BOOL UsedAI_Locations (); - BOOL TestServerFlag (u32 Flag) const; - virtual bool can_validate_position_on_spawn (){return true;} + virtual BOOL UsedAI_Locations() override; + virtual BOOL TestServerFlag(u32 Flag) const override; + virtual bool can_validate_position_on_spawn() override { return true; } #ifdef DEBUG - virtual void OnRender (); + virtual void OnRender() override; #endif - - void init (); - virtual void reinit (); - virtual void reload (LPCSTR section); + virtual void reinit() override; + virtual void reload(LPCSTR section) override; ///////////////////// network ///////////////////////////////////////// - bool object_removed () const { return m_bObjectRemoved; }; -private: - bool m_bCrPr_Activated; - u32 m_dwCrPr_ActivationStep; - -public: - virtual void make_Interpolation () {}; // interpolation from last visible to corrected position/rotation - virtual void PH_B_CrPr () {}; // actions & operations before physic correction-prediction steps - virtual void PH_I_CrPr () {}; // actions & operations after correction before prediction steps + virtual bool object_removed() const override { return m_bObjectRemoved; } + virtual void make_Interpolation() override {} // interpolation from last visible to corrected position/rotation + virtual void PH_B_CrPr() override {} // actions & operations before physic correction-prediction steps + virtual void PH_I_CrPr() override {} // actions & operations after correction before prediction steps #ifdef DEBUG - virtual void PH_Ch_CrPr () {}; // - virtual void dbg_DrawSkeleton (); + virtual void PH_Ch_CrPr() override {} + virtual void dbg_DrawSkeleton() override; #endif - virtual void PH_A_CrPr () {}; // actions & operations after phisic correction-prediction steps - virtual void CrPr_SetActivationStep (u32 Step) {m_dwCrPr_ActivationStep = Step; }; - virtual u32 CrPr_GetActivationStep () { return m_dwCrPr_ActivationStep; }; - virtual void CrPr_SetActivated (bool Activate) { m_bCrPr_Activated = Activate; }; - virtual bool CrPr_IsActivated () { return m_bCrPr_Activated; }; + virtual void PH_A_CrPr() override {} // actions & operations after phisic correction-prediction steps + virtual void CrPr_SetActivationStep(u32 Step) override { m_dwCrPr_ActivationStep = Step; } + virtual u32 CrPr_GetActivationStep() override { return m_dwCrPr_ActivationStep; } + virtual void CrPr_SetActivated(bool Activate) override { m_bCrPr_Activated = Activate; } + virtual bool CrPr_IsActivated() override { return m_bCrPr_Activated; }; /////////////////////////////////////////////////////////////////////// - virtual const SRotation Orientation () const - { - SRotation rotation; - float h,p,b; - XFORM().getHPB (h,p,b); - rotation.yaw = h; - rotation.pitch = p; - return (rotation); - }; - - virtual bool use_parent_ai_locations () const + virtual const SRotation Orientation() const override + { + SRotation rotation; + float h, p, b; + XFORM().getHPB(h, p, b); + rotation.yaw = h; + rotation.pitch = p; + return rotation; + } + virtual bool use_parent_ai_locations() const override { return true; } + virtual void add_visual_callback(visual_callback callback) override; + virtual void remove_visual_callback(visual_callback callback) override; + virtual CALLBACK_VECTOR &visual_callbacks() override { return m_visual_callback; } + virtual CScriptGameObject *lua_game_object() const override; + virtual int clsid() const override { - return (true); + THROW(m_script_clsid>=0); + return m_script_clsid; } - -public: - typedef void __stdcall visual_callback(IKinematics *); - typedef svector CALLBACK_VECTOR; - typedef CALLBACK_VECTOR::iterator CALLBACK_VECTOR_IT; - - CALLBACK_VECTOR m_visual_callback; - -public: - void add_visual_callback (visual_callback *callback); - void remove_visual_callback (visual_callback *callback); - void SetKinematicsCallback (bool set); - - IC CALLBACK_VECTOR &visual_callbacks () + virtual CInifile *spawn_ini() override { return m_ini_file; } + virtual CAI_ObjectLocation &ai_location() const override { - return (m_visual_callback); + VERIFY(m_ai_location); + return *m_ai_location; } - - -private: - mutable CScriptGameObject *m_lua_game_object; - int m_script_clsid; -public: - CScriptGameObject *lua_game_object() const; - int clsid () const - { - THROW (m_script_clsid >= 0); - return (m_script_clsid); - } -public: - IC CInifile *spawn_ini () - { - return (m_ini_file); - } -protected: - virtual void spawn_supplies (); - -public: - IC CAI_ObjectLocation &ai_location () const - { - VERIFY (m_ai_location); - return (*m_ai_location); - } - -private: - u32 m_spawn_time; - -public: - IC u32 spawn_time () const + virtual u32 spawn_time() const override { - VERIFY (m_spawned); - return (m_spawn_time); + VERIFY(m_spawned); + return m_spawn_time; } - - IC const ALife::_STORY_ID &story_id () const - { - return (m_story_id); - } - -public: - virtual u32 ef_creature_type () const; - virtual u32 ef_equipment_type () const; - virtual u32 ef_main_weapon_type () const; - virtual u32 ef_anomaly_type () const; - virtual u32 ef_weapon_type () const; - virtual u32 ef_detector_type () const; - virtual bool natural_weapon () const {return true;} - virtual bool natural_detector () const {return true;} - virtual bool use_center_to_aim () const {return false;} + virtual const ALife::_STORY_ID &story_id() const override { return m_story_id; } + virtual u32 ef_creature_type() const override; + virtual u32 ef_equipment_type() const override; + virtual u32 ef_main_weapon_type() const override; + virtual u32 ef_anomaly_type() const override; + virtual u32 ef_weapon_type() const override; + virtual u32 ef_detector_type() const override; + virtual bool natural_weapon() const override { return true; } + virtual bool natural_detector() const override { return true; } + virtual bool use_center_to_aim() const override { return false; } // [12.11.07] Alexander Maniluk: added this method for moving object - virtual void MoveTo(Fvector const & position) {}; - -public: - - typedef CScriptCallbackEx CScriptCallbackExVoid; - -private: - - DEFINE_MAP (GameObject::ECallbackType, CScriptCallbackExVoid, CALLBACK_MAP, CALLBACK_MAP_IT); - CALLBACK_MAP *m_callbacks; - -public: - CScriptCallbackExVoid &callback (GameObject::ECallbackType type) const; - virtual LPCSTR visual_name (CSE_Abstract *server_entity); - - virtual void On_B_NotCurrentEntity () {}; - - // for moving objects -private: - u32 new_level_vertex_id () const; - void update_ai_locations (bool decrement_reference); - -private: - ai_obstacle *m_ai_obstacle; - Fmatrix m_previous_matrix; - -public: - virtual bool is_ai_obstacle () const; - -public: - IC ai_obstacle &obstacle () const + virtual void MoveTo(const Fvector &position) override {} + // the only usage: aimers::base::fill_bones + virtual CScriptCallbackExVoid &callback(GameObject::ECallbackType type) const override; + virtual LPCSTR visual_name(CSE_Abstract *server_entity) override; + virtual void On_B_NotCurrentEntity() override {} + virtual bool is_ai_obstacle() const override; + virtual ai_obstacle &obstacle() const override { - VERIFY (m_ai_obstacle); - return (*m_ai_obstacle); + VERIFY(m_ai_obstacle); + return *m_ai_obstacle; } - - virtual void on_matrix_change (const Fmatrix &previous); + virtual void on_matrix_change(const Fmatrix &previous) override; // UsableScriptObject functions - virtual bool use(CGameObject* who_use); + virtual bool use(IGameObject *obj) override; //строчка появляющаяся при наведении на объект (если NULL, то нет) - virtual LPCSTR tip_text(); - void set_tip_text(LPCSTR new_text); - virtual void set_tip_text_default(); + virtual LPCSTR tip_text() override; + virtual void set_tip_text(LPCSTR new_text) override; + virtual void set_tip_text_default() override; //можно ли использовать объект стандартным (не скриптовым) образом - bool nonscript_usable(); - void set_nonscript_usable(bool usable); - - CScriptBinderObject *GetScriptBinderObject() { return scriptBinder.object(); } - void SetScriptBinderObject(CScriptBinderObject *object) { scriptBinder.set_object(object); } + virtual bool nonscript_usable() override; + virtual void set_nonscript_usable(bool usable) override; + virtual CScriptBinderObject *GetScriptBinderObject() override { return scriptBinder.object(); } + virtual void SetScriptBinderObject(CScriptBinderObject *object) override { scriptBinder.set_object(object); } +protected: + virtual void spawn_supplies(); +private: // XXX: move to GameObjectBase + void init(); + void setup_parent_ai_locations(bool assign_position = true); + void validate_ai_locations(bool decrement_reference = true); + u32 new_level_vertex_id() const; + void update_ai_locations(bool decrement_reference); + void SetKinematicsCallback(bool set); }; +#pragma pack(pop) #endif // !defined(AFX_GAMEOBJECT_H__3DA72D03_C759_4688_AEBB_89FA812AA873__INCLUDED_) diff --git a/src/xrGame/GamePersistent.cpp b/src/xrGame/GamePersistent.cpp index 0772994dac9..14c8c950db2 100644 --- a/src/xrGame/GamePersistent.cpp +++ b/src/xrGame/GamePersistent.cpp @@ -608,13 +608,13 @@ void CGamePersistent::OnFrame () #ifdef DEBUG if(psActorFlags.test(AF_NO_CLIP)) { - Actor()->dbg_update_cl = 0; + Actor()->SetDbgUpdateFrame(0); Actor()->GetSchedulerData().dbg_update_shedule = 0; Device.dwTimeDelta = 0; Device.fTimeDelta = 0.01f; Actor()->UpdateCL (); Actor()->shedule_Update (0); - Actor()->dbg_update_cl = 0; + Actor()->SetDbgUpdateFrame(0); Actor()->GetSchedulerData().dbg_update_shedule = 0; CSE_Abstract* e = Level().Server->ID_to_entity(Actor()->ID()); @@ -624,15 +624,15 @@ void CGamePersistent::OnFrame () xr_vector::iterator it = s_actor->children.begin(); for(;it!=s_actor->children.end();it++) { - CObject* obj = Level().Objects.net_Find(*it); + IGameObject* obj = Level().Objects.net_Find(*it); if(obj && Engine.Sheduler.Registered(obj)) { obj->GetSchedulerData().dbg_update_shedule = 0; - obj->dbg_update_cl = 0; + obj->SetDbgUpdateFrame(0); obj->shedule_Update (0); obj->UpdateCL(); obj->GetSchedulerData().dbg_update_shedule = 0; - obj->dbg_update_cl = 0; + obj->SetDbgUpdateFrame(0); } } } diff --git a/src/xrGame/GlobalFeelTouch.cpp b/src/xrGame/GlobalFeelTouch.cpp index 1d3f491a2d5..7b3c233b3b4 100644 --- a/src/xrGame/GlobalFeelTouch.cpp +++ b/src/xrGame/GlobalFeelTouch.cpp @@ -19,9 +19,9 @@ struct delete_predicate_by_time : public std::binary_function +struct objects_ptrs_equal : public std::binary_function { - bool operator() (Feel::Touch::DenyTouch const & left, CObject const * const right) const + bool operator() (Feel::Touch::DenyTouch const & left, IGameObject const * const right) const { if (left.O == right) return true; @@ -38,7 +38,7 @@ void GlobalFeelTouch::feel_touch_update(Fvector& P, float R) feel_touch_disable.erase(new_end, feel_touch_disable.end()); } -bool GlobalFeelTouch::is_object_denied(CObject const * O) +bool GlobalFeelTouch::is_object_denied(IGameObject const * O) { /*Fvector temp_vector; feel_touch_update(temp_vector, 0.f);*/ diff --git a/src/xrGame/GlobalFeelTouch.hpp b/src/xrGame/GlobalFeelTouch.hpp index 99a6b54a88f..113377fe311 100644 --- a/src/xrGame/GlobalFeelTouch.hpp +++ b/src/xrGame/GlobalFeelTouch.hpp @@ -11,9 +11,9 @@ class GlobalFeelTouch : public Feel::Touch virtual ~GlobalFeelTouch(); virtual void feel_touch_update (Fvector& P, float R); - //virtual void feel_touch_deny (CObject* O, DWORD T); - implemented in inherited class + //virtual void feel_touch_deny (IGameObject* O, DWORD T); - implemented in inherited class - bool is_object_denied (CObject const * O); + bool is_object_denied (IGameObject const * O); }; //class GlobalFeelTouch #endif //#ifndef GLOBAL_FEEL_TOUCH_HPP \ No newline at end of file diff --git a/src/xrGame/GraviZone.cpp b/src/xrGame/GraviZone.cpp index c70172f1985..6aca5c71001 100644 --- a/src/xrGame/GraviZone.cpp +++ b/src/xrGame/GraviZone.cpp @@ -262,7 +262,7 @@ void CBaseGraviZone::StopTeleParticles(CGameObject* pObject) PP->StopParticles (particle_str, BI_NONE, true); } -void CBaseGraviZone::net_Relcase(CObject* O) +void CBaseGraviZone::net_Relcase(IGameObject* O) { inherited::net_Relcase(O); diff --git a/src/xrGame/GraviZone.h b/src/xrGame/GraviZone.h index b602e622a50..e8d8d3dc4e2 100644 --- a/src/xrGame/GraviZone.h +++ b/src/xrGame/GraviZone.h @@ -27,7 +27,7 @@ class CBaseGraviZone : public CCustomZone virtual BOOL net_Spawn (CSE_Abstract* DC); virtual void net_Destroy (); - virtual void net_Relcase (CObject* O); + virtual void net_Relcase (IGameObject* O); //воздействие зоной на объект diff --git a/src/xrGame/Grenade.cpp b/src/xrGame/Grenade.cpp index f9c2b47f63a..7b888067b78 100644 --- a/src/xrGame/Grenade.cpp +++ b/src/xrGame/Grenade.cpp @@ -342,7 +342,7 @@ BOOL CGrenade::UsedAI_Locations () return inherited::UsedAI_Locations( );//m_dwDestroyTime == 0xffffffff; } -void CGrenade::net_Relcase(CObject* O ) +void CGrenade::net_Relcase(IGameObject* O ) { CExplosive::net_Relcase(O); inherited::net_Relcase(O); diff --git a/src/xrGame/Grenade.h b/src/xrGame/Grenade.h index ebe8e657789..9cb5a7f14a6 100644 --- a/src/xrGame/Grenade.h +++ b/src/xrGame/Grenade.h @@ -17,7 +17,7 @@ class CGrenade : virtual BOOL net_Spawn (CSE_Abstract* DC); virtual void net_Destroy (); - virtual void net_Relcase (CObject* O ); + virtual void net_Relcase (IGameObject* O ); virtual void OnH_B_Independent (bool just_before_destroy); virtual void OnH_A_Independent (); diff --git a/src/xrGame/HUDManager.cpp b/src/xrGame/HUDManager.cpp index 308ee3c85bf..bf222380a50 100644 --- a/src/xrGame/HUDManager.cpp +++ b/src/xrGame/HUDManager.cpp @@ -164,7 +164,7 @@ void CHUDManager::Render_First() { if (!psHUD_Flags.is(HUD_WEAPON|HUD_WEAPON_RT|HUD_WEAPON_RT2|HUD_DRAW_RT2))return; if (0==pUIGame) return; - CObject* O = g_pGameLevel->CurrentViewEntity(); + IGameObject* O = g_pGameLevel->CurrentViewEntity(); if (0==O) return; CActor* A = smart_cast (O); if (!A) return; @@ -179,7 +179,7 @@ void CHUDManager::Render_First() bool need_render_hud() { - CObject* O = g_pGameLevel ? g_pGameLevel->CurrentViewEntity() : NULL; + IGameObject* O = g_pGameLevel ? g_pGameLevel->CurrentViewEntity() : NULL; if (0==O) return false; @@ -200,7 +200,7 @@ void CHUDManager::Render_Last() if(!need_render_hud()) return; - CObject* O = g_pGameLevel->CurrentViewEntity(); + IGameObject* O = g_pGameLevel->CurrentViewEntity(); // hud itself GlobalEnv.Render->set_HUD (TRUE); GlobalEnv.Render->set_Object (O->H_Root()); @@ -361,7 +361,7 @@ void CHUDManager::OnConnected() Device.seqFrame.Add (pUIGame,REG_PRIORITY_LOW-1000); } -void CHUDManager::net_Relcase( CObject* obj ) +void CHUDManager::net_Relcase( IGameObject* obj ) { HitMarker.net_Relcase ( obj ); diff --git a/src/xrGame/HUDManager.h b/src/xrGame/HUDManager.h index 6ee032d9c9d..65422e624cf 100644 --- a/src/xrGame/HUDManager.h +++ b/src/xrGame/HUDManager.h @@ -33,7 +33,7 @@ class CHUDManager : void HitMarked (int idx, float power, const Fvector& dir); bool AddGrenade_ForMark ( CGrenade* grn ); void Update_GrenadeView ( Fvector& pos_actor ); - void net_Relcase ( CObject* obj ); + void net_Relcase ( IGameObject* obj ); //текущий предмет на который смотрит HUD collide::rq_result& GetCurrentRayQuery (); diff --git a/src/xrGame/HUDTarget.cpp b/src/xrGame/HUDTarget.cpp index 740d4789b19..b601a4c5f63 100644 --- a/src/xrGame/HUDTarget.cpp +++ b/src/xrGame/HUDTarget.cpp @@ -143,7 +143,7 @@ void CHUDTarget::Render() VERIFY (g_bRendering); - CObject* O = Level().CurrentEntity(); + IGameObject* O = Level().CurrentEntity(); if (0==O) return; CEntity* E = smart_cast(O); if (0==E) return; @@ -318,7 +318,7 @@ void CHUDTarget::Render() } } -void CHUDTarget::net_Relcase(CObject* O) +void CHUDTarget::net_Relcase(IGameObject* O) { if(PP.RQ.O == O) PP.RQ.O = NULL; diff --git a/src/xrGame/HUDTarget.h b/src/xrGame/HUDTarget.h index c931b8c6e6f..ee711a9d2ab 100644 --- a/src/xrGame/HUDTarget.h +++ b/src/xrGame/HUDTarget.h @@ -37,5 +37,5 @@ class CHUDTarget float GetRQVis () {return PP.power;}; CHUDCrosshair& GetHUDCrosshair () {return HUDCrosshair;} void ShowCrosshair (bool b); - void net_Relcase (CObject* O); + void net_Relcase (IGameObject* O); }; diff --git a/src/xrGame/HairsZone.cpp b/src/xrGame/HairsZone.cpp index c637d47804d..3fe37b902c5 100644 --- a/src/xrGame/HairsZone.cpp +++ b/src/xrGame/HairsZone.cpp @@ -19,7 +19,7 @@ void CHairsZone::CheckForAwaking() for(OBJECT_INFO_VEC_IT it = m_ObjectInfoMap.begin(); m_ObjectInfoMap.end() != it; ++it) { - CObject* pObject = (*it).object; + IGameObject* pObject = (*it).object; if (!pObject) continue; CEntityAlive* pEnt = smart_cast(pObject); diff --git a/src/xrGame/HangingLamp.cpp b/src/xrGame/HangingLamp.cpp index 605e1e002ff..58965210d55 100644 --- a/src/xrGame/HangingLamp.cpp +++ b/src/xrGame/HangingLamp.cpp @@ -313,7 +313,7 @@ void CHangingLamp::TurnOff () } -//void CHangingLamp::Hit(float P,Fvector &dir, CObject* who,s16 element, +//void CHangingLamp::Hit(float P,Fvector &dir, IGameObject* who,s16 element, // Fvector p_in_object_space, float impulse, ALife::EHitType hit_type) void CHangingLamp::Hit (SHit* pHDS) { diff --git a/src/xrGame/Helicopter.cpp b/src/xrGame/Helicopter.cpp index 0e16f665c67..18d0ecbef1e 100644 --- a/src/xrGame/Helicopter.cpp +++ b/src/xrGame/Helicopter.cpp @@ -501,7 +501,7 @@ void CHelicopter::load(IReader &input_packet) load_data (m_time_between_rocket_attack, input_packet); load_data (m_syncronize_rocket, input_packet); } -void CHelicopter::net_Relcase(CObject* O ) +void CHelicopter::net_Relcase(IGameObject* O ) { CExplosive::net_Relcase(O); inherited::net_Relcase(O); diff --git a/src/xrGame/Helicopter2.cpp b/src/xrGame/Helicopter2.cpp index 1bdf8baa049..6f2c9d46a55 100644 --- a/src/xrGame/Helicopter2.cpp +++ b/src/xrGame/Helicopter2.cpp @@ -14,7 +14,7 @@ #include "actor.h" #include "physics_game.h" -bool CHelicopter::isObjectVisible (CObject* O) +bool CHelicopter::isObjectVisible (IGameObject* O) { Fvector dir_to_object; Fvector to_point; @@ -345,7 +345,7 @@ void SHeliEnemy::Update() case eEnemyPoint: break; case eEnemyEntity:{ - CObject* O = Level().Objects.net_Find(destEnemyID); + IGameObject* O = Level().Objects.net_Find(destEnemyID); if(O) O->Center( destEnemyPos ); else type = eEnemyNone; }break; diff --git a/src/xrGame/Hit.cpp b/src/xrGame/Hit.cpp index a0385d64c30..b053aa1e0f5 100644 --- a/src/xrGame/Hit.cpp +++ b/src/xrGame/Hit.cpp @@ -6,7 +6,7 @@ #include "xrMessages.h" #include "Level.h" #include "xrPhysics/mathutils.h" -SHit::SHit(float powerA, Fvector &dirA, CObject *whoA, u16 elementA, Fvector p_in_bone_spaceA,\ +SHit::SHit(float powerA, Fvector &dirA, IGameObject *whoA, u16 elementA, Fvector p_in_bone_spaceA,\ float impulseA, ALife::EHitType hit_typeA, float armor_piercingA, bool AimBullet) { power = powerA ; diff --git a/src/xrGame/Hit.h b/src/xrGame/Hit.h index 360906cee77..164cc2eaa07 100644 --- a/src/xrGame/Hit.h +++ b/src/xrGame/Hit.h @@ -2,7 +2,7 @@ struct SHit { - SHit(float powerA, Fvector &dirA, CObject *whoA, u16 elementA, Fvector p_in_bone_spaceA,\ + SHit(float powerA, Fvector &dirA, IGameObject *whoA, u16 elementA, Fvector p_in_bone_spaceA,\ float impulseA, ALife::EHitType hit_typeA, float armor_piercingA/*=0.0f*/, bool AimBullet/*=false*/); SHit (); @@ -10,7 +10,7 @@ struct SHit void invalidate () ; IC float damage () const {VERIFY(is_valide());return power;} IC const Fvector &direction () const {VERIFY(is_valide());return dir;} -IC const CObject *initiator () const {VERIFY(is_valide());return who;} +IC const IGameObject *initiator () const {VERIFY(is_valide());return who;} IC u16 bone () const {VERIFY(is_valide());return boneID;} IC const Fvector &bone_space_position () const {VERIFY(is_valide());return p_in_bone_space;} IC float phys_impulse () const {VERIFY(is_valide());return impulse;} @@ -29,7 +29,7 @@ IC ALife::EHitType type () const {VERIFY(is_valide());return hit_type;} float power; Fvector dir; - CObject *who; + IGameObject *who; u16 whoID; u16 weaponID; u16 boneID; diff --git a/src/xrGame/HitMarker.cpp b/src/xrGame/HitMarker.cpp index 23819c7dc27..a586dc22cfd 100644 --- a/src/xrGame/HitMarker.cpp +++ b/src/xrGame/HitMarker.cpp @@ -133,7 +133,7 @@ void CHitMarker::Update_GrenadeView( Fvector& pos_actor ) } -void CHitMarker::net_Relcase( CObject* obj ) +void CHitMarker::net_Relcase( IGameObject* obj ) { u16 remove_id = obj->ID(); diff --git a/src/xrGame/HitMarker.h b/src/xrGame/HitMarker.h index 8d393eefdcf..909a9ce752d 100644 --- a/src/xrGame/HitMarker.h +++ b/src/xrGame/HitMarker.h @@ -67,7 +67,7 @@ class CHitMarker void InitShader( LPCSTR tex_name ); void InitShader_Grenade( LPCSTR tex_name ); - void net_Relcase( CObject* obj ); + void net_Relcase( IGameObject* obj ); }; #endif // __XR_HITMARKER_H__ diff --git a/src/xrGame/HudSound.cpp b/src/xrGame/HudSound.cpp index 3a96acf7635..0c45d2bf69b 100644 --- a/src/xrGame/HudSound.cpp +++ b/src/xrGame/HudSound.cpp @@ -80,7 +80,7 @@ void HUD_SOUND_ITEM::DestroySound(HUD_SOUND_ITEM& hud_snd) void HUD_SOUND_ITEM::PlaySound( HUD_SOUND_ITEM& hud_snd, const Fvector& position, - const CObject* parent, + const IGameObject* parent, bool b_hud_mode, bool looped, u8 index) @@ -100,7 +100,7 @@ void HUD_SOUND_ITEM::PlaySound( HUD_SOUND_ITEM& hud_snd, hud_snd.m_activeSnd = &hud_snd.sounds[ index ]; - hud_snd.m_activeSnd->snd.play_at_pos( const_cast(parent), + hud_snd.m_activeSnd->snd.play_at_pos( const_cast(parent), flags&sm_2D?Fvector().set(0,0,0):position, flags, hud_snd.m_activeSnd->delay); @@ -145,7 +145,7 @@ HUD_SOUND_ITEM* HUD_SOUND_COLLECTION::FindSoundItem(LPCSTR alias, bool b_assert) void HUD_SOUND_COLLECTION::PlaySound( LPCSTR alias, const Fvector& position, - const CObject* parent, + const IGameObject* parent, bool hud_mode, bool looped, u8 index) diff --git a/src/xrGame/HudSound.h b/src/xrGame/HudSound.h index 5ffa410e279..fc57dabc61a 100644 --- a/src/xrGame/HudSound.h +++ b/src/xrGame/HudSound.h @@ -20,7 +20,7 @@ struct HUD_SOUND_ITEM static void PlaySound ( HUD_SOUND_ITEM& snd, const Fvector& position, - const CObject* parent, + const IGameObject* parent, bool hud_mode, bool looped = false, u8 index=u8(-1)); @@ -63,7 +63,7 @@ class HUD_SOUND_COLLECTION ~HUD_SOUND_COLLECTION(); void PlaySound ( LPCSTR alias, const Fvector& position, - const CObject* parent, + const IGameObject* parent, bool hud_mode, bool looped = false, u8 index=u8(-1)); diff --git a/src/xrGame/Inventory.cpp b/src/xrGame/Inventory.cpp index 048e2c96891..4f2388d38cf 100644 --- a/src/xrGame/Inventory.cpp +++ b/src/xrGame/Inventory.cpp @@ -189,7 +189,7 @@ void CInventory::Take(CGameObject *pObj, bool bNotActivate, bool strict_placemen if( CurrentGameUI() ) { - CObject* pActor_owner = smart_cast(m_pOwner); + IGameObject* pActor_owner = smart_cast(m_pOwner); if (Level().CurrentViewEntity() == pActor_owner) { @@ -283,7 +283,7 @@ bool CInventory::DropItem(CGameObject *pObj, bool just_before_destroy, bool dont if( CurrentGameUI() ) { - CObject* pActor_owner = smart_cast(m_pOwner); + IGameObject* pActor_owner = smart_cast(m_pOwner); if (Level().CurrentViewEntity() == pActor_owner) CurrentGameUI()->OnInventoryAction(pIItem, GE_OWNERSHIP_REJECT); @@ -762,7 +762,7 @@ void CInventory::Update() { if(m_iActiveSlot!=m_iNextActiveSlot) { - CObject* pActor_owner = smart_cast(m_pOwner); + IGameObject* pActor_owner = smart_cast(m_pOwner); if (Level().CurrentViewEntity() == pActor_owner) { if( (m_iNextActiveSlot!=NO_ACTIVE_SLOT) && diff --git a/src/xrGame/InventoryBox.cpp b/src/xrGame/InventoryBox.cpp index cd7a16a4dbe..a88ee4795a0 100644 --- a/src/xrGame/InventoryBox.cpp +++ b/src/xrGame/InventoryBox.cpp @@ -32,7 +32,7 @@ void CInventoryBox::OnEvent(NET_Packet& P, u16 type) { u16 id; P.r_u16 (id); - CObject* itm = Level().Objects.net_Find(id); VERIFY(itm); + IGameObject* itm = Level().Objects.net_Find(id); VERIFY(itm); m_items.push_back (id); itm->H_SetParent (this); itm->setVisible (FALSE); @@ -55,7 +55,7 @@ void CInventoryBox::OnEvent(NET_Packet& P, u16 type) { u16 id; P.r_u16(id); - CObject* itm = Level().Objects.net_Find(id); VERIFY(itm); + IGameObject* itm = Level().Objects.net_Find(id); VERIFY(itm); xr_vector::iterator it; it = std::find(m_items.begin(),m_items.end(),id); VERIFY(it!=m_items.end()); m_items.erase (it); @@ -102,7 +102,7 @@ BOOL CInventoryBox::net_Spawn(CSE_Abstract* DC) return TRUE; } -void CInventoryBox::net_Relcase(CObject* O) +void CInventoryBox::net_Relcase(IGameObject* O) { inherited::net_Relcase(O); } diff --git a/src/xrGame/InventoryBox.h b/src/xrGame/InventoryBox.h index b2f76e16586..d82a784e5f7 100644 --- a/src/xrGame/InventoryBox.h +++ b/src/xrGame/InventoryBox.h @@ -21,7 +21,7 @@ class CInventoryBox :public CGameObject virtual void OnEvent (NET_Packet& P, u16 type); virtual BOOL net_Spawn (CSE_Abstract* DC); virtual void net_Destroy (); - virtual void net_Relcase (CObject* O); + virtual void net_Relcase (IGameObject* O); void AddAvailableItems (TIItemContainer& items_container) const; IC bool IsEmpty () const {return m_items.empty();} virtual void UpdateCL (); diff --git a/src/xrGame/Level.cpp b/src/xrGame/Level.cpp index 9beeb52b894..a59d2c8106d 100644 --- a/src/xrGame/Level.cpp +++ b/src/xrGame/Level.cpp @@ -246,7 +246,7 @@ bool g_bDebugEvents = false; void CLevel::cl_Process_Event(u16 dest, u16 type, NET_Packet& P) { // Msg("--- event[%d] for [%d]",type,dest); - CObject* O = Objects.net_Find(dest); + IGameObject* O = Objects.net_Find(dest); if (0 == O) { #ifdef DEBUG @@ -277,7 +277,7 @@ void CLevel::cl_Process_Event(u16 dest, u16 type, NET_Packet& P) u16 id = P.r_u16(); P.r_seek(pos); bool ok = true; - CObject* D = Objects.net_Find(id); + IGameObject* D = Objects.net_Find(id); if (0 == D) { #ifndef MASTER_GOLD @@ -639,7 +639,7 @@ void CLevel::OnRender() { for (u32 I = 0; I < Level().Objects.o_count(); I++) { - CObject* _O = Level().Objects.o_get_by_iterator(I); + IGameObject* _O = Level().Objects.o_get_by_iterator(I); CAI_Stalker* stalker = smart_cast(_O); if (stalker) stalker->OnRender(); @@ -708,7 +708,7 @@ void CLevel::OnRender() { for (u32 I = 0; I < Level().Objects.o_count(); I++) { - CObject* object = Objects.o_get_by_iterator(I); + IGameObject* object = Objects.o_get_by_iterator(I); CAI_Stalker* stalker = smart_cast(object); if (!stalker) continue; @@ -721,7 +721,7 @@ void CLevel::OnRender() { for (u32 I = 0; I < Level().Objects.o_count(); I++) { - CObject* object = Objects.o_get_by_iterator(I); + IGameObject* object = Objects.o_get_by_iterator(I); CAI_Stalker* stalker = smart_cast(object); if (!stalker) continue; @@ -931,7 +931,7 @@ void CLevel::PhisStepsCallback(u32 Time0, u32 Time1) //#pragma todo("Oles to all: highly inefficient and slow!!!") //fixed (Andy) /* - for (xr_vector::iterator O=Level().Objects.objects.begin(); O!=Level().Objects.objects.end(); ++O) + for (xr_vector::iterator O=Level().Objects.objects.begin(); O!=Level().Objects.objects.end(); ++O) { if( smart_cast((*O)){ CActor* pActor = smart_cast(*O); @@ -1064,7 +1064,7 @@ CZoneList* CLevel::create_hud_zones_list() return hud_zones_list; } -bool CZoneList::feel_touch_contact(CObject* O) +bool CZoneList::feel_touch_contact(IGameObject* O) { TypesMapIt it = m_TypesMap.find(O->cNameSect()); bool res = (it != m_TypesMap.end()); diff --git a/src/xrGame/Level.h b/src/xrGame/Level.h index ebddec2aa04..e7a1ec1b1ab 100644 --- a/src/xrGame/Level.h +++ b/src/xrGame/Level.h @@ -186,15 +186,15 @@ class CLevel : bool m_bIn_CrPr = false; xr_vector pObjects4CrPr; xr_vector pActors4CrPr; - CObject* pCurrentControlEntity = nullptr; + IGameObject* pCurrentControlEntity = nullptr; xrServer::EConnect m_connect_server_err = xrServer::ErrNoError; public: void AddObject_To_Objects4CrPr(CGameObject* pObj); void AddActor_To_Actors4CrPr(CGameObject* pActor); void RemoveObject_From_4CrPr(CGameObject* pObj); - CObject* CurrentControlEntity() const { return pCurrentControlEntity; } - void SetControlEntity(CObject* O) { pCurrentControlEntity = O; } + IGameObject* CurrentControlEntity() const { return pCurrentControlEntity; } + void SetControlEntity(IGameObject* O) { pCurrentControlEntity = O; } private: void make_NetCorrectionPrediction(); diff --git a/src/xrGame/Level_Bullet_Manager.cpp b/src/xrGame/Level_Bullet_Manager.cpp index b10bce8edfe..df027216743 100644 --- a/src/xrGame/Level_Bullet_Manager.cpp +++ b/src/xrGame/Level_Bullet_Manager.cpp @@ -177,7 +177,7 @@ void CBulletManager::PlayExplodePS( const Fmatrix& xf ) GamePersistent().ps_needtoplay.push_back(ps); } -void CBulletManager::PlayWhineSound(SBullet* bullet, CObject* object, const Fvector& pos) +void CBulletManager::PlayWhineSound(SBullet* bullet, IGameObject* object, const Fvector& pos) { if (m_WhineSounds.empty()) return; if (bullet->m_whine_snd._feedback() != NULL) return; diff --git a/src/xrGame/Level_Bullet_Manager.h b/src/xrGame/Level_Bullet_Manager.h index e02cfb90ec8..19ff11177fe 100644 --- a/src/xrGame/Level_Bullet_Manager.h +++ b/src/xrGame/Level_Bullet_Manager.h @@ -171,10 +171,10 @@ class CBulletManager float m_fTracerLengthMax; float m_fTracerLengthMin; protected: - void PlayWhineSound (SBullet* bullet, CObject* object, const Fvector& pos); + void PlayWhineSound (SBullet* bullet, IGameObject* object, const Fvector& pos); void PlayExplodePS (const Fmatrix& xf); //функция обработки хитов объектов - static BOOL test_callback (const collide::ray_defs& rd, CObject* object, LPVOID params); + static BOOL test_callback (const collide::ray_defs& rd, IGameObject* object, LPVOID params); static BOOL firetrace_callback (collide::rq_result& result, LPVOID params); // Deffer event diff --git a/src/xrGame/Level_bullet_manager_firetrace.cpp b/src/xrGame/Level_bullet_manager_firetrace.cpp index d78d84ba393..d83cf0fd701 100644 --- a/src/xrGame/Level_bullet_manager_firetrace.cpp +++ b/src/xrGame/Level_bullet_manager_firetrace.cpp @@ -34,7 +34,7 @@ extern float gCheckHitK; //test callback функция // object - object for testing //return TRUE-тестировать объект / FALSE-пропустить объект -BOOL CBulletManager::test_callback(const collide::ray_defs& rd, CObject* object, LPVOID params) +BOOL CBulletManager::test_callback(const collide::ray_defs& rd, IGameObject* object, LPVOID params) { bullet_test_callback_data* pData = (bullet_test_callback_data*)params; SBullet* bullet = pData->pBullet; @@ -62,14 +62,14 @@ BOOL CBulletManager::test_callback(const collide::ray_defs& rd, CObject* object, { // да попали, найдем кто стрелял bool play_whine = true; - CObject* initiator = Level().Objects.net_Find (bullet->parent_id); + IGameObject* initiator = Level().Objects.net_Find (bullet->parent_id); if (actor){ // попали в актера float hpf = 1.f; float ahp = actor->HitProbability(); #if 1 # if 0 - CObject *weapon_object = Level().Objects.net_Find (bullet->weapon_id); + IGameObject *weapon_object = Level().Objects.net_Find (bullet->weapon_id); if (weapon_object) { CWeapon *weapon = smart_cast(weapon_object); if (weapon) { @@ -85,7 +85,7 @@ BOOL CBulletManager::test_callback(const collide::ray_defs& rd, CObject* object, hpf = stalker->SpecificCharacter().hit_probability_factor(); float dist_factor = 1.f; - CObject *weapon_object = Level().Objects.net_Find (bullet->weapon_id); + IGameObject *weapon_object = Level().Objects.net_Find (bullet->weapon_id); if (weapon_object) { CWeapon *weapon = smart_cast(weapon_object); if (weapon) { @@ -143,7 +143,7 @@ BOOL CBulletManager::test_callback(const collide::ray_defs& rd, CObject* object, } //callback функция -// result.O; // 0-static else CObject* +// result.O; // 0-static else IGameObject* // result.range; // range from start to element // result.element; // if (O) "num tri" else "num bone" // params; // user defined abstract data @@ -198,7 +198,7 @@ void CBulletManager::FireShotmark (SBullet* bullet, const Fvector& vDir, const F //проиграть звук if(pSound && ShowMark) { - CObject* O = Level().Objects.net_Find(bullet->parent_id ); + IGameObject* O = Level().Objects.net_Find(bullet->parent_id ); bullet->m_mtl_snd = *pSound; bullet->m_mtl_snd.play_at_pos(O, vEnd, 0); } diff --git a/src/xrGame/Level_input.cpp b/src/xrGame/Level_input.cpp index e24058e7cb0..a057f364174 100644 --- a/src/xrGame/Level_input.cpp +++ b/src/xrGame/Level_input.cpp @@ -330,9 +330,9 @@ void CLevel::IR_OnKeyboardPress (int key) } } if (bOk) { - CObject *tpObject = CurrentEntity(); - CObject *__I = Objects.o_get_by_iterator(i); - CObject **I = &__I; + IGameObject *tpObject = CurrentEntity(); + IGameObject *__I = Objects.o_get_by_iterator(i); + IGameObject **I = &__I; SetEntity(*I); if (tpObject != *I) @@ -438,7 +438,7 @@ void CLevel::IR_OnKeyboardPress (int key) #ifdef _DEBUG - CObject *obj = Level().Objects.FindObjectByName("monster"); + IGameObject *obj = Level().Objects.FindObjectByName("monster"); if (obj) { CBaseMonster *monster = smart_cast(obj); if (monster) diff --git a/src/xrGame/Level_network.cpp b/src/xrGame/Level_network.cpp index 3c56463dda8..643d8fcf8c3 100644 --- a/src/xrGame/Level_network.cpp +++ b/src/xrGame/Level_network.cpp @@ -187,7 +187,7 @@ void CLevel::ClientSend() // if (!(Game().local_player) || Game().local_player->testFlag(GAME_PLAYER_FLAG_VERY_VERY_DEAD)) return; if (CurrentControlEntity()) { - CObject* pObj = CurrentControlEntity(); + IGameObject* pObj = CurrentControlEntity(); if (!pObj->getDestroy() && pObj->net_Relevant()) { P.w_begin (M_CL_UPDATE); @@ -237,7 +237,7 @@ u32 CLevel::Objects_net_Save (NET_Packet* _Packet, u32 start, u32 max_object_siz NET_Packet& Packet = *_Packet; u32 position; for (; start(_P); // Msg ("save:iterating:%d:%s, size[%d]",P->ID(),*P->cName(), Packet.w_tell() ); if (P && !P->getDestroy() && P->net_SaveRelevant()) { @@ -513,7 +513,7 @@ void CLevel::ClearAllObjects () ParentFound = false; for (u32 i=0; iH_Parent()) continue; //----------------------------------------------------------- NET_Packet GEN; @@ -539,7 +539,7 @@ void CLevel::ClearAllObjects () for (u32 i=0; iH_Parent() != NULL) { if (IsGameTypeSingle()) diff --git a/src/xrGame/Level_network_Demo.cpp b/src/xrGame/Level_network_Demo.cpp index 09f9ead0d96..e2e65607d14 100644 --- a/src/xrGame/Level_network_Demo.cpp +++ b/src/xrGame/Level_network_Demo.cpp @@ -101,7 +101,7 @@ void CLevel::RestartPlayDemo() VERIFY(g_pGameLevel); VERIFY(m_current_spectator); g_pGameLevel->Cameras().dbg_upd_frame = 0; - m_current_spectator->dbg_update_cl = 0; + m_current_spectator->SetDbgUpdateFrame(0); #endif StopPlayDemo (); } @@ -255,7 +255,7 @@ void CLevel::SpawnDemoSpectator() F_entity_Destroy (specentity); } -void CLevel::SetDemoSpectator(CObject* spectator) +void CLevel::SetDemoSpectator(IGameObject* spectator) { R_ASSERT2 (smart_cast(spectator), "tried to set not an spectator object to demo spectator"); @@ -370,7 +370,7 @@ void __stdcall CLevel::MSpawnsCatchCallback(u32 message, u32 subtype, NET_Packet tmp_msg_filter->remove_filter(M_SPAWN, fake_sub_msg); } -CObject* CLevel::GetDemoSpectator() +IGameObject* CLevel::GetDemoSpectator() { return smart_cast(m_current_spectator); }; diff --git a/src/xrGame/Level_network_Demo.h b/src/xrGame/Level_network_Demo.h index 54ab7c3b310..6f369723c25 100644 --- a/src/xrGame/Level_network_Demo.h +++ b/src/xrGame/Level_network_Demo.h @@ -6,7 +6,7 @@ BOOL m_DemoSaveStarted = false; u32 m_StartGlobalTime; // XXX nitrocaster: why not CurrentControlEntity* ? - CObject* m_current_spectator = nullptr; // in real, this is CurrentControlEntity + IGameObject* m_current_spectator = nullptr; // in real, this is CurrentControlEntity message_filter* m_msg_filter = nullptr; demoplay_control* m_demoplay_control = nullptr; public: @@ -28,8 +28,8 @@ }; #pragma pack(pop) - void SetDemoSpectator(CObject* spectator); - CObject* GetDemoSpectator(); + void SetDemoSpectator(IGameObject* spectator); + IGameObject* GetDemoSpectator(); void PrepareToSaveDemo(); void SaveDemoInfo(); inline demo_info* GetDemoInfo() const { return m_demo_info; } diff --git a/src/xrGame/Level_network_messages.cpp b/src/xrGame/Level_network_messages.cpp index a6b76d005a9..e2530cf3b7c 100644 --- a/src/xrGame/Level_network_messages.cpp +++ b/src/xrGame/Level_network_messages.cpp @@ -238,7 +238,7 @@ void CLevel::ClientReceive() break; }*/ P->r_u16 (ID); - CObject* O = Objects.net_Find (ID); + IGameObject* O = Objects.net_Find (ID); if (0 == O) break; O->net_ImportInput(*P); }break; diff --git a/src/xrGame/Level_network_spawn.cpp b/src/xrGame/Level_network_spawn.cpp index 23d8d6b0ed5..f9c6b110096 100644 --- a/src/xrGame/Level_network_spawn.cpp +++ b/src/xrGame/Level_network_spawn.cpp @@ -105,7 +105,7 @@ void CLevel::g_sv_Spawn (CSE_Abstract* E) // Client spawn // T.Start (); - CObject* O = Objects.Create (*E->s_name); + IGameObject* O = Objects.Create (*E->s_name); // Msg ("--spawn--CREATE: %f ms",1000.f*T.GetAsync()); // T.Start (); diff --git a/src/xrGame/MPPlayersBag.cpp b/src/xrGame/MPPlayersBag.cpp index 8059a25a3e1..e972fbd8f7b 100644 --- a/src/xrGame/MPPlayersBag.cpp +++ b/src/xrGame/MPPlayersBag.cpp @@ -23,7 +23,7 @@ void CMPPlayersBag::OnEvent(NET_Packet& P, u16 type) case GE_OWNERSHIP_TAKE : { P.r_u16(id); - CObject* O = Level().Objects.net_Find(id); + IGameObject* O = Level().Objects.net_Find(id); CInventoryItem* pIItem = smart_cast(O); R_ASSERT (pIItem->m_pInventory==NULL); @@ -37,7 +37,7 @@ void CMPPlayersBag::OnEvent(NET_Packet& P, u16 type) case GE_OWNERSHIP_REJECT : { P.r_u16 (id); - CObject* O = Level().Objects.net_Find(id); + IGameObject* O = Level().Objects.net_Find(id); #ifdef MP_LOGGING Msg("--- Rukzak [%d] rejects [%d][%s]", ID(), O->ID(), O->cNameSect().c_str()); diff --git a/src/xrGame/Mincer.cpp b/src/xrGame/Mincer.cpp index 1b74dc9a6fa..17556cbbc4a 100644 --- a/src/xrGame/Mincer.cpp +++ b/src/xrGame/Mincer.cpp @@ -65,7 +65,7 @@ void CMincer::net_Destroy() inherited::net_Destroy(); m_telekinetics.clear_impacts(); } -void CMincer::feel_touch_new (CObject* O) +void CMincer::feel_touch_new (IGameObject* O) { inherited::feel_touch_new(O); @@ -75,7 +75,7 @@ void CMincer::feel_touch_new (CObject* O) Telekinesis().activate(GO, m_fThrowInImpulse, m_fTeleHeight, 100000); } } -bool CMincer::feel_touch_contact (CObject* O) +bool CMincer::feel_touch_contact (IGameObject* O) { return inherited::feel_touch_contact(O)&&smart_cast(O); } @@ -88,7 +88,7 @@ bool CMincer::BlowoutState () { bool ret=inherited::BlowoutState (); - //xr_set::iterator it=m_inZone.begin(),e=m_inZone.end(); + //xr_set::iterator it=m_inZone.begin(),e=m_inZone.end(); //for(;e!=it;++it) //{ // CEntityAlive * EA = smart_cast(*it); @@ -122,7 +122,7 @@ void CMincer::NotificateDestroy (CPHDestroyableNotificate *dn) float impulse; //if(!m_telekinetics.has_impacts()) return; - //CObject* obj=Level().Objects.net_Find(id); + //IGameObject* obj=Level().Objects.net_Find(id); CPhysicsShellHolder* obj=dn->PPhysicsShellHolder(); m_telekinetics.draw_out_impact(dir,impulse); CParticlesPlayer* PP = smart_cast(obj); diff --git a/src/xrGame/Mincer.h b/src/xrGame/Mincer.h index 7a72861620b..4a29f8d6e00 100644 --- a/src/xrGame/Mincer.h +++ b/src/xrGame/Mincer.h @@ -32,8 +32,8 @@ class CMincer : virtual ~CMincer (); // virtual void SwitchZoneState (EZoneState new_state); virtual void OnStateSwitch (EZoneState new_state); - virtual bool feel_touch_contact (CObject* O); - virtual void feel_touch_new (CObject* O); + virtual bool feel_touch_contact (IGameObject* O); + virtual void feel_touch_new (IGameObject* O); virtual void Load (LPCSTR section); virtual bool BlowoutState (); virtual void AffectPullDead (CPhysicsShellHolder* GO,const Fvector& throw_in_dir,float dist){} diff --git a/src/xrGame/Missile.cpp b/src/xrGame/Missile.cpp index 51d98ca25ab..f6e1579c6d6 100644 --- a/src/xrGame/Missile.cpp +++ b/src/xrGame/Missile.cpp @@ -669,12 +669,12 @@ void CMissile::activate_physic_shell() kinematics->CalculateBones_Invalidate(); kinematics->CalculateBones (TRUE); } -void CMissile::net_Relcase(CObject* O) +void CMissile::net_Relcase(IGameObject* O) { inherited::net_Relcase(O); if(PPhysicsShell()&&PPhysicsShell()->isActive()) { - if(O==smart_cast((CPhysicsShellHolder*)PPhysicsShell()->get_CallbackData())) + if(O==smart_cast((CPhysicsShellHolder*)PPhysicsShell()->get_CallbackData())) { PPhysicsShell()->remove_ObjectContactCallback(ExitContactCallback); PPhysicsShell()->set_CallbackData(NULL); diff --git a/src/xrGame/Missile.h b/src/xrGame/Missile.h index d996844d6f0..b059a8e1e0c 100644 --- a/src/xrGame/Missile.h +++ b/src/xrGame/Missile.h @@ -59,7 +59,7 @@ class CMissile : public CHudItemObject virtual void OnHiddenItem (); //для сети - virtual void net_Relcase (CObject* O ); + virtual void net_Relcase (IGameObject* O ); protected: //время нахождения в текущем состоянии diff --git a/src/xrGame/PDA.cpp b/src/xrGame/PDA.cpp index 8127e33be74..35b8623124c 100644 --- a/src/xrGame/PDA.cpp +++ b/src/xrGame/PDA.cpp @@ -75,7 +75,7 @@ void CPda::shedule_Update(u32 dt) void CPda::UpdateActiveContacts () { m_active_contacts.clear_not_free(); - xr_vector::iterator it= feel_touch.begin(); + xr_vector::iterator it= feel_touch.begin(); for(;it!=feel_touch.end();++it){ CEntityAlive* pEA = smart_cast(*it); if(!!pEA->g_Alive() && !pEA->cast_base_monster()) @@ -85,7 +85,7 @@ void CPda::UpdateActiveContacts () } } -void CPda::feel_touch_new(CObject* O) +void CPda::feel_touch_new(IGameObject* O) { if ( CInventoryOwner* pNewContactInvOwner = smart_cast(O) ) { @@ -94,7 +94,7 @@ void CPda::feel_touch_new(CObject* O) } } -void CPda::feel_touch_delete(CObject* O) +void CPda::feel_touch_delete(IGameObject* O) { if(!H_Parent()) return; if ( CInventoryOwner* pLostContactInvOwner = smart_cast(O) ) @@ -104,7 +104,7 @@ void CPda::feel_touch_delete(CObject* O) } } -bool CPda::feel_touch_contact(CObject* O) +bool CPda::feel_touch_contact(IGameObject* O) { CEntityAlive* entity_alive = smart_cast(O); @@ -153,7 +153,7 @@ void CPda::OnH_B_Independent(bool just_before_destroy) CInventoryOwner* CPda::GetOriginalOwner() { - CObject* pObject = Level().Objects.net_Find(GetOriginalOwnerID()); + IGameObject* pObject = Level().Objects.net_Find(GetOriginalOwnerID()); CInventoryOwner* pInvOwner = smart_cast(pObject); return pInvOwner; @@ -164,8 +164,8 @@ CInventoryOwner* CPda::GetOriginalOwner() void CPda::ActivePDAContacts(xr_vector& res) { res.clear_not_free (); - xr_vector::iterator it = m_active_contacts.begin(); - xr_vector::iterator it_e = m_active_contacts.end(); + xr_vector::iterator it = m_active_contacts.begin(); + xr_vector::iterator it_e = m_active_contacts.end(); for(;it!=it_e;++it) { @@ -187,7 +187,7 @@ void CPda::load(IReader &input_packet) load_data (m_sFullName, input_packet); } -CObject* CPda::GetOwnerObject() +IGameObject* CPda::GetOwnerObject() { return Level().Objects.net_Find(GetOriginalOwnerID()); } @@ -211,7 +211,7 @@ LPCSTR CPda::Name () } */ -CPda* CPda::GetPdaFromOwner(CObject* owner) +CPda* CPda::GetPdaFromOwner(IGameObject* owner) { return smart_cast(owner)->GetPDA (); } diff --git a/src/xrGame/PDA.h b/src/xrGame/PDA.h index d382a1adf31..8e9f233b6b7 100644 --- a/src/xrGame/PDA.h +++ b/src/xrGame/PDA.h @@ -31,14 +31,14 @@ class CPda : virtual void shedule_Update (u32 dt); - virtual void feel_touch_new (CObject* O); - virtual void feel_touch_delete (CObject* O); - virtual bool feel_touch_contact (CObject* O); + virtual void feel_touch_new (IGameObject* O); + virtual void feel_touch_delete (IGameObject* O); + virtual bool feel_touch_contact (IGameObject* O); virtual u16 GetOriginalOwnerID () {return m_idOriginalOwner;} virtual CInventoryOwner* GetOriginalOwner (); - virtual CObject* GetOwnerObject (); + virtual IGameObject* GetOwnerObject (); void TurnOn () {m_bTurnedOff = false;} @@ -50,7 +50,7 @@ class CPda : void ActivePDAContacts (xr_vector& res); - CPda* GetPdaFromOwner (CObject* owner); + CPda* GetPdaFromOwner (IGameObject* owner); u32 ActiveContactsNum () {return m_active_contacts.size();} void PlayScriptFunction (); bool CanPlayScriptFunction () {if(!xr_strcmp(m_functor_str, "")) return false; return true;}; @@ -65,7 +65,7 @@ class CPda : void UpdateActiveContacts (); - xr_vector m_active_contacts; + xr_vector m_active_contacts; float m_fRadius; u16 m_idOriginalOwner; diff --git a/src/xrGame/PHDebug.cpp b/src/xrGame/PHDebug.cpp index d02b487f25d..00b43ec2f9a 100644 --- a/src/xrGame/PHDebug.cpp +++ b/src/xrGame/PHDebug.cpp @@ -30,7 +30,7 @@ bool draw_frame=0; //LPCSTR dbg_trace_object_name =NULL; string64 s_dbg_trace_obj_name ="none"; -CObject *trace_object = NULL; +IGameObject *trace_object = NULL; u32 dbg_bodies_num =0; u32 dbg_joints_num =0; u32 dbg_islands_num =0; @@ -877,7 +877,7 @@ void DBG_DrawBones( const Fmatrix &xform, IKinematics *K ) DBG_DrawPoint( xform.c, 0.1, color_xrgb( 255, 125, 125 ) ); } -void DBG_DrawBones( CObject &O ) +void DBG_DrawBones( IGameObject &O ) { IKinematics *K = smart_cast ( O.Visual() ); @@ -887,7 +887,7 @@ void DBG_DrawBones( CObject &O ) VERIFY( K ); DBG_DrawBones(O.XFORM(), K ); } -void DBG_PhysBones( CObject &O ) +void DBG_PhysBones( IGameObject &O ) { CPhysicsShellHolder *sh = smart_cast(&O); @@ -909,7 +909,7 @@ void DBG_PhysBones( CObject &O ) } -void DBG_DrawBind( CObject &O ) +void DBG_DrawBind( IGameObject &O ) { IKinematics *K = smart_cast ( O.Visual() ); @@ -962,7 +962,7 @@ class cphdebug_impl: public IPhDebugRender } ph_debug_render_impl; -void DBG_PH_NetRelcase( CObject* obj ) +void DBG_PH_NetRelcase( IGameObject* obj ) { if( trace_object == obj ) trace_object = NULL; @@ -970,7 +970,7 @@ void DBG_PH_NetRelcase( CObject* obj ) bool is_trace_obj( CPHObject *obj ) { - return trace_object && smart_cast(obj->ref_object()) == trace_object; + return trace_object && smart_cast(obj->ref_object()) == trace_object; } @@ -1125,9 +1125,9 @@ virtual void _cdecl DBG_OutText( LPCSTR s,... ) } //virtual void DBG_TextOutSet( float x, float y ) =0; //virtual void DBG_TextSetColor( u32 color ) =0; -//virtual void DBG_DrawBind( CObject &O ) =0; -//virtual void DBG_PhysBones( CObject &O ) =0; -//virtual void DBG_DrawBones( CObject &O ) =0; +//virtual void DBG_DrawBind( IGameObject &O ) =0; +//virtual void DBG_PhysBones( IGameObject &O ) =0; +//virtual void DBG_DrawBones( IGameObject &O ) =0; virtual void DBG_DrawFrameStart( ) { ::DBG_DrawFrameStart( ); diff --git a/src/xrGame/PHDebug.h b/src/xrGame/PHDebug.h index 78eb725faaf..f089d44b177 100644 --- a/src/xrGame/PHDebug.h +++ b/src/xrGame/PHDebug.h @@ -22,8 +22,8 @@ extern u32 dbg_islands_num ; extern u32 dbg_contacts_num ; extern float dbg_vel_collid_damage_to_display ; extern LPCSTR dbg_trace_object ; -class CObject ; -extern CObject *trace_object ; +class IGameObject ; +extern IGameObject *trace_object ; #ifdef DRAW_CONTACTS @@ -68,9 +68,9 @@ void DBG_DrawRotationZ( const Fmatrix &m, float ang0, float ang1, float size, u3 void _cdecl DBG_OutText( LPCSTR s,... ); void DBG_TextOutSet( float x, float y ); void DBG_TextSetColor( u32 color ); -void DBG_DrawBind( CObject &O ); -void DBG_PhysBones( CObject &O ); -void DBG_DrawBones( CObject &O ); +void DBG_DrawBind( IGameObject &O ); +void DBG_PhysBones( IGameObject &O ); +void DBG_DrawBones( IGameObject &O ); void DBG_DrawFrameStart( ); void PH_DBG_Render( ); void PH_DBG_Clear( ); @@ -79,7 +79,7 @@ LPCSTR PH_DBG_ObjectTrackName( ); ///////////////////////////////////////////////// -void DBG_PH_NetRelcase( CObject* obj ); +void DBG_PH_NetRelcase( IGameObject* obj ); struct CFunctionGraph diff --git a/src/xrGame/PHMovementControl.cpp b/src/xrGame/PHMovementControl.cpp index f6683d0068f..8c6c42f45dc 100644 --- a/src/xrGame/PHMovementControl.cpp +++ b/src/xrGame/PHMovementControl.cpp @@ -45,7 +45,7 @@ const u64 after_creation_collision_hit_block_steps_number=100; -CPHMovementControl::CPHMovementControl(CObject* parent) +CPHMovementControl::CPHMovementControl(IGameObject* parent) { pObject=parent; @@ -1354,7 +1354,7 @@ void CPHMovementControl::TraceBorder(const Fvector &prev_position) STraceBorderQParams p(this,dir); storage.r_clear (); - g_pGameLevel->ObjectSpace.RayQuery(storage,RD,BorderTraceCallback,&p,NULL,smart_cast(m_character->PhysicsRefObject())); + g_pGameLevel->ObjectSpace.RayQuery(storage,RD,BorderTraceCallback,&p,NULL,smart_cast(m_character->PhysicsRefObject())); } void CPHMovementControl:: UpdateObjectBox(CPHCharacter *ach) @@ -1774,7 +1774,7 @@ void CPHMovementControl::BlockDamageSet ( u64 steps_num ) UpdateCollisionDamage();//reset all saved values } -void CPHMovementControl::NetRelcase ( CObject* O ) +void CPHMovementControl::NetRelcase ( IGameObject* O ) { CPhysicsShellHolder *sh = smart_cast(O); diff --git a/src/xrGame/PHMovementControl.h b/src/xrGame/PHMovementControl.h index 2850e48f940..87133bacee4 100644 --- a/src/xrGame/PHMovementControl.h +++ b/src/xrGame/PHMovementControl.h @@ -39,7 +39,7 @@ class CPHMovementControl : static const int path_few_point=10; public: -CObject *ParentObject (){ return pObject; } +IGameObject *ParentObject (){ return pObject; } IElevatorState *ElevatorState (); void in_shedule_Update ( u32 DT ); void PHCaptureObject ( CPhysicsShellHolder* object, CPHCaptureBoneCallback* cb =0 ); @@ -107,7 +107,7 @@ int in_dead_area_count; float m_fGroundDelayFactor; BOOL bIsAffectedByGravity; //------------------------------ - CObject* pObject; + IGameObject* pObject; EEnvironment eOldEnvironment; EEnvironment eEnvironment; Fbox aabb; @@ -279,11 +279,11 @@ int in_dead_area_count; bool CharacterExist () const ; void update_last_material () ; u16 injurious_material_idx () ; - CPHMovementControl(CObject* parent); + CPHMovementControl(IGameObject* parent); ~CPHMovementControl(void); CPHCharacter *character () { return m_character; }; - void NetRelcase ( CObject* O ); + void NetRelcase ( IGameObject* O ); private: void actor_calculate (Fvector& vAccel,const Fvector& camDir, float ang_speed, float jump, float dt, bool bLight); void UpdateCollisionDamage ( ); diff --git a/src/xrGame/PHScriptCall.h b/src/xrGame/PHScriptCall.h index e72092aabf7..303e4ddeb2b 100644 --- a/src/xrGame/PHScriptCall.h +++ b/src/xrGame/PHScriptCall.h @@ -123,17 +123,17 @@ class CPHScriptObjectActionN : class CPHScriptGameObjectCondition : public CPHScriptObjectConditionN { - CObject* m_obj; + IGameObject* m_obj; bool b_obsolete; public: - CPHScriptGameObjectCondition( const luabind::object &object,const luabind::functor &functor,CObject* gobj): + CPHScriptGameObjectCondition( const luabind::object &object,const luabind::functor &functor,IGameObject* gobj): CPHScriptObjectConditionN(object,functor) { m_obj=gobj; b_obsolete=false; } virtual bool is_true () {b_obsolete=CPHScriptObjectConditionN::is_true();return b_obsolete;} - virtual bool compare (const CObject* v) const {return m_obj->ID()==v->ID();} + virtual bool compare (const IGameObject* v) const {return m_obj->ID()==v->ID();} virtual bool compare (const CPHReqComparerV* v) const {return v->compare(this);} virtual bool obsolete () const {return b_obsolete;} }; @@ -141,15 +141,15 @@ class CPHScriptGameObjectCondition : class CPHScriptGameObjectAction : public CPHScriptObjectActionN { - CObject* m_obj; + IGameObject* m_obj; public: - CPHScriptGameObjectAction( const luabind::object &object,const luabind::functor &functor,CObject* gobj): + CPHScriptGameObjectAction( const luabind::object &object,const luabind::functor &functor,IGameObject* gobj): CPHScriptObjectActionN(object,functor) { m_obj=gobj; } virtual bool compare (const CPHReqComparerV* v) const {return v->compare(this);} - virtual bool compare (const CObject* v) const {return m_obj->ID()==v->ID();} + virtual bool compare (const IGameObject* v) const {return m_obj->ID()==v->ID();} }; class CPHSriptReqObjComparer : @@ -171,10 +171,10 @@ class CPHSriptReqObjComparer : class CPHSriptReqGObjComparer : public CPHReqComparerV { - CObject *m_object; + IGameObject *m_object; public: - CPHSriptReqGObjComparer (CObject* object) {m_object= object;} + CPHSriptReqGObjComparer (IGameObject* object) {m_object= object;} virtual bool compare (const CPHScriptGameObjectAction* v) const {return v->compare(m_object);} virtual bool compare (const CPHScriptGameObjectCondition* v)const {return v->compare(m_object);} }; \ No newline at end of file diff --git a/src/xrGame/ParticlesPlayer.cpp b/src/xrGame/ParticlesPlayer.cpp index 3e69d9c553a..98a217d5b13 100644 --- a/src/xrGame/ParticlesPlayer.cpp +++ b/src/xrGame/ParticlesPlayer.cpp @@ -19,7 +19,7 @@ CParticlesPlayer::SParticlesInfo* CParticlesPlayer::SBoneInfo::FindParticles(con if (it->ps && it->ps->Name()==ps_name) return &(*it); return 0; } -CParticlesPlayer::SParticlesInfo* CParticlesPlayer::SBoneInfo::AppendParticles(CObject* object, const shared_str& ps_name) +CParticlesPlayer::SParticlesInfo* CParticlesPlayer::SBoneInfo::AppendParticles(IGameObject* object, const shared_str& ps_name) { SParticlesInfo* pi = FindParticles(ps_name); if (pi) return pi; @@ -139,7 +139,7 @@ void CParticlesPlayer::StartParticles(const shared_str& particles_name, u16 bone VERIFY(fis_zero(xform.c.magnitude())); R_ASSERT(*particles_name); - CObject* object = m_self_object; + IGameObject* object = m_self_object; VERIFY(object); SBoneInfo* pBoneInfo = get_nearest_bone_info(smart_cast(object->Visual()),bone_num); @@ -163,7 +163,7 @@ void CParticlesPlayer::StartParticles(const shared_str& particles_name, u16 bone void CParticlesPlayer::StartParticles(const shared_str& ps_name, const Fmatrix& xform, u16 sender_id, int life_time, bool auto_stop) { - CObject* object = m_self_object; + IGameObject* object = m_self_object; VERIFY(object); for(BoneInfoVecIt it = m_Bones.begin(); it!=m_Bones.end(); it++){ @@ -243,7 +243,7 @@ void CParticlesPlayer::UpdateParticles() if (!m_bActiveBones) return; m_bActiveBones = false; - CObject* object = m_self_object; + IGameObject* object = m_self_object; VERIFY (object); for(BoneInfoVecIt b_it=m_Bones.begin(); b_it!=m_Bones.end(); b_it++){ @@ -281,7 +281,7 @@ void CParticlesPlayer::UpdateParticles() } -void CParticlesPlayer::GetBonePos (CObject* pObject, u16 bone_id, const Fvector& offset, Fvector& result) +void CParticlesPlayer::GetBonePos (IGameObject* pObject, u16 bone_id, const Fvector& offset, Fvector& result) { VERIFY(pObject); IKinematics* pKinematics = smart_cast(pObject->Visual()); VERIFY(pKinematics); @@ -292,7 +292,7 @@ void CParticlesPlayer::GetBonePos (CObject* pObject, u16 bone_id, const Fvector& pObject->XFORM().transform_tiny(result); } -void CParticlesPlayer::MakeXFORM (CObject* pObject, u16 bone_id, const Fvector& dir, const Fvector& offset, Fmatrix& result) +void CParticlesPlayer::MakeXFORM (IGameObject* pObject, u16 bone_id, const Fvector& dir, const Fvector& offset, Fmatrix& result) { generate_orthonormal_basis(dir,result); GetBonePos(pObject, bone_id, offset, result.c); @@ -312,7 +312,7 @@ u16 CParticlesPlayer::GetNearestBone (IKinematics* K, u16 bone_id) void CParticlesPlayer::net_SpawnParticles () { VERIFY (!m_self_object); - m_self_object = smart_cast(this); + m_self_object = smart_cast(this); VERIFY (m_self_object); } diff --git a/src/xrGame/ParticlesPlayer.h b/src/xrGame/ParticlesPlayer.h index 2b4cdd63db4..a097f43b13c 100644 --- a/src/xrGame/ParticlesPlayer.h +++ b/src/xrGame/ParticlesPlayer.h @@ -11,7 +11,7 @@ DEFINE_VECTOR(CParticlesObject*, PARTICLES_PTR_VECTOR, PARTICLES_PTR_VECTOR_IT); -class CObject; +class IGameObject; class IKinematics; class CParticlesPlayer @@ -37,7 +37,7 @@ class CParticlesPlayer SParticlesInfo* FindParticles (const shared_str& ps_name); public: SBoneInfo (u16 idx, const Fvector& offs):index(idx),offset(offs){;} - SParticlesInfo* AppendParticles (CObject* object, const shared_str& ps_name); + SParticlesInfo* AppendParticles (IGameObject* object, const shared_str& ps_name); void StopParticles (const shared_str& ps_name, bool bDestroy); void StopParticles (u16 sender_id, bool bDestroy); }; @@ -47,7 +47,7 @@ class CParticlesPlayer // список костей u64 bone_mask; // используемые кости BoneInfoVec m_Bones; - CObject *m_self_object; + IGameObject *m_self_object; protected : bool m_bActiveBones; //есть ли косточки на которых играются партиклы @@ -83,8 +83,8 @@ protected : void StopParticles (const shared_str& particles_name, u16 bone_id, bool bDestroy); void AutoStopParticles (const shared_str& ps_name, u16 bone_id,u32 life_time); - static void MakeXFORM (CObject* pObject, u16 bone_id, const Fvector& dir, const Fvector& offset, Fmatrix& result); - static void GetBonePos (CObject* pObject, u16 bone_id, const Fvector& offset, Fvector& result); + static void MakeXFORM (IGameObject* pObject, u16 bone_id, const Fvector& dir, const Fvector& offset, Fmatrix& result); + static void GetBonePos (IGameObject* pObject, u16 bone_id, const Fvector& offset, Fvector& result); u16 GetNearestBone (IKinematics* K, u16 bone_id); IC u16 GetRandomBone (){ u16 l_PBCount=u16(m_Bones.size()); if(l_PBCount) return m_Bones[(u16)Random.randI(l_PBCount)].index; else return BI_NONE;} diff --git a/src/xrGame/PhysicsShellHolder.cpp b/src/xrGame/PhysicsShellHolder.cpp index 1abb7376b7f..1d163f2c132 100644 --- a/src/xrGame/PhysicsShellHolder.cpp +++ b/src/xrGame/PhysicsShellHolder.cpp @@ -120,7 +120,7 @@ void CPhysicsShellHolder::PHHit( SHit &H ) if(m_pPhysicsShell) m_pPhysicsShell->applyHit(H.bone_space_position(),H.direction(),H.phys_impulse(),H.bone(),H.type()); } -//void CPhysicsShellHolder::Hit(float P, Fvector &dir, CObject* who, s16 element, +//void CPhysicsShellHolder::Hit(float P, Fvector &dir, IGameObject* who, s16 element, // Fvector p_in_object_space, float impulse, ALife::EHitType hit_type) void CPhysicsShellHolder::Hit (SHit* pHDS) { diff --git a/src/xrGame/RadioactiveZone.cpp b/src/xrGame/RadioactiveZone.cpp index 890fd5c159b..3ef05483cf4 100644 --- a/src/xrGame/RadioactiveZone.cpp +++ b/src/xrGame/RadioactiveZone.cpp @@ -75,7 +75,7 @@ void CRadioactiveZone::Affect(SZoneObjectInfo* O) }//while } -void CRadioactiveZone::feel_touch_new (CObject* O ) +void CRadioactiveZone::feel_touch_new (IGameObject* O ) { inherited::feel_touch_new(O); if (GameID() != eGameIDSingle) @@ -88,7 +88,7 @@ void CRadioactiveZone::feel_touch_new (CObject* O ) }; #include "actor.h" -bool CRadioactiveZone::feel_touch_contact(CObject* O) +bool CRadioactiveZone::feel_touch_contact(IGameObject* O) { CActor* A = smart_cast(O); diff --git a/src/xrGame/RadioactiveZone.h b/src/xrGame/RadioactiveZone.h index 1384f5124b4..cc2e5194c74 100644 --- a/src/xrGame/RadioactiveZone.h +++ b/src/xrGame/RadioactiveZone.h @@ -11,9 +11,9 @@ class CRadioactiveZone : public CCustomZone virtual void Load (LPCSTR section); virtual void Affect (SZoneObjectInfo* O); - virtual void feel_touch_new (CObject* O ); + virtual void feel_touch_new (IGameObject* O ); virtual void UpdateWorkload (u32 dt ); // related to fast-mode optimizations - virtual bool feel_touch_contact (CObject* O ); + virtual bool feel_touch_contact (IGameObject* O ); float nearest_shape_radius (SZoneObjectInfo* O); protected: diff --git a/src/xrGame/ShootingObject.cpp b/src/xrGame/ShootingObject.cpp index 47b923b0832..20a9ce73d6a 100644 --- a/src/xrGame/ShootingObject.cpp +++ b/src/xrGame/ShootingObject.cpp @@ -405,7 +405,7 @@ void CShootingObject::RenderLight() } } -bool CShootingObject::SendHitAllowed (CObject* pUser) +bool CShootingObject::SendHitAllowed (IGameObject* pUser) { if (Game().IsServerControlHits()) return OnServer(); diff --git a/src/xrGame/ShootingObject.h b/src/xrGame/ShootingObject.h index 699f577ca34..49dddfc96b8 100644 --- a/src/xrGame/ShootingObject.h +++ b/src/xrGame/ShootingObject.h @@ -44,7 +44,7 @@ class CShootingObject : public IAnticheatDumpable ////////////////////////////////////////////////////////////////////////// protected: virtual void LoadFireParams (LPCSTR section); //сила выстрела - virtual bool SendHitAllowed (CObject* pUser); + virtual bool SendHitAllowed (IGameObject* pUser); virtual void FireBullet (const Fvector& pos, const Fvector& dir, float fire_disp, diff --git a/src/xrGame/Spectator.cpp b/src/xrGame/Spectator.cpp index fbb8c0559c7..7cd2b6081da 100644 --- a/src/xrGame/Spectator.cpp +++ b/src/xrGame/Spectator.cpp @@ -84,7 +84,7 @@ void CSpectator::UpdateCL() if (m_pActorToLookAt) { #ifdef DEBUG - m_pActorToLookAt->dbg_update_cl = 0; + m_pActorToLookAt->SetDbgUpdateFrame(0); m_pActorToLookAt->GetSchedulerData().dbg_update_shedule = 0; Game().GetSchedulerData().dbg_update_shedule = 0; #endif @@ -93,7 +93,7 @@ void CSpectator::UpdateCL() m_pActorToLookAt->shedule_Update (0); Game().shedule_Update (0); #ifdef DEBUG - m_pActorToLookAt->dbg_update_cl = 0; + m_pActorToLookAt->SetDbgUpdateFrame(0); m_pActorToLookAt->GetSchedulerData().dbg_update_shedule = 0; Game().GetSchedulerData().dbg_update_shedule = 0; #endif @@ -312,9 +312,9 @@ void CSpectator::IR_OnMouseMove(int dx, int dy) } } -void CSpectator::FirstEye_ToPlayer(CObject* pObject) +void CSpectator::FirstEye_ToPlayer(IGameObject* pObject) { - CObject* pCurViewEntity = Level().CurrentEntity(); + IGameObject* pCurViewEntity = Level().CurrentEntity(); CActor* pOldActor = NULL; if (pCurViewEntity) { @@ -351,14 +351,14 @@ void CSpectator::FirstEye_ToPlayer(CObject* pObject) if (Device.Paused() && pOldActor) { #ifdef DEBUG - pOldActor->dbg_update_cl = 0; + pOldActor->SetDbgUpdateFrame(0); pOldActor->GetSchedulerData().dbg_update_shedule = 0; #endif Device.dwTimeDelta = 0; pOldActor->UpdateCL (); pOldActor->shedule_Update (0); #ifdef DEBUG - pOldActor->dbg_update_cl = 0; + pOldActor->SetDbgUpdateFrame(0); pOldActor->GetSchedulerData().dbg_update_shedule = 0; #endif } @@ -532,7 +532,7 @@ bool CSpectator::SelectNextPlayerToLook (bool const search_next) if (ps->team != PS->team && !PS->testFlag(GAME_PLAYER_FLAG_SPECTATOR)) continue; }; u16 id = ps->GameID; - CObject* pObject = Level().Objects.net_Find(id); + IGameObject* pObject = Level().Objects.net_Find(id); if (!pObject) continue; CActor* A = smart_cast(pObject); if (!A) continue; @@ -566,7 +566,7 @@ bool CSpectator::SelectNextPlayerToLook (bool const search_next) return false; }; -void CSpectator::net_Relcase (CObject *O) +void CSpectator::net_Relcase (IGameObject *O) { if (O != m_pActorToLookAt) return; diff --git a/src/xrGame/Spectator.h b/src/xrGame/Spectator.h index 3686b084182..fcd16b7228f 100644 --- a/src/xrGame/Spectator.h +++ b/src/xrGame/Spectator.h @@ -44,7 +44,7 @@ class CSpectator: CActor* m_pActorToLookAt; bool SelectNextPlayerToLook (bool const search_next); - void FirstEye_ToPlayer (CObject* pObject); + void FirstEye_ToPlayer (IGameObject* pObject); static const float cam_inert_value; float prev_cam_inert_value; @@ -69,7 +69,7 @@ class CSpectator: virtual CGameObject* cast_game_object () {return this;} virtual IInputReceiver* cast_input_receiver () {return this;} - virtual void net_Relcase (CObject *O); + virtual void net_Relcase (IGameObject *O); void GetSpectatorString (string1024& pStr); diff --git a/src/xrGame/UIDialogHolder.cpp b/src/xrGame/UIDialogHolder.cpp index cf4cefc6a9e..51c8c42b3c2 100644 --- a/src/xrGame/UIDialogHolder.cpp +++ b/src/xrGame/UIDialogHolder.cpp @@ -271,7 +271,7 @@ bool CDialogHolder::IR_UIOnKeyboardPress(int dik) if( !TIR->StopAnyMove() && g_pGameLevel ) { - CObject* O = Level().CurrentEntity(); + IGameObject* O = Level().CurrentEntity(); if( O ){ IInputReceiver* IR = smart_cast( smart_cast(O) ); if (IR) @@ -307,7 +307,7 @@ bool CDialogHolder::IR_UIOnKeyboardRelease(int dik) if( !TIR->StopAnyMove() && g_pGameLevel ) { - CObject* O = Level().CurrentEntity(); + IGameObject* O = Level().CurrentEntity(); if( O ) { IInputReceiver* IR = smart_cast( smart_cast(O) ); @@ -330,7 +330,7 @@ bool CDialogHolder::IR_UIOnKeyboardHold(int dik) if(!TIR->StopAnyMove() && g_pGameLevel ) { - CObject* O = Level().CurrentEntity(); + IGameObject* O = Level().CurrentEntity(); if(O) { IInputReceiver* IR = smart_cast( smart_cast(O) ); @@ -367,7 +367,7 @@ bool CDialogHolder::IR_UIOnMouseMove(int dx, int dy) }else if(!TIR->StopAnyMove() && g_pGameLevel ) { - CObject* O = Level().CurrentEntity(); + IGameObject* O = Level().CurrentEntity(); if(O) { IInputReceiver* IR = smart_cast( smart_cast(O) ); diff --git a/src/xrGame/Weapon.cpp b/src/xrGame/Weapon.cpp index d01b231babb..437f7a2789c 100644 --- a/src/xrGame/Weapon.cpp +++ b/src/xrGame/Weapon.cpp @@ -1807,14 +1807,14 @@ float CWeapon::GetConditionToShow () const BOOL CWeapon::ParentMayHaveAimBullet () { - CObject* O=H_Parent(); + IGameObject* O=H_Parent(); CEntityAlive* EA=smart_cast(O); return EA->cast_actor()!=0; } BOOL CWeapon::ParentIsActor () { - CObject* O = H_Parent(); + IGameObject* O = H_Parent(); if (!O) return FALSE; diff --git a/src/xrGame/WeaponBinoculars.cpp b/src/xrGame/WeaponBinoculars.cpp index 6a772591c26..29cd0498035 100644 --- a/src/xrGame/WeaponBinoculars.cpp +++ b/src/xrGame/WeaponBinoculars.cpp @@ -157,7 +157,7 @@ bool CWeaponBinoculars::GetBriefInfo( II_BriefInfo& info ) return true; } -void CWeaponBinoculars::net_Relcase (CObject *object) +void CWeaponBinoculars::net_Relcase (IGameObject *object) { if (!m_binoc_vision) return; diff --git a/src/xrGame/WeaponBinoculars.h b/src/xrGame/WeaponBinoculars.h index 903ae99cd5c..263de1203af 100644 --- a/src/xrGame/WeaponBinoculars.h +++ b/src/xrGame/WeaponBinoculars.h @@ -34,7 +34,7 @@ class CWeaponBinoculars: public CWeaponCustomPistol virtual bool render_item_ui_query(); virtual bool use_crosshair () const {return false;} virtual bool GetBriefInfo (II_BriefInfo& info); - virtual void net_Relcase (CObject *object); + virtual void net_Relcase (IGameObject *object); protected: CBinocularsVision* m_binoc_vision; }; diff --git a/src/xrGame/WeaponBinocularsVision.cpp b/src/xrGame/WeaponBinocularsVision.cpp index d1be96ee8e0..8b37f9702b6 100644 --- a/src/xrGame/WeaponBinocularsVision.cpp +++ b/src/xrGame/WeaponBinocularsVision.cpp @@ -22,8 +22,8 @@ extern u32 C_ON_NEUTRAL; extern u32 C_ON_FRIEND; struct FindVisObjByObject{ - const CObject* O; - FindVisObjByObject(const CObject* o):O(o){} + const IGameObject* O; + FindVisObjByObject(const IGameObject* o):O(o){} bool operator () (const SBinocVisibleObj* vis){ return (O==vis->m_object); } @@ -217,11 +217,11 @@ void CBinocularsVision::Update() CVisualMemoryManager::VISIBLES::const_iterator v_it = vVisibles.begin(); for (; v_it!=vVisibles.end(); ++v_it) { - const CObject* _object_ = (*v_it).m_object; + const IGameObject* _object_ = (*v_it).m_object; if (!pActor->memory().visual().visible_now(smart_cast(_object_))) continue; - CObject* object_ = const_cast(_object_); + IGameObject* object_ = const_cast(_object_); CEntityAlive* EA = smart_cast(object_); @@ -282,7 +282,7 @@ void CBinocularsVision::Load(const shared_str& section) m_sounds.LoadSound (section.c_str(),"catch_snd", "catch_snd", false, SOUND_TYPE_NO_SOUND); } -void CBinocularsVision::remove_links(CObject *object) +void CBinocularsVision::remove_links(IGameObject *object) { VIS_OBJECTS::iterator I = std::find_if(m_active_objects.begin(),m_active_objects.end(),FindVisObjByObject(object)); if (I == m_active_objects.end()) diff --git a/src/xrGame/WeaponBinocularsVision.h b/src/xrGame/WeaponBinocularsVision.h index ab49b22a5a6..36c3190f8e1 100644 --- a/src/xrGame/WeaponBinocularsVision.h +++ b/src/xrGame/WeaponBinocularsVision.h @@ -2,7 +2,7 @@ #include "ui\uistatic.h" #include "HudSound.h" -class CObject; +class IGameObject; enum{ @@ -11,7 +11,7 @@ enum{ }; struct SBinocVisibleObj{ SBinocVisibleObj () {}; - CObject* m_object; + IGameObject* m_object; CUIStatic m_lt; CUIStatic m_lb; CUIStatic m_rt; @@ -36,7 +36,7 @@ class CBinocularsVision ~CBinocularsVision (); void Update (); void Draw (); - void remove_links (CObject *object); + void remove_links (IGameObject *object); protected : Fcolor m_frame_color; diff --git a/src/xrGame/WeaponKnife.cpp b/src/xrGame/WeaponKnife.cpp index 12b28384f69..338e6eb16be 100644 --- a/src/xrGame/WeaponKnife.cpp +++ b/src/xrGame/WeaponKnife.cpp @@ -142,7 +142,7 @@ void CWeaponKnife::OnStateSwitch (u32 S) void CWeaponKnife::KnifeStrike(const Fvector& pos, const Fvector& dir) { - CObject* real_victim = TryPick(pos, dir, m_hit_dist); + IGameObject* real_victim = TryPick(pos, dir, m_hit_dist); if (real_victim) { float new_khit = m_eHitType == m_eHitType_1 ? @@ -670,7 +670,7 @@ void CWeaponKnife::create_victims_list(spartial_base_t spartial_result, for (spartial_base_t::const_iterator i = spartial_result.begin(), ie = spartial_result.end(); i != ie; ++i) { - CObject* tmp_obj = (*i)->dcast_CObject(); + IGameObject* tmp_obj = (*i)->dcast_GameObject(); VERIFY(tmp_obj); if (!tmp_obj) continue; @@ -823,7 +823,7 @@ BOOL CWeaponKnife::RayQueryCallback(collide::rq_result& result, LPVOID this_ptr) return TRUE; } -CObject* CWeaponKnife::TryPick(Fvector const & start_pos, Fvector const & dir, float const dist) +IGameObject* CWeaponKnife::TryPick(Fvector const & start_pos, Fvector const & dir, float const dist) { collide::ray_defs tmp_rdefs(start_pos, dir, dist, CDB::OPT_FULL_TEST, collide::rqtObject); m_ray_query_results.r_clear(); @@ -862,7 +862,7 @@ CWeaponKnife::victim_filter::victim_filter(victim_filter const & copy) : bool CWeaponKnife::victim_filter::operator()(spartial_base_t::value_type const & left) const { - CObject* const tmp_obj = left->dcast_CObject(); + IGameObject* const tmp_obj = left->dcast_GameObject(); VERIFY (tmp_obj); if (!tmp_obj) return true; @@ -912,7 +912,7 @@ CWeaponKnife::best_victim_selector::best_victim_selector( void CWeaponKnife::best_victim_selector::operator()( spartial_base_t::value_type const & left) { - CObject* const tmp_obj = left->dcast_CObject(); + IGameObject* const tmp_obj = left->dcast_GameObject(); VERIFY (tmp_obj); if (!tmp_obj) return; diff --git a/src/xrGame/WeaponKnife.h b/src/xrGame/WeaponKnife.h index 9f6657c18c8..1bf6b0fc038 100644 --- a/src/xrGame/WeaponKnife.h +++ b/src/xrGame/WeaponKnife.h @@ -109,14 +109,14 @@ class CWeaponKnife: public CWeapon { void GetVictimPos (CEntityAlive* victim, Fvector & pos_dest); u32 SelectHitsToShot (shot_targets_t & dst_dirs, Fvector const & f_pos); bool SelectBestHitVictim (Fvector const & f_pos, Fmatrix & parent_xform_dest, Fvector & fendpos_dest, Fsphere & query_sphere); - CObject* TryPick (Fvector const & start_pos, + IGameObject* TryPick (Fvector const & start_pos, Fvector const & dir, float const dist); static BOOL RayQueryCallback (collide::rq_result& result, LPVOID this_ptr); collide::rq_results m_ray_query_results; u16 m_except_id; - CObject* m_last_picked_obj; + IGameObject* m_last_picked_obj; typedef xr_vector spartial_base_t; typedef buffer_vector victims_list_t; diff --git a/src/xrGame/WeaponStatMgun.cpp b/src/xrGame/WeaponStatMgun.cpp index e5806ce97da..afb0395c8af 100644 --- a/src/xrGame/WeaponStatMgun.cpp +++ b/src/xrGame/WeaponStatMgun.cpp @@ -162,7 +162,7 @@ void CWeaponStatMgun::UpdateCL() } -//void CWeaponStatMgun::Hit( float P, Fvector &dir, CObject* who, +//void CWeaponStatMgun::Hit( float P, Fvector &dir, IGameObject* who, // s16 element,Fvector p_in_object_space, // float impulse, ALife::EHitType hit_type) void CWeaponStatMgun::Hit(SHit* pHDS) diff --git a/src/xrGame/WeaponStatMgunFire.cpp b/src/xrGame/WeaponStatMgunFire.cpp index 49ad490ba7d..e39d3c5ad13 100644 --- a/src/xrGame/WeaponStatMgunFire.cpp +++ b/src/xrGame/WeaponStatMgunFire.cpp @@ -73,7 +73,7 @@ void CWeaponStatMgun::OnShot() StartSmokeParticles (m_fire_pos, zero_vel); OnShellDrop (m_fire_pos, zero_vel); - bool b_hud_mode = (Level().CurrentEntity() == smart_cast(Owner())); + bool b_hud_mode = (Level().CurrentEntity() == smart_cast(Owner())); m_sounds.PlaySound ("sndShot", m_fire_pos, Owner(), b_hud_mode); AddShotEffector (); diff --git a/src/xrGame/actor_memory.cpp b/src/xrGame/actor_memory.cpp index 0b4ed9aae92..a2358b0885f 100644 --- a/src/xrGame/actor_memory.cpp +++ b/src/xrGame/actor_memory.cpp @@ -22,7 +22,7 @@ CActorMemory::CActorMemory (CActor *actor) : VERIFY (m_actor); } -bool CActorMemory::feel_vision_isRelevant (CObject* O) +bool CActorMemory::feel_vision_isRelevant (IGameObject* O) { CEntityAlive *entity_alive = smart_cast(O); if (!entity_alive) diff --git a/src/xrGame/actor_memory.h b/src/xrGame/actor_memory.h index 18cb9a96715..3a46dfba371 100644 --- a/src/xrGame/actor_memory.h +++ b/src/xrGame/actor_memory.h @@ -21,7 +21,7 @@ class CActorMemory : public vision_client { public: CActorMemory (CActor *actor); - virtual bool feel_vision_isRelevant (CObject *object); + virtual bool feel_vision_isRelevant (IGameObject *object); virtual void camera ( Fvector &position, Fvector &direction, diff --git a/src/xrGame/actor_mp_client.cpp b/src/xrGame/actor_mp_client.cpp index acef0542f69..3500a1aeb4d 100644 --- a/src/xrGame/actor_mp_client.cpp +++ b/src/xrGame/actor_mp_client.cpp @@ -28,7 +28,7 @@ void CActorMP::OnEvent ( NET_Packet &P, u16 type) inherited::OnEvent(P,type); } -void CActorMP::Die (CObject *killer) +void CActorMP::Die (IGameObject *killer) { //m_i_am_dead = true; //conditions().health() = 0.f; @@ -55,7 +55,7 @@ void CActorMP::use_booster(NET_Packet &packet) u16 tmp_booster_id; packet.r_u16 (tmp_booster_id); - CObject* tmp_booster = Level().Objects.net_Find(tmp_booster_id); + IGameObject* tmp_booster = Level().Objects.net_Find(tmp_booster_id); VERIFY2(tmp_booster, "using unknown or deleted booster"); if (!tmp_booster) { diff --git a/src/xrGame/actor_mp_client.h b/src/xrGame/actor_mp_client.h index 12523bf15f8..58402e76951 100644 --- a/src/xrGame/actor_mp_client.h +++ b/src/xrGame/actor_mp_client.h @@ -28,7 +28,7 @@ class CActorMP : virtual void net_Import (NET_Packet &packet); virtual BOOL net_Relevant (); virtual void OnEvent (NET_Packet &packet, u16 type); - virtual void Die (CObject *killer); + virtual void Die (IGameObject *killer); virtual void DumpActiveParams (shared_str const & section_name, CInifile & dst_ini) const; shared_str const GetAnticheatSectionName () const { return "mp_actor"; }; virtual void On_SetEntity (); diff --git a/src/xrGame/agent_corpse_manager.cpp b/src/xrGame/agent_corpse_manager.cpp index 38924987c6c..9c7c2f5f137 100644 --- a/src/xrGame/agent_corpse_manager.cpp +++ b/src/xrGame/agent_corpse_manager.cpp @@ -23,8 +23,8 @@ struct CRemoveMemberCorpsesPredicate { }; struct CRemoveOfflineCorpsesPredicate { - CObject *m_object; - IC CRemoveOfflineCorpsesPredicate (CObject *object) + IGameObject *m_object; + IC CRemoveOfflineCorpsesPredicate (IGameObject *object) { VERIFY (object); m_object = object; @@ -103,7 +103,7 @@ void CAgentCorpseManager::react_on_member_death () } } -void CAgentCorpseManager::remove_links (CObject *object) +void CAgentCorpseManager::remove_links (IGameObject *object) { m_corpses.erase ( std::remove_if( diff --git a/src/xrGame/agent_corpse_manager.h b/src/xrGame/agent_corpse_manager.h index 893151e5d7e..f3e08d45835 100644 --- a/src/xrGame/agent_corpse_manager.h +++ b/src/xrGame/agent_corpse_manager.h @@ -32,7 +32,7 @@ class CAgentCorpseManager { IC void clear (); void react_on_member_death (); void update (); - void remove_links (CObject *object); + void remove_links (IGameObject *object); }; #include "agent_corpse_manager_inline.h" \ No newline at end of file diff --git a/src/xrGame/agent_enemy_manager.cpp b/src/xrGame/agent_enemy_manager.cpp index 4e2ad305772..e5c5c22d341 100644 --- a/src/xrGame/agent_enemy_manager.cpp +++ b/src/xrGame/agent_enemy_manager.cpp @@ -603,9 +603,9 @@ void CAgentEnemyManager::distribute_enemies () } struct wounded_predicate { - CObject *m_object; + IGameObject *m_object; - IC wounded_predicate (CObject *object) + IC wounded_predicate (IGameObject *object) { VERIFY (object); m_object = object; @@ -623,7 +623,7 @@ struct wounded_predicate { } }; -void CAgentEnemyManager::remove_links (CObject *object) +void CAgentEnemyManager::remove_links (IGameObject *object) { m_wounded.erase ( std::remove_if( diff --git a/src/xrGame/agent_enemy_manager.h b/src/xrGame/agent_enemy_manager.h index ed5dfcd15f9..413bf3f6f8b 100644 --- a/src/xrGame/agent_enemy_manager.h +++ b/src/xrGame/agent_enemy_manager.h @@ -49,7 +49,7 @@ class CAgentEnemyManager { void update (); void distribute_enemies (); IC ENEMIES &enemies (); - void remove_links (CObject *object); + void remove_links (IGameObject *object); private: void wounded_processor (const CEntityAlive *object, const ALife::_OBJECT_ID &wounded_processor_id); diff --git a/src/xrGame/agent_explosive_manager.cpp b/src/xrGame/agent_explosive_manager.cpp index 9e1de375454..25a095853f7 100644 --- a/src/xrGame/agent_explosive_manager.cpp +++ b/src/xrGame/agent_explosive_manager.cpp @@ -29,7 +29,7 @@ struct CRemoveExplosivesPredicate { } }; -void CAgentExplosiveManager::remove_links (CObject *object) +void CAgentExplosiveManager::remove_links (IGameObject *object) { TO_BE_DESTROYED::iterator I = std::find(m_explosives_to_remove.begin(),m_explosives_to_remove.end(),object->ID()); if (I != m_explosives_to_remove.end()) diff --git a/src/xrGame/agent_explosive_manager.h b/src/xrGame/agent_explosive_manager.h index 0d80f421306..a20734faab2 100644 --- a/src/xrGame/agent_explosive_manager.h +++ b/src/xrGame/agent_explosive_manager.h @@ -10,7 +10,7 @@ #include "danger_explosive.h" -class CObject; +class IGameObject; class CAgentManager; class CMemberOrder; @@ -31,7 +31,7 @@ class CAgentExplosiveManager { public: IC CAgentExplosiveManager (CAgentManager *object); - void remove_links (CObject *object); + void remove_links (IGameObject *object); void register_explosive (const CExplosive *explosive, const CGameObject *game_object); void react_on_explosives (); void update (); diff --git a/src/xrGame/agent_location_manager.cpp b/src/xrGame/agent_location_manager.cpp index 06a38fa2a8c..192fd2fc791 100644 --- a/src/xrGame/agent_location_manager.cpp +++ b/src/xrGame/agent_location_manager.cpp @@ -199,7 +199,7 @@ void CAgentLocationManager::update () remove_old_danger_covers (); } -void CAgentLocationManager::remove_links(CObject *object) +void CAgentLocationManager::remove_links(IGameObject *object) { m_danger_locations.erase ( std::remove_if( diff --git a/src/xrGame/agent_location_manager.h b/src/xrGame/agent_location_manager.h index 7b65cc56a36..b0c5ad29000 100644 --- a/src/xrGame/agent_location_manager.h +++ b/src/xrGame/agent_location_manager.h @@ -14,7 +14,7 @@ class CAI_Stalker; class CCoverPoint; class CAgentManager; class CDangerLocation; -class CObject; +class IGameObject; class CAgentLocationManager { public: @@ -33,14 +33,14 @@ class CAgentLocationManager { public: IC CAgentLocationManager (CAgentManager *object); IC CDangerLocationPtr location (const Fvector &position); - IC CDangerLocationPtr location (const CObject *object); + IC CDangerLocationPtr location (const IGameObject *object); IC void clear (); void update (); void add (CDangerLocationPtr location); float danger (const CCoverPoint *cover, CAI_Stalker *member) const; bool suitable (CAI_Stalker *object, const CCoverPoint *location, bool use_enemy_info) const; void make_suitable (CAI_Stalker *object, const CCoverPoint *location) const; - void remove_links (CObject *object); + void remove_links (IGameObject *object); IC const LOCATIONS &locations () const; }; diff --git a/src/xrGame/agent_location_manager_inline.h b/src/xrGame/agent_location_manager_inline.h index 372f6dbe686..4aeb8114187 100644 --- a/src/xrGame/agent_location_manager_inline.h +++ b/src/xrGame/agent_location_manager_inline.h @@ -9,9 +9,9 @@ #pragma once struct CRemoveDangerObject { - const CObject *m_object; + const IGameObject *m_object; - IC CRemoveDangerObject (const CObject *object) + IC CRemoveDangerObject (const IGameObject *object) { m_object = object; } @@ -39,7 +39,7 @@ IC void CAgentLocationManager::clear () m_danger_locations.clear (); } -IC CAgentLocationManager::CDangerLocationPtr CAgentLocationManager::location (const CObject *object) +IC CAgentLocationManager::CDangerLocationPtr CAgentLocationManager::location (const IGameObject *object) { LOCATIONS::iterator I = std::find_if(m_danger_locations.begin(),m_danger_locations.end(),CRemoveDangerObject(object)); if (I != m_danger_locations.end()) diff --git a/src/xrGame/agent_manager.cpp b/src/xrGame/agent_manager.cpp index b5294f397b5..13586bacfd5 100644 --- a/src/xrGame/agent_manager.cpp +++ b/src/xrGame/agent_manager.cpp @@ -74,7 +74,7 @@ void CAgentManager::remove_components () xr_delete (m_brain); } -void CAgentManager::remove_links (CObject *object) +void CAgentManager::remove_links (IGameObject *object) { corpse().remove_links (object); enemy().remove_links (object); diff --git a/src/xrGame/agent_manager.h b/src/xrGame/agent_manager.h index 6e6c4282a0d..5530273812e 100644 --- a/src/xrGame/agent_manager.h +++ b/src/xrGame/agent_manager.h @@ -63,7 +63,7 @@ class CAgentManagerPlanner; void update (); #endif // USE_SCHEDULER_IN_AGENT_MANAGER shared_str cName () const; - void remove_links (CObject *object); + void remove_links (IGameObject *object); public: IC CAgentCorpseManager &corpse () const; diff --git a/src/xrGame/agent_manager_planner.cpp b/src/xrGame/agent_manager_planner.cpp index 5f9feaf3bbd..ad5e8e071c8 100644 --- a/src/xrGame/agent_manager_planner.cpp +++ b/src/xrGame/agent_manager_planner.cpp @@ -68,6 +68,6 @@ void CAgentManagerPlanner::add_actions () add_operator (eOperatorReactOnDanger, action); } -void CAgentManagerPlanner::remove_links (CObject *object) +void CAgentManagerPlanner::remove_links (IGameObject *object) { } diff --git a/src/xrGame/agent_manager_planner.h b/src/xrGame/agent_manager_planner.h index e5545fa6841..c6b52e6d02c 100644 --- a/src/xrGame/agent_manager_planner.h +++ b/src/xrGame/agent_manager_planner.h @@ -11,7 +11,7 @@ #include "action_planner.h" class CAgentManager; -class CObject; +class IGameObject; class CAgentManagerPlanner : public CActionPlanner { private: @@ -21,5 +21,5 @@ class CAgentManagerPlanner : public CActionPlanner { virtual void setup (CAgentManager *object); void add_evaluators (); void add_actions (); - void remove_links (CObject *object); + void remove_links (IGameObject *object); }; diff --git a/src/xrGame/agent_member_manager.cpp b/src/xrGame/agent_member_manager.cpp index ce7d48dc43d..c1068a9b5a2 100644 --- a/src/xrGame/agent_member_manager.cpp +++ b/src/xrGame/agent_member_manager.cpp @@ -82,7 +82,7 @@ void CAgentMemberManager::update () { } -void CAgentMemberManager::remove_links (CObject *object) +void CAgentMemberManager::remove_links (IGameObject *object) { MEMBER_STORAGE::iterator I = m_members.begin(); MEMBER_STORAGE::iterator E = m_members.end(); diff --git a/src/xrGame/agent_member_manager.h b/src/xrGame/agent_member_manager.h index b8eb7e58ec7..f957f3b4a54 100644 --- a/src/xrGame/agent_member_manager.h +++ b/src/xrGame/agent_member_manager.h @@ -47,7 +47,7 @@ class CAgentMemberManager { squad_mask_type mask (const ALife::_OBJECT_ID &id) const; IC bool group_behaviour () const; IC iterator member (squad_mask_type mask); - void remove_links (CObject *object); + void remove_links (IGameObject *object); void register_in_combat (const CAI_Stalker *object); void unregister_in_combat (const CAI_Stalker *object); bool registered_in_combat (const CAI_Stalker *object) const; diff --git a/src/xrGame/agent_memory_manager.cpp b/src/xrGame/agent_memory_manager.cpp index c8f168decb5..4e133686c82 100644 --- a/src/xrGame/agent_memory_manager.cpp +++ b/src/xrGame/agent_memory_manager.cpp @@ -20,7 +20,7 @@ void CAgentMemoryManager::update () reset_memory_masks (); } -void CAgentMemoryManager::remove_links (CObject *object) +void CAgentMemoryManager::remove_links (IGameObject *object) { } @@ -68,7 +68,7 @@ void CAgentMemoryManager::update_memory_masks (const squad_mask_type &mask) } } -void CAgentMemoryManager::object_information (const CObject *object, u32 &level_time, Fvector &position) +void CAgentMemoryManager::object_information (const IGameObject *object, u32 &level_time, Fvector &position) { { VISIBLES::const_iterator I = std::find(visibles().begin(),visibles().end(),object_id(object)); diff --git a/src/xrGame/agent_memory_manager.h b/src/xrGame/agent_memory_manager.h index 18627227bcd..a4215f00196 100644 --- a/src/xrGame/agent_memory_manager.h +++ b/src/xrGame/agent_memory_manager.h @@ -37,7 +37,7 @@ class CAgentMemoryManager { public: IC CAgentMemoryManager (CAgentManager *object); void update (); - void remove_links (CObject *object); + void remove_links (IGameObject *object); public: IC void set_squad_objects (VISIBLES *objects); @@ -58,7 +58,7 @@ class CAgentMemoryManager { IC void update_memory_masks (const squad_mask_type &mask, T &objects); IC void update_memory_mask (const squad_mask_type &mask, squad_mask_type ¤t); void update_memory_masks (const squad_mask_type &mask); - void object_information (const CObject *object, u32 &level_time, Fvector &position); + void object_information (const IGameObject *object, u32 &level_time, Fvector &position); }; #include "agent_memory_manager_inline.h" \ No newline at end of file diff --git a/src/xrGame/ai/crow/ai_crow.cpp b/src/xrGame/ai/crow/ai_crow.cpp index c64a3fc7f28..949b5b2b443 100644 --- a/src/xrGame/ai/crow/ai_crow.cpp +++ b/src/xrGame/ai/crow/ai_crow.cpp @@ -257,7 +257,7 @@ void CAI_Crow::state_DeathFall() VERIFY2( valid_pos( Position() ), dbg_valide_pos_string(Position(),this,"CAI_Crow::state_DeathFall()") ); } -void CAI_Crow::Die (CObject* who) +void CAI_Crow::Die (IGameObject* who) { inherited::Die (who) ; processing_activate () ; // enable UpdateCL for dead crows - especially for physics support @@ -401,7 +401,7 @@ void CAI_Crow::net_Import (NET_Packet& P) VERIFY2 ( valid_pos( Position() ), dbg_valide_pos_string(Position(),this," CAI_Crow::net_Import (NET_Packet& P)") ); } //--------------------------------------------------------------------- -void CAI_Crow::HitSignal (float /**HitAmount/**/, Fvector& /**local_dir/**/, CObject* who, s16 /**element/**/) +void CAI_Crow::HitSignal (float /**HitAmount/**/, Fvector& /**local_dir/**/, IGameObject* who, s16 /**element/**/) { //bool first_time = !!g_Alive(); // bool first_time = !PPhysicsShell(); @@ -425,7 +425,7 @@ void CAI_Crow::CreateSkeleton() m_pPhysicsShell->SetMaterial(smart_cast(Visual())->LL_GetData(smart_cast(Visual())->LL_GetBoneRoot()).game_mtl_idx); } -//void CAI_Crow::Hit (float P, Fvector &dir, CObject* who, s16 element,Fvector p_in_object_space, float impulse, ALife::EHitType hit_type) +//void CAI_Crow::Hit (float P, Fvector &dir, IGameObject* who, s16 element,Fvector p_in_object_space, float impulse, ALife::EHitType hit_type) void CAI_Crow::Hit (SHit* pHDS) { // inherited::Hit (P,dir,who,element,p_in_object_space,impulse/100.f, hit_type); diff --git a/src/xrGame/ai/crow/ai_crow.h b/src/xrGame/ai/crow/ai_crow.h index 1a6adbf1f0e..ed78c3a4ffe 100644 --- a/src/xrGame/ai/crow/ai_crow.h +++ b/src/xrGame/ai/crow/ai_crow.h @@ -124,10 +124,10 @@ class CAI_Crow : public CEntity virtual void g_fireParams (const CHudItem* /**pHudItem/**/, Fvector& /**P/**/, Fvector& /**D/**/) {}; virtual void g_WeaponBones (int &/**L/**/, int &/**R1/**/, int &/**R2/**/) {}; - virtual void HitSignal (float HitAmount, Fvector& local_dir, CObject* who, s16 element); + virtual void HitSignal (float HitAmount, Fvector& local_dir, IGameObject* who, s16 element); virtual void HitImpulse (float amount, Fvector& vWorldDir, Fvector& vLocalDir); virtual void Hit (SHit* pHDS); - virtual void Die (CObject* who); + virtual void Die (IGameObject* who); virtual float ffGetFov () const {return 150.f; } virtual float ffGetRange () const {return 30.f; } diff --git a/src/xrGame/ai/monsters/ai_monster_defs.h b/src/xrGame/ai/monsters/ai_monster_defs.h index d22a383a4ea..02dc438d4a4 100644 --- a/src/xrGame/ai/monsters/ai_monster_defs.h +++ b/src/xrGame/ai/monsters/ai_monster_defs.h @@ -490,12 +490,12 @@ DEFINE_MAP(const CEntityAlive *,SMonsterCorpse,CORPSE_MAP, CORPSE_MAP_IT); struct SMonsterHit { - CObject *object; + IGameObject *object; TTime time; EHitSide side; Fvector position; - bool operator==(const CObject *obj) { + bool operator==(const IGameObject *obj) { return (object == obj); } }; diff --git a/src/xrGame/ai/monsters/ai_monster_squad.cpp b/src/xrGame/ai/monsters/ai_monster_squad.cpp index 505be63fc3d..ca0e4a96edb 100644 --- a/src/xrGame/ai/monsters/ai_monster_squad.cpp +++ b/src/xrGame/ai/monsters/ai_monster_squad.cpp @@ -159,7 +159,7 @@ void CMonsterSquad::UpdateSquadCommands() ProcessIdle (); } -void CMonsterSquad::remove_links(CObject *O) +void CMonsterSquad::remove_links(IGameObject *O) { // Удалить все цели, объекты которых невалидны или ушли в оффлайн for (MEMBER_GOAL_MAP_IT it_goal = m_goals.begin(); it_goal != m_goals.end(); ++it_goal) { diff --git a/src/xrGame/ai/monsters/ai_monster_squad.h b/src/xrGame/ai/monsters/ai_monster_squad.h index 03aab606366..42a5065ff69 100644 --- a/src/xrGame/ai/monsters/ai_monster_squad.h +++ b/src/xrGame/ai/monsters/ai_monster_squad.h @@ -118,7 +118,7 @@ class CMonsterSquad void UpdateSquadCommands (); - void remove_links (CObject *O); + void remove_links (IGameObject *O); // return count of monsters in radius for object u8 get_count (const CEntity *object, float radius); diff --git a/src/xrGame/ai/monsters/ai_monster_squad_manager.cpp b/src/xrGame/ai/monsters/ai_monster_squad_manager.cpp index 37668199f2d..23f6adc4947 100644 --- a/src/xrGame/ai/monsters/ai_monster_squad_manager.cpp +++ b/src/xrGame/ai/monsters/ai_monster_squad_manager.cpp @@ -98,7 +98,7 @@ void CMonsterSquadManager::update(CEntity *entity) } } -void CMonsterSquadManager::remove_links(CObject *O) +void CMonsterSquadManager::remove_links(IGameObject *O) { for (u32 team_id=0; team_id(object->Visual())->LL_BoneID (bone_name); CBoneInstance &bone = smart_cast(object->Visual())->LL_GetBoneInstance (bone_id); @@ -41,7 +41,7 @@ Fvector get_bone_position (CObject *object, LPCSTR bone_name) return (global_transform.c); } -Fvector get_head_position(CObject *object) +Fvector get_head_position(IGameObject *object) { pcstr bone_name = "bip01_head"; if ( CBaseMonster* monster = smart_cast(object) ) diff --git a/src/xrGame/ai/monsters/ai_monster_utils.h b/src/xrGame/ai/monsters/ai_monster_utils.h index 58b9dcd2b49..0b13a7c06d6 100644 --- a/src/xrGame/ai/monsters/ai_monster_utils.h +++ b/src/xrGame/ai/monsters/ai_monster_utils.h @@ -66,9 +66,9 @@ IC u32 time() ////////////////////////////////////////////////////////////////////////// // bone routines ////////////////////////////////////////////////////////////////////////// -extern Fvector get_bone_position (CObject *object, LPCSTR bone_name); +extern Fvector get_bone_position (IGameObject *object, LPCSTR bone_name); -Fvector get_head_position(CObject *object); +Fvector get_head_position(IGameObject *object); ////////////////////////////////////////////////////////////////////////// diff --git a/src/xrGame/ai/monsters/anomaly_detector.cpp b/src/xrGame/ai/monsters/anomaly_detector.cpp index 3e20e4fc6dd..1379426b907 100644 --- a/src/xrGame/ai/monsters/anomaly_detector.cpp +++ b/src/xrGame/ai/monsters/anomaly_detector.cpp @@ -73,7 +73,7 @@ void CAnomalyDetector::update_schedule() ); } -void CAnomalyDetector::on_contact(CObject *obj) +void CAnomalyDetector::on_contact(IGameObject *obj) { if (!m_active) return; diff --git a/src/xrGame/ai/monsters/anomaly_detector.h b/src/xrGame/ai/monsters/anomaly_detector.h index 9f19d772244..f7e93eb7b0f 100644 --- a/src/xrGame/ai/monsters/anomaly_detector.h +++ b/src/xrGame/ai/monsters/anomaly_detector.h @@ -11,10 +11,10 @@ class CAnomalyDetector { bool m_active; struct SAnomalyInfo { - CObject *object; + IGameObject *object; u32 time_registered; - bool operator == (CObject *obj) { + bool operator == (IGameObject *obj) { return (object == obj); } }; @@ -39,7 +39,7 @@ class CAnomalyDetector { void reinit (); void update_schedule (); - void on_contact (CObject *obj); + void on_contact (IGameObject *obj); void activate (){m_active = true;} void deactivate (){m_active = false;} diff --git a/src/xrGame/ai/monsters/basemonster/base_monster.cpp b/src/xrGame/ai/monsters/basemonster/base_monster.cpp index d1c67b50157..2b862c0063e 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster.cpp +++ b/src/xrGame/ai/monsters/basemonster/base_monster.cpp @@ -394,7 +394,7 @@ void CBaseMonster::shedule_Update(u32 dt) ////////////////////////////////////////////////////////////////////// -void CBaseMonster::Die(CObject* who) +void CBaseMonster::Die(IGameObject* who) { if (StateMan) StateMan->critical_finalize(); @@ -599,12 +599,12 @@ void CBaseMonster::set_state_sound(u32 type, bool once) m_prev_sound_type = type; } -bool CBaseMonster::feel_touch_on_contact (CObject *O) +bool CBaseMonster::feel_touch_on_contact (IGameObject *O) { return (inherited::feel_touch_on_contact(O)); } -bool CBaseMonster::feel_touch_contact(CObject *O) +bool CBaseMonster::feel_touch_contact(IGameObject *O) { m_anomaly_detector->on_contact(O); return inherited::feel_touch_contact(O); @@ -754,7 +754,7 @@ IFactoryObject *CBaseMonster::_construct () return (this); } -void CBaseMonster::net_Relcase(CObject *O) +void CBaseMonster::net_Relcase(IGameObject *O) { inherited::net_Relcase(O); @@ -884,7 +884,7 @@ void CBaseMonster::OnEvent(NET_Packet& P, u16 type) { case GE_KILL_SOMEONE: P.r_u16 (id); - CObject* O = Level().Objects.net_Find (id); + IGameObject* O = Level().Objects.net_Find (id); if (O) { CEntity *pEntity = smart_cast(O); diff --git a/src/xrGame/ai/monsters/basemonster/base_monster.h b/src/xrGame/ai/monsters/basemonster/base_monster.h index 74adf638158..545a714cf4a 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster.h +++ b/src/xrGame/ai/monsters/basemonster/base_monster.h @@ -74,8 +74,8 @@ class CBaseMonster : public CCustomMonster, public CStepManager public: virtual BOOL renderable_ShadowReceive () { return TRUE; } - virtual void Die (CObject* who); - virtual void HitSignal (float amount, Fvector& vLocalDir, CObject* who, s16 element); + virtual void Die (IGameObject* who); + virtual void HitSignal (float amount, Fvector& vLocalDir, IGameObject* who, s16 element); virtual void Hit (SHit* pHDS); virtual void PHHit ( SHit &H ); virtual void SelectAnimation (const Fvector& _view, const Fvector& _move, float speed ); @@ -93,7 +93,7 @@ class CBaseMonster : public CCustomMonster, public CStepManager virtual BOOL net_SaveRelevant (); virtual void net_Export (NET_Packet& P); virtual void net_Import (NET_Packet& P); - virtual void net_Relcase (CObject *O); + virtual void net_Relcase (IGameObject *O); //save/load server serialization virtual void save (NET_Packet &output_packet) {inherited::save(output_packet);} @@ -110,10 +110,10 @@ class CBaseMonster : public CCustomMonster, public CStepManager virtual void init () {} - virtual void feel_sound_new (CObject* who, int eType, CSound_UserDataPtr user_data, const Fvector &Position, float power); - virtual bool feel_vision_isRelevant (CObject* O); - virtual bool feel_touch_on_contact (CObject* O); - virtual bool feel_touch_contact (CObject *); + virtual void feel_sound_new (IGameObject* who, int eType, CSound_UserDataPtr user_data, const Fvector &Position, float power); + virtual bool feel_vision_isRelevant (IGameObject* O); + virtual bool feel_touch_on_contact (IGameObject* O); + virtual bool feel_touch_contact (IGameObject *); virtual bool useful (const CItemManager *manager, const CGameObject *object) const; virtual float evaluate (const CItemManager *manager, const CGameObject *object) const; @@ -351,8 +351,8 @@ class CBaseMonster : public CCustomMonster, public CStepManager // Special Services (refactoring needed) void on_kill_enemy (const CEntity *obj); - void Hit_Psy (CObject *object, float value); - void Hit_Wound (CObject *object, float value, const Fvector &dir, float impulse); + void Hit_Psy (IGameObject *object, float value); + void Hit_Wound (IGameObject *object, float value, const Fvector &dir, float impulse); CParticlesObject *PlayParticles (const shared_str& name, const Fvector &position, const Fvector &dir, BOOL auto_remove = TRUE, BOOL xformed = TRUE); void load_effector (LPCSTR section, LPCSTR line, SAttackEffector &effector); @@ -503,7 +503,7 @@ IC void wake_up (){m_bSleep = false;} float get_feel_enemy_who_just_hit_max_distance () { return m_feel_enemy_who_just_hit_max_distance; } float get_feel_enemy_who_made_sound_max_distance () { return m_feel_enemy_who_made_sound_max_distance; } float get_feel_enemy_max_distance () { return m_feel_enemy_max_distance; } - virtual bool can_use_agressive_jump (const CObject*) { return false; } + virtual bool can_use_agressive_jump (const IGameObject*) { return false; } private: steering_behaviour::manager* m_steer_manager; diff --git a/src/xrGame/ai/monsters/basemonster/base_monster_feel.cpp b/src/xrGame/ai/monsters/basemonster/base_monster_feel.cpp index b3569993e52..bd6f7b418b3 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster_feel.cpp +++ b/src/xrGame/ai/monsters/basemonster/base_monster_feel.cpp @@ -26,7 +26,7 @@ #include "ActorEffector.h" #include "xrEngine/CameraBase.h" -void CBaseMonster::feel_sound_new(CObject* who, int eType, CSound_UserDataPtr user_data, const Fvector &Position, float power) +void CBaseMonster::feel_sound_new(IGameObject* who, int eType, CSound_UserDataPtr user_data, const Fvector &Position, float power) { if (!g_Alive()) return; @@ -195,12 +195,12 @@ void CBaseMonster::HitEntity(const CEntity *pEntity, float fDamage, float impuls } -bool CBaseMonster::feel_vision_isRelevant(CObject* O) +bool CBaseMonster::feel_vision_isRelevant(IGameObject* O) { if (!g_Alive()) return false; if (0==smart_cast(O)) return false; - if ((O->spatial.type & STYPE_VISIBLEFORAI) != STYPE_VISIBLEFORAI) return false; + if ((O->GetSpatialData().type & STYPE_VISIBLEFORAI) != STYPE_VISIBLEFORAI) return false; // если спит, то ничего не видит if (m_bSleep) return false; @@ -219,7 +219,7 @@ bool CBaseMonster::feel_vision_isRelevant(CObject* O) return true; } -void CBaseMonster::HitSignal(float amount, Fvector& vLocalDir, CObject* who, s16 element) +void CBaseMonster::HitSignal(float amount, Fvector& vLocalDir, IGameObject* who, s16 element) { if (!g_Alive()) return; @@ -267,7 +267,7 @@ void CBaseMonster::SetAttackEffector() } } -void CBaseMonster::Hit_Psy(CObject *object, float value) +void CBaseMonster::Hit_Psy(IGameObject *object, float value) { NET_Packet P; SHit HS; @@ -284,7 +284,7 @@ void CBaseMonster::Hit_Psy(CObject *object, float value) u_EventSend (P); } -void CBaseMonster::Hit_Wound(CObject *object, float value, const Fvector &dir, float impulse) +void CBaseMonster::Hit_Wound(IGameObject *object, float value, const Fvector &dir, float impulse) { NET_Packet P; SHit HS; diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker.cpp b/src/xrGame/ai/monsters/bloodsucker/bloodsucker.cpp index fb391597f22..d5c90d4134d 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker.cpp +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker.cpp @@ -568,7 +568,7 @@ void CAI_Bloodsucker::shedule_Update(u32 dt) if (m_alien_control.active()) sound().play(eAlien); } -void CAI_Bloodsucker::Die(CObject* who) +void CAI_Bloodsucker::Die(IGameObject* who) { inherited::Die(who); stop_invisible_predator(); diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker.h index a7427b63791..089189ef38c 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker.h @@ -21,7 +21,7 @@ class CAI_Bloodsucker : public CBaseMonster, virtual void UpdateCL (); virtual void shedule_Update (u32 dt); - virtual void Die (CObject* who); + virtual void Die (IGameObject* who); virtual BOOL net_Spawn (CSE_Abstract* DC); virtual void Load (LPCSTR section); virtual void Hit (SHit* pHDS); diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state.h index e6795d75fb6..0b284e6fc06 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state.h @@ -50,7 +50,7 @@ class CStateMonsterBackstubEnemy : public CState<_Object> { virtual void execute (); virtual bool check_start_conditions (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "bloodsucker_attack_state_inline.h" diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator.h index 43f2b359c7a..e5c43f7c335 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator.h @@ -20,7 +20,7 @@ class CStateBloodsuckerPredator : public CState<_Object> { virtual void critical_finalize (); virtual bool check_start_conditions (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual void setup_substates (); virtual void check_force_state (); diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_capture_jump.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_capture_jump.h index 398467b0dba..60bb2c1f1c9 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_capture_jump.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_capture_jump.h @@ -15,7 +15,7 @@ class CStateCaptureJumpBloodsucker : public CState<_Object> { virtual void execute (); virtual void setup_substates (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "bloodsucker_state_capture_jump_inline.h" \ No newline at end of file diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_manager.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_manager.h index 41df723f1a0..c26aac51628 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_manager.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_manager.h @@ -11,6 +11,6 @@ class CStateManagerBloodsucker : public CMonsterStateManager { virtual void execute (); virtual void update (); void drag_object (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} bool check_vampire (); }; diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire.h index 57629fe6237..796057a6baa 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire.h @@ -20,7 +20,7 @@ class CStateBloodsuckerVampire : public CState<_Object> { virtual void critical_finalize (); virtual bool check_start_conditions (); virtual bool check_completion (); - virtual void remove_links (CObject* object); + virtual void remove_links (IGameObject* object); virtual void setup_substates (); virtual void check_force_state (); diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_approach.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_approach.h index 201a6e37678..a05501f74e3 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_approach.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_approach.h @@ -11,7 +11,7 @@ class CStateBloodsuckerVampireApproach : public CState<_Object> { virtual void initialize (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "bloodsucker_vampire_approach_inline.h" diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_execute.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_execute.h index b16b03e5099..54192d126a2 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_execute.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_execute.h @@ -26,7 +26,7 @@ class CStateBloodsuckerVampireExecute : public CState<_Object> { virtual void critical_finalize (); virtual bool check_start_conditions (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} private: void execute_vampire_prepare (); diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_hide.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_hide.h index 3c06c83ead9..79d4d40d609 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_hide.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_hide.h @@ -12,7 +12,7 @@ class CStateBloodsuckerVampireHide : public CState<_Object> { virtual void reselect_state (); virtual void setup_substates (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "bloodsucker_vampire_hide_inline.h" diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_inline.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_inline.h index 24c0441e58f..64b93fdd871 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_inline.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_inline.h @@ -160,7 +160,7 @@ void CStateBloodsuckerVampireAbstract::setup_substates() } TEMPLATE_SPECIALIZATION -void CStateBloodsuckerVampireAbstract::remove_links (CObject* object) +void CStateBloodsuckerVampireAbstract::remove_links (IGameObject* object) { if (enemy == object) enemy = 0; diff --git a/src/xrGame/ai/monsters/boar/boar_state_manager.h b/src/xrGame/ai/monsters/boar/boar_state_manager.h index 1c8d68b1a36..b015ca02b41 100644 --- a/src/xrGame/ai/monsters/boar/boar_state_manager.h +++ b/src/xrGame/ai/monsters/boar/boar_state_manager.h @@ -11,5 +11,5 @@ class CStateManagerBoar : public CMonsterStateManager { CStateManagerBoar (CAI_Boar *monster); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/monsters/burer/burer.cpp b/src/xrGame/ai/monsters/burer/burer.cpp index c91b698305b..45456dd2339 100644 --- a/src/xrGame/ai/monsters/burer/burer.cpp +++ b/src/xrGame/ai/monsters/burer/burer.cpp @@ -303,12 +303,12 @@ void CBurer::UpdateGraviObject() collide::rq_result l_rq; if (Level().ObjectSpace.RayPick(new_pos, dir, trace_dist, collide::rqtBoth, l_rq, NULL)) { - const CObject *enemy = smart_cast(m_gravi_object.enemy); + const IGameObject *enemy = smart_cast(m_gravi_object.enemy); if ((l_rq.O == enemy) && (l_rq.range < trace_dist)) { // check for visibility bool b_enemy_visible = false; - xr_vector visible_objects; + xr_vector visible_objects; feel_vision_get(visible_objects); // find object @@ -353,7 +353,7 @@ void CBurer::UpdateGraviObject() // hit objects m_nearest.clear_not_free (); Level().ObjectSpace.GetNearest (m_nearest,m_gravi_object.cur_pos, m_gravi.radius, NULL); - //xr_vector &m_nearest = Level().ObjectSpace.q_nearest; + //xr_vector &m_nearest = Level().ObjectSpace.q_nearest; for (u32 i=0;i(m_nearest[i]); @@ -442,7 +442,7 @@ void CBurer::Hit (SHit* pHDS) last_hit_frame = Device.dwFrame; } -void CBurer::Die(CObject* who) +void CBurer::Die(IGameObject* who) { inherited::Die(who); @@ -454,7 +454,7 @@ void CBurer::Die(CObject* who) CTelekinesis::Deactivate(); } -void CBurer::net_Relcase(CObject *O) +void CBurer::net_Relcase(IGameObject *O) { inherited::net_Relcase (O); diff --git a/src/xrGame/ai/monsters/burer/burer.h b/src/xrGame/ai/monsters/burer/burer.h index 61faa79da15..e42f6beab34 100644 --- a/src/xrGame/ai/monsters/burer/burer.h +++ b/src/xrGame/ai/monsters/burer/burer.h @@ -15,7 +15,7 @@ class CBurer : public CBaseMonster, typedef CBaseMonster inherited; private: - xr_vector m_nearest; + xr_vector m_nearest; public: static bool can_scan; @@ -133,11 +133,11 @@ class CBurer : public CBaseMonster, virtual void PostLoad (LPCSTR section); virtual void net_Destroy (); - virtual void net_Relcase (CObject *O); + virtual void net_Relcase (IGameObject *O); virtual void shedule_Update (u32 dt); virtual void UpdateCL (); virtual void Hit (SHit* pHDS); - virtual void Die (CObject* who); + virtual void Die (IGameObject* who); void ProcessTurn (); virtual void CheckSpecParams (u32 spec_params); diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack.h b/src/xrGame/ai/monsters/burer/burer_state_attack.h index 9e2373bc369..5004c33281f 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack.h @@ -12,7 +12,7 @@ class CStateBurerAttack : public CState virtual void initialize (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object); } + virtual void remove_links (IGameObject* object) { inherited::remove_links(object); } virtual void finalize (); virtual void critical_finalize (); diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_antiaim.h b/src/xrGame/ai/monsters/burer/burer_state_attack_antiaim.h index c52662805e4..917b1f0d27d 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_antiaim.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_antiaim.h @@ -14,7 +14,7 @@ class CStateBurerAntiAim : public CState virtual void execute (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_start_conditions (); virtual bool check_completion (); diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_gravi.h b/src/xrGame/ai/monsters/burer/burer_state_attack_gravi.h index af1bccf079b..273204c5aaf 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_gravi.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_gravi.h @@ -11,7 +11,7 @@ class CStateBurerAttackGravi : public CState<_Object> { virtual void execute (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_start_conditions (); virtual bool check_completion (); diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_run_around.h b/src/xrGame/ai/monsters/burer/burer_state_attack_run_around.h index 2a42dcefed2..724225a0aaa 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_run_around.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_run_around.h @@ -17,7 +17,7 @@ class CStateBurerAttackRunAround : public CState<_Object> { virtual bool check_start_conditions (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "burer_state_attack_run_around_inline.h" \ No newline at end of file diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_shield.h b/src/xrGame/ai/monsters/burer/burer_state_attack_shield.h index b4c688add5a..82994a23064 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_shield.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_shield.h @@ -14,7 +14,7 @@ class CStateBurerShield : public CState virtual void execute (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_start_conditions (); virtual bool check_completion (); diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_tele.h b/src/xrGame/ai/monsters/burer/burer_state_attack_tele.h index d666ce51bd9..bcd2003f0f4 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_tele.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_tele.h @@ -9,7 +9,7 @@ class CStateBurerAttackTele : public CState { xr_vector tele_objects; CPhysicsShellHolder *selected_object; - xr_vector m_nearest; + xr_vector m_nearest; u32 time_started; @@ -28,7 +28,7 @@ class CStateBurerAttackTele : public CState { virtual void execute (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_start_conditions (); virtual bool check_completion (); @@ -53,7 +53,7 @@ class CStateBurerAttackTele : public CState { void SelectObjects (); // internal for FindObjects - void FindFreeObjects (xr_vector &tpObjects, const Fvector &pos); + void FindFreeObjects (xr_vector &tpObjects, const Fvector &pos); void xr_stdcall OnGrenadeDestroyed (CGrenade* const grenade); void FireAllToEnemy (); diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_tele_inline.h b/src/xrGame/ai/monsters/burer/burer_state_attack_tele_inline.h index fee7049ebbb..542f3bb7380 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_tele_inline.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_tele_inline.h @@ -189,7 +189,7 @@ bool CStateBurerAttackTele::check_completion() ////////////////////////////////////////////////////////////////////////// template -void CStateBurerAttackTele::FindFreeObjects(xr_vector &tpObjects, const Fvector &pos) +void CStateBurerAttackTele::FindFreeObjects(xr_vector &tpObjects, const Fvector &pos) { Level().ObjectSpace.GetNearest (tpObjects, pos, object->m_tele_find_radius, NULL); diff --git a/src/xrGame/ai/monsters/burer/burer_state_manager.h b/src/xrGame/ai/monsters/burer/burer_state_manager.h index d085453a765..caefe013413 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_manager.h +++ b/src/xrGame/ai/monsters/burer/burer_state_manager.h @@ -9,6 +9,6 @@ class CStateManagerBurer : public CMonsterStateManager { CStateManagerBurer (CBurer *monster); virtual void execute (); virtual void setup_substates (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/monsters/cat/cat.cpp b/src/xrGame/ai/monsters/cat/cat.cpp index 808592c67ee..7b5f89116d3 100644 --- a/src/xrGame/ai/monsters/cat/cat.cpp +++ b/src/xrGame/ai/monsters/cat/cat.cpp @@ -102,7 +102,7 @@ void CCat::reinit() void CCat::try_to_jump() { - CObject *target = const_cast(EnemyMan.get_enemy()); + IGameObject *target = const_cast(EnemyMan.get_enemy()); if (!target || !EnemyMan.see_enemy_now()) return; } diff --git a/src/xrGame/ai/monsters/cat/cat_state_manager.h b/src/xrGame/ai/monsters/cat/cat_state_manager.h index 008ffa5f3d4..097fd6659cb 100644 --- a/src/xrGame/ai/monsters/cat/cat_state_manager.h +++ b/src/xrGame/ai/monsters/cat/cat_state_manager.h @@ -14,5 +14,5 @@ class CStateManagerCat : public CMonsterStateManager { virtual ~CStateManagerCat (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/monsters/chimera/chimera_attack_state.h b/src/xrGame/ai/monsters/chimera/chimera_attack_state.h index 458413383a8..f8e32fd0568 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_attack_state.h +++ b/src/xrGame/ai/monsters/chimera/chimera_attack_state.h @@ -29,7 +29,7 @@ class ChimeraAttackState : public CState float calculate_min_run_distance () const; typedef CState inherited; - virtual void remove_links (CObject* object) { inherited::remove_links(object); } + virtual void remove_links (IGameObject* object) { inherited::remove_links(object); } CControl_Com* m_capturer; diff --git a/src/xrGame/ai/monsters/chimera/chimera_attack_state_inline.h b/src/xrGame/ai/monsters/chimera/chimera_attack_state_inline.h index a49dec81fde..330fe62eeaa 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_attack_state_inline.h +++ b/src/xrGame/ai/monsters/chimera/chimera_attack_state_inline.h @@ -107,7 +107,7 @@ bool ChimeraAttackState::check_if_jump_possible (Fvector const& target if ( !ai().level_graph().valid_vertex_position(target) ) return false; - if ( object->com_man().get_jump_control()->jump_intersect_geometry(target, (CObject*)object->EnemyMan.get_enemy()) ) + if ( object->com_man().get_jump_control()->jump_intersect_geometry(target, (IGameObject*)object->EnemyMan.get_enemy()) ) return false; return true; diff --git a/src/xrGame/ai/monsters/chimera/chimera_state_manager.h b/src/xrGame/ai/monsters/chimera/chimera_state_manager.h index 5c3c0792a6d..eb17f505a6d 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_state_manager.h +++ b/src/xrGame/ai/monsters/chimera/chimera_state_manager.h @@ -13,5 +13,5 @@ class CStateManagerChimera : public CMonsterStateManager virtual ~CStateManagerChimera (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/monsters/chimera/chimera_state_threaten.h b/src/xrGame/ai/monsters/chimera/chimera_state_threaten.h index 7d1f8f62b4a..eb55af1c1bf 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_state_threaten.h +++ b/src/xrGame/ai/monsters/chimera/chimera_state_threaten.h @@ -29,7 +29,7 @@ class CStateChimeraThreaten : public CState<_Object> { virtual void critical_finalize (); virtual bool check_start_conditions (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "chimera_state_threaten_inline.h" diff --git a/src/xrGame/ai/monsters/chimera/chimera_state_threaten_roar.h b/src/xrGame/ai/monsters/chimera/chimera_state_threaten_roar.h index 3e74d49bea3..d6ed7332645 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_state_threaten_roar.h +++ b/src/xrGame/ai/monsters/chimera/chimera_state_threaten_roar.h @@ -11,7 +11,7 @@ class CStateChimeraThreatenRoar : public CState<_Object> { virtual void initialize (); virtual void execute (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "chimera_state_threaten_roar_inline.h" diff --git a/src/xrGame/ai/monsters/control_direction.cpp b/src/xrGame/ai/monsters/control_direction.cpp index 52238e5319c..b019375ea69 100644 --- a/src/xrGame/ai/monsters/control_direction.cpp +++ b/src/xrGame/ai/monsters/control_direction.cpp @@ -150,7 +150,7 @@ bool CControlDirection::is_face_target(const Fvector &position, float eps_angle) return true; } -bool CControlDirection::is_face_target(const CObject *obj, float eps_angle) +bool CControlDirection::is_face_target(const IGameObject *obj, float eps_angle) { return is_face_target(obj->Position(), eps_angle); } diff --git a/src/xrGame/ai/monsters/control_direction.h b/src/xrGame/ai/monsters/control_direction.h index 92d4eb19b39..b263c305f4d 100644 --- a/src/xrGame/ai/monsters/control_direction.h +++ b/src/xrGame/ai/monsters/control_direction.h @@ -42,7 +42,7 @@ class CControlDirection : public CControl_ComPure { // services bool is_face_target (const Fvector &position, float eps_angle); - bool is_face_target (const CObject *obj, float eps_angle); + bool is_face_target (const IGameObject *obj, float eps_angle); bool is_from_right (const Fvector &position); bool is_from_right (float yaw); diff --git a/src/xrGame/ai/monsters/control_direction_base.cpp b/src/xrGame/ai/monsters/control_direction_base.cpp index b5f708ce598..a6e62b9a488 100644 --- a/src/xrGame/ai/monsters/control_direction_base.cpp +++ b/src/xrGame/ai/monsters/control_direction_base.cpp @@ -39,7 +39,7 @@ void CControlDirectionBase::face_target(const Fvector &position, u32 delay, floa m_time_last_faced = Device.dwTimeGlobal; } -void CControlDirectionBase::face_target(const CObject *obj, u32 delay, float add_yaw) +void CControlDirectionBase::face_target(const IGameObject *obj, u32 delay, float add_yaw) { face_target (obj->Position(), delay, add_yaw); } diff --git a/src/xrGame/ai/monsters/control_direction_base.h b/src/xrGame/ai/monsters/control_direction_base.h index 1256752c0e2..9b91ec9f404 100644 --- a/src/xrGame/ai/monsters/control_direction_base.h +++ b/src/xrGame/ai/monsters/control_direction_base.h @@ -28,7 +28,7 @@ class CControlDirectionBase : public CControl_ComBase { void use_path_direction (bool reversed = false); virtual void face_target (const Fvector &position, u32 delay = 0, float add_yaw = 0.f); - virtual void face_target (const CObject *obj, u32 delay = 0, float add_yaw = 0.f); + virtual void face_target (const IGameObject *obj, u32 delay = 0, float add_yaw = 0.f); IC void set_delay (u32 delay) {m_delay = delay;} void set_heading_speed (float value, bool force = false); diff --git a/src/xrGame/ai/monsters/control_jump.cpp b/src/xrGame/ai/monsters/control_jump.cpp index 0669810a025..7e76fd7aeb6 100644 --- a/src/xrGame/ai/monsters/control_jump.cpp +++ b/src/xrGame/ai/monsters/control_jump.cpp @@ -60,7 +60,7 @@ bool CControlJump::check_start_conditions() return true; } -void CControlJump::remove_links (CObject* object) +void CControlJump::remove_links (IGameObject* object) { if ( m_data.target_object == object ) m_data.target_object = NULL; @@ -394,7 +394,7 @@ void CControlJump::stop() ////////////////////////////////////////////////////////////////////////// // Get target point in world space -Fvector CControlJump::get_target(CObject *obj) +Fvector CControlJump::get_target(IGameObject *obj) { u16 bone_id = smart_cast(obj->Visual())->LL_GetBoneRoot (); CBoneInstance &bone = smart_cast(obj->Visual())->LL_GetBoneInstance (bone_id); @@ -529,7 +529,7 @@ void CControlJump::hit_test() m_object->HitEntityInJump(smart_cast(m_data.target_object)); } -bool CControlJump::can_jump(CObject *target) +bool CControlJump::can_jump(IGameObject *target) { const bool aggressive_jump = m_object->can_use_agressive_jump(target); Fvector target_position; @@ -538,7 +538,7 @@ bool CControlJump::can_jump(CObject *target) return can_jump(target_position, aggressive_jump); } -bool CControlJump::jump_intersect_geometry (Fvector const & target, CObject * const ignored_object) +bool CControlJump::jump_intersect_geometry (Fvector const & target, IGameObject * const ignored_object) { calculate_jump_time (target, false); @@ -677,7 +677,7 @@ bool CControlJump::can_jump(Fvector const& target, bool const aggressive_jump) } -Fvector CControlJump::predict_position(CObject *obj, const Fvector &pos) +Fvector CControlJump::predict_position(IGameObject *obj, const Fvector &pos) { return pos; } diff --git a/src/xrGame/ai/monsters/control_jump.h b/src/xrGame/ai/monsters/control_jump.h index 00071622a3f..66d4e7d6ef9 100644 --- a/src/xrGame/ai/monsters/control_jump.h +++ b/src/xrGame/ai/monsters/control_jump.h @@ -3,7 +3,7 @@ #include "Include/xrRender/KinematicsAnimated.h" struct SControlJumpData : public ControlCom::IComData { - CObject *target_object; + IGameObject *target_object; Fvector target_position; float force_factor; @@ -103,10 +103,10 @@ class CControlJump : public CControl_ComCustom { virtual void update_frame (); // check for distance and angle difference - virtual bool can_jump (CObject *target); + virtual bool can_jump (IGameObject *target); bool can_jump (Fvector const& target, bool const aggressive_jump); - bool jump_intersect_geometry (Fvector const & target, CObject * ignored_object); + bool jump_intersect_geometry (Fvector const & target, IGameObject * ignored_object); // stop/break jump and all of jumping states virtual void stop (); @@ -116,7 +116,7 @@ class CControlJump : public CControl_ComCustom { SControlJumpData &setup_data () {return m_data;} - void remove_links (CObject* object); + void remove_links (IGameObject* object); private: void calculate_jump_time (Fvector const & target, bool check_force_factor); @@ -124,7 +124,7 @@ SControlJumpData &setup_data () {return m_data;} // build path after jump void grounding (); // get target position according to object center point - Fvector get_target (CObject *obj); + Fvector get_target (IGameObject *obj); // check for hit object void hit_test (); @@ -132,7 +132,7 @@ SControlJumpData &setup_data () {return m_data;} bool is_on_the_ground (); // position prediction - Fvector predict_position (CObject *obj, const Fvector &pos); + Fvector predict_position (IGameObject *obj, const Fvector &pos); void start_jump (const Fvector &point); diff --git a/src/xrGame/ai/monsters/control_manager.h b/src/xrGame/ai/monsters/control_manager.h index e4fe701ee1f..efd49be5883 100644 --- a/src/xrGame/ai/monsters/control_manager.h +++ b/src/xrGame/ai/monsters/control_manager.h @@ -16,7 +16,7 @@ class CControl_Com; class CControl_Manager { CBaseMonster *m_object; - xr_vector m_nearest; + xr_vector m_nearest; DEFINE_VECTOR (CControl_Com *, CONTROLLERS_VECTOR, CONTROLLERS_VECTOR_IT); DEFINE_MAP (ControlCom::EEventType, CONTROLLERS_VECTOR, LISTENERS_MAP, LISTENERS_MAP_IT); diff --git a/src/xrGame/ai/monsters/control_manager_custom.cpp b/src/xrGame/ai/monsters/control_manager_custom.cpp index 638deae99e9..cb4f1591969 100644 --- a/src/xrGame/ai/monsters/control_manager_custom.cpp +++ b/src/xrGame/ai/monsters/control_manager_custom.cpp @@ -256,7 +256,7 @@ void CControlManagerCustom::seq_run(MotionID motion) /////////////////////////////////////////////////////////////////////////////////////////////////// // Jumping /////////////////////////////////////////////////////////////////////////////////////////////////// -void CControlManagerCustom::jump(CObject *obj, const SControlJumpData &ta) +void CControlManagerCustom::jump(IGameObject *obj, const SControlJumpData &ta) { if (!m_man->check_start_conditions(ControlCom::eControlJump)) return; @@ -665,7 +665,7 @@ void CControlManagerCustom::critical_wound(LPCSTR anim) } ////////////////////////////////////////////////////////////////////////// -void CControlManagerCustom::remove_links (CObject * object) +void CControlManagerCustom::remove_links (IGameObject * object) { if ( m_jump ) m_jump->remove_links(object); diff --git a/src/xrGame/ai/monsters/control_manager_custom.h b/src/xrGame/ai/monsters/control_manager_custom.h index 226af3678ba..fa3c6ce0b01 100644 --- a/src/xrGame/ai/monsters/control_manager_custom.h +++ b/src/xrGame/ai/monsters/control_manager_custom.h @@ -17,7 +17,7 @@ class CEntityAlive; class CControlManagerCustom : public CControl_ComBase { typedef CControl_ComBase inherited; - xr_vector m_nearest; + xr_vector m_nearest; CAnimationSequencer *m_sequencer; CAnimationTriple *m_triple_anim; @@ -68,7 +68,7 @@ class CControlManagerCustom : public CControl_ComBase { //------------------------------------------------------------------------------- // Jump - void jump (CObject *obj, const SControlJumpData &ta); + void jump (IGameObject *obj, const SControlJumpData &ta); bool jump (const SControlJumpData &ta); void jump (const Fvector &position); void load_jump_data (LPCSTR s1, LPCSTR s2, LPCSTR s3, LPCSTR s4, u32 vel_mask_prepare, u32 vel_mask_ground, u32 flags); @@ -96,7 +96,7 @@ class CControlManagerCustom : public CControl_ComBase { void critical_wound (LPCSTR anim); - void remove_links (CObject * object); + void remove_links (IGameObject * object); CControlJump* get_jump_control () { return m_jump; } private: diff --git a/src/xrGame/ai/monsters/controller/controller.cpp b/src/xrGame/ai/monsters/controller/controller.cpp index 7048713f558..fd8129fa013 100644 --- a/src/xrGame/ai/monsters/controller/controller.cpp +++ b/src/xrGame/ai/monsters/controller/controller.cpp @@ -469,7 +469,7 @@ void CController::shedule_Update(u32 dt) test_covers(); } -void CController::Die(CObject* who) +void CController::Die(IGameObject* who) { inherited::Die(who); FreeFromControl(); @@ -484,7 +484,7 @@ void CController::net_Destroy() FreeFromControl (); } -void CController::net_Relcase(CObject *O) +void CController::net_Relcase(IGameObject *O) { inherited::net_Relcase(O); } diff --git a/src/xrGame/ai/monsters/controller/controller.h b/src/xrGame/ai/monsters/controller/controller.h index 3382c4d0489..ec23845387e 100644 --- a/src/xrGame/ai/monsters/controller/controller.h +++ b/src/xrGame/ai/monsters/controller/controller.h @@ -77,11 +77,11 @@ class CController : public CBaseMonster, virtual void reinit (); virtual void UpdateCL (); virtual void shedule_Update (u32 dt); - virtual void Die (CObject* who); + virtual void Die (IGameObject* who); virtual void net_Destroy (); virtual BOOL net_Spawn (CSE_Abstract *DC); - virtual void net_Relcase (CObject *O); + virtual void net_Relcase (IGameObject *O); virtual void CheckSpecParams (u32 spec_params); virtual void InitThink (); diff --git a/src/xrGame/ai/monsters/controller/controller_psy_hit.cpp b/src/xrGame/ai/monsters/controller/controller_psy_hit.cpp index d7d4fb7d9ff..bad06bb852a 100644 --- a/src/xrGame/ai/monsters/controller/controller_psy_hit.cpp +++ b/src/xrGame/ai/monsters/controller/controller_psy_hit.cpp @@ -141,7 +141,7 @@ namespace detail bool check_actor_visibility (const Fvector trace_from, const Fvector trace_to, - CObject* object) + IGameObject* object) { const float dist = trace_from.distance_to(trace_to); Fvector trace_dir; diff --git a/src/xrGame/ai/monsters/controller/controller_state_attack.h b/src/xrGame/ai/monsters/controller/controller_state_attack.h index 125605edbb3..33d0ef34f2d 100644 --- a/src/xrGame/ai/monsters/controller/controller_state_attack.h +++ b/src/xrGame/ai/monsters/controller/controller_state_attack.h @@ -20,7 +20,7 @@ class CStateControllerAttack : public CState<_Object> { virtual void execute (); virtual void setup_substates (); virtual void check_force_state (); - virtual void remove_links (CObject * ) {} + virtual void remove_links (IGameObject * ) {} bool check_home_point (); }; diff --git a/src/xrGame/ai/monsters/controller/controller_state_attack_camp.h b/src/xrGame/ai/monsters/controller/controller_state_attack_camp.h index 96b09b3ea22..20f703dfd84 100644 --- a/src/xrGame/ai/monsters/controller/controller_state_attack_camp.h +++ b/src/xrGame/ai/monsters/controller/controller_state_attack_camp.h @@ -20,7 +20,7 @@ class CStateControlCamp : public CState<_Object> { virtual bool check_completion (); virtual bool check_start_conditions (); - virtual void remove_links (CObject* object) {} + virtual void remove_links (IGameObject* object) {} private: diff --git a/src/xrGame/ai/monsters/controller/controller_state_attack_hide.h b/src/xrGame/ai/monsters/controller/controller_state_attack_hide.h index 51480df7320..a6088641ef6 100644 --- a/src/xrGame/ai/monsters/controller/controller_state_attack_hide.h +++ b/src/xrGame/ai/monsters/controller/controller_state_attack_hide.h @@ -26,7 +26,7 @@ class CStateControlHide : public CState<_Object> { virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); virtual bool check_start_conditions (); diff --git a/src/xrGame/ai/monsters/controller/controller_state_attack_hide_lite.h b/src/xrGame/ai/monsters/controller/controller_state_attack_hide_lite.h index 1cbbc497db3..f6c40d8104a 100644 --- a/src/xrGame/ai/monsters/controller/controller_state_attack_hide_lite.h +++ b/src/xrGame/ai/monsters/controller/controller_state_attack_hide_lite.h @@ -27,7 +27,7 @@ class CStateControlHideLite : public CState<_Object> { virtual bool check_completion (); virtual bool check_start_conditions (); - virtual void remove_links (CObject* object) {} + virtual void remove_links (IGameObject* object) {} private: diff --git a/src/xrGame/ai/monsters/controller/controller_state_attack_moveout.h b/src/xrGame/ai/monsters/controller/controller_state_attack_moveout.h index aff0cb34e98..0afd799764d 100644 --- a/src/xrGame/ai/monsters/controller/controller_state_attack_moveout.h +++ b/src/xrGame/ai/monsters/controller/controller_state_attack_moveout.h @@ -30,7 +30,7 @@ class CStateControlMoveOut : public CState<_Object> { virtual bool check_completion (); virtual bool check_start_conditions (); - virtual void remove_links (CObject* object) {} + virtual void remove_links (IGameObject* object) {} private: void update_target_point (); diff --git a/src/xrGame/ai/monsters/controller/controller_state_manager.h b/src/xrGame/ai/monsters/controller/controller_state_manager.h index 9a71079dc95..b813c0bdeba 100644 --- a/src/xrGame/ai/monsters/controller/controller_state_manager.h +++ b/src/xrGame/ai/monsters/controller/controller_state_manager.h @@ -13,6 +13,6 @@ class CStateManagerController : public CMonsterStateManager { virtual void reinit (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_control_start_conditions (ControlCom::EControlType type); }; diff --git a/src/xrGame/ai/monsters/dog/dog.cpp b/src/xrGame/ai/monsters/dog/dog.cpp index ca2f9d86a25..3b09009ba33 100644 --- a/src/xrGame/ai/monsters/dog/dog.cpp +++ b/src/xrGame/ai/monsters/dog/dog.cpp @@ -394,7 +394,7 @@ u32 CAI_Dog::get_attack_rebuild_time () return 100 + u32(25*dist); } -bool CAI_Dog::can_use_agressive_jump (const CObject* enemy) +bool CAI_Dog::can_use_agressive_jump (const IGameObject* enemy) { float delta_y = 0.8f; if ( enemy == Actor() ) diff --git a/src/xrGame/ai/monsters/dog/dog.h b/src/xrGame/ai/monsters/dog/dog.h index 203fe5b90be..3cfe0b271a2 100644 --- a/src/xrGame/ai/monsters/dog/dog.h +++ b/src/xrGame/ai/monsters/dog/dog.h @@ -24,7 +24,7 @@ class CAI_Dog : public CBaseMonster, virtual bool ability_can_drag () {return true;} virtual u32 get_attack_rebuild_time (); - virtual bool can_use_agressive_jump (const CObject*); + virtual bool can_use_agressive_jump (const IGameObject*); virtual char* get_monster_class_name () { return "dog"; } public: diff --git a/src/xrGame/ai/monsters/dog/dog_state_manager.h b/src/xrGame/ai/monsters/dog/dog_state_manager.h index 24dc16f2b13..58f3126d62d 100644 --- a/src/xrGame/ai/monsters/dog/dog_state_manager.h +++ b/src/xrGame/ai/monsters/dog/dog_state_manager.h @@ -11,5 +11,5 @@ class CStateManagerDog : public CMonsterStateManager { CStateManagerDog (CAI_Dog *monster); virtual void execute (); bool check_eat (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/monsters/flesh/flesh_state_manager.h b/src/xrGame/ai/monsters/flesh/flesh_state_manager.h index 2373dd13951..e1a2fda88ec 100644 --- a/src/xrGame/ai/monsters/flesh/flesh_state_manager.h +++ b/src/xrGame/ai/monsters/flesh/flesh_state_manager.h @@ -10,5 +10,5 @@ class CStateManagerFlesh : public CMonsterStateManager { CStateManagerFlesh (CAI_Flesh *monster); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/monsters/fracture/fracture_state_manager.h b/src/xrGame/ai/monsters/fracture/fracture_state_manager.h index d6fa11a71d9..50874d92d30 100644 --- a/src/xrGame/ai/monsters/fracture/fracture_state_manager.h +++ b/src/xrGame/ai/monsters/fracture/fracture_state_manager.h @@ -11,5 +11,5 @@ class CStateManagerFracture : public CMonsterStateManager { virtual ~CStateManagerFracture (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/monsters/group_states/group_state_attack.h b/src/xrGame/ai/monsters/group_states/group_state_attack.h index ec18788f70d..c3cff4ed20d 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_attack.h +++ b/src/xrGame/ai/monsters/group_states/group_state_attack.h @@ -15,7 +15,7 @@ class CStateGroupAttack : public CState<_Object> virtual void setup_substates (); virtual void critical_finalize (); virtual void finalize (); - virtual void remove_links (CObject* object); + virtual void remove_links (IGameObject* object); protected: typedef CState<_Object> inherited; diff --git a/src/xrGame/ai/monsters/group_states/group_state_attack_inline.h b/src/xrGame/ai/monsters/group_states/group_state_attack_inline.h index b945ec41b55..123ff5c2b67 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_attack_inline.h +++ b/src/xrGame/ai/monsters/group_states/group_state_attack_inline.h @@ -512,7 +512,7 @@ bool CStateGroupAttackAbstract::check_behinder() } TEMPLATE_SPECIALIZATION -void CStateGroupAttackAbstract::remove_links(CObject* object) +void CStateGroupAttackAbstract::remove_links(IGameObject* object) { if ( m_enemy == object ) { diff --git a/src/xrGame/ai/monsters/group_states/group_state_attack_run.h b/src/xrGame/ai/monsters/group_states/group_state_attack_run.h index a9aaa30cc47..fbda745d830 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_attack_run.h +++ b/src/xrGame/ai/monsters/group_states/group_state_attack_run.h @@ -30,7 +30,7 @@ class CStateGroupAttackRun : public CState<_Object> { virtual bool check_completion (); virtual bool check_start_conditions (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "group_state_attack_run_inline.h" diff --git a/src/xrGame/ai/monsters/group_states/group_state_custom.h b/src/xrGame/ai/monsters/group_states/group_state_custom.h index 6f2104238e8..be730ebde24 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_custom.h +++ b/src/xrGame/ai/monsters/group_states/group_state_custom.h @@ -15,7 +15,7 @@ class CStateCustomGroup : public CState<_Object> { virtual void execute (); virtual void setup_substates (); virtual bool check_completion () {return (object->b_state_end);} - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "group_state_custom_inline.h" \ No newline at end of file diff --git a/src/xrGame/ai/monsters/group_states/group_state_eat.h b/src/xrGame/ai/monsters/group_states/group_state_eat.h index 496654b2e70..71ba9fd6b82 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_eat.h +++ b/src/xrGame/ai/monsters/group_states/group_state_eat.h @@ -20,7 +20,7 @@ class CStateGroupEat : public CState<_Object> { virtual void initialize (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object); + virtual void remove_links (IGameObject* object); virtual void reselect_state (); virtual void setup_substates (); diff --git a/src/xrGame/ai/monsters/group_states/group_state_eat_drag.h b/src/xrGame/ai/monsters/group_states/group_state_eat_drag.h index 3eb10fdbff7..d0fb00e8a1c 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_eat_drag.h +++ b/src/xrGame/ai/monsters/group_states/group_state_eat_drag.h @@ -23,7 +23,7 @@ class CStateGroupDrag : public CState<_Object> { virtual void execute (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); }; diff --git a/src/xrGame/ai/monsters/group_states/group_state_eat_eat.h b/src/xrGame/ai/monsters/group_states/group_state_eat_eat.h index 1493770475e..9703857d317 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_eat_eat.h +++ b/src/xrGame/ai/monsters/group_states/group_state_eat_eat.h @@ -18,7 +18,7 @@ class CStateGroupEating : public CState<_Object> { virtual bool check_start_conditions (); virtual bool check_completion (); - virtual void remove_links (CObject* object); + virtual void remove_links (IGameObject* object); }; #include "group_state_eat_eat_inline.h" diff --git a/src/xrGame/ai/monsters/group_states/group_state_eat_eat_inline.h b/src/xrGame/ai/monsters/group_states/group_state_eat_eat_inline.h index 7d76a2480cb..7693657b3e9 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_eat_eat_inline.h +++ b/src/xrGame/ai/monsters/group_states/group_state_eat_eat_inline.h @@ -91,7 +91,7 @@ bool CStateGroupEatingAbstract::check_completion() } TEMPLATE_SPECIALIZATION -void CStateGroupEatingAbstract::remove_links(CObject* object) +void CStateGroupEatingAbstract::remove_links(IGameObject* object) { if (corpse == object) corpse = 0; diff --git a/src/xrGame/ai/monsters/group_states/group_state_eat_inline.h b/src/xrGame/ai/monsters/group_states/group_state_eat_inline.h index e3e19962b09..ff1042cf4e7 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_eat_inline.h +++ b/src/xrGame/ai/monsters/group_states/group_state_eat_inline.h @@ -340,7 +340,7 @@ bool CStateGroupEatAbstract::hungry() } TEMPLATE_SPECIALIZATION -void CStateGroupEatAbstract::remove_links (CObject* object) +void CStateGroupEatAbstract::remove_links (IGameObject* object) { if (corpse == object) corpse = 0; diff --git a/src/xrGame/ai/monsters/group_states/group_state_hear_danger_sound.h b/src/xrGame/ai/monsters/group_states/group_state_hear_danger_sound.h index 3180037d034..b058e0b0e7f 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_hear_danger_sound.h +++ b/src/xrGame/ai/monsters/group_states/group_state_hear_danger_sound.h @@ -18,7 +18,7 @@ class CStateGroupHearDangerousSound : public CState<_Object> { virtual void initialize (); virtual void reselect_state (); virtual void setup_substates (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "group_state_hear_danger_sound_inline.h" \ No newline at end of file diff --git a/src/xrGame/ai/monsters/group_states/group_state_home_point_attack.h b/src/xrGame/ai/monsters/group_states/group_state_home_point_attack.h index 6ab38865928..42d700b2492 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_home_point_attack.h +++ b/src/xrGame/ai/monsters/group_states/group_state_home_point_attack.h @@ -19,7 +19,7 @@ class CStateGroupAttackMoveToHomePoint : public CState<_Object> { virtual void initialize (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_start_conditions (); virtual bool check_completion (); diff --git a/src/xrGame/ai/monsters/group_states/group_state_panic.h b/src/xrGame/ai/monsters/group_states/group_state_panic.h index 5004ef5aae6..194cf721e8a 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_panic.h +++ b/src/xrGame/ai/monsters/group_states/group_state_panic.h @@ -15,7 +15,7 @@ class CStateGroupPanic : public CState<_Object> { virtual void reselect_state (); virtual void check_force_state (); virtual void setup_substates (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "group_state_panic_inline.h" diff --git a/src/xrGame/ai/monsters/group_states/group_state_panic_run.h b/src/xrGame/ai/monsters/group_states/group_state_panic_run.h index 99847a8c19b..0d4d85dfead 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_panic_run.h +++ b/src/xrGame/ai/monsters/group_states/group_state_panic_run.h @@ -12,7 +12,7 @@ class CStateGroupPanicRun : public CState<_Object> { virtual void execute (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "group_state_panic_run_inline.h" diff --git a/src/xrGame/ai/monsters/group_states/group_state_rest.h b/src/xrGame/ai/monsters/group_states/group_state_rest.h index 78390c77976..c5d63f0086d 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_rest.h +++ b/src/xrGame/ai/monsters/group_states/group_state_rest.h @@ -20,7 +20,7 @@ class CStateGroupRest : public CState<_Object> { virtual void execute (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "group_state_rest_inline.h" \ No newline at end of file diff --git a/src/xrGame/ai/monsters/group_states/group_state_rest_idle.h b/src/xrGame/ai/monsters/group_states/group_state_rest_idle.h index 090fcbd9dbc..49ad01c8e34 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_rest_idle.h +++ b/src/xrGame/ai/monsters/group_states/group_state_rest_idle.h @@ -15,7 +15,7 @@ class CStateGroupRestIdle : public CState<_Object> { virtual void initialize (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual void reselect_state (); virtual void setup_substates (); diff --git a/src/xrGame/ai/monsters/group_states/group_state_squad_move_to_radius.h b/src/xrGame/ai/monsters/group_states/group_state_squad_move_to_radius.h index 42cc1c3d2a5..d54cbfeeb9c 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_squad_move_to_radius.h +++ b/src/xrGame/ai/monsters/group_states/group_state_squad_move_to_radius.h @@ -16,7 +16,7 @@ class CStateGroupSquadMoveToRadiusEx : public CState<_Object> { virtual void initialize (); virtual void execute (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; template @@ -33,7 +33,7 @@ class CStateGroupSquadMoveToRadius : public CState<_Object> { virtual void initialize (); virtual void execute (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/monsters/group_states/state_adapter.h b/src/xrGame/ai/monsters/group_states/state_adapter.h index 21eff3e2d1e..f5788f5f73a 100644 --- a/src/xrGame/ai/monsters/group_states/state_adapter.h +++ b/src/xrGame/ai/monsters/group_states/state_adapter.h @@ -47,7 +47,7 @@ class CMonsterStateAdapter : public CState<_Object> virtual void execute () { m_impl->execute(); } virtual bool check_completion () { return m_impl->check_completion(); } - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} private: CMonsterStateInterface* m_impl; diff --git a/src/xrGame/ai/monsters/monster_corpse_manager.cpp b/src/xrGame/ai/monsters/monster_corpse_manager.cpp index 33f45072480..7ad87eab330 100644 --- a/src/xrGame/ai/monsters/monster_corpse_manager.cpp +++ b/src/xrGame/ai/monsters/monster_corpse_manager.cpp @@ -69,7 +69,7 @@ void CMonsterCorpseManager::reinit() time_last_seen = 0; } -void CMonsterCorpseManager::remove_links (CObject* O) +void CMonsterCorpseManager::remove_links (IGameObject* O) { if ( corpse == O ) { diff --git a/src/xrGame/ai/monsters/monster_corpse_manager.h b/src/xrGame/ai/monsters/monster_corpse_manager.h index 658832f5211..8c11e28c42a 100644 --- a/src/xrGame/ai/monsters/monster_corpse_manager.h +++ b/src/xrGame/ai/monsters/monster_corpse_manager.h @@ -30,6 +30,6 @@ class CMonsterCorpseManager { TTime get_corpse_time_last_seen() {return time_last_seen;} void reinit (); - void remove_links (CObject* O); + void remove_links (IGameObject* O); }; diff --git a/src/xrGame/ai/monsters/monster_corpse_memory.cpp b/src/xrGame/ai/monsters/monster_corpse_memory.cpp index 0a36776d8f8..e9006b5f561 100644 --- a/src/xrGame/ai/monsters/monster_corpse_memory.cpp +++ b/src/xrGame/ai/monsters/monster_corpse_memory.cpp @@ -127,7 +127,7 @@ CORPSE_MAP_IT CMonsterCorpseMemory::find_best_corpse() return it; } -void CMonsterCorpseMemory::remove_links(CObject *O) +void CMonsterCorpseMemory::remove_links(IGameObject *O) { for (CORPSE_MAP_IT I = m_objects.begin();I!=m_objects.end();++I) { if ((*I).first == O) { diff --git a/src/xrGame/ai/monsters/monster_corpse_memory.h b/src/xrGame/ai/monsters/monster_corpse_memory.h index 6cddcd312bb..070b5b8840a 100644 --- a/src/xrGame/ai/monsters/monster_corpse_memory.h +++ b/src/xrGame/ai/monsters/monster_corpse_memory.h @@ -23,7 +23,7 @@ class CMonsterCorpseMemory { u32 get_corpse_count () {return m_objects.size();} void clear () {m_objects.clear();} - void remove_links (CObject *O); + void remove_links (IGameObject *O); void add_corpse (const CEntityAlive *corpse); bool is_valid_corpse (const CEntityAlive *corpse); diff --git a/src/xrGame/ai/monsters/monster_enemy_manager.cpp b/src/xrGame/ai/monsters/monster_enemy_manager.cpp index 32f57602b2e..93a8ef3b29b 100644 --- a/src/xrGame/ai/monsters/monster_enemy_manager.cpp +++ b/src/xrGame/ai/monsters/monster_enemy_manager.cpp @@ -298,7 +298,7 @@ void CMonsterEnemyManager::script_enemy (const CEntityAlive &enemy) m_script_enemy = &enemy; } -void CMonsterEnemyManager::remove_links (CObject* O) +void CMonsterEnemyManager::remove_links (IGameObject* O) { if ( enemy == O ) { diff --git a/src/xrGame/ai/monsters/monster_enemy_manager.h b/src/xrGame/ai/monsters/monster_enemy_manager.h index faf7e6acf6b..ed7a7a241e3 100644 --- a/src/xrGame/ai/monsters/monster_enemy_manager.h +++ b/src/xrGame/ai/monsters/monster_enemy_manager.h @@ -80,6 +80,6 @@ class CMonsterEnemyManager { const CEntityAlive *get_script_enemy () {return m_script_enemy;} void script_enemy (); void script_enemy (const CEntityAlive &enemy); - void remove_links (CObject* O); + void remove_links (IGameObject* O); }; diff --git a/src/xrGame/ai/monsters/monster_enemy_memory.cpp b/src/xrGame/ai/monsters/monster_enemy_memory.cpp index cf800cb0bc6..97d011ccd2e 100644 --- a/src/xrGame/ai/monsters/monster_enemy_memory.cpp +++ b/src/xrGame/ai/monsters/monster_enemy_memory.cpp @@ -236,7 +236,7 @@ ENEMIES_MAP_IT CMonsterEnemyMemory::find_best_enemy() return it; } -void CMonsterEnemyMemory::remove_links(CObject *O) +void CMonsterEnemyMemory::remove_links(IGameObject *O) { if ( monster ) { diff --git a/src/xrGame/ai/monsters/monster_enemy_memory.h b/src/xrGame/ai/monsters/monster_enemy_memory.h index 93575623663..297f961d7f6 100644 --- a/src/xrGame/ai/monsters/monster_enemy_memory.h +++ b/src/xrGame/ai/monsters/monster_enemy_memory.h @@ -25,7 +25,7 @@ class CMonsterEnemyMemory { const ENEMIES_MAP &get_memory () {return m_objects;} void clear () {m_objects.clear();} - void remove_links (CObject *O); + void remove_links (IGameObject *O); void add_enemy (const CEntityAlive *enemy); void add_enemy (const CEntityAlive *enemy, const Fvector &pos, u32 vertex, u32 time); diff --git a/src/xrGame/ai/monsters/monster_hit_memory.cpp b/src/xrGame/ai/monsters/monster_hit_memory.cpp index 902c5c502c1..a8ced14d219 100644 --- a/src/xrGame/ai/monsters/monster_hit_memory.cpp +++ b/src/xrGame/ai/monsters/monster_hit_memory.cpp @@ -25,12 +25,12 @@ void CMonsterHitMemory::update() remove_non_actual(); } -bool CMonsterHitMemory::is_hit(CObject *pO) +bool CMonsterHitMemory::is_hit(IGameObject *pO) { return (std::find(m_hits.begin(),m_hits.end(),pO) != m_hits.end()); } -void CMonsterHitMemory::add_hit(CObject *who, EHitSide side) +void CMonsterHitMemory::add_hit(IGameObject *who, EHitSide side) { SMonsterHit new_hit_info; new_hit_info.object = who; @@ -129,7 +129,7 @@ TTime CMonsterHitMemory::get_last_hit_time() return last_hit.time; } -CObject *CMonsterHitMemory::get_last_hit_object() +IGameObject *CMonsterHitMemory::get_last_hit_object() { SMonsterHit last_hit; last_hit.object = 0; @@ -156,16 +156,16 @@ Fvector CMonsterHitMemory::get_last_hit_position() } struct predicate_old_info { - const CObject *object; + const IGameObject *object; - predicate_old_info(const CObject *obj) : object(obj) {} + predicate_old_info(const IGameObject *obj) : object(obj) {} IC bool operator() (const SMonsterHit &hit_info) { return (object == hit_info.object); } }; -void CMonsterHitMemory::remove_hit_info(const CObject *obj) +void CMonsterHitMemory::remove_hit_info(const IGameObject *obj) { m_hits.erase ( std::remove_if( diff --git a/src/xrGame/ai/monsters/monster_hit_memory.h b/src/xrGame/ai/monsters/monster_hit_memory.h index d8d9d9e9e2d..d0a54251db4 100644 --- a/src/xrGame/ai/monsters/monster_hit_memory.h +++ b/src/xrGame/ai/monsters/monster_hit_memory.h @@ -18,21 +18,21 @@ class CMonsterHitMemory { // ----------------------------------------------------- bool is_hit () {return !m_hits.empty();} - bool is_hit (CObject *pO); + bool is_hit (IGameObject *pO); // Lain: added int get_num_hits () {return m_hits.size(); } - void add_hit (CObject *who, EHitSide side); + void add_hit (IGameObject *who, EHitSide side); Fvector get_last_hit_dir (); TTime get_last_hit_time (); - CObject *get_last_hit_object (); + IGameObject *get_last_hit_object (); Fvector get_last_hit_position (); void clear () {m_hits.clear();} - void remove_hit_info (const CObject *obj); + void remove_hit_info (const IGameObject *obj); private: void remove_non_actual (); diff --git a/src/xrGame/ai/monsters/monster_sound_memory.cpp b/src/xrGame/ai/monsters/monster_sound_memory.cpp index 0c875390be3..848b93f559d 100644 --- a/src/xrGame/ai/monsters/monster_sound_memory.cpp +++ b/src/xrGame/ai/monsters/monster_sound_memory.cpp @@ -73,7 +73,7 @@ void CMonsterSoundMemory::HearSound(const SoundElem &s) } -void CMonsterSoundMemory::HearSound(const CObject* who, int eType, const Fvector &Position, float power, TTime time) +void CMonsterSoundMemory::HearSound(const IGameObject* who, int eType, const Fvector &Position, float power, TTime time) { SoundElem s; s.SetConvert(who,eType,Position,power,time); @@ -164,7 +164,7 @@ bool CMonsterSoundMemory::is_loud_sound(float val) return false; } -bool CMonsterSoundMemory::get_sound_from_object(const CObject* obj, SoundElem &value) +bool CMonsterSoundMemory::get_sound_from_object(const IGameObject* obj, SoundElem &value) { for (u32 i=0; iwho = who; type = ConvertSoundType((ESoundTypes)eType); this->position = position; this->power = power; this->time = time; } TSoundDangerValue ConvertSoundType(ESoundTypes stype); @@ -80,7 +80,7 @@ class CMonsterSoundMemory { void init_external (CBaseMonster *M, TTime mem_time); void HearSound (const SoundElem &s); - void HearSound (const CObject* who, int eType, const Fvector &Position, float power, TTime time); + void HearSound (const IGameObject* who, int eType, const Fvector &Position, float power, TTime time); IC bool IsRememberSound () {return (!Sounds.empty());} // Lain: added @@ -89,14 +89,14 @@ class CMonsterSoundMemory { void GetSound (SoundElem& s, bool& bDangerous); // возвращает самый опасный звук SoundElem &GetSound (); - bool get_sound_from_object (const CObject* who, SoundElem &value); + bool get_sound_from_object (const IGameObject* who, SoundElem &value); void UpdateHearing (); bool is_loud_sound (float val); void clear () {Sounds.clear();} - void remove_links (CObject *O); + void remove_links (IGameObject *O); // help sounds bool hear_help_sound (); diff --git a/src/xrGame/ai/monsters/monster_state_manager.h b/src/xrGame/ai/monsters/monster_state_manager.h index d25dea623b0..f3f16769d4b 100644 --- a/src/xrGame/ai/monsters/monster_state_manager.h +++ b/src/xrGame/ai/monsters/monster_state_manager.h @@ -18,7 +18,7 @@ class CMonsterStateManager : public IStateManagerBase, public CState<_Object> { virtual void force_script_state (EMonsterState state); virtual void execute_script_state (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) = 0 { inherited::remove_links(object); } + virtual void remove_links (IGameObject* object) = 0 { inherited::remove_links(object); } virtual EMonsterState get_state_type (); diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist.cpp b/src/xrGame/ai/monsters/poltergeist/poltergeist.cpp index 5b5c1a34a4e..4e065d30816 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist.cpp +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist.cpp @@ -366,7 +366,7 @@ void CPoltergeist::net_Destroy() ability()->on_destroy(); } -void CPoltergeist::Die(CObject* who) +void CPoltergeist::Die(IGameObject* who) { // if (m_tele) { // if (state_invisible) { @@ -441,7 +441,7 @@ CMovementManager *CPoltergeist::create_movement_manager () } -void CPoltergeist::net_Relcase(CObject *O) +void CPoltergeist::net_Relcase(IGameObject *O) { inherited::net_Relcase (O); CTelekinesis::remove_links (O); diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist.h b/src/xrGame/ai/monsters/poltergeist/poltergeist.h index 78372006492..87f5986bb45 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist.h +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist.h @@ -60,7 +60,7 @@ class CPoltergeist : public CBaseMonster , virtual BOOL net_Spawn (CSE_Abstract* DC); virtual void net_Destroy (); - virtual void net_Relcase (CObject *O); + virtual void net_Relcase (IGameObject *O); virtual void UpdateCL (); virtual void shedule_Update (u32 dt); @@ -68,7 +68,7 @@ class CPoltergeist : public CBaseMonster , void set_actor_ignore (bool const actor_ignore) { m_actor_ignore = actor_ignore; } bool get_actor_ignore () const { return m_actor_ignore; } - virtual void Die (CObject* who); + virtual void Die (IGameObject* who); virtual CMovementManager *create_movement_manager(); @@ -242,7 +242,7 @@ class CPolterFlame : public CPolterSpecialAbility { public: struct SFlameElement { - const CObject *target_object; + const IGameObject *target_object; Fvector position; Fvector target_dir; u32 time_started; @@ -268,8 +268,8 @@ class CPolterFlame : public CPolterSpecialAbility { private: void select_state (SFlameElement *elem, EFlameState state); - bool get_valid_flame_position (const CObject *target_object, Fvector &res_pos); - void create_flame (const CObject *target_object); + bool get_valid_flame_position (const IGameObject *target_object, Fvector &res_pos); + void create_flame (const IGameObject *target_object); }; @@ -279,7 +279,7 @@ class CPolterFlame : public CPolterSpecialAbility { class CPolterTele : public CPolterSpecialAbility { typedef CPolterSpecialAbility inherited; - xr_vector m_nearest; + xr_vector m_nearest; // external params float m_pmt_radius; @@ -320,9 +320,9 @@ class CPolterTele : public CPolterSpecialAbility { virtual void update_frame (); private: - void tele_find_objects (xr_vector &objects, const Fvector &pos); + void tele_find_objects (xr_vector &objects, const Fvector &pos); bool tele_raise_objects (); void tele_fire_objects (); - bool trace_object (CObject *obj, const Fvector &target); + bool trace_object (IGameObject *obj, const Fvector &target); }; diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_ability.cpp b/src/xrGame/ai/monsters/poltergeist/poltergeist_ability.cpp index 481509458b8..93ce2a9a877 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_ability.cpp +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_ability.cpp @@ -109,7 +109,7 @@ void CPoltergeist::PhysicalImpulse (const Fvector &position) { m_nearest.clear_not_free (); Level().ObjectSpace.GetNearest (m_nearest,position, IMPULSE_RADIUS, NULL); - //xr_vector &m_nearest = Level().ObjectSpace.q_nearest; + //xr_vector &m_nearest = Level().ObjectSpace.q_nearest; if (m_nearest.empty()) return; u32 index = Random.randI (m_nearest.size()); diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_flame_thrower.cpp b/src/xrGame/ai/monsters/poltergeist/poltergeist_flame_thrower.cpp index 8f8c4c8741f..49b4576faf8 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_flame_thrower.cpp +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_flame_thrower.cpp @@ -80,7 +80,7 @@ void CPolterFlame::load(LPCSTR section) m_time_flame_started = 0; } -void CPolterFlame::create_flame(const CObject *target_object) +void CPolterFlame::create_flame(const IGameObject *target_object) { Fvector position; if (!get_valid_flame_position(target_object, position)) return; @@ -95,7 +95,7 @@ void CPolterFlame::create_flame(const CObject *target_object) element->particles_object = 0; element->time_last_hit = 0; - Fvector target_point = get_head_position(const_cast(target_object)); + Fvector target_point = get_head_position(const_cast(target_object)); element->target_dir.sub (target_point, element->position); element->target_dir.normalize (); @@ -253,7 +253,7 @@ void CPolterFlame::on_die() #define FIND_POINT_ATTEMPT_COUNT 5 -bool CPolterFlame::get_valid_flame_position(const CObject *target_object, Fvector &res_pos) +bool CPolterFlame::get_valid_flame_position(const IGameObject *target_object, Fvector &res_pos) { const CGameObject *Obj = smart_cast(target_object); if (!Obj) return (false); diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_state_attack_hidden.h b/src/xrGame/ai/monsters/poltergeist/poltergeist_state_attack_hidden.h index 871f621c0a3..949e3943745 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_state_attack_hidden.h +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_state_attack_hidden.h @@ -15,7 +15,7 @@ class CStatePoltergeistAttackHidden : public CState<_Object> { virtual void initialize (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} bool check_home_point (); diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_state_manager.h b/src/xrGame/ai/monsters/poltergeist/poltergeist_state_manager.h index 73bd0cb54dd..2542f3576ba 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_state_manager.h +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_state_manager.h @@ -13,7 +13,7 @@ class CStateManagerPoltergeist : public CMonsterStateManager { virtual void reinit (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} private: diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_telekinesis.cpp b/src/xrGame/ai/monsters/poltergeist/poltergeist_telekinesis.cpp index 7ce9e2f6c0d..f51acb12456 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_telekinesis.cpp +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_telekinesis.cpp @@ -133,7 +133,7 @@ class best_object_predicate2 { Fvector enemy_pos; Fvector monster_pos; public: - typedef CObject* CObject_ptr; + typedef IGameObject* CObject_ptr; best_object_predicate2(const Fvector &m_pos, const Fvector &pos) { monster_pos = m_pos; @@ -151,7 +151,7 @@ class best_object_predicate2 { ////////////////////////////////////////////////////////////////////////// -bool CPolterTele::trace_object(CObject *obj, const Fvector &target) +bool CPolterTele::trace_object(IGameObject *obj, const Fvector &target) { Fvector trace_from; obj->Center (trace_from); @@ -174,7 +174,7 @@ bool CPolterTele::trace_object(CObject *obj, const Fvector &target) return false; } -void CPolterTele::tele_find_objects(xr_vector &objects, const Fvector &pos) +void CPolterTele::tele_find_objects(xr_vector &objects, const Fvector &pos) { m_nearest.clear_not_free (); Level().ObjectSpace.GetNearest (m_nearest, pos, m_pmt_radius, NULL); @@ -205,7 +205,7 @@ void CPolterTele::tele_find_objects(xr_vector &objects, const Fvector bool CPolterTele::tele_raise_objects() { // find objects near actor - xr_vector tele_objects; + xr_vector tele_objects; tele_objects.reserve (20); // получить список объектов вокруг врага diff --git a/src/xrGame/ai/monsters/pseudodog/pseudodog_state_manager.h b/src/xrGame/ai/monsters/pseudodog/pseudodog_state_manager.h index 3e43399156e..b0f72deca3b 100644 --- a/src/xrGame/ai/monsters/pseudodog/pseudodog_state_manager.h +++ b/src/xrGame/ai/monsters/pseudodog/pseudodog_state_manager.h @@ -10,5 +10,5 @@ class CStateManagerPseudodog : public CMonsterStateManager { CStateManagerPseudodog (CAI_PseudoDog *monster); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/monsters/pseudodog/psy_dog.cpp b/src/xrGame/ai/monsters/pseudodog/psy_dog.cpp index c795a6f9e55..ea18228dab7 100644 --- a/src/xrGame/ai/monsters/pseudodog/psy_dog.cpp +++ b/src/xrGame/ai/monsters/pseudodog/psy_dog.cpp @@ -160,7 +160,7 @@ void CPsyDog::net_Destroy() inherited::net_Destroy(); } -void CPsyDog::Die(CObject* who) +void CPsyDog::Die(IGameObject* who) { inherited::Die (who); m_aura->on_death (); @@ -276,7 +276,7 @@ void CPsyDogPhantom::Think() Actor()->Cameras().AddPPEffector(xr_new(m_appear_effector.ppi, m_appear_effector.time, m_appear_effector.time_attack, m_appear_effector.time_release)); } -//void CPsyDogPhantom::Hit(float P,Fvector &dir,CObject*who,s16 element,Fvector p_in_object_space,float impulse, ALife::EHitType hit_type) +//void CPsyDogPhantom::Hit(float P,Fvector &dir,IGameObject*who,s16 element,Fvector p_in_object_space,float impulse, ALife::EHitType hit_type) void CPsyDogPhantom::Hit (SHit* pHDS) { if (is_wait_to_destroy_object()) return; @@ -298,7 +298,7 @@ void CPsyDogPhantom::net_Destroy() inherited::net_Destroy(); } -void CPsyDogPhantom::Die(CObject* who) +void CPsyDogPhantom::Die(IGameObject* who) { inherited::Die (who); destroy_me (); @@ -309,7 +309,7 @@ void CPsyDogPhantom::try_to_register_to_parent() // parent not ready yet if(m_parent) return; - CObject *obj = Level().Objects.net_Find(m_parent_id); + IGameObject *obj = Level().Objects.net_Find(m_parent_id); if (obj) { CPsyDog *dog = smart_cast(obj); VERIFY(dog); diff --git a/src/xrGame/ai/monsters/pseudodog/psy_dog.h b/src/xrGame/ai/monsters/pseudodog/psy_dog.h index 6445ade5612..095a672faf9 100644 --- a/src/xrGame/ai/monsters/pseudodog/psy_dog.h +++ b/src/xrGame/ai/monsters/pseudodog/psy_dog.h @@ -33,7 +33,7 @@ class CPsyDog : public CAI_PseudoDog { virtual void reinit (); virtual void reload (LPCSTR section); virtual void net_Destroy (); - virtual void Die (CObject* who); + virtual void Die (IGameObject* who); virtual void Think (); // void on_phantom_appear (); @@ -86,7 +86,7 @@ class CPsyDogPhantom : public CAI_PseudoDog { virtual void Hit (SHit* pHDS); virtual void net_Destroy (); - virtual void Die (CObject* who); + virtual void Die (IGameObject* who); void destroy_from_parent (); private: diff --git a/src/xrGame/ai/monsters/pseudodog/psy_dog_state_manager.h b/src/xrGame/ai/monsters/pseudodog/psy_dog_state_manager.h index a18e1d7df7f..26c73e120d7 100644 --- a/src/xrGame/ai/monsters/pseudodog/psy_dog_state_manager.h +++ b/src/xrGame/ai/monsters/pseudodog/psy_dog_state_manager.h @@ -6,5 +6,5 @@ class CStateManagerPsyDog : public CStateManagerPseudodog { public: CStateManagerPsyDog (CAI_PseudoDog *monster); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack.h b/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack.h index 236ef7a9227..cd2c326753c 100644 --- a/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack.h +++ b/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack.h @@ -13,7 +13,7 @@ class CStatePsyDogPsyAttack : public CState<_Object> { virtual ~CStatePsyDogPsyAttack () {} virtual void reselect_state (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "psy_dog_state_psy_attack_inline.h" diff --git a/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack_hide.h b/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack_hide.h index ab9af71c82e..ef4b275d49c 100644 --- a/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack_hide.h +++ b/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack_hide.h @@ -17,7 +17,7 @@ class CStatePsyDogHide : public CState<_Object> { virtual void initialize (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); virtual bool check_start_conditions (); diff --git a/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant.h b/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant.h index c27df3129d4..ea339b72a2b 100644 --- a/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant.h +++ b/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant.h @@ -11,7 +11,7 @@ class CPseudoGigant : public CBaseMonster, typedef CControlledEntity CControlled; private: - xr_vector m_nearest; + xr_vector m_nearest; // step_effector struct { diff --git a/src/xrGame/ai/monsters/pseudogigant/pseudogigant_state_manager.h b/src/xrGame/ai/monsters/pseudogigant/pseudogigant_state_manager.h index cac19f1b7ee..0e6e30d0877 100644 --- a/src/xrGame/ai/monsters/pseudogigant/pseudogigant_state_manager.h +++ b/src/xrGame/ai/monsters/pseudogigant/pseudogigant_state_manager.h @@ -9,5 +9,5 @@ class CStateManagerGigant : public CMonsterStateManager { CStateManagerGigant (CPseudoGigant *monster); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/monsters/psy_aura.h b/src/xrGame/ai/monsters/psy_aura.h index a781e45f870..0cfb88729df 100644 --- a/src/xrGame/ai/monsters/psy_aura.h +++ b/src/xrGame/ai/monsters/psy_aura.h @@ -19,7 +19,7 @@ class CPsyAura : public Feel::Touch, public CEnergyHolder { virtual ~CPsyAura (); void init_external (CBaseMonster *obj) {m_object = obj;} - virtual bool feel_touch_contact (CObject* O){return FALSE;} + virtual bool feel_touch_contact (IGameObject* O){return FALSE;} virtual void schedule_update (); virtual void process_objects_in_aura () {} diff --git a/src/xrGame/ai/monsters/rats/ai_rat.cpp b/src/xrGame/ai/monsters/rats/ai_rat.cpp index 057a4698aa7..7ff4bd79d8f 100644 --- a/src/xrGame/ai/monsters/rats/ai_rat.cpp +++ b/src/xrGame/ai/monsters/rats/ai_rat.cpp @@ -125,7 +125,7 @@ void CAI_Rat::reload (LPCSTR section) sound().add (pSettings->r_string(section,"sound_eat"), 100, SOUND_TYPE_MONSTER_EATING , 3, u32(eRatSoundMaskEat), eRatSoundEat, head_bone_name); } -void CAI_Rat::Die(CObject* who) +void CAI_Rat::Die(IGameObject* who) { inherited::Die(who); @@ -516,7 +516,7 @@ void CAI_Rat::UpdatePositionAnimation() SelectAnimation (XFORM().k,Fvector().set(1,0,0),m_fSpeed); } -//void CAI_Rat::Hit(float P,Fvector &dir,CObject*who,s16 element,Fvector p_in_object_space,float impulse, ALife::EHitType hit_type /*= ALife::eHitTypeWound*/) +//void CAI_Rat::Hit(float P,Fvector &dir,IGameObject*who,s16 element,Fvector p_in_object_space,float impulse, ALife::EHitType hit_type /*= ALife::eHitTypeWound*/) void CAI_Rat::Hit (SHit* pHDS) { // inherited::Hit (P,dir,who,element,p_in_object_space,impulse, hit_type); @@ -533,7 +533,7 @@ void CAI_Rat::Hit (SHit* pHDS) } } -void CAI_Rat::feel_touch_new(CObject* O) +void CAI_Rat::feel_touch_new(IGameObject* O) { } @@ -651,7 +651,7 @@ void CAI_Rat::activate_physic_shell () void CAI_Rat::on_activate_physic_shell () { - CObject *object = smart_cast(H_Parent()); + IGameObject *object = smart_cast(H_Parent()); R_ASSERT (object); XFORM().set (object->XFORM()); inherited::activate_physic_shell(); diff --git a/src/xrGame/ai/monsters/rats/ai_rat.h b/src/xrGame/ai/monsters/rats/ai_rat.h index ba867935bac..14940b2ea0b 100644 --- a/src/xrGame/ai/monsters/rats/ai_rat.h +++ b/src/xrGame/ai/monsters/rats/ai_rat.h @@ -366,16 +366,16 @@ class CAI_Rat : public CCustomMonster, public CEatableItem virtual void net_Destroy (); virtual void net_Export (NET_Packet& P); virtual void net_Import (NET_Packet& P); - virtual void HitSignal (float amount, Fvector& vLocalDir, CObject* who, s16 element); - virtual void Die (CObject* who); + virtual void HitSignal (float amount, Fvector& vLocalDir, IGameObject* who, s16 element); + virtual void Die (IGameObject* who); virtual void Load (LPCSTR section); virtual void Think (); virtual void SelectAnimation (const Fvector& _view, const Fvector& _move, float speed ); virtual void Exec_Action (float dt); - virtual void feel_sound_new (CObject* who, int type, CSound_UserDataPtr user_data, const Fvector &Position, float power); - virtual void feel_touch_new (CObject* O); - virtual bool feel_touch_on_contact (CObject* O); - virtual bool feel_vision_isRelevant(CObject*); + virtual void feel_sound_new (IGameObject* who, int type, CSound_UserDataPtr user_data, const Fvector &Position, float power); + virtual void feel_touch_new (IGameObject* O); + virtual bool feel_touch_on_contact (IGameObject* O); + virtual bool feel_vision_isRelevant(IGameObject*); virtual void shedule_Update (u32 dt); virtual void UpdateCL (); virtual void Hit (SHit* pHDS); diff --git a/src/xrGame/ai/monsters/rats/ai_rat_feel.cpp b/src/xrGame/ai/monsters/rats/ai_rat_feel.cpp index db166210317..034ac386310 100644 --- a/src/xrGame/ai/monsters/rats/ai_rat_feel.cpp +++ b/src/xrGame/ai/monsters/rats/ai_rat_feel.cpp @@ -12,7 +12,7 @@ #include "enemy_manager.h" #include "xrServerEntities/ai_sounds.h" -bool CAI_Rat::feel_vision_isRelevant(CObject* O) +bool CAI_Rat::feel_vision_isRelevant(IGameObject* O) { CEntityAlive* E = smart_cast (O); if (!E) return false; @@ -20,7 +20,7 @@ bool CAI_Rat::feel_vision_isRelevant(CObject* O) return true; } -void CAI_Rat::feel_sound_new(CObject* who, int eType, CSound_UserDataPtr user_data, const Fvector &Position, float power) +void CAI_Rat::feel_sound_new(IGameObject* who, int eType, CSound_UserDataPtr user_data, const Fvector &Position, float power) { if (!g_Alive()) return; @@ -49,7 +49,7 @@ void CAI_Rat::feel_sound_new(CObject* who, int eType, CSound_UserDataPtr user_da inherited::feel_sound_new (who,eType,user_data,Position,power); } -bool CAI_Rat::feel_touch_on_contact (CObject *O) +bool CAI_Rat::feel_touch_on_contact (IGameObject *O) { return (inherited::feel_touch_on_contact(O)); } diff --git a/src/xrGame/ai/monsters/rats/ai_rat_fire.cpp b/src/xrGame/ai/monsters/rats/ai_rat_fire.cpp index 14c329c9ba8..0bf825ba4b2 100644 --- a/src/xrGame/ai/monsters/rats/ai_rat_fire.cpp +++ b/src/xrGame/ai/monsters/rats/ai_rat_fire.cpp @@ -67,7 +67,7 @@ void CAI_Rat::Exec_Action(float /**dt/**/) } } -void CAI_Rat::HitSignal(float amount, Fvector& vLocalDir, CObject* who, s16 /**element/**/) +void CAI_Rat::HitSignal(float amount, Fvector& vLocalDir, IGameObject* who, s16 /**element/**/) { // Save event Fvector D; diff --git a/src/xrGame/ai/monsters/rats/ai_rat_templates.cpp b/src/xrGame/ai/monsters/rats/ai_rat_templates.cpp index 6c062d07c84..03edb4c66bc 100644 --- a/src/xrGame/ai/monsters/rats/ai_rat_templates.cpp +++ b/src/xrGame/ai/monsters/rats/ai_rat_templates.cpp @@ -422,7 +422,7 @@ void CAI_Rat::select_next_home_position () bool CAI_Rat::can_stand_in_position() { - xr_vector tpNearestList ; + xr_vector tpNearestList ; //float m_radius = Radius(); Level().ObjectSpace.GetNearest (tpNearestList, Position(), 0.2f, this) ; if (tpNearestList.empty()) @@ -435,8 +435,8 @@ bool CAI_Rat::can_stand_in_position() M.c = C2; MagicBox3 box(M,d); - xr_vector::iterator I = tpNearestList.begin(); - xr_vector::iterator E = tpNearestList.end(); + xr_vector::iterator I = tpNearestList.begin(); + xr_vector::iterator E = tpNearestList.end(); for ( ; I != E; ++I) { if (!smart_cast(*I)) continue; @@ -454,9 +454,9 @@ bool CAI_Rat::can_stand_in_position() bool CAI_Rat::can_stand_here () { - xr_vector tpNearestList ; + xr_vector tpNearestList ; Level().ObjectSpace.GetNearest (tpNearestList, Position(),Radius(),this) ; - //xr_vector &tpNearestList = Level().ObjectSpace.q_nearest; + //xr_vector &tpNearestList = Level().ObjectSpace.q_nearest; if (tpNearestList.empty()) return (true); @@ -467,8 +467,8 @@ bool CAI_Rat::can_stand_here () M.c = C2; MagicBox3 box(M,d); - xr_vector::iterator I = tpNearestList.begin(); - xr_vector::iterator E = tpNearestList.end(); + xr_vector::iterator I = tpNearestList.begin(); + xr_vector::iterator E = tpNearestList.end(); for ( ; I != E; ++I) { if (!smart_cast(*I)) continue; diff --git a/src/xrGame/ai/monsters/scanning_ability.h b/src/xrGame/ai/monsters/scanning_ability.h index f1439401fe5..1927c594072 100644 --- a/src/xrGame/ai/monsters/scanning_ability.h +++ b/src/xrGame/ai/monsters/scanning_ability.h @@ -48,7 +48,7 @@ class CScanningAbility { virtual void on_scanning () {} private: - float get_velocity (CObject *obj); + float get_velocity (IGameObject *obj); #ifdef DEBUG public: diff --git a/src/xrGame/ai/monsters/scanning_ability_inline.h b/src/xrGame/ai/monsters/scanning_ability_inline.h index 3e360f63373..71d00e1ef0f 100644 --- a/src/xrGame/ai/monsters/scanning_ability_inline.h +++ b/src/xrGame/ai/monsters/scanning_ability_inline.h @@ -129,7 +129,7 @@ void CScanningAbilityAbstract::frame_update(u32 dt) TEMPLATE_SPECIALIZATION -float CScanningAbilityAbstract::get_velocity(CObject *obj) +float CScanningAbilityAbstract::get_velocity(IGameObject *obj) { CActor *actor = smart_cast(obj); return (actor->character_physics_support()->movement()->GetVelocityActual()); diff --git a/src/xrGame/ai/monsters/snork/snork.cpp b/src/xrGame/ai/monsters/snork/snork.cpp index 29d1d146789..ccfbe585027 100644 --- a/src/xrGame/ai/monsters/snork/snork.cpp +++ b/src/xrGame/ai/monsters/snork/snork.cpp @@ -110,7 +110,7 @@ void CSnork::UpdateCL() inherited::UpdateCL (); ////////////////////////////////////////////////////////////////////////// - //CObject *obj = Level().CurrentEntity(); + //IGameObject *obj = Level().CurrentEntity(); //if (!obj) return; //find_geometry (); @@ -118,7 +118,7 @@ void CSnork::UpdateCL() #ifdef _DEBUG // test - CObject *obj = Level().CurrentEntity(); + IGameObject *obj = Level().CurrentEntity(); if (!obj) return; const CCoverPoint *point = CoverMan->find_cover(obj->Position(), 10.f, 30.f); diff --git a/src/xrGame/ai/monsters/snork/snork_jump.cpp b/src/xrGame/ai/monsters/snork/snork_jump.cpp index d5dacb07f98..384a2e45691 100644 --- a/src/xrGame/ai/monsters/snork/snork_jump.cpp +++ b/src/xrGame/ai/monsters/snork/snork_jump.cpp @@ -60,8 +60,8 @@ // //void CSnorkJump::try_to_jump(u32 velocity_mask) //{ -// //CObject *target = const_cast(m_object->EnemyMan.get_enemy()); -// CObject *target = Level().CurrentEntity(); +// //IGameObject *target = const_cast(m_object->EnemyMan.get_enemy()); +// IGameObject *target = Level().CurrentEntity(); // if (!target) return; // // m_specific_jump = false; diff --git a/src/xrGame/ai/monsters/snork/snork_jump.h b/src/xrGame/ai/monsters/snork/snork_jump.h index 65a81837bbe..7f7b7e8f0f1 100644 --- a/src/xrGame/ai/monsters/snork/snork_jump.h +++ b/src/xrGame/ai/monsters/snork/snork_jump.h @@ -10,7 +10,7 @@ class CSnorkJump { float m_cur_dist; bool m_specific_jump; - CObject *m_target_object; + IGameObject *m_target_object; u32 m_velocity_mask; public: diff --git a/src/xrGame/ai/monsters/snork/snork_state_manager.h b/src/xrGame/ai/monsters/snork/snork_state_manager.h index 1c7e20cd4d0..c90cb1a7bca 100644 --- a/src/xrGame/ai/monsters/snork/snork_state_manager.h +++ b/src/xrGame/ai/monsters/snork/snork_state_manager.h @@ -13,5 +13,5 @@ class CStateManagerSnork : public CMonsterStateManager virtual ~CStateManagerSnork (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/monsters/state.h b/src/xrGame/ai/monsters/state.h index c81ec35a2b1..be5fdb6850f 100644 --- a/src/xrGame/ai/monsters/state.h +++ b/src/xrGame/ai/monsters/state.h @@ -16,7 +16,7 @@ class CState { virtual ~CState (); virtual void reinit (); - virtual void remove_links (CObject* object) = 0; + virtual void remove_links (IGameObject* object) = 0; virtual void initialize (); virtual void execute (); diff --git a/src/xrGame/ai/monsters/state_inline.h b/src/xrGame/ai/monsters/state_inline.h index 9759371d838..4debf7437f3 100644 --- a/src/xrGame/ai/monsters/state_inline.h +++ b/src/xrGame/ai/monsters/state_inline.h @@ -208,7 +208,7 @@ EMonsterState CStateAbstract::get_state_type() } TEMPLATE_SPECIALIZATION -void CStateAbstract::remove_links (CObject* object) +void CStateAbstract::remove_links (IGameObject* object) { SubStates::iterator i = substates.begin(); SubStates::iterator e = substates.end(); diff --git a/src/xrGame/ai/monsters/state_manager.h b/src/xrGame/ai/monsters/state_manager.h index f9265af18bd..7f0e8c8f892 100644 --- a/src/xrGame/ai/monsters/state_manager.h +++ b/src/xrGame/ai/monsters/state_manager.h @@ -15,7 +15,7 @@ class IStateManagerBase { virtual void force_script_state (EMonsterState state) = 0; virtual void execute_script_state () = 0; virtual void critical_finalize () = 0; - virtual void remove_links (CObject *O) = 0; + virtual void remove_links (IGameObject *O) = 0; virtual EMonsterState get_state_type () = 0; virtual bool check_control_start_conditions (ControlCom::EControlType type) = 0; diff --git a/src/xrGame/ai/monsters/states/monster_state_attack.h b/src/xrGame/ai/monsters/states/monster_state_attack.h index 718a587fcb9..15b45e27d73 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack.h @@ -22,7 +22,7 @@ class CStateMonsterAttack : public CState<_Object> { virtual void initialize (); virtual void execute (); virtual void setup_substates (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} protected: bool check_steal_state (); diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_camp.h b/src/xrGame/ai/monsters/states/monster_state_attack_camp.h index 89a6b9e5429..3a6fb5f3a09 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_camp.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_camp.h @@ -14,7 +14,7 @@ class CStateMonsterAttackCamp : public CState<_Object> { virtual void initialize (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); virtual bool check_start_conditions (); diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_camp_stealout.h b/src/xrGame/ai/monsters/states/monster_state_attack_camp_stealout.h index 27ea021591c..80146eaf249 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_camp_stealout.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_camp_stealout.h @@ -11,7 +11,7 @@ class CStateMonsterAttackCampStealOut : public CStateMove<_Object> { virtual void execute (); virtual bool check_completion (); virtual bool check_start_conditions (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_attack_camp_stealout_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_melee.h b/src/xrGame/ai/monsters/states/monster_state_attack_melee.h index 4c38bd54e14..5ba1082caca 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_melee.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_melee.h @@ -14,7 +14,7 @@ class CStateMonsterAttackMelee : public CState<_Object> { virtual bool check_completion (); virtual bool check_start_conditions (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_attack_melee_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_on_run.h b/src/xrGame/ai/monsters/states/monster_state_attack_on_run.h index d1ad950d4d4..ae8122af8c9 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_on_run.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_on_run.h @@ -19,7 +19,7 @@ class CStateMonsterAttackOnRun : public CState<_Object> { virtual void execute (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); virtual bool check_start_conditions (); diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_run.h b/src/xrGame/ai/monsters/states/monster_state_attack_run.h index 5a2f1c27844..a258249536a 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_run.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_run.h @@ -15,7 +15,7 @@ class CStateMonsterAttackRun : public CState<_Object> { virtual void execute (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); virtual bool check_start_conditions (); diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_run_attack.h b/src/xrGame/ai/monsters/states/monster_state_attack_run_attack.h index e7b4fae56a7..64878639f6f 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_run_attack.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_run_attack.h @@ -12,7 +12,7 @@ class CStateMonsterAttackRunAttack : public CState<_Object> { virtual void execute (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); virtual bool check_start_conditions (); diff --git a/src/xrGame/ai/monsters/states/monster_state_controlled.h b/src/xrGame/ai/monsters/states/monster_state_controlled.h index f96b5ee89a1..2680b2cffc1 100644 --- a/src/xrGame/ai/monsters/states/monster_state_controlled.h +++ b/src/xrGame/ai/monsters/states/monster_state_controlled.h @@ -9,7 +9,7 @@ class CStateMonsterControlled : public CState<_Object> { public: CStateMonsterControlled (_Object *obj); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_controlled_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_controlled_follow.h b/src/xrGame/ai/monsters/states/monster_state_controlled_follow.h index 6403f0ef2e1..e339f7698f4 100644 --- a/src/xrGame/ai/monsters/states/monster_state_controlled_follow.h +++ b/src/xrGame/ai/monsters/states/monster_state_controlled_follow.h @@ -11,7 +11,7 @@ class CStateMonsterControlledFollow : public CState<_Object> { CStateMonsterControlledFollow (_Object *obj); virtual void reselect_state (); virtual void setup_substates (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_controlled_follow_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_eat.h b/src/xrGame/ai/monsters/states/monster_state_eat.h index d836e7bd942..65a3eabf486 100644 --- a/src/xrGame/ai/monsters/states/monster_state_eat.h +++ b/src/xrGame/ai/monsters/states/monster_state_eat.h @@ -20,7 +20,7 @@ class CStateMonsterEat : public CState<_Object> { virtual void initialize (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object); + virtual void remove_links (IGameObject* object); virtual void reselect_state (); virtual void setup_substates (); diff --git a/src/xrGame/ai/monsters/states/monster_state_eat_drag.h b/src/xrGame/ai/monsters/states/monster_state_eat_drag.h index 7bd514fa3da..34ac1ba809a 100644 --- a/src/xrGame/ai/monsters/states/monster_state_eat_drag.h +++ b/src/xrGame/ai/monsters/states/monster_state_eat_drag.h @@ -18,7 +18,7 @@ class CStateMonsterDrag : public CState<_Object> { virtual void execute (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); }; diff --git a/src/xrGame/ai/monsters/states/monster_state_eat_eat.h b/src/xrGame/ai/monsters/states/monster_state_eat_eat.h index a29da15d955..ff91a19b1e8 100644 --- a/src/xrGame/ai/monsters/states/monster_state_eat_eat.h +++ b/src/xrGame/ai/monsters/states/monster_state_eat_eat.h @@ -15,7 +15,7 @@ class CStateMonsterEating : public CState<_Object> { virtual void initialize (); virtual void execute (); - virtual void remove_links (CObject* object); + virtual void remove_links (IGameObject* object); virtual bool check_start_conditions (); virtual bool check_completion (); diff --git a/src/xrGame/ai/monsters/states/monster_state_eat_eat_inline.h b/src/xrGame/ai/monsters/states/monster_state_eat_eat_inline.h index 6a5b075342b..a2660984d4f 100644 --- a/src/xrGame/ai/monsters/states/monster_state_eat_eat_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_eat_eat_inline.h @@ -78,7 +78,7 @@ bool CStateMonsterEatingAbstract::check_completion() } TEMPLATE_SPECIALIZATION -void CStateMonsterEatingAbstract::remove_links (CObject* object) +void CStateMonsterEatingAbstract::remove_links (IGameObject* object) { if (corpse == object) corpse = 0; diff --git a/src/xrGame/ai/monsters/states/monster_state_eat_inline.h b/src/xrGame/ai/monsters/states/monster_state_eat_inline.h index 2ceedf50850..674cc38024f 100644 --- a/src/xrGame/ai/monsters/states/monster_state_eat_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_eat_inline.h @@ -259,7 +259,7 @@ bool CStateMonsterEatAbstract::hungry() } TEMPLATE_SPECIALIZATION -void CStateMonsterEatAbstract::remove_links (CObject* object) +void CStateMonsterEatAbstract::remove_links (IGameObject* object) { if (corpse == object) corpse = 0; diff --git a/src/xrGame/ai/monsters/states/monster_state_find_enemy.h b/src/xrGame/ai/monsters/states/monster_state_find_enemy.h index e0346829b6d..5cddafdb0ed 100644 --- a/src/xrGame/ai/monsters/states/monster_state_find_enemy.h +++ b/src/xrGame/ai/monsters/states/monster_state_find_enemy.h @@ -12,7 +12,7 @@ class CStateMonsterFindEnemy : public CState<_Object> { public: CStateMonsterFindEnemy (_Object *obj); virtual ~CStateMonsterFindEnemy (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual void reselect_state (); }; diff --git a/src/xrGame/ai/monsters/states/monster_state_find_enemy_angry.h b/src/xrGame/ai/monsters/states/monster_state_find_enemy_angry.h index 971792fb118..4cdd6013dd4 100644 --- a/src/xrGame/ai/monsters/states/monster_state_find_enemy_angry.h +++ b/src/xrGame/ai/monsters/states/monster_state_find_enemy_angry.h @@ -12,7 +12,7 @@ class CStateMonsterFindEnemyAngry : public CState<_Object> { virtual void execute (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_find_enemy_angry_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_find_enemy_look.h b/src/xrGame/ai/monsters/states/monster_state_find_enemy_look.h index f10c9d8343a..731c3d8da27 100644 --- a/src/xrGame/ai/monsters/states/monster_state_find_enemy_look.h +++ b/src/xrGame/ai/monsters/states/monster_state_find_enemy_look.h @@ -27,7 +27,7 @@ class CStateMonsterFindEnemyLook : public CState<_Object> { virtual void initialize (); virtual void reselect_state (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual void setup_substates (); }; diff --git a/src/xrGame/ai/monsters/states/monster_state_find_enemy_run.h b/src/xrGame/ai/monsters/states/monster_state_find_enemy_run.h index 1c08ef5307e..87679443e1f 100644 --- a/src/xrGame/ai/monsters/states/monster_state_find_enemy_run.h +++ b/src/xrGame/ai/monsters/states/monster_state_find_enemy_run.h @@ -16,7 +16,7 @@ class CStateMonsterFindEnemyRun : public CState<_Object> { virtual void initialize (); virtual void execute (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_find_enemy_run_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_find_enemy_walk.h b/src/xrGame/ai/monsters/states/monster_state_find_enemy_walk.h index 36568684671..3fa136802b5 100644 --- a/src/xrGame/ai/monsters/states/monster_state_find_enemy_walk.h +++ b/src/xrGame/ai/monsters/states/monster_state_find_enemy_walk.h @@ -10,7 +10,7 @@ class CStateMonsterFindEnemyWalkAround : public CState<_Object> { CStateMonsterFindEnemyWalkAround (_Object *obj) : inherited(obj) {} virtual void execute (); virtual bool check_completion () {return false;} - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_find_enemy_walk_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_hear_danger_sound.h b/src/xrGame/ai/monsters/states/monster_state_hear_danger_sound.h index 6362c52ab3c..225f7333598 100644 --- a/src/xrGame/ai/monsters/states/monster_state_hear_danger_sound.h +++ b/src/xrGame/ai/monsters/states/monster_state_hear_danger_sound.h @@ -14,7 +14,7 @@ class CStateMonsterHearDangerousSound : public CState<_Object> { virtual void reselect_state (); virtual void setup_substates (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_hear_danger_sound_inline.h" \ No newline at end of file diff --git a/src/xrGame/ai/monsters/states/monster_state_hear_int_sound.h b/src/xrGame/ai/monsters/states/monster_state_hear_int_sound.h index 1e8869c2e2c..26a1fa4100a 100644 --- a/src/xrGame/ai/monsters/states/monster_state_hear_int_sound.h +++ b/src/xrGame/ai/monsters/states/monster_state_hear_int_sound.h @@ -14,7 +14,7 @@ class CStateMonsterHearInterestingSound : public CState<_Object> { virtual void reselect_state (); virtual void setup_substates (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} private: Fvector get_target_position (); diff --git a/src/xrGame/ai/monsters/states/monster_state_help_sound.h b/src/xrGame/ai/monsters/states/monster_state_help_sound.h index cf317b68487..880b12c055a 100644 --- a/src/xrGame/ai/monsters/states/monster_state_help_sound.h +++ b/src/xrGame/ai/monsters/states/monster_state_help_sound.h @@ -18,7 +18,7 @@ class CStateMonsterHearHelpSound : public CState<_Object> { virtual bool check_start_conditions (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_help_sound_inline.h" \ No newline at end of file diff --git a/src/xrGame/ai/monsters/states/monster_state_hitted.h b/src/xrGame/ai/monsters/states/monster_state_hitted.h index 189098ee713..0c0471cc3bc 100644 --- a/src/xrGame/ai/monsters/states/monster_state_hitted.h +++ b/src/xrGame/ai/monsters/states/monster_state_hitted.h @@ -13,7 +13,7 @@ class CStateMonsterHitted : public CState<_Object> { virtual ~CStateMonsterHitted (); virtual void reselect_state (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_hitted_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_hitted_hide.h b/src/xrGame/ai/monsters/states/monster_state_hitted_hide.h index 9b9e0c32430..5f3e435e9f6 100644 --- a/src/xrGame/ai/monsters/states/monster_state_hitted_hide.h +++ b/src/xrGame/ai/monsters/states/monster_state_hitted_hide.h @@ -12,7 +12,7 @@ class CStateMonsterHittedHide : public CState<_Object> { virtual void initialize (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); virtual bool check_start_conditions (); diff --git a/src/xrGame/ai/monsters/states/monster_state_hitted_moveout.h b/src/xrGame/ai/monsters/states/monster_state_hitted_moveout.h index aec3bedc56b..5346b1ceee9 100644 --- a/src/xrGame/ai/monsters/states/monster_state_hitted_moveout.h +++ b/src/xrGame/ai/monsters/states/monster_state_hitted_moveout.h @@ -20,7 +20,7 @@ class CStateMonsterHittedMoveOut : public CState<_Object> { virtual void initialize (); virtual void execute (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} private: void select_target (); diff --git a/src/xrGame/ai/monsters/states/monster_state_home_point_attack.h b/src/xrGame/ai/monsters/states/monster_state_home_point_attack.h index b92190db9c3..bd33bacdd4d 100644 --- a/src/xrGame/ai/monsters/states/monster_state_home_point_attack.h +++ b/src/xrGame/ai/monsters/states/monster_state_home_point_attack.h @@ -19,7 +19,7 @@ class CStateMonsterAttackMoveToHomePoint : public CState<_Object> { virtual void finalize (); virtual void critical_finalize (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_start_conditions (); virtual bool check_completion (); diff --git a/src/xrGame/ai/monsters/states/monster_state_home_point_danger.h b/src/xrGame/ai/monsters/states/monster_state_home_point_danger.h index 5c8050309b3..f02198ef4e1 100644 --- a/src/xrGame/ai/monsters/states/monster_state_home_point_danger.h +++ b/src/xrGame/ai/monsters/states/monster_state_home_point_danger.h @@ -19,7 +19,7 @@ class CStateMonsterDangerMoveToHomePoint : public CState<_Object> { virtual bool check_start_conditions (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual void reselect_state (); virtual void setup_substates (); diff --git a/src/xrGame/ai/monsters/states/monster_state_home_point_rest.h b/src/xrGame/ai/monsters/states/monster_state_home_point_rest.h index aff925b7976..65d158a835a 100644 --- a/src/xrGame/ai/monsters/states/monster_state_home_point_rest.h +++ b/src/xrGame/ai/monsters/states/monster_state_home_point_rest.h @@ -15,7 +15,7 @@ class CStateMonsterRestMoveToHomePoint : public CStateMove<_Object> { virtual void execute (); virtual bool check_start_conditions (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_home_point_rest_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_panic.h b/src/xrGame/ai/monsters/states/monster_state_panic.h index cd70d750ef2..759026bce48 100644 --- a/src/xrGame/ai/monsters/states/monster_state_panic.h +++ b/src/xrGame/ai/monsters/states/monster_state_panic.h @@ -15,7 +15,7 @@ class CStateMonsterPanic : public CState<_Object> { virtual void reselect_state (); virtual void check_force_state (); virtual void setup_substates (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_panic_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_panic_run.h b/src/xrGame/ai/monsters/states/monster_state_panic_run.h index 2add0d00aba..c636338c6e9 100644 --- a/src/xrGame/ai/monsters/states/monster_state_panic_run.h +++ b/src/xrGame/ai/monsters/states/monster_state_panic_run.h @@ -10,7 +10,7 @@ class CStateMonsterPanicRun : public CState<_Object> { virtual void initialize (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); }; diff --git a/src/xrGame/ai/monsters/states/monster_state_rest.h b/src/xrGame/ai/monsters/states/monster_state_rest.h index c2b2f2cb1a5..28b0a85404b 100644 --- a/src/xrGame/ai/monsters/states/monster_state_rest.h +++ b/src/xrGame/ai/monsters/states/monster_state_rest.h @@ -20,7 +20,7 @@ class CStateMonsterRest : public CState<_Object> { virtual void execute (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_rest_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_rest_fun.h b/src/xrGame/ai/monsters/states/monster_state_rest_fun.h index cb24a1da416..9d43afc3af9 100644 --- a/src/xrGame/ai/monsters/states/monster_state_rest_fun.h +++ b/src/xrGame/ai/monsters/states/monster_state_rest_fun.h @@ -15,7 +15,7 @@ class CStateMonsterRestFun : public CState<_Object> { virtual void execute (); virtual bool check_completion (); virtual bool check_start_conditions (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_rest_fun_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_rest_idle.h b/src/xrGame/ai/monsters/states/monster_state_rest_idle.h index 4a68d91ca96..fef6075e071 100644 --- a/src/xrGame/ai/monsters/states/monster_state_rest_idle.h +++ b/src/xrGame/ai/monsters/states/monster_state_rest_idle.h @@ -14,7 +14,7 @@ class CStateMonsterRestIdle : public CState<_Object> { virtual void initialize (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual void reselect_state (); virtual void setup_substates (); diff --git a/src/xrGame/ai/monsters/states/monster_state_rest_sleep.h b/src/xrGame/ai/monsters/states/monster_state_rest_sleep.h index 8a3730f526b..d0d78804896 100644 --- a/src/xrGame/ai/monsters/states/monster_state_rest_sleep.h +++ b/src/xrGame/ai/monsters/states/monster_state_rest_sleep.h @@ -14,7 +14,7 @@ class CStateMonsterRestSleep : public CState<_Object> { virtual void execute (); virtual void finalize (); virtual void critical_finalize (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_rest_sleep_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_rest_walk_graph.h b/src/xrGame/ai/monsters/states/monster_state_rest_walk_graph.h index 1ae5619f64c..0b5bd232010 100644 --- a/src/xrGame/ai/monsters/states/monster_state_rest_walk_graph.h +++ b/src/xrGame/ai/monsters/states/monster_state_rest_walk_graph.h @@ -10,7 +10,7 @@ class CStateMonsterRestWalkGraph : public CState<_Object> { virtual ~CStateMonsterRestWalkGraph (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_rest_walk_graph_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task.h b/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task.h index 405f121d513..c883d7fb1ef 100644 --- a/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task.h +++ b/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task.h @@ -18,7 +18,7 @@ class CStateMonsterSmartTerrainTask : public CState<_Object> { virtual bool check_completion (); virtual void setup_substates (); virtual void check_force_state (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_smart_terrain_task_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task_graph_walk.h b/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task_graph_walk.h index 935a05542be..d02203ceaab 100644 --- a/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task_graph_walk.h +++ b/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task_graph_walk.h @@ -13,7 +13,7 @@ class CStateMonsterSmartTerrainTaskGraphWalk : public CStateMove<_Object> { virtual void execute (); virtual bool check_start_conditions (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_smart_terrain_task_graph_walk_inline.h" \ No newline at end of file diff --git a/src/xrGame/ai/monsters/states/monster_state_squad_rest.h b/src/xrGame/ai/monsters/states/monster_state_squad_rest.h index 4779e255f58..ab4e6f5d9cf 100644 --- a/src/xrGame/ai/monsters/states/monster_state_squad_rest.h +++ b/src/xrGame/ai/monsters/states/monster_state_squad_rest.h @@ -16,7 +16,7 @@ class CStateMonsterSquadRest : public CState<_Object> { virtual void reselect_state (); virtual void setup_substates (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_squad_rest_inline.h" \ No newline at end of file diff --git a/src/xrGame/ai/monsters/states/monster_state_squad_rest_follow.h b/src/xrGame/ai/monsters/states/monster_state_squad_rest_follow.h index 76ed573a5aa..36755780dba 100644 --- a/src/xrGame/ai/monsters/states/monster_state_squad_rest_follow.h +++ b/src/xrGame/ai/monsters/states/monster_state_squad_rest_follow.h @@ -18,7 +18,7 @@ class CStateMonsterSquadRestFollow : public CState<_Object> { virtual void reselect_state (); virtual void setup_substates (); virtual void check_force_state (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "monster_state_squad_rest_follow_inline.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_steal.h b/src/xrGame/ai/monsters/states/monster_state_steal.h index 74e28699e4e..8b6b03f567a 100644 --- a/src/xrGame/ai/monsters/states/monster_state_steal.h +++ b/src/xrGame/ai/monsters/states/monster_state_steal.h @@ -10,7 +10,7 @@ class CStateMonsterSteal : public CState<_Object> { virtual void initialize (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); virtual bool check_start_conditions (); diff --git a/src/xrGame/ai/monsters/states/state_custom_action.h b/src/xrGame/ai/monsters/states/state_custom_action.h index f40e15a90e8..52a5e37c52e 100644 --- a/src/xrGame/ai/monsters/states/state_custom_action.h +++ b/src/xrGame/ai/monsters/states/state_custom_action.h @@ -14,7 +14,7 @@ class CStateMonsterCustomAction : public CState<_Object> { virtual void execute (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "state_custom_action_inline.h" \ No newline at end of file diff --git a/src/xrGame/ai/monsters/states/state_custom_action_look.h b/src/xrGame/ai/monsters/states/state_custom_action_look.h index d10b2d348c4..747551f4525 100644 --- a/src/xrGame/ai/monsters/states/state_custom_action_look.h +++ b/src/xrGame/ai/monsters/states/state_custom_action_look.h @@ -14,7 +14,7 @@ class CStateMonsterCustomActionLook : public CState<_Object> { virtual void execute (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "state_custom_action_look_inline.h" \ No newline at end of file diff --git a/src/xrGame/ai/monsters/states/state_hide_from_point.h b/src/xrGame/ai/monsters/states/state_hide_from_point.h index 7841d7b0a99..6642c98367e 100644 --- a/src/xrGame/ai/monsters/states/state_hide_from_point.h +++ b/src/xrGame/ai/monsters/states/state_hide_from_point.h @@ -14,7 +14,7 @@ class CStateMonsterHideFromPoint : public CState<_Object> { virtual void initialize (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); diff --git a/src/xrGame/ai/monsters/states/state_hit_object.h b/src/xrGame/ai/monsters/states/state_hit_object.h index d6985845b22..446f91c77fe 100644 --- a/src/xrGame/ai/monsters/states/state_hit_object.h +++ b/src/xrGame/ai/monsters/states/state_hit_object.h @@ -5,7 +5,7 @@ template class CStateMonsterHitObject : public CState<_Object> { typedef CState<_Object> inherited; - xr_vector m_nearest_objects; + xr_vector m_nearest_objects; CPhysicsShellHolder *target; bool m_hitted; diff --git a/src/xrGame/ai/monsters/states/state_hit_object_inline.h b/src/xrGame/ai/monsters/states/state_hit_object_inline.h index fa2b21987b5..2b707a7e893 100644 --- a/src/xrGame/ai/monsters/states/state_hit_object_inline.h +++ b/src/xrGame/ai/monsters/states/state_hit_object_inline.h @@ -45,10 +45,10 @@ bool CStateMonsterHitObjectAbstract::check_start_conditions() m_nearest_objects.clear_not_free (); Level().ObjectSpace.GetNearest (m_nearest_objects,object->Position(), object->Radius() - 0.5f, object()); - xr_vector::iterator B = m_nearest_objects.begin(); - xr_vector::iterator E = m_nearest_objects.end(); + xr_vector::iterator B = m_nearest_objects.begin(); + xr_vector::iterator E = m_nearest_objects.end(); - for (xr_vector::iterator I = B; I != E; I++) { + for (xr_vector::iterator I = B; I != E; I++) { CPhysicsShellHolder *obj = smart_cast(*I); if (!obj || !obj->m_pPhysicsShell) continue; diff --git a/src/xrGame/ai/monsters/states/state_look_point.h b/src/xrGame/ai/monsters/states/state_look_point.h index c186f555433..dec3d5e9863 100644 --- a/src/xrGame/ai/monsters/states/state_look_point.h +++ b/src/xrGame/ai/monsters/states/state_look_point.h @@ -14,7 +14,7 @@ class CStateMonsterLookToPoint : public CState<_Object> { virtual void initialize (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); }; diff --git a/src/xrGame/ai/monsters/states/state_look_unprotected_area.h b/src/xrGame/ai/monsters/states/state_look_unprotected_area.h index b0d6664a0e7..0553dd0e569 100644 --- a/src/xrGame/ai/monsters/states/state_look_unprotected_area.h +++ b/src/xrGame/ai/monsters/states/state_look_unprotected_area.h @@ -19,7 +19,7 @@ class CStateMonsterLookToUnprotectedArea : public CState<_Object> { virtual void initialize (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); }; diff --git a/src/xrGame/ai/monsters/states/state_move_to_point.h b/src/xrGame/ai/monsters/states/state_move_to_point.h index 0c7f2618ae4..a51aafe4d4f 100644 --- a/src/xrGame/ai/monsters/states/state_move_to_point.h +++ b/src/xrGame/ai/monsters/states/state_move_to_point.h @@ -14,7 +14,7 @@ class CStateMonsterMoveToPoint : public CState<_Object> { virtual void initialize (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} virtual bool check_completion (); @@ -35,7 +35,7 @@ class CStateMonsterMoveToPointEx : public CState<_Object> { virtual void initialize (); virtual void execute (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "state_move_to_point_inline.h" diff --git a/src/xrGame/ai/monsters/states/state_move_to_restrictor.h b/src/xrGame/ai/monsters/states/state_move_to_restrictor.h index c12cbf90236..d594a723239 100644 --- a/src/xrGame/ai/monsters/states/state_move_to_restrictor.h +++ b/src/xrGame/ai/monsters/states/state_move_to_restrictor.h @@ -14,7 +14,7 @@ class CStateMonsterMoveToRestrictor : public CState<_Object> { virtual bool check_start_conditions (); virtual bool check_completion (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "state_move_to_restrictor_inline.h" diff --git a/src/xrGame/ai/monsters/states/state_test_look_actor.h b/src/xrGame/ai/monsters/states/state_test_look_actor.h index 025e59c5170..11855e4ee0e 100644 --- a/src/xrGame/ai/monsters/states/state_test_look_actor.h +++ b/src/xrGame/ai/monsters/states/state_test_look_actor.h @@ -7,7 +7,7 @@ class CStateMonsterLookActor : public CState<_Object> { public: CStateMonsterLookActor (_Object *obj) : inherited(obj) {} virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/monsters/states/state_test_state.h b/src/xrGame/ai/monsters/states/state_test_state.h index a000a3c8f5e..ccd4c727eb8 100644 --- a/src/xrGame/ai/monsters/states/state_test_state.h +++ b/src/xrGame/ai/monsters/states/state_test_state.h @@ -10,7 +10,7 @@ class CStateMonsterTestState : public CState<_Object> { CStateMonsterTestState (_Object *obj); virtual void reselect_state (); virtual void setup_substates (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; template @@ -26,7 +26,7 @@ class CStateMonsterTestCover : public CState<_Object> { virtual void check_force_state (); virtual void reselect_state (); virtual void setup_substates (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; #include "state_test_state_inline.h" \ No newline at end of file diff --git a/src/xrGame/ai/monsters/telekinesis.cpp b/src/xrGame/ai/monsters/telekinesis.cpp index 6365724a788..b8161e779b6 100644 --- a/src/xrGame/ai/monsters/telekinesis.cpp +++ b/src/xrGame/ai/monsters/telekinesis.cpp @@ -224,7 +224,7 @@ u32 CTelekinesis::get_objects_count() } // объект был удален - удалить все связи на объект -void CTelekinesis::remove_links(CObject *O) +void CTelekinesis::remove_links(IGameObject *O) { remove_object(smart_cast(O)); } diff --git a/src/xrGame/ai/monsters/telekinesis.h b/src/xrGame/ai/monsters/telekinesis.h index 9875e07b690..fdd6c8d76c1 100644 --- a/src/xrGame/ai/monsters/telekinesis.h +++ b/src/xrGame/ai/monsters/telekinesis.h @@ -7,7 +7,7 @@ class CTelekinesis : public CPHUpdateObject { protected: DEFINE_VECTOR(CTelekineticObject*,TELE_OBJECTS,TELE_OBJECTS_IT); TELE_OBJECTS objects; - xr_vector m_nearest; + xr_vector m_nearest; bool active; public: @@ -63,7 +63,7 @@ CTelekineticObject get_object_by_index (u32 index) {VERIFY(objects.size() > inde void schedule_update (); // объект был удален - удалить все связи на объект - void remove_links (CObject *O); + void remove_links (IGameObject *O); protected: virtual CTelekineticObject* alloc_tele_object(){return xr_new();} diff --git a/src/xrGame/ai/monsters/telekinesis_inline.h b/src/xrGame/ai/monsters/telekinesis_inline.h index 0f1e7ca5e4d..f5106df4f7b 100644 --- a/src/xrGame/ai/monsters/telekinesis_inline.h +++ b/src/xrGame/ai/monsters/telekinesis_inline.h @@ -32,7 +32,7 @@ void CTelekinesis<_Object>::Activate() // получить список объектов m_nearest.clear_not_free (); Level().ObjectSpace.GetNearest (m_nearest,control_object->Position(),10.f); - //xr_vector &m_nearest = Level().ObjectSpace.q_nearest; + //xr_vector &m_nearest = Level().ObjectSpace.q_nearest; // все объекты внести в список for (u32 i = 0; i < m_nearest.size(); i++) { diff --git a/src/xrGame/ai/monsters/tushkano/tushkano_state_manager.h b/src/xrGame/ai/monsters/tushkano/tushkano_state_manager.h index 46cb9f5f89b..ecb769c7176 100644 --- a/src/xrGame/ai/monsters/tushkano/tushkano_state_manager.h +++ b/src/xrGame/ai/monsters/tushkano/tushkano_state_manager.h @@ -11,5 +11,5 @@ class CStateManagerTushkano : public CMonsterStateManager { virtual ~CStateManagerTushkano (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/monsters/zombie/zombie.cpp b/src/xrGame/ai/monsters/zombie/zombie.cpp index 943765f8798..1a31f5a9050 100644 --- a/src/xrGame/ai/monsters/zombie/zombie.cpp +++ b/src/xrGame/ai/monsters/zombie/zombie.cpp @@ -140,7 +140,7 @@ BOOL CZombie::net_Spawn (CSE_Abstract* DC) #define TIME_FAKE_DEATH 5000 #define TIME_RESURRECT_RESTORE 2000 -//void CZombie::Hit(float P,Fvector &dir,CObject*who,s16 element,Fvector p_in_object_space,float impulse, ALife::EHitType hit_type) +//void CZombie::Hit(float P,Fvector &dir,IGameObject*who,s16 element,Fvector p_in_object_space,float impulse, ALife::EHitType hit_type) void CZombie::Hit (SHit* pHDS) { // inherited::Hit(P,dir,who,element,p_in_object_space,impulse,hit_type); diff --git a/src/xrGame/ai/monsters/zombie/zombie_state_attack_run.h b/src/xrGame/ai/monsters/zombie/zombie_state_attack_run.h index c0167c9339d..bbaaf48966c 100644 --- a/src/xrGame/ai/monsters/zombie/zombie_state_attack_run.h +++ b/src/xrGame/ai/monsters/zombie/zombie_state_attack_run.h @@ -18,7 +18,7 @@ class CStateZombieAttackRun : public CState<_Object> { virtual bool check_completion (); virtual bool check_start_conditions (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} private: void choose_action (); diff --git a/src/xrGame/ai/monsters/zombie/zombie_state_manager.h b/src/xrGame/ai/monsters/zombie/zombie_state_manager.h index 2070ccd4da3..38bc96b193a 100644 --- a/src/xrGame/ai/monsters/zombie/zombie_state_manager.h +++ b/src/xrGame/ai/monsters/zombie/zombie_state_manager.h @@ -11,5 +11,5 @@ class CStateManagerZombie : public CMonsterStateManager { virtual ~CStateManagerZombie (); virtual void execute (); - virtual void remove_links (CObject* object) { inherited::remove_links(object);} + virtual void remove_links (IGameObject* object) { inherited::remove_links(object);} }; diff --git a/src/xrGame/ai/phantom/phantom.cpp b/src/xrGame/ai/phantom/phantom.cpp index d24559fadbd..c815448aaa9 100644 --- a/src/xrGame/ai/phantom/phantom.cpp +++ b/src/xrGame/ai/phantom/phantom.cpp @@ -254,7 +254,7 @@ void CPhantom::UpdateCL() if (m_TgtState!=m_CurState) SwitchToState_internal(m_TgtState); } //--------------------------------------------------------------------- -//void CPhantom::Hit (float P, Fvector &dir, CObject* who, s16 element,Fvector p_in_object_space, float impulse, ALife::EHitType hit_type) +//void CPhantom::Hit (float P, Fvector &dir, IGameObject* who, s16 element,Fvector p_in_object_space, float impulse, ALife::EHitType hit_type) void CPhantom::Hit (SHit* pHDS) { if (m_TgtState==stFly) SwitchToState(stShoot); @@ -299,7 +299,7 @@ void CPhantom::UpdatePosition(const Fvector& tgt_pos) Position().mad (prev_pos,cur_dir,fSpeed*Device.fTimeDelta); } -void CPhantom::PsyHit(const CObject *object, float value) +void CPhantom::PsyHit(const IGameObject *object, float value) { NET_Packet P; SHit HS; diff --git a/src/xrGame/ai/phantom/phantom.h b/src/xrGame/ai/phantom/phantom.h index 218008aa234..0e20aedaae8 100644 --- a/src/xrGame/ai/phantom/phantom.h +++ b/src/xrGame/ai/phantom/phantom.h @@ -40,7 +40,7 @@ class CPhantom : public CEntity { CParticlesObject* m_fly_particles; static void animation_end_callback (CBlend* B); private: - CObject* m_enemy; + IGameObject* m_enemy; float fSpeed; float fASpeed; @@ -55,7 +55,7 @@ class CPhantom : public CEntity { void UpdatePosition (const Fvector& tgt_pos); - void PsyHit (const CObject *object, float value); + void PsyHit (const IGameObject *object, float value); public: CPhantom (); virtual ~CPhantom (); @@ -72,7 +72,7 @@ class CPhantom : public CEntity { virtual void shedule_Update (u32 DT); virtual void UpdateCL (); - virtual void HitSignal (float HitAmount, Fvector& local_dir, CObject* who, s16 element){} + virtual void HitSignal (float HitAmount, Fvector& local_dir, IGameObject* who, s16 element){} virtual void HitImpulse (float amount, Fvector& vWorldDir, Fvector& vLocalDir){} virtual void Hit (SHit* pHDS); diff --git a/src/xrGame/ai/stalker/ai_stalker.cpp b/src/xrGame/ai/stalker/ai_stalker.cpp index be4e7e01a86..7b0c4a357c5 100644 --- a/src/xrGame/ai/stalker/ai_stalker.cpp +++ b/src/xrGame/ai/stalker/ai_stalker.cpp @@ -462,7 +462,7 @@ void CAI_Stalker::reload (LPCSTR section) m_power_fx_factor = pSettings->r_float(section,"power_fx_factor"); } -void CAI_Stalker::Die (CObject* who) +void CAI_Stalker::Die (IGameObject* who) { movement().on_death ( ); @@ -1161,7 +1161,7 @@ const MonsterSpace::SBoneRotation &CAI_Stalker::head_orientation () const return (movement().head_orientation()); } -void CAI_Stalker::net_Relcase (CObject* O) +void CAI_Stalker::net_Relcase (IGameObject* O) { inherited::net_Relcase (O); diff --git a/src/xrGame/ai/stalker/ai_stalker.h b/src/xrGame/ai/stalker/ai_stalker.h index ecee99ab31a..2fb73265e22 100644 --- a/src/xrGame/ai/stalker/ai_stalker.h +++ b/src/xrGame/ai/stalker/ai_stalker.h @@ -185,7 +185,7 @@ class CAI_Stalker : virtual void net_Destroy (); virtual void net_Save (NET_Packet& P); virtual BOOL net_SaveRelevant (); - virtual void net_Relcase (CObject* O); + virtual void net_Relcase (IGameObject* O); //save/load server serialization virtual void save (NET_Packet &output_packet); @@ -199,18 +199,18 @@ class CAI_Stalker : virtual void g_WeaponBones (int &L, int &R1, int &R2); virtual void g_fireParams (const CHudItem* pHudItem, Fvector& P, Fvector& D); - virtual void HitSignal (float P, Fvector& vLocalDir, CObject* who, s16 element); - virtual void Die (CObject* who); + virtual void HitSignal (float P, Fvector& vLocalDir, IGameObject* who, s16 element); + virtual void Die (IGameObject* who); virtual void OnEvent (NET_Packet& P, u16 type); - virtual void feel_touch_new (CObject* O); - virtual void feel_touch_delete (CObject* O); - void on_ownership_reject ( CObject*O, bool just_before_destroy ); + virtual void feel_touch_new (IGameObject* O); + virtual void feel_touch_delete (IGameObject* O); + void on_ownership_reject ( IGameObject*O, bool just_before_destroy ); virtual void renderable_Render (); virtual void Exec_Look (float dt); virtual void Hit (SHit* pHDS); virtual void PHHit (SHit &H); - virtual bool feel_vision_isRelevant (CObject* who); + virtual bool feel_vision_isRelevant (IGameObject* who); virtual float Radius () const; #ifdef DEBUG virtual void OnHUDDraw (CCustomHUD* hud); @@ -246,7 +246,7 @@ class CAI_Stalker : virtual void PHFreeze () {return inherited ::PHFreeze();} // miscellanious functions - void DropItemSendMessage (CObject *O); + void DropItemSendMessage (IGameObject *O); bool bfCheckForNodeVisibility(u32 dwNodeID, bool bIfRyPick = false); virtual ALife::ERelationType tfGetRelationType (const CEntityAlive *tpEntityAlive) const; virtual const SRotation Orientation () const; @@ -302,8 +302,8 @@ class CAI_Stalker : bool fire_make_sense (); virtual LPCSTR Name () const; - virtual bool feel_touch_contact (CObject* O); - virtual bool feel_touch_on_contact (CObject* O); + virtual bool feel_touch_contact (IGameObject* O); + virtual bool feel_touch_on_contact (IGameObject* O); //флаги, какие действия совершал актер по отношению к сталкеру //(помог, атаковал и т.д.) @@ -673,7 +673,7 @@ class CAI_Stalker : Fvector m_computed_object_direction; // target parameters Fvector m_throw_target_position; - CObject *m_throw_ignore_object; + IGameObject *m_throw_ignore_object; // computed Fvector m_throw_position; Fvector m_throw_velocity; @@ -708,15 +708,15 @@ class CAI_Stalker : const Fvector &gravity ); void check_throw_trajectory (const float &throw_time); - void throw_target_impl (const Fvector &position, CObject *throw_ignore_object ); + void throw_target_impl (const Fvector &position, IGameObject *throw_ignore_object ); void compute_throw_miss ( u32 const vertex_id ); public: virtual bool use_default_throw_force (); virtual float missile_throw_force (); virtual bool use_throw_randomness (); - void throw_target (const Fvector &position, CObject *throw_ignore_object ); - void throw_target (const Fvector &position, u32 const vertex_id, CObject *throw_ignore_object ); + void throw_target (const Fvector &position, IGameObject *throw_ignore_object ); + void throw_target (const Fvector &position, u32 const vertex_id, IGameObject *throw_ignore_object ); IC const Fvector &throw_target () const; void update_throw_params (); void on_throw_completed (); @@ -752,7 +752,7 @@ class CAI_Stalker : bool can_cry_enemy_is_wounded () const; void on_critical_wound_initiator (const CAI_Stalker *critically_wounded); void on_enemy_wounded_or_killed (const CAI_Stalker *wounded_or_killed); - void notify_on_wounded_or_killed (CObject *object); + void notify_on_wounded_or_killed (IGameObject *object); void notify_on_wounded_or_killed (); void xr_stdcall remove_critical_hit (); ////////////////////////////////////////////////////////////////////////// @@ -829,9 +829,9 @@ class CAI_Stalker : bool can_fire_right_now ( ); public: - typedef xr_vector ignored_touched_objects_type; + typedef xr_vector ignored_touched_objects_type; inline ignored_touched_objects_type& ignored_touched_objects () { return m_ignored_touched_objects; } - void generate_take_event ( CObject const* const object ) const; + void generate_take_event ( IGameObject const* const object ) const; private: ignored_touched_objects_type m_ignored_touched_objects; diff --git a/src/xrGame/ai/stalker/ai_stalker_debug.cpp b/src/xrGame/ai/stalker/ai_stalker_debug.cpp index fb516b1d013..5a3365b20d6 100644 --- a/src/xrGame/ai/stalker/ai_stalker_debug.cpp +++ b/src/xrGame/ai/stalker/ai_stalker_debug.cpp @@ -303,7 +303,7 @@ void CAI_Stalker::debug_text () DBG_OutText ("%s%sobjects : %d",indent,indent,memory().hit().objects().size()); ALife::_OBJECT_ID object_id = memory().hit().last_hit_object_id(); DBG_OutText ("%s%slast hit object id : %d",indent,indent,object_id); - CObject *object = (object_id == ALife::_OBJECT_ID(-1)) ? 0 : Level().Objects.net_Find(object_id); + IGameObject *object = (object_id == ALife::_OBJECT_ID(-1)) ? 0 : Level().Objects.net_Find(object_id); DBG_OutText ("%s%slast hit object name : %s",indent,indent,object ? *object->cName() : ""); #ifdef USE_SELECTED_HIT if (memory().hit().hit()) { @@ -1030,7 +1030,7 @@ void fill_points (CCustomMonster *self, const Fvector &position, const Fvector pick_distance = params.m_pick_distance; } -void draw_visiblity_rays (CCustomMonster *self, const CObject *object, collide::rq_results& rq_storage) +void draw_visiblity_rays (CCustomMonster *self, const IGameObject *object, collide::rq_results& rq_storage) { typedef Feel::Vision::feel_visible_Item feel_visible_Item; typedef xr_vector VISIBLE_ITEMS; @@ -1663,7 +1663,7 @@ void CAI_Stalker::OnRender () if (!memory().enemy().selected() || !memory().visual().visible_now(memory().enemy().selected())) return; - xr_vector objects; + xr_vector objects; feel_vision_get (objects); if (std::find(objects.begin(),objects.end(),memory().enemy().selected()) != objects.end()) { Fvector position = feel_vision_get_vispoint(const_cast(memory().enemy().selected())); diff --git a/src/xrGame/ai/stalker/ai_stalker_events.cpp b/src/xrGame/ai/stalker/ai_stalker_events.cpp index 3263d006bc2..bb5b2119ef8 100644 --- a/src/xrGame/ai/stalker/ai_stalker_events.cpp +++ b/src/xrGame/ai/stalker/ai_stalker_events.cpp @@ -33,7 +33,7 @@ void CAI_Stalker::OnEvent (NET_Packet& P, u16 type) u16 id; P.r_u16 (id); - CObject *O = Level().Objects.net_Find (id); + IGameObject *O = Level().Objects.net_Find (id); R_ASSERT (O); @@ -70,7 +70,7 @@ void CAI_Stalker::OnEvent (NET_Packet& P, u16 type) u16 id; P.r_u16 (id); - CObject *O = Level().Objects.net_Find(id); + IGameObject *O = Level().Objects.net_Find(id); #pragma todo("Dima to Oles : how can this happen?") if (!O) @@ -89,7 +89,7 @@ void CAI_Stalker::OnEvent (NET_Packet& P, u16 type) } } -void CAI_Stalker::on_ownership_reject ( CObject*O, bool just_before_destroy ) +void CAI_Stalker::on_ownership_reject ( IGameObject*O, bool just_before_destroy ) { m_pPhysics_support->in_UpdateCL (); IKinematics* const kinematics = smart_cast(Visual()); @@ -108,7 +108,7 @@ void CAI_Stalker::on_ownership_reject ( CObject*O, bool just_before_destroy ) feel_touch_deny (O,2000); } -void CAI_Stalker::generate_take_event ( CObject const* const object ) const +void CAI_Stalker::generate_take_event ( IGameObject const* const object ) const { NET_Packet packet; u_EventGen ( packet, GE_OWNERSHIP_TAKE, ID() ); @@ -116,7 +116,7 @@ void CAI_Stalker::generate_take_event ( CObject const* const object ) const u_EventSend ( packet ); } -void CAI_Stalker::DropItemSendMessage (CObject *O) +void CAI_Stalker::DropItemSendMessage (IGameObject *O) { if (!O || !O->H_Parent() || (this != O->H_Parent())) return; @@ -136,12 +136,12 @@ void CAI_Stalker::UpdateAvailableDialogs(CPhraseDialogManager* partner) CAI_PhraseDialogManager::UpdateAvailableDialogs(partner); } -void CAI_Stalker::feel_touch_new (CObject* O) +void CAI_Stalker::feel_touch_new (IGameObject* O) { // Msg ("FEEL_TOUCH::NEW : %s",*O->cName()); if (!g_Alive()) return; if (Remote()) return; - if ((O->spatial.type | STYPE_VISIBLEFORAI) != O->spatial.type) return; + if ((O->GetSpatialData().type | STYPE_VISIBLEFORAI) != O->GetSpatialData().type) return; // Now, test for game specific logical objects to minimize traffic CInventoryItem *I = smart_cast (O); diff --git a/src/xrGame/ai/stalker/ai_stalker_feel.cpp b/src/xrGame/ai/stalker/ai_stalker_feel.cpp index baca04a06dd..135aeda3f29 100644 --- a/src/xrGame/ai/stalker/ai_stalker_feel.cpp +++ b/src/xrGame/ai/stalker/ai_stalker_feel.cpp @@ -20,7 +20,7 @@ extern Flags32 psAI_Flags; #endif // DEBUG -bool CAI_Stalker::feel_vision_isRelevant(CObject* O) +bool CAI_Stalker::feel_vision_isRelevant(IGameObject* O) { if (!g_Alive()) return false; @@ -56,7 +56,7 @@ bool CAI_Stalker::bfCheckForNodeVisibility(u32 dwNodeID, bool bIfRayPick) return (memory().visual().visible(dwNodeID,movement().m_head.current.yaw,ffGetFov())); } -bool CAI_Stalker::feel_touch_contact (CObject *O) +bool CAI_Stalker::feel_touch_contact (IGameObject *O) { if ( !m_take_items_enabled && smart_cast(O) ) return (false); @@ -74,17 +74,17 @@ bool CAI_Stalker::feel_touch_contact (CObject *O) return (game_object->feel_touch_on_contact(this)); } -bool CAI_Stalker::feel_touch_on_contact (CObject *O) +bool CAI_Stalker::feel_touch_on_contact (IGameObject *O) { VERIFY (O != this); - if ((O->spatial.type | STYPE_VISIBLEFORAI) != O->spatial.type) + if ((O->GetSpatialData().type | STYPE_VISIBLEFORAI) != O->GetSpatialData().type) return (false); return (inherited::feel_touch_on_contact(O)); } -void CAI_Stalker::feel_touch_delete (CObject* O) +void CAI_Stalker::feel_touch_delete (IGameObject* O) { ignored_touched_objects_type::iterator i = std::find(m_ignored_touched_objects.begin(), m_ignored_touched_objects.end(), O); if ( i == m_ignored_touched_objects.end() ) diff --git a/src/xrGame/ai/stalker/ai_stalker_fire.cpp b/src/xrGame/ai/stalker/ai_stalker_fire.cpp index f82854ad420..8fc9af1d5d6 100644 --- a/src/xrGame/ai/stalker/ai_stalker_fire.cpp +++ b/src/xrGame/ai/stalker/ai_stalker_fire.cpp @@ -326,7 +326,7 @@ void CAI_Stalker::Hit(SHit* pHDS) inherited::Hit ( &HDS ); } -void CAI_Stalker::HitSignal (float amount, Fvector& vLocalDir, CObject* who, s16 element) +void CAI_Stalker::HitSignal (float amount, Fvector& vLocalDir, IGameObject* who, s16 element) { } @@ -698,8 +698,8 @@ bool CAI_Stalker::undetected_anomaly () bool CAI_Stalker::inside_anomaly () { - xr_vector::const_iterator I = feel_touch.begin(); - xr_vector::const_iterator E = feel_touch.end(); + xr_vector::const_iterator I = feel_touch.begin(); + xr_vector::const_iterator E = feel_touch.end(); for ( ; I != E; ++I) { CCustomZone *zone = smart_cast(*I); if ( zone && (zone->restrictor_type() != RestrictionSpace::eRestrictorTypeNone) ) { @@ -819,7 +819,7 @@ void CAI_Stalker::on_weapon_hide (CWeapon *weapon) { } -void CAI_Stalker::notify_on_wounded_or_killed (CObject *object) +void CAI_Stalker::notify_on_wounded_or_killed (IGameObject *object) { CAI_Stalker *stalker = smart_cast(object); if (!stalker) @@ -845,7 +845,7 @@ void CAI_Stalker::notify_on_wounded_or_killed () if (last_hit_object_id == ALife::_OBJECT_ID(-1)) return; - CObject *object = Level().Objects.net_Find(last_hit_object_id); + IGameObject *object = Level().Objects.net_Find(last_hit_object_id); if (!object) return; @@ -928,7 +928,7 @@ void CAI_Stalker::compute_throw_miss ( u32 const vertex_id ) } } -void CAI_Stalker::throw_target_impl (const Fvector &position, CObject *throw_ignore_object ) +void CAI_Stalker::throw_target_impl (const Fvector &position, IGameObject *throw_ignore_object ) { float distance_to_sqr = position.distance_to_sqr(m_throw_target_position); m_throw_actual = m_throw_actual && (distance_to_sqr < _sqr(.1f)); @@ -936,12 +936,12 @@ void CAI_Stalker::throw_target_impl (const Fvector &position, CObject *throw_i m_throw_ignore_object = throw_ignore_object; } -void CAI_Stalker::throw_target (const Fvector &position, CObject *throw_ignore_object ) +void CAI_Stalker::throw_target (const Fvector &position, IGameObject *throw_ignore_object ) { throw_target_impl ( position, throw_ignore_object ); } -void CAI_Stalker::throw_target (const Fvector &position, u32 const vertex_id, CObject *throw_ignore_object ) +void CAI_Stalker::throw_target (const Fvector &position, u32 const vertex_id, IGameObject *throw_ignore_object ) { throw_target_impl ( position, throw_ignore_object ); compute_throw_miss ( vertex_id ); diff --git a/src/xrGame/ai/trader/ai_trader.cpp b/src/xrGame/ai/trader/ai_trader.cpp index 020a592d17e..eacaf7870f0 100644 --- a/src/xrGame/ai/trader/ai_trader.cpp +++ b/src/xrGame/ai/trader/ai_trader.cpp @@ -168,7 +168,7 @@ void CAI_Trader::OnEvent (NET_Packet& P, u16 type) CInventoryOwner::OnEvent (P,type); u16 id; - CObject* Obj; + IGameObject* Obj; switch (type) { case GE_TRADE_BUY: @@ -204,7 +204,7 @@ void CAI_Trader::OnEvent (NET_Packet& P, u16 type) } } -void CAI_Trader::feel_touch_new (CObject* O) +void CAI_Trader::feel_touch_new (IGameObject* O) { if (!g_Alive()) return; if (Remote()) return; @@ -221,7 +221,7 @@ void CAI_Trader::feel_touch_new (CObject* O) } } -void CAI_Trader::DropItemSendMessage(CObject *O) +void CAI_Trader::DropItemSendMessage(IGameObject *O) { if (!O || !O->H_Parent() || (this != O->H_Parent())) return; @@ -265,7 +265,7 @@ void CAI_Trader::Think() { } -void CAI_Trader::Die (CObject* who) +void CAI_Trader::Die (IGameObject* who) { inherited::Die (who); } diff --git a/src/xrGame/ai/trader/ai_trader.h b/src/xrGame/ai/trader/ai_trader.h index 669014d56d7..2e73d83c64b 100644 --- a/src/xrGame/ai/trader/ai_trader.h +++ b/src/xrGame/ai/trader/ai_trader.h @@ -57,9 +57,9 @@ class CAI_Trader : public CEntityAlive, virtual void load (IReader &input_packet); virtual BOOL net_SaveRelevant() {return inherited::net_SaveRelevant();} - virtual void Die (CObject* who); + virtual void Die (IGameObject* who); virtual void Think (); - virtual void HitSignal (float /**P/**/, Fvector &/**local_dir/**/, CObject* /**who/**/, s16 /**element/**/){}; + virtual void HitSignal (float /**P/**/, Fvector &/**local_dir/**/, IGameObject* /**who/**/, s16 /**element/**/){}; virtual void HitImpulse (float /**P/**/, Fvector &/**vWorldDir/**/, Fvector& /**vLocalDir/**/){}; virtual void Hit (SHit* pHDS){inherited::Hit(pHDS);} virtual void UpdateCL (); @@ -69,8 +69,8 @@ class CAI_Trader : public CEntityAlive, virtual float ffGetFov () const {return 150.f;} virtual float ffGetRange () const {return 30.f;} virtual void OnEvent (NET_Packet& P, u16 type); - virtual void feel_touch_new (CObject* O); - virtual void DropItemSendMessage (CObject *O); + virtual void feel_touch_new (IGameObject* O); + virtual void DropItemSendMessage (IGameObject *O); virtual void shedule_Update (u32 dt); virtual BOOL UsedAI_Locations (); diff --git a/src/xrGame/attachment_owner.cpp b/src/xrGame/attachment_owner.cpp index 500c59d84dc..8b8bb8269bf 100644 --- a/src/xrGame/attachment_owner.cpp +++ b/src/xrGame/attachment_owner.cpp @@ -61,7 +61,7 @@ void CAttachmentOwner::renderable_Render () void __stdcall AttachmentCallback(IKinematics *tpKinematics) { - CGameObject *game_object = smart_cast(static_cast(tpKinematics->GetUpdateCallbackParam())); + CGameObject *game_object = smart_cast(static_cast(tpKinematics->GetUpdateCallbackParam())); VERIFY (game_object); CAttachmentOwner *attachment_owner = smart_cast(game_object); diff --git a/src/xrGame/base_client_classes_script.cpp b/src/xrGame/base_client_classes_script.cpp index c5c58eb6146..e21a08661e3 100644 --- a/src/xrGame/base_client_classes_script.cpp +++ b/src/xrGame/base_client_classes_script.cpp @@ -18,13 +18,13 @@ using namespace luabind; SCRIPT_EXPORT(IFactoryObject, (), { - module(luaState) + module(luaState) [ // 'DLL_Pure' is preserved to maintain backward compatibility with mod scripts class_("DLL_Pure") .def(constructor<>()) - .def("_construct",&IFactoryObject::_construct,&FactoryObjectWrapper::_construct_static) - ]; + .def("_construct", &IFactoryObject::_construct, &FactoryObjectWrapper::_construct_static) + ]; }); /* @@ -38,7 +38,7 @@ SCRIPT_EXPORT(ISpatial, (), .def("spatial_unregister", &ISpatial::spatial_unregister, &CISpatialWrapper::spatial_unregister_static) .def("spatial_move", &ISpatial::spatial_move, &CISpatialWrapper::spatial_move_static) .def("spatial_sector_point",&ISpatial::spatial_sector_point,&CISpatialWrapper::spatial_sector_point_static) - .def("dcast_CObject", &ISpatial::dcast_CObject, &CISpatialWrapper::dcast_CObject_static) + .def("dcast_GameObject", &ISpatial::dcast_GameObject, &CISpatialWrapper::dcast_CObject_static) .def("dcast_FeelSound", &ISpatial::dcast_FeelSound, &CISpatialWrapper::dcast_FeelSound_static) .def("dcast_Renderable", &ISpatial::dcast_Renderable, &CISpatialWrapper::dcast_Renderable_static) .def("dcast_Light", &ISpatial::dcast_Light, &CISpatialWrapper::dcast_Light_static) @@ -81,24 +81,24 @@ SCRIPT_EXPORT(CGameObject, (IFactoryObject, ISheduled, ICollidable, IRenderable) { module(luaState) [ -// class_,CObjectWrapper>("CObject") +// class_,CObjectWrapper>("IGameObject") // .def(constructor<>()) -// .def("_construct", &CObject::_construct,&CObjectWrapper::_construct_static) +// .def("_construct", &IGameObject::_construct,&CObjectWrapper::_construct_static) /* - .def("spatial_register", &CObject::spatial_register, &CObjectWrapper::spatial_register_static) - .def("spatial_unregister", &CObject::spatial_unregister, &CObjectWrapper::spatial_unregister_static) - .def("spatial_move", &CObject::spatial_move, &CObjectWrapper::spatial_move_static) - .def("spatial_sector_point",&CObject::spatial_sector_point,&CObjectWrapper::spatial_sector_point_static) - .def("dcast_FeelSound", &CObject::dcast_FeelSound, &CObjectWrapper::dcast_FeelSound_static) - .def("dcast_Light", &CObject::dcast_Light, &CObjectWrapper::dcast_Light_static) + .def("spatial_register", &IGameObject::spatial_register, &CObjectWrapper::spatial_register_static) + .def("spatial_unregister", &IGameObject::spatial_unregister, &CObjectWrapper::spatial_unregister_static) + .def("spatial_move", &IGameObject::spatial_move, &CObjectWrapper::spatial_move_static) + .def("spatial_sector_point",&IGameObject::spatial_sector_point,&CObjectWrapper::spatial_sector_point_static) + .def("dcast_FeelSound", &IGameObject::dcast_FeelSound, &CObjectWrapper::dcast_FeelSound_static) + .def("dcast_Light", &IGameObject::dcast_Light, &CObjectWrapper::dcast_Light_static) */ -// .def("shedule_Scale", &CObject::shedule_Scale, &CObjectWrapper::shedule_Scale_static) -// .def("shedule_Update", &CObject::shedule_Update, &CObjectWrapper::shedule_Update_static) +// .def("shedule_Scale", &IGameObject::shedule_Scale, &CObjectWrapper::shedule_Scale_static) +// .def("shedule_Update", &IGameObject::shedule_Update, &CObjectWrapper::shedule_Update_static) -// .def("renderable_Render" ,&CObject::renderable_Render,&CObjectWrapper::renderable_Render_static) -// .def("renderable_ShadowGenerate",&CObject::renderable_ShadowGenerate,&CObjectWrapper::renderable_ShadowGenerate_static) -// .def("renderable_ShadowReceive",&CObject::renderable_ShadowReceive,&CObjectWrapper::renderable_ShadowReceive_static) -// .def("Visual", &CObject::Visual) +// .def("renderable_Render" ,&IGameObject::renderable_Render,&CObjectWrapper::renderable_Render_static) +// .def("renderable_ShadowGenerate",&IGameObject::renderable_ShadowGenerate,&CObjectWrapper::renderable_ShadowGenerate_static) +// .def("renderable_ShadowReceive",&IGameObject::renderable_ShadowReceive,&CObjectWrapper::renderable_ShadowReceive_static) +// .def("Visual", &IGameObject::Visual) class_, default_holder, CGameObjectWrapper>("CGameObject") .def(constructor<>()) diff --git a/src/xrGame/base_client_classes_wrappers.h b/src/xrGame/base_client_classes_wrappers.h index 895feb44db3..a41c0e581a0 100644 --- a/src/xrGame/base_client_classes_wrappers.h +++ b/src/xrGame/base_client_classes_wrappers.h @@ -106,14 +106,14 @@ class ISpatialWrapper : public heritage::result { return (self->base::spatial_sector_point()); } - virtual CObject* dcast_CObject () + virtual IGameObject* dcast_GameObject () { - return (call_member(this,"dcast_CObject")); + return (call_member(this,"dcast_GameObject")); } - static CObject* dcast_CObject_static (base *self) + static IGameObject* dcast_CObject_static (base *self) { - return (self->base::dcast_CObject()); + return (self->base::dcast_GameObject()); } virtual Feel::Sound* dcast_FeelSound () @@ -212,9 +212,9 @@ class IRenderableWrapper : public heritage::result { */ }; -typedef IRenderableWrapper CIRenderableWrapper; +using CIRenderableWrapper = IRenderableWrapper; -//typedef FactoryObjectWrapperTpl CObjectDLL_Pure; +//typedef FactoryObjectWrapperTpl CObjectDLL_Pure; //typedef ISpatialWrapper CObjectISpatial; //typedef ISheduledWrapper CObjectISheduled; //typedef IRenderableWrapper CObjectIRenderable; @@ -225,7 +225,7 @@ typedef IRenderableWrapper CIRenderableWrapper; // virtual ~CObjectWrapper () {}; ///** // virtual BOOL Ready (); -// virtual CObject* H_SetParent (CObject* O); +// virtual IGameObject* H_SetParent (IGameObject* O); // virtual void Center (Fvector& C) const; // virtual float Radius () const; // virtual const Fbox& BoundingBox () const; @@ -239,8 +239,8 @@ typedef IRenderableWrapper CIRenderableWrapper; // virtual BOOL net_Relevant (); // virtual void net_MigrateInactive (NET_Packet& P); // virtual void net_MigrateActive (NET_Packet& P); -// virtual void net_Relcase (CObject* O); -// virtual SavedPosition ps_Element (u32 ID) const; +// virtual void net_Relcase (IGameObject* O); +// virtual GameObjectSavedPosition ps_Element (u32 ID) const; // virtual void ForceTransform (const Fmatrix& m); // virtual void OnHUDDraw (CCustomHUD* hud); // virtual void OnH_B_Chield (); @@ -251,10 +251,11 @@ typedef IRenderableWrapper CIRenderableWrapper; //}; -typedef FactoryObjectWrapperTpl CGameObjectIFactoryObject; -//typedef ISpatialWrapper CGameObjectISpatial; -typedef ISheduledWrapper CGameObjectISheduled; -typedef IRenderableWrapper CGameObjectIRenderable; +using CGameObjectIFactoryObject = FactoryObjectWrapperTpl; +//using CGameObjectISpatial = ISpatialWrapper; +using CGameObjectISheduled = ISheduledWrapper; +using CGameObjectIRenderable = IRenderableWrapper>>; +//using CGameObjectIRenderable = IRenderableWrapper; // original class CGameObjectWrapper : public CGameObjectIRenderable { public: @@ -307,12 +308,12 @@ class CEntityWrapper : public CEntity, public luabind::wrap_base { IC CEntityWrapper () {} virtual ~CEntityWrapper () {} - virtual void HitSignal (float P, Fvector &local_dir, CObject* who, s16 element) + virtual void HitSignal (float P, Fvector &local_dir, IGameObject* who, s16 element) { luabind::call_member(this,"HitSignal",P,local_dir,who,element); } - static void HitSignal_static (CEntity *self, float P, Fvector &local_dir, CObject* who, s16 element) + static void HitSignal_static (CEntity *self, float P, Fvector &local_dir, IGameObject* who, s16 element) { ai().script_engine().script_log(LuaMessageType::Error,"You are trying to call a pure virtual function CEntity::HitSignal!"); } diff --git a/src/xrGame/best_scores_helper.h b/src/xrGame/best_scores_helper.h index 560e0e54f29..577e3045027 100644 --- a/src/xrGame/best_scores_helper.h +++ b/src/xrGame/best_scores_helper.h @@ -16,7 +16,7 @@ class best_scores_helper : public reward_event_handler virtual bool OnWeapon_Fire (u16 sender, u16 sender_weapon_id) { return false;}; virtual bool OnBullet_Fire (u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction) { return false; }; - virtual bool OnBullet_Hit (CObject const * hitter, CObject const * victim, CObject const * weapon, u16 const bone) { return false; }; + virtual bool OnBullet_Hit (IGameObject const * hitter, IGameObject const * victim, IGameObject const * weapon, u16 const bone) { return false; }; virtual bool OnArtefactSpawned () { return false; }; virtual bool OnPlayerTakeArtefact (game_PlayerState const * ps) { return false; }; virtual bool OnPlayerDropArtefact (game_PlayerState const * ps) { return false; }; diff --git a/src/xrGame/car_memory.cpp b/src/xrGame/car_memory.cpp index 88878201f78..fa915164d09 100644 --- a/src/xrGame/car_memory.cpp +++ b/src/xrGame/car_memory.cpp @@ -32,7 +32,7 @@ void car_memory::reload(LPCSTR section) m_far_plane = pSettings->r_float(section,"view_far_plane"); } #include "actor.h" -bool car_memory::feel_vision_isRelevant (CObject *object) +bool car_memory::feel_vision_isRelevant (IGameObject *object) { return (NULL!=smart_cast(object)); //. return (false); diff --git a/src/xrGame/car_memory.h b/src/xrGame/car_memory.h index 2bb4044a819..6483b22226d 100644 --- a/src/xrGame/car_memory.h +++ b/src/xrGame/car_memory.h @@ -31,7 +31,7 @@ class car_memory : public vision_client { virtual void reload (LPCSTR section); - virtual bool feel_vision_isRelevant (CObject *object); + virtual bool feel_vision_isRelevant (IGameObject *object); virtual void camera ( Fvector &position, Fvector &direction, diff --git a/src/xrGame/character_shell_control.cpp b/src/xrGame/character_shell_control.cpp index 00b375b0d11..45acb992ccd 100644 --- a/src/xrGame/character_shell_control.cpp +++ b/src/xrGame/character_shell_control.cpp @@ -89,7 +89,7 @@ void character_shell_control:: set_start_shell_params (CPhysicsShell * sh) cons } -void character_shell_control:: apply_start_velocity_factor ( CObject* who, Fvector &velocity ) const +void character_shell_control:: apply_start_velocity_factor ( IGameObject* who, Fvector &velocity ) const { velocity.mul( 1.3f ); velocity.mul( 1.25f*m_after_death_velocity_factor ); diff --git a/src/xrGame/character_shell_control.h b/src/xrGame/character_shell_control.h index 8215053e678..079e9d42e8d 100644 --- a/src/xrGame/character_shell_control.h +++ b/src/xrGame/character_shell_control.h @@ -10,7 +10,7 @@ class character_shell_control void set_kill_hit ( SHit &H ) const; void set_fatal_impulse ( SHit &H ) const; void set_start_shell_params ( CPhysicsShell * sh ) const; - void apply_start_velocity_factor (CObject* who, Fvector &velocity ) const; + void apply_start_velocity_factor (IGameObject* who, Fvector &velocity ) const; void Load ( LPCSTR section ); void TestForWounded ( const Fmatrix& xform, IKinematics* CKA ); void UpdateFrictionAndJointResistanse( CPhysicsShell * sh ); diff --git a/src/xrGame/client_spawn_manager.cpp b/src/xrGame/client_spawn_manager.cpp index cbee4625ebe..6deb94c7133 100644 --- a/src/xrGame/client_spawn_manager.cpp +++ b/src/xrGame/client_spawn_manager.cpp @@ -42,7 +42,7 @@ void CClientSpawnManager::add (ALife::_OBJECT_ID requesting_id, ALife::_OBJEC void CClientSpawnManager::add (ALife::_OBJECT_ID requesting_id, ALife::_OBJECT_ID requested_id, CSpawnCallback &spawn_callback) { - CObject *object = Level().Objects.net_Find(requesting_id); + IGameObject *object = Level().Objects.net_Find(requesting_id); if (object) { callback (spawn_callback,object); return; @@ -109,7 +109,7 @@ void CClientSpawnManager::clear (ALife::_OBJECT_ID requested_id) } } -void CClientSpawnManager::callback (CSpawnCallback &spawn_callback, CObject *object) +void CClientSpawnManager::callback (CSpawnCallback &spawn_callback, IGameObject *object) { if (spawn_callback.m_object_callback) spawn_callback.m_object_callback (object); @@ -119,7 +119,7 @@ void CClientSpawnManager::callback (CSpawnCallback &spawn_callback, CObject *o (spawn_callback.m_callback) (object->ID(),script_game_object); } -void CClientSpawnManager::callback (CObject *object) +void CClientSpawnManager::callback (IGameObject *object) { REQUEST_REGISTRY::iterator I = m_registry.find(object->ID()); if (I == m_registry.end()) diff --git a/src/xrGame/client_spawn_manager.h b/src/xrGame/client_spawn_manager.h index fd572178863..655c3a2ac55 100644 --- a/src/xrGame/client_spawn_manager.h +++ b/src/xrGame/client_spawn_manager.h @@ -15,7 +15,7 @@ class CGameObject; class CClientSpawnManager { public: - typedef fastdelegate::FastDelegate1 CALLBACK_TYPE; + typedef fastdelegate::FastDelegate1 CALLBACK_TYPE; public: struct CSpawnCallback { @@ -44,8 +44,8 @@ class CClientSpawnManager { void remove (ALife::_OBJECT_ID requesting_id, ALife::_OBJECT_ID requested_id); void clear (ALife::_OBJECT_ID requested_id); void clear (); - void callback (CObject *object); - void callback (CSpawnCallback &spawn_callback, CObject *object); + void callback (IGameObject *object); + void callback (CSpawnCallback &spawn_callback, IGameObject *object); const CSpawnCallback *callback (ALife::_OBJECT_ID requesting_id, ALife::_OBJECT_ID requested_id) const; #ifdef DEBUG IC const REQUEST_REGISTRY ®istry () const; diff --git a/src/xrGame/console_commands.cpp b/src/xrGame/console_commands.cpp index cc22d5313f2..e2a919e99f7 100644 --- a/src/xrGame/console_commands.cpp +++ b/src/xrGame/console_commands.cpp @@ -1007,7 +1007,7 @@ class CCC_ShowMonsterInfo : public IConsole_Command { _GetItem(args,0,param1,' '); _GetItem(args,1,param2,' '); - CObject *obj = Level().Objects.FindObjectByName(param1); + IGameObject *obj = Level().Objects.FindObjectByName(param1); CBaseMonster *monster = smart_cast(obj); if (!monster) return; @@ -1032,7 +1032,7 @@ class CCC_DbgPhTrackObj : public CCC_String { } ph_dbg_draw_mask1.set(ph_m1_DbgTrackObject,TRUE); PH_DBG_SetTrackObject(); - //CObject* O= Level().Objects.FindObjectByName(args); + //IGameObject* O= Level().Objects.FindObjectByName(args); //if(O) //{ // PH_DBG_SetTrackObject(*(O->cName())); @@ -1483,7 +1483,7 @@ public : return; }; - CObject* obj = Level().CurrentViewEntity(); VERIFY(obj); + IGameObject* obj = Level().CurrentViewEntity(); VERIFY(obj); shared_str ssss = args; CAttachmentOwner* owner = smart_cast(obj); diff --git a/src/xrGame/console_commands_mp.cpp b/src/xrGame/console_commands_mp.cpp index c7ee5941179..31bccea6df8 100644 --- a/src/xrGame/console_commands_mp.cpp +++ b/src/xrGame/console_commands_mp.cpp @@ -160,7 +160,7 @@ class CCC_Kill : public IConsole_Command { Game().local_player->testFlag(GAME_PLAYER_FLAG_VERY_VERY_DEAD)) return; - CObject *l_pObj = Level().CurrentControlEntity(); + IGameObject *l_pObj = Level().CurrentControlEntity(); CActor *l_pPlayer = smart_cast(l_pObj); if(l_pPlayer) { @@ -236,7 +236,7 @@ class CCC_Dbg_NumObjects : public IConsole_Command { if (CO < CLObjNum && CO < SVObjNum) { CSE_Abstract* pEntity = Level().Server->ID_to_entity(SObjID[CO]); - CObject* pObj = Level().Objects.net_Find(CObjID[CO]); + IGameObject* pObj = Level().Objects.net_Find(CObjID[CO]); char color = (pObj->ID() == pEntity->ID) ? '-' : '!'; Msg("%c%4d: Client - %20s[%5d] <===> Server - %s [%d]", color, CO+1, @@ -247,7 +247,7 @@ class CCC_Dbg_NumObjects : public IConsole_Command { { if (CO Server - -----------------", CO+1, *(pObj->cNameSect()), pObj->ID()); } diff --git a/src/xrGame/control_action.h b/src/xrGame/control_action.h index 23eeddd5195..3718cdfbfa2 100644 --- a/src/xrGame/control_action.h +++ b/src/xrGame/control_action.h @@ -23,7 +23,7 @@ class CControlAction { IC void execute (); IC void finalize (); IC CAI_Stalker &object () const; - IC void remove_links (CObject *object); + IC void remove_links (IGameObject *object); }; #include "control_action_inline.h" \ No newline at end of file diff --git a/src/xrGame/control_action_inline.h b/src/xrGame/control_action_inline.h index ad024cd6965..85cbdd1164e 100644 --- a/src/xrGame/control_action_inline.h +++ b/src/xrGame/control_action_inline.h @@ -46,6 +46,6 @@ IC CAI_Stalker &CControlAction::object () const return (*m_object); } -IC void CControlAction::remove_links (CObject *object) +IC void CControlAction::remove_links (IGameObject *object) { } diff --git a/src/xrGame/damage_manager.cpp b/src/xrGame/damage_manager.cpp index b673b97fbb2..02840c20036 100644 --- a/src/xrGame/damage_manager.cpp +++ b/src/xrGame/damage_manager.cpp @@ -23,7 +23,7 @@ CDamageManager::~CDamageManager () IFactoryObject *CDamageManager::_construct () { - m_object = smart_cast(this); + m_object = smart_cast(this); VERIFY (m_object); return (m_object); } diff --git a/src/xrGame/damage_manager.h b/src/xrGame/damage_manager.h index 36cbaa9c533..6cd8f65d465 100644 --- a/src/xrGame/damage_manager.h +++ b/src/xrGame/damage_manager.h @@ -12,7 +12,7 @@ class CDamageManager { protected: float m_default_hit_factor; float m_default_wound_factor; - CObject *m_object; + IGameObject *m_object; public: CDamageManager (); diff --git a/src/xrGame/danger_location.h b/src/xrGame/danger_location.h index 8e1906fd83e..7185d5145ac 100644 --- a/src/xrGame/danger_location.h +++ b/src/xrGame/danger_location.h @@ -10,7 +10,7 @@ #include "memory_space.h" -class CObject; +class IGameObject; class CDangerLocation : public intrusive_base { public: @@ -25,7 +25,7 @@ class CDangerLocation : public intrusive_base { public: IC bool operator== (const Fvector &position) const; - virtual bool operator== (const CObject *object) const; + virtual bool operator== (const IGameObject *object) const; virtual bool useful () const; virtual const Fvector &position () const = 0; IC const flags &mask () const; diff --git a/src/xrGame/danger_location_inline.h b/src/xrGame/danger_location_inline.h index 382b5beb395..cab89b271a7 100644 --- a/src/xrGame/danger_location_inline.h +++ b/src/xrGame/danger_location_inline.h @@ -13,7 +13,7 @@ IC bool CDangerLocation::operator== (const Fvector &position) const return (!!this->position().similar(position)); } -IC bool CDangerLocation::operator== (const CObject *object) const +IC bool CDangerLocation::operator== (const IGameObject *object) const { return (false); } diff --git a/src/xrGame/danger_manager.cpp b/src/xrGame/danger_manager.cpp index daed1aa5d34..a630fc35947 100644 --- a/src/xrGame/danger_manager.cpp +++ b/src/xrGame/danger_manager.cpp @@ -17,9 +17,9 @@ #include "Common/object_broker.h" struct CDangerPredicate { - const CObject *m_object; + const IGameObject *m_object; - IC CDangerPredicate (const CObject *object) + IC CDangerPredicate (const IGameObject *object) { m_object = object; } @@ -129,7 +129,7 @@ void CDangerManager::update () STOP_PROFILE } -void CDangerManager::remove_links (const CObject *object) +void CDangerManager::remove_links (const IGameObject *object) { if (m_selected && (m_selected->object() == object)) m_selected = 0; diff --git a/src/xrGame/danger_manager.h b/src/xrGame/danger_manager.h index 1ef0058bfcc..04050890efa 100644 --- a/src/xrGame/danger_manager.h +++ b/src/xrGame/danger_manager.h @@ -47,7 +47,7 @@ class CDangerManager { virtual bool is_useful (const CDangerObject &object) const; virtual float evaluate (const CDangerObject &object) const; virtual float do_evaluate (const CDangerObject &object) const; - void remove_links (const CObject *object); + void remove_links (const IGameObject *object); IC void reset (); public: diff --git a/src/xrGame/danger_object.h b/src/xrGame/danger_object.h index bd21d9758d1..20157ce8977 100644 --- a/src/xrGame/danger_object.h +++ b/src/xrGame/danger_object.h @@ -33,21 +33,21 @@ class CDangerObject { private: const CEntityAlive *m_object; - const CObject *m_dependent_object; + const IGameObject *m_dependent_object; Fvector m_position; u32 m_time; EDangerType m_type; EDangerPerceiveType m_perceive_type; public: - IC CDangerObject (const CEntityAlive *object, const Fvector &position, u32 time, const EDangerType &type, const EDangerPerceiveType &perceive_type, const CObject *dependent_object = 0); + IC CDangerObject (const CEntityAlive *object, const Fvector &position, u32 time, const EDangerType &type, const EDangerPerceiveType &perceive_type, const IGameObject *dependent_object = 0); virtual ~CDangerObject (); IC const CEntityAlive *object () const; IC const Fvector &position () const; IC u32 time () const; IC EDangerType type () const; IC EDangerPerceiveType perceive_type () const; - IC const CObject *dependent_object () const; + IC const IGameObject *dependent_object () const; IC void clear_dependent_object (); IC bool operator== (const CDangerObject &object) const; }; diff --git a/src/xrGame/danger_object_inline.h b/src/xrGame/danger_object_inline.h index 1a649f4f73a..07ff5f56cb8 100644 --- a/src/xrGame/danger_object_inline.h +++ b/src/xrGame/danger_object_inline.h @@ -14,7 +14,7 @@ IC CDangerObject::CDangerObject ( u32 time, const EDangerType &type, const EDangerPerceiveType &perceive_type, - const CObject *dependent_object + const IGameObject *dependent_object ) { m_object = object; @@ -50,7 +50,7 @@ IC CDangerObject::EDangerPerceiveType CDangerObject::perceive_type () const return (m_perceive_type); } -IC const CObject *CDangerObject::dependent_object () const +IC const IGameObject *CDangerObject::dependent_object () const { return (m_dependent_object); } diff --git a/src/xrGame/danger_object_location.cpp b/src/xrGame/danger_object_location.cpp index 3a66655747d..50feb571044 100644 --- a/src/xrGame/danger_object_location.cpp +++ b/src/xrGame/danger_object_location.cpp @@ -20,7 +20,7 @@ bool CDangerObjectLocation::useful () const return (true); } -bool CDangerObjectLocation::operator== (const CObject *object) const +bool CDangerObjectLocation::operator== (const IGameObject *object) const { return (m_object->ID() == object->ID()); } diff --git a/src/xrGame/danger_object_location.h b/src/xrGame/danger_object_location.h index 64d8ae54a40..9c835327128 100644 --- a/src/xrGame/danger_object_location.h +++ b/src/xrGame/danger_object_location.h @@ -20,7 +20,7 @@ class CDangerObjectLocation : public CDangerLocation { IC CDangerObjectLocation (const CGameObject *object, u32 level_time, u32 interval, float radius, const squad_mask_type &mask = squad_mask_type(-1)); virtual const Fvector &position () const; virtual bool useful () const; - virtual bool operator== (const CObject *object) const; + virtual bool operator== (const IGameObject *object) const; }; #include "danger_object_location_inline.h" \ No newline at end of file diff --git a/src/xrGame/death_anims_predicates.cpp b/src/xrGame/death_anims_predicates.cpp index e6050346fd4..b508009a7d3 100644 --- a/src/xrGame/death_anims_predicates.cpp +++ b/src/xrGame/death_anims_predicates.cpp @@ -173,7 +173,7 @@ class type_motion2: public type_motion if( H.initiator() != Level().CurrentControlEntity()) return false; - CObject* O = Level().Objects.net_Find( H.weaponID ); + IGameObject* O = Level().Objects.net_Find( H.weaponID ); if(!O) return false; //static_cast(O)->cast_weapon() @@ -215,7 +215,7 @@ class type_motion3: public type_motion bool is_snipper( u16 weaponID ) { - CObject* O = Level().Objects.net_Find( weaponID ); + IGameObject* O = Level().Objects.net_Find( weaponID ); if(!O) return false; CWeaponMagazined* WM = smart_cast( O ); @@ -296,7 +296,7 @@ class type_motion6: public type_motion return true; } - CObject* O = Level().Objects.net_Find( H.weaponID ); + IGameObject* O = Level().Objects.net_Find( H.weaponID ); if(!O) { m = MotionID(); diff --git a/src/xrGame/doors_manager.cpp b/src/xrGame/doors_manager.cpp index 922e1a4b1cd..7a8948d9c78 100644 --- a/src/xrGame/doors_manager.cpp +++ b/src/xrGame/doors_manager.cpp @@ -29,7 +29,7 @@ manager::~manager ( ) // //void manager::check_bug_door ( ) const //{ -// CObject const* const object = Level().Objects.FindObjectByName("shkaf_work_01_door_0000"); +// IGameObject const* const object = Level().Objects.FindObjectByName("shkaf_work_01_door_0000"); // if ( !object ) { // Msg ( "there is now object[\"shkaf_work_01_door_0000\"] found" ); // return; diff --git a/src/xrGame/eatable_item_object.cpp b/src/xrGame/eatable_item_object.cpp index c61c105a9a8..39468fa42e5 100644 --- a/src/xrGame/eatable_item_object.cpp +++ b/src/xrGame/eatable_item_object.cpp @@ -31,7 +31,7 @@ void CEatableItemObject::Load (LPCSTR section) } //void CEatableItemObject::Hit(float P, Fvector &dir, -// CObject* who, s16 element, +// IGameObject* who, s16 element, // Fvector position_in_object_space, // float impulse, // ALife::EHitType hit_type) diff --git a/src/xrGame/enemy_manager.cpp b/src/xrGame/enemy_manager.cpp index 1d7e95d9808..b9aaf37ee08 100644 --- a/src/xrGame/enemy_manager.cpp +++ b/src/xrGame/enemy_manager.cpp @@ -186,7 +186,7 @@ void CEnemyManager::set_ready_to_save () m_ready_to_save = true; } -void CEnemyManager::remove_links (CObject *object) +void CEnemyManager::remove_links (IGameObject *object) { // since we use no members in CEntityAlive during search, // we just use the pinter itself, we can just statically cast object @@ -365,7 +365,7 @@ bool CEnemyManager::need_update (const bool &only_wounded) const if (last_hit_time && (last_hit_time > m_last_enemy_change) ) { ALife::_OBJECT_ID enemy_id = m_object->memory().hit().last_hit_object_id(); VERIFY ( enemy_id != ALife::_OBJECT_ID(-1) ); - CObject const* enemy = Level().Objects.net_Find(enemy_id); + IGameObject const* enemy = Level().Objects.net_Find(enemy_id); VERIFY (enemy); CEntityAlive const* alive_enemy = smart_cast(enemy); if (alive_enemy && m_object->is_relation_enemy(alive_enemy)) diff --git a/src/xrGame/enemy_manager.h b/src/xrGame/enemy_manager.h index 8528d34f791..cee3c1b15a6 100644 --- a/src/xrGame/enemy_manager.h +++ b/src/xrGame/enemy_manager.h @@ -60,7 +60,7 @@ class CEnemyManager : public CObjectManager { IC u32 last_enemy_time () const; IC const CEntityAlive *last_enemy () const; IC USEFULE_CALLBACK &useful_callback (); - void remove_links (CObject *object); + void remove_links (IGameObject *object); public: void ignore_monster_threshold (const float &ignore_monster_threshold); diff --git a/src/xrGame/entity_alive.cpp b/src/xrGame/entity_alive.cpp index 8b9989bb15d..a046b456d87 100644 --- a/src/xrGame/entity_alive.cpp +++ b/src/xrGame/entity_alive.cpp @@ -305,7 +305,7 @@ void CEntityAlive::Hit(SHit* pHDS) } -void CEntityAlive::Die (CObject* who) +void CEntityAlive::Die (IGameObject* who) { if(IsGameTypeSingle()) RELATION_REGISTRY().Action(smart_cast(who), this, RELATION_REGISTRY::KILL); @@ -739,7 +739,7 @@ void CEntityAlive:: set_collision_hit_callback (ICollisionHitCallback *cc) } -void CEntityAlive::net_Relcase (CObject *object) +void CEntityAlive::net_Relcase (IGameObject *object) { inherited::net_Relcase (object); conditions().remove_links (object); diff --git a/src/xrGame/entity_alive.h b/src/xrGame/entity_alive.h index 1d309485d77..051cf93944f 100644 --- a/src/xrGame/entity_alive.h +++ b/src/xrGame/entity_alive.h @@ -59,7 +59,7 @@ class CEntityAlive : public CEntity { virtual void HitImpulse (float amount, Fvector& vWorldDir, Fvector& vLocalDir); virtual void Hit (SHit* pHDS); - virtual void Die (CObject* who); + virtual void Die (IGameObject* who); virtual void g_WeaponBones (int &L, int &R1, int &R2) = 0; void set_lock_corpse (bool b_l_corpse); bool is_locked_corpse (); @@ -181,7 +181,7 @@ class CEntityAlive : public CEntity { virtual void OnCriticalRadiationHealthLoss() {}; //вызывается если entity умрет от радиации virtual CVisualMemoryManager*visual_memory () const {return(0);} - virtual void net_Relcase (CObject *O); + virtual void net_Relcase (IGameObject *O); public: virtual Fvector predict_position (const float &time_to_check) const; diff --git a/src/xrGame/faster_than_bullets_time.cpp b/src/xrGame/faster_than_bullets_time.cpp index 402ec82af57..7161f5a0b82 100644 --- a/src/xrGame/faster_than_bullets_time.cpp +++ b/src/xrGame/faster_than_bullets_time.cpp @@ -73,7 +73,7 @@ void faster_than_bullets_time::OnPlayerKilled(u16 killer_id, u16 target_id, u16 return; } - CObject* victim_obj = Level().Objects.net_Find(target_id); + IGameObject* victim_obj = Level().Objects.net_Find(target_id); if (!victim_obj) return; diff --git a/src/xrGame/game_cl_artefacthunt.cpp b/src/xrGame/game_cl_artefacthunt.cpp index d368861daa7..5192f6489f8 100644 --- a/src/xrGame/game_cl_artefacthunt.cpp +++ b/src/xrGame/game_cl_artefacthunt.cpp @@ -273,7 +273,7 @@ void game_cl_ArtefactHunt::TranslateGameMessage (u32 msg, NET_Packet& P) Color_Main, *st.translate("mp_art_destroyed")); u16 ArtefactID = P.r_u16(); //------------------------------------------- - CObject* pObj = Level().Objects.net_Find(ArtefactID); + IGameObject* pObj = Level().Objects.net_Find(ArtefactID); if (pObj && xr_strlen(m_Eff_Af_Disappear)) PlayParticleEffect(m_Eff_Af_Disappear.c_str(), pObj->Position()); //------------------------------------------- @@ -318,14 +318,14 @@ void game_cl_ArtefactHunt::GetMapEntities(xr_vector& dst) s16 local_team = local_player->team; - CObject* pObject = Level().Objects.net_Find(artefactID); + IGameObject* pObject = Level().Objects.net_Find(artefactID); if(!pObject) return; CArtefact* pArtefact = smart_cast(pObject); VERIFY(pArtefact); - CObject* pParent = pArtefact->H_Parent(); + IGameObject* pParent = pArtefact->H_Parent(); if(!pParent){// Artefact alone D.color = color_artefact; D.pos = pArtefact->Position(); @@ -334,7 +334,7 @@ void game_cl_ArtefactHunt::GetMapEntities(xr_vector& dst) }; if (pParent && pParent->ID() == artefactBearerID && GetPlayerByGameID(artefactBearerID)){ - CObject* pBearer = Level().Objects.net_Find(artefactBearerID); + IGameObject* pBearer = Level().Objects.net_Find(artefactBearerID); VERIFY(pBearer); D.pos = pBearer->Position(); @@ -698,7 +698,7 @@ bool game_cl_ArtefactHunt::NeedToSendReady_Spectator(int key, game_PlayerState* return res; } -void game_cl_ArtefactHunt::OnSpawn(CObject* pObj) +void game_cl_ArtefactHunt::OnSpawn(IGameObject* pObj) { inherited::OnSpawn(pObj); if (!pObj) return; @@ -710,7 +710,7 @@ void game_cl_ArtefactHunt::OnSpawn(CObject* pObj) }; } -void game_cl_ArtefactHunt::OnDestroy(CObject* pObj) +void game_cl_ArtefactHunt::OnDestroy(IGameObject* pObj) { inherited::OnDestroy(pObj); if (!pObj) return; @@ -738,7 +738,7 @@ void game_cl_ArtefactHunt::LoadSndMessages() void game_cl_ArtefactHunt::OnBuySpawnMenu_Ok () { - CObject* curr = Level().CurrentEntity(); + IGameObject* curr = Level().CurrentEntity(); if (!curr) return; CGameObject* GO = smart_cast(curr); NET_Packet P; diff --git a/src/xrGame/game_cl_artefacthunt.h b/src/xrGame/game_cl_artefacthunt.h index 370fef3b61a..9ea52fad501 100644 --- a/src/xrGame/game_cl_artefacthunt.h +++ b/src/xrGame/game_cl_artefacthunt.h @@ -51,8 +51,8 @@ public : virtual void SetScore (); virtual void OnSellItemsFromRuck (); - virtual void OnSpawn (CObject* pObj); - virtual void OnDestroy (CObject* pObj); + virtual void OnSpawn (IGameObject* pObj); + virtual void OnDestroy (IGameObject* pObj); virtual void SendPickUpEvent (u16 ID_who, u16 ID_what); virtual void OnConnected (); }; diff --git a/src/xrGame/game_cl_base.cpp b/src/xrGame/game_cl_base.cpp index fc9901e90cc..4a8c01b2703 100644 --- a/src/xrGame/game_cl_base.cpp +++ b/src/xrGame/game_cl_base.cpp @@ -292,7 +292,7 @@ void game_cl_GameState::OnGameMessage (NET_Packet& P) game_PlayerState* game_cl_GameState::lookat_player() { - CObject* current_entity = Level().CurrentEntity(); + IGameObject* current_entity = Level().CurrentEntity(); if (current_entity) { return GetPlayerByGameID(current_entity->ID()); @@ -419,7 +419,7 @@ void game_cl_GameState::OnSwitchPhase (u32 old_phase, u32 new_phase) void game_cl_GameState::SendPickUpEvent(u16 ID_who, u16 ID_what) { - CObject* O = Level().Objects.net_Find (ID_what); + IGameObject* O = Level().Objects.net_Find (ID_what); Level().m_feel_deny.feel_touch_deny (O, 1000); NET_Packet P; diff --git a/src/xrGame/game_cl_base.h b/src/xrGame/game_cl_base.h index 8e6283880f1..6d2e56fe6db 100644 --- a/src/xrGame/game_cl_base.h +++ b/src/xrGame/game_cl_base.h @@ -109,8 +109,8 @@ class game_cl_GameState : public game_GameState, public ScheduledBase virtual bool IsEnemy (CEntityAlive* ea1, CEntityAlive* ea2) {return false;}; virtual bool PlayerCanSprint (CActor* pActor) {return true;}; - virtual void OnSpawn (CObject* pObj) {}; - virtual void OnDestroy (CObject* pObj) {}; + virtual void OnSpawn (IGameObject* pObj) {}; + virtual void OnDestroy (IGameObject* pObj) {}; virtual void OnPlayerFlagsChanged (game_PlayerState* ps) {}; virtual void OnNewPlayerConnected (ClientID const & newClient) {}; diff --git a/src/xrGame/game_cl_base_weapon_usage_statistic.cpp b/src/xrGame/game_cl_base_weapon_usage_statistic.cpp index c5f23840312..69ef8bf15d9 100644 --- a/src/xrGame/game_cl_base_weapon_usage_statistic.cpp +++ b/src/xrGame/game_cl_base_weapon_usage_statistic.cpp @@ -543,9 +543,9 @@ void WeaponUsageStatistic::OnBullet_Fire(SBullet* pBullet, const CCartridge& car if (!CollectData()) return; if (!pBullet || !pBullet->flags.allow_sendhit) return; - CObject *object_weapon = Level().Objects.net_Find(pBullet->weapon_id); + IGameObject *object_weapon = Level().Objects.net_Find(pBullet->weapon_id); if (!object_weapon) return; - CObject *object_parent = Level().Objects.net_Find(pBullet->parent_id); + IGameObject *object_parent = Level().Objects.net_Find(pBullet->parent_id); if (!object_parent) return; CActor* pActor = smart_cast(object_parent); if (!pActor) return; @@ -577,7 +577,7 @@ void WeaponUsageStatistic::OnBullet_Hit(SBullet* pBullet, u16 TargetID, s16 elem WeaponIt->m_dwHitsScored++; WeaponIt->m_dwHitsScored_d++; //--------------------------- - CObject *pTarget = Level().Objects.net_Find(TargetID); + IGameObject *pTarget = Level().Objects.net_Find(TargetID); if (!pTarget) return; CActor* pActor = smart_cast(pTarget); if (!pActor) return; @@ -756,7 +756,7 @@ void WeaponUsageStatistic::On_Check_Respond(NET_Packet* P) HitData& HData = *HitIt; HData.Deadly = true; HData.BoneID = BoneID; - CObject* pObj = Level().Objects.net_Find(HData.TargetID); + IGameObject* pObj = Level().Objects.net_Find(HData.TargetID); if (pObj) HData.BoneName = smart_cast(pObj->Visual())->LL_BoneName_dbg(BoneID); @@ -825,7 +825,7 @@ void WeaponUsageStatistic::OnExplosionKill(game_PlayerState* ps, const SHit& hit statistic_sync_quard syncg(m_mutex); - CObject* killer = hit.who; + IGameObject* killer = hit.who; if(!killer) return; u16 killer_id = hit.whoID; @@ -834,7 +834,7 @@ void WeaponUsageStatistic::OnExplosionKill(game_PlayerState* ps, const SHit& hit Player_Statistic& PlayerStatKiller = *(FindPlayer(killerPS->getName())); - CObject* weapon_object = Level().Objects.net_Find(hit.weaponID); + IGameObject* weapon_object = Level().Objects.net_Find(hit.weaponID); WEAPON_STATS_it WeaponIt = PlayerStatKiller.FindPlayersWeapon(weapon_object->cNameSect().c_str()); ++WeaponIt->m_dwHitsScored; ++WeaponIt->m_dwKillsScored; @@ -862,7 +862,7 @@ void WeaponUsageStatistic::OnBleedKill(game_PlayerState* killer_ps, game_PlayerS if (!killer_ps || !victim_ps) return; Player_Statistic& PlayerStatKiller = *(FindPlayer(killer_ps->getName())); - CObject* weapon_object = Level().Objects.net_Find(weapon_id); + IGameObject* weapon_object = Level().Objects.net_Find(weapon_id); if (!weapon_object) return; diff --git a/src/xrGame/game_cl_capture_the_artefact.cpp b/src/xrGame/game_cl_capture_the_artefact.cpp index d508d8ccafb..8f9bbbd4155 100644 --- a/src/xrGame/game_cl_capture_the_artefact.cpp +++ b/src/xrGame/game_cl_capture_the_artefact.cpp @@ -816,7 +816,7 @@ void game_cl_CaptureTheArtefact::UpdateMapLocations() } -void game_cl_CaptureTheArtefact::OnSpawn(CObject* pObj) +void game_cl_CaptureTheArtefact::OnSpawn(IGameObject* pObj) { inherited::OnSpawn(pObj); @@ -884,7 +884,7 @@ void game_cl_CaptureTheArtefact::OnSpawn(CObject* pObj) void game_cl_CaptureTheArtefact::SetInvinciblePlayer(u16 const gameId, bool const invincible) { - CObject* pObject = Level().Objects.net_Find (gameId); + IGameObject* pObject = Level().Objects.net_Find (gameId); if (!pObject) return; @@ -1109,7 +1109,7 @@ bool game_cl_CaptureTheArtefact::NeedToSendReady_Spectator(int key, game_PlayerS void game_cl_CaptureTheArtefact::OnBuySpawnMenu_Ok () { - CObject* curr = Level().CurrentEntity(); + IGameObject* curr = Level().CurrentEntity(); if (!curr) return; @@ -1571,7 +1571,7 @@ void game_cl_CaptureTheArtefact::OnRender() if (ps->testFlag(GAME_PLAYER_FLAG_VERY_VERY_DEAD)) continue; - CObject* pObject = Level().Objects.net_Find(id); + IGameObject* pObject = Level().Objects.net_Find(id); if (!pObject) continue; diff --git a/src/xrGame/game_cl_capture_the_artefact.h b/src/xrGame/game_cl_capture_the_artefact.h index eb9e1167591..019bf53b274 100644 --- a/src/xrGame/game_cl_capture_the_artefact.h +++ b/src/xrGame/game_cl_capture_the_artefact.h @@ -101,7 +101,7 @@ class game_cl_CaptureTheArtefact : public game_cl_mp virtual bool OnKeyboardPress(int key); virtual bool OnKeyboardRelease(int key); - virtual void OnSpawn(CObject* pObj); + virtual void OnSpawn(IGameObject* pObj); virtual BOOL CanCallBuyMenu(); virtual BOOL CanCallSkinMenu() {return TRUE;}; virtual BOOL CanCallTeamSelectMenu(); diff --git a/src/xrGame/game_cl_capture_the_artefact_captions_manager.cpp b/src/xrGame/game_cl_capture_the_artefact_captions_manager.cpp index 00d57579617..d7164070c67 100644 --- a/src/xrGame/game_cl_capture_the_artefact_captions_manager.cpp +++ b/src/xrGame/game_cl_capture_the_artefact_captions_manager.cpp @@ -52,7 +52,7 @@ void CTAGameClCaptionsManager::ShowInProgressCaptions() if (parent_game_object->HasTimeLimit()) parent_game_ui->SetTimeMsgCaption(timelimit_message); - CObject* control_entity = Level().CurrentControlEntity(); + IGameObject* control_entity = Level().CurrentControlEntity(); if (!control_entity) return; diff --git a/src/xrGame/game_cl_capture_the_artefact_messages_menu.cpp b/src/xrGame/game_cl_capture_the_artefact_messages_menu.cpp index 0f9d261b098..1083af1ae5d 100644 --- a/src/xrGame/game_cl_capture_the_artefact_messages_menu.cpp +++ b/src/xrGame/game_cl_capture_the_artefact_messages_menu.cpp @@ -58,7 +58,7 @@ void game_cl_CaptureTheArtefact::OnSpeechMessage(NET_Packet& P) } else { - CObject* pObj = Level().Objects.net_Find(ps->GameID); + IGameObject* pObj = Level().Objects.net_Find(ps->GameID); if (pObj) { pMSound->mSound_Voice.play_at_pos(pObj, pObj->Position()); diff --git a/src/xrGame/game_cl_deathmatch.cpp b/src/xrGame/game_cl_deathmatch.cpp index e89e2765be4..2a804f18d64 100644 --- a/src/xrGame/game_cl_deathmatch.cpp +++ b/src/xrGame/game_cl_deathmatch.cpp @@ -203,7 +203,7 @@ void game_cl_Deathmatch::OnSkinMenuBack () void game_cl_Deathmatch::OnSkinMenu_Ok () { - CObject *l_pObj = Level().CurrentEntity(); + IGameObject *l_pObj = Level().CurrentEntity(); CGameObject *l_pPlayer = smart_cast(l_pObj); if(!l_pPlayer) return; @@ -924,7 +924,7 @@ void game_cl_Deathmatch::GetMapEntities(xr_vector& dst) game_PlayerState* ps = it->second; u16 id = ps->GameID; if (ps->testFlag(GAME_PLAYER_FLAG_VERY_VERY_DEAD)) continue; - CObject* pObject = Level().Objects.net_Find(id); + IGameObject* pObject = Level().Objects.net_Find(id); if (!pObject) continue; if (!pObject || !smart_cast(pObject)) continue; @@ -957,7 +957,7 @@ void game_cl_Deathmatch::OnRender () u16 id = ps->GameID; if (ps->testFlag(GAME_PLAYER_FLAG_VERY_VERY_DEAD)) continue; if (!ps->testFlag(GAME_PLAYER_FLAG_INVINCIBLE)) continue; - CObject* pObject = Level().Objects.net_Find(id); + IGameObject* pObject = Level().Objects.net_Find(id); if (!pObject) continue; if (!pObject || !smart_cast(pObject)) continue; if (ps == local_player) continue; @@ -1001,7 +1001,7 @@ void game_cl_Deathmatch::PlayParticleEffect(LPCSTR EffName, Fvector& pos) GamePersistent().ps_needtoplay.push_back(ps); } -void game_cl_Deathmatch::OnSpawn(CObject* pObj) +void game_cl_Deathmatch::OnSpawn(IGameObject* pObj) { inherited::OnSpawn(pObj); if (!pObj) return; @@ -1194,7 +1194,7 @@ void game_cl_Deathmatch::OnPlayerFlagsChanged(game_PlayerState* ps) return; } - CObject* pObject = Level().Objects.net_Find(ps->GameID); + IGameObject* pObject = Level().Objects.net_Find(ps->GameID); if (!pObject) return; if (!smart_cast(pObject)) return; diff --git a/src/xrGame/game_cl_deathmatch.h b/src/xrGame/game_cl_deathmatch.h index f29c49ef1ab..417fd2a4c5b 100644 --- a/src/xrGame/game_cl_deathmatch.h +++ b/src/xrGame/game_cl_deathmatch.h @@ -138,7 +138,7 @@ public : virtual bool IsEnemy (game_PlayerState* ps); virtual bool IsEnemy (CEntityAlive* ea1, CEntityAlive* ea2); - virtual void OnSpawn (CObject* pObj); + virtual void OnSpawn (IGameObject* pObj); virtual void OnSwitchPhase (u32 old_phase, u32 new_phase); virtual void OnRankChanged (u8 OldRank); virtual void PlayRankChangesSndMessage (); diff --git a/src/xrGame/game_cl_deathmatch_buywnd.cpp b/src/xrGame/game_cl_deathmatch_buywnd.cpp index e0b3df25e34..cb238630cc6 100644 --- a/src/xrGame/game_cl_deathmatch_buywnd.cpp +++ b/src/xrGame/game_cl_deathmatch_buywnd.cpp @@ -27,7 +27,7 @@ s16 game_cl_Deathmatch::GetBuyMenuItemIndex (u8 Addons, u8 ItemID) void game_cl_Deathmatch::OnBuyMenu_Ok () { if (!m_bBuyEnabled) return; - CObject *l_pObj = Level().CurrentEntity(); + IGameObject *l_pObj = Level().CurrentEntity(); CGameObject *l_pPlayer = smart_cast(l_pObj); if(!l_pPlayer) return; diff --git a/src/xrGame/game_cl_mp.cpp b/src/xrGame/game_cl_mp.cpp index 8c65ab36a91..8287ce107a6 100644 --- a/src/xrGame/game_cl_mp.cpp +++ b/src/xrGame/game_cl_mp.cpp @@ -182,7 +182,7 @@ bool game_cl_mp::OnKeyboardPress(int key) { bool b_need_to_send_ready = false; - CObject* curr = Level().CurrentControlEntity(); + IGameObject* curr = Level().CurrentControlEntity(); if (!curr) return(false); bool is_actor = !!smart_cast(curr); @@ -822,8 +822,8 @@ void game_cl_mp::OnPlayerKilled (NET_Packet& P) if (m_reward_generator) m_reward_generator->OnPlayerKilled(KillerID, KilledID, WeaponID, std::make_pair(KillType, SpecialKill)); //----------------------------------------------------------- - CObject* pOKiller = Level().Objects.net_Find(KillerID); - CObject* pWeapon = Level().Objects.net_Find(WeaponID); + IGameObject* pOKiller = Level().Objects.net_Find(KillerID); + IGameObject* pWeapon = Level().Objects.net_Find(WeaponID); game_PlayerState* pPlayer = GetPlayerByGameID(KilledID); if (!pPlayer) @@ -1069,7 +1069,7 @@ void game_cl_mp::OnPlayerChangeName (NET_Packet& P) if(CurrentGameUI()) CurrentGameUI()->CommonMessageOut(resStr); Msg( NewName ); //------------------------------------------- - CObject* pObj = Level().Objects.net_Find(ObjID); + IGameObject* pObj = Level().Objects.net_Find(ObjID); if (pObj) { pObj->cName_set(NewName); @@ -1265,7 +1265,7 @@ void game_cl_mp::OnEventMoneyChanged (NET_Packet& P) void game_cl_mp::OnSpectatorSelect () { - CObject *l_pObj = Level().CurrentEntity(); + IGameObject *l_pObj = Level().CurrentEntity(); CGameObject *l_pPlayer = smart_cast(l_pObj); if(!l_pPlayer) return; @@ -1923,7 +1923,7 @@ void game_cl_mp::extract_server_info(u8* data_ptr, u32 data_size) void game_cl_mp::AddRewardTask(u32 const award_id) { - CObject* tmp_view_entity = Level().CurrentViewEntity(); + IGameObject* tmp_view_entity = Level().CurrentViewEntity(); if ((tmp_view_entity && local_player) && (tmp_view_entity->ID() == local_player->GameID)) { diff --git a/src/xrGame/game_cl_mp_messages_menu.cpp b/src/xrGame/game_cl_mp_messages_menu.cpp index 2b9550ea4c1..7af24723f90 100644 --- a/src/xrGame/game_cl_mp_messages_menu.cpp +++ b/src/xrGame/game_cl_mp_messages_menu.cpp @@ -184,7 +184,7 @@ void game_cl_mp::OnSpeechMessage (NET_Packet& P) } else { - CObject* pObj = Level().Objects.net_Find(ps->GameID); + IGameObject* pObj = Level().Objects.net_Find(ps->GameID); if (pObj) { pMSound->mSound_Voice.play_at_pos(pObj, pObj->Position()); diff --git a/src/xrGame/game_cl_teamdeathmatch.cpp b/src/xrGame/game_cl_teamdeathmatch.cpp index fb3ef8c71dc..8495d36da5b 100644 --- a/src/xrGame/game_cl_teamdeathmatch.cpp +++ b/src/xrGame/game_cl_teamdeathmatch.cpp @@ -208,7 +208,7 @@ void game_cl_TeamDeathmatch::GetMapEntities(xr_vector& dst) for(;it!=players.end();++it){ if(local_team == it->second->team){ u16 id = it->second->GameID; - CObject* pObject = Level().Objects.net_Find(id); + IGameObject* pObject = Level().Objects.net_Find(id); if (!pObject) continue; if (!pObject || !smart_cast(pObject)) continue; @@ -280,7 +280,7 @@ void game_cl_TeamDeathmatch::OnTeamSelect(int Team) if (NeedToSendTeamSelect) { - CObject *l_pObj = Level().CurrentEntity(); + IGameObject *l_pObj = Level().CurrentEntity(); CGameObject *l_pPlayer = smart_cast(l_pObj); if(!l_pPlayer) return; @@ -534,7 +534,7 @@ void game_cl_TeamDeathmatch::OnRender () game_PlayerState* ps = it->second; u16 id = ps->GameID; if (ps->testFlag(GAME_PLAYER_FLAG_VERY_VERY_DEAD)) continue; - CObject* pObject = Level().Objects.net_Find(id); + IGameObject* pObject = Level().Objects.net_Find(id); if (!pObject) continue; if (!pObject || !smart_cast(pObject)) continue; if (IsEnemy(ps)) continue; @@ -663,7 +663,7 @@ void game_cl_TeamDeathmatch::UpdateMapLocations () continue; }; - CObject* pObject = Level().Objects.net_Find(id); + IGameObject* pObject = Level().Objects.net_Find(id); if (!pObject || !smart_cast(pObject)) continue; if (IsEnemy(ps)) { diff --git a/src/xrGame/game_events_handler.h b/src/xrGame/game_events_handler.h index e423126b351..86f4112a5f4 100644 --- a/src/xrGame/game_events_handler.h +++ b/src/xrGame/game_events_handler.h @@ -14,7 +14,7 @@ class game_events_handler virtual void OnWeapon_Fire (u16 sender, u16 sender_weapon_id) = 0; virtual void OnBullet_Fire (u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction) = 0; - virtual void OnBullet_Hit (CObject const * hitter, CObject const * victim, CObject const * weapon, u16 const bone) = 0; + virtual void OnBullet_Hit (IGameObject const * hitter, IGameObject const * victim, IGameObject const * weapon, u16 const bone) = 0; virtual void OnArtefactSpawned () = 0; virtual void OnPlayerTakeArtefact (game_PlayerState const * ps) = 0; virtual void OnPlayerDropArtefact (game_PlayerState const * ps) = 0; diff --git a/src/xrGame/game_state_accumulator.cpp b/src/xrGame/game_state_accumulator.cpp index cc4900c9295..bea291c75a8 100644 --- a/src/xrGame/game_state_accumulator.cpp +++ b/src/xrGame/game_state_accumulator.cpp @@ -85,7 +85,7 @@ void game_state_accumulator::OnBullet_Fire(u16 sender, } } -void game_state_accumulator::OnBullet_Hit(CObject const * hitter, CObject const * victim, CObject const * weapon, u16 const bone) +void game_state_accumulator::OnBullet_Hit(IGameObject const * hitter, IGameObject const * victim, IGameObject const * weapon, u16 const bone) { if (!hitter || !victim || !weapon) return; @@ -156,8 +156,8 @@ void game_state_accumulator::OnPlayerKilled(u16 killer_id, u16 target_id, u16 we if (!is_enemies(killer_id, target_id)) return; - CObject* killer_obj = Level().Objects.net_Find(killer_id); - CObject* victim_obj = Level().Objects.net_Find(target_id); + IGameObject* killer_obj = Level().Objects.net_Find(killer_id); + IGameObject* victim_obj = Level().Objects.net_Find(target_id); if (killer_obj && victim_obj) { m_kills.add_kill( @@ -208,7 +208,7 @@ void game_state_accumulator::OnRoundStart() } } -u16 game_state_accumulator::get_object_id(CObject const * obj) +u16 game_state_accumulator::get_object_id(IGameObject const * obj) { if (!obj) return 0; @@ -224,7 +224,7 @@ u16 game_state_accumulator::get_object_id(CObject const * obj) u16 game_state_accumulator::get_object_id(u16 item_object_id) { - CObject *tmp_object = Level().Objects.net_Find(item_object_id); + IGameObject *tmp_object = Level().Objects.net_Find(item_object_id); if (!tmp_object ) return 0; @@ -467,7 +467,7 @@ CWeapon* game_state_accumulator::get_active_weapon(game_PlayerState* player) if (!player) return NULL; - CObject* tmp_obj = Level().Objects.net_Find(player->GameID); + IGameObject* tmp_obj = Level().Objects.net_Find(player->GameID); if (!tmp_obj) return NULL; @@ -488,7 +488,7 @@ CWeapon* game_state_accumulator::get_active_weapon(game_PlayerState* player) CActor* game_state_accumulator::get_players_actor(u16 game_id) { - CObject* tmp_obj = Level().Objects.net_Find(game_id); + IGameObject* tmp_obj = Level().Objects.net_Find(game_id); if (!tmp_obj) return NULL; diff --git a/src/xrGame/game_state_accumulator.h b/src/xrGame/game_state_accumulator.h index 9f66bb8fbf0..d7cd5bb2adb 100644 --- a/src/xrGame/game_state_accumulator.h +++ b/src/xrGame/game_state_accumulator.h @@ -32,7 +32,7 @@ class game_state_accumulator : public game_events_handler void init_bone_groups (CActor* first_spawned_actor); u16 get_object_id (u16 item_object_id); - u16 get_object_id (CObject const * obj); + u16 get_object_id (IGameObject const * obj); bool is_item_in_group (u16 item_id, ammunition_group::enum_group_id gid); bool is_bone_in_group (u16 bone_id, bone_group::enum_group_id gid); u16 get_armor_of_player (game_PlayerState* player); @@ -50,7 +50,7 @@ class game_state_accumulator : public game_events_handler virtual void OnWeapon_Fire (u16 sender, u16 sender_weapon_id); virtual void OnBullet_Fire (u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction); - virtual void OnBullet_Hit (CObject const * hitter, CObject const * victim, CObject const * weapon, u16 const bone); + virtual void OnBullet_Hit (IGameObject const * hitter, IGameObject const * victim, IGameObject const * weapon, u16 const bone); virtual void OnArtefactSpawned (); virtual void OnPlayerTakeArtefact (game_PlayerState const * ps); virtual void OnPlayerDropArtefact (game_PlayerState const * ps); diff --git a/src/xrGame/game_sv_artefacthunt.cpp b/src/xrGame/game_sv_artefacthunt.cpp index 277a7355f70..147a7f17b27 100644 --- a/src/xrGame/game_sv_artefacthunt.cpp +++ b/src/xrGame/game_sv_artefacthunt.cpp @@ -288,7 +288,7 @@ bool game_sv_ArtefactHunt::assign_rp_tmp( game_PlayerState* ps_who, return; if (tmp_ps->testFlag(GAME_PLAYER_FLAG_VERY_VERY_DEAD)) return; - CObject* tmp_player = Level().Objects.net_Find(tmp_ps->GameID); + IGameObject* tmp_player = Level().Objects.net_Find(tmp_ps->GameID); if (!tmp_player) return; @@ -426,7 +426,7 @@ struct RemoveBlockedRPointPredicate : public std::unary_function rp->bBlocked = false; return true; } - CObject* pPlayer = Level().Objects.net_Find(rp->BlockedByID); + IGameObject* pPlayer = Level().Objects.net_Find(rp->BlockedByID); if (!pPlayer || (rp->P.distance_to(pPlayer->Position()) <= 0.4f)) { @@ -457,7 +457,7 @@ void game_sv_ArtefactHunt::CheckRPUnblock () rpointsBlocked.erase (rpointsBlocked.begin()+b); continue; }; - CObject* pPlayer = Level().Objects.net_Find(pRP->BlockedByID); + IGameObject* pPlayer = Level().Objects.net_Find(pRP->BlockedByID); if (!pPlayer || pRP->P.distance_to(pPlayer->Position())<=0.4f) { pRP->bBlocked = false; diff --git a/src/xrGame/game_sv_base.cpp b/src/xrGame/game_sv_base.cpp index c5d8607dae7..c714d4b63b2 100644 --- a/src/xrGame/game_sv_base.cpp +++ b/src/xrGame/game_sv_base.cpp @@ -1182,7 +1182,7 @@ void game_sv_GameState::OnRender () game_PlayerState* PS = get_it (p_it); if (!PS) continue; if (PS->testFlag(GAME_PLAYER_FLAG_VERY_VERY_DEAD)) continue; - CObject* pPlayer = Level().Objects.net_Find(PS->GameID); + IGameObject* pPlayer = Level().Objects.net_Find(PS->GameID); if (!pPlayer) continue; if (rp.P.distance_to(pPlayer->Position())<=0.4f) @@ -1222,7 +1222,7 @@ void game_sv_GameState::OnRender () game_PlayerState* PS = get_it (p_it); if (!PS) continue; if (PS->testFlag(GAME_PLAYER_FLAG_VERY_VERY_DEAD)) continue; - CObject* pPlayer = Level().Objects.net_Find(PS->GameID); + IGameObject* pPlayer = Level().Objects.net_Find(PS->GameID); if (!pPlayer) continue; float r = .4f; diff --git a/src/xrGame/game_sv_capture_the_artefact.cpp b/src/xrGame/game_sv_capture_the_artefact.cpp index 47ddf11b5bf..093f93c6665 100644 --- a/src/xrGame/game_sv_capture_the_artefact.cpp +++ b/src/xrGame/game_sv_capture_the_artefact.cpp @@ -184,7 +184,7 @@ void game_sv_CaptureTheArtefact::SM_CheckViewSwitching() CUIGameCTA* gameCTA = smart_cast(CurrentGameUI()); if (gameCTA) { - CObject* pObject = Level().CurrentViewEntity(); + IGameObject* pObject = Level().CurrentViewEntity(); if (pObject && smart_cast(pObject)) { string1024 Text; @@ -196,7 +196,7 @@ void game_sv_CaptureTheArtefact::SM_CheckViewSwitching() } } -void game_sv_CaptureTheArtefact::SM_SwitchOnPlayer(CObject* pNewObject) +void game_sv_CaptureTheArtefact::SM_SwitchOnPlayer(IGameObject* pNewObject) { if (!pNewObject) return; @@ -246,7 +246,7 @@ void game_sv_CaptureTheArtefact::SM_SwitchOnNextActivePlayer() m_server->ForEachClientDo(tmp_functor); - CObject* pNewObject = NULL; + IGameObject* pNewObject = NULL; if (!tmp_functor.PPlayersCount) { xrClientData* C = (xrClientData*) m_server->GetServerClient(); diff --git a/src/xrGame/game_sv_capture_the_artefact.h b/src/xrGame/game_sv_capture_the_artefact.h index cefd899d8cb..638b8763410 100644 --- a/src/xrGame/game_sv_capture_the_artefact.h +++ b/src/xrGame/game_sv_capture_the_artefact.h @@ -91,11 +91,11 @@ class game_sv_CaptureTheArtefact : public game_sv_mp u32 m_dwSM_SwitchDelta; u32 m_dwSM_LastSwitchTime; u32 m_dwSM_CurViewEntity; - CObject * m_pSM_CurViewEntity; + IGameObject * m_pSM_CurViewEntity; //static const float spectr_cam_inert_value; //float prev_cam_inert_value; void SM_SwitchOnNextActivePlayer (); - void SM_SwitchOnPlayer (CObject* pNewObject); + void SM_SwitchOnPlayer (IGameObject* pNewObject); void SM_CheckViewSwitching(); void LoadAnomalySet(); diff --git a/src/xrGame/game_sv_deathmatch.cpp b/src/xrGame/game_sv_deathmatch.cpp index 2d294e9d4f3..2dc65670a30 100644 --- a/src/xrGame/game_sv_deathmatch.cpp +++ b/src/xrGame/game_sv_deathmatch.cpp @@ -436,7 +436,7 @@ void game_sv_Deathmatch::Update() if(GameDM) { - CObject* pObject = Level().CurrentViewEntity(); + IGameObject* pObject = Level().CurrentViewEntity(); if (pObject && smart_cast(pObject)) { string1024 Text; @@ -575,7 +575,7 @@ void game_sv_Deathmatch::SM_SwitchOnNextActivePlayer() m_server->ForEachClientDo(tmp_functor); - CObject* pNewObject = NULL; + IGameObject* pNewObject = NULL; if (!tmp_functor.PPlayersCount) { xrClientData* C = (xrClientData*) m_server->GetServerClient(); @@ -596,14 +596,14 @@ void game_sv_Deathmatch::SM_SwitchOnNextActivePlayer() #include "WeaponHUD.h" -void game_sv_Deathmatch::net_Relcase(CObject* O) +void game_sv_Deathmatch::net_Relcase(IGameObject* O) { if(m_pSM_CurViewEntity==O) m_pSM_CurViewEntity = NULL; } -void game_sv_Deathmatch::SM_SwitchOnPlayer(CObject* pNewObject) +void game_sv_Deathmatch::SM_SwitchOnPlayer(IGameObject* pNewObject) { if (!pNewObject) return; diff --git a/src/xrGame/game_sv_deathmatch.h b/src/xrGame/game_sv_deathmatch.h index a72561bc1a6..4b61ec58787 100644 --- a/src/xrGame/game_sv_deathmatch.h +++ b/src/xrGame/game_sv_deathmatch.h @@ -65,9 +65,9 @@ class game_sv_Deathmatch : public game_sv_mp,private pure_relcase u32 m_dwSM_SwitchDelta; u32 m_dwSM_LastSwitchTime; u32 m_dwSM_CurViewEntity; - CObject * m_pSM_CurViewEntity; + IGameObject * m_pSM_CurViewEntity; void SM_SwitchOnNextActivePlayer (); - void SM_SwitchOnPlayer (CObject* pNewObject); + void SM_SwitchOnPlayer (IGameObject* pNewObject); BOOL Is_Anomaly_InLists (CSE_Abstract* E); @@ -97,7 +97,7 @@ class game_sv_Deathmatch : public game_sv_mp,private pure_relcase u32 m_dwWarmUp_CurTime; bool m_bInWarmUp; - void __stdcall net_Relcase (CObject* O); + void __stdcall net_Relcase (IGameObject* O); public: game_sv_Deathmatch (); diff --git a/src/xrGame/game_sv_mp.cpp b/src/xrGame/game_sv_mp.cpp index d18fce2919c..c32d25a512f 100644 --- a/src/xrGame/game_sv_mp.cpp +++ b/src/xrGame/game_sv_mp.cpp @@ -237,7 +237,7 @@ struct real_sender void game_sv_mp::KillPlayer (ClientID id_who, u16 GameID) { - CObject* pObject = Level().Objects.net_Find(GameID); + IGameObject* pObject = Level().Objects.net_Find(GameID); if (!pObject || !smart_cast(pObject)) return; // Remove everything xrClientData* xrCData = m_server->ID_to_client(id_who); @@ -610,7 +610,7 @@ void game_sv_mp::AllowDeadBodyRemove(ClientID id, u16 GameID) if (pSObject) pSObject->owner = (xrClientData*)m_server->GetServerClient(); - CObject* pObject = Level().Objects.net_Find(GameID); + IGameObject* pObject = Level().Objects.net_Find(GameID); if (pObject && smart_cast(pObject)) @@ -691,7 +691,7 @@ bool game_sv_mp::GetPosAngleFromActor (ClientID id, Fvector& Pos, Fvector &An xrClientData* xrCData = m_server->ID_to_client(id); if (!xrCData || !xrCData->owner) return false; - CObject* pObject = Level().Objects.net_Find(xrCData->owner->ID); + IGameObject* pObject = Level().Objects.net_Find(xrCData->owner->ID); /// R_ASSERT2 ((pObject && smart_cast(pObject)),"Dead Player is not Actor"); if (!pObject || !smart_cast(pObject)) return false; diff --git a/src/xrGame/harvest_time.cpp b/src/xrGame/harvest_time.cpp index 00d0389c882..1ff41041a31 100644 --- a/src/xrGame/harvest_time.cpp +++ b/src/xrGame/harvest_time.cpp @@ -77,7 +77,7 @@ void harvest_time::OnPlayerKilled(u16 killer_id, if (killer_id != tmp_local_player->GameID) return; - CObject* victim_obj = Level().Objects.net_Find(target_id); + IGameObject* victim_obj = Level().Objects.net_Find(target_id); if (!victim_obj) return; diff --git a/src/xrGame/helicopter.h b/src/xrGame/helicopter.h index 743c7af73fb..b6bb804c48e 100644 --- a/src/xrGame/helicopter.h +++ b/src/xrGame/helicopter.h @@ -273,7 +273,7 @@ class CHelicopter : public CEntity, virtual void net_Destroy (); virtual void net_Export (NET_Packet &P){}; virtual void net_Import (NET_Packet &P){}; - virtual void net_Relcase (CObject* O ); + virtual void net_Relcase (IGameObject* O ); virtual void save (NET_Packet &output_packet); virtual void load (IReader &input_packet); @@ -294,7 +294,7 @@ class CHelicopter : public CEntity, virtual void Hit (SHit* pHDS); virtual void PHHit (SHit &H); //CEntity - virtual void HitSignal (float P, Fvector &local_dir, CObject* who, s16 element){;} + virtual void HitSignal (float P, Fvector &local_dir, IGameObject* who, s16 element){;} virtual void HitImpulse (float P, Fvector &vWorldDir, Fvector& vLocalDir){;} virtual const Fmatrix& get_ParticlesXFORM (); @@ -307,7 +307,7 @@ class CHelicopter : public CEntity, public: //for scripting bool isVisible (CScriptGameObject* O); - bool isObjectVisible (CObject* O); + bool isObjectVisible (IGameObject* O); bool isOnAttack () {return m_enemy.type!=eEnemyNone;} void goPatrolByPatrolPath (LPCSTR path_name,int start_idx); diff --git a/src/xrGame/hit_memory_manager.cpp b/src/xrGame/hit_memory_manager.cpp index 7ecd19540a7..961bc38be0f 100644 --- a/src/xrGame/hit_memory_manager.cpp +++ b/src/xrGame/hit_memory_manager.cpp @@ -29,9 +29,9 @@ #endif // MASTER_GOLD struct CHitObjectPredicate { - const CObject *m_object; + const IGameObject *m_object; - CHitObjectPredicate (const CObject *object) : + CHitObjectPredicate (const IGameObject *object) : m_object (object) { } @@ -91,7 +91,7 @@ void CHitMemoryManager::reload (LPCSTR section) m_max_hit_count = READ_IF_EXISTS(pSettings,r_s32,section,"DynamicHitCount",1); } -void CHitMemoryManager::add (float amount, const Fvector &vLocalDir, const CObject *who, s16 element) +void CHitMemoryManager::add (float amount, const Fvector &vLocalDir, const IGameObject *who, s16 element) { #ifndef MASTER_GOLD if (who && smart_cast(who) && psAI_Flags.test(aiIgnoreActor)) @@ -224,7 +224,7 @@ void CHitMemoryManager::update() STOP_PROFILE } -void CHitMemoryManager::enable (const CObject *object, bool enable) +void CHitMemoryManager::enable (const IGameObject *object, bool enable) { HITS::iterator J = std::find(m_hits->begin(),m_hits->end(),object_id(object)); if (J == m_hits->end()) @@ -233,7 +233,7 @@ void CHitMemoryManager::enable (const CObject *object, bool enable) (*J).m_enabled = enable; } -void CHitMemoryManager::remove_links (CObject *object) +void CHitMemoryManager::remove_links (IGameObject *object) { if (m_last_hit_object_id == object->ID()) { m_last_hit_object_id = ALife::_OBJECT_ID(-1); @@ -389,7 +389,7 @@ void CHitMemoryManager::clear_delayed_objects() m_delayed_objects.clear (); } -void CHitMemoryManager::on_requested_spawn (CObject *object) +void CHitMemoryManager::on_requested_spawn (IGameObject *object) { DELAYED_HIT_OBJECTS::iterator I = m_delayed_objects.begin(); DELAYED_HIT_OBJECTS::iterator E = m_delayed_objects.end(); diff --git a/src/xrGame/hit_memory_manager.h b/src/xrGame/hit_memory_manager.h index c04e2fb9aeb..e89289ba04b 100644 --- a/src/xrGame/hit_memory_manager.h +++ b/src/xrGame/hit_memory_manager.h @@ -55,11 +55,11 @@ class CHitMemoryManager { virtual void reinit (); virtual void reload (LPCSTR section); virtual void update (); - void remove_links (CObject *object); + void remove_links (IGameObject *object); public: void add (const CEntityAlive *who); - void add (float amount, const Fvector &local_direction, const CObject *who, s16 element); + void add (float amount, const Fvector &local_direction, const IGameObject *who, s16 element); void add (const CHitObject &hit_object); public: @@ -73,13 +73,13 @@ class CHitMemoryManager { IC u32 const & last_hit_time () const; public: - void enable (const CObject *object, bool enable); + void enable (const IGameObject *object, bool enable); CCustomMonster &object () const; public: void save (NET_Packet &packet) const; void load (IReader &packet); - void on_requested_spawn (CObject *object); + void on_requested_spawn (IGameObject *object); private: void clear_delayed_objects (); diff --git a/src/xrGame/ik_foot_collider.cpp b/src/xrGame/ik_foot_collider.cpp index 36a47c04d1d..3596dd72a71 100644 --- a/src/xrGame/ik_foot_collider.cpp +++ b/src/xrGame/ik_foot_collider.cpp @@ -62,7 +62,7 @@ bool ignore_static_tri( int tri ) return ignore_tri( *triangle ); } -IC bool ignore_object( CObject *O ) +IC bool ignore_object( IGameObject *O ) { VERIFY( O ); if( static_cast( O )->cast_entity_alive() /*&& static_cast( O )->cast_entity_alive()->g_Alive() */) @@ -177,7 +177,7 @@ IC bool get_plane( ik_pick_result &r, Fvector &next_pos, float &next_range, con return get_plane_dynamic( r, next_pos, next_range, R, pick_dist, pos, pick_v ); } -bool Pick( ik_pick_result &r, const ik_pick_query &q , CObject* ignore_object) +bool Pick( ik_pick_result &r, const ik_pick_query &q , IGameObject* ignore_object) { VERIFY( q.is_valid() ); diff --git a/src/xrGame/imotion_position.cpp b/src/xrGame/imotion_position.cpp index be7a7666c85..409412177b1 100644 --- a/src/xrGame/imotion_position.cpp +++ b/src/xrGame/imotion_position.cpp @@ -378,8 +378,8 @@ float imotion_position::advance_animation( float dt, IKinematicsAnimated& KA ) } #ifdef DEBUG -void DBG_DrawBones( CObject &O ); -void DBG_PhysBones( CObject &O ); +void DBG_DrawBones( IGameObject &O ); +void DBG_PhysBones( IGameObject &O ); void collide_anim_dbg_draw( CPhysicsShell *shell, float dt ) { VERIFY( shell ); diff --git a/src/xrGame/inventory_item.cpp b/src/xrGame/inventory_item.cpp index 23a41fa0f65..ed0fb81c946 100644 --- a/src/xrGame/inventory_item.cpp +++ b/src/xrGame/inventory_item.cpp @@ -74,7 +74,7 @@ CInventoryItem::~CInventoryItem() (std::find( m_pInventory->m_all.begin(),m_pInventory->m_all.end(), this)==m_pInventory->m_all.end()) ); if(!B_GOOD) { - CObject* p = object().H_Parent(); + IGameObject* p = object().H_Parent(); Msg("inventory ptr is [%s]",m_pInventory?"not-null":"null"); if(p) Msg("parent name is [%s]",p->cName().c_str()); diff --git a/src/xrGame/inventory_owner_info.cpp b/src/xrGame/inventory_owner_info.cpp index 3bf3682d10e..25feefbb518 100644 --- a/src/xrGame/inventory_owner_info.cpp +++ b/src/xrGame/inventory_owner_info.cpp @@ -98,7 +98,7 @@ void CInventoryOwner::OnDisableInfo(shared_str info_id) const void CInventoryOwner::TransferInfo(shared_str info_id, bool add_info) const { VERIFY( info_id.size() ); - const CObject* pThisObject = smart_cast(this); VERIFY(pThisObject); + const IGameObject* pThisObject = smart_cast(this); VERIFY(pThisObject); //отправляем от нашему PDA пакет информации с номером NET_Packet P; diff --git a/src/xrGame/inventory_quickswitch.cpp b/src/xrGame/inventory_quickswitch.cpp index b0aa6a97310..7358a87844a 100644 --- a/src/xrGame/inventory_quickswitch.cpp +++ b/src/xrGame/inventory_quickswitch.cpp @@ -131,7 +131,7 @@ bool CInventory::ActivateNextItemInActiveSlot() return false; } - CObject* pActor_owner = smart_cast(m_pOwner); + IGameObject* pActor_owner = smart_cast(m_pOwner); if ( Level().CurrentViewEntity() != pActor_owner ) { return false; diff --git a/src/xrGame/item_manager.cpp b/src/xrGame/item_manager.cpp index 38244838b7f..6201a0db4d7 100644 --- a/src/xrGame/item_manager.cpp +++ b/src/xrGame/item_manager.cpp @@ -122,7 +122,7 @@ void CItemManager::update () STOP_PROFILE } -void CItemManager::remove_links (CObject *object) +void CItemManager::remove_links (IGameObject *object) { // since we use no members in CGameObject during search, // we just use the pinter itself, we can just statically cast object diff --git a/src/xrGame/item_manager.h b/src/xrGame/item_manager.h index b990f351580..d026fb04b79 100644 --- a/src/xrGame/item_manager.h +++ b/src/xrGame/item_manager.h @@ -29,6 +29,6 @@ class CItemManager : public CObjectManager { virtual float evaluate (const CGameObject *object) const; virtual float do_evaluate (const CGameObject *object) const; virtual void update (); - void remove_links (CObject *object); + void remove_links (IGameObject *object); virtual void on_restrictions_change (); }; \ No newline at end of file diff --git a/src/xrGame/level_changer.cpp b/src/xrGame/level_changer.cpp index f8984656c3f..b216b41e8a7 100644 --- a/src/xrGame/level_changer.cpp +++ b/src/xrGame/level_changer.cpp @@ -109,7 +109,7 @@ void CLevelChanger::shedule_Update(u32 dt) } #include "patrol_path.h" #include "patrol_path_storage.h" -void CLevelChanger::feel_touch_new (CObject *tpObject) +void CLevelChanger::feel_touch_new (IGameObject *tpObject) { CActor* l_tpActor = smart_cast(tpObject); VERIFY (l_tpActor); @@ -162,7 +162,7 @@ bool CLevelChanger::get_reject_pos(Fvector& p, Fvector& r) return false; } -bool CLevelChanger::feel_touch_contact (CObject *object) +bool CLevelChanger::feel_touch_contact (IGameObject *object) { bool bRes = (((CCF_Shape*)GetCForm())->Contact(object)); bRes = bRes && smart_cast(object) && smart_cast(object)->g_Alive(); @@ -172,8 +172,8 @@ bool CLevelChanger::feel_touch_contact (CObject *object) void CLevelChanger::update_actor_invitation() { if(m_bSilentMode) return; - xr_vector::iterator it = feel_touch.begin(); - xr_vector::iterator it_e = feel_touch.end(); + xr_vector::iterator it = feel_touch.begin(); + xr_vector::iterator it_e = feel_touch.end(); for(;it!=it_e;++it){ CActor* l_tpActor = smart_cast(*it); diff --git a/src/xrGame/level_changer.h b/src/xrGame/level_changer.h index 42daf1f0908..05114eddb58 100644 --- a/src/xrGame/level_changer.h +++ b/src/xrGame/level_changer.h @@ -36,8 +36,8 @@ class CLevelChanger : public CGameObject, public Feel::Touch { virtual void Center (Fvector& C) const; virtual float Radius () const; virtual void shedule_Update (u32 dt); - virtual void feel_touch_new (CObject* O); - virtual bool feel_touch_contact (CObject* O); + virtual void feel_touch_new (IGameObject* O); + virtual bool feel_touch_contact (IGameObject* O); virtual bool IsVisibleForZones() { return false;} void EnableLevelChanger (bool b) {m_b_enabled=b;} diff --git a/src/xrGame/level_debug.cpp b/src/xrGame/level_debug.cpp index 66ba3f2040c..de5139f143b 100644 --- a/src/xrGame/level_debug.cpp +++ b/src/xrGame/level_debug.cpp @@ -95,7 +95,7 @@ debug::text_tree& CLevelDebug::get_text_tree () return *m_p_texttree; } -CLevelDebug::CObjectInfo &CLevelDebug::object_info(CObject *obj, LPCSTR class_name) +CLevelDebug::CObjectInfo &CLevelDebug::object_info(IGameObject *obj, LPCSTR class_name) { OBJECT_INFO_MAP_IT obj_it = m_objects_info.find(obj); if (obj_it != m_objects_info.end()) { @@ -338,7 +338,7 @@ void CLevelDebug::CLevelInfo::draw_info() process (pred); } -void CLevelDebug::on_destroy_object(CObject *obj) +void CLevelDebug::on_destroy_object(IGameObject *obj) { // handle all of the objects for (OBJECT_INFO_MAP_IT it = m_objects_info.begin(); it != m_objects_info.end(); ++it) { diff --git a/src/xrGame/level_debug.h b/src/xrGame/level_debug.h index a02a6f929cd..99683944fae 100644 --- a/src/xrGame/level_debug.h +++ b/src/xrGame/level_debug.h @@ -178,7 +178,7 @@ class CLevelDebug { ~CLevelDebug (); template - CObjectInfo &object_info (CObject *obj, T typed_class) { + CObjectInfo &object_info (IGameObject *obj, T typed_class) { return object_info(obj, typeid((*typed_class)).name()); } @@ -210,12 +210,12 @@ class CLevelDebug { debug::text_tree& get_text_tree (); - void on_destroy_object (CObject *obj); + void on_destroy_object (IGameObject *obj); private: void free_mem (); - CObjectInfo &object_info (CObject *obj, LPCSTR class_name); + CObjectInfo &object_info (IGameObject *obj, LPCSTR class_name); CTextInfo &text (void *class_ptr, LPCSTR class_name); CLevelInfo &level_info (void *class_ptr, LPCSTR class_name); @@ -234,7 +234,7 @@ class CLevelDebug { }; DEFINE_MAP (LPCSTR, CObjectInfo*, CLASS_INFO_MAP, CLASS_INFO_MAP_IT); - DEFINE_MAP (CObject*, CLASS_INFO_MAP, OBJECT_INFO_MAP, OBJECT_INFO_MAP_IT); + DEFINE_MAP (IGameObject*, CLASS_INFO_MAP, OBJECT_INFO_MAP, OBJECT_INFO_MAP_IT); DEFINE_MAP (SKey, CTextInfo*, TEXT_INFO_MAP, TEXT_INFO_MAP_IT); DEFINE_MAP (SKey, CLevelInfo*, LEVEL_INFO_MAP, LEVEL_INFO_MAP_IT); diff --git a/src/xrGame/level_graph_debug2.cpp b/src/xrGame/level_graph_debug2.cpp index 6edea095ab0..9e8b0618ca8 100644 --- a/src/xrGame/level_graph_debug2.cpp +++ b/src/xrGame/level_graph_debug2.cpp @@ -323,7 +323,7 @@ void CLevelGraph::draw_objects () u32 I = 0; u32 E = Level().Objects.o_count (); for ( ; I < E; ++I) { - CObject *_O = Level().Objects.o_get_by_iterator(I); + IGameObject *_O = Level().Objects.o_get_by_iterator(I); CTeamBaseZone *team_base_zone = smart_cast(_O); if (team_base_zone) { team_base_zone->OnRender(); diff --git a/src/xrGame/map_location.cpp b/src/xrGame/map_location.cpp index 6212a0202b5..47415cd1ee3 100644 --- a/src/xrGame/map_location.cpp +++ b/src/xrGame/map_location.cpp @@ -237,7 +237,7 @@ void CMapLocation::CalcPosition() return; } - CObject* pObject = Level().Objects.net_Find(m_objectID); + IGameObject* pObject = Level().Objects.net_Find(m_objectID); if(!pObject) { if(m_owner_se_object) @@ -260,7 +260,7 @@ const Fvector2& CMapLocation::CalcDirection() m_cached.m_Direction.set(Device.vCameraDirection.x,Device.vCameraDirection.z); }else { - CObject* pObject = Level().Objects.net_Find(m_objectID); + IGameObject* pObject = Level().Objects.net_Find(m_objectID); if(!pObject) m_cached.m_Direction.set(0.0f, 0.0f); else{ @@ -270,7 +270,7 @@ const Fvector2& CMapLocation::CalcDirection() } if(m_flags.test(ePosToActor)){ - CObject* pObject = Level().Objects.net_Find(m_objectID); + IGameObject* pObject = Level().Objects.net_Find(m_objectID); if(pObject){ Fvector2 dcp,obj_pos; dcp.set(Device.vCameraPosition.x, Device.vCameraPosition.z); @@ -312,7 +312,7 @@ bool CMapLocation::Update() //returns actual } } - CObject* pObject = Level().Objects.net_Find(m_objectID); + IGameObject* pObject = Level().Objects.net_Find(m_objectID); if (m_owner_se_object || (!IsGameTypeSingle() && pObject) ) { @@ -771,7 +771,7 @@ bool CRelationMapLocation::Update() bool vis_res = true; if(m_last_relation==ALife::eRelationTypeEnemy || m_last_relation==ALife::eRelationTypeWorstEnemy) { - CObject* _object_ = Level().Objects.net_Find(m_objectID); + IGameObject* _object_ = Level().Objects.net_Find(m_objectID); if(_object_) { CEntityAlive* ea = smart_cast(_object_); @@ -799,7 +799,7 @@ bool CRelationMapLocation::Update() if(bAlive==false) { - CObject* _object_ = Level().Objects.net_Find(m_objectID); + IGameObject* _object_ = Level().Objects.net_Find(m_objectID); if(_object_) { const CGameObject* pObj = smart_cast(_object_); diff --git a/src/xrGame/map_spot.cpp b/src/xrGame/map_spot.cpp index 48bcb18e2bb..48413c9679f 100644 --- a/src/xrGame/map_spot.cpp +++ b/src/xrGame/map_spot.cpp @@ -223,7 +223,7 @@ void CMiniMapSpot::Load(CUIXml* xml, LPCSTR path) void CMiniMapSpot::Draw() { - CObject* O = Level().CurrentViewEntity(); + IGameObject* O = Level().CurrentViewEntity(); if(O&&m_icon_above->inited()&&m_icon_below->inited()){ float ml_y = MapLocation()->GetLastPosition().y; float d = O->Position().y-ml_y; diff --git a/src/xrGame/material_manager.cpp b/src/xrGame/material_manager.cpp index 0d262de4d2a..11745ecadc5 100644 --- a/src/xrGame/material_manager.cpp +++ b/src/xrGame/material_manager.cpp @@ -14,7 +14,7 @@ #include "CharacterPhysicsSupport.h" #include "Include/xrRender/Kinematics.h" -CMaterialManager::CMaterialManager (CObject *object, CPHMovementControl *movement_control) +CMaterialManager::CMaterialManager (IGameObject *object, CPHMovementControl *movement_control) { VERIFY (object); m_object = object; diff --git a/src/xrGame/material_manager.h b/src/xrGame/material_manager.h index b61af3e9fe2..44e21aec438 100644 --- a/src/xrGame/material_manager.h +++ b/src/xrGame/material_manager.h @@ -19,14 +19,14 @@ class CMaterialManager { u32 m_step_id; u16 m_my_material_idx; ref_sound m_step_sound[4]; - CObject *m_object; + IGameObject *m_object; CPHMovementControl *m_movement_control; protected: u16 m_last_material_idx; public: - CMaterialManager (CObject *object, CPHMovementControl *movement_control); + CMaterialManager (IGameObject *object, CPHMovementControl *movement_control); virtual ~CMaterialManager (); virtual void Load (LPCSTR section); virtual void reinit (); diff --git a/src/xrGame/memory_manager.cpp b/src/xrGame/memory_manager.cpp index 0d200957713..f4c34a9aa96 100644 --- a/src/xrGame/memory_manager.cpp +++ b/src/xrGame/memory_manager.cpp @@ -149,7 +149,7 @@ void CMemoryManager::update (float time_delta) STOP_PROFILE } -void CMemoryManager::enable (const CObject *object, bool enable) +void CMemoryManager::enable (const IGameObject *object, bool enable) { visual().enable (object,enable); sound().enable (object,enable); @@ -186,7 +186,7 @@ void CMemoryManager::update (const xr_vector &objects, bool add_enemies) } } -CMemoryInfo CMemoryManager::memory(const CObject *object) const +CMemoryInfo CMemoryManager::memory(const IGameObject *object) const { CMemoryInfo result; if (!this->object().g_Alive()) @@ -231,7 +231,7 @@ CMemoryInfo CMemoryManager::memory(const CObject *object) const return (result); } -u32 CMemoryManager::memory_time(const CObject *object) const +u32 CMemoryManager::memory_time(const IGameObject *object) const { u32 result = 0; if (!this->object().g_Alive()) @@ -261,7 +261,7 @@ u32 CMemoryManager::memory_time(const CObject *object) const return (result); } -Fvector CMemoryManager::memory_position (const CObject *object) const +Fvector CMemoryManager::memory_position (const IGameObject *object) const { u32 time = 0; Fvector result = Fvector().set(0.f,0.f,0.f); @@ -298,7 +298,7 @@ Fvector CMemoryManager::memory_position (const CObject *object) const return (result); } -void CMemoryManager::remove_links (CObject *object) +void CMemoryManager::remove_links (IGameObject *object) { if (m_object->g_Alive()) { visual().remove_links (object); @@ -357,7 +357,7 @@ void CMemoryManager::load (IReader &packet) // we do this due to the limitation of client spawn manager // should be revisited from the acrhitectural point of view -void CMemoryManager::on_requested_spawn (CObject *object) +void CMemoryManager::on_requested_spawn (IGameObject *object) { visual().on_requested_spawn (object); sound().on_requested_spawn (object); diff --git a/src/xrGame/memory_manager.h b/src/xrGame/memory_manager.h index 7d5253c20d6..990fadf417e 100644 --- a/src/xrGame/memory_manager.h +++ b/src/xrGame/memory_manager.h @@ -53,14 +53,14 @@ class CMemoryManager { virtual void reinit (); virtual void reload (LPCSTR section); virtual void update (float time_delta); - void remove_links (CObject *object); + void remove_links (IGameObject *object); virtual void on_restrictions_change (); public: - void enable (const CObject *object, bool enable); - CMemoryInfo memory (const CObject *object) const; - u32 memory_time (const CObject *object) const; - Fvector memory_position (const CObject *object) const; + void enable (const IGameObject *object, bool enable); + CMemoryInfo memory (const IGameObject *object) const; + u32 memory_time (const IGameObject *object) const; + Fvector memory_position (const IGameObject *object) const; void make_object_visible_somewhen(const CEntityAlive *enemy); public: @@ -82,7 +82,7 @@ class CMemoryManager { public: void save (NET_Packet &packet) const; void load (IReader &packet); - void xr_stdcall on_requested_spawn (CObject *object); + void xr_stdcall on_requested_spawn (IGameObject *object); }; #include "memory_manager_inline.h" \ No newline at end of file diff --git a/src/xrGame/movement_manager.h b/src/xrGame/movement_manager.h index 18981990234..fbe5d44f8ba 100644 --- a/src/xrGame/movement_manager.h +++ b/src/xrGame/movement_manager.h @@ -142,7 +142,7 @@ class CMovementManager { }; protected: - typedef xr_vector NEAREST_OBJECTS; + typedef xr_vector NEAREST_OBJECTS; protected: NEAREST_OBJECTS m_nearest_objects; diff --git a/src/xrGame/moving_object.cpp b/src/xrGame/moving_object.cpp index 15e465965aa..7171da34208 100644 --- a/src/xrGame/moving_object.cpp +++ b/src/xrGame/moving_object.cpp @@ -51,12 +51,12 @@ Fvector moving_object::target_position () const return (object().target_position()); } -void moving_object::ignore (const CObject *object) +void moving_object::ignore (const IGameObject *object) { m_ignored_object = object; } -bool moving_object::ignored (const CObject *object) +bool moving_object::ignored (const IGameObject *object) { if (object == m_object) return (true); diff --git a/src/xrGame/moving_object.h b/src/xrGame/moving_object.h index f1456a2fd0a..59377c4a85c 100644 --- a/src/xrGame/moving_object.h +++ b/src/xrGame/moving_object.h @@ -26,7 +26,7 @@ class moving_object { private: const CEntityAlive *m_object; - const CObject *m_ignored_object; + const IGameObject *m_ignored_object; Fvector m_position; obstacles_query m_static_query; obstacles_query m_dynamic_query; @@ -48,8 +48,8 @@ class moving_object { Fvector target_position () const; void update_position (); IC const CEntityAlive &object () const; - void ignore (const CObject *object); - bool ignored (const CObject *object); + void ignore (const IGameObject *object); + bool ignored (const IGameObject *object); IC void action (const action_type &action); IC void action (const action_type &action, const Fvector &action_position); IC const action_type &action () const; diff --git a/src/xrGame/moving_objects.h b/src/xrGame/moving_objects.h index 8715f6f12db..bb054770885 100644 --- a/src/xrGame/moving_objects.h +++ b/src/xrGame/moving_objects.h @@ -13,14 +13,14 @@ #include "obstacles_query.h" class moving_object; -class CObject; +class IGameObject; class MagicBox3; struct boxes; class moving_objects { private: typedef CQuadTree TREE; - typedef xr_vector NEAREST_STATIC; + typedef xr_vector NEAREST_STATIC; public: enum possible_actions { @@ -65,7 +65,7 @@ class moving_objects { #endif // DEBUG private: - IC bool collided (const CObject *object, const Fvector &position, const float &radius) const; + IC bool collided (const IGameObject *object, const Fvector &position, const float &radius) const; bool collided_static (const Fvector &position, const float &radius); bool collided_static (moving_object *object, const Fvector &dest_position); void fill_static (obstacles_query &query, const Fvector &position, const float &radius); diff --git a/src/xrGame/moving_objects_impl.h b/src/xrGame/moving_objects_impl.h index fd5dd347143..0b11c14dcbc 100644 --- a/src/xrGame/moving_objects_impl.h +++ b/src/xrGame/moving_objects_impl.h @@ -16,7 +16,7 @@ static const u32 inertia_time_ms = 500; static const float additional_radius = 2.f; static const float max_linear_velocity = 10.f; -IC bool moving_objects::collided (const CObject *object, const Fvector &position, const float &radius) const +IC bool moving_objects::collided (const IGameObject *object, const Fvector &position, const float &radius) const { return (object->Position().distance_to(position) <= (object->Radius() + radius)); } diff --git a/src/xrGame/moving_objects_static.cpp b/src/xrGame/moving_objects_static.cpp index 88eab96df4f..7d087dae760 100644 --- a/src/xrGame/moving_objects_static.cpp +++ b/src/xrGame/moving_objects_static.cpp @@ -104,7 +104,7 @@ class ignore_predicate { { } - IC bool operator() (const CObject *object) const + IC bool operator() (const IGameObject *object) const { if (m_object->ignored(object)) return (true); diff --git a/src/xrGame/object_handler_planner.cpp b/src/xrGame/object_handler_planner.cpp index ab8d8044aee..746b0f28381 100644 --- a/src/xrGame/object_handler_planner.cpp +++ b/src/xrGame/object_handler_planner.cpp @@ -218,7 +218,7 @@ LPCSTR CObjectHandlerPlanner::property2string(const _condition_type &id) } #endif -void CObjectHandlerPlanner::remove_evaluators (CObject *object) +void CObjectHandlerPlanner::remove_evaluators (IGameObject *object) { #pragma todo("Dima to Dima : safe, but not optimal!") for (;;) { @@ -229,7 +229,7 @@ void CObjectHandlerPlanner::remove_evaluators (CObject *object) } } -void CObjectHandlerPlanner::remove_operators (CObject *object) +void CObjectHandlerPlanner::remove_operators (IGameObject *object) { #pragma todo("Dima to Dima : safe, but not optimal!") for (;;) { diff --git a/src/xrGame/object_handler_planner.h b/src/xrGame/object_handler_planner.h index d76f8570118..4de4bb2706f 100644 --- a/src/xrGame/object_handler_planner.h +++ b/src/xrGame/object_handler_planner.h @@ -47,8 +47,8 @@ class CObjectHandlerPlanner : public CActionPlanner { void add_operators (CWeapon *weapon); void add_evaluators (CMissile *missile); void add_operators (CMissile *missile); - void remove_evaluators (CObject *object); - void remove_operators (CObject *object); + void remove_evaluators (IGameObject *object); + void remove_operators (IGameObject *object); void init_storage (); IC EWorldProperties object_property (EObjectAction object_action) const; #ifdef LOG_ACTION @@ -59,7 +59,7 @@ class CObjectHandlerPlanner : public CActionPlanner { public: IC _condition_type uid (const u32 id1, const u32 id0) const; - IC bool object_action (_condition_type action_id, CObject *object); + IC bool object_action (_condition_type action_id, IGameObject *object); IC u16 current_action_object_id() const; IC u32 current_action_state_id () const; IC u16 action_object_id (_condition_type action_id) const; diff --git a/src/xrGame/object_handler_planner_impl.h b/src/xrGame/object_handler_planner_impl.h index c203004e6ae..f6edcee5026 100644 --- a/src/xrGame/object_handler_planner_impl.h +++ b/src/xrGame/object_handler_planner_impl.h @@ -14,7 +14,7 @@ IC CObjectHandlerPlanner::_condition_type CObjectHandlerPlanner::uid(const u32 i return ((id0 << 16) | id1); } -IC bool CObjectHandlerPlanner::object_action (u32 action_id, CObject *object) +IC bool CObjectHandlerPlanner::object_action (u32 action_id, IGameObject *object) { return ((action_id >> 16) == object->ID()); } diff --git a/src/xrGame/obstacles_query.cpp b/src/xrGame/obstacles_query.cpp index c8ed11d38d2..502d1245ac1 100644 --- a/src/xrGame/obstacles_query.cpp +++ b/src/xrGame/obstacles_query.cpp @@ -169,7 +169,7 @@ bool obstacles_query::remove_objects (const Fvector &position, const float &radi return (crc_before != crc()); } -void obstacles_query::remove_links (CObject *object) +void obstacles_query::remove_links (IGameObject *object) { OBSTACLES::iterator I = m_obstacles.find(smart_cast(object)); if (I == m_obstacles.end()) diff --git a/src/xrGame/obstacles_query.h b/src/xrGame/obstacles_query.h index 32f0a3d8824..874408afc0b 100644 --- a/src/xrGame/obstacles_query.h +++ b/src/xrGame/obstacles_query.h @@ -48,7 +48,7 @@ class obstacles_query { bool objects_changed (const Fvector &position, const float &radius) const; bool remove_objects (const Fvector &position, const float &radius); IC bool update_objects (const Fvector &position, const float &radius); - void remove_links (CObject *object); + void remove_links (IGameObject *object); public: IC bool operator== (const obstacles_query &object) const; diff --git a/src/xrGame/physic_item.cpp b/src/xrGame/physic_item.cpp index ddf83e90bfb..926599f100d 100644 --- a/src/xrGame/physic_item.cpp +++ b/src/xrGame/physic_item.cpp @@ -117,7 +117,7 @@ void CPhysicItem::UpdateCL() void CPhysicItem::activate_physic_shell() { - CObject *object = smart_cast(H_Parent()); + IGameObject *object = smart_cast(H_Parent()); R_ASSERT (object); XFORM().set (object->XFORM()); inherited::activate_physic_shell(); diff --git a/src/xrGame/player_hud.cpp b/src/xrGame/player_hud.cpp index 9c76017d908..0a3223fba6c 100644 --- a/src/xrGame/player_hud.cpp +++ b/src/xrGame/player_hud.cpp @@ -368,7 +368,7 @@ u32 attachable_hud_item::anim_play(const shared_str& anm_name_b, BOOL bMixIn, co R_ASSERT2 (m_parent_hud_item, "parent hud item is NULL"); CPhysicItem& parent_object = m_parent_hud_item->object(); //R_ASSERT2 (parent_object, "object has no parent actor"); - //CObject* parent_object = static_cast_checked(&m_parent_hud_item->object()); + //IGameObject* parent_object = static_cast_checked(&m_parent_hud_item->object()); if (IsGameTypeSingle() && parent_object.H_Parent() == Level().CurrentControlEntity()) { diff --git a/src/xrGame/player_state_param.h b/src/xrGame/player_state_param.h index e3b022febab..3df7603f721 100644 --- a/src/xrGame/player_state_param.h +++ b/src/xrGame/player_state_param.h @@ -21,7 +21,7 @@ class player_state_param : public game_events_handler virtual void OnWeapon_Fire (u16 sender, u16 sender_weapon_id) {}; virtual void OnBullet_Fire (u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction) {}; - virtual void OnBullet_Hit (CObject const * hitter, CObject const * victim, CObject const * weapon, u16 const bone) {}; + virtual void OnBullet_Hit (IGameObject const * hitter, IGameObject const * victim, IGameObject const * weapon, u16 const bone) {}; virtual void OnArtefactSpawned () {}; virtual void OnPlayerTakeArtefact (game_PlayerState const * ps) {}; virtual void OnPlayerDropArtefact (game_PlayerState const * ps) {}; diff --git a/src/xrGame/restricted_object.cpp b/src/xrGame/restricted_object.cpp index 2e3d9d545cb..2eb885792af 100644 --- a/src/xrGame/restricted_object.cpp +++ b/src/xrGame/restricted_object.cpp @@ -269,7 +269,7 @@ IC void CRestrictedObject::construct_restriction_string(LPSTR temp_restrictions, xr_vector::const_iterator I = restrictions.begin(); xr_vector::const_iterator E = restrictions.end(); for ( ; I != E; ++I) { - CObject *object = Level().Objects.net_Find(*I); + IGameObject *object = Level().Objects.net_Find(*I); if (!object || !!strstr(*current_restrictions,*object->cName()) == value) continue; diff --git a/src/xrGame/reward_event_generator.cpp b/src/xrGame/reward_event_generator.cpp index 19d694a63d0..55c1cd2e8ec 100644 --- a/src/xrGame/reward_event_generator.cpp +++ b/src/xrGame/reward_event_generator.cpp @@ -73,7 +73,7 @@ void reward_event_generator::OnBullet_Fire(u16 sender, u16 sender_weapon_id, con m_event_handlers->OnBullet_Fire (sender, sender_weapon_id, position, direction); } -void reward_event_generator::OnBullet_Hit(CObject const * hitter, CObject const * victim, CObject* weapon, u16 const bone) +void reward_event_generator::OnBullet_Hit(IGameObject const * hitter, IGameObject const * victim, IGameObject* weapon, u16 const bone) { m_state_accum->OnBullet_Hit (hitter, victim, weapon, bone); m_event_handlers->OnBullet_Hit (hitter, victim, weapon, bone); diff --git a/src/xrGame/reward_event_generator.h b/src/xrGame/reward_event_generator.h index eca69d69799..4750b2ea398 100644 --- a/src/xrGame/reward_event_generator.h +++ b/src/xrGame/reward_event_generator.h @@ -27,7 +27,7 @@ class reward_event_generator : public boost::noncopyable void OnWeapon_Fire (u16 sender, u16 sender_weapon_id); void OnBullet_Fire (u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction); - void OnBullet_Hit (CObject const * hitter, CObject const * victim, CObject* weapon, u16 const bone); + void OnBullet_Hit (IGameObject const * hitter, IGameObject const * victim, IGameObject* weapon, u16 const bone); void OnArtefactSpawned (); void OnPlayerTakeArtefact (game_PlayerState const * ps); void OnPlayerDropArtefact (game_PlayerState const * ps); diff --git a/src/xrGame/reward_event_handler.h b/src/xrGame/reward_event_handler.h index 2883b01ece3..4e13dcf3a25 100644 --- a/src/xrGame/reward_event_handler.h +++ b/src/xrGame/reward_event_handler.h @@ -18,7 +18,7 @@ class reward_event_handler ~reward_event_handler () {}; virtual bool OnWeapon_Fire (u16 sender, u16 sender_weapon_id) = 0; virtual bool OnBullet_Fire (u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction) = 0; - virtual bool OnBullet_Hit (CObject const * hitter, CObject const * victim, CObject const * weapon, u16 const bone) = 0; + virtual bool OnBullet_Hit (IGameObject const * hitter, IGameObject const * victim, IGameObject const * weapon, u16 const bone) = 0; virtual bool OnArtefactSpawned () = 0; virtual bool OnPlayerTakeArtefact (game_PlayerState const * ps) = 0; virtual bool OnPlayerDropArtefact (game_PlayerState const * ps) = 0; diff --git a/src/xrGame/rewarding_events_handlers.cpp b/src/xrGame/rewarding_events_handlers.cpp index 3a0092e26f6..5b3601db04e 100644 --- a/src/xrGame/rewarding_events_handlers.cpp +++ b/src/xrGame/rewarding_events_handlers.cpp @@ -50,7 +50,7 @@ void rewarding_event_handlers::OnBullet_Fire(u16 sender, u16 sender_weapon_id, c m_null_hanlder->OnBullet_Fire(sender, sender_weapon_id, position, direction); } -void rewarding_event_handlers::OnBullet_Hit (CObject const * hitter, CObject const * victim, CObject const * weapon, u16 const bone) +void rewarding_event_handlers::OnBullet_Hit (IGameObject const * hitter, IGameObject const * victim, IGameObject const * weapon, u16 const bone) { for (handlers_store_t::iterator i = m_events_store.begin(), ie = m_events_store.end(); i != ie; ++i) diff --git a/src/xrGame/rewarding_events_handlers.h b/src/xrGame/rewarding_events_handlers.h index 8e56676149b..8d0986813ad 100644 --- a/src/xrGame/rewarding_events_handlers.h +++ b/src/xrGame/rewarding_events_handlers.h @@ -23,7 +23,7 @@ class rewarding_event_handlers : public game_events_handler virtual void OnWeapon_Fire (u16 sender, u16 sender_weapon_id); virtual void OnBullet_Fire (u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction); - virtual void OnBullet_Hit (CObject const * hitter, CObject const * victim, CObject const * weapon, u16 const bone); + virtual void OnBullet_Hit (IGameObject const * hitter, IGameObject const * victim, IGameObject const * weapon, u16 const bone); virtual void OnArtefactSpawned (); virtual void OnPlayerTakeArtefact (game_PlayerState const * ps); virtual void OnPlayerDropArtefact (game_PlayerState const * ps); diff --git a/src/xrGame/script_binder.cpp b/src/xrGame/script_binder.cpp index 073684f070b..353e9e353fb 100644 --- a/src/xrGame/script_binder.cpp +++ b/src/xrGame/script_binder.cpp @@ -221,7 +221,7 @@ BOOL CScriptBinder::net_SaveRelevant() return (FALSE); } -void CScriptBinder::net_Relcase (CObject *object) +void CScriptBinder::net_Relcase (IGameObject *object) { CGameObject *game_object = smart_cast(object); if (m_object && game_object) { diff --git a/src/xrGame/script_binder.h b/src/xrGame/script_binder.h index 61ff52a480f..4a38779e463 100644 --- a/src/xrGame/script_binder.h +++ b/src/xrGame/script_binder.h @@ -30,7 +30,7 @@ class CScriptBinder { virtual void save (NET_Packet &output_packet); virtual void load (IReader &input_packet); virtual BOOL net_SaveRelevant(); - virtual void net_Relcase (CObject *object); + virtual void net_Relcase (IGameObject *object); void set_object (CScriptBinderObject *object); IC CScriptBinderObject *object (); }; diff --git a/src/xrGame/script_entity.cpp b/src/xrGame/script_entity.cpp index 079db8f67f9..167f07ec78a 100644 --- a/src/xrGame/script_entity.cpp +++ b/src/xrGame/script_entity.cpp @@ -637,7 +637,7 @@ const CScriptEntityAction *CScriptEntity::GetActionByIndex (u32 action_index) co return (m_tpActionQueue[action_index]); } -void CScriptEntity::sound_callback (const CObject *object, int sound_type, const Fvector &position, float sound_power) +void CScriptEntity::sound_callback (const IGameObject *object, int sound_type, const Fvector &position, float sound_power) { if (!smart_cast(object)) return; diff --git a/src/xrGame/script_entity.h b/src/xrGame/script_entity.h index 6c6c9249115..af51473d4cb 100644 --- a/src/xrGame/script_entity.h +++ b/src/xrGame/script_entity.h @@ -104,7 +104,7 @@ class CScriptEntity { virtual bool bfAssignObject (CScriptEntityAction *tpEntityAction); virtual bool bfAssignMonsterAction (CScriptEntityAction *tpEntityAction); - virtual void sound_callback (const CObject *object, int sound_type, const Fvector &position, float sound_power); + virtual void sound_callback (const IGameObject *object, int sound_type, const Fvector &position, float sound_power); virtual LPCSTR GetPatrolPathName (); bool bfScriptAnimation (); diff --git a/src/xrGame/script_game_object.h b/src/xrGame/script_game_object.h index 3dca01a81b0..aba24590ba2 100644 --- a/src/xrGame/script_game_object.h +++ b/src/xrGame/script_game_object.h @@ -143,7 +143,7 @@ class CScriptGameObject { CScriptGameObject (CGameObject *tpGameObject); virtual ~CScriptGameObject (); - operator CObject* (); + operator IGameObject* (); IC CGameObject &object () const; CScriptGameObject *Parent () const; diff --git a/src/xrGame/script_game_object2.cpp b/src/xrGame/script_game_object2.cpp index 4c58177b481..55d3080d918 100644 --- a/src/xrGame/script_game_object2.cpp +++ b/src/xrGame/script_game_object2.cpp @@ -166,7 +166,7 @@ void CScriptGameObject::Hit(CScriptHit *tpLuaHit) #pragma todo("Dima to Dima : find out why user defined conversion operators work incorrect") -CScriptGameObject::operator CObject*() +CScriptGameObject::operator IGameObject*() { return (&object()); } diff --git a/src/xrGame/script_game_object_inventory_owner.cpp b/src/xrGame/script_game_object_inventory_owner.cpp index 6a94cc50587..55c16ee1ce1 100644 --- a/src/xrGame/script_game_object_inventory_owner.cpp +++ b/src/xrGame/script_game_object_inventory_owner.cpp @@ -770,7 +770,7 @@ void construct_restriction_vector(shared_str restrictions, xr_vectorID()); diff --git a/src/xrGame/script_monster_action.cpp b/src/xrGame/script_monster_action.cpp index e0311703237..a75b7771028 100644 --- a/src/xrGame/script_monster_action.cpp +++ b/src/xrGame/script_monster_action.cpp @@ -16,5 +16,5 @@ CScriptMonsterAction::~CScriptMonsterAction () void CScriptMonsterAction::SetObject (CScriptGameObject *tObj) { - m_tObject = tObj->operator CObject*(); + m_tObject = tObj->operator IGameObject*(); } diff --git a/src/xrGame/script_monster_action.h b/src/xrGame/script_monster_action.h index fa7ab7a0b7f..5f1912dd8e3 100644 --- a/src/xrGame/script_monster_action.h +++ b/src/xrGame/script_monster_action.h @@ -16,7 +16,7 @@ class CScriptGameObject; class CScriptMonsterAction : public CScriptAbstractAction { public: MonsterSpace::EScriptMonsterGlobalAction m_tAction; - CObject *m_tObject; + IGameObject *m_tObject; public: IC CScriptMonsterAction (); diff --git a/src/xrGame/script_movement_action.cpp b/src/xrGame/script_movement_action.cpp index 20a5f6d8364..43043a2bcf9 100644 --- a/src/xrGame/script_movement_action.cpp +++ b/src/xrGame/script_movement_action.cpp @@ -124,7 +124,7 @@ CScriptMovementAction::~CScriptMovementAction () void CScriptMovementAction::SetObjectToGo (CScriptGameObject *tpObjectToGo) { if (tpObjectToGo) - m_tpObjectToGo = tpObjectToGo->operator CObject*(); + m_tpObjectToGo = tpObjectToGo->operator IGameObject*(); else m_tpObjectToGo = 0; m_tGoalType = eGoalTypeObject; diff --git a/src/xrGame/script_movement_action.h b/src/xrGame/script_movement_action.h index f80cec511c3..fdcbabb6b68 100644 --- a/src/xrGame/script_movement_action.h +++ b/src/xrGame/script_movement_action.h @@ -63,7 +63,7 @@ class CScriptMovementAction : public CScriptAbstractAction { MonsterSpace::EBodyState m_tBodyState; MonsterSpace::EMovementType m_tMovementType; DetailPathManager::EDetailPathType m_tPathType; - CObject *m_tpObjectToGo; + IGameObject *m_tpObjectToGo; const CPatrolPath *m_path; PatrolPathManager::EPatrolStartType m_tPatrolPathStart; PatrolPathManager::EPatrolRouteType m_tPatrolPathStop; diff --git a/src/xrGame/script_object_action.cpp b/src/xrGame/script_object_action.cpp index beb1d7e7d9e..8185df886ed 100644 --- a/src/xrGame/script_object_action.cpp +++ b/src/xrGame/script_object_action.cpp @@ -16,6 +16,6 @@ CScriptObjectAction::~CScriptObjectAction () void CScriptObjectAction::SetObject (CScriptGameObject *tpLuaGameObject) { - m_tpObject = tpLuaGameObject->operator CObject*(); + m_tpObject = tpLuaGameObject->operator IGameObject*(); m_bCompleted = false; } diff --git a/src/xrGame/script_object_action.h b/src/xrGame/script_object_action.h index be71c2cd1b0..4375cd4d620 100644 --- a/src/xrGame/script_object_action.h +++ b/src/xrGame/script_object_action.h @@ -16,7 +16,7 @@ class CScriptGameObject; class CScriptObjectAction : public CScriptAbstractAction { public: - CObject *m_tpObject; + IGameObject *m_tpObject; MonsterSpace::EObjectAction m_tGoalType; u32 m_dwQueueSize; shared_str m_caBoneName; diff --git a/src/xrGame/script_watch_action.cpp b/src/xrGame/script_watch_action.cpp index 6dc5e88992a..7d607104cc0 100644 --- a/src/xrGame/script_watch_action.cpp +++ b/src/xrGame/script_watch_action.cpp @@ -26,7 +26,7 @@ CScriptWatchAction::~CScriptWatchAction () void CScriptWatchAction::SetWatchObject (CScriptGameObject *tpObjectToWatch) { - m_tpObjectToWatch = tpObjectToWatch->operator CObject*(); + m_tpObjectToWatch = tpObjectToWatch->operator IGameObject*(); m_tGoalType = eGoalTypeObject; m_bCompleted = false; } diff --git a/src/xrGame/script_watch_action.h b/src/xrGame/script_watch_action.h index b2398a5bf3f..2340cf9fe98 100644 --- a/src/xrGame/script_watch_action.h +++ b/src/xrGame/script_watch_action.h @@ -27,7 +27,7 @@ class CScriptWatchAction : public CScriptAbstractAction { }; public: - CObject *m_tpObjectToWatch; + IGameObject *m_tpObjectToWatch; SightManager::ESightType m_tWatchType; EGoalType m_tGoalType; Fvector m_tWatchVector; diff --git a/src/xrGame/script_zone.cpp b/src/xrGame/script_zone.cpp index 75715bccf0b..1a1fb638ebe 100644 --- a/src/xrGame/script_zone.cpp +++ b/src/xrGame/script_zone.cpp @@ -57,7 +57,7 @@ void CScriptZone::shedule_Update(u32 dt) feel_touch_update (P,s.R); } -void CScriptZone::feel_touch_new (CObject *tpObject) +void CScriptZone::feel_touch_new (IGameObject *tpObject) { CGameObject *l_tpGameObject = smart_cast(tpObject); if (!l_tpGameObject) @@ -66,7 +66,7 @@ void CScriptZone::feel_touch_new (CObject *tpObject) callback(GameObject::eZoneEnter)(lua_game_object(),l_tpGameObject->lua_game_object()); } -void CScriptZone::feel_touch_delete (CObject *tpObject) +void CScriptZone::feel_touch_delete (IGameObject *tpObject) { CGameObject *l_tpGameObject = smart_cast(tpObject); @@ -76,19 +76,19 @@ void CScriptZone::feel_touch_delete (CObject *tpObject) callback(GameObject::eZoneExit)(lua_game_object(),l_tpGameObject->lua_game_object()); } -void CScriptZone::net_Relcase (CObject *O) +void CScriptZone::net_Relcase (IGameObject *O) { CGameObject *l_tpGameObject = smart_cast(O); if (!l_tpGameObject) return; - xr_vector::iterator I = std::find(feel_touch.begin(),feel_touch.end(),O); + xr_vector::iterator I = std::find(feel_touch.begin(),feel_touch.end(),O); if (I != feel_touch.end()) { callback(GameObject::eZoneExit)(lua_game_object(),l_tpGameObject->lua_game_object()); } } -bool CScriptZone::feel_touch_contact (CObject* O) +bool CScriptZone::feel_touch_contact (IGameObject* O) { return (((CCF_Shape*)GetCForm())->Contact(O)); } @@ -130,8 +130,8 @@ void CScriptZone::OnRender() bool CScriptZone::active_contact(u16 id) const { - xr_vector::const_iterator I = feel_touch.begin(); - xr_vector::const_iterator E = feel_touch.end(); + xr_vector::const_iterator I = feel_touch.begin(); + xr_vector::const_iterator E = feel_touch.end(); for ( ; I != E; ++I) if ((*I)->ID() == id) return (true); diff --git a/src/xrGame/script_zone.h b/src/xrGame/script_zone.h index cc8c40e163c..f8fc703a9c8 100644 --- a/src/xrGame/script_zone.h +++ b/src/xrGame/script_zone.h @@ -23,11 +23,11 @@ class CScriptZone : public CSpaceRestrictor, public Feel::Touch { virtual void reinit (); virtual BOOL net_Spawn (CSE_Abstract* DC); virtual void net_Destroy (); - virtual void net_Relcase (CObject* O); + virtual void net_Relcase (IGameObject* O); virtual void shedule_Update (u32 dt); - virtual void feel_touch_new (CObject* O); - virtual void feel_touch_delete (CObject* O); - virtual bool feel_touch_contact (CObject* O); + virtual void feel_touch_new (IGameObject* O); + virtual void feel_touch_delete (IGameObject* O); + virtual bool feel_touch_contact (IGameObject* O); bool active_contact (u16 id) const; virtual bool IsVisibleForZones () {return false;} virtual bool register_schedule () const {return true;} diff --git a/src/xrGame/sight_action.cpp b/src/xrGame/sight_action.cpp index b2be10eb293..08d16880753 100644 --- a/src/xrGame/sight_action.cpp +++ b/src/xrGame/sight_action.cpp @@ -88,7 +88,7 @@ void CSightAction::execute () } } -void CSightAction::remove_links (CObject *object) +void CSightAction::remove_links (IGameObject *object) { if (!m_object_to_look) return; @@ -329,10 +329,10 @@ void CSightAction::predict_object_position ( bool use_exact_position ) u32 const count = m_object_to_look->ps_Size(); if ( count > 1 ) { - CObject::SavedPosition const current_position = m_object_to_look->ps_Element( count - 1 ); + GameObjectSavedPosition const current_position = m_object_to_look->ps_Element( count - 1 ); VERIFY ( Device.dwTimeGlobal >= current_position.dwTime ); - CObject::SavedPosition previous_position = m_object_to_look->ps_Element( count - 2 ); + GameObjectSavedPosition previous_position = m_object_to_look->ps_Element( count - 2 ); for (int i=3; (current_position.dwTime == previous_position.dwTime) && (i<=(int)count); ++i) previous_position = m_object_to_look->ps_Element( count - i ); diff --git a/src/xrGame/sight_action.h b/src/xrGame/sight_action.h index 2f9829a2b33..23b52dc1116 100644 --- a/src/xrGame/sight_action.h +++ b/src/xrGame/sight_action.h @@ -24,7 +24,7 @@ class CSightAction : public CControlAction { typedef MemorySpace::CMemoryInfo CMemoryInfo; protected: - xr_vector objects; + xr_vector objects; ESightType m_sight_type; bool m_torso_look; bool m_path; @@ -81,7 +81,7 @@ class CSightAction : public CControlAction { IC void set_object_to_look (const CGameObject *object_to_look); IC void set_memory_object (const CMemoryInfo *object_to_look); IC bool operator== (const CSightAction &sight_action) const; - void remove_links (CObject *object); + void remove_links (IGameObject *object); bool change_body_speed () const; float body_speed () const; bool change_head_speed () const; diff --git a/src/xrGame/sight_manager.cpp b/src/xrGame/sight_manager.cpp index a8d14e3ee68..d5216bf7c34 100644 --- a/src/xrGame/sight_manager.cpp +++ b/src/xrGame/sight_manager.cpp @@ -261,7 +261,7 @@ void CSightManager::update () STOP_PROFILE } -void CSightManager::remove_links (CObject *object) +void CSightManager::remove_links (IGameObject *object) { setup_actions::iterator I = actions().begin(); setup_actions::iterator E = actions().end(); diff --git a/src/xrGame/sight_manager.h b/src/xrGame/sight_manager.h index 65252a1d003..50902a2ab6f 100644 --- a/src/xrGame/sight_manager.h +++ b/src/xrGame/sight_manager.h @@ -78,7 +78,7 @@ class CSightManager : public CSetupManager virtual void Load (LPCSTR section); virtual void reinit (); virtual void reload (LPCSTR section); - void remove_links (CObject *object); + void remove_links (IGameObject *object); void Exec_Look (float dt); void SetPointLookAngles (const Fvector &tPosition, float &yaw, float &pitch, Fvector const& look_position, const CGameObject *object = 0); void SetFirePointLookAngles (const Fvector &tPosition, float &yaw, float &pitch, Fvector const& look_position, const CGameObject *object = 0); diff --git a/src/xrGame/sight_manager_target.cpp b/src/xrGame/sight_manager_target.cpp index 27e1c93ce65..f02d07eab54 100644 --- a/src/xrGame/sight_manager_target.cpp +++ b/src/xrGame/sight_manager_target.cpp @@ -216,7 +216,7 @@ bool CSightManager::GetDirectionAnglesByPrevPositions(float &yaw, float &pitch) if (i < 2) return (false); - CObject::SavedPosition tPreviousPosition = m_object->ps_Element(i - 2), tCurrentPosition = m_object->ps_Element(i - 1); + GameObjectSavedPosition tPreviousPosition = m_object->ps_Element(i - 2), tCurrentPosition = m_object->ps_Element(i - 1); VERIFY (_valid(tPreviousPosition.vPosition)); VERIFY (_valid(tCurrentPosition.vPosition)); tDirection.sub (tCurrentPosition.vPosition,tPreviousPosition.vPosition); diff --git a/src/xrGame/smart_cover_object.h b/src/xrGame/smart_cover_object.h index c432a4caa68..cdbad8e85a2 100644 --- a/src/xrGame/smart_cover_object.h +++ b/src/xrGame/smart_cover_object.h @@ -29,7 +29,7 @@ class object : public: virtual void Load (LPCSTR section); - virtual bool feel_touch_on_contact (CObject *) { return FALSE; } + virtual bool feel_touch_on_contact (IGameObject *) { return FALSE; } virtual bool use (CGameObject* who_use) { return false; } virtual BOOL net_Spawn (CSE_Abstract* DC); virtual void UpdateCL (); diff --git a/src/xrGame/sound_memory_manager.cpp b/src/xrGame/sound_memory_manager.cpp index b487925fa56..5e234071dde 100644 --- a/src/xrGame/sound_memory_manager.cpp +++ b/src/xrGame/sound_memory_manager.cpp @@ -112,7 +112,7 @@ IC u32 CSoundMemoryManager::priority (const MemorySpace::CSoundObject &sound) c return (priority); } -void CSoundMemoryManager::enable (const CObject *object, bool enable) +void CSoundMemoryManager::enable (const IGameObject *object, bool enable) { xr_vector::iterator J = std::find(m_sounds->begin(),m_sounds->end(),object_id(object)); if (J == m_sounds->end()) @@ -125,7 +125,7 @@ IC bool is_sound_type(int s, const ESoundTypes &t) return ((s & t) == t); } -void CSoundMemoryManager::feel_sound_new(CObject *object, int sound_type, CSound_UserDataPtr user_data, const Fvector &position, float sound_power) +void CSoundMemoryManager::feel_sound_new(IGameObject *object, int sound_type, CSound_UserDataPtr user_data, const Fvector &position, float sound_power) { #ifndef MASTER_GOLD if (object && smart_cast(object) && psAI_Flags.test(aiIgnoreActor)) @@ -139,7 +139,7 @@ void CSoundMemoryManager::feel_sound_new(CObject *object, int sound_type, CSound if (user_data) user_data->accept (m_visitor); - CObject *self = m_object; + IGameObject *self = m_object; VERIFY (self); #ifndef SILENCE Msg ("%s (%d) - sound type %x from %s at %d in (%.2f,%.2f,%.2f) with power %.2f",*self->cName(),Device.dwTimeGlobal,sound_type,object ? *object->cName() : "world",Device.dwTimeGlobal,position.x,position.y,position.z,sound_power); @@ -219,7 +219,7 @@ void CSoundMemoryManager::add (const CSoundObject &sound_object, bool check_fo m_sounds->push_back (sound_object); } -void CSoundMemoryManager::add (const CObject *object, int sound_type, const Fvector &position, float sound_power) +void CSoundMemoryManager::add (const IGameObject *object, int sound_type, const Fvector &position, float sound_power) { #ifndef SAVE_OWN_SOUNDS // we do not want to save our own sounds @@ -334,9 +334,9 @@ void CSoundMemoryManager::update() } struct CSoundObjectPredicate { - const CObject *m_object; + const IGameObject *m_object; - CSoundObjectPredicate (const CObject *object) : + CSoundObjectPredicate (const IGameObject *object) : m_object (object) { } @@ -353,7 +353,7 @@ struct CSoundObjectPredicate { } }; -void CSoundMemoryManager::remove_links (CObject *object) +void CSoundMemoryManager::remove_links (IGameObject *object) { VERIFY (m_sounds); SOUNDS::iterator I = std::find_if(m_sounds->begin(),m_sounds->end(),CSoundObjectPredicate(object)); @@ -505,7 +505,7 @@ void CSoundMemoryManager::clear_delayed_objects() m_delayed_objects.clear (); } -void CSoundMemoryManager::on_requested_spawn (CObject *object) +void CSoundMemoryManager::on_requested_spawn (IGameObject *object) { DELAYED_SOUND_OBJECTS::iterator I = m_delayed_objects.begin(); DELAYED_SOUND_OBJECTS::iterator E = m_delayed_objects.end(); diff --git a/src/xrGame/sound_memory_manager.h b/src/xrGame/sound_memory_manager.h index 8cd7db68f84..7d87480535f 100644 --- a/src/xrGame/sound_memory_manager.h +++ b/src/xrGame/sound_memory_manager.h @@ -73,7 +73,7 @@ class CSoundMemoryManager { IC void update_sound_threshold (); IC u32 priority (const CSoundObject &sound) const; void add (const CSoundObject &sound_object, bool check_for_existance = false); - void add (const CObject *object, int sound_type, const Fvector &position, float sound_power); + void add (const IGameObject *object, int sound_type, const Fvector &position, float sound_power); protected: IC void priority (const ESoundTypes &sound_type, u32 priority); @@ -84,12 +84,12 @@ class CSoundMemoryManager { virtual void Load (LPCSTR section); virtual void reinit (); virtual void reload (LPCSTR section); - virtual void feel_sound_new (CObject* who, int eType, CSound_UserDataPtr user_data, const Fvector &Position, float power); + virtual void feel_sound_new (IGameObject* who, int eType, CSound_UserDataPtr user_data, const Fvector &Position, float power); virtual void update (); - void remove_links (CObject *object); + void remove_links (IGameObject *object); public: - void enable (const CObject *object, bool enable); + void enable (const IGameObject *object, bool enable); public: IC const SOUNDS &objects () const; @@ -105,7 +105,7 @@ class CSoundMemoryManager { public: void save (NET_Packet &packet) const; void load (IReader &packet); - void on_requested_spawn (CObject *object); + void on_requested_spawn (IGameObject *object); private: void clear_delayed_objects (); diff --git a/src/xrGame/sound_player.cpp b/src/xrGame/sound_player.cpp index b3b46eeec05..81ef76da2da 100644 --- a/src/xrGame/sound_player.cpp +++ b/src/xrGame/sound_player.cpp @@ -18,7 +18,7 @@ #include "sound_collection_storage.h" #include "Common/object_broker.h" -CSoundPlayer::CSoundPlayer (CObject *object) +CSoundPlayer::CSoundPlayer (IGameObject *object) { VERIFY (object); m_object = object; diff --git a/src/xrGame/sound_player.h b/src/xrGame/sound_player.h index d3a1fa5dd52..ef85880c851 100644 --- a/src/xrGame/sound_player.h +++ b/src/xrGame/sound_player.h @@ -82,7 +82,7 @@ class CSoundPlayer : public CRandom32 { xr_delete (m_sound); } - void play_at_pos (CObject *object, const Fvector &position) + void play_at_pos (IGameObject *object, const Fvector &position) { m_sound->play_at_pos (object,position); m_started = true; @@ -124,7 +124,7 @@ class CSoundPlayer : public CRandom32 { SOUND_COLLECTIONS m_sounds; xr_vector m_playing_sounds; u32 m_sound_mask; - CObject *m_object; + IGameObject *m_object; shared_str m_sound_prefix; IC Fvector compute_sound_point (const CSoundSingle &sound); @@ -133,7 +133,7 @@ class CSoundPlayer : public CRandom32 { bool check_sound_legacy (u32 internal_type) const; public: - CSoundPlayer (CObject *object); + CSoundPlayer (IGameObject *object); virtual ~CSoundPlayer (); virtual void reinit (); virtual void reload (LPCSTR section); diff --git a/src/xrGame/space_restriction_composition.cpp b/src/xrGame/space_restriction_composition.cpp index d7825604706..b4e9f7f98c1 100644 --- a/src/xrGame/space_restriction_composition.cpp +++ b/src/xrGame/space_restriction_composition.cpp @@ -219,7 +219,7 @@ void CSpaceRestrictionComposition::check_restrictor_type() if (!ai().get_alife()) return; - CObject *object = Level().Objects.FindObjectByName(m_space_restrictors); + IGameObject *object = Level().Objects.FindObjectByName(m_space_restrictors); if (!object) return; diff --git a/src/xrGame/spectator_camera_first_eye.cpp b/src/xrGame/spectator_camera_first_eye.cpp index 44fbaee142f..786156dda29 100644 --- a/src/xrGame/spectator_camera_first_eye.cpp +++ b/src/xrGame/spectator_camera_first_eye.cpp @@ -4,7 +4,7 @@ #include "xrEngine/xr_object.h" CSpectrCameraFirstEye::CSpectrCameraFirstEye(float const & fTimeDelta, - CObject* p, + IGameObject* p, u32 flags) : inherited(p, flags), m_fTimeDelta(fTimeDelta) diff --git a/src/xrGame/spectator_camera_first_eye.h b/src/xrGame/spectator_camera_first_eye.h index f878bee9959..cfab9329cd5 100644 --- a/src/xrGame/spectator_camera_first_eye.h +++ b/src/xrGame/spectator_camera_first_eye.h @@ -10,7 +10,7 @@ class CSpectrCameraFirstEye : public CCameraFirstEye typedef CCameraFirstEye inherited; float const & m_fTimeDelta; public: - CSpectrCameraFirstEye (float const & fTimeDelta, CObject* p, u32 flags=0); + CSpectrCameraFirstEye (float const & fTimeDelta, IGameObject* p, u32 flags=0); virtual ~CSpectrCameraFirstEye (); CSpectrCameraFirstEye& operator= (CSpectrCameraFirstEye& copy) {}; diff --git a/src/xrGame/stalker_alife_actions.cpp b/src/xrGame/stalker_alife_actions.cpp index 3d45d2efb4c..752ccd69c5a 100644 --- a/src/xrGame/stalker_alife_actions.cpp +++ b/src/xrGame/stalker_alife_actions.cpp @@ -129,7 +129,7 @@ void CStalkerActionGatherItems::initialize () else object().CObjectHandler::set_goal (eObjectActionIdle,object().inventory().ActiveItem()); - CObject const* const selected = object().memory().item().selected(); + IGameObject const* const selected = object().memory().item().selected(); typedef CAI_Stalker::ignored_touched_objects_type ignored_touched_objects_type; ignored_touched_objects_type& ignored_touched_objects = m_object->ignored_touched_objects(); diff --git a/src/xrGame/stalker_animation_script.h b/src/xrGame/stalker_animation_script.h index 31528c9ac8a..5d938f74615 100644 --- a/src/xrGame/stalker_animation_script.h +++ b/src/xrGame/stalker_animation_script.h @@ -24,7 +24,7 @@ class CStalkerAnimationScript { IC const bool& hand_usage () const; IC const bool& use_movement_controller () const; IC const bool& local_animation () const; - IC Fmatrix const& transform (CObject const& object) const; + IC Fmatrix const& transform (IGameObject const& object) const; IC bool has_transform () const; }; diff --git a/src/xrGame/stalker_animation_script_inline.h b/src/xrGame/stalker_animation_script_inline.h index 75c8b0b22ad..6446c340d72 100644 --- a/src/xrGame/stalker_animation_script_inline.h +++ b/src/xrGame/stalker_animation_script_inline.h @@ -63,7 +63,7 @@ IC const bool &CStalkerAnimationScript::local_animation () const return (m_local_animation); } -IC Fmatrix const& CStalkerAnimationScript::transform (CObject const& object) const +IC Fmatrix const& CStalkerAnimationScript::transform (IGameObject const& object) const { if (m_transform_ptr) return (*m_transform_ptr); diff --git a/src/xrGame/stalker_anomaly_actions.cpp b/src/xrGame/stalker_anomaly_actions.cpp index 4a56bc86373..af132431e02 100644 --- a/src/xrGame/stalker_anomaly_actions.cpp +++ b/src/xrGame/stalker_anomaly_actions.cpp @@ -101,8 +101,8 @@ void CStalkerActionGetOutOfAnomaly::execute () typedef xr_vector ids_type; ids_type const& restrictions = alife_object->m_dynamic_in_restrictions; - xr_vector::const_iterator I = object().feel_touch.begin(); - xr_vector::const_iterator E = object().feel_touch.end(); + xr_vector::const_iterator I = object().feel_touch.begin(); + xr_vector::const_iterator E = object().feel_touch.end(); for ( ; I != E; ++I) { CCustomZone *zone = smart_cast(*I); if ( zone && (zone->restrictor_type() != RestrictionSpace::eRestrictorTypeNone) ) { diff --git a/src/xrGame/stalker_kill_wounded_actions.cpp b/src/xrGame/stalker_kill_wounded_actions.cpp index a2d598e66a3..ecdb59fa518 100644 --- a/src/xrGame/stalker_kill_wounded_actions.cpp +++ b/src/xrGame/stalker_kill_wounded_actions.cpp @@ -131,7 +131,7 @@ void CStalkerActionReachWounded::execute () return; } -// CObject *processor = Level().Objects.net_Find(processor_id); +// IGameObject *processor = Level().Objects.net_Find(processor_id); // if (processor && processor->Position().distance_to_sqr(object().Position()) < _sqr(3.f)) { // object().movement().set_movement_type (eMovementTypeStand); // return; diff --git a/src/xrGame/stalker_movement_manager_base.cpp b/src/xrGame/stalker_movement_manager_base.cpp index 5e24e1fcd9a..7a7c76c816b 100644 --- a/src/xrGame/stalker_movement_manager_base.cpp +++ b/src/xrGame/stalker_movement_manager_base.cpp @@ -772,7 +772,7 @@ void stalker_movement_manager_base::set_level_dest_vertex (u32 const& level_vert m_target.cover_id (""); } -void stalker_movement_manager_base::remove_links (CObject *object) +void stalker_movement_manager_base::remove_links (IGameObject *object) { m_last_query_object = 0; } \ No newline at end of file diff --git a/src/xrGame/stalker_movement_manager_base.h b/src/xrGame/stalker_movement_manager_base.h index 75e3b9edb4f..b44c5bd5991 100644 --- a/src/xrGame/stalker_movement_manager_base.h +++ b/src/xrGame/stalker_movement_manager_base.h @@ -50,7 +50,7 @@ class stalker_movement_manager_base : public CMovementManager { virtual void on_travel_point_change (const u32 &previous_travel_point_index); virtual void on_restrictions_change (); virtual void set_level_dest_vertex (u32 const& level_vertex_id); - virtual void remove_links (CObject *object); + virtual void remove_links (IGameObject *object); void initialize (); IC float path_direction_angle (); IC bool turn_in_place () const; diff --git a/src/xrGame/stalker_movement_manager_obstacles.cpp b/src/xrGame/stalker_movement_manager_obstacles.cpp index 4c95ed6bf26..90c817c1d38 100644 --- a/src/xrGame/stalker_movement_manager_obstacles.cpp +++ b/src/xrGame/stalker_movement_manager_obstacles.cpp @@ -210,7 +210,7 @@ const float &stalker_movement_manager_obstacles::prediction_speed () const return (object().animation().target_speed()); } -void stalker_movement_manager_obstacles::remove_links (CObject *object) +void stalker_movement_manager_obstacles::remove_links (IGameObject *object) { inherited::remove_links (object); m_static_obstacles.remove_links (object); diff --git a/src/xrGame/stalker_movement_manager_obstacles.h b/src/xrGame/stalker_movement_manager_obstacles.h index 7fd9780b97b..242899420ca 100644 --- a/src/xrGame/stalker_movement_manager_obstacles.h +++ b/src/xrGame/stalker_movement_manager_obstacles.h @@ -27,7 +27,7 @@ class stalker_movement_manager_obstacles : public stalker_movement_manager_base stalker_movement_manager_obstacles (CAI_Stalker *object); virtual ~stalker_movement_manager_obstacles (); virtual void move_along_path (CPHMovementControl *movement_control, Fvector &dest_position, float time_delta); - virtual void remove_links (CObject *object); + virtual void remove_links (IGameObject *object); virtual void Load ( LPCSTR section ); float is_going_through ( Fmatrix const& matrix, Fvector const& vector, float max_distance ) const; void on_death ( ); diff --git a/src/xrGame/stalker_movement_manager_smart_cover.cpp b/src/xrGame/stalker_movement_manager_smart_cover.cpp index 4fad0ae67d3..f4b83d0ce2c 100644 --- a/src/xrGame/stalker_movement_manager_smart_cover.cpp +++ b/src/xrGame/stalker_movement_manager_smart_cover.cpp @@ -565,7 +565,7 @@ bool stalker_movement_manager_smart_cover::in_smart_cover () const return (false); } -void stalker_movement_manager_smart_cover::remove_links (CObject *object) +void stalker_movement_manager_smart_cover::remove_links (IGameObject *object) { inherited::remove_links ( object ); diff --git a/src/xrGame/stalker_movement_manager_smart_cover.h b/src/xrGame/stalker_movement_manager_smart_cover.h index 1e3b8fcecba..ff478311dfd 100644 --- a/src/xrGame/stalker_movement_manager_smart_cover.h +++ b/src/xrGame/stalker_movement_manager_smart_cover.h @@ -50,7 +50,7 @@ class stalker_movement_manager_smart_cover : public stalker_movement_manager_obs virtual void reinit (); virtual void update (u32 time_delta); virtual void on_frame (CPHMovementControl *movement_control, Fvector &dest_position); - virtual void remove_links (CObject *object); + virtual void remove_links (IGameObject *object); void cleanup_after_animation_selector(); bool in_smart_cover () const; inline bool check_can_kill_enemy () const; diff --git a/src/xrGame/static_obstacles_avoider.cpp b/src/xrGame/static_obstacles_avoider.cpp index 5370a91b45e..6c73ff82b29 100644 --- a/src/xrGame/static_obstacles_avoider.cpp +++ b/src/xrGame/static_obstacles_avoider.cpp @@ -124,7 +124,7 @@ void static_obstacles_avoider::update () process_query (true); } -void static_obstacles_avoider::remove_links (CObject *object) +void static_obstacles_avoider::remove_links (IGameObject *object) { m_current_iteration.remove_links(object); m_inactive_query.remove_links (object); diff --git a/src/xrGame/static_obstacles_avoider.h b/src/xrGame/static_obstacles_avoider.h index 76e13da42cb..e6a87305489 100644 --- a/src/xrGame/static_obstacles_avoider.h +++ b/src/xrGame/static_obstacles_avoider.h @@ -52,7 +52,7 @@ class static_obstacles_avoider { void query (const Fvector &start_position, const Fvector &dest_position); virtual bool process_query (const bool &change_path_state); void update (); - void remove_links (CObject *object); + void remove_links (IGameObject *object); }; #include "static_obstacles_avoider_inline.h" \ No newline at end of file diff --git a/src/xrGame/team_base_zone.cpp b/src/xrGame/team_base_zone.cpp index fc4b34a8b51..d8933f37abf 100644 --- a/src/xrGame/team_base_zone.cpp +++ b/src/xrGame/team_base_zone.cpp @@ -109,7 +109,7 @@ void CTeamBaseZone::shedule_Update(u32 dt) feel_touch_update (P,s.R); } -void CTeamBaseZone::feel_touch_new (CObject *tpObject) +void CTeamBaseZone::feel_touch_new (IGameObject *tpObject) { if(OnServer() && smart_cast(tpObject)) { @@ -123,7 +123,7 @@ void CTeamBaseZone::feel_touch_new (CObject *tpObject) }; } -void CTeamBaseZone::feel_touch_delete (CObject *tpObject) +void CTeamBaseZone::feel_touch_delete (IGameObject *tpObject) { if(OnServer() && smart_cast(tpObject)) { @@ -136,7 +136,7 @@ void CTeamBaseZone::feel_touch_delete (CObject *tpObject) }; } -bool CTeamBaseZone::feel_touch_contact (CObject* O) +bool CTeamBaseZone::feel_touch_contact (IGameObject* O) { CActor* pActor = smart_cast(O); if (!pActor) return (false); diff --git a/src/xrGame/team_base_zone.h b/src/xrGame/team_base_zone.h index 1e2d06bb6d5..fc30b90e7ba 100644 --- a/src/xrGame/team_base_zone.h +++ b/src/xrGame/team_base_zone.h @@ -27,9 +27,9 @@ class CTeamBaseZone : public CGameObject, public Feel::Touch { virtual float Radius () const; virtual void shedule_Update (u32 dt); - virtual void feel_touch_new (CObject* O); - virtual void feel_touch_delete (CObject* O); - virtual bool feel_touch_contact (CObject* O); + virtual void feel_touch_new (IGameObject* O); + virtual void feel_touch_delete (IGameObject* O); + virtual bool feel_touch_contact (IGameObject* O); virtual u8 GetZoneTeam () { return m_Team; }; #ifdef DEBUG diff --git a/src/xrGame/trade.h b/src/xrGame/trade.h index 2610054c937..3e310036cf4 100644 --- a/src/xrGame/trade.h +++ b/src/xrGame/trade.h @@ -7,7 +7,7 @@ class CEntity; class CTrade { - xr_vector m_nearest; + xr_vector m_nearest; bool TradeState; // режим торговли. true - включен u32 m_dwLastTradeTime; diff --git a/src/xrGame/trajectories.cpp b/src/xrGame/trajectories.cpp index 0664a214539..a4173c2088c 100644 --- a/src/xrGame/trajectories.cpp +++ b/src/xrGame/trajectories.cpp @@ -94,8 +94,8 @@ bool trajectory_check_collision (float low, Fvector const & position, Fvector const & velocity, Fvector const & gravity, - CObject * const self_object, - CObject * const ignored_object, + IGameObject * const self_object, + IGameObject * const ignored_object, Fvector & collide_position, collide::rq_results & temp_rq_results, Fvector box_size, @@ -189,8 +189,8 @@ bool trajectory_intersects_geometry (float trajectory_time, Fvector const & trajectory_end, Fvector const & trajectory_velocity, Fvector & collide_position, - CObject * const self_object, - CObject * const ignored_object, + IGameObject * const self_object, + IGameObject * const ignored_object, collide::rq_results & temp_rq_results, xr_vector * const out_trajectory_picks, xr_vector * const out_collide_tris, diff --git a/src/xrGame/trajectories.h b/src/xrGame/trajectories.h index 18c4e814158..fa383adae13 100644 --- a/src/xrGame/trajectories.h +++ b/src/xrGame/trajectories.h @@ -18,8 +18,8 @@ bool trajectory_intersects_geometry (float trajectory_time, Fvector const & trajectory_end, Fvector const & trajectory_velocity, Fvector & collide_position, - CObject * const self_object, - CObject * const ignored_object, + IGameObject * const self_object, + IGameObject * const ignored_object, collide::rq_results & temp_rq_results, xr_vector * const out_trajectory_picks, xr_vector * const out_collide_tris, diff --git a/src/xrGame/ui/UIActorMenuInventory.cpp b/src/xrGame/ui/UIActorMenuInventory.cpp index caab0a8a99e..3b4951b3f93 100644 --- a/src/xrGame/ui/UIActorMenuInventory.cpp +++ b/src/xrGame/ui/UIActorMenuInventory.cpp @@ -1056,7 +1056,7 @@ void CUIActorMenu::PropertiesBoxForUsing( PIItem item, bool& b_show ) } else if ( pEatableItem ) { - CObject* pObj = smart_cast (item); + IGameObject* pObj = smart_cast (item); shared_str section_name = pObj->cNameSect(); if ( !xr_strcmp(section_name,"vodka") || !(xr_strcmp(section_name,"energy_drink")) ) { diff --git a/src/xrGame/ui/UIHudStatesWnd.cpp b/src/xrGame/ui/UIHudStatesWnd.cpp index ba74749c197..a99d50e783f 100644 --- a/src/xrGame/ui/UIHudStatesWnd.cpp +++ b/src/xrGame/ui/UIHudStatesWnd.cpp @@ -395,7 +395,7 @@ void CUIHudStatesWnd::UpdateZones() CPda* const pda = actor->GetPDA(); if(pda) { - typedef xr_vector monsters; + typedef xr_vector monsters; for(monsters::const_iterator it = pda->feel_touch.begin(); it != pda->feel_touch.end(); ++it) { diff --git a/src/xrGame/vision_client.cpp b/src/xrGame/vision_client.cpp index 23dca357be2..c1fe6c97bc4 100644 --- a/src/xrGame/vision_client.cpp +++ b/src/xrGame/vision_client.cpp @@ -110,7 +110,7 @@ bool vision_client::shedule_Needed () return (true); } -float vision_client::feel_vision_mtl_transp (CObject* O, u32 element) +float vision_client::feel_vision_mtl_transp (IGameObject* O, u32 element) { return (visual().feel_vision_mtl_transp(O,element)); } @@ -125,7 +125,7 @@ void vision_client::reload (LPCSTR section) visual().reload (section); } -void vision_client::remove_links (CObject *object) +void vision_client::remove_links (IGameObject *object) { visual().remove_links (object); } \ No newline at end of file diff --git a/src/xrGame/vision_client.h b/src/xrGame/vision_client.h index 2bb52880143..7762d5f3bb0 100644 --- a/src/xrGame/vision_client.h +++ b/src/xrGame/vision_client.h @@ -11,7 +11,7 @@ #include "xrEngine/feel_vision.h" -class CObject; +class IGameObject; class CEntity; class CVisualMemoryManager; @@ -49,10 +49,10 @@ class vision_client : virtual bool shedule_Needed (); public: - virtual float feel_vision_mtl_transp (CObject *object, u32 element); + virtual float feel_vision_mtl_transp (IGameObject *object, u32 element); public: - virtual bool feel_vision_isRelevant (CObject *object) = 0; + virtual bool feel_vision_isRelevant (IGameObject *object) = 0; virtual void camera ( Fvector &position, Fvector &direction, @@ -67,7 +67,7 @@ class vision_client : public: virtual void reinit (); virtual void reload (LPCSTR section); - void remove_links (CObject *object); + void remove_links (IGameObject *object); public: IC CVisualMemoryManager &visual () const; diff --git a/src/xrGame/visual_memory_manager.cpp b/src/xrGame/visual_memory_manager.cpp index ceeca5141d2..52b8ffc78ea 100644 --- a/src/xrGame/visual_memory_manager.cpp +++ b/src/xrGame/visual_memory_manager.cpp @@ -56,7 +56,7 @@ struct CVisibleObjectPredicate { { } - bool operator() (const CObject *object) const + bool operator() (const IGameObject *object) const { VERIFY (object); return (object->ID() == m_id); @@ -171,7 +171,7 @@ IC const CVisionParameters &CVisualMemoryManager::current_state() const } } -u32 CVisualMemoryManager::visible_object_time_last_seen (const CObject *object) const +u32 CVisualMemoryManager::visible_object_time_last_seen (const IGameObject *object) const { VISIBLES::iterator I = std::find(m_objects->begin(),m_objects->end(),object_id(object)); if (I != m_objects->end()) @@ -223,7 +223,7 @@ bool CVisualMemoryManager::visible_now (const CGameObject *game_object) const return ((objects().end() != I) && (*I).visible(mask())); } -void CVisualMemoryManager::enable (const CObject *object, bool enable) +void CVisualMemoryManager::enable (const IGameObject *object, bool enable) { VISIBLES::iterator J = std::find(m_objects->begin(),m_objects->end(),object_id(object)); if (J == m_objects->end()) @@ -301,8 +301,8 @@ float CVisualMemoryManager::get_object_velocity (const CGameObject *game_object, if ((game_object->ps_Size() < 2) || (not_yet_visible_object.m_prev_time == game_object->ps_Element(game_object->ps_Size() - 2).dwTime)) return (0.f); - CObject::SavedPosition pos0 = game_object->ps_Element (game_object->ps_Size() - 2); - CObject::SavedPosition pos1 = game_object->ps_Element (game_object->ps_Size() - 1); + GameObjectSavedPosition pos0 = game_object->ps_Element (game_object->ps_Size() - 2); + GameObjectSavedPosition pos1 = game_object->ps_Element (game_object->ps_Size() - 1); return ( pos1.vPosition.distance_to(pos0.vPosition)/ @@ -411,7 +411,7 @@ bool CVisualMemoryManager::visible (const CGameObject *game_object, float tim return (object->m_value >= current_state().m_visibility_threshold); } -bool CVisualMemoryManager::should_ignore_object (CObject const* object) const +bool CVisualMemoryManager::should_ignore_object (IGameObject const* object) const { if ( !object ) { @@ -437,7 +437,7 @@ bool CVisualMemoryManager::should_ignore_object (CObject const* object) const return false; } -void CVisualMemoryManager::add_visible_object (const CObject *object, float time_delta, bool fictitious) +void CVisualMemoryManager::add_visible_object (const IGameObject *object, float time_delta, bool fictitious) { if ( !fictitious && should_ignore_object(object) ) { @@ -546,7 +546,7 @@ bool CVisualMemoryManager::visible(u32 _level_vertex_id, float yaw, float eye_fo return(false); } -float CVisualMemoryManager::feel_vision_mtl_transp(CObject* O, u32 element) +float CVisualMemoryManager::feel_vision_mtl_transp(IGameObject* O, u32 element) { float vis = 1.f; if (O){ @@ -563,9 +563,9 @@ float CVisualMemoryManager::feel_vision_mtl_transp(CObject* O, u32 element) } struct CVisibleObjectPredicateEx { - const CObject *m_object; + const IGameObject *m_object; - CVisibleObjectPredicateEx (const CObject *object) : + CVisibleObjectPredicateEx (const IGameObject *object) : m_object (object) { } @@ -589,7 +589,7 @@ struct CVisibleObjectPredicateEx { } }; -void CVisualMemoryManager::remove_links (CObject *object) +void CVisualMemoryManager::remove_links (IGameObject *object) { { VERIFY (m_objects); @@ -656,8 +656,8 @@ void CVisualMemoryManager::update (float time_delta) START_PROFILE("Memory Manager/visuals/update/add_visibles") { - xr_vector::const_iterator I = m_visible_objects.begin(); - xr_vector::const_iterator E = m_visible_objects.end(); + xr_vector::const_iterator I = m_visible_objects.begin(); + xr_vector::const_iterator E = m_visible_objects.end(); for ( ; I != E; ++I) add_visible_object (*I,time_delta); } @@ -892,7 +892,7 @@ void CVisualMemoryManager::clear_delayed_objects() m_delayed_objects.clear (); } -void CVisualMemoryManager::on_requested_spawn (CObject *object) +void CVisualMemoryManager::on_requested_spawn (IGameObject *object) { DELAYED_VISIBLE_OBJECTS::iterator I = m_delayed_objects.begin(); DELAYED_VISIBLE_OBJECTS::iterator E = m_delayed_objects.end(); diff --git a/src/xrGame/visual_memory_manager.h b/src/xrGame/visual_memory_manager.h index b99f734e4a6..cf59f286a97 100644 --- a/src/xrGame/visual_memory_manager.h +++ b/src/xrGame/visual_memory_manager.h @@ -23,7 +23,7 @@ class CVisualMemoryManager { typedef MemorySpace::CVisibleObject CVisibleObject; typedef MemorySpace::CNotYetVisibleObject CNotYetVisibleObject; typedef xr_vector VISIBLES; - typedef xr_vector RAW_VISIBLES; + typedef xr_vector RAW_VISIBLES; typedef xr_vector NOT_YET_VISIBLES; private: @@ -58,11 +58,11 @@ class CVisualMemoryManager { u32 m_last_update_time; public: - void add_visible_object (const CObject *object, float time_delta, bool fictitious = false); + void add_visible_object (const IGameObject *object, float time_delta, bool fictitious = false); protected: IC void fill_object (CVisibleObject &visible_object, const CGameObject *game_object); - bool should_ignore_object (CObject const* object) const; + bool should_ignore_object (IGameObject const* object) const; void add_visible_object (const CVisibleObject visible_object); float object_visible_distance (const CGameObject *game_object, float &object_distance) const; float object_luminocity (const CGameObject *game_object) const; @@ -71,7 +71,7 @@ class CVisualMemoryManager { u32 get_prev_time (const CGameObject *game_object) const; public: - u32 visible_object_time_last_seen (const CObject *object) const; + u32 visible_object_time_last_seen (const IGameObject *object) const; protected: void add_not_yet_visible_object (const CNotYetVisibleObject ¬_yet_visible_object); @@ -88,8 +88,8 @@ class CVisualMemoryManager { virtual void reinit (); virtual void reload (LPCSTR section); virtual void update (float time_delta); - virtual float feel_vision_mtl_transp (CObject* O, u32 element); - void remove_links (CObject *object); + virtual float feel_vision_mtl_transp (IGameObject* O, u32 element); + void remove_links (IGameObject *object); public: bool visible (const CGameObject *game_object, float time_delta); @@ -113,7 +113,7 @@ class CVisualMemoryManager { bool visible_now (const CGameObject *game_object) const; public: - void enable (const CObject *object, bool enable); + void enable (const IGameObject *object, bool enable); public: IC float visibility_threshold () const; @@ -138,7 +138,7 @@ class CVisualMemoryManager { public: void save (NET_Packet &packet) const; void load (IReader &packet); - void on_requested_spawn (CObject *object); + void on_requested_spawn (IGameObject *object); private: void clear_delayed_objects (); diff --git a/src/xrGame/wallmark_manager.cpp b/src/xrGame/wallmark_manager.cpp index 26e1153a912..4bec35d2eef 100644 --- a/src/xrGame/wallmark_manager.cpp +++ b/src/xrGame/wallmark_manager.cpp @@ -58,7 +58,7 @@ void CWalmarkManager::AddWallmark(const Fvector& dir, const Fvector& start_pos, /* void CWalmarkManager::PlaceWallmark(const Fvector& dir, const Fvector& start_pos, float trace_dist, float wallmark_size, - SHADER_VECTOR& wallmarks_vector,CObject* ignore_obj) + SHADER_VECTOR& wallmarks_vector,IGameObject* ignore_obj) { collide::rq_result result; BOOL reach_wall = diff --git a/src/xrGame/wallmark_manager.h b/src/xrGame/wallmark_manager.h index bac34ce5eea..ac59eee42ed 100644 --- a/src/xrGame/wallmark_manager.h +++ b/src/xrGame/wallmark_manager.h @@ -9,7 +9,7 @@ class CWalmarkManager FactoryPtr m_wallmarks; Fvector m_pos; public: - CObject* m_owner; + IGameObject* m_owner; CWalmarkManager () ; ~CWalmarkManager () ; void Load (LPCSTR section) ; diff --git a/src/xrGame/xrServer_svclient_validation.cpp b/src/xrGame/xrServer_svclient_validation.cpp index 9bdfb266ded..2f6072a1c66 100644 --- a/src/xrGame/xrServer_svclient_validation.cpp +++ b/src/xrGame/xrServer_svclient_validation.cpp @@ -5,7 +5,7 @@ bool is_object_valid_on_svclient(u16 id_entity) { - CObject* tmp_obj = Level().Objects.net_Find(id_entity); + IGameObject* tmp_obj = Level().Objects.net_Find(id_entity); if (!tmp_obj) return false; diff --git a/src/xrPhysics/IColisiondamageInfo.h b/src/xrPhysics/IColisiondamageInfo.h index 0b3ee9acb13..39325e36ca8 100644 --- a/src/xrPhysics/IColisiondamageInfo.h +++ b/src/xrPhysics/IColisiondamageInfo.h @@ -9,7 +9,7 @@ class ICollisionDamageInfo virtual void HitDir (Fvector &dir) const =0; virtual const Fvector& HitPos () const =0; virtual u16 DamageInitiatorID () const =0; - virtual CObject *DamageInitiator () const =0; + virtual IGameObject *DamageInitiator () const =0; virtual ALife::EHitType HitType () const =0; virtual ICollisionHitCallback *HitCallback () const =0; virtual void Reinit () =0; diff --git a/src/xrPhysics/PHCapture.cpp b/src/xrPhysics/PHCapture.cpp index e2eeaf02d47..920650f76d3 100644 --- a/src/xrPhysics/PHCapture.cpp +++ b/src/xrPhysics/PHCapture.cpp @@ -150,7 +150,7 @@ void CPHCapture::PullingUpdate() Fvector dir; Fvector capture_bone_position; - //CObject* object=smart_cast(m_character->PhysicsRefObject()); + //IGameObject* object=smart_cast(m_character->PhysicsRefObject()); capture_bone_position.set(m_capture_bone->mTransform.c); m_character->PhysicsRefObject()->ObjectXFORM().transform_tiny(capture_bone_position); m_taget_element->GetGlobalPositionDynamic(&dir); @@ -309,7 +309,7 @@ void CPHCapture::CapturedUpdate() } Fvector capture_bone_position; - //CObject* object=smart_cast(m_character->PhysicsRefObject()); + //IGameObject* object=smart_cast(m_character->PhysicsRefObject()); capture_bone_position.set(m_capture_bone->mTransform.c); m_character->PhysicsRefObject()->ObjectXFORM().transform_tiny(capture_bone_position); dBodySetPosition(m_body,capture_bone_position.x,capture_bone_position.y,capture_bone_position.z); diff --git a/src/xrPhysics/PHObject.cpp b/src/xrPhysics/PHObject.cpp index f947ea2e202..3b9be60dd84 100644 --- a/src/xrPhysics/PHObject.cpp +++ b/src/xrPhysics/PHObject.cpp @@ -104,7 +104,8 @@ void CPHObject::Collide() qResultVec& result=ph_world->r_spatial; qResultIt i=result.begin(),e=result.end(); for(;i!=e;++i) { - CPHObject* obj2=static_cast(*i); + CPHObject *obj2 = smart_cast(*i); + VERIFY(obj2); if(obj2==this || !obj2->m_flags.test(st_dirty)) continue; dGeomID motion_ray=ph_world->GetMotionRayGeom(); dGeomRayMotionSetGeom(motion_ray,I.dGeom()); @@ -124,7 +125,8 @@ void CPHObject:: CollideDynamics () qResultVec& result=ph_world->r_spatial ; qResultIt i=result.begin(),e=result.end(); for(;i!=e;++i) { - CPHObject* obj2=static_cast(*i); + CPHObject *obj2 = smart_cast(*i); + VERIFY(obj2); if(obj2==this || !obj2->m_flags.test(st_dirty)) continue; if(CPHCollideValidator::DoCollide(*this,*obj2)) NearCallback(this,obj2,dSpacedGeom(),obj2->dSpacedGeom()); } @@ -136,7 +138,8 @@ void CPHObject::reinit_single() qResultIt i=result.begin(),e=result.end(); for(;i!=e;++i) { - CPHObject* obj=static_cast(*i); + CPHObject *obj = smart_cast(*i); + VERIFY(obj); obj->IslandReinit(); } result.clear_not_free(); diff --git a/src/xrPhysics/PHSimpleCharacter.cpp b/src/xrPhysics/PHSimpleCharacter.cpp index 59b4c8bd330..a3466ef8d47 100644 --- a/src/xrPhysics/PHSimpleCharacter.cpp +++ b/src/xrPhysics/PHSimpleCharacter.cpp @@ -1431,7 +1431,7 @@ u16 CPHSimpleCharacter::RetriveContactBone() collide::ray_defs Q(m_collision_damage_info.HitPos(), dir, m_radius, CDB::OPT_ONLYNEAREST|CDB::OPT_CULL,collide::rqtBoth); // CDB::OPT_ONLYFIRST CDB::OPT_ONLYNEAREST RQR.r_clear (); u16 contact_bone = 0; -// CObject* object = smart_cast(m_phys_ref_object); +// IGameObject* object = smart_cast(m_phys_ref_object); //VERIFY (object) ; VERIFY (!fis_zero(Q.dir.square_magnitude())); if (inl_ph_world().ObjectSpace().RayQuery(RQR,m_phys_ref_object->ObjectCollisionModel(),Q)) { @@ -1744,7 +1744,7 @@ u16 CPHSimpleCharacter::DamageInitiatorID()const IPhysicsShellHolder* object = 0; if( m_collision_damage_info.m_obj_id != u16(-1) ) { - CObject * obj = inl_ph_world().LevelObjects().net_Find(m_collision_damage_info.m_obj_id); + IGameObject * obj = inl_ph_world().LevelObjects().net_Find(m_collision_damage_info.m_obj_id); VERIFY(!obj|| smart_cast(obj) ); object=smart_cast(obj); } @@ -1759,15 +1759,15 @@ u16 CPHSimpleCharacter::DamageInitiatorID()const return ret; } -CObject* CPHSimpleCharacter::DamageInitiator() const +IGameObject* CPHSimpleCharacter::DamageInitiator() const { VERIFY(m_phys_ref_object); if( m_collision_damage_info.m_dmc_type==SCollisionDamageInfo::ctStatic ) - return smart_cast (m_phys_ref_object); + return smart_cast (m_phys_ref_object); u16 initiator_id=DamageInitiatorID(); VERIFY(initiator_id!=u16(-1)); if(initiator_id==m_phys_ref_object->ObjectID()) - return smart_cast (m_phys_ref_object); + return smart_cast (m_phys_ref_object); else { return inl_ph_world ().LevelObjects().net_Find(initiator_id); @@ -1965,7 +1965,7 @@ IC bool valide_res( u16& res_material_idx, const collide::rq_result &R ) return true; } -bool PickMaterial( u16& res_material_idx, const Fvector &pos_, const Fvector &dir_,float range_, CObject* ignore_object ) +bool PickMaterial( u16& res_material_idx, const Fvector &pos_, const Fvector &dir_,float range_, IGameObject* ignore_object ) { Fvector pos = pos_; pos.y+=EPS_L; Fvector dir = dir_; @@ -2000,8 +2000,8 @@ void CPHSimpleCharacter::update_last_material() return; } u16 new_material; - VERIFY(!PhysicsRefObject() || smart_cast( PhysicsRefObject() ) ); - if( PickMaterial( new_material, pos, Fvector().set( 0, -1, 0 ), material_pick_dist + material_pick_upset, smart_cast( PhysicsRefObject() ) ) ) + VERIFY(!PhysicsRefObject() || smart_cast( PhysicsRefObject() ) ); + if( PickMaterial( new_material, pos, Fvector().set( 0, -1, 0 ), material_pick_dist + material_pick_upset, smart_cast( PhysicsRefObject() ) ) ) { m_last_picked_material = new_material; *p_lastMaterialIDX = new_material; diff --git a/src/xrPhysics/PHSimpleCharacter.h b/src/xrPhysics/PHSimpleCharacter.h index 7c15a2c788c..85286f2113c 100644 --- a/src/xrPhysics/PHSimpleCharacter.h +++ b/src/xrPhysics/PHSimpleCharacter.h @@ -155,7 +155,7 @@ class CPHSimpleCharacter : virtual void HitDir (Fvector& dir)const {return m_collision_damage_info.HitDir(dir);} virtual const Fvector& HitPos ()const {return m_collision_damage_info.HitPos();} virtual u16 DamageInitiatorID ()const ; - virtual CObject *DamageInitiator ()const ; + virtual IGameObject *DamageInitiator ()const ; virtual ALife::EHitType HitType ()const {return m_collision_damage_info.m_hit_type; }; virtual void SetInitiated (); virtual bool IsInitiated ()const ; diff --git a/src/xrPhysics/debug_output.cpp b/src/xrPhysics/debug_output.cpp index ca9e38cabac..bfc2c97573a 100644 --- a/src/xrPhysics/debug_output.cpp +++ b/src/xrPhysics/debug_output.cpp @@ -81,9 +81,9 @@ virtual void _cdecl DBG_OutText( LPCSTR s,... ) } //virtual void DBG_TextOutSet( float x, float y ) =0; //virtual void DBG_TextSetColor( u32 color ) =0; -//virtual void DBG_DrawBind( CObject &O ) =0; -//virtual void DBG_PhysBones( CObject &O ) =0; -//virtual void DBG_DrawBones( CObject &O ) =0; +//virtual void DBG_DrawBind( IGameObject &O ) =0; +//virtual void DBG_PhysBones( IGameObject &O ) =0; +//virtual void DBG_DrawBones( IGameObject &O ) =0; virtual void DBG_DrawFrameStart( ) { diff --git a/src/xrPhysics/debug_output.h b/src/xrPhysics/debug_output.h index 97d17790633..e875f6ae328 100644 --- a/src/xrPhysics/debug_output.h +++ b/src/xrPhysics/debug_output.h @@ -94,9 +94,9 @@ virtual void DBG_DrawMatrix( const Fmatrix &m, float size, u8 a=255 ) =0; virtual void _cdecl DBG_OutText( LPCSTR s,... ) =0; //virtual void DBG_TextOutSet( float x, float y ) =0; //virtual void DBG_TextSetColor( u32 color ) =0; -//virtual void DBG_DrawBind( CObject &O ) =0; -//virtual void DBG_PhysBones( CObject &O ) =0; -//virtual void DBG_DrawBones( CObject &O ) =0; +//virtual void DBG_DrawBind( IGameObject &O ) =0; +//virtual void DBG_PhysBones( IGameObject &O ) =0; +//virtual void DBG_DrawBones( IGameObject &O ) =0; virtual void DBG_DrawFrameStart( ) =0; virtual void PH_DBG_Render( ) =0; virtual void PH_DBG_Clear( ) =0; diff --git a/src/xrServerEntities/smart_cast.h b/src/xrServerEntities/smart_cast.h index faebc837745..91fe49f2563 100644 --- a/src/xrServerEntities/smart_cast.h +++ b/src/xrServerEntities/smart_cast.h @@ -82,16 +82,16 @@ # undef cast_type_list # define cast_type_list save_cast_list (IRender_Light, ISpatial) - DECLARE_SPECIALIZATION (CObject, ISpatial, dcast_CObject); + DECLARE_SPECIALIZATION (CGameObject, ISpatial, dcast_GameObject); # undef cast_type_list -# define cast_type_list save_cast_list (CObject, ISpatial) +# define cast_type_list save_cast_list (CGameObject, ISpatial) # ifndef DO_NOT_DECLARE_TYPE_LIST - class CObject; + class IGameObject; class CGameObject; - add_to_cast_list (CGameObject, CObject); + add_to_cast_list (CGameObject, IGameObject); # undef cast_type_list -# define cast_type_list save_cast_list (CGameObject, CObject) +# define cast_type_list save_cast_list (CGameObject, IGameObject) # endif DECLARE_SPECIALIZATION (CEntity, CGameObject, cast_entity); diff --git a/src/xrServerEntities/smart_cast_impl1.h b/src/xrServerEntities/smart_cast_impl1.h index 9debbc4ed42..3a216bff695 100644 --- a/src/xrServerEntities/smart_cast_impl1.h +++ b/src/xrServerEntities/smart_cast_impl1.h @@ -512,5 +512,5 @@ IC T1 smart_cast(T2& p) #ifdef XRGAME_EXPORTS template <> extern - CGameObject* SmartDynamicCast::smart_cast(CObject *p); + CGameObject* SmartDynamicCast::smart_cast(IGameObject *p); #endif diff --git a/src/xrServerEntities/smart_cast_impl2.h b/src/xrServerEntities/smart_cast_impl2.h index 110715bc339..b9f1907bb87 100644 --- a/src/xrServerEntities/smart_cast_impl2.h +++ b/src/xrServerEntities/smart_cast_impl2.h @@ -16,7 +16,7 @@ #ifdef XRGAME_EXPORTS template <> - CGameObject* SmartDynamicCast::smart_cast(CObject *p) + CGameObject* SmartDynamicCast::smart_cast(IGameObject *p) { return static_cast(p); } diff --git a/src/xrServerEntities/xrServer_Space.h b/src/xrServerEntities/xrServer_Space.h index 8f0195ed11d..320f0205d58 100644 --- a/src/xrServerEntities/xrServer_Space.h +++ b/src/xrServerEntities/xrServer_Space.h @@ -14,7 +14,7 @@ #else // #ifdef XRGAME_EXPORTS # define SERVER_ENTITY_EDITOR_METHODS #endif // #ifndef XRGAME_EXPORTS - +// XXX: move to core/math struct SRotation { float yaw, pitch, roll; diff --git a/src/xrSound/Sound.h b/src/xrSound/Sound.h index 17a202f3a45..3de7d74c19a 100644 --- a/src/xrSound/Sound.h +++ b/src/xrSound/Sound.h @@ -23,7 +23,7 @@ #define OGG_COMMENT_VERSION 0x0003 // refs -class CObject; +class IGameObject; class XRSOUND_API CSound_params; class XRSOUND_API CSound_source; class XRSOUND_API CSound_emitter; @@ -89,7 +89,7 @@ class ref_sound_data : public xr_resource { CSound_emitter* feedback; //!< Pointer to emitter, automaticaly clears on emitter-stop esound_type s_type; int g_type; //!< Sound type, usually for AI - CObject* g_object; //!< Game object that emitts ref_sound + IGameObject* g_object; //!< Game object that emitts ref_sound CSound_UserDataPtr g_userdata; shared_str fn_attached [2]; @@ -118,7 +118,7 @@ struct ref_sound IC CSound_source* _handle () const {return _p?_p->handle:NULL;} IC CSound_emitter* _feedback () {return _p?_p->feedback:0;} - IC CObject* _g_object () {VERIFY(_p); return _p->g_object;} + IC IGameObject* _g_object () {VERIFY(_p); return _p->g_object;} IC int _g_type () {VERIFY(_p); return _p->g_type;} IC esound_type _sound_type () {VERIFY(_p); return _p->s_type;} IC CSound_UserDataPtr _g_userdata () {VERIFY(_p); return _p->g_userdata;} @@ -130,9 +130,9 @@ struct ref_sound IC void destroy ( ); - IC void play ( CObject* O, u32 flags=0, float delay=0.f); - IC void play_at_pos ( CObject* O, const Fvector &pos , u32 flags=0, float delay=0.f); - IC void play_no_feedback ( CObject* O, u32 flags=0, float delay=0.f, Fvector* pos=0, float* vol=0, float* freq=0, Fvector2* range=0); + IC void play ( IGameObject* O, u32 flags=0, float delay=0.f); + IC void play_at_pos ( IGameObject* O, const Fvector &pos , u32 flags=0, float delay=0.f); + IC void play_no_feedback ( IGameObject* O, u32 flags=0, float delay=0.f, Fvector* pos=0, float* vol=0, float* freq=0, Fvector2* range=0); IC void stop ( ); IC void stop_deffered ( ); @@ -220,7 +220,7 @@ class XRSOUND_API CSound_stats_ext float volume; esound_type type; int game_type; - CObject* game_object; + IGameObject* game_object; struct { u32 _3D :1; u32 _rendered :1; @@ -267,9 +267,9 @@ class XRSOUND_API CSound_manager_interface virtual void stop_emitters ( ) = 0; virtual int pause_emitters ( bool val ) = 0; - virtual void play ( ref_sound& S, CObject* O, u32 flags=0, float delay=0.f) = 0; - virtual void play_at_pos ( ref_sound& S, CObject* O, const Fvector &pos, u32 flags=0, float delay=0.f) = 0; - virtual void play_no_feedback ( ref_sound& S, CObject* O, u32 flags=0, float delay=0.f, Fvector* pos=0, float* vol=0, float* freq=0, Fvector2* range=0)= 0; + virtual void play ( ref_sound& S, IGameObject* O, u32 flags=0, float delay=0.f) = 0; + virtual void play_at_pos ( ref_sound& S, IGameObject* O, const Fvector &pos, u32 flags=0, float delay=0.f) = 0; + virtual void play_no_feedback ( ref_sound& S, IGameObject* O, u32 flags=0, float delay=0.f, Fvector* pos=0, float* vol=0, float* freq=0, Fvector2* range=0)= 0; virtual void set_master_volume ( float f=1.f ) = 0; virtual void set_geometry_env ( IReader* I ) = 0; @@ -283,7 +283,7 @@ class XRSOUND_API CSound_manager_interface virtual float get_occlusion_to ( const Fvector& hear_pt, const Fvector& snd_pt, float dispersion=0.2f) = 0; - virtual void object_relcase ( CObject* obj ) = 0; + virtual void object_relcase ( IGameObject* obj ) = 0; virtual const Fvector& listener_position () = 0; #ifdef __BORLANDC__ virtual SoundEnvironment_LIB* get_env_library () = 0; @@ -308,9 +308,9 @@ IC void ref_sound::attach_tail ( LPCSTR name) { VERIFY(!::Sound->i IC void ref_sound::clone ( const ref_sound& from,esound_type sound_type, int game_type) { VERIFY(!::Sound->i_locked()); ::Sound->clone (*this,from,sound_type,game_type); } IC void ref_sound::destroy ( ) { VERIFY(!::Sound->i_locked()); ::Sound->destroy (*this); } -IC void ref_sound::play ( CObject* O, u32 flags, float d) { VERIFY(!::Sound->i_locked()); ::Sound->play (*this,O,flags,d); } -IC void ref_sound::play_at_pos ( CObject* O, const Fvector &pos, u32 flags, float d) { VERIFY(!::Sound->i_locked()); ::Sound->play_at_pos(*this,O,pos,flags,d); } -IC void ref_sound::play_no_feedback ( CObject* O, u32 flags, float d, Fvector* pos, float* vol, float* freq, Fvector2* range){ VERIFY(!::Sound->i_locked()); ::Sound->play_no_feedback(*this,O,flags,d,pos,vol,freq,range); } +IC void ref_sound::play ( IGameObject* O, u32 flags, float d) { VERIFY(!::Sound->i_locked()); ::Sound->play (*this,O,flags,d); } +IC void ref_sound::play_at_pos ( IGameObject* O, const Fvector &pos, u32 flags, float d) { VERIFY(!::Sound->i_locked()); ::Sound->play_at_pos(*this,O,pos,flags,d); } +IC void ref_sound::play_no_feedback ( IGameObject* O, u32 flags, float d, Fvector* pos, float* vol, float* freq, Fvector2* range){ VERIFY(!::Sound->i_locked()); ::Sound->play_no_feedback(*this,O,flags,d,pos,vol,freq,range); } IC void ref_sound::set_position ( const Fvector &pos) { VERIFY(!::Sound->i_locked()); VERIFY(_feedback());_feedback()->set_position(pos); } IC void ref_sound::set_frequency ( float freq) { VERIFY(!::Sound->i_locked()); if (_feedback()) _feedback()->set_frequency(freq); } IC void ref_sound::set_range ( float min, float max ) { VERIFY(!::Sound->i_locked()); if (_feedback()) _feedback()->set_range(min,max); } diff --git a/src/xrSound/SoundRender_Core.cpp b/src/xrSound/SoundRender_Core.cpp index 2ff3f6974b9..f9547a19504 100644 --- a/src/xrSound/SoundRender_Core.cpp +++ b/src/xrSound/SoundRender_Core.cpp @@ -312,7 +312,7 @@ void CSoundRender_Core::clone ( ref_sound& S, const ref_sound& from, esound_t } -void CSoundRender_Core::play ( ref_sound& S, CObject* O, u32 flags, float delay) +void CSoundRender_Core::play ( ref_sound& S, IGameObject* O, u32 flags, float delay) { if (!bPresent || 0==S._handle())return; S._p->g_object = O; @@ -323,7 +323,7 @@ void CSoundRender_Core::play ( ref_sound& S, CObject* O, u32 flags, float de S._feedback()->switch_to_2D(); } -void CSoundRender_Core::play_no_feedback ( ref_sound& S, CObject* O, u32 flags, float delay, Fvector* pos, float* vol, float* freq, Fvector2* range) +void CSoundRender_Core::play_no_feedback ( ref_sound& S, IGameObject* O, u32 flags, float delay, Fvector* pos, float* vol, float* freq, Fvector2* range) { if (!bPresent || 0==S._handle())return; ref_sound_data_ptr orig = S._p; @@ -348,7 +348,7 @@ void CSoundRender_Core::play_no_feedback ( ref_sound& S, CObject* O, u32 flags, S._p = orig; } -void CSoundRender_Core::play_at_pos ( ref_sound& S, CObject* O, const Fvector &pos, u32 flags, float delay) +void CSoundRender_Core::play_at_pos ( ref_sound& S, IGameObject* O, const Fvector &pos, u32 flags, float delay) { if (!bPresent || 0==S._handle())return; S._p->g_object = O; @@ -520,7 +520,7 @@ void CSoundRender_Core::i_eax_commit_setting() i_eax_set(&DSPROPSETID_EAX_ListenerProperties, DSPROPERTY_EAXLISTENER_COMMITDEFERREDSETTINGS,NULL,0); } -void CSoundRender_Core::object_relcase( CObject* obj ) +void CSoundRender_Core::object_relcase( IGameObject* obj ) { if (obj){ for (u32 eit=0; eit