sfml.js 0.0.1-preview.37 → 0.0.1-preview.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -4
- package/binding.gyp +31 -0
- package/lib/color.js +5 -2
- package/lib/image.js +17 -4
- package/lib/keyboard.js +3 -1
- package/lib/rect.js +28 -8
- package/lib/render_window.js +3 -1
- package/lib/texture.d.ts +1 -0
- package/lib/texture.js +19 -0
- package/lib/vector2.js +26 -12
- package/lib/vertex.js +4 -2
- package/lib/video_mode.js +14 -4
- package/package.json +8 -3
- package/src/color.cc +4 -6
- package/src/drawable/package_plugin-inl.h +4 -3
- package/src/drawable/rectangle_shape.cc +3 -2
- package/src/drawable/shape.cc +3 -1
- package/src/drawable/vertex_array.cc +3 -3
- package/src/font.cc +6 -4
- package/src/image.cc +4 -5
- package/src/image.h +1 -1
- package/src/mouse.cc +2 -1
- package/src/plugins/transformable_plugin-inl.h +2 -2
- package/src/rect-inl.h +12 -8
- package/src/rect.h +1 -1
- package/src/render_window.cc +4 -3
- package/src/resizable_buffer.h +17 -2
- package/src/texture.cc +46 -2
- package/src/texture.h +1 -0
- package/src/utils-inl.h +2 -2
- package/src/vector2-inl.h +13 -13
- package/src/vector2.h +3 -3
- package/src/vertex.cc +66 -28
- package/src/vertex.h +2 -2
- package/third_party/sfml/platform/macOS/Frameworks/FLAC.framework/Resources/Info.plist +22 -0
- package/third_party/sfml/platform/macOS/Frameworks/FLAC.framework/Versions/Current/FLAC +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/FLAC.framework/Versions/Current/Resources/Info.plist +22 -0
- package/third_party/sfml/platform/macOS/Frameworks/OpenAL.framework/Resources/Info.plist +22 -0
- package/third_party/sfml/platform/macOS/Frameworks/OpenAL.framework/Versions/Current/OpenAL +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/OpenAL.framework/Versions/Current/Resources/Info.plist +22 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/AlResource.hpp +70 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/Export.hpp +48 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/InputSoundFile.hpp +263 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/Listener.hpp +234 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/Music.hpp +337 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/OutputSoundFile.hpp +133 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/Sound.hpp +264 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundBuffer.hpp +352 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundBufferRecorder.hpp +144 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundFileFactory.hpp +197 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundFileFactory.inl +100 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundFileReader.hpp +165 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundFileWriter.hpp +125 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundRecorder.hpp +408 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundSource.hpp +332 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundStream.hpp +405 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio.hpp +56 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Config.hpp +236 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/GpuPreference.hpp +74 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/BlendMode.hpp +215 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/CircleShape.hpp +154 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Color.hpp +275 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/ConvexShape.hpp +153 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Drawable.hpp +126 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Export.hpp +48 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Font.hpp +439 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Glsl.hpp +227 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Glsl.inl +155 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Glyph.hpp +79 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Image.hpp +324 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/PrimitiveType.hpp +58 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Rect.hpp +254 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Rect.inl +159 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RectangleShape.hpp +132 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RenderStates.hpp +174 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RenderTarget.hpp +510 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RenderTexture.hpp +314 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RenderWindow.hpp +284 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Shader.hpp +875 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Shape.hpp +355 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Sprite.hpp +279 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Text.hpp +513 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Texture.hpp +733 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Transform.hpp +479 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Transformable.hpp +429 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Vertex.hpp +148 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/VertexArray.hpp +223 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/VertexBuffer.hpp +408 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/View.hpp +343 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics.hpp +68 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Main.hpp +43 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Export.hpp +48 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Ftp.hpp +616 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Http.hpp +482 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/IpAddress.hpp +328 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Packet.hpp +532 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Socket.hpp +219 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/SocketHandle.hpp +57 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/SocketSelector.hpp +263 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/TcpListener.hpp +166 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/TcpSocket.hpp +316 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/UdpSocket.hpp +291 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network.hpp +53 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/OpenGL.hpp +78 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Clock.hpp +117 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Err.hpp +80 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Export.hpp +48 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/FileInputStream.hpp +169 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/InputStream.hpp +152 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Lock.hpp +139 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/MemoryInputStream.hpp +148 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Mutex.hpp +148 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/NativeActivity.hpp +62 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/NonCopyable.hpp +129 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Sleep.hpp +52 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/String.hpp +669 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/String.inl +53 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Thread.hpp +282 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Thread.inl +90 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/ThreadLocal.hpp +103 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/ThreadLocalPtr.hpp +158 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/ThreadLocalPtr.inl +77 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Time.hpp +488 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Utf.hpp +763 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Utf.inl +752 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Vector2.hpp +301 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Vector2.inl +161 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Vector3.hpp +302 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Vector3.inl +168 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System.hpp +60 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Clipboard.hpp +119 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Context.hpp +195 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/ContextSettings.hpp +149 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Cursor.hpp +222 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Event.hpp +284 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Export.hpp +48 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/GlResource.hpp +109 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Joystick.hpp +227 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Keyboard.hpp +232 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Mouse.hpp +177 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Sensor.hpp +150 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Touch.hpp +137 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/VideoMode.hpp +228 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Window.hpp +622 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/WindowHandle.hpp +101 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/WindowStyle.hpp +53 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window.hpp +58 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLConfig.cmake +148 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLConfigDependencies.cmake +86 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLConfigVersion.cmake +46 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLSharedTargets-release.cmake +59 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLSharedTargets.cmake +158 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/Info.plist +26 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/AlResource.hpp +70 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/Export.hpp +48 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/InputSoundFile.hpp +263 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/Listener.hpp +234 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/Music.hpp +337 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/OutputSoundFile.hpp +133 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/Sound.hpp +264 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundBuffer.hpp +352 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundBufferRecorder.hpp +144 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundFileFactory.hpp +197 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundFileFactory.inl +100 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundFileReader.hpp +165 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundFileWriter.hpp +125 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundRecorder.hpp +408 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundSource.hpp +332 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundStream.hpp +405 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio.hpp +56 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Config.hpp +236 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/GpuPreference.hpp +74 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/BlendMode.hpp +215 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/CircleShape.hpp +154 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Color.hpp +275 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/ConvexShape.hpp +153 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Drawable.hpp +126 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Export.hpp +48 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Font.hpp +439 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Glsl.hpp +227 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Glsl.inl +155 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Glyph.hpp +79 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Image.hpp +324 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/PrimitiveType.hpp +58 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Rect.hpp +254 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Rect.inl +159 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RectangleShape.hpp +132 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RenderStates.hpp +174 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RenderTarget.hpp +510 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RenderTexture.hpp +314 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RenderWindow.hpp +284 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Shader.hpp +875 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Shape.hpp +355 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Sprite.hpp +279 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Text.hpp +513 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Texture.hpp +733 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Transform.hpp +479 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Transformable.hpp +429 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Vertex.hpp +148 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/VertexArray.hpp +223 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/VertexBuffer.hpp +408 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/View.hpp +343 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics.hpp +68 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Main.hpp +43 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Export.hpp +48 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Ftp.hpp +616 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Http.hpp +482 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/IpAddress.hpp +328 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Packet.hpp +532 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Socket.hpp +219 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/SocketHandle.hpp +57 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/SocketSelector.hpp +263 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/TcpListener.hpp +166 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/TcpSocket.hpp +316 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/UdpSocket.hpp +291 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network.hpp +53 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/OpenGL.hpp +78 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Clock.hpp +117 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Err.hpp +80 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Export.hpp +48 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/FileInputStream.hpp +169 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/InputStream.hpp +152 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Lock.hpp +139 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/MemoryInputStream.hpp +148 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Mutex.hpp +148 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/NativeActivity.hpp +62 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/NonCopyable.hpp +129 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Sleep.hpp +52 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/String.hpp +669 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/String.inl +53 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Thread.hpp +282 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Thread.inl +90 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/ThreadLocal.hpp +103 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/ThreadLocalPtr.hpp +158 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/ThreadLocalPtr.inl +77 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Time.hpp +488 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Utf.hpp +763 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Utf.inl +752 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Vector2.hpp +301 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Vector2.inl +161 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Vector3.hpp +302 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Vector3.inl +168 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System.hpp +60 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Clipboard.hpp +119 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Context.hpp +195 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/ContextSettings.hpp +149 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Cursor.hpp +222 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Event.hpp +284 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Export.hpp +48 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/GlResource.hpp +109 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Joystick.hpp +227 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Keyboard.hpp +232 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Mouse.hpp +177 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Sensor.hpp +150 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Touch.hpp +137 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/VideoMode.hpp +228 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Window.hpp +622 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/WindowHandle.hpp +101 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/WindowStyle.hpp +53 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window.hpp +58 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLConfig.cmake +148 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLConfigDependencies.cmake +86 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLConfigVersion.cmake +46 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLSharedTargets-release.cmake +59 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLSharedTargets.cmake +158 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/Info.plist +26 -0
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/SFML +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/freetype.framework/Resources/Info.plist +22 -0
- package/third_party/sfml/platform/macOS/Frameworks/freetype.framework/Versions/Current/Resources/Info.plist +22 -0
- package/third_party/sfml/platform/macOS/Frameworks/freetype.framework/Versions/Current/freetype +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/ogg.framework/Resources/Info.plist +22 -0
- package/third_party/sfml/platform/macOS/Frameworks/ogg.framework/Versions/Current/Resources/Info.plist +22 -0
- package/third_party/sfml/platform/macOS/Frameworks/ogg.framework/Versions/Current/ogg +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-audio.framework/Resources/Info.plist +26 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-audio.framework/Versions/Current/Resources/Info.plist +26 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-audio.framework/Versions/Current/sfml-audio +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-graphics.framework/Resources/Info.plist +26 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-graphics.framework/Versions/Current/Resources/Info.plist +26 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-graphics.framework/Versions/Current/sfml-graphics +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-network.framework/Resources/Info.plist +26 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-network.framework/Versions/Current/Resources/Info.plist +26 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-network.framework/Versions/Current/sfml-network +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-system.framework/Resources/Info.plist +26 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-system.framework/Versions/Current/Resources/Info.plist +26 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-system.framework/Versions/Current/sfml-system +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-window.framework/Resources/Info.plist +26 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-window.framework/Versions/Current/Resources/Info.plist +26 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-window.framework/Versions/Current/sfml-window +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/vorbis.framework/Resources/Info.plist +22 -0
- package/third_party/sfml/platform/macOS/Frameworks/vorbis.framework/Versions/Current/Resources/Info.plist +22 -0
- package/third_party/sfml/platform/macOS/Frameworks/vorbis.framework/Versions/Current/vorbis +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/vorbisenc.framework/Resources/Info.plist +22 -0
- package/third_party/sfml/platform/macOS/Frameworks/vorbisenc.framework/Versions/Current/Resources/Info.plist +22 -0
- package/third_party/sfml/platform/macOS/Frameworks/vorbisenc.framework/Versions/Current/vorbisenc +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/vorbisfile.framework/Resources/Info.plist +22 -0
- package/third_party/sfml/platform/macOS/Frameworks/vorbisfile.framework/Versions/Current/Resources/Info.plist +22 -0
- package/third_party/sfml/platform/macOS/Frameworks/vorbisfile.framework/Versions/Current/vorbisfile +0 -0
- package/third_party/sfml/platform/win64/bin/openal32.dll +0 -0
- package/third_party/sfml/platform/win64/bin/sfml-audio-2.dll +0 -0
- package/third_party/sfml/platform/win64/bin/sfml-graphics-2.dll +0 -0
- package/third_party/sfml/platform/win64/bin/sfml-network-2.dll +0 -0
- package/third_party/sfml/platform/win64/bin/sfml-system-2.dll +0 -0
- package/third_party/sfml/platform/win64/bin/sfml-window-2.dll +0 -0
- package/third_party/sfml/platform/win64/lib/flac.lib +0 -0
- package/third_party/sfml/platform/win64/lib/freetype.lib +0 -0
- package/third_party/sfml/platform/win64/lib/ogg.lib +0 -0
- package/third_party/sfml/platform/win64/lib/openal32.lib +0 -0
- package/third_party/sfml/platform/win64/lib/sfml-audio.lib +0 -0
- package/third_party/sfml/platform/win64/lib/sfml-graphics.lib +0 -0
- package/third_party/sfml/platform/win64/lib/sfml-main.lib +0 -0
- package/third_party/sfml/platform/win64/lib/sfml-network.lib +0 -0
- package/third_party/sfml/platform/win64/lib/sfml-system.lib +0 -0
- package/third_party/sfml/platform/win64/lib/sfml-window.lib +0 -0
- package/third_party/sfml/platform/win64/lib/vorbis.lib +0 -0
- package/third_party/sfml/platform/win64/lib/vorbisenc.lib +0 -0
- package/third_party/sfml/platform/win64/lib/vorbisfile.lib +0 -0
- package/tools/keycode.js +31 -20
- package/tools/mouse_button.js +52 -35
- package/tools/symlinks.js +15 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
SFML's Node.js binding.
|
|
5
|
+
A cross-platform SFML's Node.js binding.
|
|
6
6
|
|
|
7
7
|
> Under developing.
|
|
8
8
|
|
|
@@ -10,6 +10,4 @@ SFML's Node.js binding.
|
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
$ node-gyp rebuild
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
> Current only support Linux and macOS.
|
|
13
|
+
```
|
package/binding.gyp
CHANGED
|
@@ -57,6 +57,37 @@
|
|
|
57
57
|
"../third_party/sfml/platform/linux/lib/libsfml-graphics.so"
|
|
58
58
|
]
|
|
59
59
|
}],
|
|
60
|
+
["OS==\"win\"", {
|
|
61
|
+
"defines": [
|
|
62
|
+
"NOMINMAX"
|
|
63
|
+
],
|
|
64
|
+
"copies": [{
|
|
65
|
+
"destination": "<(module_root_dir)/build/Release/",
|
|
66
|
+
"files": [
|
|
67
|
+
"<(module_root_dir)/third_party/sfml/platform/win64/bin/openal32.dll",
|
|
68
|
+
"<(module_root_dir)/third_party/sfml/platform/win64/bin/sfml-audio-2.dll",
|
|
69
|
+
"<(module_root_dir)/third_party/sfml/platform/win64/bin/sfml-graphics-2.dll",
|
|
70
|
+
"<(module_root_dir)/third_party/sfml/platform/win64/bin/sfml-network-2.dll",
|
|
71
|
+
"<(module_root_dir)/third_party/sfml/platform/win64/bin/sfml-system-2.dll",
|
|
72
|
+
"<(module_root_dir)/third_party/sfml/platform/win64/bin/sfml-window-2.dll"
|
|
73
|
+
]
|
|
74
|
+
}],
|
|
75
|
+
"libraries": [
|
|
76
|
+
"../third_party/sfml/platform/win64/lib/flac.lib",
|
|
77
|
+
"../third_party/sfml/platform/win64/lib/freetype.lib",
|
|
78
|
+
"../third_party/sfml/platform/win64/lib/ogg.lib",
|
|
79
|
+
"../third_party/sfml/platform/win64/lib/openal32.lib",
|
|
80
|
+
"../third_party/sfml/platform/win64/lib/sfml-audio.lib",
|
|
81
|
+
"../third_party/sfml/platform/win64/lib/sfml-graphics.lib",
|
|
82
|
+
"../third_party/sfml/platform/win64/lib/sfml-main.lib",
|
|
83
|
+
"../third_party/sfml/platform/win64/lib/sfml-network.lib",
|
|
84
|
+
"../third_party/sfml/platform/win64/lib/sfml-system.lib",
|
|
85
|
+
"../third_party/sfml/platform/win64/lib/sfml-window.lib",
|
|
86
|
+
"../third_party/sfml/platform/win64/lib/vorbis.lib",
|
|
87
|
+
"../third_party/sfml/platform/win64/lib/vorbisenc.lib",
|
|
88
|
+
"../third_party/sfml/platform/win64/lib/vorbisfile.lib",
|
|
89
|
+
],
|
|
90
|
+
}],
|
|
60
91
|
["OS==\"mac\"", {
|
|
61
92
|
"libraries": [
|
|
62
93
|
"../third_party/sfml/platform/macOS/lib/libsfml-audio.dylib",
|
package/lib/color.js
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
const util = require('util');
|
|
4
4
|
|
|
5
|
-
const {
|
|
5
|
+
const {
|
|
6
|
+
Color: _Color,
|
|
7
|
+
setRealColorConstructor,
|
|
8
|
+
} = require('../build/Release/binding.node');
|
|
6
9
|
const { validateTypeOf } = require('./common');
|
|
7
10
|
|
|
8
11
|
const TO_INTEGER = Symbol('Color::toInteger');
|
|
@@ -90,6 +93,6 @@ class Color extends _Color {
|
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
95
|
|
|
93
|
-
setRealColorConstructor(Color);
|
|
96
|
+
setRealColorConstructor((...args) => new Color(...args));
|
|
94
97
|
|
|
95
98
|
module.exports = { Color };
|
package/lib/image.js
CHANGED
|
@@ -13,7 +13,11 @@ class Image extends _Image {
|
|
|
13
13
|
validateTypeOf(src, 'src', _Image);
|
|
14
14
|
validateTypeOf(destX, 'destX', 'number');
|
|
15
15
|
validateTypeOf(destY, 'destY', 'number');
|
|
16
|
-
validateTypeOf(
|
|
16
|
+
validateTypeOf(
|
|
17
|
+
sourceRect,
|
|
18
|
+
'sourceRectOrApplyAlpha',
|
|
19
|
+
[ 'boolean', IntRect ],
|
|
20
|
+
true);
|
|
17
21
|
validateTypeOf(applyAlpha, 'applyAlpha', 'boolean', true);
|
|
18
22
|
|
|
19
23
|
if (sourceRect === undefined && applyAlpha === undefined) {
|
|
@@ -30,7 +34,14 @@ class Image extends _Image {
|
|
|
30
34
|
create(width, height, colorOrPixels) {
|
|
31
35
|
validateTypeOf(width, 'width', 'number');
|
|
32
36
|
validateTypeOf(height, 'height', 'number');
|
|
33
|
-
validateTypeOf(colorOrPixels, 'colorOrPixels', [
|
|
37
|
+
validateTypeOf(colorOrPixels, 'colorOrPixels', [
|
|
38
|
+
Color,
|
|
39
|
+
Buffer,
|
|
40
|
+
Array,
|
|
41
|
+
ArrayBuffer,
|
|
42
|
+
Uint8Array,
|
|
43
|
+
'number',
|
|
44
|
+
]);
|
|
34
45
|
|
|
35
46
|
if (typeof colorOrPixels === 'number') {
|
|
36
47
|
colorOrPixels = new Color(colorOrPixels);
|
|
@@ -122,13 +133,15 @@ class Image extends _Image {
|
|
|
122
133
|
});
|
|
123
134
|
|
|
124
135
|
if (err) {
|
|
125
|
-
process.nextTick(() => {
|
|
136
|
+
process.nextTick(() => {
|
|
137
|
+
reject(err);
|
|
138
|
+
});
|
|
126
139
|
}
|
|
127
140
|
|
|
128
141
|
return promise;
|
|
129
142
|
}
|
|
130
143
|
}
|
|
131
144
|
|
|
132
|
-
Image.setRealConstructor(Image);
|
|
145
|
+
Image.setRealConstructor((...args) => new Image(...args));
|
|
133
146
|
|
|
134
147
|
module.exports = { Image };
|
package/lib/keyboard.js
CHANGED
|
@@ -6,7 +6,9 @@ const {
|
|
|
6
6
|
Keys,
|
|
7
7
|
} = require('../build/Release/binding.node');
|
|
8
8
|
|
|
9
|
-
exports.setVirtualKeyboardVisible = function setVirtualKeyboardVisible(
|
|
9
|
+
exports.setVirtualKeyboardVisible = function setVirtualKeyboardVisible(
|
|
10
|
+
visible
|
|
11
|
+
) {
|
|
10
12
|
_setVirtualKeyboardVisible(!!visible);
|
|
11
13
|
};
|
|
12
14
|
|
package/lib/rect.js
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
const util = require('util');
|
|
4
4
|
|
|
5
|
-
const {
|
|
5
|
+
const {
|
|
6
|
+
FloatRect: _FloatRect,
|
|
7
|
+
IntRect: _IntRect,
|
|
8
|
+
} = require('../build/Release/binding.node');
|
|
6
9
|
const { validateTypeOf } = require('./common');
|
|
7
10
|
const { Vector2F, Vector2I } = require('./vector2');
|
|
8
11
|
|
|
@@ -15,7 +18,12 @@ function createClass(name, BaseClz, Vector) {
|
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
toJSON() {
|
|
18
|
-
return {
|
|
21
|
+
return {
|
|
22
|
+
left: this.left,
|
|
23
|
+
top: this.top,
|
|
24
|
+
width: this.width,
|
|
25
|
+
height: this.height,
|
|
26
|
+
};
|
|
19
27
|
}
|
|
20
28
|
|
|
21
29
|
constructor(leftOrPosition, topOrSize, width, height) {
|
|
@@ -42,25 +50,37 @@ function createClass(name, BaseClz, Vector) {
|
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
52
|
|
|
45
|
-
get top() {
|
|
53
|
+
get top() {
|
|
54
|
+
return super.top;
|
|
55
|
+
}
|
|
56
|
+
|
|
46
57
|
set top(val) {
|
|
47
58
|
validateTypeOf(val, 'top', 'number');
|
|
48
59
|
super.top = val;
|
|
49
60
|
}
|
|
50
61
|
|
|
51
|
-
get left() {
|
|
62
|
+
get left() {
|
|
63
|
+
return super.left;
|
|
64
|
+
}
|
|
65
|
+
|
|
52
66
|
set left(val) {
|
|
53
67
|
validateTypeOf(val, 'left', 'number');
|
|
54
68
|
super.left = val;
|
|
55
69
|
}
|
|
56
70
|
|
|
57
|
-
get width() {
|
|
71
|
+
get width() {
|
|
72
|
+
return super.width;
|
|
73
|
+
}
|
|
74
|
+
|
|
58
75
|
set width(val) {
|
|
59
76
|
validateTypeOf(val, 'width', 'number');
|
|
60
77
|
super.width = val;
|
|
61
78
|
}
|
|
62
79
|
|
|
63
|
-
get height() {
|
|
80
|
+
get height() {
|
|
81
|
+
return super.height;
|
|
82
|
+
}
|
|
83
|
+
|
|
64
84
|
set height(val) {
|
|
65
85
|
validateTypeOf(val, 'height', 'number');
|
|
66
86
|
super.height = val;
|
|
@@ -91,9 +111,9 @@ function createClass(name, BaseClz, Vector) {
|
|
|
91
111
|
}
|
|
92
112
|
|
|
93
113
|
const IntRect = createClass('IntRect', _IntRect, Vector2I);
|
|
94
|
-
_IntRect.setRealConstructor(IntRect);
|
|
114
|
+
_IntRect.setRealConstructor((...args) => new IntRect(...args));
|
|
95
115
|
|
|
96
116
|
const FloatRect = createClass('FloatRect', _FloatRect, Vector2F);
|
|
97
|
-
_FloatRect.setRealConstructor(FloatRect);
|
|
117
|
+
_FloatRect.setRealConstructor((...args) => new FloatRect(...args));
|
|
98
118
|
|
|
99
119
|
module.exports = { FloatRect, IntRect };
|
package/lib/render_window.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
const { Color } = require('./color');
|
|
4
4
|
const { Drawable } = require('./drawable/drawable');
|
|
5
|
-
const {
|
|
5
|
+
const {
|
|
6
|
+
RenderWindow: _RenderWindow,
|
|
7
|
+
} = require('../build/Release/binding.node');
|
|
6
8
|
const { validateTypeOf } = require('./common');
|
|
7
9
|
const { VideoMode } = require('./video_mode');
|
|
8
10
|
|
package/lib/texture.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export class Texture {
|
|
|
14
14
|
update(texture: Texture, x: number, y: number): void;
|
|
15
15
|
update(image: Image): void;
|
|
16
16
|
update(image: Image, x: number, y: number): void;
|
|
17
|
+
update(buffer: Buffer, width?: number, height?: number, x?: number, y?: number): void;
|
|
17
18
|
|
|
18
19
|
getSize(): Vector2F;
|
|
19
20
|
setSmooth(smooth?: boolean): void;
|
package/lib/texture.js
CHANGED
|
@@ -62,6 +62,16 @@ class Texture extends _Texture {
|
|
|
62
62
|
this.updateByImage(arguments[0], arguments[1], arguments[2]);
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
+
|
|
66
|
+
if (arguments.length >= 1 && Buffer.isBuffer(arguments[0])) {
|
|
67
|
+
this.updateByPixels(
|
|
68
|
+
arguments[0],
|
|
69
|
+
arguments[1],
|
|
70
|
+
arguments[2],
|
|
71
|
+
arguments[3],
|
|
72
|
+
arguments[4]);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
65
75
|
}
|
|
66
76
|
|
|
67
77
|
updateByImage(image, x, y) {
|
|
@@ -100,6 +110,15 @@ class Texture extends _Texture {
|
|
|
100
110
|
super.updateByTexture(texture, x, y);
|
|
101
111
|
}
|
|
102
112
|
|
|
113
|
+
updateByPixels(buffer, width, height, x, y) {
|
|
114
|
+
validateTypeOf(buffer, 'buffer', Buffer);
|
|
115
|
+
validateTypeOf(width, 'width', 'number', true);
|
|
116
|
+
validateTypeOf(height, 'height', 'number', true);
|
|
117
|
+
validateTypeOf(x, 'x', 'number', true);
|
|
118
|
+
validateTypeOf(y, 'y', 'number', true);
|
|
119
|
+
super.updateByPixels(buffer, width, height, x, y);
|
|
120
|
+
}
|
|
121
|
+
|
|
103
122
|
setSmooth(smooth = true) {
|
|
104
123
|
super.setSmooth(!!smooth);
|
|
105
124
|
}
|
package/lib/vector2.js
CHANGED
|
@@ -43,14 +43,20 @@ function createClass(name, BaseClz, checkRange, formatBaseValue = v => v) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
get x() {
|
|
46
|
+
get x() {
|
|
47
|
+
return super.x;
|
|
48
|
+
}
|
|
49
|
+
|
|
47
50
|
set x(val) {
|
|
48
51
|
validateTypeOf(val, 'x', 'number');
|
|
49
52
|
checkRange(val);
|
|
50
53
|
super.x = formatBaseValue(val);
|
|
51
54
|
}
|
|
52
55
|
|
|
53
|
-
get y() {
|
|
56
|
+
get y() {
|
|
57
|
+
return super.y;
|
|
58
|
+
}
|
|
59
|
+
|
|
54
60
|
set y(val) {
|
|
55
61
|
validateTypeOf(val, 'y', 'number');
|
|
56
62
|
checkRange(val);
|
|
@@ -111,17 +117,25 @@ function createClass(name, BaseClz, checkRange, formatBaseValue = v => v) {
|
|
|
111
117
|
};
|
|
112
118
|
}
|
|
113
119
|
|
|
114
|
-
const Vector2I = createClass(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
const Vector2I = createClass(
|
|
121
|
+
'Vector2I',
|
|
122
|
+
_Vector2I,
|
|
123
|
+
() => true,
|
|
124
|
+
v => parseInt(v));
|
|
125
|
+
_Vector2I.setRealConstructor((...args) => new Vector2I(...args));
|
|
126
|
+
|
|
127
|
+
const Vector2U = createClass(
|
|
128
|
+
'Vector2U',
|
|
129
|
+
_Vector2U,
|
|
130
|
+
v => {
|
|
131
|
+
if (v < 0) {
|
|
132
|
+
throw new Error('Value should greater than or equal to 0.');
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
v => parseInt(v));
|
|
136
|
+
_Vector2U.setRealConstructor((...args) => new Vector2U(...args));
|
|
123
137
|
|
|
124
138
|
const Vector2F = createClass('Vector2F', _Vector2F, () => true);
|
|
125
|
-
_Vector2F.setRealConstructor(Vector2F);
|
|
139
|
+
_Vector2F.setRealConstructor((...args) => new Vector2F(...args));
|
|
126
140
|
|
|
127
141
|
module.exports = { Vector2I, Vector2U, Vector2F };
|
package/lib/vertex.js
CHANGED
|
@@ -67,7 +67,9 @@ class Vertex extends _Vertex {
|
|
|
67
67
|
|
|
68
68
|
[UNINJECT](object, properties) {
|
|
69
69
|
for (const property of properties) {
|
|
70
|
-
const origDesc = Object.getOwnPropertyDescriptor(
|
|
70
|
+
const origDesc = Object.getOwnPropertyDescriptor(
|
|
71
|
+
object,
|
|
72
|
+
`orig$$${property}`);
|
|
71
73
|
origDesc.enumerable = true;
|
|
72
74
|
Object.defineProperty(object, property, origDesc);
|
|
73
75
|
delete object[`orig$$${property}`];
|
|
@@ -170,6 +172,6 @@ class Vertex extends _Vertex {
|
|
|
170
172
|
}
|
|
171
173
|
}
|
|
172
174
|
|
|
173
|
-
_Vertex.setRealConstructor(Vertex);
|
|
175
|
+
_Vertex.setRealConstructor((...args) => new Vertex(...args));
|
|
174
176
|
|
|
175
177
|
module.exports = { Vertex };
|
package/lib/video_mode.js
CHANGED
|
@@ -25,7 +25,11 @@ class VideoMode {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
toJSON() {
|
|
28
|
-
return {
|
|
28
|
+
return {
|
|
29
|
+
width: this.width,
|
|
30
|
+
height: this.height,
|
|
31
|
+
bitsPerPixel: this.bitsPerPixel,
|
|
32
|
+
};
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
constructor(modeWidth, modeHeight, modeBitsPerPixel) {
|
|
@@ -42,13 +46,19 @@ class VideoMode {
|
|
|
42
46
|
this[RAW_VIDEO_MODE] = new _VideoMode();
|
|
43
47
|
return;
|
|
44
48
|
} else if (modeHeight === undefined) {
|
|
45
|
-
throw new Error(
|
|
49
|
+
throw new Error(
|
|
50
|
+
'modeHeight cannot be undefined while modeWidth is not undefined.');
|
|
46
51
|
}
|
|
47
52
|
|
|
48
53
|
if (modeBitsPerPixel === undefined) {
|
|
49
|
-
this[RAW_VIDEO_MODE] = new _VideoMode(
|
|
54
|
+
this[RAW_VIDEO_MODE] = new _VideoMode(
|
|
55
|
+
parseInt(modeWidth),
|
|
56
|
+
parseInt(modeHeight));
|
|
50
57
|
} else {
|
|
51
|
-
this[RAW_VIDEO_MODE] = new _VideoMode(
|
|
58
|
+
this[RAW_VIDEO_MODE] = new _VideoMode(
|
|
59
|
+
parseInt(modeWidth),
|
|
60
|
+
parseInt(modeHeight),
|
|
61
|
+
parseInt(modeBitsPerPixel));
|
|
52
62
|
}
|
|
53
63
|
}
|
|
54
64
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sfml.js",
|
|
3
|
-
"version": "0.0.1-preview.
|
|
3
|
+
"version": "0.0.1-preview.40",
|
|
4
4
|
"description": "SFML's Node.js binding.",
|
|
5
5
|
"main": "lib/sfml.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"clang-format": "./tools/clang_format.js --style=file -i ./src/*.cc ./src/*.h ./src/drawable/*.cc ./src/drawable/*.h ./src/sound/*.cc ./src/sound/*.h ./src/workers/*.h",
|
|
10
10
|
"preinstall": "node tools/symlinks.js",
|
|
11
11
|
"cpplint": "./third_party/cpplint/cpplint.py src/**/*",
|
|
12
|
-
"jslint": "eslint
|
|
12
|
+
"jslint": "./node_modules/.bin/eslint ./**/*.js",
|
|
13
13
|
"install": "node-gyp rebuild"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
@@ -29,9 +29,12 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^16.11.6",
|
|
32
|
-
"eslint": "^
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
|
33
|
+
"eslint": "^7.0.0",
|
|
33
34
|
"eslint-config-egg": "^9.0.0",
|
|
34
35
|
"eslint-plugin-import": "^2.25.2",
|
|
36
|
+
"eslint-plugin-jsdoc": "^37.0.3",
|
|
37
|
+
"eslint-plugin-node": "^11.1.0",
|
|
35
38
|
"typescript": "~4.0.0"
|
|
36
39
|
},
|
|
37
40
|
"files": [
|
|
@@ -51,6 +54,8 @@
|
|
|
51
54
|
"third_party/sfml/platform/macOS/lib/libsfml-network.2.5.1.dylib",
|
|
52
55
|
"third_party/sfml/platform/macOS/lib/libsfml-graphics.2.5.1.dylib",
|
|
53
56
|
"third_party/sfml/platform/macOS/Frameworks/**/*",
|
|
57
|
+
"third_party/sfml/platform/win64/lib/*.lib",
|
|
58
|
+
"third_party/sfml/platform/win64/bin/*.dll",
|
|
54
59
|
"tools/*",
|
|
55
60
|
"tsconfig.json"
|
|
56
61
|
]
|
package/src/color.cc
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
namespace node_sfml {
|
|
4
4
|
namespace color {
|
|
5
5
|
|
|
6
|
-
using v8::Context;
|
|
7
6
|
using v8::EscapableHandleScope;
|
|
8
7
|
using v8::Function;
|
|
9
8
|
using v8::FunctionTemplate;
|
|
@@ -28,18 +27,17 @@ MaybeLocal<Object> Color::NewRealColorInstance(Isolate* isolate,
|
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
Local<Function> func = real_constructor.Get(isolate);
|
|
31
|
-
Local<Context> context = isolate->GetCurrentContext();
|
|
32
30
|
Local<Value> argv[] = {Nan::New(val)};
|
|
33
31
|
|
|
34
32
|
Nan::TryCatch try_catch;
|
|
35
|
-
|
|
33
|
+
MaybeLocal<Value> maybe = Nan::Call(func, func, 1, argv);
|
|
36
34
|
if (try_catch.HasCaught()) {
|
|
37
35
|
try_catch.ReThrow();
|
|
38
36
|
Local<Object> empty;
|
|
39
37
|
return scope.Escape(empty);
|
|
40
38
|
}
|
|
41
39
|
|
|
42
|
-
return scope.Escape(
|
|
40
|
+
return scope.Escape(maybe.ToLocalChecked().As<Object>());
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
NAN_METHOD(SetRealColorConstructor) {
|
|
@@ -151,7 +149,7 @@ NAN_METHOD(Color::ToInteger) {
|
|
|
151
149
|
|
|
152
150
|
#define V(name, lowercase) \
|
|
153
151
|
NAN_METHOD(Color::name##Getter) { \
|
|
154
|
-
Color* color = Nan::ObjectWrap::Unwrap<Color>(info.
|
|
152
|
+
Color* color = Nan::ObjectWrap::Unwrap<Color>(info.This()); \
|
|
155
153
|
info.GetReturnValue().Set(color->_color->lowercase); \
|
|
156
154
|
} \
|
|
157
155
|
\
|
|
@@ -167,7 +165,7 @@ NAN_METHOD(Color::ToInteger) {
|
|
|
167
165
|
return; \
|
|
168
166
|
} \
|
|
169
167
|
\
|
|
170
|
-
Color* color = Nan::ObjectWrap::Unwrap<Color>(info.
|
|
168
|
+
Color* color = Nan::ObjectWrap::Unwrap<Color>(info.This()); \
|
|
171
169
|
color->_color->lowercase = val; \
|
|
172
170
|
}
|
|
173
171
|
|
|
@@ -59,7 +59,7 @@ inline static NAN_METHOD(GetTextureRect) {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
Nan::TryCatch try_catch;
|
|
62
|
-
v8::MaybeLocal<v8::
|
|
62
|
+
v8::MaybeLocal<v8::Value> maybe_rect =
|
|
63
63
|
rect::IntRect::NewRealInstance(info.GetIsolate(), argc, argv);
|
|
64
64
|
if (maybe_rect.IsEmpty()) {
|
|
65
65
|
try_catch.ReThrow();
|
|
@@ -88,14 +88,15 @@ inline void SetPrototype(v8::Local<v8::FunctionTemplate>* _tpl) {
|
|
|
88
88
|
sf::FloatRect rect = drawable->raw<T>().get##type##Bounds(); \
|
|
89
89
|
\
|
|
90
90
|
Nan::TryCatch try_catch; \
|
|
91
|
-
v8::MaybeLocal<v8::
|
|
91
|
+
v8::MaybeLocal<v8::Value> maybe_rect = \
|
|
92
92
|
rect::FloatRect::NewRealInstance(info.GetIsolate()); \
|
|
93
93
|
if (try_catch.HasCaught()) { \
|
|
94
94
|
try_catch.ReThrow(); \
|
|
95
95
|
return; \
|
|
96
96
|
} \
|
|
97
97
|
\
|
|
98
|
-
v8::Local<v8::Object> node_rect =
|
|
98
|
+
v8::Local<v8::Object> node_rect = \
|
|
99
|
+
maybe_rect.ToLocalChecked().As<v8::Object>(); \
|
|
99
100
|
sf::FloatRect& ret = \
|
|
100
101
|
Nan::ObjectWrap::Unwrap<rect::FloatRect>(node_rect)->rect(); \
|
|
101
102
|
ret.top = rect.top; \
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#include <SFML/Graphics/RectangleShape.hpp>
|
|
2
2
|
|
|
3
|
-
#include "../vector2.h"
|
|
3
|
+
#include "../vector2-inl.h"
|
|
4
4
|
#include "drawable-inl.h"
|
|
5
5
|
#include "rectangle_shape.h"
|
|
6
6
|
|
|
@@ -11,6 +11,7 @@ using v8::FunctionTemplate;
|
|
|
11
11
|
using v8::Local;
|
|
12
12
|
using v8::MaybeLocal;
|
|
13
13
|
using v8::Object;
|
|
14
|
+
using v8::Value;
|
|
14
15
|
|
|
15
16
|
const char rectangle_shape_name[] = "RectangleShape";
|
|
16
17
|
|
|
@@ -42,7 +43,7 @@ NAN_METHOD(RectangleShape::GetSize) {
|
|
|
42
43
|
sf::Vector2f vec = shape->raw<sf::RectangleShape>().getSize();
|
|
43
44
|
|
|
44
45
|
Nan::TryCatch try_catch;
|
|
45
|
-
MaybeLocal<
|
|
46
|
+
MaybeLocal<Value> maybe_vec =
|
|
46
47
|
vector2::Vector2F::NewRealInstance(info.GetIsolate(), vec);
|
|
47
48
|
if (maybe_vec.IsEmpty()) {
|
|
48
49
|
try_catch.ReThrow();
|
package/src/drawable/shape.cc
CHANGED
|
@@ -9,7 +9,9 @@ namespace node_sfml {
|
|
|
9
9
|
namespace drawable {
|
|
10
10
|
|
|
11
11
|
using v8::Local;
|
|
12
|
+
using v8::MaybeLocal;
|
|
12
13
|
using v8::Object;
|
|
14
|
+
using v8::Value;
|
|
13
15
|
|
|
14
16
|
void Shape::SetPrototype(v8::Local<v8::FunctionTemplate>* _tpl) {
|
|
15
17
|
v8::Local<v8::FunctionTemplate>& tpl = *_tpl;
|
|
@@ -41,7 +43,7 @@ NAN_METHOD(Shape::GetPoint) {
|
|
|
41
43
|
sf::Vector2f point = raw.getPoint(Nan::To<sf::Uint32>(info[0]).FromJust());
|
|
42
44
|
|
|
43
45
|
Nan::TryCatch try_catch;
|
|
44
|
-
|
|
46
|
+
MaybeLocal<Value> maybe_vec =
|
|
45
47
|
vector2::Vector2F::NewRealInstance(info.GetIsolate(), point);
|
|
46
48
|
if (maybe_vec.IsEmpty()) {
|
|
47
49
|
try_catch.ReThrow();
|
|
@@ -127,14 +127,14 @@ NAN_METHOD(VertexArray::GetBounds) {
|
|
|
127
127
|
sf::FloatRect rect = va->raw<sf::VertexArray>().getBounds();
|
|
128
128
|
|
|
129
129
|
Nan::TryCatch try_catch;
|
|
130
|
-
v8::MaybeLocal<v8::
|
|
130
|
+
v8::MaybeLocal<v8::Value> maybe_rect =
|
|
131
131
|
rect::FloatRect::NewRealInstance(info.GetIsolate());
|
|
132
132
|
if (try_catch.HasCaught()) {
|
|
133
133
|
try_catch.ReThrow();
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
v8::Local<v8::Object> node_rect = maybe_rect.ToLocalChecked();
|
|
137
|
+
v8::Local<v8::Object> node_rect = maybe_rect.ToLocalChecked().As<Object>();
|
|
138
138
|
sf::FloatRect& ret =
|
|
139
139
|
Nan::ObjectWrap::Unwrap<rect::FloatRect>(node_rect)->rect();
|
|
140
140
|
ret.top = rect.top;
|
|
@@ -167,7 +167,7 @@ NAN_METHOD(VertexArray::DuplicateVertex) {
|
|
|
167
167
|
const sf::Vertex& vertex = raw[idx];
|
|
168
168
|
|
|
169
169
|
Nan::TryCatch try_catch;
|
|
170
|
-
MaybeLocal<
|
|
170
|
+
MaybeLocal<Value> maybe_ret =
|
|
171
171
|
vertex::Vertex::NewRealInstance(info.GetIsolate(), vertex);
|
|
172
172
|
if (maybe_ret.IsEmpty()) {
|
|
173
173
|
try_catch.ReThrow();
|
package/src/font.cc
CHANGED
|
@@ -122,13 +122,14 @@ NAN_METHOD(Font::GetGlyph) {
|
|
|
122
122
|
Nan::New<Number>(static_cast<double>(glyph.advance)));
|
|
123
123
|
|
|
124
124
|
Nan::TryCatch try_catch;
|
|
125
|
-
MaybeLocal<
|
|
125
|
+
MaybeLocal<Value> maybe_float_rect_object =
|
|
126
126
|
rect::FloatRect::NewRealInstance(info.GetIsolate());
|
|
127
127
|
if (maybe_float_rect_object.IsEmpty()) {
|
|
128
128
|
try_catch.ReThrow();
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
Local<Object> float_rect_object =
|
|
131
|
+
Local<Object> float_rect_object =
|
|
132
|
+
maybe_float_rect_object.ToLocalChecked().As<Object>();
|
|
132
133
|
rect::FloatRect* float_rect =
|
|
133
134
|
Nan::ObjectWrap::Unwrap<rect::FloatRect>(float_rect_object);
|
|
134
135
|
sf::FloatRect& float_rect_inner = float_rect->rect();
|
|
@@ -138,13 +139,14 @@ NAN_METHOD(Font::GetGlyph) {
|
|
|
138
139
|
float_rect_inner.height = glyph.bounds.height;
|
|
139
140
|
Nan::Set(ret, Nan::New<String>("bounds").ToLocalChecked(), float_rect_object);
|
|
140
141
|
|
|
141
|
-
MaybeLocal<
|
|
142
|
+
MaybeLocal<Value> maybe_int_rect_object =
|
|
142
143
|
rect::IntRect::NewRealInstance(info.GetIsolate());
|
|
143
144
|
if (maybe_int_rect_object.IsEmpty()) {
|
|
144
145
|
try_catch.ReThrow();
|
|
145
146
|
return;
|
|
146
147
|
}
|
|
147
|
-
Local<Object> int_rect_object =
|
|
148
|
+
Local<Object> int_rect_object =
|
|
149
|
+
maybe_int_rect_object.ToLocalChecked().As<Object>();
|
|
148
150
|
rect::IntRect* int_rect =
|
|
149
151
|
Nan::ObjectWrap::Unwrap<rect::IntRect>(int_rect_object);
|
|
150
152
|
sf::IntRect& int_rect_inner = int_rect->rect();
|
package/src/image.cc
CHANGED
|
@@ -26,10 +26,9 @@ NAN_METHOD(SetRealConstructor) {
|
|
|
26
26
|
real_constructor.Reset(info[0].As<v8::Function>());
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
MaybeLocal<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
cons->NewInstance(isolate->GetCurrentContext());
|
|
29
|
+
MaybeLocal<Value> Image::NewRealInstance(Isolate* isolate) {
|
|
30
|
+
Local<Function> cons = real_constructor.Get(isolate);
|
|
31
|
+
MaybeLocal<Value> maybe_ret = Nan::Call(cons, cons, 0, nullptr);
|
|
33
32
|
return maybe_ret;
|
|
34
33
|
}
|
|
35
34
|
|
|
@@ -160,7 +159,7 @@ NAN_METHOD(Image::GetSize) {
|
|
|
160
159
|
sf::Vector2u size = image->_image.getSize();
|
|
161
160
|
|
|
162
161
|
Nan::TryCatch try_catch;
|
|
163
|
-
MaybeLocal<
|
|
162
|
+
MaybeLocal<Value> size_obj =
|
|
164
163
|
vector2::Vector2<sf::Uint32, sf::Uint32, v8::Uint32>::NewRealInstance(
|
|
165
164
|
info.GetIsolate(), size);
|
|
166
165
|
if (size_obj.IsEmpty()) {
|
package/src/image.h
CHANGED
|
@@ -15,7 +15,7 @@ namespace image {
|
|
|
15
15
|
class Image : public Nan::ObjectWrap, public BaseClassWithLoading {
|
|
16
16
|
public:
|
|
17
17
|
static NAN_MODULE_INIT(Init);
|
|
18
|
-
static v8::MaybeLocal<v8::
|
|
18
|
+
static v8::MaybeLocal<v8::Value> NewRealInstance(v8::Isolate* isolate);
|
|
19
19
|
|
|
20
20
|
public:
|
|
21
21
|
static NAN_METHOD(New);
|
package/src/mouse.cc
CHANGED
|
@@ -15,6 +15,7 @@ using v8::Local;
|
|
|
15
15
|
using v8::MaybeLocal;
|
|
16
16
|
using v8::Object;
|
|
17
17
|
using v8::String;
|
|
18
|
+
using v8::Value;
|
|
18
19
|
|
|
19
20
|
NAN_MODULE_INIT(Init) {
|
|
20
21
|
gen::InitMouseButton();
|
|
@@ -65,7 +66,7 @@ NAN_METHOD(GetPosition) {
|
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
Nan::TryCatch try_catch;
|
|
68
|
-
MaybeLocal<
|
|
69
|
+
MaybeLocal<Value> ret =
|
|
69
70
|
vector2::Vector2I::NewRealInstance(info.GetIsolate(), pos);
|
|
70
71
|
if (ret.IsEmpty()) {
|
|
71
72
|
try_catch.ReThrow();
|