46{
48
49 if ( m_pLocatorVISHeader ==
TNULL )
50
51 {
52 for (
TINT i = 0; i < m_pLocatorsHeader->iNumLocators; i++ )
53 {
54 ATerrainLocator* pLocator = &m_pLocatorsHeader->pLocators[ i ];
55
57 return &m_pLocatorsHeader->pLocators[ i ];
58 }
59 }
60 else
61
62 {
63 for (
TINT i = 0; i < m_pLocatorVISHeader->iNumSections; i++ )
64 {
65 ATerrainLocatorVISSection* pSection = &m_pLocatorVISHeader->pSections[ i ];
66
67
70 TUINT uiCurrent = ( ( uiEnd - uiBase ) / 2 ) + uiBase;
71
72 while ( uiBase <= uiCurrent && uiCurrent < uiEnd )
73 {
74 ATerrainLocator* pLocator = &m_pLocatorsHeader->pLocators[ uiCurrent ];
76
77 if ( iCmpRes == 0 ) return pLocator;
78
79 if ( iCmpRes < 1 )
80
81 {
82 uiBase = uiCurrent + 1;
83 uiCurrent = ( ( uiEnd - uiBase ) / 2 ) + uiBase;
84 }
85 else
86
87 {
88 uiEnd = uiCurrent;
89 uiCurrent = ( ( uiCurrent - uiBase ) / 2 ) + uiBase;
90 }
91 }
92 }
93 }
94
96}
static TINT String8Compare(const TCHAR *str1, const TCHAR *str2, TSIZE size=-1)