Restore console, server/client stuff.
This commit is contained in:
38
src/main.c
38
src/main.c
@ -5,12 +5,14 @@
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "assert/assert.h"
|
||||
#include "game/game.h"
|
||||
#include "display/render.h"
|
||||
#include "input.h"
|
||||
#include "console/console.h"
|
||||
#include "client/client.h"
|
||||
#include "server/server.h"
|
||||
#include "util/random.h"
|
||||
#include "util/string.h"
|
||||
#include "assert/assert.h"
|
||||
|
||||
bool_t exitRequested = false;
|
||||
|
||||
@ -18,34 +20,40 @@ void cmdExit(const consolecmdexec_t *exec) {
|
||||
exitRequested = true;
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
int32_t main(const int32_t argc, const char **argv) {
|
||||
assertInit();
|
||||
consoleInit();
|
||||
randomInit();
|
||||
gameInit();
|
||||
inputInit();
|
||||
renderInit();
|
||||
consoleInit();
|
||||
clientInit();
|
||||
serverInit();
|
||||
|
||||
consoleRegCmd("exit", cmdExit);
|
||||
|
||||
InitWindow(1280, 720, DUSK_NAME);
|
||||
entityInit(&GAME.entities[GAME.entityCount++], ENTITY_TYPE_PLAYER);
|
||||
|
||||
while(!WindowShouldClose()) {
|
||||
while(true) {
|
||||
inputUpdate();
|
||||
consoleUpdate();
|
||||
|
||||
BeginDrawing();
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
consoleDraw();
|
||||
|
||||
EndDrawing();
|
||||
if(!CONSOLE.open) {
|
||||
for(uint32_t i = 0; i < GAME.entityCount; i++) {
|
||||
entity_t *ent = &GAME.entities[i];
|
||||
entityTest(ent);
|
||||
}
|
||||
}
|
||||
|
||||
renderresult_t result = renderDraw();
|
||||
if(result != RENDER_OK) break;
|
||||
|
||||
if(exitRequested) break;
|
||||
}
|
||||
|
||||
CloseWindow();
|
||||
|
||||
serverDispose();
|
||||
clientDispose();
|
||||
|
||||
renderDispose();
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Reference in New Issue
Block a user