diff --git a/src/client.c b/src/client.c index c9ebef1..16db241 100644 --- a/src/client.c +++ b/src/client.c @@ -9,8 +9,9 @@ #include //#include #include "base/impl.c" +#include "shared.h" #include "lib/network.c" -#include "render.c" +#include "lib/tui.c" #include "string_chunk.c" //#include "assets/asset1.h" //#include "assets/asset2.h" diff --git a/src/render.c b/src/render.c deleted file mode 100644 index 3e0badf..0000000 --- a/src/render.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "shared.h" -#include "lib/tui.c" - -#define MAX_SCREEN_HEIGHT 300 -#define MAX_SCREEN_WIDTH 800 - -fn str strForPlanet(PlanetType type) { - switch(type) { - case PlanetTypeNull: - return " "; - case PlanetTypeAsteroid: - return "🪨"; - case PlanetTypeEarth: - return "🌎"; - case PlanetTypeGas: - return "🪐"; - case PlanetTypeMoon: - return "🌘"; - case PlanetTypeStation: - return "\xF0\x9F\x9B\xB0 "; - case PlanetType_Count: - assert(false && "this should never happen"); - return ""; - } -} - diff --git a/src/server.c b/src/server.c index 1134bbe..0b11a5f 100644 --- a/src/server.c +++ b/src/server.c @@ -14,7 +14,7 @@ #include "base/impl.c" #define NET_OUTGOING_MESSAGE_QUEUE_LEN 64 #include "lib/network.c" -#include "render.c" +#include "lib/tui.c" #include "string_chunk.c" ///// CONSTANTS diff --git a/src/shared.h b/src/shared.h index 128c2bc..c089081 100644 --- a/src/shared.h +++ b/src/shared.h @@ -16,6 +16,9 @@ #define MAX_PASSENGER_JOB_PRICE (10000) #define MAX_PASSENGER_BERTHS (8) #define AUCTION_COMMODITY_CUTOFF (7) +#define MAX_SCREEN_HEIGHT 300 +#define MAX_SCREEN_WIDTH 800 + #define AUCTION_PRICE_START_MULTIPLE (12) typedef enum ShipType { @@ -515,4 +518,24 @@ fn u32 oxyCostForTravel(PlayerShip* ship, Pos2 current, Pos2 dest) { return (x_distance + y_distance) * oxy_per_person_per_dist * (shipTotalPassengers(*ship) + 1); } +fn str strForPlanet(PlanetType type) { + switch(type) { + case PlanetTypeNull: + return " "; + case PlanetTypeAsteroid: + return "🪨"; + case PlanetTypeEarth: + return "🌎"; + case PlanetTypeGas: + return "🪐"; + case PlanetTypeMoon: + return "🌘"; + case PlanetTypeStation: + return "\xF0\x9F\x9B\xB0 "; + case PlanetType_Count: + assert(false && "this should never happen"); + return ""; + } +} + #endif //GAMESHARED_H