[nostalgia] Remove dynamic library usage
Will make dynamically loaded Modules impossible, but they add complexity and really aren't that useful...
This commit is contained in:
		@@ -205,6 +205,12 @@ ox::Error loadSpritePalette(Context *ctx, int section, ox::FileAddress paletteAd
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Do NOT use Context in the GBA version of this function.
 | 
			
		||||
void puts(Context *ctx, int column, int row, const char *str) {
 | 
			
		||||
	for (int i = 0; str[i]; i++) {
 | 
			
		||||
		setTile(ctx, 0, column + i, row, static_cast<uint8_t>(charMap[static_cast<int>(str[i])]));
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void setTile(Context*, int layer, int column, int row, uint8_t tile) {
 | 
			
		||||
	MEM_BG_MAP[layer][row * GbaTileColumns + column] = tile;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,7 @@
 | 
			
		||||
namespace nostalgia::core {
 | 
			
		||||
 | 
			
		||||
// map ASCII values to the nostalgia charset
 | 
			
		||||
static char charMap[128] = {
 | 
			
		||||
char charMap[128] = {
 | 
			
		||||
	0,
 | 
			
		||||
	0,
 | 
			
		||||
	0,
 | 
			
		||||
@@ -175,12 +175,6 @@ uint8_t blue32(Color16 c) noexcept {
 | 
			
		||||
	return blue16(c) * 8;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void puts(Context *ctx, int column, int row, const char *str) {
 | 
			
		||||
	for (int i = 0; str[i]; i++) {
 | 
			
		||||
		setTile(ctx, 0, column + i, row, static_cast<uint8_t>(charMap[static_cast<int>(str[i])]));
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static_assert(color16(0, 31, 0, 0) == 992);
 | 
			
		||||
static_assert(color16(16, 31, 0, 0) == 1008);
 | 
			
		||||
static_assert(color16(16, 31, 8, 0) == 9200);
 | 
			
		||||
 
 | 
			
		||||
@@ -14,6 +14,8 @@
 | 
			
		||||
 | 
			
		||||
namespace nostalgia::core {
 | 
			
		||||
 | 
			
		||||
extern char charMap[128];
 | 
			
		||||
 | 
			
		||||
enum class TileSheetSpace {
 | 
			
		||||
	Background,
 | 
			
		||||
	Sprite
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ set(CMAKE_AUTOMOC ON)
 | 
			
		||||
set(CMAKE_AUTORCC ON)
 | 
			
		||||
 | 
			
		||||
add_library(
 | 
			
		||||
	NostalgiaCore-Qt SHARED
 | 
			
		||||
	NostalgiaCore-Qt OBJECT
 | 
			
		||||
		gfx.cpp
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,16 @@ ox::Error loadBgTileSheet(Context*,
 | 
			
		||||
	return OxError(1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void puts(Context *ctx, int column, int row, const char *str) {
 | 
			
		||||
	for (int i = 0; str[i]; i++) {
 | 
			
		||||
		setTile(ctx, 0, column + i, row, static_cast<uint8_t>(charMap[static_cast<int>(str[i])]));
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void setTile(Context*, int, int, int, uint8_t) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void setSprite(Context*, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -194,6 +194,12 @@ void draw(Context *ctx) {
 | 
			
		||||
	SDL_RenderPresent(id->renderer);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void puts(Context *ctx, int column, int row, const char *str) {
 | 
			
		||||
	for (int i = 0; str[i]; i++) {
 | 
			
		||||
		setTile(ctx, 0, column + i, row, static_cast<uint8_t>(charMap[static_cast<int>(str[i])]));
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void setTile(Context *ctx, int layer, int column, int row, uint8_t tile) {
 | 
			
		||||
	auto id = ctx->implData<SdlImplData>();
 | 
			
		||||
	auto z = static_cast<unsigned>(layer);
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
 | 
			
		||||
set(CMAKE_AUTOMOC ON)
 | 
			
		||||
 | 
			
		||||
add_library(
 | 
			
		||||
	NostalgiaStudio SHARED
 | 
			
		||||
	NostalgiaStudio OBJECT
 | 
			
		||||
		editor.cpp
 | 
			
		||||
		wizard.cpp
 | 
			
		||||
		module.cpp
 | 
			
		||||
 
 | 
			
		||||
@@ -46,8 +46,8 @@ ox::Error model(T *io, NostalgiaStudioState *obj) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct NostalgiaStudioProfile {
 | 
			
		||||
	QString appName;
 | 
			
		||||
	QString orgName;
 | 
			
		||||
	QString appName = "Nostalgia Studio";
 | 
			
		||||
	QString orgName = "Drinking Tea";
 | 
			
		||||
	QVector<QString> modulesPath;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user