From 5f6470792b105bdd2a110751f87f88e900fb3e9e Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 15 Jan 2017 10:36:12 +0100 Subject: [PATCH] Reformat: Include --- src/Include/editor/engine.hpp | 97 +- src/Include/editor/ide.hpp | 53 +- src/Include/editor/interfaces.hpp | 12 +- src/Include/editor/property_holder.hpp | 837 +++++++----------- src/Include/xrAPI/xrAPI.h | 6 +- src/Include/xrRender/ApplicationRender.h | 18 +- src/Include/xrRender/ConsoleRender.h | 8 +- src/Include/xrRender/DebugRender.h | 69 +- src/Include/xrRender/DebugShader.h | 9 +- src/Include/xrRender/DrawUtils.h | 112 ++- src/Include/xrRender/EnvironmentRender.h | 47 +- src/Include/xrRender/FactoryPtr.h | 126 ++- src/Include/xrRender/FontRender.h | 9 +- src/Include/xrRender/Kinematics.h | 121 +-- src/Include/xrRender/KinematicsAnimated.h | 181 ++-- src/Include/xrRender/LensFlareRender.h | 20 +- src/Include/xrRender/ObjectSpaceRender.h | 14 +- src/Include/xrRender/ParticleCustom.h | 36 +- src/Include/xrRender/RainRender.h | 12 +- src/Include/xrRender/RenderDetailModel.h | 6 +- src/Include/xrRender/RenderFactory.h | 65 +- src/Include/xrRender/RenderVisual.h | 21 +- src/Include/xrRender/StatGraphRender.h | 16 +- src/Include/xrRender/ThunderboltDescRender.h | 14 +- src/Include/xrRender/ThunderboltRender.h | 8 +- src/Include/xrRender/UIRender.h | 100 +-- src/Include/xrRender/UISequenceVideoItem.h | 24 +- src/Include/xrRender/UIShader.h | 16 +- src/Include/xrRender/WallMarkArray.h | 22 +- src/Include/xrRender/animation_blend.h | 349 ++++---- src/Include/xrRender/animation_motion.h | 63 +- .../particles_systems_library_interface.hpp | 28 +- 32 files changed, 1143 insertions(+), 1376 deletions(-) diff --git a/src/Include/editor/engine.hpp b/src/Include/editor/engine.hpp index 4c49a1ec7fc..a5c34f637c3 100644 --- a/src/Include/editor/engine.hpp +++ b/src/Include/editor/engine.hpp @@ -11,71 +11,66 @@ class shared_str; -namespace editor { - +namespace editor +{ class property_holder; -class engine { +class engine +{ public: - virtual bool on_message ( - HWND hWnd, - UINT uMsg, - WPARAM wParam, - LPARAM lParam, - LRESULT &result - ) = 0; - virtual void on_idle () = 0; - virtual void on_resize () = 0; - virtual void pause (bool const &value) = 0; - virtual void capture_input (bool const &value) = 0; - virtual void disconnect () = 0; - // shared_str support - virtual void value (LPCSTR value, shared_str& result) = 0; - virtual LPCSTR value (shared_str const& value) = 0; - - // weather editor + virtual bool on_message(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& result) = 0; + virtual void on_idle() = 0; + virtual void on_resize() = 0; + virtual void pause(bool const& value) = 0; + virtual void capture_input(bool const& value) = 0; + virtual void disconnect() = 0; + // shared_str support + virtual void value(LPCSTR value, shared_str& result) = 0; + virtual LPCSTR value(shared_str const& value) = 0; + + // weather editor public: - // weather - virtual void weather (LPCSTR value) = 0; - virtual LPCSTR weather () = 0; - // weather frame - virtual void current_weather_frame (LPCSTR frame_id) = 0; - virtual LPCSTR current_weather_frame () = 0; + // weather + virtual void weather(LPCSTR value) = 0; + virtual LPCSTR weather() = 0; + // weather frame + virtual void current_weather_frame(LPCSTR frame_id) = 0; + virtual LPCSTR current_weather_frame() = 0; - virtual void track_frame (float const& time) = 0; - virtual float track_frame () = 0; + virtual void track_frame(float const& time) = 0; + virtual float track_frame() = 0; - virtual void track_weather (float const& time) = 0; - virtual float track_weather () = 0; + virtual void track_weather(float const& time) = 0; + virtual float track_weather() = 0; - virtual property_holder* current_frame_property_holder () = 0; - virtual property_holder* blend_frame_property_holder () = 0; - virtual property_holder* target_frame_property_holder () = 0; + virtual property_holder* current_frame_property_holder() = 0; + virtual property_holder* blend_frame_property_holder() = 0; + virtual property_holder* target_frame_property_holder() = 0; - virtual void weather_paused (bool const &value) = 0; - virtual bool weather_paused () = 0; - virtual void weather_time_factor (float const &value) = 0; - virtual float weather_time_factor () = 0; - virtual void save_weathers () = 0; + virtual void weather_paused(bool const& value) = 0; + virtual bool weather_paused() = 0; + virtual void weather_time_factor(float const& value) = 0; + virtual float weather_time_factor() = 0; + virtual void save_weathers() = 0; - virtual bool save_time_frame (char* buffer, u32 const& buffer_size) = 0; + virtual bool save_time_frame(char* buffer, u32 const& buffer_size) = 0; - virtual bool paste_current_time_frame (char const* buffer, u32 const& buffer_size) = 0; - virtual bool paste_target_time_frame (char const* buffer, u32 const& buffer_size) = 0; + virtual bool paste_current_time_frame(char const* buffer, u32 const& buffer_size) = 0; + virtual bool paste_target_time_frame(char const* buffer, u32 const& buffer_size) = 0; - virtual void reload_current_time_frame () = 0; - virtual void reload_target_time_frame () = 0; + virtual void reload_current_time_frame() = 0; + virtual void reload_target_time_frame() = 0; - virtual void reload_current_weather () = 0; - virtual void reload_weathers () = 0; + virtual void reload_current_weather() = 0; + virtual void reload_weathers() = 0; - virtual bool add_time_frame (char const* buffer, u32 const& buffer_size) = 0; + virtual bool add_time_frame(char const* buffer, u32 const& buffer_size) = 0; - virtual char const* weather_current_time () const = 0; - virtual void weather_current_time (char const*) = 0; -}; // class engine + virtual char const* weather_current_time() const = 0; + virtual void weather_current_time(char const*) = 0; +}; // class engine -} // namespace editor +} // namespace editor -#endif // ifndef EDITOR_ENGINE_HPP_INCLUDED \ No newline at end of file +#endif // ifndef EDITOR_ENGINE_HPP_INCLUDED \ No newline at end of file diff --git a/src/Include/editor/ide.hpp b/src/Include/editor/ide.hpp index ab3d5bd933b..078d10669e2 100644 --- a/src/Include/editor/ide.hpp +++ b/src/Include/editor/ide.hpp @@ -9,39 +9,38 @@ #ifndef EDITOR_IDE_HPP_INCLUDED #define EDITOR_IDE_HPP_INCLUDED -namespace editor { - +namespace editor +{ class property_holder; class property_holder_collection; class property_holder_holder; -class ide { +class ide +{ public: - virtual HWND main_handle () = 0; - virtual HWND view_handle () = 0; - virtual void run () = 0; - virtual void on_load_finished () = 0; - virtual void pause () = 0; + virtual HWND main_handle() = 0; + virtual HWND view_handle() = 0; + virtual void run() = 0; + virtual void on_load_finished() = 0; + virtual void pause() = 0; public: - virtual property_holder* create_property_holder (LPCSTR display_name, property_holder_collection* collection = 0, property_holder_holder* holder = 0) = 0; - virtual void destroy (property_holder *&property_holder) = 0; - virtual void environment_levels (property_holder *property_holder) = 0; - virtual void environment_weathers (property_holder *property_holder) = 0; + virtual property_holder* create_property_holder( + LPCSTR display_name, property_holder_collection* collection = 0, property_holder_holder* holder = 0) = 0; + virtual void destroy(property_holder*& property_holder) = 0; + virtual void environment_levels(property_holder* property_holder) = 0; + virtual void environment_weathers(property_holder* property_holder) = 0; public: - typedef fastdelegate::FastDelegate0 weathers_getter_type; - typedef fastdelegate::FastDelegate0 weathers_size_getter_type; - typedef fastdelegate::FastDelegate1 frames_getter_type; - typedef fastdelegate::FastDelegate1 frames_size_getter_type; - virtual void weather_editor_setup ( - weathers_getter_type const& weathers_getter, - weathers_size_getter_type const& weathers_size_getter, - frames_getter_type const& frames_getter, - frames_size_getter_type const& frames_size_getter - ) = 0; -}; // class ide - -} // namespace editor - -#endif // ifndef EDITOR_IDE_HPP_INCLUDED \ No newline at end of file + typedef fastdelegate::FastDelegate0 weathers_getter_type; + typedef fastdelegate::FastDelegate0 weathers_size_getter_type; + typedef fastdelegate::FastDelegate1 frames_getter_type; + typedef fastdelegate::FastDelegate1 frames_size_getter_type; + virtual void weather_editor_setup(weathers_getter_type const& weathers_getter, + weathers_size_getter_type const& weathers_size_getter, frames_getter_type const& frames_getter, + frames_size_getter_type const& frames_size_getter) = 0; +}; // class ide + +} // namespace editor + +#endif // ifndef EDITOR_IDE_HPP_INCLUDED \ No newline at end of file diff --git a/src/Include/editor/interfaces.hpp b/src/Include/editor/interfaces.hpp index 51dcdc8c890..b6c5a34c2ba 100644 --- a/src/Include/editor/interfaces.hpp +++ b/src/Include/editor/interfaces.hpp @@ -9,14 +9,14 @@ #ifndef EDITOR_INTERFACES_HPP_INCLUDED #define EDITOR_INTERFACES_HPP_INCLUDED -namespace editor { - +namespace editor +{ class ide; class engine; -typedef void (__cdecl *initialize_function_ptr) (ide*&, engine*); -typedef void (__cdecl *finalize_function_ptr) (ide*&); +typedef void(__cdecl* initialize_function_ptr)(ide*&, engine*); +typedef void(__cdecl* finalize_function_ptr)(ide*&); -} // namespace editor +} // namespace editor -#endif // ifndef EDITOR_INTERFACES_HPP_INCLUDED \ No newline at end of file +#endif // ifndef EDITOR_INTERFACES_HPP_INCLUDED \ No newline at end of file diff --git a/src/Include/editor/property_holder.hpp b/src/Include/editor/property_holder.hpp index 7a62396cd69..f4800e69d1e 100644 --- a/src/Include/editor/property_holder.hpp +++ b/src/Include/editor/property_holder.hpp @@ -11,570 +11,343 @@ class shared_str; -namespace editor { - -#pragma pack(push,4) -struct color { - float r,g,b; +namespace editor +{ +#pragma pack(push, 4) +struct color +{ + float r, g, b; }; -struct vec3f { - float x,y,z; +struct vec3f +{ + float x, y, z; }; #pragma pack(pop) class property_holder; -class property_holder_holder { +class property_holder_holder +{ public: - virtual property_holder* object () = 0; - virtual ~property_holder_holder () = 0 {} + virtual property_holder* object() = 0; + virtual ~property_holder_holder() = 0 {} }; -class property_holder_collection { +class property_holder_collection +{ public: - virtual void clear () = 0; - virtual void insert (property_holder* holder, u32 const& position) = 0; - virtual void erase (u32 const& position) = 0; - virtual int index (property_holder* holder) = 0; - virtual property_holder* item (u32 const& position) = 0; - virtual u32 size () = 0; - virtual void display_name (u32 const& item_index, char* const& buffer, u32 const& buffer_size) = 0; - virtual property_holder* create () = 0; - virtual void destroy (property_holder* holder) = 0; -}; // class propery_holder_collection + virtual void clear() = 0; + virtual void insert(property_holder* holder, u32 const& position) = 0; + virtual void erase(u32 const& position) = 0; + virtual int index(property_holder* holder) = 0; + virtual property_holder* item(u32 const& position) = 0; + virtual u32 size() = 0; + virtual void display_name(u32 const& item_index, char* const& buffer, u32 const& buffer_size) = 0; + virtual property_holder* create() = 0; + virtual void destroy(property_holder* holder) = 0; +}; // class propery_holder_collection class property_value; -class property_holder { +class property_holder +{ public: - typedef fastdelegate::FastDelegate0 boolean_getter_type; - typedef fastdelegate::FastDelegate1 boolean_setter_type; + typedef fastdelegate::FastDelegate0 boolean_getter_type; + typedef fastdelegate::FastDelegate1 boolean_setter_type; - typedef fastdelegate::FastDelegate0 integer_getter_type; - typedef fastdelegate::FastDelegate1 integer_setter_type; + typedef fastdelegate::FastDelegate0 integer_getter_type; + typedef fastdelegate::FastDelegate1 integer_setter_type; - typedef fastdelegate::FastDelegate0 float_getter_type; - typedef fastdelegate::FastDelegate1 float_setter_type; + typedef fastdelegate::FastDelegate0 float_getter_type; + typedef fastdelegate::FastDelegate1 float_setter_type; - typedef fastdelegate::FastDelegate0 string_getter_type; - typedef fastdelegate::FastDelegate1 string_setter_type; + typedef fastdelegate::FastDelegate0 string_getter_type; + typedef fastdelegate::FastDelegate1 string_setter_type; - typedef fastdelegate::FastDelegate0 color_getter_type; - typedef fastdelegate::FastDelegate1 color_setter_type; + typedef fastdelegate::FastDelegate0 color_getter_type; + typedef fastdelegate::FastDelegate1 color_setter_type; - typedef fastdelegate::FastDelegate0 vec3f_getter_type; - typedef fastdelegate::FastDelegate1 vec3f_setter_type; + typedef fastdelegate::FastDelegate0 vec3f_getter_type; + typedef fastdelegate::FastDelegate1 vec3f_setter_type; - typedef fastdelegate::FastDelegate0< - property_holder_collection* - > collection_getter_type; + typedef fastdelegate::FastDelegate0 collection_getter_type; - typedef fastdelegate::FastDelegate0 string_collection_getter_type; - typedef fastdelegate::FastDelegate0 string_collection_size_getter_type; + typedef fastdelegate::FastDelegate0 string_collection_getter_type; + typedef fastdelegate::FastDelegate0 string_collection_size_getter_type; public: - enum enter_text_enum { - can_enter_text = int(0), - cannot_enter_text = int(1), - }; // enum can_enter_text_enum + enum enter_text_enum + { + can_enter_text = int(0), + cannot_enter_text = int(1), + }; // enum can_enter_text_enum + + enum extension_action_enum + { + remove_extension = int(0), + keep_extension = int(1), + }; // enum remove_extension_enum - enum extension_action_enum { - remove_extension = int(0), - keep_extension = int(1), - }; // enum remove_extension_enum + enum value_editor_enum + { + value_editor_combo_box = int(0), + value_editor_tree_view = int(1), + }; // enum value_editor_enum - enum value_editor_enum { - value_editor_combo_box = int(0), - value_editor_tree_view = int(1), - }; // enum value_editor_enum + enum readonly_enum + { + property_read_only = int(0), + property_read_write = int(1), + }; // enum value_editor_enum - enum readonly_enum { - property_read_only = int(0), - property_read_write = int(1), - }; // enum value_editor_enum + enum notify_parent_on_change_enum + { + notify_parent_on_change = int(0), + do_not_notify_parent_on_change = int(1), + }; // enum value_editor_enum - enum notify_parent_on_change_enum { - notify_parent_on_change = int(0), - do_not_notify_parent_on_change = int(1), - }; // enum value_editor_enum + enum password_char_enum + { + password_char = int(0), + no_password_char = int(1), + }; // enum value_editor_enum - enum password_char_enum { - password_char = int(0), - no_password_char = int(1), - }; // enum value_editor_enum + enum refresh_grid_on_change_enum + { + refresh_grid_on_change = int(0), + do_not_refresh_grid_on_change = int(1), + }; // enum value_editor_enum - enum refresh_grid_on_change_enum { - refresh_grid_on_change = int(0), - do_not_refresh_grid_on_change = int(1), - }; // enum value_editor_enum - public: - virtual property_holder_holder* holder () = 0; - virtual void clear () = 0; - virtual property_value* add_property ( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - bool const &default_value, - boolean_getter_type const &getter, - boolean_setter_type const &setter, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property ( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - bool const &default_value, - bool& value, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property ( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - bool const &default_value, - boolean_getter_type const &getter, - boolean_setter_type const &setter, - LPCSTR values[2], - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property ( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - bool const &default_value, - bool& value, - LPCSTR values[2], - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - int const &default_value, - integer_getter_type const &getter, - integer_setter_type const &setter, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - int const &default_value, - int& value, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - int const &default_value, - integer_getter_type const &getter, - integer_setter_type const &setter, - int const &min_value, - int const &max_value, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - int const &default_value, - int& value, - int const &min_value, - int const &max_value, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - int const &default_value, - integer_getter_type const &getter, - integer_setter_type const &setter, - std::pair *values, - u32 const &value_count, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - int const &default_value, - int& value, - std::pair *values, - u32 const &value_count, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - int const &default_value, - integer_getter_type const &getter, - integer_setter_type const &setter, - LPCSTR const* values, - u32 const &value_count, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - int const &default_value, - int& value, - LPCSTR const* values, - u32 const &value_count, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - int const &default_value, - integer_getter_type const &getter, - integer_setter_type const &setter, - string_collection_getter_type const& values, - string_collection_size_getter_type const& value_count, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - int const &default_value, - int& value, - string_collection_getter_type const& values, - string_collection_size_getter_type const& value_count, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - float const &default_value, - float_getter_type const &getter, - float_setter_type const &setter, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - float const &default_value, - float& value, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - float const &default_value, - float_getter_type const &getter, - float_setter_type const &setter, - float const &min_value, - float const &max_value, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - float const &default_value, - float& value, - float const &min_value, - float const &max_value, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - float const &default_value, - float_getter_type const &getter, - float_setter_type const &setter, - std::pair *values, - u32 const &value_count, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - float const &default_value, - float& value, - std::pair *values, - u32 const &value_count, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - LPCSTR default_value, - string_getter_type const &getter, - string_setter_type const &setter, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - LPCSTR default_value, - shared_str& value, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - LPCSTR default_value, - string_getter_type const &getter, - string_setter_type const &setter, - LPCSTR default_extension, // ".dds", - LPCSTR file_mask, // "Texture files (*.dds)|*.dds", - LPCSTR default_folder, // "R:\\development\\priquel\\resources\\gamedata\\textures\\sky", - LPCSTR caption, // "Select texture..." - enter_text_enum const& can_enter_text, - extension_action_enum const& remove_extension, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - LPCSTR default_value, - shared_str& value, - LPCSTR default_extension, // ".dds", - LPCSTR file_mask, // "Texture files (*.dds)|*.dds", - LPCSTR default_folder, // "R:\\development\\priquel\\resources\\gamedata\\textures\\sky", - LPCSTR caption, // "Select texture..." - enter_text_enum const& can_enter_text, - extension_action_enum const& remove_extension, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - LPCSTR default_value, - string_getter_type const &getter, - string_setter_type const &setter, - LPCSTR const* values, - u32 const &value_count, - value_editor_enum const& value_editor, - enter_text_enum const& can_enter_text, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - LPCSTR default_value, - shared_str& value, - LPCSTR const* values, - u32 const &value_count, - value_editor_enum const& value_editor, - enter_text_enum const& can_enter_text, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - LPCSTR default_value, - string_getter_type const &getter, - string_setter_type const &setter, - string_collection_getter_type const& values, - string_collection_size_getter_type const& value_count, - value_editor_enum const& value_editor, - enter_text_enum const& can_enter_text, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - LPCSTR default_value, - shared_str& value, - string_collection_getter_type const& values, - string_collection_size_getter_type const& value_count, - value_editor_enum const& value_editor, - enter_text_enum const& can_enter_text, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - color const& default_value, - color_getter_type const& getter, - color_setter_type const& setter, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - color const& default_value, - color& result, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - vec3f const& default_value, - vec3f_getter_type const& getter, - vec3f_setter_type const& setter, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - vec3f const& default_value, - vec3f& result, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - property_holder* value, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - property_holder_collection* collection, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; - // probably, dummy method, should be removed sometimes - virtual property_value* add_property( - LPCSTR identifier, - LPCSTR category, - LPCSTR description, - collection_getter_type const& collection_getter, - readonly_enum const& read_only = property_read_write, - notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, - password_char_enum const& password = no_password_char, - refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change - ) = 0; -}; // class property_holder + virtual property_holder_holder* holder() = 0; + virtual void clear() = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + bool const& default_value, boolean_getter_type const& getter, boolean_setter_type const& setter, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + bool const& default_value, bool& value, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + bool const& default_value, boolean_getter_type const& getter, boolean_setter_type const& setter, + LPCSTR values[2], readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + bool const& default_value, bool& value, LPCSTR values[2], readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + int const& default_value, integer_getter_type const& getter, integer_setter_type const& setter, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + int const& default_value, int& value, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + int const& default_value, integer_getter_type const& getter, integer_setter_type const& setter, + int const& min_value, int const& max_value, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + int const& default_value, int& value, int const& min_value, int const& max_value, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + int const& default_value, integer_getter_type const& getter, integer_setter_type const& setter, + std::pair* values, u32 const& value_count, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + int const& default_value, int& value, std::pair* values, u32 const& value_count, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + int const& default_value, integer_getter_type const& getter, integer_setter_type const& setter, + LPCSTR const* values, u32 const& value_count, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + int const& default_value, int& value, LPCSTR const* values, u32 const& value_count, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + int const& default_value, integer_getter_type const& getter, integer_setter_type const& setter, + string_collection_getter_type const& values, string_collection_size_getter_type const& value_count, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + int const& default_value, int& value, string_collection_getter_type const& values, + string_collection_size_getter_type const& value_count, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + float const& default_value, float_getter_type const& getter, float_setter_type const& setter, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + float const& default_value, float& value, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + float const& default_value, float_getter_type const& getter, float_setter_type const& setter, + float const& min_value, float const& max_value, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + float const& default_value, float& value, float const& min_value, float const& max_value, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + float const& default_value, float_getter_type const& getter, float_setter_type const& setter, + std::pair* values, u32 const& value_count, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + float const& default_value, float& value, std::pair* values, u32 const& value_count, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, LPCSTR default_value, + string_getter_type const& getter, string_setter_type const& setter, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, LPCSTR default_value, + shared_str& value, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, LPCSTR default_value, + string_getter_type const& getter, string_setter_type const& setter, + LPCSTR default_extension, // ".dds", + LPCSTR file_mask, // "Texture files (*.dds)|*.dds", + LPCSTR default_folder, // "R:\\development\\priquel\\resources\\gamedata\\textures\\sky", + LPCSTR caption, // "Select texture..." + enter_text_enum const& can_enter_text, extension_action_enum const& remove_extension, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, LPCSTR default_value, + shared_str& value, + LPCSTR default_extension, // ".dds", + LPCSTR file_mask, // "Texture files (*.dds)|*.dds", + LPCSTR default_folder, // "R:\\development\\priquel\\resources\\gamedata\\textures\\sky", + LPCSTR caption, // "Select texture..." + enter_text_enum const& can_enter_text, extension_action_enum const& remove_extension, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, LPCSTR default_value, + string_getter_type const& getter, string_setter_type const& setter, LPCSTR const* values, + u32 const& value_count, value_editor_enum const& value_editor, enter_text_enum const& can_enter_text, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, LPCSTR default_value, + shared_str& value, LPCSTR const* values, u32 const& value_count, value_editor_enum const& value_editor, + enter_text_enum const& can_enter_text, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, LPCSTR default_value, + string_getter_type const& getter, string_setter_type const& setter, string_collection_getter_type const& values, + string_collection_size_getter_type const& value_count, value_editor_enum const& value_editor, + enter_text_enum const& can_enter_text, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, LPCSTR default_value, + shared_str& value, string_collection_getter_type const& values, + string_collection_size_getter_type const& value_count, value_editor_enum const& value_editor, + enter_text_enum const& can_enter_text, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + color const& default_value, color_getter_type const& getter, color_setter_type const& setter, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + color const& default_value, color& result, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + vec3f const& default_value, vec3f_getter_type const& getter, vec3f_setter_type const& setter, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + vec3f const& default_value, vec3f& result, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, property_holder* value, + readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + property_holder_collection* collection, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; + // probably, dummy method, should be removed sometimes + virtual property_value* add_property(LPCSTR identifier, LPCSTR category, LPCSTR description, + collection_getter_type const& collection_getter, readonly_enum const& read_only = property_read_write, + notify_parent_on_change_enum const& notify_parent = do_not_notify_parent_on_change, + password_char_enum const& password = no_password_char, + refresh_grid_on_change_enum const& refresh_grid = do_not_refresh_grid_on_change) = 0; +}; // class property_holder -class property_value { +class property_value +{ public: - virtual void attribute (property_holder::readonly_enum const& read_only) = 0; - virtual void attribute (property_holder::notify_parent_on_change_enum const& notify_parent) = 0; - virtual void attribute (property_holder::password_char_enum const& password_char) = 0; - virtual void attribute (property_holder::refresh_grid_on_change_enum const& refresh_grid) = 0; -}; // class property_value + virtual void attribute(property_holder::readonly_enum const& read_only) = 0; + virtual void attribute(property_holder::notify_parent_on_change_enum const& notify_parent) = 0; + virtual void attribute(property_holder::password_char_enum const& password_char) = 0; + virtual void attribute(property_holder::refresh_grid_on_change_enum const& refresh_grid) = 0; +}; // class property_value -} // namespace editor +} // namespace editor -#endif // ifndef EDITOR_PROPERTY_HOLDER_HPP_INCLUDED \ No newline at end of file +#endif // ifndef EDITOR_PROPERTY_HOLDER_HPP_INCLUDED \ No newline at end of file diff --git a/src/Include/xrAPI/xrAPI.h b/src/Include/xrAPI/xrAPI.h index 00e848d3784..ce7465a115a 100644 --- a/src/Include/xrAPI/xrAPI.h +++ b/src/Include/xrAPI/xrAPI.h @@ -34,8 +34,8 @@ class XRAPI_API EngineGlobalEnvironment #endif IRenderFactory* RenderFactory; CScriptEngine* ScriptEngine; - AISpaceBase *AISpace; + AISpaceBase* AISpace; }; -extern XRAPI_API EngineGlobalEnvironment GlobalEnv; // XXX: rename to GEnv -extern XRAPI_API bool g_dedicated_server; // XXX: move to EngineGlobalEnvironment +extern XRAPI_API EngineGlobalEnvironment GlobalEnv; // XXX: rename to GEnv +extern XRAPI_API bool g_dedicated_server; // XXX: move to EngineGlobalEnvironment diff --git a/src/Include/xrRender/ApplicationRender.h b/src/Include/xrRender/ApplicationRender.h index c55a9a71e18..264c2e71b6b 100644 --- a/src/Include/xrRender/ApplicationRender.h +++ b/src/Include/xrRender/ApplicationRender.h @@ -7,15 +7,15 @@ class CApplication; class IApplicationRender { public: - virtual ~IApplicationRender() {;} - virtual void Copy(IApplicationRender &_in) = 0; + virtual ~IApplicationRender() { ; } + virtual void Copy(IApplicationRender& _in) = 0; - virtual void LoadBegin() = 0; - virtual void destroy_loading_shaders() = 0; - virtual void setLevelLogo(LPCSTR pszLogoName) = 0; - virtual void load_draw_internal(CApplication &owner) = 0; - // ????? - virtual void KillHW() = 0; + virtual void LoadBegin() = 0; + virtual void destroy_loading_shaders() = 0; + virtual void setLevelLogo(LPCSTR pszLogoName) = 0; + virtual void load_draw_internal(CApplication& owner) = 0; + // ????? + virtual void KillHW() = 0; }; -#endif // ApplicationRender_included \ No newline at end of file +#endif // ApplicationRender_included \ No newline at end of file diff --git a/src/Include/xrRender/ConsoleRender.h b/src/Include/xrRender/ConsoleRender.h index fe9694f2314..722cb2cad00 100644 --- a/src/Include/xrRender/ConsoleRender.h +++ b/src/Include/xrRender/ConsoleRender.h @@ -5,9 +5,9 @@ class IConsoleRender { public: - virtual ~IConsoleRender() {;} - virtual void Copy(IConsoleRender &_in) = 0; - virtual void OnRender(bool bGame) = 0; + virtual ~IConsoleRender() { ; } + virtual void Copy(IConsoleRender& _in) = 0; + virtual void OnRender(bool bGame) = 0; }; -#endif // ConsoleRender_included \ No newline at end of file +#endif // ConsoleRender_included \ No newline at end of file diff --git a/src/Include/xrRender/DebugRender.h b/src/Include/xrRender/DebugRender.h index ae8350dc0b3..6c4b4a3f060 100644 --- a/src/Include/xrRender/DebugRender.h +++ b/src/Include/xrRender/DebugRender.h @@ -1,5 +1,5 @@ -#ifndef DebugRender_included -#define DebugRender_included +#ifndef DebugRender_included +#define DebugRender_included #pragma once #ifdef DEBUG @@ -9,42 +9,43 @@ class IDebugRender { public: - enum CullMode - { - cmNONE = 0, - cmCW, - cmCCW, - }; - - enum dbgShaderHandle - { - dbgShaderWindow = 0, - dbgShaderCount - }; + enum CullMode + { + cmNONE = 0, + cmCW, + cmCCW, + }; + + enum dbgShaderHandle + { + dbgShaderWindow = 0, + dbgShaderCount + }; public: - virtual ~IDebugRender () {} - virtual void Render () = 0; - virtual void add_lines (Fvector const *vertices, u32 const &vertex_count, u16 const *pairs, u32 const &pair_count, u32 const &color) = 0; - - // routed to RCache - virtual void NextSceneMode () = 0; - virtual void ZEnable (bool bEnable) = 0; - virtual void OnFrameEnd () = 0; - virtual void SetShader (const debug_shader &shader) = 0; - virtual void CacheSetXformWorld (const Fmatrix& M) = 0; - virtual void CacheSetCullMode (CullMode) = 0; - virtual void SetAmbient (u32 colour) = 0; - - // Shaders - virtual void SetDebugShader (dbgShaderHandle shdHandle) = 0; - virtual void DestroyDebugShader (dbgShaderHandle shdHandle) = 0; + virtual ~IDebugRender() {} + virtual void Render() = 0; + virtual void add_lines(Fvector const* vertices, u32 const& vertex_count, u16 const* pairs, u32 const& pair_count, + u32 const& color) = 0; + + // routed to RCache + virtual void NextSceneMode() = 0; + virtual void ZEnable(bool bEnable) = 0; + virtual void OnFrameEnd() = 0; + virtual void SetShader(const debug_shader& shader) = 0; + virtual void CacheSetXformWorld(const Fmatrix& M) = 0; + virtual void CacheSetCullMode(CullMode) = 0; + virtual void SetAmbient(u32 colour) = 0; + + // Shaders + virtual void SetDebugShader(dbgShaderHandle shdHandle) = 0; + virtual void DestroyDebugShader(dbgShaderHandle shdHandle) = 0; #ifdef DEBUG - virtual void dbg_DrawTRI (Fmatrix& T, Fvector& p1, Fvector& p2, Fvector& p3, u32 C) = 0; -#endif // DEBUG + virtual void dbg_DrawTRI(Fmatrix& T, Fvector& p1, Fvector& p2, Fvector& p3, u32 C) = 0; +#endif // DEBUG }; -#endif // DEBUG +#endif // DEBUG -#endif // DebugRender_included \ No newline at end of file +#endif // DebugRender_included \ No newline at end of file diff --git a/src/Include/xrRender/DebugShader.h b/src/Include/xrRender/DebugShader.h index f149a3fd6f0..5c9ac759112 100644 --- a/src/Include/xrRender/DebugShader.h +++ b/src/Include/xrRender/DebugShader.h @@ -1,11 +1,10 @@ -#ifndef DebugShader_included -#define DebugShader_included +#ifndef DebugShader_included +#define DebugShader_included #pragma once #include "FactoryPtr.h" #include "UIShader.h" -typedef FactoryPtr debug_shader; +typedef FactoryPtr debug_shader; - -#endif // DebugShader_included \ No newline at end of file +#endif // DebugShader_included \ No newline at end of file diff --git a/src/Include/xrRender/DrawUtils.h b/src/Include/xrRender/DrawUtils.h index 9b91a35b361..2dbd08891bd 100644 --- a/src/Include/xrRender/DrawUtils.h +++ b/src/Include/xrRender/DrawUtils.h @@ -11,62 +11,80 @@ class ECORE_API CDUInterface { public: //---------------------------------------------------- - virtual void __stdcall DrawCross (const Fvector& p, float szx1, float szy1, float szz1, float szx2, float szy2, float szz2, u32 clr, BOOL bRot45=false)=0; - virtual void __stdcall DrawCross (const Fvector& p, float sz, u32 clr, BOOL bRot45=false)=0; - virtual void __stdcall DrawFlag (const Fvector& p, float heading, float height, float sz, float sz_fl, u32 clr, BOOL bDrawEntity)=0; - virtual void __stdcall DrawRomboid (const Fvector& p, float radius, u32 clr)=0; - virtual void __stdcall DrawJoint (const Fvector& p, float radius, u32 clr)=0; + virtual void __stdcall DrawCross(const Fvector& p, float szx1, float szy1, float szz1, float szx2, float szy2, + float szz2, u32 clr, BOOL bRot45 = false) = 0; + virtual void __stdcall DrawCross(const Fvector& p, float sz, u32 clr, BOOL bRot45 = false) = 0; + virtual void __stdcall DrawFlag( + const Fvector& p, float heading, float height, float sz, float sz_fl, u32 clr, BOOL bDrawEntity) = 0; + virtual void __stdcall DrawRomboid(const Fvector& p, float radius, u32 clr) = 0; + virtual void __stdcall DrawJoint(const Fvector& p, float radius, u32 clr) = 0; - virtual void __stdcall DrawSpotLight (const Fvector& p, const Fvector& d, float range, float phi, u32 clr)=0; - virtual void __stdcall DrawDirectionalLight (const Fvector& p, const Fvector& d, float radius, float range, u32 clr)=0; - virtual void __stdcall DrawPointLight (const Fvector& p, float radius, u32 clr)=0; + virtual void __stdcall DrawSpotLight(const Fvector& p, const Fvector& d, float range, float phi, u32 clr) = 0; + virtual void __stdcall DrawDirectionalLight( + const Fvector& p, const Fvector& d, float radius, float range, u32 clr) = 0; + virtual void __stdcall DrawPointLight(const Fvector& p, float radius, u32 clr) = 0; - virtual void __stdcall DrawSound (const Fvector& p, float radius, u32 clr)=0; - virtual void __stdcall DrawLineSphere (const Fvector& p, float radius, u32 clr, BOOL bCross)=0; + virtual void __stdcall DrawSound(const Fvector& p, float radius, u32 clr) = 0; + virtual void __stdcall DrawLineSphere(const Fvector& p, float radius, u32 clr, BOOL bCross) = 0; - virtual void __stdcall dbgDrawPlacement (const Fvector& p, int sz, u32 clr, LPCSTR caption=0, u32 clr_font=0xffffffff)=0; - virtual void __stdcall dbgDrawVert (const Fvector& p0, u32 clr, LPCSTR caption=0)=0; - virtual void __stdcall dbgDrawEdge (const Fvector& p0, const Fvector& p1, u32 clr, LPCSTR caption=0)=0; - virtual void __stdcall dbgDrawFace (const Fvector& p0, const Fvector& p1, const Fvector& p2, u32 clr, LPCSTR caption=0)=0; + virtual void __stdcall dbgDrawPlacement( + const Fvector& p, int sz, u32 clr, LPCSTR caption = 0, u32 clr_font = 0xffffffff) = 0; + virtual void __stdcall dbgDrawVert(const Fvector& p0, u32 clr, LPCSTR caption = 0) = 0; + virtual void __stdcall dbgDrawEdge(const Fvector& p0, const Fvector& p1, u32 clr, LPCSTR caption = 0) = 0; + virtual void __stdcall dbgDrawFace( + const Fvector& p0, const Fvector& p1, const Fvector& p2, u32 clr, LPCSTR caption = 0) = 0; - virtual void __stdcall DrawFace (const Fvector& p0, const Fvector& p1, const Fvector& p2, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire)=0; - virtual void __stdcall DrawLine (const Fvector& p0, const Fvector& p1, u32 clr)=0; - virtual void __stdcall DrawLink (const Fvector& p0, const Fvector& p1, float sz, u32 clr)=0; - virtual void __stdcall DrawFaceNormal (const Fvector& p0, const Fvector& p1, const Fvector& p2, float size, u32 clr)=0; - virtual void __stdcall DrawFaceNormal (const Fvector* p, float size, u32 clr)=0; - virtual void __stdcall DrawFaceNormal (const Fvector& C, const Fvector& N, float size, u32 clr)=0; - virtual void __stdcall DrawSelectionBox (const Fvector& center, const Fvector& size, u32* c=0)=0; - virtual void __stdcall DrawSelectionBoxB (const Fbox& box, u32* c=0)=0; - virtual void __stdcall DrawIdentSphere (BOOL bSolid, BOOL bWire, u32 clr_s, u32 clr_w)=0; - virtual void __stdcall DrawIdentSpherePart (BOOL bSolid, BOOL bWire, u32 clr_s, u32 clr_w)=0; - virtual void __stdcall DrawIdentCone (BOOL bSolid, BOOL bWire, u32 clr_s, u32 clr_w)=0; - virtual void __stdcall DrawIdentCylinder (BOOL bSolid, BOOL bWire, u32 clr_s, u32 clr_w)=0; - virtual void __stdcall DrawIdentBox (BOOL bSolid, BOOL bWire, u32 clr_s, u32 clr_w)=0; + virtual void __stdcall DrawFace( + const Fvector& p0, const Fvector& p1, const Fvector& p2, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire) = 0; + virtual void __stdcall DrawLine(const Fvector& p0, const Fvector& p1, u32 clr) = 0; + virtual void __stdcall DrawLink(const Fvector& p0, const Fvector& p1, float sz, u32 clr) = 0; + virtual void __stdcall DrawFaceNormal( + const Fvector& p0, const Fvector& p1, const Fvector& p2, float size, u32 clr) = 0; + virtual void __stdcall DrawFaceNormal(const Fvector* p, float size, u32 clr) = 0; + virtual void __stdcall DrawFaceNormal(const Fvector& C, const Fvector& N, float size, u32 clr) = 0; + virtual void __stdcall DrawSelectionBox(const Fvector& center, const Fvector& size, u32* c = 0) = 0; + virtual void __stdcall DrawSelectionBoxB(const Fbox& box, u32* c = 0) = 0; + virtual void __stdcall DrawIdentSphere(BOOL bSolid, BOOL bWire, u32 clr_s, u32 clr_w) = 0; + virtual void __stdcall DrawIdentSpherePart(BOOL bSolid, BOOL bWire, u32 clr_s, u32 clr_w) = 0; + virtual void __stdcall DrawIdentCone(BOOL bSolid, BOOL bWire, u32 clr_s, u32 clr_w) = 0; + virtual void __stdcall DrawIdentCylinder(BOOL bSolid, BOOL bWire, u32 clr_s, u32 clr_w) = 0; + virtual void __stdcall DrawIdentBox(BOOL bSolid, BOOL bWire, u32 clr_s, u32 clr_w) = 0; - virtual void __stdcall DrawBox (const Fvector& offs, const Fvector& Size, BOOL bSolid, BOOL bWire, u32 clr_s, u32 clr_w)=0; - virtual void __stdcall DrawAABB (const Fvector& p0, const Fvector& p1, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire)=0; - virtual void __stdcall DrawAABB (const Fmatrix& parent, const Fvector& center, const Fvector& size, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire)=0; - virtual void __stdcall DrawOBB (const Fmatrix& parent, const Fobb& box, u32 clr_s, u32 clr_w)=0; - virtual void __stdcall DrawSphere (const Fmatrix& parent, const Fvector& center, float radius, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire)=0; - virtual void __stdcall DrawSphere (const Fmatrix& parent, const Fsphere& S, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire)=0; - virtual void __stdcall DrawCylinder (const Fmatrix& parent, const Fvector& center, const Fvector& dir, float height, float radius, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire)=0; - virtual void __stdcall DrawCone (const Fmatrix& parent, const Fvector& apex, const Fvector& dir, float height, float radius, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire)=0; - virtual void __stdcall DrawPlane (const Fvector& center, const Fvector2& scale, const Fvector& rotate, u32 clr_s, u32 clr_w, BOOL bCull, BOOL bSolid, BOOL bWire)=0; - virtual void __stdcall DrawPlane (const Fvector& p, const Fvector& n, const Fvector2& scale, u32 clr_s, u32 clr_w, BOOL bCull, BOOL bSolid, BOOL bWire)=0; - virtual void __stdcall DrawRectangle (const Fvector& o, const Fvector& u, const Fvector& v, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire)=0; + virtual void __stdcall DrawBox( + const Fvector& offs, const Fvector& Size, BOOL bSolid, BOOL bWire, u32 clr_s, u32 clr_w) = 0; + virtual void __stdcall DrawAABB( + const Fvector& p0, const Fvector& p1, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire) = 0; + virtual void __stdcall DrawAABB(const Fmatrix& parent, const Fvector& center, const Fvector& size, u32 clr_s, + u32 clr_w, BOOL bSolid, BOOL bWire) = 0; + virtual void __stdcall DrawOBB(const Fmatrix& parent, const Fobb& box, u32 clr_s, u32 clr_w) = 0; + virtual void __stdcall DrawSphere( + const Fmatrix& parent, const Fvector& center, float radius, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire) = 0; + virtual void __stdcall DrawSphere( + const Fmatrix& parent, const Fsphere& S, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire) = 0; + virtual void __stdcall DrawCylinder(const Fmatrix& parent, const Fvector& center, const Fvector& dir, float height, + float radius, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire) = 0; + virtual void __stdcall DrawCone(const Fmatrix& parent, const Fvector& apex, const Fvector& dir, float height, + float radius, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire) = 0; + virtual void __stdcall DrawPlane(const Fvector& center, const Fvector2& scale, const Fvector& rotate, u32 clr_s, + u32 clr_w, BOOL bCull, BOOL bSolid, BOOL bWire) = 0; + virtual void __stdcall DrawPlane(const Fvector& p, const Fvector& n, const Fvector2& scale, u32 clr_s, u32 clr_w, + BOOL bCull, BOOL bSolid, BOOL bWire) = 0; + virtual void __stdcall DrawRectangle( + const Fvector& o, const Fvector& u, const Fvector& v, u32 clr_s, u32 clr_w, BOOL bSolid, BOOL bWire) = 0; - virtual void __stdcall DrawGrid ()=0; - virtual void __stdcall DrawPivot (const Fvector& pos, float sz=5.f)=0; - virtual void __stdcall DrawAxis (const Fmatrix& T)=0; - virtual void __stdcall DrawObjectAxis (const Fmatrix& T, float sz, BOOL sel)=0; - virtual void __stdcall DrawSelectionRect (const Ivector2& m_SelStart, const Ivector2& m_SelEnd)=0; + virtual void __stdcall DrawGrid() = 0; + virtual void __stdcall DrawPivot(const Fvector& pos, float sz = 5.f) = 0; + virtual void __stdcall DrawAxis(const Fmatrix& T) = 0; + virtual void __stdcall DrawObjectAxis(const Fmatrix& T, float sz, BOOL sel) = 0; + virtual void __stdcall DrawSelectionRect(const Ivector2& m_SelStart, const Ivector2& m_SelEnd) = 0; - virtual void __stdcall DrawIndexedPrimitive (int prim_type, u32 pc, const Fvector& pos, const Fvector* vb, const u32& vb_size, const u32* ib, const u32& ib_size, const u32& clr_argb, float scale=1.0f)=0; + virtual void __stdcall DrawIndexedPrimitive(int prim_type, u32 pc, const Fvector& pos, const Fvector* vb, + const u32& vb_size, const u32* ib, const u32& ib_size, const u32& clr_argb, float scale = 1.0f) = 0; - virtual void __stdcall OutText (const Fvector& pos, LPCSTR text, u32 color=0xFF000000, u32 shadow_color=0xFF909090)=0; + virtual void __stdcall OutText( + const Fvector& pos, LPCSTR text, u32 color = 0xFF000000, u32 shadow_color = 0xFF909090) = 0; - virtual void __stdcall OnDeviceDestroy() = 0; + virtual void __stdcall OnDeviceDestroy() = 0; }; //---------------------------------------------------- #endif - diff --git a/src/Include/xrRender/EnvironmentRender.h b/src/Include/xrRender/EnvironmentRender.h index eb10aacb03a..9680f194875 100644 --- a/src/Include/xrRender/EnvironmentRender.h +++ b/src/Include/xrRender/EnvironmentRender.h @@ -2,9 +2,10 @@ #define EnvironmentRender_included #pragma once -namespace particles_systems { - class library_interface; -} // namespace particle_systems +namespace particles_systems +{ +class library_interface; +} // namespace particle_systems class CEnvironment; class CEnvDescriptor; @@ -12,37 +13,37 @@ class CEnvDescriptor; class IEnvDescriptorRender { public: - virtual ~IEnvDescriptorRender() {;} - virtual void Copy(IEnvDescriptorRender &_in) = 0; + virtual ~IEnvDescriptorRender() { ; } + virtual void Copy(IEnvDescriptorRender& _in) = 0; - virtual void OnDeviceCreate(CEnvDescriptor &owner) = 0; - virtual void OnDeviceDestroy() = 0; + virtual void OnDeviceCreate(CEnvDescriptor& owner) = 0; + virtual void OnDeviceDestroy() = 0; }; class IEnvDescriptorMixerRender { public: - virtual ~IEnvDescriptorMixerRender() {;} - virtual void Copy(IEnvDescriptorMixerRender &_in) = 0; + virtual ~IEnvDescriptorMixerRender() { ; } + virtual void Copy(IEnvDescriptorMixerRender& _in) = 0; - virtual void Destroy() = 0; - virtual void Clear() = 0; - virtual void lerp(IEnvDescriptorRender *inA, IEnvDescriptorRender *inB) = 0; + virtual void Destroy() = 0; + virtual void Clear() = 0; + virtual void lerp(IEnvDescriptorRender* inA, IEnvDescriptorRender* inB) = 0; }; class IEnvironmentRender { public: - virtual ~IEnvironmentRender() {;} - virtual void Copy(IEnvironmentRender &_in) = 0; - virtual void OnFrame(CEnvironment &env) = 0; - virtual void OnLoad() = 0; - virtual void OnUnload() = 0; - virtual void RenderSky(CEnvironment &env) = 0; - virtual void RenderClouds(CEnvironment &env) = 0; - virtual void OnDeviceCreate() = 0; - virtual void OnDeviceDestroy() = 0; - virtual particles_systems::library_interface const& particles_systems_library () = 0; + virtual ~IEnvironmentRender() { ; } + virtual void Copy(IEnvironmentRender& _in) = 0; + virtual void OnFrame(CEnvironment& env) = 0; + virtual void OnLoad() = 0; + virtual void OnUnload() = 0; + virtual void RenderSky(CEnvironment& env) = 0; + virtual void RenderClouds(CEnvironment& env) = 0; + virtual void OnDeviceCreate() = 0; + virtual void OnDeviceDestroy() = 0; + virtual particles_systems::library_interface const& particles_systems_library() = 0; }; -#endif // EnvironmentRender_included \ No newline at end of file +#endif // EnvironmentRender_included \ No newline at end of file diff --git a/src/Include/xrRender/FactoryPtr.h b/src/Include/xrRender/FactoryPtr.h index dbe5a2b4a8f..f17657e1ba3 100644 --- a/src/Include/xrRender/FactoryPtr.h +++ b/src/Include/xrRender/FactoryPtr.h @@ -1,93 +1,89 @@ -#ifndef FactoryPtr_included +#ifndef FactoryPtr_included #define FactoryPtr_included #pragma once -#include "RenderFactory.h" #include "Include/xrAPI/xrAPI.h" +#include "RenderFactory.h" -#define FACTORY_PTR_INSTANCIATE(Class) \ - template<> inline void FactoryPtr::CreateObject(void) \ -{ \ - m_pObject = GlobalEnv.RenderFactory->Create##Class(); \ -} \ - template<> inline void FactoryPtr::DestroyObject(void) \ -{ \ - GlobalEnv.RenderFactory->Destroy##Class(m_pObject); \ - m_pObject = NULL; \ -} - +#define FACTORY_PTR_INSTANCIATE(Class) \ + template <> \ + inline void FactoryPtr::CreateObject(void) \ + { \ + m_pObject = GlobalEnv.RenderFactory->Create##Class(); \ + } \ + template <> \ + inline void FactoryPtr::DestroyObject(void) \ + { \ + GlobalEnv.RenderFactory->Destroy##Class(m_pObject); \ + m_pObject = NULL; \ + } -template +template class FactoryPtr { public: - FactoryPtr() { CreateObject();} - ~FactoryPtr() { DestroyObject();} - - FactoryPtr(const FactoryPtr &_in) - { - CreateObject(); - m_pObject->Copy(*_in.m_pObject); - } + FactoryPtr() { CreateObject(); } + ~FactoryPtr() { DestroyObject(); } + FactoryPtr(const FactoryPtr& _in) + { + CreateObject(); + m_pObject->Copy(*_in.m_pObject); + } - FactoryPtr& operator=( const FactoryPtr &_in) - { - m_pObject->Copy(*_in.m_pObject); - return *this; - } - - T& operator*() const {return *m_pObject;} - T* operator->() const {return m_pObject;} - - // unspecified bool type - typedef T const * (FactoryPtr::*unspecified_bool_type) () const; - operator unspecified_bool_type () const {return (!m_pObject ? 0 : &FactoryPtr::get);} - bool operator! () const { return m_pObject == 0;} + FactoryPtr& operator=(const FactoryPtr& _in) + { + m_pObject->Copy(*_in.m_pObject); + return *this; + } + T& operator*() const { return *m_pObject; } + T* operator->() const { return m_pObject; } + // unspecified bool type + typedef T const* (FactoryPtr::*unspecified_bool_type)() const; + operator unspecified_bool_type() const { return (!m_pObject ? 0 : &FactoryPtr::get); } + bool operator!() const { return m_pObject == 0; } private: - void CreateObject(); - void DestroyObject(); - T const* get() const { return m_pObject; } + void CreateObject(); + void DestroyObject(); + T const* get() const { return m_pObject; } private: - T* m_pObject; + T* m_pObject; }; - #ifndef _EDITOR - FACTORY_PTR_INSTANCIATE(UISequenceVideoItem) - FACTORY_PTR_INSTANCIATE(UIShader) - FACTORY_PTR_INSTANCIATE(StatGraphRender) - FACTORY_PTR_INSTANCIATE(ConsoleRender) -# ifdef DEBUG - FACTORY_PTR_INSTANCIATE(ObjectSpaceRender) -# endif // DEBUG - FACTORY_PTR_INSTANCIATE(ApplicationRender) - FACTORY_PTR_INSTANCIATE(WallMarkArray) -#endif // _EDITOR +FACTORY_PTR_INSTANCIATE(UISequenceVideoItem) +FACTORY_PTR_INSTANCIATE(UIShader) +FACTORY_PTR_INSTANCIATE(StatGraphRender) +FACTORY_PTR_INSTANCIATE(ConsoleRender) +#ifdef DEBUG +FACTORY_PTR_INSTANCIATE(ObjectSpaceRender) +#endif // DEBUG +FACTORY_PTR_INSTANCIATE(ApplicationRender) +FACTORY_PTR_INSTANCIATE(WallMarkArray) +#endif // _EDITOR #ifndef _EDITOR - FACTORY_PTR_INSTANCIATE(FlareRender) - FACTORY_PTR_INSTANCIATE(ThunderboltRender) - FACTORY_PTR_INSTANCIATE(ThunderboltDescRender) - FACTORY_PTR_INSTANCIATE(LensFlareRender) - FACTORY_PTR_INSTANCIATE(RainRender) - FACTORY_PTR_INSTANCIATE(EnvironmentRender) - FACTORY_PTR_INSTANCIATE(EnvDescriptorRender) - FACTORY_PTR_INSTANCIATE(EnvDescriptorMixerRender) -#endif // _EDITOR - FACTORY_PTR_INSTANCIATE(FontRender) +FACTORY_PTR_INSTANCIATE(FlareRender) +FACTORY_PTR_INSTANCIATE(ThunderboltRender) +FACTORY_PTR_INSTANCIATE(ThunderboltDescRender) +FACTORY_PTR_INSTANCIATE(LensFlareRender) +FACTORY_PTR_INSTANCIATE(RainRender) +FACTORY_PTR_INSTANCIATE(EnvironmentRender) +FACTORY_PTR_INSTANCIATE(EnvDescriptorRender) +FACTORY_PTR_INSTANCIATE(EnvDescriptorMixerRender) +#endif // _EDITOR +FACTORY_PTR_INSTANCIATE(FontRender) /* void FactoryPtr::CreateObject(void) { - m_pObject = RenderFactory->CreateStatsRender(); + m_pObject = RenderFactory->CreateStatsRender(); } void FactoryPtr::DestroyObject(void) { - RenderFactory->DestroyStatsRender(m_pObject); - m_pObject = NULL; + RenderFactory->DestroyStatsRender(m_pObject); + m_pObject = NULL; } */ - -#endif // FactoryPtr_included \ No newline at end of file +#endif // FactoryPtr_included \ No newline at end of file diff --git a/src/Include/xrRender/FontRender.h b/src/Include/xrRender/FontRender.h index f8bdfd1f0d3..26885e65a02 100644 --- a/src/Include/xrRender/FontRender.h +++ b/src/Include/xrRender/FontRender.h @@ -7,10 +7,9 @@ class CGameFont; class IFontRender { public: - virtual ~IFontRender() {;} - - virtual void Initialize(LPCSTR cShader, LPCSTR cTexture) = 0; - virtual void OnRender(CGameFont &owner) = 0; + virtual ~IFontRender() { ; } + virtual void Initialize(LPCSTR cShader, LPCSTR cTexture) = 0; + virtual void OnRender(CGameFont& owner) = 0; }; -#endif // FontRender_included \ No newline at end of file +#endif // FontRender_included \ No newline at end of file diff --git a/src/Include/xrRender/Kinematics.h b/src/Include/xrRender/Kinematics.h index f108a0f27e4..21f2d4ea420 100644 --- a/src/Include/xrRender/Kinematics.h +++ b/src/Include/xrRender/Kinematics.h @@ -1,95 +1,100 @@ -#ifndef Kinematics_included -#define Kinematics_included +#ifndef Kinematics_included +#define Kinematics_included #pragma once #include "RenderVisual.h" -typedef void (* UpdateCallback) (IKinematics* P); +typedef void (*UpdateCallback)(IKinematics* P); class CBoneData; class IBoneData; class IKinematicsAnimated; class IRenderVisual; class CBoneInstance; -struct SEnumVerticesCallback; +struct SEnumVerticesCallback; // 10 fps -#define UCalc_Interval (u32(100)) +#define UCalc_Interval (u32(100)) class IKinematics { public: - typedef xr_vector > accel; - struct pick_result - { - Fvector normal; - float dist; - Fvector tri[3]; - }; + typedef xr_vector> accel; + struct pick_result + { + Fvector normal; + float dist; + Fvector tri[3]; + }; + public: - virtual void Bone_Calculate (CBoneData* bd, Fmatrix* parent) = 0; - virtual void Bone_GetAnimPos(Fmatrix& pos,u16 id, u8 channel_mask, bool ignore_callbacks) = 0; + virtual void Bone_Calculate(CBoneData* bd, Fmatrix* parent) = 0; + virtual void Bone_GetAnimPos(Fmatrix& pos, u16 id, u8 channel_mask, bool ignore_callbacks) = 0; - virtual bool PickBone (const Fmatrix &parent_xform, pick_result &r, float dist, const Fvector& start, const Fvector& dir, u16 bone_id) = 0; - virtual void EnumBoneVertices (SEnumVerticesCallback &C, u16 bone_id) = 0; + virtual bool PickBone(const Fmatrix& parent_xform, pick_result& r, float dist, const Fvector& start, + const Fvector& dir, u16 bone_id) = 0; + virtual void EnumBoneVertices(SEnumVerticesCallback& C, u16 bone_id) = 0; - // Low level interface - virtual u16 LL_BoneID(LPCSTR B) = 0; - virtual u16 LL_BoneID(const shared_str& B) = 0; - virtual LPCSTR LL_BoneName_dbg(u16 ID) = 0; + // Low level interface + virtual u16 LL_BoneID(LPCSTR B) = 0; + virtual u16 LL_BoneID(const shared_str& B) = 0; + virtual LPCSTR LL_BoneName_dbg(u16 ID) = 0; - virtual CInifile* LL_UserData() = 0; - virtual accel* LL_Bones() = 0; + virtual CInifile* LL_UserData() = 0; + virtual accel* LL_Bones() = 0; - virtual ICF CBoneInstance& LL_GetBoneInstance(u16 bone_id) = 0; + virtual ICF CBoneInstance& LL_GetBoneInstance(u16 bone_id) = 0; - virtual CBoneData& LL_GetData(u16 bone_id) = 0; + virtual CBoneData& LL_GetData(u16 bone_id) = 0; -virtual const IBoneData& GetBoneData(u16 bone_id) const = 0; + virtual const IBoneData& GetBoneData(u16 bone_id) const = 0; - virtual u16 LL_BoneCount()const = 0; - virtual u16 LL_VisibleBoneCount() = 0; + virtual u16 LL_BoneCount() const = 0; + virtual u16 LL_VisibleBoneCount() = 0; - virtual ICF Fmatrix& LL_GetTransform(u16 bone_id) = 0; - virtual ICF const Fmatrix& LL_GetTransform(u16 bone_id) const = 0; + virtual ICF Fmatrix& LL_GetTransform(u16 bone_id) = 0; + virtual ICF const Fmatrix& LL_GetTransform(u16 bone_id) const = 0; - virtual ICF Fmatrix& LL_GetTransform_R(u16 bone_id) = 0; - virtual Fobb& LL_GetBox(u16 bone_id) = 0; - virtual const Fbox& GetBox()const = 0; - virtual void LL_GetBindTransform(xr_vector& matrices) = 0; - virtual int LL_GetBoneGroups(xr_vector >& groups) = 0; + virtual ICF Fmatrix& LL_GetTransform_R(u16 bone_id) = 0; + virtual Fobb& LL_GetBox(u16 bone_id) = 0; + virtual const Fbox& GetBox() const = 0; + virtual void LL_GetBindTransform(xr_vector& matrices) = 0; + virtual int LL_GetBoneGroups(xr_vector>& groups) = 0; - virtual u16 LL_GetBoneRoot() = 0; - virtual void LL_SetBoneRoot(u16 bone_id) = 0; + virtual u16 LL_GetBoneRoot() = 0; + virtual void LL_SetBoneRoot(u16 bone_id) = 0; - virtual BOOL LL_GetBoneVisible(u16 bone_id) = 0; - virtual void LL_SetBoneVisible(u16 bone_id, BOOL val, BOOL bRecursive) = 0; - virtual u64 LL_GetBonesVisible() = 0; - virtual void LL_SetBonesVisible(u64 mask) = 0; + virtual BOOL LL_GetBoneVisible(u16 bone_id) = 0; + virtual void LL_SetBoneVisible(u16 bone_id, BOOL val, BOOL bRecursive) = 0; + virtual u64 LL_GetBonesVisible() = 0; + virtual void LL_SetBonesVisible(u64 mask) = 0; - // Main functionality - virtual void CalculateBones(BOOL bForceExact = FALSE) = 0; // Recalculate skeleton - virtual void CalculateBones_Invalidate() = 0; - virtual void Callback(UpdateCallback C, void* Param) = 0; + // Main functionality + virtual void CalculateBones(BOOL bForceExact = FALSE) = 0; // Recalculate skeleton + virtual void CalculateBones_Invalidate() = 0; + virtual void Callback(UpdateCallback C, void* Param) = 0; - // Callback: data manipulation - virtual void SetUpdateCallback(UpdateCallback pCallback) = 0; - virtual void SetUpdateCallbackParam(void* pCallbackParam) = 0; + // Callback: data manipulation + virtual void SetUpdateCallback(UpdateCallback pCallback) = 0; + virtual void SetUpdateCallbackParam(void* pCallbackParam) = 0; - virtual UpdateCallback GetUpdateCallback() = 0; - virtual void* GetUpdateCallbackParam() = 0; - //UpdateCallback Update_Callback; - //void* Update_Callback_Param; - virtual IRenderVisual* dcast_RenderVisual() = 0; - virtual IKinematicsAnimated* dcast_PKinematicsAnimated() = 0; + virtual UpdateCallback GetUpdateCallback() = 0; + virtual void* GetUpdateCallbackParam() = 0; + // UpdateCallback Update_Callback; + // void* Update_Callback_Param; + virtual IRenderVisual* dcast_RenderVisual() = 0; + virtual IKinematicsAnimated* dcast_PKinematicsAnimated() = 0; - // debug +// debug #ifdef DEBUG - virtual void DebugRender (Fmatrix& XFORM) = 0; - virtual shared_str getDebugName () = 0; + virtual void DebugRender(Fmatrix& XFORM) = 0; + virtual shared_str getDebugName() = 0; #endif }; -IC IKinematics* PKinematics (IRenderVisual* V) { return V?V->dcast_PKinematics():0;} +IC IKinematics* PKinematics(IRenderVisual* V) +{ + return V ? V->dcast_PKinematics() : 0; +} -#endif // Kinematics_included \ No newline at end of file +#endif // Kinematics_included \ No newline at end of file diff --git a/src/Include/xrRender/KinematicsAnimated.h b/src/Include/xrRender/KinematicsAnimated.h index b71465406e9..109cd6f92c5 100644 --- a/src/Include/xrRender/KinematicsAnimated.h +++ b/src/Include/xrRender/KinematicsAnimated.h @@ -1,112 +1,119 @@ -#ifndef KinematicsAnimated_included -#define KinematicsAnimated_included +#ifndef KinematicsAnimated_included +#define KinematicsAnimated_included #pragma once -#include "xrCore/Animation/SkeletonMotions.hpp" -#include "animation_blend.h" #include "Layers/xrrender/KinematicAnimatedDefs.h" +#include "animation_blend.h" +#include "xrCore/Animation/SkeletonMotions.hpp" -class IKinematics; -class CBlend; -class CKinematicsAnimated; -class CBoneInstanceAnimated; -struct CKey; -class CInifile; -class IKinematicsAnimated; -class IRenderVisual; +class IKinematics; +class CBlend; +class CKinematicsAnimated; +class CBoneInstanceAnimated; +struct CKey; +class CInifile; +class IKinematicsAnimated; +class IRenderVisual; struct IterateBlendsCallback { - virtual void operator () ( CBlend &B ) = 0; + virtual void operator()(CBlend& B) = 0; }; struct IUpdateTracksCallback { - virtual bool operator () ( float dt, IKinematicsAnimated& k ) = 0; + virtual bool operator()(float dt, IKinematicsAnimated& k) = 0; }; struct SKeyTable { - CKey keys [MAX_CHANNELS][MAX_BLENDED]; //all keys - CBlend *blends [MAX_CHANNELS][MAX_BLENDED]; //blend pointers - int chanel_blend_conts [MAX_CHANNELS] ; //channel counts - SKeyTable () { std::fill_n( chanel_blend_conts, MAX_CHANNELS, 0 ); } + CKey keys[MAX_CHANNELS][MAX_BLENDED]; // all keys + CBlend* blends[MAX_CHANNELS][MAX_BLENDED]; // blend pointers + int chanel_blend_conts[MAX_CHANNELS]; // channel counts + SKeyTable() { std::fill_n(chanel_blend_conts, MAX_CHANNELS, 0); } }; class IKinematicsAnimated { public: - virtual ~IKinematicsAnimated() {;} - - // Calculation + virtual ~IKinematicsAnimated() { ; } + // Calculation public: - virtual void OnCalculateBones() = 0; + virtual void OnCalculateBones() = 0; #ifdef DEBUG - virtual std::pair LL_MotionDefName_dbg (MotionID ID) = 0; - virtual void LL_DumpBlends_dbg ( )=0; + virtual std::pair LL_MotionDefName_dbg(MotionID ID) = 0; + virtual void LL_DumpBlends_dbg() = 0; #endif - virtual u32 LL_PartBlendsCount ( u32 bone_part_id )=0; - virtual CBlend *LL_PartBlend ( u32 bone_part_id, u32 n )=0; - virtual void LL_IterateBlends ( IterateBlendsCallback &callback )=0; - - virtual u16 LL_MotionsSlotCount() = 0; - virtual const shared_motions& LL_MotionsSlot(u16 idx) = 0; - - //IC CMotionDef* LL_GetMotionDef (MotionID id){return m_Motions[id.slot].motions.motion_def(id.idx);} - //IC CMotion* LL_GetRootMotion(MotionID id){return &m_Motions[id.slot].bone_motions[iRoot]->at(id.idx);} - //IC CMotion* LL_GetMotion (MotionID id, u16 bone_id){return &m_Motions[id.slot].bone_motions[bone_id]->at(id.idx);} - virtual CMotionDef* LL_GetMotionDef (MotionID id) = 0; - virtual CMotion* LL_GetRootMotion(MotionID id) = 0; - virtual CMotion* LL_GetMotion (MotionID id, u16 bone_id) = 0; - //interface for procedural animations :) - virtual void LL_BuldBoneMatrixDequatize ( const CBoneData* bd, u8 channel_mask, SKeyTable& keys ) = 0; - virtual void LL_BoneMatrixBuild ( CBoneInstance &bi, const Fmatrix *parent, const SKeyTable& keys ) = 0; - - virtual IBlendDestroyCallback *GetBlendDestroyCallback ( ) = 0; - virtual void SetBlendDestroyCallback ( IBlendDestroyCallback *cb ) = 0; - virtual void SetUpdateTracksCalback ( IUpdateTracksCallback *callback )=0; - virtual IUpdateTracksCallback *GetUpdateTracksCalback ( )=0; - - // Low level interface - virtual MotionID LL_MotionID (LPCSTR B) = 0; - virtual u16 LL_PartID (LPCSTR B) = 0; - -// CBlend* LL_PlayFX (u16 bone, MotionID motion, float blendAccrue, float blendFalloff, float Speed, float Power); - virtual CBlend* LL_PlayCycle (u16 partition, MotionID motion, BOOL bMixing, float blendAccrue, float blendFalloff, float Speed, BOOL noloop, PlayCallback Callback, LPVOID CallbackParam, u8 channel = 0) = 0; - virtual CBlend* LL_PlayCycle (u16 partition, MotionID motion, BOOL bMixIn, PlayCallback Callback, LPVOID CallbackParam, u8 channel = 0) = 0; -// void LL_FadeCycle (u16 partition, float falloff, u8 mask_channel = (1<<0)); - virtual void LL_CloseCycle (u16 partition, u8 mask_channel = (1<<0)) = 0; - virtual void LL_SetChannelFactor (u16 channel,float factor) = 0; -// virtual CBlendInstance& LL_GetBlendInstance (u16 bone_id) = 0; - - // Main functionality - virtual void UpdateTracks () = 0; // Update motions - virtual void LL_UpdateTracks ( float dt, bool b_force, bool leave_blends ) = 0; // Update motions - //void DestroyCycle (CBlend &B); - - // cycles - virtual MotionID ID_Cycle (LPCSTR N) = 0; - virtual MotionID ID_Cycle_Safe (LPCSTR N) = 0; - virtual MotionID ID_Cycle (shared_str N) = 0; - virtual MotionID ID_Cycle_Safe (shared_str N) = 0; - virtual CBlend* PlayCycle (LPCSTR N, BOOL bMixIn=TRUE, PlayCallback Callback=0, LPVOID CallbackParam=0, u8 channel = 0) = 0; - virtual CBlend* PlayCycle (MotionID M, BOOL bMixIn=TRUE, PlayCallback Callback=0, LPVOID CallbackParam=0, u8 channel = 0) = 0; - virtual CBlend* PlayCycle (u16 partition, MotionID M, BOOL bMixIn=TRUE, PlayCallback Callback=0, LPVOID CallbackParam=0, u8 channel = 0) = 0; - // fx'es - virtual MotionID ID_FX (LPCSTR N) = 0; - virtual MotionID ID_FX_Safe (LPCSTR N) = 0; - virtual CBlend* PlayFX (LPCSTR N, float power_scale) = 0; - virtual CBlend* PlayFX (MotionID M, float power_scale) = 0; - - virtual const CPartition& partitions () const = 0; - - virtual IRenderVisual* dcast_RenderVisual() = 0; - virtual IKinematics* dcast_PKinematics() = 0; - - virtual float get_animation_length (MotionID motion_ID) = 0; -//#ifdef DEBUG -// virtual const BlendSVec &blend_cycle (const u32 &bone_part_id) const = 0; -//#endif // DEBUG + virtual u32 LL_PartBlendsCount(u32 bone_part_id) = 0; + virtual CBlend* LL_PartBlend(u32 bone_part_id, u32 n) = 0; + virtual void LL_IterateBlends(IterateBlendsCallback& callback) = 0; + + virtual u16 LL_MotionsSlotCount() = 0; + virtual const shared_motions& LL_MotionsSlot(u16 idx) = 0; + + // IC CMotionDef* LL_GetMotionDef (MotionID id){return m_Motions[id.slot].motions.motion_def(id.idx);} + // IC CMotion* LL_GetRootMotion(MotionID id){return + // &m_Motions[id.slot].bone_motions[iRoot]->at(id.idx);} + // IC CMotion* LL_GetMotion (MotionID id, u16 bone_id){return + // &m_Motions[id.slot].bone_motions[bone_id]->at(id.idx);} + virtual CMotionDef* LL_GetMotionDef(MotionID id) = 0; + virtual CMotion* LL_GetRootMotion(MotionID id) = 0; + virtual CMotion* LL_GetMotion(MotionID id, u16 bone_id) = 0; + // interface for procedural animations :) + virtual void LL_BuldBoneMatrixDequatize(const CBoneData* bd, u8 channel_mask, SKeyTable& keys) = 0; + virtual void LL_BoneMatrixBuild(CBoneInstance& bi, const Fmatrix* parent, const SKeyTable& keys) = 0; + + virtual IBlendDestroyCallback* GetBlendDestroyCallback() = 0; + virtual void SetBlendDestroyCallback(IBlendDestroyCallback* cb) = 0; + virtual void SetUpdateTracksCalback(IUpdateTracksCallback* callback) = 0; + virtual IUpdateTracksCallback* GetUpdateTracksCalback() = 0; + + // Low level interface + virtual MotionID LL_MotionID(LPCSTR B) = 0; + virtual u16 LL_PartID(LPCSTR B) = 0; + + // CBlend* LL_PlayFX (u16 bone, MotionID motion, float blendAccrue, float blendFalloff, float + //Speed, float Power); + virtual CBlend* LL_PlayCycle(u16 partition, MotionID motion, BOOL bMixing, float blendAccrue, float blendFalloff, + float Speed, BOOL noloop, PlayCallback Callback, LPVOID CallbackParam, u8 channel = 0) = 0; + virtual CBlend* LL_PlayCycle( + u16 partition, MotionID motion, BOOL bMixIn, PlayCallback Callback, LPVOID CallbackParam, u8 channel = 0) = 0; + // void LL_FadeCycle (u16 partition, float falloff, u8 mask_channel = (1<<0)); + virtual void LL_CloseCycle(u16 partition, u8 mask_channel = (1 << 0)) = 0; + virtual void LL_SetChannelFactor(u16 channel, float factor) = 0; + // virtual CBlendInstance& LL_GetBlendInstance (u16 bone_id) = 0; + + // Main functionality + virtual void UpdateTracks() = 0; // Update motions + virtual void LL_UpdateTracks(float dt, bool b_force, bool leave_blends) = 0; // Update motions + // void DestroyCycle (CBlend &B); + + // cycles + virtual MotionID ID_Cycle(LPCSTR N) = 0; + virtual MotionID ID_Cycle_Safe(LPCSTR N) = 0; + virtual MotionID ID_Cycle(shared_str N) = 0; + virtual MotionID ID_Cycle_Safe(shared_str N) = 0; + virtual CBlend* PlayCycle( + LPCSTR N, BOOL bMixIn = TRUE, PlayCallback Callback = 0, LPVOID CallbackParam = 0, u8 channel = 0) = 0; + virtual CBlend* PlayCycle( + MotionID M, BOOL bMixIn = TRUE, PlayCallback Callback = 0, LPVOID CallbackParam = 0, u8 channel = 0) = 0; + virtual CBlend* PlayCycle(u16 partition, MotionID M, BOOL bMixIn = TRUE, PlayCallback Callback = 0, + LPVOID CallbackParam = 0, u8 channel = 0) = 0; + // fx'es + virtual MotionID ID_FX(LPCSTR N) = 0; + virtual MotionID ID_FX_Safe(LPCSTR N) = 0; + virtual CBlend* PlayFX(LPCSTR N, float power_scale) = 0; + virtual CBlend* PlayFX(MotionID M, float power_scale) = 0; + + virtual const CPartition& partitions() const = 0; + + virtual IRenderVisual* dcast_RenderVisual() = 0; + virtual IKinematics* dcast_PKinematics() = 0; + + virtual float get_animation_length(MotionID motion_ID) = 0; + //#ifdef DEBUG + // virtual const BlendSVec &blend_cycle (const u32 &bone_part_id) const = 0; + //#endif // DEBUG }; -#endif // KinematicsAnimated_included +#endif // KinematicsAnimated_included diff --git a/src/Include/xrRender/LensFlareRender.h b/src/Include/xrRender/LensFlareRender.h index 201f3f39815..493daad2a6d 100644 --- a/src/Include/xrRender/LensFlareRender.h +++ b/src/Include/xrRender/LensFlareRender.h @@ -5,11 +5,11 @@ class IFlareRender { public: - virtual ~IFlareRender() {;} - virtual void Copy(IFlareRender &_in) = 0; + virtual ~IFlareRender() { ; } + virtual void Copy(IFlareRender& _in) = 0; - virtual void CreateShader(LPCSTR sh_name, LPCSTR tex_name) = 0; - virtual void DestroyShader() = 0; + virtual void CreateShader(LPCSTR sh_name, LPCSTR tex_name) = 0; + virtual void DestroyShader() = 0; }; class CLensFlare; @@ -17,12 +17,12 @@ class CLensFlare; class ILensFlareRender { public: - virtual ~ILensFlareRender() {;} - virtual void Copy(ILensFlareRender &_in) = 0; + virtual ~ILensFlareRender() { ; } + virtual void Copy(ILensFlareRender& _in) = 0; - virtual void Render(CLensFlare &owner, BOOL bSun, BOOL bFlares, BOOL bGradient) = 0; - virtual void OnDeviceCreate() = 0; - virtual void OnDeviceDestroy() = 0; + virtual void Render(CLensFlare& owner, BOOL bSun, BOOL bFlares, BOOL bGradient) = 0; + virtual void OnDeviceCreate() = 0; + virtual void OnDeviceDestroy() = 0; }; -#endif // LensFlareRender_included \ No newline at end of file +#endif // LensFlareRender_included \ No newline at end of file diff --git a/src/Include/xrRender/ObjectSpaceRender.h b/src/Include/xrRender/ObjectSpaceRender.h index 771d280636d..f4a2ac95fc8 100644 --- a/src/Include/xrRender/ObjectSpaceRender.h +++ b/src/Include/xrRender/ObjectSpaceRender.h @@ -7,14 +7,14 @@ class IObjectSpaceRender { public: - virtual ~IObjectSpaceRender() {;} - virtual void Copy (IObjectSpaceRender &_in) = 0; + virtual ~IObjectSpaceRender() { ; } + virtual void Copy(IObjectSpaceRender& _in) = 0; - virtual void dbgRender() = 0; - virtual void dbgAddSphere(const Fsphere &sphere, u32 colour) = 0; - virtual void SetShader() = 0; + virtual void dbgRender() = 0; + virtual void dbgAddSphere(const Fsphere& sphere, u32 colour) = 0; + virtual void SetShader() = 0; }; -#endif // DEBUG +#endif // DEBUG -#endif // ObjectSpaceRender_included \ No newline at end of file +#endif // ObjectSpaceRender_included \ No newline at end of file diff --git a/src/Include/xrRender/ParticleCustom.h b/src/Include/xrRender/ParticleCustom.h index 120149c7da3..174b6d2bc07 100644 --- a/src/Include/xrRender/ParticleCustom.h +++ b/src/Include/xrRender/ParticleCustom.h @@ -1,30 +1,28 @@ -#ifndef ParticleCustom_included -#define ParticleCustom_included +#ifndef ParticleCustom_included +#define ParticleCustom_included #pragma once class IParticleCustom { public: - virtual ~IParticleCustom() {;} + virtual ~IParticleCustom() { ; } + virtual void OnDeviceCreate() = 0; + virtual void OnDeviceDestroy() = 0; - virtual void OnDeviceCreate ()=0; - virtual void OnDeviceDestroy ()=0; + virtual void UpdateParent(const Fmatrix& m, const Fvector& velocity, BOOL bXFORM) = 0; + virtual void OnFrame(u32 dt) = 0; - virtual void UpdateParent (const Fmatrix& m, const Fvector& velocity, BOOL bXFORM)=0; - virtual void OnFrame (u32 dt)=0; + virtual void Play() = 0; + virtual void Stop(BOOL bDefferedStop = TRUE) = 0; + virtual BOOL IsPlaying() = 0; - virtual void Play ()=0; - virtual void Stop (BOOL bDefferedStop=TRUE)=0; - virtual BOOL IsPlaying ()=0; + virtual u32 ParticlesCount() = 0; - virtual u32 ParticlesCount ()=0; - - virtual float GetTimeLimit ()=0; - virtual BOOL IsLooped (){return GetTimeLimit()<0.f;} - - virtual const shared_str Name ()=0; - virtual void SetHudMode (BOOL b)=0; - virtual BOOL GetHudMode ()=0; + virtual float GetTimeLimit() = 0; + virtual BOOL IsLooped() { return GetTimeLimit() < 0.f; } + virtual const shared_str Name() = 0; + virtual void SetHudMode(BOOL b) = 0; + virtual BOOL GetHudMode() = 0; }; -#endif // ParticleCustom_included \ No newline at end of file +#endif // ParticleCustom_included \ No newline at end of file diff --git a/src/Include/xrRender/RainRender.h b/src/Include/xrRender/RainRender.h index fabb070e58a..6fa69fdfe72 100644 --- a/src/Include/xrRender/RainRender.h +++ b/src/Include/xrRender/RainRender.h @@ -3,19 +3,19 @@ #pragma once class CEffect_Rain; -//struct Fsphere; +// struct Fsphere; #include "xrCore/_sphere.h" class IRainRender { public: - virtual ~IRainRender() {;} - virtual void Copy(IRainRender &_in) = 0; + virtual ~IRainRender() { ; } + virtual void Copy(IRainRender& _in) = 0; - virtual void Render(CEffect_Rain &owner) = 0; + virtual void Render(CEffect_Rain& owner) = 0; - virtual const Fsphere& GetDropBounds() const = 0; + virtual const Fsphere& GetDropBounds() const = 0; }; -#endif // RainRender_included \ No newline at end of file +#endif // RainRender_included \ No newline at end of file diff --git a/src/Include/xrRender/RenderDetailModel.h b/src/Include/xrRender/RenderDetailModel.h index f9eb4cc0b53..a4198ac443f 100644 --- a/src/Include/xrRender/RenderDetailModel.h +++ b/src/Include/xrRender/RenderDetailModel.h @@ -1,5 +1,5 @@ -#ifndef RenderDetailModel_included -#define RenderDetailModel_included +#ifndef RenderDetailModel_included +#define RenderDetailModel_included #pragma once class IRenderDetailModel @@ -7,4 +7,4 @@ class IRenderDetailModel public: }; -#endif // RenderDetailModel_included \ No newline at end of file +#endif // RenderDetailModel_included \ No newline at end of file diff --git a/src/Include/xrRender/RenderFactory.h b/src/Include/xrRender/RenderFactory.h index 98fb37b4a2b..d70a6d78768 100644 --- a/src/Include/xrRender/RenderFactory.h +++ b/src/Include/xrRender/RenderFactory.h @@ -5,8 +5,8 @@ class IWallMarkArray; #ifdef DEBUG - class IObjectSpaceRender; -#endif // DEBUG +class IObjectSpaceRender; +#endif // DEBUG class IFontRender; class IApplicationRender; @@ -32,44 +32,43 @@ class IConsoleRender; class IUIShader; class IUISequenceVideoItem; -#define RENDER_FACTORY_INTERFACE(Class) \ -virtual I##Class* Create##Class() = 0; \ -virtual void Destroy##Class(I##Class *pObject) = 0; - +#define RENDER_FACTORY_INTERFACE(Class) \ + virtual I##Class* Create##Class() = 0; \ + virtual void Destroy##Class(I##Class* pObject) = 0; class IRenderFactory { public: #ifndef _EDITOR - /* - virtual IStatsRender* CreateStatsRender() = 0; - virtual void DestroyStatsRender(IStatsRender *pObject) = 0; - */ - RENDER_FACTORY_INTERFACE(UISequenceVideoItem) - RENDER_FACTORY_INTERFACE(UIShader) - RENDER_FACTORY_INTERFACE(StatGraphRender) - RENDER_FACTORY_INTERFACE(ConsoleRender) -# ifdef DEBUG - RENDER_FACTORY_INTERFACE(ObjectSpaceRender) -# endif // DEBUG - RENDER_FACTORY_INTERFACE(ApplicationRender) - RENDER_FACTORY_INTERFACE(WallMarkArray) -#endif // _EDITOR + /* + virtual IStatsRender* CreateStatsRender() = 0; + virtual void DestroyStatsRender(IStatsRender *pObject) = 0; + */ + RENDER_FACTORY_INTERFACE(UISequenceVideoItem) + RENDER_FACTORY_INTERFACE(UIShader) + RENDER_FACTORY_INTERFACE(StatGraphRender) + RENDER_FACTORY_INTERFACE(ConsoleRender) +#ifdef DEBUG + RENDER_FACTORY_INTERFACE(ObjectSpaceRender) +#endif // DEBUG + RENDER_FACTORY_INTERFACE(ApplicationRender) + RENDER_FACTORY_INTERFACE(WallMarkArray) +#endif // _EDITOR #ifndef _EDITOR - RENDER_FACTORY_INTERFACE(EnvironmentRender) - RENDER_FACTORY_INTERFACE(EnvDescriptorMixerRender) - RENDER_FACTORY_INTERFACE(EnvDescriptorRender) - RENDER_FACTORY_INTERFACE(RainRender) - RENDER_FACTORY_INTERFACE(LensFlareRender) - RENDER_FACTORY_INTERFACE(ThunderboltRender) - RENDER_FACTORY_INTERFACE(ThunderboltDescRender) - RENDER_FACTORY_INTERFACE(FlareRender) -#endif // _EDITOR - RENDER_FACTORY_INTERFACE(FontRender) + RENDER_FACTORY_INTERFACE(EnvironmentRender) + RENDER_FACTORY_INTERFACE(EnvDescriptorMixerRender) + RENDER_FACTORY_INTERFACE(EnvDescriptorRender) + RENDER_FACTORY_INTERFACE(RainRender) + RENDER_FACTORY_INTERFACE(LensFlareRender) + RENDER_FACTORY_INTERFACE(ThunderboltRender) + RENDER_FACTORY_INTERFACE(ThunderboltDescRender) + RENDER_FACTORY_INTERFACE(FlareRender) +#endif // _EDITOR + RENDER_FACTORY_INTERFACE(FontRender) protected: - //virtual IEnvDescriptorRender *CreateEnvDescriptorRender() = 0; - //virtual void DestroyEnvDescriptorRender(IEnvDescriptorRender *pObject) = 0; + // virtual IEnvDescriptorRender *CreateEnvDescriptorRender() = 0; + // virtual void DestroyEnvDescriptorRender(IEnvDescriptorRender *pObject) = 0; }; -#endif // RenderFactory_included +#endif // RenderFactory_included diff --git a/src/Include/xrRender/RenderVisual.h b/src/Include/xrRender/RenderVisual.h index 6b3d017de8b..29cc1abfb00 100644 --- a/src/Include/xrRender/RenderVisual.h +++ b/src/Include/xrRender/RenderVisual.h @@ -1,5 +1,5 @@ -#ifndef RenderVisual_included -#define RenderVisual_included +#ifndef RenderVisual_included +#define RenderVisual_included #pragma once class IKinematics; @@ -10,18 +10,17 @@ struct vis_data; class IRenderVisual { public: - virtual ~IRenderVisual() {;} - - virtual vis_data& getVisData() = 0; - virtual u32 getType() = 0; + virtual ~IRenderVisual() { ; } + virtual vis_data& getVisData() = 0; + virtual u32 getType() = 0; #ifdef DEBUG - virtual shared_str getDebugName() = 0; + virtual shared_str getDebugName() = 0; #endif - virtual IKinematics* dcast_PKinematics () { return 0; } - virtual IKinematicsAnimated* dcast_PKinematicsAnimated () { return 0; } - virtual IParticleCustom* dcast_ParticleCustom () { return 0; } + virtual IKinematics* dcast_PKinematics() { return 0; } + virtual IKinematicsAnimated* dcast_PKinematicsAnimated() { return 0; } + virtual IParticleCustom* dcast_ParticleCustom() { return 0; } }; -#endif // RenderVisual_included \ No newline at end of file +#endif // RenderVisual_included \ No newline at end of file diff --git a/src/Include/xrRender/StatGraphRender.h b/src/Include/xrRender/StatGraphRender.h index 8f14d96e2b8..bbf85b500db 100644 --- a/src/Include/xrRender/StatGraphRender.h +++ b/src/Include/xrRender/StatGraphRender.h @@ -1,5 +1,5 @@ -#ifndef StatGraphRender_included -#define StatGraphRender_included +#ifndef StatGraphRender_included +#define StatGraphRender_included #pragma once class CStatGraph; @@ -7,13 +7,13 @@ class CStatGraph; class IStatGraphRender { public: - virtual ~IStatGraphRender() {;} - virtual void Copy(IStatGraphRender &_in) = 0; + virtual ~IStatGraphRender() { ; } + virtual void Copy(IStatGraphRender& _in) = 0; - virtual void OnDeviceCreate() = 0; - virtual void OnDeviceDestroy() = 0; + virtual void OnDeviceCreate() = 0; + virtual void OnDeviceDestroy() = 0; - virtual void OnRender(CStatGraph &owner) = 0; + virtual void OnRender(CStatGraph& owner) = 0; }; -#endif // StatGraphRender_included \ No newline at end of file +#endif // StatGraphRender_included \ No newline at end of file diff --git a/src/Include/xrRender/ThunderboltDescRender.h b/src/Include/xrRender/ThunderboltDescRender.h index 89e2635aeff..65bbc82c9f3 100644 --- a/src/Include/xrRender/ThunderboltDescRender.h +++ b/src/Include/xrRender/ThunderboltDescRender.h @@ -1,15 +1,15 @@ -#ifndef ThunderboltDescRender_included -#define ThunderboltDescRender_included +#ifndef ThunderboltDescRender_included +#define ThunderboltDescRender_included #pragma once class IThunderboltDescRender { public: - virtual ~IThunderboltDescRender() {;} - virtual void Copy(IThunderboltDescRender &_in) = 0; + virtual ~IThunderboltDescRender() { ; } + virtual void Copy(IThunderboltDescRender& _in) = 0; - virtual void CreateModel(LPCSTR m_name) = 0; - virtual void DestroyModel() = 0; + virtual void CreateModel(LPCSTR m_name) = 0; + virtual void DestroyModel() = 0; }; -#endif // ThunderboltDescRender_included \ No newline at end of file +#endif // ThunderboltDescRender_included \ No newline at end of file diff --git a/src/Include/xrRender/ThunderboltRender.h b/src/Include/xrRender/ThunderboltRender.h index b387ba8f31d..9a48cc468cf 100644 --- a/src/Include/xrRender/ThunderboltRender.h +++ b/src/Include/xrRender/ThunderboltRender.h @@ -7,10 +7,10 @@ class CEffect_Thunderbolt; class IThunderboltRender { public: - virtual ~IThunderboltRender() {;} - virtual void Copy(IThunderboltRender &_in) = 0; + virtual ~IThunderboltRender() { ; } + virtual void Copy(IThunderboltRender& _in) = 0; - virtual void Render(CEffect_Thunderbolt &owner) = 0; + virtual void Render(CEffect_Thunderbolt& owner) = 0; }; -#endif // ThunderboltRender_included \ No newline at end of file +#endif // ThunderboltRender_included \ No newline at end of file diff --git a/src/Include/xrRender/UIRender.h b/src/Include/xrRender/UIRender.h index a636d5fa904..58d8a27dc43 100644 --- a/src/Include/xrRender/UIRender.h +++ b/src/Include/xrRender/UIRender.h @@ -1,5 +1,5 @@ -#ifndef UIRender_included -#define UIRender_included +#ifndef UIRender_included +#define UIRender_included #pragma once class IUIShader; @@ -7,63 +7,63 @@ class IUIShader; class IUIRender { public: - enum ePrimitiveType - { - ptNone = -1, - ptTriList, -// ptTriFan, - ptTriStrip, - ptLineStrip, - ptLineList - }; + enum ePrimitiveType + { + ptNone = -1, + ptTriList, + // ptTriFan, + ptTriStrip, + ptLineStrip, + ptLineList + }; - enum ePointType - { - pttNone = -1, - pttTL, - pttLIT - }; + enum ePointType + { + pttNone = -1, + pttTL, + pttLIT + }; - enum CullMode - { - cmNONE = 0, - cmCW, - cmCCW, - }; + enum CullMode + { + cmNONE = 0, + cmCW, + cmCCW, + }; public: - //virtual ~IUIRender() {;} + // virtual ~IUIRender() {;} - virtual void CreateUIGeom() = 0; - virtual void DestroyUIGeom() = 0; + virtual void CreateUIGeom() = 0; + virtual void DestroyUIGeom() = 0; - virtual void SetShader(IUIShader &shader) = 0; - virtual void SetAlphaRef(int aref) = 0; -//. virtual void StartTriList(u32 iMaxVerts) = 0; -//. virtual void FlushTriList() = 0; -//. virtual void StartTriFan(u32 iMaxVerts) = 0; -//. virtual void FlushTriFan() = 0; - - //virtual void StartTriStrip(u32 iMaxVerts) = 0; - //virtual void FlushTriStrip() = 0; -//. virtual void StartLineStrip(u32 iMaxVerts) = 0; -//. virtual void FlushLineStrip() = 0; -//. virtual void StartLineList(u32 iMaxVerts) = 0; -//. virtual void FlushLineList() = 0; - virtual void SetScissor(Irect* rect=NULL) = 0; - virtual void GetActiveTextureResolution(Fvector2 &res) = 0; + virtual void SetShader(IUIShader& shader) = 0; + virtual void SetAlphaRef(int aref) = 0; + //. virtual void StartTriList(u32 iMaxVerts) = 0; + //. virtual void FlushTriList() = 0; + //. virtual void StartTriFan(u32 iMaxVerts) = 0; + //. virtual void FlushTriFan() = 0; -//. virtual void PushPoint(float x, float y, u32 c, float u, float v) = 0; -//. virtual void PushPoint(int x, int y, u32 c, float u, float v) = 0; - virtual void PushPoint(float x, float y, float z, u32 C, float u, float v) = 0; + // virtual void StartTriStrip(u32 iMaxVerts) = 0; + // virtual void FlushTriStrip() = 0; + //. virtual void StartLineStrip(u32 iMaxVerts) = 0; + //. virtual void FlushLineStrip() = 0; + //. virtual void StartLineList(u32 iMaxVerts) = 0; + //. virtual void FlushLineList() = 0; + virtual void SetScissor(Irect* rect = NULL) = 0; + virtual void GetActiveTextureResolution(Fvector2& res) = 0; - virtual void StartPrimitive(u32 iMaxVerts, ePrimitiveType primType, ePointType pointType) = 0; - virtual void FlushPrimitive() = 0; + //. virtual void PushPoint(float x, float y, u32 c, float u, float v) = 0; + //. virtual void PushPoint(int x, int y, u32 c, float u, float v) = 0; + virtual void PushPoint(float x, float y, float z, u32 C, float u, float v) = 0; - virtual LPCSTR UpdateShaderName(LPCSTR tex_name, LPCSTR sh_name) = 0; + virtual void StartPrimitive(u32 iMaxVerts, ePrimitiveType primType, ePointType pointType) = 0; + virtual void FlushPrimitive() = 0; - virtual void CacheSetXformWorld (const Fmatrix& M) = 0; - virtual void CacheSetCullMode (CullMode) = 0; + virtual LPCSTR UpdateShaderName(LPCSTR tex_name, LPCSTR sh_name) = 0; + + virtual void CacheSetXformWorld(const Fmatrix& M) = 0; + virtual void CacheSetCullMode(CullMode) = 0; }; -#endif // UIRender_included \ No newline at end of file +#endif // UIRender_included \ No newline at end of file diff --git a/src/Include/xrRender/UISequenceVideoItem.h b/src/Include/xrRender/UISequenceVideoItem.h index da3df4be138..917045f83a9 100644 --- a/src/Include/xrRender/UISequenceVideoItem.h +++ b/src/Include/xrRender/UISequenceVideoItem.h @@ -1,20 +1,20 @@ -#ifndef UISequenceVideoItem_included -#define UISequenceVideoItem_included +#ifndef UISequenceVideoItem_included +#define UISequenceVideoItem_included #pragma once class IUISequenceVideoItem { public: - virtual ~IUISequenceVideoItem() {;} - virtual void Copy(IUISequenceVideoItem &_in) = 0; + virtual ~IUISequenceVideoItem() { ; } + virtual void Copy(IUISequenceVideoItem& _in) = 0; - virtual bool HasTexture() = 0; - virtual void CaptureTexture() = 0; - virtual void ResetTexture() = 0; - virtual BOOL video_IsPlaying() = 0; - virtual void video_Sync(u32 _time) = 0; - virtual void video_Play(BOOL looped, u32 _time=0xFFFFFFFF) = 0; - virtual void video_Stop() = 0; + virtual bool HasTexture() = 0; + virtual void CaptureTexture() = 0; + virtual void ResetTexture() = 0; + virtual BOOL video_IsPlaying() = 0; + virtual void video_Sync(u32 _time) = 0; + virtual void video_Play(BOOL looped, u32 _time = 0xFFFFFFFF) = 0; + virtual void video_Stop() = 0; }; -#endif // UISequenceVideoItem_included +#endif // UISequenceVideoItem_included diff --git a/src/Include/xrRender/UIShader.h b/src/Include/xrRender/UIShader.h index d7efbd5ad3e..908e2bab4d9 100644 --- a/src/Include/xrRender/UIShader.h +++ b/src/Include/xrRender/UIShader.h @@ -1,15 +1,15 @@ -#ifndef UIShader_included -#define UIShader_included +#ifndef UIShader_included +#define UIShader_included #pragma once class IUIShader { public: - virtual ~IUIShader() {;} - virtual void Copy(IUIShader &_in) = 0; - virtual void create(LPCSTR sh, LPCSTR tex=0) = 0; - virtual bool inited() = 0; - virtual void destroy() = 0; + virtual ~IUIShader() { ; } + virtual void Copy(IUIShader& _in) = 0; + virtual void create(LPCSTR sh, LPCSTR tex = 0) = 0; + virtual bool inited() = 0; + virtual void destroy() = 0; }; -#endif // UIShader_included \ No newline at end of file +#endif // UIShader_included \ No newline at end of file diff --git a/src/Include/xrRender/WallMarkArray.h b/src/Include/xrRender/WallMarkArray.h index 18c2c05e7a9..5d91df17f46 100644 --- a/src/Include/xrRender/WallMarkArray.h +++ b/src/Include/xrRender/WallMarkArray.h @@ -5,21 +5,21 @@ #include "FactoryPtr.h" #include "UIShader.h" -typedef FactoryPtr wm_shader; +typedef FactoryPtr wm_shader; class IWallMarkArray { public: - virtual ~IWallMarkArray() {;} - virtual void Copy(IWallMarkArray &_in) = 0; + virtual ~IWallMarkArray() { ; } + virtual void Copy(IWallMarkArray& _in) = 0; - virtual void AppendMark(LPCSTR s_textures) = 0; - virtual void clear() = 0; - virtual bool empty() = 0; - // Igor: this function performs unobviouse small memory allocations/ - // deallocations while generation a return value, so prefere - // passing IWallMarkArray directly to renderer. - virtual wm_shader GenerateWallmark() = 0; + virtual void AppendMark(LPCSTR s_textures) = 0; + virtual void clear() = 0; + virtual bool empty() = 0; + // Igor: this function performs unobviouse small memory allocations/ + // deallocations while generation a return value, so prefere + // passing IWallMarkArray directly to renderer. + virtual wm_shader GenerateWallmark() = 0; }; -#endif // WallMarkArray_included \ No newline at end of file +#endif // WallMarkArray_included \ No newline at end of file diff --git a/src/Include/xrRender/animation_blend.h b/src/Include/xrRender/animation_blend.h index be7240fad5e..055cb30eaec 100644 --- a/src/Include/xrRender/animation_blend.h +++ b/src/Include/xrRender/animation_blend.h @@ -1,229 +1,194 @@ #pragma once -#include "animation_motion.h" +#include "animation_motion.h" //*** Run-time Blend definition ******************************************************************* -#ifdef DEBUG -class bnon_copy +#ifdef DEBUG +class bnon_copy { - protected: - bnon_copy(){} + bnon_copy() {} protected: - bnon_copy( const bnon_copy& ){ } + bnon_copy(const bnon_copy&) {} protected: - const bnon_copy& operator=( const bnon_copy& ){ return *this; } + const bnon_copy& operator=(const bnon_copy&) { return *this; } }; #endif -class CBlend +class CBlend { public: - enum ECurvature - { - eFREE_SLOT=0, - // eFixed, - eAccrue, - eFalloff, - eFORCEDWORD = u32(-1) - }; + enum ECurvature + { + eFREE_SLOT = 0, + // eFixed, + eAccrue, + eFalloff, + eFORCEDWORD = u32(-1) + }; + public: - float blendAmount; - float timeCurrent; - float timeTotal; - MotionID motionID; - u16 bone_or_part; // startup parameters - u8 channel; + float blendAmount; + float timeCurrent; + float timeTotal; + MotionID motionID; + u16 bone_or_part; // startup parameters + u8 channel; + private: - ECurvature blend; + ECurvature blend; + public: - float blendAccrue; // increasing - float blendFalloff; // decreasing - float blendPower; - float speed; - - BOOL playing; - BOOL stop_at_end_callback; - BOOL stop_at_end; - BOOL fall_at_end; - PlayCallback Callback; - void* CallbackParam; - - u32 dwFrame; - - u32 mem_usage (){ return sizeof(*this); } -IC bool update_time ( float dt ); -IC void update_play ( float dt, PlayCallback _Callback ); -IC bool update_falloff ( float dt ); -IC bool update ( float dt, PlayCallback _Callback ); -IC ECurvature blend_state ( )const { return blend ;} -IC void set_free_state ( ){ blend = eFREE_SLOT; } -IC void set_accrue_state ( ){ blend = eAccrue; } -IC void set_falloff_state ( ){ blend = eFalloff; } -IC void set ( const CBlend &r ){ *this = r; } -#ifdef DEBUG -CBlend( ): - - blendAmount(0) , - timeCurrent(0) , - timeTotal(0) , - motionID() , - bone_or_part(0) , - channel(0) , - blend(eFREE_SLOT) , - blendAccrue(0) , - blendFalloff(0) , - blendPower(0) , - speed(0) , - playing(0) , - stop_at_end_callback(0) , - stop_at_end(0) , - fall_at_end(0) , - Callback(0) , - CallbackParam(0) , - dwFrame(0) -{ + float blendAccrue; // increasing + float blendFalloff; // decreasing + float blendPower; + float speed; + + BOOL playing; + BOOL stop_at_end_callback; + BOOL stop_at_end; + BOOL fall_at_end; + PlayCallback Callback; + void* CallbackParam; + + u32 dwFrame; + + u32 mem_usage() { return sizeof(*this); } + IC bool update_time(float dt); + IC void update_play(float dt, PlayCallback _Callback); + IC bool update_falloff(float dt); + IC bool update(float dt, PlayCallback _Callback); + IC ECurvature blend_state() const { return blend; } + IC void set_free_state() { blend = eFREE_SLOT; } + IC void set_accrue_state() { blend = eAccrue; } + IC void set_falloff_state() { blend = eFalloff; } + IC void set(const CBlend& r) { *this = r; } +#ifdef DEBUG + CBlend() + : + + blendAmount(0), + timeCurrent(0), timeTotal(0), motionID(), bone_or_part(0), channel(0), blend(eFREE_SLOT), blendAccrue(0), + blendFalloff(0), blendPower(0), speed(0), playing(0), stop_at_end_callback(0), stop_at_end(0), fall_at_end(0), + Callback(0), CallbackParam(0), dwFrame(0) + { + } + + CBlend(const CBlend& r) { *this = r; } + const CBlend& operator=(const CBlend& r) + { + VERIFY(r.blend_state() != eFREE_SLOT); + blendAmount = r.blendAmount; + timeCurrent = r.timeCurrent; + timeTotal = r.timeTotal; + motionID = r.motionID; + bone_or_part = r.bone_or_part; + channel = r.channel; + blend = r.blend; + blendAccrue = r.blendAccrue; + blendFalloff = r.blendFalloff; + blendPower = r.blendPower; + speed = r.speed; + playing = r.playing; + stop_at_end_callback = r.stop_at_end_callback; + stop_at_end = r.stop_at_end; + fall_at_end = r.fall_at_end; + Callback = r.Callback; + CallbackParam = r.CallbackParam; + dwFrame = r.dwFrame; + return *this; + } -} +#endif +}; -CBlend( const CBlend& r ) +IC void CBlend::update_play(float dt, PlayCallback _Callback) { - *this = r; -} + float pow_dt = dt; + if (pow_dt < 0.f) { + pow_dt = 0; + if (stop_at_end) { + VERIFY(blendAccrue > 0.f); + pow_dt = timeCurrent + dt - 1.f / blendAccrue; + clamp(pow_dt, dt, 0.f); + } + } -const CBlend& operator=( const CBlend& r ) -{ - VERIFY( r.blend_state()!=eFREE_SLOT ); - blendAmount = r.blendAmount ; - timeCurrent = r.timeCurrent ; - timeTotal = r.timeTotal ; - motionID = r.motionID ; - bone_or_part = r.bone_or_part ; - channel = r.channel ; - blend = r.blend ; - blendAccrue = r.blendAccrue ; - blendFalloff = r.blendFalloff ; - blendPower = r.blendPower ; - speed = r.speed ; - playing = r.playing ; - stop_at_end_callback= r.stop_at_end_callback; - stop_at_end = r.stop_at_end ; - fall_at_end = r.fall_at_end ; - Callback = r.Callback ; - CallbackParam = r.CallbackParam ; - dwFrame = r.dwFrame ; - return *this; -} + blendAmount += pow_dt * blendAccrue * blendPower; -#endif -}; + clamp(blendAmount, 0.f, blendPower); + if (!update_time(dt)) // reached end + return; + if (_Callback && stop_at_end_callback) _Callback(this); // callback only once -IC void CBlend::update_play( float dt, PlayCallback _Callback ) -{ + stop_at_end_callback = FALSE; - float pow_dt = dt; - if( pow_dt < 0.f ) - { - pow_dt = 0; - if( stop_at_end ) - { - VERIFY( blendAccrue>0.f ); - pow_dt = timeCurrent + dt - 1.f/blendAccrue; - clamp( pow_dt, dt, 0.f ); - } - } - - blendAmount += pow_dt*blendAccrue*blendPower; - - clamp ( blendAmount, 0.f, blendPower); - - - if( !update_time( dt ) )//reached end - return; - - if ( _Callback && stop_at_end_callback ) - _Callback( this ); // callback only once - - stop_at_end_callback = FALSE; - - if( fall_at_end ) - { - blend = eFalloff; - blendFalloff = 2.f; - //blendAccrue = timeCurrent; - } - return ; + if (fall_at_end) { + blend = eFalloff; + blendFalloff = 2.f; + // blendAccrue = timeCurrent; + } + return; } -IC bool CBlend::update_time ( float dt ) +IC bool CBlend::update_time(float dt) { - if (!playing) - return false; - float quant = dt*speed; - timeCurrent += quant; // stop@end - time is not going - - bool running_fwrd = ( quant > 0 ); - float const END_EPS = SAMPLE_SPF+EPS; - bool at_end = running_fwrd && ( timeCurrent > ( timeTotal-END_EPS ) ); - bool at_begin = !running_fwrd && ( timeCurrent < 0.f ); - - if( !stop_at_end ) - { - if( at_begin ) - timeCurrent+= timeTotal; - if( at_end ) - timeCurrent -= ( timeTotal-END_EPS ); - VERIFY( timeCurrent>=0.f ); - return false; - } - if( !at_end && !at_begin ) - return false; - - if( at_end ) - { - timeCurrent = timeTotal-END_EPS; // stop@end - time frozen at the end - if( timeCurrent<0.f ) timeCurrent =0.f; - } - else - timeCurrent = 0.f; - - VERIFY( timeCurrent>=0.f ); - return true; + if (!playing) return false; + float quant = dt * speed; + timeCurrent += quant; // stop@end - time is not going + + bool running_fwrd = (quant > 0); + float const END_EPS = SAMPLE_SPF + EPS; + bool at_end = running_fwrd && (timeCurrent > (timeTotal - END_EPS)); + bool at_begin = !running_fwrd && (timeCurrent < 0.f); + + if (!stop_at_end) { + if (at_begin) timeCurrent += timeTotal; + if (at_end) timeCurrent -= (timeTotal - END_EPS); + VERIFY(timeCurrent >= 0.f); + return false; + } + if (!at_end && !at_begin) return false; + + if (at_end) { + timeCurrent = timeTotal - END_EPS; // stop@end - time frozen at the end + if (timeCurrent < 0.f) timeCurrent = 0.f; + } + else + timeCurrent = 0.f; + + VERIFY(timeCurrent >= 0.f); + return true; } -IC bool CBlend::update_falloff( float dt ) +IC bool CBlend::update_falloff(float dt) { - update_time( dt ); - - //if( dt<0.f || timeCurrent >= blendAccrue ) - blendAmount -= dt*blendFalloff*blendPower; - - bool ret = blendAmount<=0; - clamp ( blendAmount, 0.f, blendPower); - return ret; + update_time(dt); + + // if( dt<0.f || timeCurrent >= blendAccrue ) + blendAmount -= dt * blendFalloff * blendPower; + + bool ret = blendAmount <= 0; + clamp(blendAmount, 0.f, blendPower); + return ret; } -IC bool CBlend::update( float dt, PlayCallback _Callback ) +IC bool CBlend::update(float dt, PlayCallback _Callback) { - switch (blend) - { - case eFREE_SLOT: - NODEFAULT; - case eAccrue: - update_play( dt, _Callback ); - break; - case eFalloff: - if( update_falloff( dt ) ) - return true; - break; - default: - NODEFAULT; - } - return false; + switch (blend) + { + case eFREE_SLOT: NODEFAULT; + case eAccrue: update_play(dt, _Callback); break; + case eFalloff: + if (update_falloff(dt)) return true; + break; + default: NODEFAULT; + } + return false; } class IBlendDestroyCallback { - public: - virtual void BlendDestroy( CBlend& blend ) = 0; +public: + virtual void BlendDestroy(CBlend& blend) = 0; }; \ No newline at end of file diff --git a/src/Include/xrRender/animation_motion.h b/src/Include/xrRender/animation_motion.h index 4ca8c8ab053..3e759371d06 100644 --- a/src/Include/xrRender/animation_motion.h +++ b/src/Include/xrRender/animation_motion.h @@ -1,32 +1,43 @@ #pragma once -struct MotionID { +struct MotionID +{ private: - typedef const MotionID *(MotionID::*unspecified_bool_type) () const; + typedef const MotionID* (MotionID::*unspecified_bool_type)() const; + public: - union{ - struct{ - u16 idx:16; //14 - u16 slot:16; //2 - }; -//. u16 val; - u32 val; - }; + union + { + struct + { + u16 idx : 16; // 14 + u16 slot : 16; // 2 + }; + //. u16 val; + u32 val; + }; + public: - MotionID (){invalidate();} - MotionID (u16 motion_slot, u16 motion_idx){set(motion_slot,motion_idx);} - ICF bool operator== (const MotionID& tgt) const {return tgt.val==val;} - ICF bool operator!= (const MotionID& tgt) const {return tgt.val!=val;} - ICF bool operator< (const MotionID& tgt) const {return val