Added basic CSV Parser

This commit is contained in:
2021-08-07 23:21:50 -07:00
parent b2d7f2e6d9
commit 1f3f23a76e
6 changed files with 222 additions and 1 deletions

View File

@ -7,10 +7,24 @@
#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);
}
}
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);
// Send off to the game instance
#if SETTING_GAME == SETTING_GAME_POKER
return pokerGameInit(game);

View File

@ -7,7 +7,7 @@
#include <dawn/dawn.h>
#include "../engine/engine.h"
#include "../locale/language.h"
#include "../file/csv.h"
#if SETTING_GAME == SETTING_GAME_POKER
#include "poker/pokergame.h"