-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate.bat
More file actions
66 lines (44 loc) · 1.11 KB
/
generate.bat
File metadata and controls
66 lines (44 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@echo off
setlocal enabledelayedexpansion
:: -----------------------------------------------------------------
:: This generate script will auto search and generate resource files
:: -----------------------------------------------------------------
:: Output Resource Header File
set RESOURCE_HEADER=resources.h
::Bin to CPP Application
set BIN2CPP=bin2cpp.exe
:: Search For File Extentions
set EXT[0]=*.ogg
set EXT[1]=*.png
:: set EXT[2]=*.ext
:: set EXT[3]=*.ext
:: set EXT[4]=*.ext
:: ------------------------
:: Program Start
:: ------------------------
if NOT EXIST %BIN2CPP% (
echo Could not find the %BIN2CPP% binary
goto end
)
:: LF Hack
(
set NLM=^
%=EMPTY=%
)
set NL=^^^%NLM%%NLM%^%NLM%
echo Export Resource Files...
for /F "tokens=2 delims==" %%s in ('set EXT') do (
for %%F in (%%s) do (
if not exist %%~nF.cpp (
echo Exporting %%~nF.cpp
start /B /WAIT "%%~nF" %BIN2CPP% %%F %%~nF %%~nF
)
)
)
del /S /Q %RESOURCE_HEADER%>nul
(
set "files=#pragma once!NL!"
for /f "delims=" %%A in ('dir /b /a-d "*.h" ') do set "files=!files! !NL! #include "%%A""
)
echo %files%>%RESOURCE_HEADER%
:end