Files
Goober5000 b3470af307 fix memory management in FontManager
This refactors FontManager to improve it in several ways:
1. Change all the dynamic memory management to use `new`, rather than mixing `new` and `vm_malloc`
2. Change the current font to use an index rather than a pointer
3. Take advantage of more C++11 features to avoid redundant lookups
4. Use case-insensitive name comparison
5. Avoid overflowing the `fnt->filename` field
6. Use `Warning` rather than `Error` in a non-critical error situation
2024-11-22 20:12:17 -05:00

31 lines
362 B
C++

#pragma once
#ifndef FS2_OPEN_FONT_H
#define FS2_OPEN_FONT_H
#include "scripting/ade_api.h"
#include "graphics/font.h"
namespace scripting {
namespace api {
class font_h
{
int _fontIndex;
public:
font_h(int fontIndex);
font_h();
font::FSFont* Get() const;
int GetIndex() const;
bool isValid() const;
};
DECLARE_ADE_OBJ(l_Font, font_h);
}
}
#endif