Releases: BithreenGirlen/DxLibSpineViewer
Releases · BithreenGirlen/DxLibSpineViewer
v0.3.4
Runtime changes
- Use DxLib's matrix for scaling and translation in order to adjust view for Spine older than
3.6
where there is no built-in scaler. - Allow adding drawables later to render multiple files which are not in the same directory.
- Rename a few functions.
Viewer changes
- Add a menu item
Image-> Add effect
to add Spine as an effect.- Of course, the effect is required to have the same animation name and appropriate timelines.
Effect demonstration
Add.effect.mp4
v0.3.3
Runtime changes
- Split default size and scale calculation in C++ player as C does.
Viewer changes
Main window
- Prevent the view-point from moving if animation speed had been changed.
- Fix letting window have resizable style unintentionally.
- Remove resizable style once video recording has been started.
- Avoid applying resizable style to borlderless window when moving folder.
- Add options related to window.
- Make manual window sizing optional.
- Revive option to toggle view-point behaviour to prioritise animation speed change.
v0.3.2
Runtime change
- Fix access violation which happens when the slot about to be replaced has no attachment.
Viewer change
Spine setting dialogue
- Be able to leave format specification to the application.
- Those skeleton files which contain
.skel
,.bin
, and.bytes
in extension are regarded as binary. - To manually specify the format, select from drop-down list.
- Those skeleton files which contain
Main window
- Always move view while dragging
- Option to move view between discrete points is deleted.
v0.3.1
Viewer changes
Main window
- Allow manual resizing of window when spine is loaded.
- Mouse wheel without combinating Ctrl would again fit the window to skeleton size.
- Add missing view adjustment after successful loading.
Spine setting dialogue
- Be able to move focus with tab key.
- Specify the dialogue position when to create it.
v0.3
Runtime changes
- Separate resizing window or back-buffer process from spine player.
- These are now proccessed in main window.
- Remove Win32API usage in spine player.
- The size of screen or rendering target are now obtained through DxLib's functions.
- Enhance efficiency of manipulation in the spine player.
- Avoid copy where possible.
- Remove range check inside loop.
- Acceess skeletonData through drawable instead of directly accessing those which the spine player owns once skeleton is created.
Now dxlib_spine_player
can be used with DxLib's built-in window.
Below is simpler (compared to the viewer) code using Spine runtime for DxLib.
Example code
#include "dxlib_init.h"
#include "dxlib_spine_player_c.h"
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
SDxLibInit sDxLibInit;
if (sDxLibInit.iDxLibInitialised == -1)return 0;
const char* szAtlasPath = R"(data\spineboy\export\spineboy.atlas)";
const char* szSkelPath = R"(data\spineboy\export\spineboy-ess.json)";
CDxLibSpinePlayerC sSpinePlayer;
std::vector<std::string> atlasPaths(1, szAtlasPath);
std::vector<std::string> skelPaths(1, szSkelPath);
bool bRet = sSpinePlayer.SetSpineFromFile(atlasPaths, skelPaths, false);
if (!bRet)return 0;
std::pair<int, int> iDisplaySize;
DxLib::GetDisplayMaxResolution(&iDisplaySize.first, &iDisplaySize.second);
DxLib::SetGraphMode(iDisplaySize.first * 10 / 16, iDisplaySize.second * 10 / 16, 32);
float fDelta = 1 / static_cast<float>(DxLib::GetRefreshRate());
int keyboardState[256]{};
std::pair<int, int> iMouseStartPos;
int iForeMouseState = 0;
while (DxLib::ProcessMessage() != -1)
{
DxLib::GetHitKeyStateAllEx(keyboardState);
if (keyboardState[KEY_INPUT_ESCAPE] == -1)
{
break;
}
else if (keyboardState[KEY_INPUT_A] == -1)
{
sSpinePlayer.SwitchPma();
}
int iCurrentMouseState = DxLib::GetMouseInput();
if ((iCurrentMouseState & MOUSE_INPUT_LEFT) && !(iForeMouseState & MOUSE_INPUT_LEFT))
{
DxLib::GetMousePoint(&iMouseStartPos.first, &iMouseStartPos.second);
}
else if (!(iCurrentMouseState & MOUSE_INPUT_LEFT) && (iForeMouseState & MOUSE_INPUT_LEFT))
{
std::pair<int, int> iMouseEndPos;
DxLib::GetMousePoint(&iMouseEndPos.first, &iMouseEndPos.second);
int iX = iMouseStartPos.first - iMouseEndPos.first;
int iY = iMouseStartPos.second - iMouseEndPos.second;
if (iX == 0 && iY == 0)
{
sSpinePlayer.ShiftAnimation();
}
else
{
sSpinePlayer.MoveViewPoint(iX, iY);
}
}
else if (!(iCurrentMouseState & MOUSE_INPUT_MIDDLE) && (iForeMouseState & MOUSE_INPUT_MIDDLE))
{
sSpinePlayer.ResetScale();
}
iForeMouseState = iCurrentMouseState;
DxLib::ClearDrawScreen();
sSpinePlayer.Redraw(fDelta);
DxLib::ScreenFlip();
}
return 0;
}
Viewer changes
- Prevent window resizing when spine is not yet loaded.
- Enlarge manipulation dialogue for all the list-views to be equal size.
- This dialogue can be manually resized once client area is double-clicked.
v0.2.6
- Fix access violation in searching slot to re-attach.
- Simplify the way to find file with specific extensions.
- Prevent opening file-select-dialogue under recording.
v0.2.5
- Subdivide menu to separate functions related to window behaviour.
- Add a feature to change attachment.
- The feature is available only when there are slots associated with multiple attachments.
- Even if it is possible to change attachment, it depends on timelines whether it is appropriate or not.
- One of the purpose of this feature is to make appear the attachment which is associated with atlas region, but is used nowhere.
- As said, it is allowed to change the attachment with that which is used in another animation. But in this case, it is not guaranteed to work well because of the difference of timelines.
- Below is an example to replace attachment with those of another animation.
- The feature is available only when there are slots associated with multiple attachments.
example
Re-attachment.mp4
v0.2.4
- Add context menu items to snap screen as
JPG
, and to record screen intoH264
.- The video recording is available only for Intel CPU for the time being because
Ryzen 5800U
failed to encode video withMicrosoft Media Foundation
.
- The video recording is available only for Intel CPU for the time being because
v0.2.3
- Write GIF metadata properly.
- Previously, frame metadata were written along with global metadata that the header had been duplicated.
- Allow manipulation dialogue to be resized if necessary.
- Left-double-click on client area enables resizing through dragging the window edges.
- The calculation for listview width is also corrected.
- Tidy up DxLib setup.
- Put Windows specific functions properly into macro block.
- Disable device reset regardless of window mode.
v0.2.2
- Set locale to UTF8 and get rid of conversion to ANSI code-page.
- Previously, filepath was converted to ANSI code-page because Spine's default extension uses
fopen()
. But this causes loading failure if the filepath contains characters which cannot be represented by system's ANSI code-page. - UTF8 in Universal C Runtime has been supported since Windows 10 build-version 17134.
- Previously, filepath was converted to ANSI code-page because Spine's default extension uses
- Be able to zoom without resizing window.
Ctrl
+ mouse wheel scales skeleton only.- When window is about to be resized, its size will be fitted to the largest slot again.