Polishing the CSV and Language Parser(s).

This commit is contained in:
2021-08-09 08:34:49 -07:00
parent 1f3f23a76e
commit 68986fd108
12 changed files with 382 additions and 149 deletions

View File

@ -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

View File

@ -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"