Rename Action0RemapFallbackMode to GRFPropertyMapFallbackMode

This commit is contained in:
Jonathan G Rennison
2018-11-26 17:11:26 +00:00
parent 2e539dfeca
commit 2ab0a9611b
2 changed files with 12 additions and 12 deletions

View File

@@ -8048,7 +8048,7 @@ struct GRFPropertyMapAction {
int feature; int feature;
int prop_id; int prop_id;
std::string name; std::string name;
Action0RemapFallbackMode fallback_mode; GRFPropertyMapFallbackMode fallback_mode;
uint8 ttd_ver_var_bit; uint8 ttd_ver_var_bit;
void Reset() void Reset()
@@ -8056,7 +8056,7 @@ struct GRFPropertyMapAction {
this->feature = -1; this->feature = -1;
this->prop_id = -1; this->prop_id = -1;
this->name.clear(); this->name.clear();
this->fallback_mode = A0REM_IGNORE; this->fallback_mode = GPMFM_IGNORE;
this->ttd_ver_var_bit = 0; this->ttd_ver_var_bit = 0;
} }
@@ -8091,7 +8091,7 @@ struct GRFPropertyMapAction {
SB(_cur.grffile->var8D_overlay, this->ttd_ver_var_bit, 1, success ? 1 : 0); SB(_cur.grffile->var8D_overlay, this->ttd_ver_var_bit, 1, success ? 1 : 0);
} }
if (!success) { if (!success) {
if (this->fallback_mode == A0REM_ERROR_ON_DEFINITION) { if (this->fallback_mode == GPMFM_ERROR_ON_DEFINITION) {
grfmsg(0, "Error: Unimplemented mapped property: %s, feature: %X, mapped to: %X", str, this->feature, this->prop_id); grfmsg(0, "Error: Unimplemented mapped property: %s, feature: %X, mapped to: %X", str, this->feature, this->prop_id);
GRFError *error = DisableGrf(STR_NEWGRF_ERROR_UNIMPLEMETED_MAPPED_PROPERTY); GRFError *error = DisableGrf(STR_NEWGRF_ERROR_UNIMPLEMETED_MAPPED_PROPERTY);
error->data = stredup(str); error->data = stredup(str);
@@ -8100,11 +8100,11 @@ struct GRFPropertyMapAction {
} else { } else {
const char *str_store = stredup(str); const char *str_store = stredup(str);
grfmsg(2, "Unimplemented mapped property: %s, feature: %X, mapped to: %X, %s on use", grfmsg(2, "Unimplemented mapped property: %s, feature: %X, mapped to: %X, %s on use",
str, this->feature, this->prop_id, (this->fallback_mode == A0REM_IGNORE) ? "ignoring" : "error"); str, this->feature, this->prop_id, (this->fallback_mode == GPMFM_IGNORE) ? "ignoring" : "error");
*(_cur.grffile->action0_unknown_property_names.Append()) = str_store; *(_cur.grffile->action0_unknown_property_names.Append()) = str_store;
GRFFilePropertyRemapEntry &entry = _cur.grffile->action0_property_remaps[this->feature].Entry(this->prop_id); GRFFilePropertyRemapEntry &entry = _cur.grffile->action0_property_remaps[this->feature].Entry(this->prop_id);
entry.name = str_store; entry.name = str_store;
entry.id = (this->fallback_mode == A0REM_IGNORE) ? A0RPI_UNKNOWN_IGNORE : A0RPI_UNKNOWN_ERROR; entry.id = (this->fallback_mode == GPMFM_IGNORE) ? A0RPI_UNKNOWN_IGNORE : A0RPI_UNKNOWN_ERROR;
entry.feature = this->feature; entry.feature = this->feature;
entry.property_id = this->prop_id; entry.property_id = this->prop_id;
} }
@@ -8157,8 +8157,8 @@ static bool ChangePropertyRemapSetFallbackMode(size_t len, ByteReader *buf)
grfmsg(2, "Action 14 property mapping: expected 1 byte for 'A0PM'->'FLBK' but got " PRINTF_SIZE ", ignoring this field", len); grfmsg(2, "Action 14 property mapping: expected 1 byte for 'A0PM'->'FLBK' but got " PRINTF_SIZE ", ignoring this field", len);
buf->Skip(len); buf->Skip(len);
} else { } else {
Action0RemapFallbackMode mode = (Action0RemapFallbackMode) buf->ReadByte(); GRFPropertyMapFallbackMode mode = (GRFPropertyMapFallbackMode) buf->ReadByte();
if (mode < A0REM_END) _current_grf_property_map_action.fallback_mode = mode; if (mode < GPMFM_END) _current_grf_property_map_action.fallback_mode = mode;
} }
return true; return true;
} }

View File

@@ -108,11 +108,11 @@ enum Action0RemapPropertyIds {
A0RPI_UNKNOWN_ERROR, A0RPI_UNKNOWN_ERROR,
}; };
enum Action0RemapFallbackMode { enum GRFPropertyMapFallbackMode {
A0REM_IGNORE, GPMFM_IGNORE,
A0REM_ERROR_ON_USE, GPMFM_ERROR_ON_USE,
A0REM_ERROR_ON_DEFINITION, GPMFM_ERROR_ON_DEFINITION,
A0REM_END, GPMFM_END,
}; };
struct GRFPropertyMapDefinition { struct GRFPropertyMapDefinition {