- Image: expose newImageData(newImageDataFromFile)/newEmptyImageData/isCompressed and a full ImageData script class (getWidth/Height/Format/Size, pixel get/set, paste, clone, rotate). ImageData is now registered once by the Image module; drop the duplicate minimal registrations in Font and Model3D that could overwrite each other. - Joystick: expose getJoystick/getJoystickFromID/getIndex/addJoystick/removeJoystick and a Pad class with raw axes/buttons/hats, GameController axis/button names, device info, and vibration. Pads stay owned by the module (non-owning script handles). - Mouse: expose setRelativeMode/getRelativeMode plus setVisible/setPosition/setX/setY/ setGrabbed/isGrabbed (SDL backend already implemented them). - Tests: add image.nut/image_script.cpp and joystick.nut/joystick_script.cpp script tests, extend mouse.nut with relative-mode/visibility checks, wire into test CMake and the nut embed template. - Docs: update image/joystick/mouse user chapters, MODULES.md and the REVIEW log.
17 lines
403 B
C++
17 lines
403 B
C++
#include "ScriptTest.h"
|
|
|
|
extern const char* image_content;
|
|
UnitSciptTest(ImageScript, image_content);
|
|
|
|
#define TestScript(func) \
|
|
TEST_CASE_FIXTURE(ImageScript, "ImageScript." #func) { \
|
|
CHECK(vm.callFunc(vm.findFunc(#func), vm).toBool()); \
|
|
}
|
|
|
|
TestScript(basic)
|
|
TestScript(imageDataClass)
|
|
TestScript(newImageData)
|
|
TestScript(pixelRoundTrip)
|
|
TestScript(cloneAndRotate)
|
|
TestScript(paste)
|