This commit is contained in:
DepressedTWM 2026-06-03 12:51:00 -04:00
parent 0df0aa9431
commit 13c180174c
6 changed files with 15 additions and 22 deletions

View file

@ -37,7 +37,7 @@ else()
if (MSVC) if (MSVC)
add_compile_options(/O2 /fp:fast /GL /GF /GA) add_compile_options(/O2 /fp:fast /GL /GF /GA)
else() 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) add_link_options(-Wl,-O2)
endif() endif()
endif() endif()

View file

@ -269,8 +269,7 @@ bool Font::doesExist(const char *name){
return shState->fontState().fontPresent(name); return shState->fontState().fontPresent(name);
} }
Font::Font(const std::vector<std::string> *names, Font::Font(const std::vector<std::string> *names, unsigned int size){
int size){
p = new FontPrivate(size ? size : FontPrivate::defaultSize); p = new FontPrivate(size ? size : FontPrivate::defaultSize);
if (names) if (names)

View file

@ -45,11 +45,9 @@ public:
* (when "Fonts/" is scanned for available assets). * (when "Fonts/" is scanned for available assets).
* 'ops' is an opened handle to a possible font file, * 'ops' is an opened handle to a possible font file,
* 'filename' is the corresponding path */ * 'filename' is the corresponding path */
void initFontSetCB(SDL_IOStream* &ops, void initFontSetCB(SDL_IOStream* &ops, const std::string &filename);
const std::string &filename);
TTF_Font *getFont(std::string family, TTF_Font *getFont(std::string family, unsigned int size);
int size);
bool fontPresent(std::string family) const; bool fontPresent(std::string family) const;
@ -63,8 +61,7 @@ class Font{
public: public:
static bool doesExist(const char *name); static bool doesExist(const char *name);
Font(const std::vector<std::string> *names = 0, Font(const std::vector<std::string> *names = 0, unsigned int size = 0);
int size = 0);
/* Clone constructor */ /* Clone constructor */
Font(const Font &other); Font(const Font &other);
@ -96,8 +93,7 @@ public:
* The core object picks the first existing name from the * The core object picks the first existing name from the
* passed array and stores it internally (same for default). */ * passed array and stores it internally (same for default). */
void setName(const std::vector<std::string> &names); void setName(const std::vector<std::string> &names);
static void setDefaultName(const std::vector<std::string> &names, static void setDefaultName(const std::vector<std::string> &names, const SharedFontState &sfs);
const SharedFontState &sfs);
static const std::vector<std::string> &getInitialDefaultNames(); static const std::vector<std::string> &getInitialDefaultNames();

View file

@ -47,7 +47,7 @@ struct ViewportPrivate{
EtcTemps tmp; 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), : self(self),
rect(&tmp.rect), rect(&tmp.rect),
color(&tmp.color), 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()), : SceneElement(*shState->screen()),
sceneLink(this) sceneLink(this)
{ {
@ -113,7 +113,7 @@ Viewport::Viewport()
initViewport(0, 0, graphics.width(), graphics.height()); 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); p = new ViewportPrivate(x, y, width, height, this);
/* Set our own geometry */ /* Set our own geometry */
@ -210,7 +210,6 @@ void Viewport::releaseResources(){
delete p; delete p;
} }
ViewportElement::ViewportElement(Viewport *viewport, int z, int spriteY) ViewportElement::ViewportElement(Viewport *viewport, int z, int spriteY)
: SceneElement(viewport ? *viewport : *shState->screen(), z, spriteY), : SceneElement(viewport ? *viewport : *shState->screen(), z, spriteY),
m_viewport(viewport) m_viewport(viewport)

View file

@ -31,7 +31,7 @@ struct ViewportPrivate;
class Viewport : public Scene, public SceneElement, public Flashable, public Disposable{ class Viewport : public Scene, public SceneElement, public Flashable, public Disposable{
public: 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(Rect *rect);
Viewport(); Viewport();
~Viewport(); ~Viewport();
@ -47,7 +47,7 @@ public:
void initDynAttribs(); void initDynAttribs();
private: 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 geometryChanged();
void composite(); void composite();

View file

@ -63,16 +63,15 @@ struct VorbisSource : ALDataSource{
} loop; } loop;
struct{ struct{
int channels; unsigned int channels;
int rate; unsigned int rate;
int frameSize; unsigned int frameSize;
ALenum alFormat; ALenum alFormat;
} info; } info;
std::vector<int16_t> sampleBuf; std::vector<int16_t> sampleBuf;
VorbisSource(SDL_IOStream &ops, VorbisSource(SDL_IOStream &ops, bool looped)
bool looped)
: src(ops), : src(ops),
currentFrame(0) currentFrame(0)
{ {