From 13c180174c57b3430713f40629f963400b18d8a9 Mon Sep 17 00:00:00 2001 From: DepressedTWM Date: Wed, 3 Jun 2026 12:51:00 -0400 Subject: [PATCH] meow --- CMakeLists.txt | 2 +- src/font.cpp | 3 +-- src/font.h | 12 ++++-------- src/viewport.cpp | 7 +++---- src/viewport.h | 4 ++-- src/vorbissource.cpp | 9 ++++----- 6 files changed, 15 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bafc46..cecd68b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ else() if (MSVC) add_compile_options(/O2 /fp:fast /GL /GF /GA) else() - add_compile_options(-O3 -ffast-math -flto -pipe -funroll-loops -falign-functions=16 -falign-jumps=8 -falign-loops=8 -fno-common) + add_compile_options(-O3 -ffast-math -flto -pipe -funroll-loops -falign-functions=16 -falign-jumps=8 -falign-loops=8 -fno-common -s) add_link_options(-Wl,-O2) endif() endif() diff --git a/src/font.cpp b/src/font.cpp index 5c77fb0..8cc1f4b 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -269,8 +269,7 @@ bool Font::doesExist(const char *name){ return shState->fontState().fontPresent(name); } -Font::Font(const std::vector *names, - int size){ +Font::Font(const std::vector *names, unsigned int size){ p = new FontPrivate(size ? size : FontPrivate::defaultSize); if (names) diff --git a/src/font.h b/src/font.h index da6f434..b0ad63c 100644 --- a/src/font.h +++ b/src/font.h @@ -45,11 +45,9 @@ public: * (when "Fonts/" is scanned for available assets). * 'ops' is an opened handle to a possible font file, * 'filename' is the corresponding path */ - void initFontSetCB(SDL_IOStream* &ops, - const std::string &filename); + void initFontSetCB(SDL_IOStream* &ops, const std::string &filename); - TTF_Font *getFont(std::string family, - int size); + TTF_Font *getFont(std::string family, unsigned int size); bool fontPresent(std::string family) const; @@ -63,8 +61,7 @@ class Font{ public: static bool doesExist(const char *name); - Font(const std::vector *names = 0, - int size = 0); + Font(const std::vector *names = 0, unsigned int size = 0); /* Clone constructor */ Font(const Font &other); @@ -96,8 +93,7 @@ public: * The core object picks the first existing name from the * passed array and stores it internally (same for default). */ void setName(const std::vector &names); - static void setDefaultName(const std::vector &names, - const SharedFontState &sfs); + static void setDefaultName(const std::vector &names, const SharedFontState &sfs); static const std::vector &getInitialDefaultNames(); diff --git a/src/viewport.cpp b/src/viewport.cpp index 083621d..3bf9279 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -47,7 +47,7 @@ struct ViewportPrivate{ EtcTemps tmp; - ViewportPrivate(int x, int y, int width, int height, Viewport *self) + ViewportPrivate(int x, int y, unsigned int width, unsigned int height, Viewport *self) : self(self), rect(&tmp.rect), color(&tmp.color), @@ -91,7 +91,7 @@ struct ViewportPrivate{ } }; -Viewport::Viewport(int x, int y, int width, int height) +Viewport::Viewport(int x, int y, unsigned int width, unsigned int height) : SceneElement(*shState->screen()), sceneLink(this) { @@ -113,7 +113,7 @@ Viewport::Viewport() initViewport(0, 0, graphics.width(), graphics.height()); } -void Viewport::initViewport(int x, int y, int width, int height){ +void Viewport::initViewport(int x, int y, unsigned int width, unsigned int height){ p = new ViewportPrivate(x, y, width, height, this); /* Set our own geometry */ @@ -210,7 +210,6 @@ void Viewport::releaseResources(){ delete p; } - ViewportElement::ViewportElement(Viewport *viewport, int z, int spriteY) : SceneElement(viewport ? *viewport : *shState->screen(), z, spriteY), m_viewport(viewport) diff --git a/src/viewport.h b/src/viewport.h index bb5c469..fc046df 100644 --- a/src/viewport.h +++ b/src/viewport.h @@ -31,7 +31,7 @@ struct ViewportPrivate; class Viewport : public Scene, public SceneElement, public Flashable, public Disposable{ public: - Viewport(int x, int y, int width, int height); + Viewport(int x, int y, unsigned int width, unsigned int height); Viewport(Rect *rect); Viewport(); ~Viewport(); @@ -47,7 +47,7 @@ public: void initDynAttribs(); private: - void initViewport(int x, int y, int width, int height); + void initViewport(int x, int y, unsigned int width, unsigned int height); void geometryChanged(); void composite(); diff --git a/src/vorbissource.cpp b/src/vorbissource.cpp index ae4cf03..1ec7288 100644 --- a/src/vorbissource.cpp +++ b/src/vorbissource.cpp @@ -63,16 +63,15 @@ struct VorbisSource : ALDataSource{ } loop; struct{ - int channels; - int rate; - int frameSize; + unsigned int channels; + unsigned int rate; + unsigned int frameSize; ALenum alFormat; } info; std::vector sampleBuf; - VorbisSource(SDL_IOStream &ops, - bool looped) + VorbisSource(SDL_IOStream &ops, bool looped) : src(ops), currentFrame(0) {