summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_function.cpp
diff options
context:
space:
mode:
authormelquiadess <31paths@gmail.com>2024-03-28 13:34:04 +0000
committermelquiadess <31paths@gmail.com>2024-04-04 14:17:28 +0100
commitf09d0331562a91d930170109d849a7bd0ea3e1b3 (patch)
tree4851371ac380fa230c73b8ef2d0512577fd86f8e /modules/gdscript/gdscript_function.cpp
parent7a42afbba050822a66ea5b4c620f6db1b98c49af (diff)
downloadredot-engine-f09d0331562a91d930170109d849a7bd0ea3e1b3.tar.gz
Improve performance by extracting windowManager and getRotatedValues()
Once sensor listeners are registered, onSensorChanged() (and subsequently getRotatedValues()) gets called multiple times per socond. Obtaining WindowManager on each of those calls is superfluous and can be avoided by extracting it to a lazy class val. getRotatedValue() can also be called before checking sensor type, and used for each one of them, resulting in less code repetition.
Diffstat (limited to 'modules/gdscript/gdscript_function.cpp')
0 files changed, 0 insertions, 0 deletions