mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-09-03 00:00:00 +02:00
Compare commits
5
Commits
f1c7f8ab27
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed160ed63d | ||
|
|
ff1a0bb4cb | ||
|
|
bd7cd52c4f | ||
|
|
d276899e8b | ||
|
|
42f0d52bfa |
@@ -171,7 +171,7 @@ MLX_API void mlx_set_image_region(mlx_context mlx, mlx_image image, int x, int y
|
|||||||
* @param scale_y Scale y of the image
|
* @param scale_y Scale y of the image
|
||||||
* @param angle Rotation angle of the image (clockwise)
|
* @param angle Rotation angle of the image (clockwise)
|
||||||
*/
|
*/
|
||||||
MLX_API void mlx_put_transformed_image_to_window(mlx_context mlx, mlx_window win, mlx_image image, int x, int y, float scale_x, float scale_y, float angle);
|
MLX_API void mlx_put_transformed_image_to_window(mlx_context mlx, mlx_window win, mlx_image image, float x, float y, float scale_x, float scale_y, float angle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get direct pointers to hidden functions
|
* @brief Get direct pointers to hidden functions
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace mlx
|
|||||||
void PixelPutArray(int x, int y, mlx_color* color, std::size_t pixels_size) noexcept;
|
void PixelPutArray(int x, int y, mlx_color* color, std::size_t pixels_size) noexcept;
|
||||||
void PixelPutRegion(int x, int y, int w, int h, mlx_color* color) noexcept;
|
void PixelPutRegion(int x, int y, int w, int h, mlx_color* color) noexcept;
|
||||||
void StringPut(int x, int y, mlx_color color, std::string str);
|
void StringPut(int x, int y, mlx_color color, std::string str);
|
||||||
void TexturePut(NonOwningPtr<class Texture> texture, int x, int y, float scale_x, float scale_y, float angle);
|
void TexturePut(NonOwningPtr<class Texture> texture, float x, float y, float scale_x, float scale_y, float angle);
|
||||||
|
|
||||||
inline void TryEraseSpritesInScene(NonOwningPtr<Texture> texture) noexcept;
|
inline void TryEraseSpritesInScene(NonOwningPtr<Texture> texture) noexcept;
|
||||||
|
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ extern "C"
|
|||||||
texture->SetRegion(x, y, w, h, pixels);
|
texture->SetRegion(x, y, w, h, pixels);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mlx_put_transformed_image_to_window(mlx_context mlx, mlx_window win, mlx_image image, int x, int y, float scale_x, float scale_y, float angle)
|
void mlx_put_transformed_image_to_window(mlx_context mlx, mlx_window win, mlx_image image, float x, float y, float scale_x, float scale_y, float angle)
|
||||||
{
|
{
|
||||||
MLX_CHECK_APPLICATION_POINTER(mlx);
|
MLX_CHECK_APPLICATION_POINTER(mlx);
|
||||||
mlx::NonOwningPtr<mlx::GraphicsSupport> gs = mlx->app->GetGraphicsSupport(win);
|
mlx::NonOwningPtr<mlx::GraphicsSupport> gs = mlx->app->GetGraphicsSupport(win);
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ namespace mlx
|
|||||||
p_scene->BringToDrawLayer(text.Get(), m_draw_layer);
|
p_scene->BringToDrawLayer(text.Get(), m_draw_layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsSupport::TexturePut(NonOwningPtr<Texture> texture, int x, int y, float scale_x, float scale_y, float angle)
|
void GraphicsSupport::TexturePut(NonOwningPtr<Texture> texture, float x, float y, float scale_x, float scale_y, float angle)
|
||||||
{
|
{
|
||||||
MLX_PROFILE_FUNCTION();
|
MLX_PROFILE_FUNCTION();
|
||||||
NonOwningPtr<Sprite> sprite = p_scene->GetSpriteFromTexturePositionScaleRotation(texture, Vec2f{ static_cast<float>(x), static_cast<float>(y) }, scale_x, scale_y, angle);
|
NonOwningPtr<Sprite> sprite = p_scene->GetSpriteFromTexturePositionScaleRotation(texture, Vec2f{ static_cast<float>(x), static_cast<float>(y) }, scale_x, scale_y, angle);
|
||||||
@@ -146,14 +146,14 @@ namespace mlx
|
|||||||
{
|
{
|
||||||
m_draw_layer++;
|
m_draw_layer++;
|
||||||
m_pixelput_called = false;
|
m_pixelput_called = false;
|
||||||
}
|
}
|
||||||
Sprite& new_sprite = p_scene->CreateSprite(texture);
|
Sprite& new_sprite = p_scene->CreateSprite(texture);
|
||||||
new_sprite.SetCenter(Vec2f{ texture->GetWidth() * 0.5f, texture->GetHeight() * 0.5f });
|
new_sprite.SetCenter(Vec2f{ texture->GetWidth() * 0.5f, texture->GetHeight() * 0.5f });
|
||||||
new_sprite.SetPosition(Vec2f{ static_cast<float>(x), static_cast<float>(y) });
|
new_sprite.SetPosition(Vec2f{ static_cast<float>(x), static_cast<float>(y) });
|
||||||
new_sprite.SetScale(Vec2f{ scale_x, scale_y });
|
new_sprite.SetScale(Vec2f{ scale_x, scale_y });
|
||||||
new_sprite.SetRotation(angle);
|
new_sprite.SetRotation(angle);
|
||||||
}
|
}
|
||||||
else if(!p_scene->IsTextureAtGivenDrawLayer(texture, m_draw_layer))
|
else if(!p_scene->IsTextureAtGivenDrawLayer(texture, m_draw_layer))
|
||||||
p_scene->BringToDrawLayer(sprite.Get(), m_draw_layer);
|
p_scene->BringToDrawLayer(sprite.Get(), m_draw_layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ namespace mlx
|
|||||||
SDL_DestroyWindow(infos->window);
|
SDL_DestroyWindow(infos->window);
|
||||||
if(infos->icon != nullptr)
|
if(infos->icon != nullptr)
|
||||||
{
|
{
|
||||||
delete[] (mlx_color*)infos->icon->pixels;
|
delete[] reinterpret_cast<mlx_color*>(infos->icon->pixels);
|
||||||
SDL_FreeSurface(infos->icon);
|
SDL_FreeSurface(infos->icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ namespace mlx
|
|||||||
Internal::WindowInfos* infos = static_cast<Internal::WindowInfos*>(window);
|
Internal::WindowInfos* infos = static_cast<Internal::WindowInfos*>(window);
|
||||||
if(infos->icon != nullptr)
|
if(infos->icon != nullptr)
|
||||||
{
|
{
|
||||||
delete[] (mlx_color*)infos->icon->pixels;
|
delete[] reinterpret_cast<mlx_color*>(infos->icon->pixels);
|
||||||
SDL_FreeSurface(infos->icon);
|
SDL_FreeSurface(infos->icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user