1
0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2024-11-22 10:42:38 +01:00

control: reduced component indirection.

cheats: hidden test with tab, FT style.
This commit is contained in:
Muzychenko Andrey 2022-02-10 16:29:31 +03:00
parent a626572da3
commit b20e13ee97
2 changed files with 1580 additions and 1354 deletions

File diff suppressed because it is too large Load Diff

View File

@ -26,9 +26,8 @@ struct component_tag : component_tag_base
static_assert(std::is_base_of<TPinballComponent, T>::value, "T must inherit from TPinballComponent"); static_assert(std::is_base_of<TPinballComponent, T>::value, "T must inherit from TPinballComponent");
T* Component; T* Component;
component_tag(LPCSTR name, TPinballComponent* component): component_tag_base(name), Component(nullptr) component_tag(LPCSTR name) : component_tag_base(name), Component(nullptr)
{ {
component_tag::SetComponent(component);
} }
TPinballComponent* GetComponent() override TPinballComponent* GetComponent() override
@ -54,7 +53,7 @@ struct component_control
struct component_info struct component_info
{ {
component_tag_base* Tag; component_tag_base& Tag;
component_control Control; component_control Control;
}; };
@ -72,7 +71,7 @@ public:
static void make_links(TPinballTable* table); static void make_links(TPinballTable* table);
static void ClearLinks(); static void ClearLinks();
static TPinballComponent* make_component_link(component_tag_base* tag); static TPinballComponent* make_component_link(component_tag_base& tag);
static void handler(int code, TPinballComponent* cmp); static void handler(int code, TPinballComponent* cmp);
static void pbctrl_bdoor_controller(char key); static void pbctrl_bdoor_controller(char key);
static void table_add_extra_ball(float count); static void table_add_extra_ball(float count);