various small C++ warning fixes

This commit is contained in:
Noel Berry
2021-05-06 21:48:06 -07:00
parent fb91b77900
commit 04f6257b75
20 changed files with 87 additions and 89 deletions

View File

@ -11,9 +11,7 @@
using namespace Blah;
Aseprite::Aseprite()
{
}
= default;
Aseprite::Aseprite(const FilePath& path)
{
@ -77,9 +75,7 @@ Aseprite& Aseprite::operator=(Aseprite&& src) noexcept
}
Aseprite::~Aseprite()
{
}
= default;
void Aseprite::parse(Stream& stream)
{

View File

@ -233,7 +233,7 @@ bool Font::get_image(const Font::Character& ch, Color* pixels) const
{
// we actually use the image buffer as our temporary buffer, and fill the pixels out backwards after
// kinda weird but it works & saves creating more memory
unsigned char* src = (unsigned char*)pixels;
auto* src = (unsigned char*)pixels;
stbtt_MakeGlyphBitmap((stbtt_fontinfo*)m_font, src, ch.width, ch.height, ch.width, ch.scale, ch.scale, ch.glyph);
int len = ch.width * ch.height;

View File

@ -96,6 +96,8 @@ Image::Image(const Image& src)
Image& Image::operator=(const Image& src)
{
dispose();
width = src.width;
height = src.height;
m_stbi_ownership = src.m_stbi_ownership;
@ -269,7 +271,7 @@ bool Image::save_jpg(Stream& stream, int quality) const
return false;
}
void Image::get_pixels(Color* dest, const Point& dest_pos, const Point& dest_size, RectI source_rect)
void Image::get_pixels(Color* dest, const Point& dest_pos, const Point& dest_size, RectI source_rect) const
{
// can't be outside of the source image
if (source_rect.x < 0) source_rect.x = 0;