Changeset - r10196:bb8f88b66ccb
[Not reviewed]
master
0 1 0
frosch - 16 years ago 2008-09-28 12:38:56
frosch@openttd.org
(svn r14409) -Codechange: Simplify a loop and correct a comment.
1 file changed with 6 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/viewport.cpp
Show inline comments
 
@@ -1333,15 +1333,12 @@ static void ViewportSortParentSprites(Pa
 
				}
 
			}
 

	
 
			/* Swap the two sprites ps and ps2 using bubble-sort algorithm. */
 
			ParentSpriteToDraw **psd3 = psd;
 
			do {
 
				ParentSpriteToDraw *temp = *psd3;
 
				*psd3 = ps2;
 
				ps2 = temp;
 

	
 
				psd3++;
 
			} while (psd3 <= psd2);
 
			/* Move ps2 in front of ps */
 
			ParentSpriteToDraw *temp = ps2;
 
			for (ParentSpriteToDraw **psd3 = psd2; psd3 > psd; psd3--) {
 
				*psd3 = *(psd3 - 1);
 
			}
 
			*psd = temp;
 
		}
 
	}
 
}
0 comments (0 inline, 0 general)