Browse Source

Rename (joystick) sensor callbacks to past tense.

Miku AuahDark 2 years ago
parent
commit
64d79eed18
3 changed files with 10 additions and 10 deletions
  1. 3 3
      changes.txt
  2. 2 2
      src/modules/event/sdl/Event.cpp
  3. 5 5
      src/modules/love/callbacks.lua

+ 3 - 3
changes.txt

@@ -66,8 +66,8 @@ Released: N/A
 * Added new 'clampone' wrap mode.
 * Added a variant of Font:getWidth which takes a codepoint number argument.
 * Added love.sensor module.
-* Added love.sensorupdate callback.
-* Added love.joysticksensorupdate callback.
+* Added love.sensorupdated callback.
+* Added love.joysticksensorupdated callback.
 
 * Changed the default font from Vera size 12 to Noto Sans size 13.
 * Changed the Texture class and implementation to no longer have separate Canvas and Image subclasses.
@@ -82,7 +82,7 @@ Released: N/A
 * Changed love.filesystem.exists to no longer be deprecated.
 * Changed RevoluteJoint:getMotorTorque to take 'dt' as a parameter instead of 'inverse_dt'.
 * Changed love.math.perlinNoise and simplexNoise to use higher precision numbers for its internal calculations.
-* Changed t.accelerometerjoystick startup flag in love.conf to nil by default.
+* Changed t.accelerometerjoystick startup flag in love.conf to unset by default.
 
 * Renamed 'display' field to 'displayindex' in love.window.setMode/updateMode/getMode and love.conf.
 

+ 2 - 2
src/modules/event/sdl/Event.cpp

@@ -471,7 +471,7 @@ Message *Event::convert(const SDL_Event &e)
 					vargs.emplace_back(e.sensor.data[0]);
 					vargs.emplace_back(e.sensor.data[1]);
 					vargs.emplace_back(e.sensor.data[2]);
-					msg = new Message("sensorupdate", vargs);
+					msg = new Message("sensorupdated", vargs);
 
 					break;
 				}
@@ -612,7 +612,7 @@ Message *Event::convertJoystickEvent(const SDL_Event &e) const
 			vargs.emplace_back(e.csensor.data[0]);
 			vargs.emplace_back(e.csensor.data[1]);
 			vargs.emplace_back(e.csensor.data[2]);
-			msg = new Message("joysticksensorupdate", vargs);
+			msg = new Message("joysticksensorupdated", vargs);
 		}
 		break;
 #endif

+ 5 - 5
src/modules/love/callbacks.lua

@@ -88,9 +88,9 @@ function love.createhandlers()
 		joystickremoved = function (j)
 			if love.joystickremoved then return love.joystickremoved(j) end
 		end,
-		joysticksensorupdate = function (j, sensorType, x, y, z)
-			if love.joysticksensorupdate then return love.joysticksensorupdate(j, sensorType, x, y, z) end
-		end
+		joysticksensorupdated = function (j, sensorType, x, y, z)
+			if love.joysticksensorupdated then return love.joysticksensorupdated(j, sensorType, x, y, z) end
+		end,
 		focus = function (f)
 			if love.focus then return love.focus(f) end
 		end,
@@ -137,8 +137,8 @@ function love.createhandlers()
 				love.audio.setPlaybackDevice()
 			end
 		end,
-		sensorupdate = function (sensorType, x, y, z)
-			if love.sensorupdate then return love.sensorupdate(sensorType, x, y, z) end
+		sensorupdated = function (sensorType, x, y, z)
+			if love.sensorupdated then return love.sensorupdated(sensorType, x, y, z) end
 		end,
 	}, {
 		__index = function(self, name)