# HG changeset patch # User tron # Date 1157008416 0 # Node ID 224ea00d73afa61193004b1ccfbccab810ecfbb9 # Parent fb18502e2c12174b97a40f4f1ccac5238fc875aa (svn r6254) if () cascade -> switch () diff -r fb18502e2c12 -r 224ea00d73af texteff.c --- a/texteff.c Thu Aug 31 07:09:13 2006 +0000 +++ b/texteff.c Thu Aug 31 07:13:36 2006 +0000 @@ -286,35 +286,32 @@ void DrawTextEffects(DrawPixelInfo *dpi) { - TextEffect *te; - - if (dpi->zoom < 1) { - for (te = _text_effect_list; te != endof(_text_effect_list); te++) { - if (te->string_id == INVALID_STRING_ID) - continue; + const TextEffect* te; - /* intersection? */ - if (dpi->left > te->right || - dpi->top > te->bottom || - dpi->left + dpi->width <= te->x || - dpi->top + dpi->height <= te->y) - continue; - AddStringToDraw(te->x, te->y, te->string_id, te->params_1, te->params_2, 0); - } - } else if (dpi->zoom == 1) { - for (te = _text_effect_list; te != endof(_text_effect_list); te++) { - if (te->string_id == INVALID_STRING_ID) - continue; + switch (dpi->zoom) { + case 0: + for (te = _text_effect_list; te != endof(_text_effect_list); te++) { + if (te->string_id != INVALID_STRING_ID && + dpi->left <= te->right && + dpi->top <= te->bottom && + dpi->left + dpi->width > te->x && + dpi->top + dpi->height > te->y) { + AddStringToDraw(te->x, te->y, te->string_id, te->params_1, te->params_2, 0); + } + } + break; - /* intersection? */ - if (dpi->left > te->right*2 - te->x || - dpi->top > te->bottom*2 - te->y || - (dpi->left + dpi->width) <= te->x || - (dpi->top + dpi->height) <= te->y) - continue; - AddStringToDraw(te->x, te->y, (StringID)(te->string_id-1), te->params_1, te->params_2, 0); - } - + case 1: + for (te = _text_effect_list; te != endof(_text_effect_list); te++) { + if (te->string_id != INVALID_STRING_ID && + dpi->left <= te->right * 2 - te->x && + dpi->top <= te->bottom * 2 - te->y && + dpi->left + dpi->width > te->x && + dpi->top + dpi->height > te->y) { + AddStringToDraw(te->x, te->y, (StringID)(te->string_id-1), te->params_1, te->params_2, 0); + } + } + break; } }