From 9d81fbf917e0d44fcbaa404266cebca1770a431a Mon Sep 17 00:00:00 2001 From: Luna Date: Sun, 6 Jun 2021 13:38:06 +0200 Subject: [PATCH] Auto-version Inochi2D --- .vscode/launch.json | 19 +++++++++++++++++++ dub.sdl | 1 + source/inochi2d/math/camera.d | 3 +++ source/inochi2d/package.d | 1 + source/inochi2d/ver.d | 9 +++++++++ 5 files changed, 33 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 source/inochi2d/ver.d diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..bff6126 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,19 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "(Windows) Launch", + "type": "cppvsdbg", + "request": "launch", + "program": "enter program name, for example ${workspaceFolder}/a.exe", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "console": "externalTerminal" + } + ] +} \ No newline at end of file diff --git a/dub.sdl b/dub.sdl index 059ba2c..1810488 100644 --- a/dub.sdl +++ b/dub.sdl @@ -9,3 +9,4 @@ dependency "bindbc-opengl" version="~>0.13.0" dependency "asdf" version="~>0.7.8" versions "GL_42" "GL_AllowDeprecated" "GL_ARB_gl_spirv" stringImportPaths "shaders/" +preBuildCommands "dub run gitver -- --prefix IN --file source/inochi2d/ver.d --mod inochi2d.ver --appname Inochi2D" \ No newline at end of file diff --git a/source/inochi2d/math/camera.d b/source/inochi2d/math/camera.d index ad84bf9..859f0e7 100644 --- a/source/inochi2d/math/camera.d +++ b/source/inochi2d/math/camera.d @@ -40,6 +40,9 @@ public: inGetViewport(width, height); vec2 realSize = vec2(cast(float)width/scale.x, cast(float)height/scale.y); + if(!position.isFinite) position = vec2(0); + if(!scale.isFinite) scale = vec2(1); + if(!realSize.isFinite) return mat4.identity; return mat4.orthographic(0f, realSize.x, realSize.y, 0, 0, ushort.max) * diff --git a/source/inochi2d/package.d b/source/inochi2d/package.d index 9645843..778091a 100644 --- a/source/inochi2d/package.d +++ b/source/inochi2d/package.d @@ -10,6 +10,7 @@ public import inochi2d.math; public import inochi2d.phys; public import inochi2d.fmt; public import inochi2d.core; +public import inochi2d.ver; private double currentTime_ = 0; private double lastTime_ = 0; diff --git a/source/inochi2d/ver.d b/source/inochi2d/ver.d new file mode 100644 index 0000000..db6e22c --- /dev/null +++ b/source/inochi2d/ver.d @@ -0,0 +1,9 @@ +// AUTOGENERATED BY GITVER, DO NOT MODIFY +module inochi2d.ver; + +/** + Inochi2D Version, autogenerated with gitver +*/ +enum IN_VERSION = "commit+587d095"; + +// trans rights \ No newline at end of file