Support UTF-8 in mineral names (bug #770).

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1861 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2005-08-25 00:03:27 +00:00
parent 2ff1972afb
commit c085c06f72
2 changed files with 16 additions and 7 deletions
+1
View File
@@ -1,4 +1,5 @@
Changes towards version 0.5: Changes towards version 0.5:
- Support UTF-8 chars in mineral names (bug #770) - SvdB
- Modified scalers to use surface pitch instead of width - reported to - Modified scalers to use surface pitch instead of width - reported to
fix bug #740 - Michael fix bug #740 - Michael
- Cleaner build output. Set '$MAKE_VERBOSE' to 1 for old output. - SvdB - Cleaner build output. Set '$MAKE_VERBOSE' to 1 for old output. - SvdB
+15 -7
View File
@@ -798,28 +798,36 @@ CheckObjectCollision (COUNT index)
(SURFACE_HEIGHT >> 1) (SURFACE_HEIGHT >> 1)
+ (ElementControl.EndPoint.y + (ElementControl.EndPoint.y
- LanderControl.EndPoint.y); - LanderControl.EndPoint.y);
pPSD->MineralText[0].CharCount = (COUNT)~0; pPSD->MineralText[0].CharCount =
(COUNT)~0;
pPSD->MineralText[1].pStr = pStr; pPSD->MineralText[1].pStr = pStr;
while ((ch = *pStr++) && ch != ' ') while ((ch = *pStr++) && ch != ' ')
; ;
if (ch == '\0') if (ch == '\0')
{ {
pPSD->MineralText[1].CharCount = (COUNT)~0; pPSD->MineralText[1].CharCount =
(COUNT)~0;
pPSD->MineralText[2].CharCount = 0; pPSD->MineralText[2].CharCount = 0;
} }
else else /* ch == ' ' */
{ {
// Name contains a space. Print over
// two lines.
pPSD->MineralText[1].CharCount = pPSD->MineralText[1].CharCount =
(pStr - pPSD->MineralText[1].pStr) - 1; utf8StringCountN(
pPSD->MineralText[1].pStr,
pStr - 1);
pPSD->MineralText[2].pStr = pStr; pPSD->MineralText[2].pStr = pStr;
pPSD->MineralText[2].CharCount = (COUNT)~0; pPSD->MineralText[2].CharCount =
(COUNT)~0;
} }
} }
break; break;
} }
PlaySound (SetAbsSoundIndex ( PlaySound (SetAbsSoundIndex (
LanderSounds, LANDER_FULL LanderSounds, LANDER_FULL),
), NotPositional (), NULL, GAME_SOUND_PRIORITY); NotPositional (), NULL,
GAME_SOUND_PRIORITY);
continue; continue;
case BIOLOGICAL_SCAN: case BIOLOGICAL_SCAN:
if (pPSD->BiologicalLevel < MAX_SCROUNGED) if (pPSD->BiologicalLevel < MAX_SCROUNGED)