diff options
author | Torbjörn Andersson | 2005-06-21 13:14:56 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2005-06-21 13:14:56 +0000 |
commit | 43bc76a29c8628fe9e1ed4a2f345c8ecdad97e61 (patch) | |
tree | 872c681076b76986371687721f1ce832f7408e34 | |
parent | 21efddda22766e5ed685253820d7bbcff257be1d (diff) | |
download | scummvm-rg350-43bc76a29c8628fe9e1ed4a2f345c8ecdad97e61.tar.gz scummvm-rg350-43bc76a29c8628fe9e1ed4a2f345c8ecdad97e61.tar.bz2 scummvm-rg350-43bc76a29c8628fe9e1ed4a2f345c8ecdad97e61.zip |
Added temporary variables for readability.
svn-id: r18421
-rw-r--r-- | gob/goblin.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/gob/goblin.cpp b/gob/goblin.cpp index 53772bfc65..802ce051a6 100644 --- a/gob/goblin.cpp +++ b/gob/goblin.cpp @@ -172,34 +172,27 @@ void gob_initList(void) { void gob_sortByOrder(Util_List *list) { Util_ListNode *ptr; Util_ListNode *ptr2; - void *tmp; ptr = list->pHead; while (ptr->pNext != 0) { for (ptr2 = ptr->pNext; ptr2 != 0; ptr2 = ptr2->pNext) { - if (((Gob_Object *) ptr->pData)->order <= - ((Gob_Object *) ptr2->pData)->order) { - if (((Gob_Object *) ptr->pData)->order != - ((Gob_Object *) ptr2->pData)->order) + Gob_Object *objDesc = (Gob_Object *)ptr->pData; + Gob_Object *objDesc2 = (Gob_Object *)ptr2->pData; + + if (objDesc->order <= objDesc2->order) { + if (objDesc->order != objDesc2->order) continue; - if (((Gob_Object *) ptr->pData)->bottom <= - ((Gob_Object *) ptr2->pData)->bottom) { - if (((Gob_Object *) ptr->pData)-> - bottom != - ((Gob_Object *) ptr2->pData)-> - bottom) + if (objDesc->bottom <= objDesc2->bottom) { + if (objDesc->bottom != objDesc2->bottom) continue; - if ((Gob_Object *) ptr->pData != - gob_goblins[gob_currentGoblin]) + if (objDesc != gob_goblins[gob_currentGoblin]) continue; } } - tmp = ptr->pData; - ptr->pData = ptr2->pData; - ptr2->pData = tmp; + SWAP(ptr->pData, ptr2->pData); } ptr = ptr->pNext; } |