src/newgrf_gui.cpp
changeset 5634 ba6b9ebe197a
parent 5609 dc6a58930ba4
child 5635 9464b3edb2ea
equal deleted inserted replaced
5633:e1905dacc378 5634:ba6b9ebe197a
    39 }
    39 }
    40 
    40 
    41 
    41 
    42 static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, bool show_params)
    42 static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, bool show_params)
    43 {
    43 {
    44 	char buff[512];
    44 	char buff[256];
    45 	char *s;
       
    46 	uint i;
       
    47 
    45 
    48 	/* Draw filename or not if it is not known (GRF sent over internet) */
    46 	/* Draw filename or not if it is not known (GRF sent over internet) */
    49 	if (c->filename != NULL) {
    47 	if (c->filename != NULL) {
    50 		SetDParamStr(0, c->filename);
    48 		SetDParamStr(0, c->filename);
    51 		y += DrawStringMultiLine(x, y, STR_NEWGRF_FILENAME, w);
    49 		y += DrawStringMultiLine(x, y, STR_NEWGRF_FILENAME, w);
    55 	snprintf(buff, lengthof(buff), "%08X", (uint32)BSWAP32(c->grfid));
    53 	snprintf(buff, lengthof(buff), "%08X", (uint32)BSWAP32(c->grfid));
    56 	SetDParamStr(0, buff);
    54 	SetDParamStr(0, buff);
    57 	y += DrawStringMultiLine(x, y, STR_NEWGRF_GRF_ID, w);
    55 	y += DrawStringMultiLine(x, y, STR_NEWGRF_GRF_ID, w);
    58 
    56 
    59 	/* Prepare and draw MD5 sum */
    57 	/* Prepare and draw MD5 sum */
    60 	s = buff;
    58 	md5sumToString(buff, lastof(buff), c->md5sum);
    61 	for (i = 0; i < lengthof(c->md5sum); i++) {
       
    62 		s += snprintf(s, lastof(buff) - s, "%02X", c->md5sum[i]);
       
    63 	}
       
    64 	SetDParamStr(0, buff);
    59 	SetDParamStr(0, buff);
    65 	y += DrawStringMultiLine(x, y, STR_NEWGRF_MD5SUM, w);
    60 	y += DrawStringMultiLine(x, y, STR_NEWGRF_MD5SUM, w);
    66 
    61 
    67 	/* Show GRF parameter list */
    62 	/* Show GRF parameter list */
    68 	if (show_params) {
    63 	if (show_params) {