@@ -28,79 +28,51 @@ set SRC_BMP2=%~dp0resource\my_icons.bmp
2828set DST_DIR1 = %~dp0 resource\mytool
2929set DST_DIR2 = %~dp0 resource\my_icons
3030
31- if exist %DST_DIR1% rmdir /s /q %DST_DIR1%
32- if exist %DST_DIR2% rmdir /s /q %DST_DIR2%
31+ set OUT_BMP1 = %~dp0 resource\out-mytool.bmp
32+ set OUT_BMP2 = %~dp0 resource\out-my_icons.bmp
33+
3334if exist %DST_DIR1% rmdir /s /q %DST_DIR1%
3435if exist %DST_DIR2% rmdir /s /q %DST_DIR2%
3536
36- @ rem split input bmp
37+ @ rem split input bmp file No.1
3738%SPLITTER% %SRC_BMP1% %DST_DIR1%
3839if errorlevel 1 (
3940 echo fail %SPLITTER% %SRC_BMP1% %DST_DIR1%
4041 exit /b 1
4142)
4243
44+ @ rem split input bmp file No.2
4345%SPLITTER% %SRC_BMP2% %DST_DIR2%
4446if errorlevel 1 (
4547 echo fail %SPLITTER% %SRC_BMP2% %DST_DIR2%
4648 exit /b 1
4749)
4850
49- @ rem these steps are for tests.
50- set OUT1_BMP1 = %~dp0 resource\out1-mytool.bmp
51- set OUT1_BMP2 = %~dp0 resource\out1-my_icons.bmp
52- set OUT2_BMP1 = %~dp0 resource\out2-mytool.bmp
53- set OUT2_BMP2 = %~dp0 resource\out2-my_icons.bmp
54-
55- set OUT_DIR1 = %~dp0 resource\mytool
56- set OUT_DIR2 = %~dp0 resource\my_icons
57-
58- @ rem merge multiple bmp to one bmp
59- %MUXER% %DST_DIR1% %OUT1_BMP1%
60- if errorlevel 1 (
61- echo fail %MUXER% %DST_DIR1% %OUT1_BMP1%
62- exit /b 1
63- )
64-
65- %MUXER% %DST_DIR2% %OUT1_BMP2%
66- if errorlevel 1 (
67- echo fail %MUXER% %DST_DIR2% %OUT1_BMP2%
68- exit /b 1
69- )
70-
71- %SPLITTER% %OUT1_BMP1% %OUT_DIR1%
72- if errorlevel 1 (
73- echo fail %SPLITTER% %OUT1_BMP1% %OUT_DIR1%
74- exit /b 1
75- )
76-
77- %SPLITTER% %OUT1_BMP2% %OUT_DIR2%
78- if errorlevel 1 (
79- echo fail %SPLITTER% %OUT1_BMP2% %OUT_DIR2%
80- exit /b 1
81- )
82-
83- %MUXER% %OUT_DIR1% %OUT2_BMP1%
51+ @ rem merge separated bmp files into single bmp file
52+ %MUXER% %DST_DIR1% %OUT_BMP1%
8453if errorlevel 1 (
85- echo fail %MUXER% %OUT_DIR1 % %OUT2_BMP1 %
54+ echo fail %MUXER% %DST_DIR1 % %OUT_BMP1 %
8655 exit /b 1
8756)
8857
89- %MUXER% %OUT_DIR2% %OUT2_BMP2%
58+ @ rem merge separated bmp files into single bmp file
59+ %MUXER% %DST_DIR2% %OUT_BMP2%
9060if errorlevel 1 (
91- echo fail %MUXER% %OUT_DIR2 % %OUT2_BMP2 %
61+ echo fail %MUXER% %DST_DIR2 % %OUT_BMP2 %
9262 exit /b 1
9363)
9464
95- fc /a /b %OUT1_BMP1% %OUT2_BMP1% > NUL
65+ @ rem verify contents of merged bmp file is as same as source bitmap file
66+ fc /a /b %SRC_BMP1% %OUT_BMP1% > NUL
9667if errorlevel 1 (
97- echo fail fc /a /b %OUT1_BMP1 % %OUT2_BMP1 %
68+ echo fail fc /a /b %SRC_BMP1 % %OUT_BMP1 %
9869 exit /b 1
9970)
10071
101- fc /a /b %OUT1_BMP2% %OUT2_BMP2% > NUL
72+ @ rem verify contents of merged bmp file is as same as source bitmap file
73+ fc /a /b %SRC_BMP2% %OUT_BMP2% > NUL
10274if errorlevel 1 (
103- echo fail fc /a /b %OUT1_BMP2 % %OUT2_BMP2 %
75+ echo fail fc /a /b %SRC_BMP2 % %OUT_BMP2 %
10476 exit /b 1
10577)
10678
0 commit comments