(svn r23040) -Add: [NewGRF] allow use of newgrf textstack during callback 23

This commit is contained in:
yexo 2011-10-20 16:49:30 +00:00
parent e3b99e3415
commit d8a80adf0e

View File

@ -755,10 +755,8 @@ static uint ShowAdditionalText(int left, int right, int y, EngineID engine)
uint16 callback = GetVehicleCallback(CBID_VEHICLE_ADDITIONAL_TEXT, 0, 0, engine, NULL); uint16 callback = GetVehicleCallback(CBID_VEHICLE_ADDITIONAL_TEXT, 0, 0, engine, NULL);
if (callback == CALLBACK_FAILED) return y; if (callback == CALLBACK_FAILED) return y;
/* STR_BLACK_STRING is used to start the string with {BLACK} */ StartTextRefStackUsage(4);
SetDParam(0, GetGRFStringID(GetEngineGRFID(engine), 0xD000 + callback)); uint result = DrawStringMultiLine(left, right, y, INT32_MAX, GetGRFStringID(GetEngineGRFID(engine), 0xD000 + callback), TC_BLACK);
StartTextRefStackUsage(0);
uint result = DrawStringMultiLine(left, right, y, INT32_MAX, STR_BLACK_STRING);
StopTextRefStackUsage(); StopTextRefStackUsage();
return result; return result;
} }