From: <sag...@us...> - 2009-09-22 17:07:29
|
Revision: 375 http://modplug.svn.sourceforge.net/modplug/?rev=375&view=rev Author: saga-games Date: 2009-09-22 17:07:04 +0000 (Tue, 22 Sep 2009) Log Message: ----------- [Mod] Compatibility Export: Use module working directory in "save as" dialog [Fix] Color Setup: When no INI file was present, channel separators were completely black [Fix] MED Loader: Possible error when loading orderlist Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/misc_util.h trunk/OpenMPT/soundlib/Load_med.cpp Removed Paths: ------------- trunk/OpenMPT/mptrack/bin/default.mkb Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2009-09-21 20:03:46 UTC (rev 374) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2009-09-22 17:07:04 UTC (rev 375) @@ -255,6 +255,8 @@ 0x800000, 0x808000, 0x008000, 0x808000, 0x008080, 0x000080, 0xFF0000, // VU-Meters 0x00FF00, 0x00FFFF, 0x0000FF, + // Channel separators + GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNFACE), GetSysColor(COLOR_BTNHIGHLIGHT), }; // Directory Arrays (Default + Last) Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2009-09-21 20:03:46 UTC (rev 374) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2009-09-22 17:07:04 UTC (rev 375) @@ -1635,6 +1635,8 @@ CFileDialog dlg(FALSE, ext, s, OFN_HIDEREADONLY | OFN_ENABLESIZING | OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST | OFN_NOREADONLYRETURN, pattern, pMainFrm); + dlg.m_ofn.lpstrInitialDir = CMainFrame::GetWorkingDirectory(DIR_MODS); + if (dlg.DoModal() != IDOK){ return; } Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2009-09-21 20:03:46 UTC (rev 374) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2009-09-22 17:07:04 UTC (rev 375) @@ -742,6 +742,8 @@ MoveConfigFile("plugin.cache"); MoveConfigFile("mpt_intl.ini"); MoveConfigFile("default.mkb", "", "Keybindings.mkb"); + MoveConfigFile("Keybindings.mkb"); + // TODO - Check the old ini settings here } // Create tunings dir Deleted: trunk/OpenMPT/mptrack/bin/default.mkb =================================================================== --- trunk/OpenMPT/mptrack/bin/default.mkb 2009-09-21 20:03:46 UTC (rev 374) +++ trunk/OpenMPT/mptrack/bin/default.mkb 2009-09-22 17:07:04 UTC (rev 375) @@ -1,282 +0,0 @@ -//-------- OpenMPT key binding definition file ------- -//-Format is: - -//- Context:Command ID:Modifiers:Key:KeypressEventType //Comments - -//---------------------------------------------------------------------- - -//----( Global Context (0) )------------ -0:1347:2:78:1 //File/New: Ctrl+N (KeyDown) -0:1346:2:79:1 //File/Open: Ctrl+O (KeyDown) -0:1349:2:83:1 //File/Save: Ctrl+S (KeyDown) -0:1030:2:119:1 //Play song/Pause song: Ctrl+F8 (KeyDown) -0:1031:0:119:1 //Pause song: F8 (KeyDown) -0:1375:0:27:1 //Stop Song: ESC (KeyDown) -0:1029:0:116:5 //Play song from start: F5 (KeyDown|KeyHold) -0:1028:0:118:5 //Play song from cursor: F7 (KeyDown|KeyHold) -0:1027:0:117:5 //Play pattern from start: F6 (KeyDown|KeyHold) -0:1026:2:117:5 //Play pattern from cursor: Ctrl+F6 (KeyDown|KeyHold) -0:1687:6:66:1 //Show approx. real BPM: Ctrl+Alt+B (KeyDown) -0:1376:2:120:1 //Toggle Midi Record: Ctrl+F9 (KeyDown) -0:1359:2:90:1 //Undo: Ctrl+Z (KeyDown) -0:1360:2:88:1 //Cut: Ctrl+X (KeyDown) -0:1361:2:67:1 //Copy: Ctrl+C (KeyDown) -0:1361:4:67:1 //Copy: Alt+C (KeyDown) -0:1362:2:86:1 //Paste: Ctrl+V (KeyDown) -0:1362:4:86:1 //Paste: Alt+V (KeyDown) -0:1363:2:77:1 //Mix Paste: Ctrl+M (KeyDown) -0:1364:2:65:1 //SelectAll: Ctrl+A (KeyDown) -0:1365:2:70:1 //Find: Ctrl+F (KeyDown) -0:1366:2:114:1 //Find Next: Ctrl+F3 (KeyDown) -0:1021:0:122:1 //View General: F11 (KeyDown) -0:1022:0:113:1 //View Pattern: F2 (KeyDown) -0:1023:0:114:1 //View Samples: F3 (KeyDown) -0:1024:0:115:1 //View Instruments: F4 (KeyDown) -0:1025:1:120:1 //View Comments: Shift+F9 (KeyDown) -0:1368:2:113:1 //Toggle Tree View: Ctrl+F2 (KeyDown) -0:1369:2:112:1 //View Options: Ctrl+F1 (KeyDown) -0:1670:6:77:1 //View Channel Manager: Ctrl+Alt+M (KeyDown) -0:1669:3:77:1 //View 'Add Plugin' Window: Shift+Ctrl+M (KeyDown) -0:1032:0:219:5 //Previous instrument: [ (KeyDown|KeyHold) -0:1032:2:38:5 //Previous instrument: Ctrl+UP (KeyDown|KeyHold) -0:1033:0:221:5 //Next instrument: ] (KeyDown|KeyHold) -0:1033:2:40:5 //Next instrument: Ctrl+DOWN (KeyDown|KeyHold) -0:1036:0:111:5 //Previous octave: NUM DIVIDE (KeyDown|KeyHold) -0:1037:0:106:5 //Next octave: NUMMULT (KeyDown|KeyHold) -0:1034:2:37:5 //Previous order: Ctrl+LEFT (KeyDown|KeyHold) -0:1035:2:39:5 //Next order: Ctrl+RIGHT (KeyDown|KeyHold) -0:1201:0:223:1 //Note off: ` (KeyDown) - -//----( General Context [bottom] (1) )------------ - -//----( Pattern Context [bottom] (2) )------------ -2:1017:0:34:5 //Jump down by measure: PGDOWN (KeyDown|KeyHold) -2:1018:0:33:5 //Jump up by measure: PGUP (KeyDown|KeyHold) -2:1338:4:34:5 //Jump down by beat: Alt+PGDOWN (KeyDown|KeyHold) -2:1339:4:33:5 //Jump up by beat: Alt+PGUP (KeyDown|KeyHold) -2:1019:2:34:5 //Snap down to measure: Ctrl+PGDOWN (KeyDown|KeyHold) -2:1020:2:33:5 //Snap up to measure: Ctrl+PGUP (KeyDown|KeyHold) -2:1340:6:34:5 //Snap down to beat: Ctrl+Alt+PGDOWN (KeyDown|KeyHold) -2:1341:6:33:5 //Snap up to beat: Ctrl+Alt+PGUP (KeyDown|KeyHold) -2:1038:0:40:5 //Navigate down by 1 row: DOWN (KeyDown|KeyHold) -2:1039:0:38:5 //Navigate up by 1 row: UP (KeyDown|KeyHold) -2:1040:0:37:5 //Navigate left: LEFT (KeyDown|KeyHold) -2:1041:0:39:5 //Navigate right: RIGHT (KeyDown|KeyHold) -2:1042:0:9:5 //Navigate to next channel: TAB (KeyDown|KeyHold) -2:1043:2:9:5 //Navigate to previous channel: Ctrl+TAB (KeyDown|KeyHold) -2:1044:0:36:1 //Go to first channel: HOME (KeyDown) -2:1045:2:36:1 //Go to first row: Ctrl+HOME (KeyDown) -2:1046:6:36:1 //Go to first row of first channel: Ctrl+Alt+HOME (KeyDown) -2:1047:0:35:1 //Go to last channel: END (KeyDown) -2:1048:2:35:1 //Go to last row: Ctrl+END (KeyDown) -2:1049:6:35:1 //Go to last row of last channel: Ctrl+Alt+END (KeyDown) -2:1050:1:16:1 //Selection key: Shift (KeyDown) -2:1011:4:76:1 //Select channel / Select all: Alt+L (KeyDown) -2:1663:2:118:1 //Toggle follow song: Ctrl+F7 (KeyDown) -2:1003:0:13:1 //Quick copy: ENTER (KeyDown) -2:1004:0:32:5 //Quick paste: SPACE (KeyDown|KeyHold) -2:1001:1:120:1 //Enable recording: Shift+F9 (KeyDown) -2:1002:2:13:1 //Play row: Ctrl+ENTER (KeyDown) -2:1002:0:104:1 //Play row: NUM 8 (KeyDown) -2:1002:0:56:1 //Play row: 8 (KeyDown) -2:1317:4:18:1 //Set row jump on note entry: Alt (KeyDown) -2:1685:6:9:1 //Switch to order list: Ctrl+Alt+TAB (KeyDown) -2:1672:3:13:1 //Insert new pattern: Shift+Ctrl+ENTER (KeyDown) -2:1662:6:80:1 //Toggle channel's plugin editor: Ctrl+Alt+P (KeyDown) -2:1062:0:93:1 //Show note properties: Application (KeyDown) -2:1063:2:93:1 //Show context (right-click) menu: Ctrl+Application (KeyDown) -2:1005:0:120:1 //Mute current channel: F9 (KeyDown) -2:1006:0:121:1 //Solo current channel: F10 (KeyDown) -2:1007:4:81:5 //Transpose +1: Alt+Q (KeyDown|KeyHold) -2:1008:4:65:5 //Transpose -1: Alt+A (KeyDown|KeyHold) -2:1009:6:81:5 //Transpose +12: Ctrl+Alt+Q (KeyDown|KeyHold) -2:1010:6:65:5 //Transpose -12: Ctrl+Alt+A (KeyDown|KeyHold) -2:1012:4:74:1 //Amplify selection: Alt+J (KeyDown) -2:1014:4:73:1 //Interpolate volume: Alt+I (KeyDown) -2:1015:4:88:1 //Interpolate effect: Alt+X (KeyDown) -2:1016:4:66:1 //Open effect visualizer: Alt+B (KeyDown) -2:1013:4:83:1 //Apply current instrument: Alt+S (KeyDown) -2:1660:4:69:1 //Grow selection: Alt+E (KeyDown) -2:1661:4:68:1 //Shrink selection: Alt+D (KeyDown) -2:1057:0:46:1 //Clear row: DELETE (KeyDown) -2:1058:0:110:1 //Clear field: NUM DECIMAL (KeyDown) -2:1664:1:190:1 //Clear field (IT Style): Shift+. (KeyDown) -2:1059:2:46:1 //Clear row and step: Ctrl+DELETE (KeyDown) -2:1060:2:110:1 //Clear field and step: Ctrl+NUM DECIMAL (KeyDown) -2:1665:3:190:1 //Clear field and step (IT Style): Shift+Ctrl+. (KeyDown) -2:1061:0:8:5 //Delete rows: BACKSPACE (KeyDown|KeyHold) -2:1377:2:8:5 //Delete all rows: Ctrl+BACKSPACE (KeyDown|KeyHold) -2:1378:0:45:5 //Insert Row: INSERT (KeyDown|KeyHold) -2:1379:2:45:1 //Insert All Rows: Ctrl+INSERT (KeyDown) -2:1055:0:109:5 //Previous pattern: NUM SUB (KeyDown|KeyHold) -2:1054:0:107:5 //Next pattern: NUM PLUS (KeyDown|KeyHold) - -//----( Pattern Context [bottom] - Note Col (3) )------------ -3:1064:0:90:1 //Base octave C: Z (KeyDown) -3:1065:0:83:1 //Base octave C#: S (KeyDown) -3:1066:0:88:1 //Base octave D: X (KeyDown) -3:1067:0:68:1 //Base octave D#: D (KeyDown) -3:1068:0:67:1 //Base octave E: C (KeyDown) -3:1069:0:86:1 //Base octave F: V (KeyDown) -3:1070:0:71:1 //Base octave F#: G (KeyDown) -3:1071:0:66:1 //Base octave G: B (KeyDown) -3:1072:0:72:1 //Base octave G#: H (KeyDown) -3:1073:0:78:1 //Base octave +1 A: N (KeyDown) -3:1074:0:74:1 //Base octave +1 A#: J (KeyDown) -3:1075:0:77:1 //Base octave +1 B: M (KeyDown) -3:1076:0:81:1 //Base octave +1 C: Q (KeyDown) -3:1077:0:50:1 //Base octave +1 C#: 2 (KeyDown) -3:1078:0:87:1 //Base octave +1 D: W (KeyDown) -3:1079:0:51:1 //Base octave +1 D#: 3 (KeyDown) -3:1080:0:69:1 //Base octave +1 E: E (KeyDown) -3:1081:0:82:1 //Base octave +1 F: R (KeyDown) -3:1082:0:53:1 //Base octave +1 F#: 5 (KeyDown) -3:1083:0:84:1 //Base octave +1 G: T (KeyDown) -3:1084:0:54:1 //Base octave +1 G#: 6 (KeyDown) -3:1085:0:89:1 //Base octave +2 A: Y (KeyDown) -3:1086:0:55:1 //Base octave +2 A#: 7 (KeyDown) -3:1087:0:85:1 //Base octave +2 B: U (KeyDown) -3:1088:0:73:1 //Base octave +2 C: I (KeyDown) -3:1089:0:57:1 //Base octave +2 C#: 9 (KeyDown) -3:1090:0:79:1 //Base octave +2 D: O (KeyDown) -3:1091:0:48:1 //Base octave +2 D#: 0 (KeyDown) -3:1092:0:80:1 //Base octave +2 E: P (KeyDown) -3:1212:0:96:1 //Set octave 0: NUM 0 (KeyDown) -3:1213:0:97:1 //Set octave 1: NUM 1 (KeyDown) -3:1214:0:98:1 //Set octave 2: NUM 2 (KeyDown) -3:1215:0:99:1 //Set octave 3: NUM 3 (KeyDown) -3:1216:0:52:1 //Set octave 4: 4 (KeyDown) -3:1216:0:100:1 //Set octave 4: NUM 4 (KeyDown) -3:1217:0:101:1 //Set octave 5: NUM 5 (KeyDown) -3:1218:0:102:1 //Set octave 6: NUM 6 (KeyDown) -3:1219:0:103:1 //Set octave 7: NUM 7 (KeyDown) -3:1220:0:104:1 //Set octave 8: NUM 8 (KeyDown) -3:1221:0:105:1 //Set octave 9: NUM 9 (KeyDown) -3:1316:1:16:1 //Chord Modifier: Shift (KeyDown) -3:1200:0:49:1 //Note cut: 1 (KeyDown) -3:1201:0:187:1 //Note off: = (KeyDown) -3:1667:1:49:1 //Note cut (don't remember instrument): Shift+1 (KeyDown) -3:1668:1:223:1 //Note off (don't remember instrument): Shift+` (KeyDown) - -//----( Pattern Context [bottom] - Ins Col (4) )------------ -4:1202:0:96:1 //Set instrument digit 0: NUM 0 (KeyDown) -4:1202:0:48:1 //Set instrument digit 0: 0 (KeyDown) -4:1203:0:97:1 //Set instrument digit 1: NUM 1 (KeyDown) -4:1203:0:49:1 //Set instrument digit 1: 1 (KeyDown) -4:1204:0:98:1 //Set instrument digit 2: NUM 2 (KeyDown) -4:1204:0:50:1 //Set instrument digit 2: 2 (KeyDown) -4:1205:0:99:1 //Set instrument digit 3: NUM 3 (KeyDown) -4:1205:0:51:1 //Set instrument digit 3: 3 (KeyDown) -4:1206:0:100:1 //Set instrument digit 4: NUM 4 (KeyDown) -4:1206:0:52:1 //Set instrument digit 4: 4 (KeyDown) -4:1207:0:101:1 //Set instrument digit 5: NUM 5 (KeyDown) -4:1207:0:53:1 //Set instrument digit 5: 5 (KeyDown) -4:1208:0:102:1 //Set instrument digit 6: NUM 6 (KeyDown) -4:1208:0:54:1 //Set instrument digit 6: 6 (KeyDown) -4:1209:0:103:1 //Set instrument digit 7: NUM 7 (KeyDown) -4:1209:0:55:1 //Set instrument digit 7: 7 (KeyDown) -4:1210:0:56:1 //Set instrument digit 8: 8 (KeyDown) -4:1210:0:104:1 //Set instrument digit 8: NUM 8 (KeyDown) -4:1211:0:105:1 //Set instrument digit 9: NUM 9 (KeyDown) -4:1211:0:57:1 //Set instrument digit 9: 9 (KeyDown) - -//----( Pattern Context [bottom] - Vol Col (5) )------------ -5:1222:0:48:1 //Set volume digit 0: 0 (KeyDown) -5:1222:0:96:1 //Set volume digit 0: NUM 0 (KeyDown) -5:1223:0:49:1 //Set volume digit 1: 1 (KeyDown) -5:1223:0:97:1 //Set volume digit 1: NUM 1 (KeyDown) -5:1224:0:50:1 //Set volume digit 2: 2 (KeyDown) -5:1224:0:98:1 //Set volume digit 2: NUM 2 (KeyDown) -5:1225:0:51:1 //Set volume digit 3: 3 (KeyDown) -5:1225:0:99:1 //Set volume digit 3: NUM 3 (KeyDown) -5:1226:0:52:1 //Set volume digit 4: 4 (KeyDown) -5:1226:0:100:1 //Set volume digit 4: NUM 4 (KeyDown) -5:1227:0:53:1 //Set volume digit 5: 5 (KeyDown) -5:1227:0:101:1 //Set volume digit 5: NUM 5 (KeyDown) -5:1228:0:54:1 //Set volume digit 6: 6 (KeyDown) -5:1228:0:102:1 //Set volume digit 6: NUM 6 (KeyDown) -5:1229:0:55:1 //Set volume digit 7: 7 (KeyDown) -5:1229:0:103:1 //Set volume digit 7: NUM 7 (KeyDown) -5:1230:0:56:1 //Set volume digit 8: 8 (KeyDown) -5:1230:0:104:1 //Set volume digit 8: NUM 8 (KeyDown) -5:1231:0:57:1 //Set volume digit 9: 9 (KeyDown) -5:1231:0:105:1 //Set volume digit 9: NUM 9 (KeyDown) -5:1232:0:86:1 //Vol command - volume: V (KeyDown) -5:1233:0:80:1 //Vol command - pan: P (KeyDown) -5:1234:0:67:1 //Vol command - vol slide up: C (KeyDown) -5:1235:0:68:1 //Vol command - vol slide down: D (KeyDown) -5:1236:0:65:1 //Vol command - vol fine slide up: A (KeyDown) -5:1237:0:66:1 //Vol command - vol fine slide down: B (KeyDown) -5:1238:0:85:1 //Vol command - vibrato speed: U (KeyDown) -5:1239:0:72:1 //Vol command - vibrato: H (KeyDown) -5:1240:0:76:1 //Vol command - XM pan left: L (KeyDown) -5:1241:0:82:1 //Vol command - XM pan right: R (KeyDown) -5:1242:0:71:1 //Vol command - Portamento: G (KeyDown) -5:1243:0:70:1 //Vol command - Portamento Up: F (KeyDown) -5:1244:0:69:1 //Vol command - Portamento Down: E (KeyDown) -5:1245:1:186:1 //Vol command - Velocity: Shift+; (KeyDown) -5:1246:0:79:1 //Vol command - Offset: O (KeyDown) - -//----( Pattern Context [bottom] - FX Col (6) )------------ -6:1294:0:220:1 //FX midi macro slide: \ (KeyDown) -6:1295:1:186:1 //FX pseudo-velocity (experimental): Shift+; (KeyDown) -6:1666:0:222:1 //FX parameter extension command: # (KeyDown) - -//----( Pattern Context [bottom] - Param Col (7) )------------ -7:1247:0:48:1 //FX Param digit 0: 0 (KeyDown) -7:1247:0:96:1 //FX Param digit 0: NUM 0 (KeyDown) -7:1248:0:49:1 //FX Param digit 1: 1 (KeyDown) -7:1248:0:97:1 //FX Param digit 1: NUM 1 (KeyDown) -7:1249:0:50:1 //FX Param digit 2: 2 (KeyDown) -7:1249:0:98:1 //FX Param digit 2: NUM 2 (KeyDown) -7:1250:0:51:1 //FX Param digit 3: 3 (KeyDown) -7:1250:0:99:1 //FX Param digit 3: NUM 3 (KeyDown) -7:1251:0:52:1 //FX Param digit 4: 4 (KeyDown) -7:1251:0:100:1 //FX Param digit 4: NUM 4 (KeyDown) -7:1252:0:53:1 //FX Param digit 5: 5 (KeyDown) -7:1252:0:101:1 //FX Param digit 5: NUM 5 (KeyDown) -7:1253:0:54:1 //FX Param digit 6: 6 (KeyDown) -7:1253:0:102:1 //FX Param digit 6: NUM 6 (KeyDown) -7:1254:0:55:1 //FX Param digit 7: 7 (KeyDown) -7:1254:0:103:1 //FX Param digit 7: NUM 7 (KeyDown) -7:1255:0:56:1 //FX Param digit 8: 8 (KeyDown) -7:1255:0:104:1 //FX Param digit 8: NUM 8 (KeyDown) -7:1256:0:57:1 //FX Param digit 9: 9 (KeyDown) -7:1256:0:105:1 //FX Param digit 9: NUM 9 (KeyDown) -7:1257:0:65:1 //FX Param digit A: A (KeyDown) -7:1258:0:66:1 //FX Param digit B: B (KeyDown) -7:1259:0:67:1 //FX Param digit C: C (KeyDown) -7:1260:0:68:1 //FX Param digit D: D (KeyDown) -7:1261:0:69:1 //FX Param digit E: E (KeyDown) -7:1262:0:70:1 //FX Param digit F: F (KeyDown) - -//----( Sample Context [bottom] (8) )------------ -8:1673:4:76:1 //Load a Sample: Alt+L (KeyDown) -8:1674:4:83:1 //Save Sample: Alt+S (KeyDown) -8:1675:4:78:1 //New Sample: Alt+N (KeyDown) -8:1380:2:84:1 //Trim sample around loop points: Ctrl+T (KeyDown) -8:1383:0:8:1 //Silence sample selection: BACKSPACE (KeyDown) -8:1384:3:78:1 //Normalise Sample: Shift+Ctrl+N (KeyDown) -8:1385:3:65:1 //Amplify Sample: Shift+Ctrl+A (KeyDown) -8:1381:3:82:1 //Reverse sample: Shift+Ctrl+R (KeyDown) -8:1382:0:46:1 //Delete sample selection: DELETE (KeyDown) -8:1386:0:107:1 //Zoom Out: NUM PLUS (KeyDown) -8:1387:0:109:1 //Zoom In: NUM SUB (KeyDown) - -//----( Instrument Context [bottom] (9) )------------ - -//----( Comments Context [bottom] (10) )------------ - -//----( Unknown Context (11) )------------ - -//----( Unknown Context (12) )------------ - -//----( Plugin GUI Context (13) )------------ - -//----( General Context [top] (14) )------------ - -//----( Pattern Context [top] (15) )------------ - -//----( Sample Context [top] (16) )------------ - -//----( Instrument Context [top] (17) )------------ - -//----( Comments Context [top] (18) )------------ Modified: trunk/OpenMPT/mptrack/misc_util.h =================================================================== --- trunk/OpenMPT/mptrack/misc_util.h 2009-09-21 20:03:46 UTC (rev 374) +++ trunk/OpenMPT/mptrack/misc_util.h 2009-09-22 17:07:04 UTC (rev 375) @@ -135,4 +135,30 @@ } } +// Convert a 0-terminated string to a space-padded string +template <size_t size> +void NullToSpaceString(char (&buffer)[size]) +{ + size_t pos = size; + while (pos-- > 0) + if (buffer[pos] == 0) + buffer[pos] = 32; + buffer[size - 1] = 0; +} +// Convert a space-padded string to a 0-terminated string +template <size_t size> +void SpaceToNullString(char (&buffer)[size]) +{ + // First, remove any Nulls + NullToSpaceString(buffer); + size_t pos = size; + while (pos-- > 0) + { + if (buffer[pos] == 32) + buffer[pos] = 0; + else if(buffer[pos] != 0) + break; + } + buffer[size - 1] = 0; +} #endif Modified: trunk/OpenMPT/soundlib/Load_med.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_med.cpp 2009-09-21 20:03:46 UTC (rev 374) +++ trunk/OpenMPT/soundlib/Load_med.cpp 2009-09-22 17:07:04 UTC (rev 375) @@ -673,7 +673,7 @@ Order.resize(nOrders++); for (UINT i=0; i<n; i++) { - WORD seqval = BigEndian(pmps->seq[i]); + WORD seqval = BigEndianW(pmps->seq[i]); if ((seqval < wNumBlocks) && (nOrders < MAX_ORDERS-1)) { Order[nOrders++] = (ORDERINDEX)seqval; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |