diff src/libmlk-rpg/rpg/map-file.c @ 411:d74f53299252

make: add basic GNU make support
author David Demelier <markand@malikania.fr>
date Fri, 07 Oct 2022 14:35:31 +0200
parents 7321511052f6
children 7d2ebc334c8c
line wrap: on
line diff
--- a/src/libmlk-rpg/rpg/map-file.c	Fri Sep 09 13:30:34 2022 +0200
+++ b/src/libmlk-rpg/rpg/map-file.c	Fri Oct 07 14:35:31 2022 +0200
@@ -33,7 +33,6 @@
 #include <core/zfile.h>
 
 #include "map-file.h"
-#include "rpg_p.h"
 
 #define MAX_F(v) MAX_F_(v)
 #define MAX_F_(v) "%" #v "[^\n|]"
@@ -58,7 +57,7 @@
 	else if (strcmp(layer_name, "above") == 0)
 		layer_type = MAP_LAYER_TYPE_ABOVE;
 	else
-		return errorf(_("invalid layer type: %s"), layer_name);
+		return errorf("invalid layer type: %s", layer_name);
 
 	amount = ctx->map->columns * ctx->map->rows;
 	current = 0;
@@ -89,7 +88,7 @@
 		struct map_block *reg;
 
 		if (!ctx->mf->load_action) {
-			tracef(_("ignoring action %d,%d,%u,%u,%d,%s"), x, y, w, h, block, exec);
+			tracef("ignoring action %d,%d,%u,%u,%d,%s", x, y, w, h, block, exec);
 			continue;
 		}
 
@@ -127,11 +126,11 @@
 
 	/* Check if weight/height has been specified. */
 	if (ctx->map->columns == 0 || ctx->map->rows == 0)
-		return errorf(_("missing map dimensions before layer"));
+		return errorf("missing map dimensions before layer");
 
 	/* Determine layer type. */
 	if (sscanf(line, "layer|%32s", layer_name) <= 0)
-		return errorf(_("missing layer type definition"));
+		return errorf("missing layer type definition");
 
 	if (strcmp(layer_name, "actions") == 0)
 		return parse_actions(ctx);
@@ -147,7 +146,7 @@
 	struct tileset_file *tf = &mf->tileset_file;
 
 	if (!(p = strchr(line, '|')))
-		return errorf(_("could not parse tileset"));
+		return errorf("could not parse tileset");
 
 	snprintf(path, sizeof (path), "%s/%s", ctx->basedir, p + 1);
 
@@ -163,7 +162,7 @@
 parse_title(struct context *ctx, const char *line)
 {
 	if (sscanf(line, "title|" MAX_F(MAP_FILE_TITLE_MAX), ctx->mf->title) != 1 || strlen(ctx->mf->title) == 0)
-		return errorf(_("null map title"));
+		return errorf("null map title");
 
 	ctx->map->title = ctx->mf->title;
 
@@ -174,7 +173,7 @@
 parse_columns(struct context *ctx, const char *line)
 {
 	if (sscanf(line, "columns|%u", &ctx->map->columns) != 1 || ctx->map->columns == 0)
-		return errorf(_("null map columns"));
+		return errorf("null map columns");
 
 	return 0;
 }
@@ -183,7 +182,7 @@
 parse_rows(struct context *ctx, const char *line)
 {
 	if (sscanf(line, "rows|%u", &ctx->map->rows) != 1 || ctx->map->rows == 0)
-		return errorf(_("null map rows"));
+		return errorf("null map rows");
 
 	return 0;
 }
@@ -192,7 +191,7 @@
 parse_origin(struct context *ctx, const char *line)
 {
 	if (sscanf(line, "origin|%d|%d", &ctx->map->player_x, &ctx->map->player_y) != 2)
-		return errorf(_("invalid origin"));
+		return errorf("invalid origin");
 
 	return 0;
 }
@@ -246,18 +245,18 @@
 	 * Check that we have parsed every required components.
 	 */
 	if (!map->title)
-		return errorf(_("missing title"));
+		return errorf("missing title");
 
 	/*
 	 * We don't need to check width/height because parsing layers and
 	 * tilesets already check for their presence, so only check layers.
 	 */
 	if (!map->layers[0].tiles)
-		return errorf(_("missing background layer"));
+		return errorf("missing background layer");
 	if (!map->layers[1].tiles)
-		return errorf(_("missing foreground layer"));
+		return errorf("missing foreground layer");
 	if (!tileset_ok(map->tileset))
-		return errorf(_("missing tileset"));
+		return errorf("missing tileset");
 
 	return 0;
 }