upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/gameinput_test.cpp
diff options
context:
space:
mode:
authorLeonida local test <local-test@localhost>2026-11-22 18:37:28 +0100
committerLeonida local test <local-test@localhost>2026-11-22 18:37:28 +0100
commitaf330fcce33843c94c2f446986b82f66cef00538 (patch)
treeec00b14386f89ca3d6c00a53ebde3c117556cf99 /runtime/test/gameinput_test.cpp
parenta3b1719c61b4b916964368bf9968e5f822cd50ca (diff)
gameinput: keep only the haptic calls the shim makes in the test seam (RT-160)
HapticApi carried SDL_GetNumHapticAxes and SDL_HapticEffectSupported, which nothing calls: the motor's axes are the shim's choice and the effect kinds are gated on SDL_GetHapticFeatures. They are gone from the table, its SDL implementation and the test's fake, so the seam is exactly the calls a pad's force feedback makes. AI-assisted.
Diffstat (limited to 'runtime/test/gameinput_test.cpp')
-rw-r--r--runtime/test/gameinput_test.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/runtime/test/gameinput_test.cpp b/runtime/test/gameinput_test.cpp
index 106f68fe4..a74c2616d 100644
--- a/runtime/test/gameinput_test.cpp
+++ b/runtime/test/gameinput_test.cpp
@@ -741,9 +741,7 @@ void* fake_open(void*) {
741} 741}
742void fake_close(void*) { ++g_fake.closes; } 742void fake_close(void*) { ++g_fake.closes; }
743uint32_t fake_features(void* h) { return static_cast<FakeHaptic*>(h)->features; } 743uint32_t fake_features(void* h) { return static_cast<FakeHaptic*>(h)->features; }
744int fake_axes(void*) { return 1; }
745int fake_max_effects(void* h) { return static_cast<FakeHaptic*>(h)->max_effects; } 744int fake_max_effects(void* h) { return static_cast<FakeHaptic*>(h)->max_effects; }
746bool fake_supported(void*, const void*) { return true; }
747int fake_create(void* h, const void* e) { 745int fake_create(void* h, const void* e) {
748 FakeHaptic* f = static_cast<FakeHaptic*>(h); 746 FakeHaptic* f = static_cast<FakeHaptic*>(h);
749 ++f->creates; 747 ++f->creates;
@@ -773,9 +771,8 @@ bool fake_gain(void* h, int gain) {
773 f->last_gain = gain; 771 f->last_gain = gain;
774 return true; 772 return true;
775} 773}
776const rt::gameinput::HapticApi kFakeHaptic{fake_open, fake_close, fake_features, fake_axes, fake_max_effects, 774const rt::gameinput::HapticApi kFakeHaptic{fake_open, fake_close, fake_features, fake_max_effects, fake_create,
777 fake_supported, fake_create, fake_update, fake_run, fake_stop, 775 fake_update, fake_run, fake_stop, fake_destroy, fake_gain};
778 fake_destroy, fake_gain};
779 776
780// The motors of one device, and the effect object its force-feedback motor hands out. Runs with no other pad. 777// The motors of one device, and the effect object its force-feedback motor hands out. Runs with no other pad.
781void test_force_feedback(IGameInput* input) { 778void test_force_feedback(IGameInput* input) {