MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / set_state

Method set_state

src/SB/Game/zDiscoFloor.cpp:784–818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

782}
783
784void z_disco_floor::set_state(size_t state, bool immediate)
785{
786 size_t r; // unused
787 S32 bit_index; // unused
788
789 if (state < min_state)
790 {
791 state = min_state;
792 }
793 else if (state > max_state)
794 {
795 state = max_state;
796 }
797
798 if (immediate)
799 {
800 next_state = state;
801 this->state = state;
802 transition_time = transition_delay;
803
804 translate_mask(next_state_mask, state_masks[next_state], tiles_size);
805 memcpy(active_state_mask, next_state_mask, state_byte_size(asset->state_mask_size));
806 }
807 else
808 {
809 next_state = state;
810 transition_time = 0.0f;
811
812 translate_mask(next_state_mask, state_masks[next_state], tiles_size);
813 }
814
815 state_time = 0.0f;
816
817 refresh_state(*this);
818}
819
820void z_disco_floor::enable()
821{

Callers 1

event_handlerMethod · 0.45

Calls 4

translate_maskFunction · 0.85
memcpyFunction · 0.85
state_byte_sizeFunction · 0.85
refresh_stateFunction · 0.70

Tested by

no test coverage detected