minor fixes
This commit is contained in:
parent
46e919609c
commit
24655f8de5
|
|
@ -18,6 +18,7 @@
|
||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
|
|
||||||
|
#include <kiwano/renderer/win32/helper.h> // DX::ThrowIfFailed
|
||||||
#include <kiwano-audio/audio-modules.h>
|
#include <kiwano-audio/audio-modules.h>
|
||||||
#include <kiwano-audio/AudioEngine.h>
|
#include <kiwano-audio/AudioEngine.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ namespace kiwano
|
||||||
Window::instance().SetCursor(CursorType::Hand);
|
Window::instance().SetCursor(CursorType::Hand);
|
||||||
|
|
||||||
if (mouse_over_callback_)
|
if (mouse_over_callback_)
|
||||||
mouse_over_callback_();
|
mouse_over_callback_(this);
|
||||||
}
|
}
|
||||||
else if (evt.IsType<MouseOutEvent>())
|
else if (evt.IsType<MouseOutEvent>())
|
||||||
{
|
{
|
||||||
|
|
@ -121,24 +121,24 @@ namespace kiwano
|
||||||
Window::instance().SetCursor(CursorType::Arrow);
|
Window::instance().SetCursor(CursorType::Arrow);
|
||||||
|
|
||||||
if (mouse_out_callback_)
|
if (mouse_out_callback_)
|
||||||
mouse_out_callback_();
|
mouse_out_callback_(this);
|
||||||
}
|
}
|
||||||
else if (evt.IsType<MouseDownEvent>() && status_ == Status::Hover)
|
else if (evt.IsType<MouseDownEvent>() && status_ == Status::Hover)
|
||||||
{
|
{
|
||||||
SetStatus(Status::Pressed);
|
SetStatus(Status::Pressed);
|
||||||
|
|
||||||
if (pressed_callback_)
|
if (pressed_callback_)
|
||||||
pressed_callback_();
|
pressed_callback_(this);
|
||||||
}
|
}
|
||||||
else if (evt.IsType<MouseUpEvent>() && status_ == Status::Pressed)
|
else if (evt.IsType<MouseUpEvent>() && status_ == Status::Pressed)
|
||||||
{
|
{
|
||||||
SetStatus(Status::Hover);
|
SetStatus(Status::Hover);
|
||||||
|
|
||||||
if (released_callback_)
|
if (released_callback_)
|
||||||
released_callback_();
|
released_callback_(this);
|
||||||
|
|
||||||
if (click_callback_)
|
if (click_callback_)
|
||||||
click_callback_();
|
click_callback_(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -240,6 +240,7 @@ namespace kiwano
|
||||||
AddObject(id, fs);
|
AddObject(id, fs);
|
||||||
return fs->GetFramesCount();
|
return fs->GetFramesCount();
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t ResourceCache::AddFrameSequence(String const& id, FramePtr frame, int cols, int rows, float padding_x, float padding_y)
|
size_t ResourceCache::AddFrameSequence(String const& id, FramePtr frame, int cols, int rows, float padding_x, float padding_y)
|
||||||
|
|
@ -386,7 +387,11 @@ namespace kiwano
|
||||||
if (rows || cols)
|
if (rows || cols)
|
||||||
{
|
{
|
||||||
// Frame slices
|
// Frame slices
|
||||||
return !!loader->AddFrameSequence(*id, gdata->path + (*file), std::max(cols, 1), std::max(rows, 1), padding_x, padding_y);
|
FramePtr frame = new (std::nothrow) Frame;
|
||||||
|
if (frame && frame->Load(gdata->path + (*file)))
|
||||||
|
{
|
||||||
|
return !!loader->AddFrameSequence(*id, frame, std::max(cols, 1), std::max(rows, 1), padding_x, padding_y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue