Polishing the CSV and Language Parser(s).
This commit is contained in:
@ -7,23 +7,16 @@
|
||||
|
||||
#include "game.h"
|
||||
|
||||
void bruhCallback(
|
||||
assetbuffer_t *asset, void *user, int32_t row,
|
||||
char **columns, int32_t columnCount
|
||||
) {
|
||||
int32_t bruh;
|
||||
for(int32_t i = 0; i < columnCount; i++) {
|
||||
char *string = columns [i];
|
||||
printf(string);
|
||||
}
|
||||
}
|
||||
language_t language;
|
||||
|
||||
bool gameInit(game_t *game) {
|
||||
// Init the engine and the rendering pipeline
|
||||
engineInit(&game->engine, game);
|
||||
|
||||
assetbuffer_t *buffer = assetBufferOpen("locale/language/en-US.csv");
|
||||
csvbufferresult_t result = csvBufferRow(buffer, &bruhCallback, NULL);
|
||||
// Load the language.
|
||||
languageInit(&language, "locale/language/en-US.csv");
|
||||
char output[CSV_CELL_SIZE_MAX];
|
||||
int32_t row = languageGet(&language, "hello.world", output);
|
||||
|
||||
// Send off to the game instance
|
||||
#if SETTING_GAME == SETTING_GAME_POKER
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <dawn/dawn.h>
|
||||
#include "../engine/engine.h"
|
||||
|
||||
#include "../file/csv.h"
|
||||
#include "../locale/language.h"
|
||||
|
||||
#if SETTING_GAME == SETTING_GAME_POKER
|
||||
#include "poker/pokergame.h"
|
||||
|
Reference in New Issue
Block a user