From 2bddcefafedee78767b537b0395e1ed44d743f36 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 29 Mar 2011 12:46:49 +0900 Subject: [PATCH] Allow up to 64 faces on a brush. This is temporary until unlimited faces can be supported, but it's sufficient to load mappi.map. --- tools/Forge/Bundles/MapEdit/SetBrush.h | 2 +- tools/Forge/Bundles/MapEdit/SetBrush.m | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/Forge/Bundles/MapEdit/SetBrush.h b/tools/Forge/Bundles/MapEdit/SetBrush.h index b60c194a3..f67911a4c 100644 --- a/tools/Forge/Bundles/MapEdit/SetBrush.h +++ b/tools/Forge/Bundles/MapEdit/SetBrush.h @@ -8,7 +8,7 @@ #include "TexturePalette.h" -#define MAX_FACES 16 +#define MAX_FACES 64 typedef struct { int numpoints; diff --git a/tools/Forge/Bundles/MapEdit/SetBrush.m b/tools/Forge/Bundles/MapEdit/SetBrush.m index 3b8cda7a2..96d704cdc 100644 --- a/tools/Forge/Bundles/MapEdit/SetBrush.m +++ b/tools/Forge/Bundles/MapEdit/SetBrush.m @@ -685,6 +685,10 @@ ParseVerts (script_t *script, int *n_verts) } do { + if (f - faces >= MAX_FACES) { + printf ("%s:%d: too many faces\n", script->file, script->line); + abort (); + } if (!Script_GetToken (script, true)) break; if (!strcmp (Script_Token (script), "}"))