Hi again- sorry about the slow response, thank you very much for the development of your games and publishing so much, we are very happy to publish it of course.
I thought I saw a scaling/rotating example on your site at some point, that was working but slow- did I imagine that? Is it something we could investigate optimizing?
Thanks,
Ben
Scale or rotation uses the DrawSprite of the Screen class.(Screen.cpp/Screen.hpp)
It simply uses sin and cos.
However, I could not think of any way to optimization it.
void Screen::DrawSprite(int destination_x, int destination_y, int destination_left, int destination_top, int destination_right, int destination_bottom, const void* source_buffer, int source_x, int source_y, int source_width, int source_height, int color_key, int rotate, int scale);
int destination_x (destination rectangle center of rotation)
int destination_y (destination rectangle center of rotation)
int destination_left (destination rectangle)
int destination_top (destination rectangle)
int destination_right (destination rectangle)
int destination_bottom (destination rectangle)
const void* source_buffer (draw image data)
int source_x (source image center of rotation)
int source_y (source image center of rotation)
int source_width (source image width)
int source_height (source image height)
int color_key (Transparent color code)
int rotate (0~255)
int scale (2~255=small, 256=same, 257~=big)
(example) line 69 of MainLoop.cpp of TinySTG rewritten as follows.
// Draw logo
screen.DrawSprite(image_data->buffer, 0, 0, image_data->width, image_data->height, 0);
// Rotate logo
screen.DrawSprite(96 / 2, 64 / 2, 0, 0, 95, 63, image_data->buffer, image_data->width / 2, image_data->height / 2, image_data->width, image_data->height, 0, global.count, 256);
// Scale logo
// scale = 2~ (It is bug.I want to 0~.)
screen.DrawSprite(96 / 2, 64 / 2, 0, 0, 95, 63, image_data->buffer, image_data->width / 2, image_data->height / 2, image_data->width, image_data->height, 0, 0, 2 + global.count);