Changeset - r3602:9970c65af58a
[Not reviewed]
master
0 1 0
peter1138 - 18 years ago 2006-04-21 06:55:47
peter1138@openttd.org
(svn r4494) - NewGRF: Clean up and reset custom texts
1 file changed with 14 insertions and 5 deletions:
0 comments (0 inline, 0 general)
newgrf_text.c
Show inline comments
 
@@ -236,15 +236,24 @@ void SetCurrentGrfLangID( const char *is
 

	
 
/**
 
 * House cleaning.
 
 * TODO : Have to be written.
 
 * Remove all strings and reset the text counter.
 
 */
 
void CleanUpStrings(void)
 
{
 
	uint id;
 

	
 
	GRFText *text_to_clear;
 
	for (id = 0; id < _num_grf_texts; id++) {
 
		GRFText *grftext = _grf_text[id].textholder;
 
		while (grftext != NULL) {
 
			GRFText *grftext2 = grftext->next;
 
			free(grftext->text);
 
			free(grftext);
 
			grftext = grftext2;
 
		}
 
		_grf_text[id].grfid      = 0;
 
		_grf_text[id].stringid   = 0;
 
		_grf_text[id].textholder = NULL;
 
	}
 

	
 
	for (id = 0; id < _num_grf_texts; id++) {
 
		text_to_clear = _grf_text[id].textholder;
 
	}
 
	_num_grf_texts = 0;
 
}
0 comments (0 inline, 0 general)