diff --git a/src/Makefile.am b/src/Makefile.am index 08e25f3c..a8541d94 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,7 +28,7 @@ liblol_core_a_SOURCES = \ liblol_core_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/3rdparty/bullet3/src -I$(srcdir)/3rdparty/lua/src liblol_core_headers = \ - lol/engine-internal.h lol/engine.h lol/public.h lol/extras.h \ + lol/engine-internal.h lol/engine.h lol/public.h lol/extras.h lol/legacy.h \ \ lol/base/all.h \ lol/base/avl_tree.h lol/base/features.h lol/base/tuple.h lol/base/types.h \ diff --git a/src/image/combine.cpp b/src/image/combine.cpp index 8fff377c..d52b302f 100644 --- a/src/image/combine.cpp +++ b/src/image/combine.cpp @@ -33,14 +33,14 @@ enum class MergeMode }; template -static Image GenericMerge(Image &src1, Image &src2, float alpha) +static image GenericMerge(image &src1, image &src2, float alpha) { typedef typename PixelType::type pixel_t; ASSERT(src1.GetSize() == src2.GetSize()); int const count = src1.GetSize().x * src2.GetSize().y; - Image dst(src1.GetSize()); + image dst(src1.GetSize()); pixel_t const *src1p = src1.Lock(); pixel_t const *src2p = src2.Lock(); @@ -79,7 +79,7 @@ static Image GenericMerge(Image &src1, Image &src2, float alpha) } template -static Image GenericMerge(Image &src1, Image &src2, float alpha) +static image GenericMerge(image &src1, image &src2, float alpha) { bool gray1 = src1.GetFormat() == PixelFormat::Y_8 || src1.GetFormat() == PixelFormat::Y_F32; @@ -92,57 +92,57 @@ static Image GenericMerge(Image &src1, Image &src2, float alpha) } -Image Image::Merge(Image &src1, Image &src2, float alpha) +image image::Merge(image &src1, image &src2, float alpha) { return GenericMerge(src1, src2, alpha); } -Image Image::Mean(Image &src1, Image &src2) +image image::Mean(image &src1, image &src2) { return GenericMerge(src1, src2, 0.5f); } -Image Image::Min(Image &src1, Image &src2) +image image::Min(image &src1, image &src2) { return GenericMerge(src1, src2, 0.0f); } -Image Image::Max(Image &src1, Image &src2) +image image::Max(image &src1, image &src2) { return GenericMerge(src1, src2, 0.0f); } -Image Image::Overlay(Image &src1, Image &src2) +image image::Overlay(image &src1, image &src2) { return GenericMerge(src1, src2, 0.0f); } -Image Image::Screen(Image &src1, Image &src2) +image image::Screen(image &src1, image &src2) { return GenericMerge(src1, src2, 0.0f); } -Image Image::Divide(Image &src1, Image &src2) +image image::Divide(image &src1, image &src2) { return GenericMerge(src1, src2, 0.0f); } -Image Image::Multiply(Image &src1, Image &src2) +image image::Multiply(image &src1, image &src2) { return GenericMerge(src1, src2, 0.0f); } -Image Image::Add(Image &src1, Image &src2) +image image::Add(image &src1, image &src2) { return GenericMerge(src1, src2, 0.0f); } -Image Image::Sub(Image &src1, Image &src2) +image image::Sub(image &src1, image &src2) { return GenericMerge(src1, src2, 0.0f); } -Image Image::Difference(Image &src1, Image &src2) +image image::Difference(image &src1, image &src2) { return GenericMerge(src1, src2, 0.0f); } diff --git a/src/image/crop.cpp b/src/image/crop.cpp index 9709d5b7..9031187f 100644 --- a/src/image/crop.cpp +++ b/src/image/crop.cpp @@ -19,12 +19,12 @@ namespace lol { -Image Image::Crop(ibox2 box) const +image image::Crop(ibox2 box) const { ivec2 const srcsize = GetSize(); ivec2 const dstsize = box.extent(); - Image dst(dstsize); + image dst(dstsize); PixelFormat format = GetFormat(); if (format != PixelFormat::Unknown) diff --git a/src/image/image-private.h b/src/image/image-private.h index a700a857..221f3e66 100644 --- a/src/image/image-private.h +++ b/src/image/image-private.h @@ -43,12 +43,12 @@ public: array2d::type> m_array2d; }; -class ImageData +class image_data { - friend class Image; + friend class image; public: - ImageData() + image_data() : m_size(0, 0), m_wrap_x(WrapMode::Clamp), m_wrap_y(WrapMode::Clamp), diff --git a/src/image/image.cpp b/src/image/image.cpp index c96bc17e..20a99ade 100644 --- a/src/image/image.cpp +++ b/src/image/image.cpp @@ -23,30 +23,30 @@ namespace lol * Public Image class */ -Image::Image() - : m_data(new ImageData()) +image::image() + : m_data(new image_data()) { } -Image::Image(char const *path) - : m_data(new ImageData()) +image::image(char const *path) + : m_data(new image_data()) { Load(path); } -Image::Image(ivec2 size) - : m_data(new ImageData()) +image::image(ivec2 size) + : m_data(new image_data()) { SetSize(size); } -Image::Image (Image const &other) - : m_data(new ImageData()) +image::image (image const &other) + : m_data(new image_data()) { Copy(other); } -Image & Image::operator =(Image other) +image & image::operator =(image other) { /* Since the argument is passed by value, we’re assured it’s a new * object and we can safely swap our m_data pointers. */ @@ -54,7 +54,7 @@ Image & Image::operator =(Image other) return *this; } -Image::~Image() +image::~image() { for (int k : m_data->m_pixels.keys()) delete m_data->m_pixels[k]; @@ -62,7 +62,7 @@ Image::~Image() delete m_data; } -void Image::Copy(uint8_t* src_pixels, ivec2 const& size, PixelFormat fmt) +void image::Copy(uint8_t* src_pixels, ivec2 const& size, PixelFormat fmt) { ASSERT(fmt != PixelFormat::Unknown); SetSize(size); @@ -71,7 +71,7 @@ void Image::Copy(uint8_t* src_pixels, ivec2 const& size, PixelFormat fmt) size.x * size.y * BytesPerPixel(fmt)); } -void Image::Copy(Image const &src) +void image::Copy(image const &src) { ivec2 size = src.GetSize(); PixelFormat fmt = src.GetFormat(); @@ -86,12 +86,12 @@ void Image::Copy(Image const &src) } } -void Image::DummyFill() +void image::DummyFill() { Load("DUMMY"); } -bool Image::Load(char const *path) +bool image::Load(char const *path) { auto resource = ResourceLoader::Load(path); if (resource == nullptr) @@ -109,20 +109,20 @@ bool Image::Load(char const *path) return true; } -bool Image::Save(char const *path) +bool image::Save(char const *path) { - auto data = new ResourceImageData(new Image(*this)); + auto data = new ResourceImageData(new image(*this)); auto result = ResourceLoader::Save(path, data); delete data; return result; } -ivec2 Image::GetSize() const +ivec2 image::GetSize() const { return m_data->m_size; } -void Image::SetSize(ivec2 size) +void image::SetSize(ivec2 size) { ASSERT(size.x > 0); ASSERT(size.y > 0); @@ -142,24 +142,24 @@ void Image::SetSize(ivec2 size) } /* Wrap-around mode for some operations */ -WrapMode Image::GetWrapX() const +WrapMode image::GetWrapX() const { return m_data->m_wrap_x; } -WrapMode Image::GetWrapY() const +WrapMode image::GetWrapY() const { return m_data->m_wrap_y; } -void Image::SetWrap(WrapMode wrap_x, WrapMode wrap_y) +void image::SetWrap(WrapMode wrap_x, WrapMode wrap_y) { m_data->m_wrap_x = wrap_x; m_data->m_wrap_y = wrap_y; } /* The Lock() method */ -template typename PixelType::type *Image::Lock() +template typename PixelType::type *image::Lock() { SetFormat(T); @@ -167,7 +167,7 @@ template typename PixelType::type *Image::Lock() } /* The Lock2D() method */ -void *Image::Lock2DHelper(PixelFormat T) +void *image::Lock2DHelper(PixelFormat T) { SetFormat(T); @@ -175,7 +175,7 @@ void *Image::Lock2DHelper(PixelFormat T) } template -void Image::Unlock2D(array2d const &array) +void image::Unlock2D(array2d const &array) { ASSERT(m_data->m_pixels.has_key((int)m_data->m_format)); ASSERT(array.data() == m_data->m_pixels[(int)m_data->m_format]->data()); @@ -183,9 +183,9 @@ void Image::Unlock2D(array2d const &array) /* Explicit specialisations for the above templates */ #define _T(T) \ - template PixelType::type *Image::Lock(); \ - template array2d::type> &Image::Lock2D(); \ - template void Image::Unlock2D(array2d::type> const &array); + template PixelType::type *image::Lock(); \ + template array2d::type> &image::Lock2D(); \ + template void image::Unlock2D(array2d::type> const &array); _T(PixelFormat::Y_8) _T(PixelFormat::RGB_8) _T(PixelFormat::RGBA_8) @@ -195,14 +195,14 @@ _T(PixelFormat::RGBA_F32) #undef _T /* Special case for the "any" format: return the last active buffer */ -void *Image::Lock() +void *image::Lock() { ASSERT(m_data->m_format != PixelFormat::Unknown); return m_data->m_pixels[(int)m_data->m_format]->data(); } -void Image::Unlock(void const *pixels) +void image::Unlock(void const *pixels) { ASSERT(m_data->m_pixels.has_key((int)m_data->m_format)); ASSERT(pixels == m_data->m_pixels[(int)m_data->m_format]->data()); diff --git a/src/image/kernel.cpp b/src/image/kernel.cpp index d385f6ac..5b8ac465 100644 --- a/src/image/kernel.cpp +++ b/src/image/kernel.cpp @@ -17,7 +17,7 @@ namespace lol { -array2d Image::BayerKernel(ivec2 size) +array2d image::BayerKernel(ivec2 size) { array2d ret(size); @@ -46,7 +46,7 @@ array2d Image::BayerKernel(ivec2 size) return ret; } -array2d Image::HalftoneKernel(ivec2 size) +array2d image::HalftoneKernel(ivec2 size) { array2d ret(size); @@ -75,7 +75,7 @@ array2d Image::HalftoneKernel(ivec2 size) return NormalizeKernel(ret); } -array2d Image::BlueNoiseKernel(ivec2 size, ivec2 gsize) +array2d image::BlueNoiseKernel(ivec2 size, ivec2 gsize) { float const epsilon = 1.f / (size.x * size.y + 1); gsize = lol::min(size, gsize); @@ -180,7 +180,7 @@ static int cmpdot(const void *p1, const void *p2) return ((Dot const *)p1)->val > ((Dot const *)p2)->val; } -array2d Image::NormalizeKernel(array2d const &kernel) +array2d image::NormalizeKernel(array2d const &kernel) { ivec2 size = kernel.size(); @@ -209,7 +209,7 @@ array2d Image::NormalizeKernel(array2d const &kernel) return dst; } -array2d Image::EdiffKernel(EdiffAlgorithm algorithm) +array2d image::EdiffKernel(EdiffAlgorithm algorithm) { switch (algorithm) { @@ -270,7 +270,7 @@ array2d Image::EdiffKernel(EdiffAlgorithm algorithm) * there is little chance that any value below 0.2 will be useful. */ #define BLUR_EPSILON 0.2f -array2d Image::GaussianKernel(vec2 radius, float angle, vec2 delta) +array2d image::GaussianKernel(vec2 radius, float angle, vec2 delta) { array2d kernel; diff --git a/src/image/movie.cpp b/src/image/movie.cpp index 6a3bc6fc..8824de16 100644 --- a/src/image/movie.cpp +++ b/src/image/movie.cpp @@ -60,7 +60,7 @@ Movie::~Movie() delete m_data; } -void Movie::Feed(Image const &image) +void Movie::Feed(image const &image) { #if LOL_USE_FFMPEG diff --git a/src/image/noise.cpp b/src/image/noise.cpp index 0f6dc8b4..2da3b314 100644 --- a/src/image/noise.cpp +++ b/src/image/noise.cpp @@ -17,7 +17,7 @@ namespace lol { -bool Image::RenderRandom(ivec2 size) +bool image::RenderRandom(ivec2 size) { SetSize(size); vec4 *pixels = Lock(); diff --git a/src/image/pixel.cpp b/src/image/pixel.cpp index 591ade7b..f6d3b2ef 100644 --- a/src/image/pixel.cpp +++ b/src/image/pixel.cpp @@ -60,7 +60,7 @@ static u8vec4 f32tou8(vec4 pixel) * Pixel-level image manipulation */ -PixelFormat Image::GetFormat() const +PixelFormat image::GetFormat() const { return m_data->m_format; } @@ -81,7 +81,7 @@ PixelFormat Image::GetFormat() const * x lossless conversion (u8 to float) * # lossy conversion (dithering and/or convert color→gray) */ -void Image::SetFormat(PixelFormat fmt) +void image::SetFormat(PixelFormat fmt) { PixelFormat old_fmt = m_data->m_format; diff --git a/src/image/resample.cpp b/src/image/resample.cpp index 4c990463..55cad2d6 100644 --- a/src/image/resample.cpp +++ b/src/image/resample.cpp @@ -17,10 +17,10 @@ namespace lol { -static Image ResizeBicubic(Image &image, ivec2 size); -static Image ResizeBresenham(Image &image, ivec2 size); +static image ResizeBicubic(image &src, ivec2 size); +static image ResizeBresenham(image &src, ivec2 size); -Image Image::Resize(ivec2 size, ResampleAlgorithm algorithm) +image image::Resize(ivec2 size, ResampleAlgorithm algorithm) { switch (algorithm) { @@ -32,12 +32,12 @@ Image Image::Resize(ivec2 size, ResampleAlgorithm algorithm) } } -static Image ResizeBicubic(Image &image, ivec2 size) +static image ResizeBicubic(image &src, ivec2 size) { - Image dst(size); - ivec2 const oldsize = image.GetSize(); + image dst(size); + ivec2 const oldsize = src.GetSize(); - vec4 const *srcp = image.Lock(); + vec4 const *srcp = src.Lock(); vec4 *dstp = dst.Lock(); float scalex = size.x > 1 ? (oldsize.x - 1.f) / (size.x - 1) : 1.f; @@ -122,7 +122,7 @@ static Image ResizeBicubic(Image &image, ivec2 size) } dst.Unlock(dstp); - image.Unlock(srcp); + src.Unlock(srcp); return dst; } @@ -134,13 +134,13 @@ static Image ResizeBicubic(Image &image, ivec2 size) /* FIXME: the algorithm does not handle alpha components properly. Resulting * alpha should be the mean alpha value of the neightbouring pixels, but * the colour components should be weighted with the alpha value. */ -static Image ResizeBresenham(Image &image, ivec2 size) +static image ResizeBresenham(image &src, ivec2 size) { - Image dst(size); - ivec2 const oldsize = image.GetSize(); + image dst(size); + ivec2 const oldsize = src.GetSize(); float const invswsh = 1.0f / (oldsize.x * oldsize.y); - vec4 const *srcp = image.Lock(); + vec4 const *srcp = src.Lock(); vec4 *dstp = dst.Lock(); array aline, line; @@ -199,7 +199,7 @@ static Image ResizeBresenham(Image &image, ivec2 size) } dst.Unlock(dstp); - image.Unlock(srcp); + src.Unlock(srcp); return dst; } diff --git a/src/image/resource.cpp b/src/image/resource.cpp index 7f46c4ed..18fa4734 100644 --- a/src/image/resource.cpp +++ b/src/image/resource.cpp @@ -88,13 +88,13 @@ ResourceCodecData* ResourceLoader::Load(char const *path) auto data = codec->Load(path); if (data != nullptr) { - msg::info("Image::Load: Codec %s succesfully loaded %s.\n", codec->GetName(), path); + msg::info("image::Load: Codec %s succesfully loaded %s.\n", codec->GetName(), path); return data; } } //Log error, because we shouldn't be here - msg::error("Image::Load: Last codec %s, Error loading resource %s.\n", last_codec->GetName(), path); + msg::error("image::Load: Last codec %s, Error loading resource %s.\n", last_codec->GetName(), path); return nullptr; } @@ -106,13 +106,13 @@ bool ResourceLoader::Save(char const *path, ResourceCodecData* data) last_codec = codec; if (codec->Save(path, data)) { - msg::info("Image::Save: Codec %s succesfully saved %s.\n", codec->GetName(), path); + msg::info("image::Save: Codec %s succesfully saved %s.\n", codec->GetName(), path); return true; } } //Log error, because we shouldn't be here - msg::error("Image::Save: Last codec %s, Error saving resource %s.\n", last_codec->GetName(), path); + msg::error("image::Save: Last codec %s, Error saving resource %s.\n", last_codec->GetName(), path); return false; } diff --git a/src/lol/engine-internal.h b/src/lol/engine-internal.h index 89b33602..7c37478d 100644 --- a/src/lol/engine-internal.h +++ b/src/lol/engine-internal.h @@ -36,4 +36,5 @@ #include #include +#include diff --git a/src/lol/engine.h b/src/lol/engine.h index 4ce972bd..8ccaf884 100644 --- a/src/lol/engine.h +++ b/src/lol/engine.h @@ -31,4 +31,5 @@ #include #include +#include diff --git a/src/lol/gpu/framebuffer.h b/src/lol/gpu/framebuffer.h index 35e333f2..1038e0f4 100644 --- a/src/lol/gpu/framebuffer.h +++ b/src/lol/gpu/framebuffer.h @@ -103,7 +103,7 @@ public: TextureUniform GetTextureUniform() const; ivec2 GetSize() const; - class Image GetImage() const; + class image GetImage() const; void Bind(); void Unbind(); diff --git a/src/lol/image/image.h b/src/lol/image/image.h index 42fffa15..1ec2ffed 100644 --- a/src/lol/image/image.h +++ b/src/lol/image/image.h @@ -13,7 +13,7 @@ #pragma once // -// The Image class +// The image class // --------------- // @@ -58,24 +58,24 @@ enum class EdiffAlgorithm : uint8_t Lite, }; -//Image ----------------------------------------------------------------------- -class Image +// image ----------------------------------------------------------------------- +class image { public: - Image(); - Image(ivec2 size); + image(); + image(ivec2 size); /* XXX: use of this ctor should be discouraged, as it will not * return information about a possible error. */ - Image(char const *path); + image(char const *path); /* Rule of three */ - Image(Image const &other); - Image & operator =(Image other); - ~Image(); + image(image const &other); + image & operator =(image other); + ~image(); void DummyFill(); void Copy(uint8_t* pixels, ivec2 const& size, PixelFormat fmt); - void Copy(Image const &other); + void Copy(image const &other); bool Load(char const *path); bool Save(char const *path); @@ -121,51 +121,51 @@ public: bool RenderRandom(ivec2 size); /* Resize and crop */ - Image Resize(ivec2 size, ResampleAlgorithm algorithm); - Image Crop(ibox2 box) const; + image Resize(ivec2 size, ResampleAlgorithm algorithm); + image Crop(ibox2 box) const; /* Image processing */ - Image AutoContrast() const; - Image Brightness(float val) const; - Image Contrast(float val) const; - Image Convolution(array2d const &kernel); - Image Dilate(); - Image Erode(); - Image Invert() const; - Image Median(ivec2 radii) const; - Image Median(array2d const &kernel) const; - Image Sharpen(array2d const &kernel); - Image Threshold(float val) const; - Image Threshold(vec3 val) const; - Image RGBToYUV() const; - Image YUVToRGB() const; + image AutoContrast() const; + image Brightness(float val) const; + image Contrast(float val) const; + image Convolution(array2d const &kernel); + image Dilate(); + image Erode(); + image Invert() const; + image Median(ivec2 radii) const; + image Median(array2d const &kernel) const; + image Sharpen(array2d const &kernel); + image Threshold(float val) const; + image Threshold(vec3 val) const; + image RGBToYUV() const; + image YUVToRGB() const; /* Dithering */ - Image DitherRandom() const; - Image DitherEdiff(array2d const &kernel, + image DitherRandom() const; + image DitherEdiff(array2d const &kernel, ScanMode scan = ScanMode::Raster) const; - Image DitherOstromoukhov(ScanMode scan = ScanMode::Raster) const; - Image DitherOrdered(array2d const &kernel) const; - Image DitherHalftone(float radius, float angle) const; - Image DitherDbs() const; + image DitherOstromoukhov(ScanMode scan = ScanMode::Raster) const; + image DitherOrdered(array2d const &kernel) const; + image DitherHalftone(float radius, float angle) const; + image DitherDbs() const; /* Combine images */ - static Image Merge(Image &src1, Image &src2, float alpha); - static Image Mean(Image &src1, Image &src2); - static Image Min(Image &src1, Image &src2); - static Image Max(Image &src1, Image &src2); - static Image Overlay(Image &src1, Image &src2); - static Image Screen(Image &src1, Image &src2); - static Image Multiply(Image &src1, Image &src2); - static Image Divide(Image &src1, Image &src2); - static Image Add(Image &src1, Image &src2); - static Image Sub(Image &src1, Image &src2); - static Image Difference(Image &src1, Image &src2); + static image Merge(image &src1, image &src2, float alpha); + static image Mean(image &src1, image &src2); + static image Min(image &src1, image &src2); + static image Max(image &src1, image &src2); + static image Overlay(image &src1, image &src2); + static image Screen(image &src1, image &src2); + static image Multiply(image &src1, image &src2); + static image Divide(image &src1, image &src2); + static image Add(image &src1, image &src2); + static image Sub(image &src1, image &src2); + static image Difference(image &src1, image &src2); private: void *Lock2DHelper(PixelFormat T); - class ImageData *m_data; + class image_data *m_data; }; } /* namespace lol */ diff --git a/src/lol/image/movie.h b/src/lol/image/movie.h index b0b948b2..b7e0609a 100644 --- a/src/lol/image/movie.h +++ b/src/lol/image/movie.h @@ -34,7 +34,7 @@ public: #endif ~Movie(); - void Feed(Image const &image); + void Feed(image const &image); private: class MovieData *m_data; diff --git a/src/lol/image/resource.h b/src/lol/image/resource.h index f8be8bf5..1fe05689 100644 --- a/src/lol/image/resource.h +++ b/src/lol/image/resource.h @@ -37,9 +37,9 @@ namespace lol class ResourceImageData : public ResourceCodecData { public: - ResourceImageData(Image* image) + ResourceImageData(image* img) { - m_image = image; + m_image = img; } virtual ~ResourceImageData() @@ -48,15 +48,15 @@ namespace lol delete m_image; } - Image* m_image = nullptr; + image* m_image = nullptr; }; //ResourceImageData ----------------------------------------------------------- class ResourceTilesetData : public ResourceImageData { public: - ResourceTilesetData(Image* image) - : ResourceImageData(image) + ResourceTilesetData(image* img) + : ResourceImageData(img) { } array m_tiles; diff --git a/src/lol/legacy.h b/src/lol/legacy.h new file mode 100644 index 00000000..aae63039 --- /dev/null +++ b/src/lol/legacy.h @@ -0,0 +1,26 @@ +// +// Lol Engine +// +// Copyright © 2010—2017 Sam Hocevar +// +// Lol Engine is free software. It comes without any warranty, to +// the extent permitted by applicable law. You can redistribute it +// and/or modify it under the terms of the Do What the Fuck You Want +// to Public License, Version 2, as published by the WTFPL Task Force. +// See http://www.wtfpl.net/ for more details. +// + +#pragma once + +// +// Legacy types that will disappear one day +// ---------------------------------------- +// + +namespace lol +{ + +typedef image Image; + +} /* namespace lol */ + diff --git a/src/lol/sys/threadtypes.h b/src/lol/sys/threadtypes.h index b7ebba71..ec575aac 100644 --- a/src/lol/sys/threadtypes.h +++ b/src/lol/sys/threadtypes.h @@ -124,16 +124,16 @@ public: { } //Returns a dummy image, and start a job to load the image on a thread - Image* Load(const lol::String& path); - bool CheckStatus(Image* image); + image* Load(const lol::String& path); + bool CheckStatus(image* img); protected: virtual void TreatResult(ThreadJob* result); private: - Image m_dummy_image; - map m_images; - array m_loaded_images; + image m_dummy_image; + map m_images; + array m_loaded_images; }; } /* namespace lol */ diff --git a/src/textureimage.h b/src/textureimage.h index b798bbef..2ef7500f 100644 --- a/src/textureimage.h +++ b/src/textureimage.h @@ -39,13 +39,13 @@ protected: public: TextureImage(char const *path); - TextureImage(char const *path, Image* image); + TextureImage(char const *path, image* img); virtual ~TextureImage(); protected: void Init(char const *path); virtual void Init(char const *path, ResourceCodecData* loaded_data); - virtual void Init(char const *path, Image* image); + virtual void Init(char const *path, image* img); protected: virtual void TickDraw(float seconds, Scene &scene); @@ -54,11 +54,11 @@ public: /* Inherited from Entity */ virtual char const *GetName(); - void UpdateTexture(Image* image); + void UpdateTexture(image* img); Texture * GetTexture(); Texture const * GetTexture() const; - Image * GetImage(); - Image const * GetImage() const; + image * GetImage(); + image const * GetImage() const; ivec2 GetImageSize() const; ivec2 GetTextureSize() const; void Bind(); diff --git a/src/tiler.h b/src/tiler.h index f21ed26f..7ec6f91b 100644 --- a/src/tiler.h +++ b/src/tiler.h @@ -30,10 +30,10 @@ public: static TileSet *Register(char const *path, ivec2 size, ivec2 count); static TileSet *Register(String const &path); static TileSet *Register(char const *path); - static TileSet *Register(String const &path, Image* image, ivec2 size, ivec2 count); - static TileSet *Register(char const *path, Image* image, ivec2 size, ivec2 count); - static TileSet *Register(String const &path, Image* image); - static TileSet *Register(char const *path, Image* image); + static TileSet *Register(String const &path, image* img, ivec2 size, ivec2 count); + static TileSet *Register(char const *path, image* img, ivec2 size, ivec2 count); + static TileSet *Register(String const &path, image* img); + static TileSet *Register(char const *path, image* img); static void Deregister(TileSet *); private: diff --git a/src/tileset.h b/src/tileset.h index cb5348e7..cea01d10 100644 --- a/src/tileset.h +++ b/src/tileset.h @@ -42,18 +42,18 @@ class TileSet : public TextureImage public: TileSet(char const *path); - TileSet(char const *path, Image* image); - TileSet(char const *path, Image* image, array& tiles); + TileSet(char const *path, image* img); + TileSet(char const *path, image* img, array& tiles); /* Old style: path to PNG file */ TileSet(char const *path, ivec2 size, ivec2 count); - TileSet(char const *path, Image* image, ivec2 size, ivec2 count); + TileSet(char const *path, image* img, ivec2 size, ivec2 count); virtual ~TileSet(); protected: virtual void Init(char const *path, ResourceCodecData* loaded_data); - virtual void Init(char const *path, Image* image); + virtual void Init(char const *path, image* img); public: /* Inherited from Entity */