* Added html5 dir, has a .bat file that can build the html5 version. I went ahead and added the html5 specific Dink media as well, a bit big for SVN though. It has mp3 versions of all songs, otherwise it's the same as the normal data I think

git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1600 353e56fe-9613-0410-8469-b96ad8e6f29c
This commit is contained in:
seth 2018-04-27 06:43:34 +00:00
parent 0974642cfb
commit 35c284b014
824 changed files with 4164 additions and 1121 deletions

View file

@ -0,0 +1,3 @@
call ../app_info_setup.bat
call build_release.bat nopause
call RunHTTPServerFromThisDir.bat

3
html5/BuildAndUpload.bat Normal file
View file

@ -0,0 +1,3 @@
call build_release.bat nopause
call UploadToWebsite.bat
pause

View file

@ -0,0 +1,250 @@
<!-- This unity webgl template is based on "A better Unity WebGL template" by greggman: https://github.com/greggman/better-unity-webgl-template -->
<!-- Also based on code by John Sharp: https://lyceum-allotments.github.io/2016/06/emscripten-and-sdl2-tutorial-part-7-get-naked-owl/ -->
<!-- Tweaks by Seth A. Robinson (rtsoft.com) - note, this is sort of a mess because I haven't fully intregrated the unity/emscripten stuff at this time. It works though -->
<script>
var appName = "RTTemplateName";
</script>
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>RTTemplateName</title>
<style>
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
margin: 0;
background: #444;
}
#gameContainer {
width: 100%;
height: 100%;
}
canvas.emscripten {
width: 100vw;
height: 66.66vw; /* height:width ratio = 9/16 = .5625 */
#background: black;
max-height: 100vh;
max-width: 150.00vh; /* 16/9 = 1.778 */
margin: auto;
position: absolute;
top:0;bottom:0; /* vertical center */
left:0;right:0; /* horizontal center */
display: block;
}
.logo {
display: block;
width: max-width: 100vw;
height: max-height: 70vh;
z-index: -1;
}
.progress {
margin: 1.5em;
border: 1px solid white;
width: 50vw;
display: none;
}
.progress .full {
margin: 2px;
background: white;
height: 1em;
transform-origin: top left;
}
#loader {
position: absolute;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
pointer-events:none;
}
.loadingtext {
color: white;
align-items: center;
justify-content: center;
}
.spinner,
.spinner:after {
border-radius: 50%;
width: 5em;
height: 5em;
}
.spinner {
margin: 10px;
font-size: 10px;
position: relative;
text-indent: -9999em;
border-top: 1.1em solid rgba(255, 255, 255, 0.2);
border-right: 1.1em solid rgba(255, 255, 255, 0.2);
border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);
border-left: 1.1em solid #ffffff;
transform: translateZ(0);
animation: spinner-spin 1.1s infinite linear;
}
@keyframes spinner-spin
{
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div id="gameContainer">
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
</div>
<div id="loader">
<img class="logo" src="WebLoaderData/logo.png">
<div class="spinner"></div>
<div class="loadingtext">Setting up...</div>
<div class="progress"><div class="full"></div></div>
</div>
</body>
<script>
var textNum = 0;
//Uncomment below to disable webassembly loading
//UnityLoader.SystemInfo.hasWasm = false;
var Module =
{
setStatus: function(text)
{
//console.log('SetStatus: ' + text)
const progress = document.querySelector("#loader .progress");
if (!Module.progress)
{
//set it up
progress.style.display = "block";
Module.progress = progress.querySelector(".full");
loader.querySelector(".spinner").style.display = "none";
Module.progress.style.transform = `scaleX(${0})`;
} else
{
//continue it
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
if (m)
{
loader.querySelector(".loadingtext").innerHTML = "Loading stuff...";
var cur = parseInt(m[2])*100;
var progressMax = parseInt(m[4])*100;
console.log('cur: ' + cur+' max: '+progressMax) ;
Module.progress.style.transform = `scaleX(${cur/progressMax})`;
} else
{
//done loading
UpdateText(); //will show index 0
loader.style.display = "none";
loader.querySelector(".spinner").style.display = "block";
}
}
},
print: function(text) {console.log('>> ' + text) },
printErr: function(text) { console.log(appName+' ERROR: ' + text) },
onRuntimeInitialized: function()
{
loader.querySelector(".spinner").style.display = "none";
loader.style.display = "none";
Module.ccall('mainf', null, null);
},
canvas: (function()
{
var canvas = document.getElementById('canvas');
return canvas;
})()
};
var start_function = function(o) {
loader.querySelector(".spinner").style.display = "none";
loader.style.display = "none";
Module.ccall('mainf', null, null);
};
</script>
<script>
(function() {
var memoryInitializer = appName+'.js.mem';
if (typeof Module['locateFile'] === 'function') {
memoryInitializer = Module['locateFile'](memoryInitializer);
} else if (Module['memoryInitializerPrefixURL']) {
memoryInitializer = Module['memoryInitializerPrefixURL'] + memoryInitializer;
}
var xhr = Module['memoryInitializerRequest'] = new XMLHttpRequest();
xhr.open('GET', memoryInitializer, true);
xhr.responseType = 'arraybuffer';
xhr.send(null);
})();
var script = document.createElement('script');
script.src = appName+".js";
document.body.appendChild(script);
var textIntervalHandle;
var textTimerIntervalMS = 5000; //how fast the text updates after the initial two
var textCommentArray = [
"This can really take a while.",
"Webgl apps like this are still relatively new, they will get faster to initialize in time.",
"While slow to initialize, this is safer to run and always up to date as compared to a downloadable that you would need to install.",
"Make sure you're using a 64 bit browser. Chrome or Firefox are good choices.",
"Did you know RTsoft has been making weird games since 1989? It's true, Seth is just that old.",
"It's looking like you'll be old too before this game starts.",
"You've gotta be bored out of your gourd by now. Sorry about the wait.",
"This doesn't work great on mobile. Chrome on Android *might* work, if you wait long enough.",
"It's possible this could take like 5 minutes. Wait if you want, or go try it on a powerful desktop machine maybe."
];
function UpdateText()
{
if (textCommentArray.length > textNum)
{
//we have more to show
const loader = document.querySelector("#loader");
loader.querySelector(".loadingtext").innerHTML = textCommentArray[textNum];
textNum++;
if (textNum > 1)
{
//keep rescheduling them after the first two messages
textIntervalHandle = window.setTimeout(UpdateText, textTimerIntervalMS);
}
}
}
</script>
</html>

View file

@ -0,0 +1,250 @@
<!-- This unity webgl template is based on "A better Unity WebGL template" by greggman: https://github.com/greggman/better-unity-webgl-template -->
<!-- Also based on code by John Sharp: https://lyceum-allotments.github.io/2016/06/emscripten-and-sdl2-tutorial-part-7-get-naked-owl/ -->
<!-- Tweaks by Seth A. Robinson (rtsoft.com) - note, this is sort of a mess because I haven't fully intregrated the unity/emscripten stuff at this time. It works though -->
<script>
var appName = "RTTemplateName";
</script>
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>RTTemplateName</title>
<style>
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
margin: 0;
background: #444;
}
#gameContainer {
width: 100%;
height: 100%;
}
canvas.emscripten {
width: 100vw;
height: 75.0vw; /* height:width ratio = 9/16 = .5625 */
#background: black;
max-height: 100vh;
max-width: 133.333vh; /* 16/9 = 1.778 */
margin: auto;
position: absolute;
top:0;bottom:0; /* vertical center */
left:0;right:0; /* horizontal center */
display: block;
}
.logo {
display: block;
width: max-width: 100vw;
height: max-height: 70vh;
z-index: -1;
}
.progress {
margin: 1.5em;
border: 1px solid white;
width: 50vw;
display: none;
}
.progress .full {
margin: 2px;
background: white;
height: 1em;
transform-origin: top left;
}
#loader {
position: absolute;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
pointer-events:none;
}
.loadingtext {
color: white;
align-items: center;
justify-content: center;
}
.spinner,
.spinner:after {
border-radius: 50%;
width: 5em;
height: 5em;
}
.spinner {
margin: 10px;
font-size: 10px;
position: relative;
text-indent: -9999em;
border-top: 1.1em solid rgba(255, 255, 255, 0.2);
border-right: 1.1em solid rgba(255, 255, 255, 0.2);
border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);
border-left: 1.1em solid #ffffff;
transform: translateZ(0);
animation: spinner-spin 1.1s infinite linear;
}
@keyframes spinner-spin
{
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div id="gameContainer">
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
</div>
<div id="loader">
<img class="logo" src="WebLoaderData/logo.png">
<div class="spinner"></div>
<div class="loadingtext">Setting up...</div>
<div class="progress"><div class="full"></div></div>
</div>
</body>
<script>
var textNum = 0;
//Uncomment below to disable webassembly loading
//UnityLoader.SystemInfo.hasWasm = false;
var Module =
{
setStatus: function(text)
{
//console.log('SetStatus: ' + text)
const progress = document.querySelector("#loader .progress");
if (!Module.progress)
{
//set it up
progress.style.display = "block";
Module.progress = progress.querySelector(".full");
loader.querySelector(".spinner").style.display = "none";
Module.progress.style.transform = `scaleX(${0})`;
} else
{
//continue it
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
if (m)
{
loader.querySelector(".loadingtext").innerHTML = "Loading stuff...";
var cur = parseInt(m[2])*100;
var progressMax = parseInt(m[4])*100;
console.log('cur: ' + cur+' max: '+progressMax) ;
Module.progress.style.transform = `scaleX(${cur/progressMax})`;
} else
{
//done loading
UpdateText(); //will show index 0
loader.style.display = "none";
loader.querySelector(".spinner").style.display = "block";
}
}
},
print: function(text) {console.log('>> ' + text) },
printErr: function(text) { console.log(appName+' ERROR: ' + text) },
onRuntimeInitialized: function()
{
loader.querySelector(".spinner").style.display = "none";
loader.style.display = "none";
Module.ccall('mainf', null, null);
},
canvas: (function()
{
var canvas = document.getElementById('canvas');
return canvas;
})()
};
var start_function = function(o) {
loader.querySelector(".spinner").style.display = "none";
loader.style.display = "none";
Module.ccall('mainf', null, null);
};
</script>
<script>
(function() {
var memoryInitializer = appName+'.js.mem';
if (typeof Module['locateFile'] === 'function') {
memoryInitializer = Module['locateFile'](memoryInitializer);
} else if (Module['memoryInitializerPrefixURL']) {
memoryInitializer = Module['memoryInitializerPrefixURL'] + memoryInitializer;
}
var xhr = Module['memoryInitializerRequest'] = new XMLHttpRequest();
xhr.open('GET', memoryInitializer, true);
xhr.responseType = 'arraybuffer';
xhr.send(null);
})();
var script = document.createElement('script');
script.src = appName+".js";
document.body.appendChild(script);
var textIntervalHandle;
var textTimerIntervalMS = 5000; //how fast the text updates after the initial two
var textCommentArray = [
"This can really take a while.",
"Webgl apps like this are still relatively new, they will get faster to initialize in time.",
"While slow to initialize, this is safer to run and always up to date as compared to a downloadable that you would need to install.",
"Make sure you're using a 64 bit browser. Chrome or Firefox are good choices.",
"Did you know RTsoft has been making weird games since 1989? It's true, Seth is just that old.",
"It's looking like you'll be old too before this game starts.",
"You've gotta be bored out of your gourd by now. Sorry about the wait.",
"This doesn't work great on mobile. Chrome on Android *might* work, if you wait long enough.",
"It's possible this could take like 5 minutes. Wait if you want, or go try it on a powerful desktop machine maybe."
];
function UpdateText()
{
if (textCommentArray.length > textNum)
{
//we have more to show
const loader = document.querySelector("#loader");
loader.querySelector(".loadingtext").innerHTML = textCommentArray[textNum];
textNum++;
if (textNum > 1)
{
//keep rescheduling them after the first two messages
textIntervalHandle = window.setTimeout(UpdateText, textTimerIntervalMS);
}
}
}
</script>
</html>

View file

@ -0,0 +1,249 @@
<!-- This unity webgl template is based on "A better Unity WebGL template" by greggman: https://github.com/greggman/better-unity-webgl-template -->
<!-- Also based on code by John Sharp: https://lyceum-allotments.github.io/2016/06/emscripten-and-sdl2-tutorial-part-7-get-naked-owl/ -->
<!-- Tweaks by Seth A. Robinson (rtsoft.com) - note, this is sort of a mess because I haven't fully intregrated the unity/emscripten stuff at this time. It works though -->
<script>
var appName = "RTTemplateName";
</script>
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>RTTemplateName</title>
<style>
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
margin: 0;
background: #444;
}
#gameContainer {
width: 100vw;
height: 100vh;
}
canvas.emscripten {
width: 100%;
height: 100%;
display: block;
}
.logo {
display: block;
width: max-width: 100vw;
height: max-height: 70vh;
z-index: -1;
}
.progress {
margin: 1.5em;
border: 1px solid white;
width: 50vw;
display: none;
}
.progress .full {
margin: 2px;
background: white;
height: 1em;
transform-origin: top left;
}
#loader {
position: absolute;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
pointer-events:none;
}
.loadingtext {
color: white;
align-items: center;
justify-content: center;
}
.spinner,
.spinner:after {
border-radius: 50%;
width: 5em;
height: 5em;
}
.spinner {
margin: 10px;
font-size: 10px;
position: relative;
text-indent: -9999em;
border-top: 1.1em solid rgba(255, 255, 255, 0.2);
border-right: 1.1em solid rgba(255, 255, 255, 0.2);
border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);
border-left: 1.1em solid #ffffff;
transform: translateZ(0);
animation: spinner-spin 1.1s infinite linear;
}
@keyframes spinner-spin
{
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div id="gameContainer">
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
</div>
<div id="loader">
<img class="logo" src="WebLoaderData/logo.png">
<div class="spinner"></div>
<div class="loadingtext">Setting up...</div>
<div class="progress"><div class="full"></div></div>
</div>
</body>
<script>
var textNum = 0;
//Uncomment below to disable webassembly loading
//UnityLoader.SystemInfo.hasWasm = false;
var Module =
{
setStatus: function(text)
{
console.log('SetStatus: ' + text)
const progress = document.querySelector("#loader .progress");
if (!Module.progress)
{
//set it up
progress.style.display = "block";
Module.progress = progress.querySelector(".full");
loader.querySelector(".spinner").style.display = "none";
Module.progress.style.transform = `scaleX(${0})`;
} else
{
//continue it
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
if (m)
{
loader.querySelector(".loadingtext").innerHTML = "Loading stuff...";
var cur = parseInt(m[2])*100;
var progressMax = parseInt(m[4])*100;
console.log('cur: ' + cur+' max: '+progressMax) ;
Module.progress.style.transform = `scaleX(${cur/progressMax})`;
} else
{
//done loading
UpdateText(); //will show index 0
loader.style.display = "none";
loader.querySelector(".spinner").style.display = "block";
}
}
},
print: function(text) {console.log('>> ' + text) },
printErr: function(text) { console.log(appName+' ERROR: ' + text) },
onRuntimeInitialized: function()
{
loader.querySelector(".spinner").style.display = "none";
loader.style.display = "none";
Module.ccall('mainf', null, null);
},
canvas: (function()
{
var canvas = document.getElementById('canvas');
return canvas;
})()
};
var start_function = function(o) {
loader.querySelector(".spinner").style.display = "none";
loader.style.display = "none";
Module.ccall('mainf', null, null);
};
</script>
<script>
(function() {
var memoryInitializer = appName+'.js.mem';
if (typeof Module['locateFile'] === 'function') {
memoryInitializer = Module['locateFile'](memoryInitializer);
} else if (Module['memoryInitializerPrefixURL']) {
memoryInitializer = Module['memoryInitializerPrefixURL'] + memoryInitializer;
}
var xhr = Module['memoryInitializerRequest'] = new XMLHttpRequest();
xhr.open('GET', memoryInitializer, true);
xhr.responseType = 'arraybuffer';
xhr.send(null);
})();
var script = document.createElement('script');
script.src = appName+".js";
document.body.appendChild(script);
var textIntervalHandle;
var textTimerIntervalMS = 5000; //how fast the text updates after the initial two
var textCommentArray = [
"This can really take a while.",
"Webgl apps like this are still relatively new, they will get faster to initialize in time.",
"While slow to initialize, this is safer to run and always up to date as compared to a downloadable that you would need to install.",
"Make sure you're using a 64 bit browser. Chrome or Firefox are good choices.",
"Did you know RTsoft has been making weird games since 1989? It's true, Seth is just that old.",
"It's looking like you'll be old too before this game starts.",
"You've gotta be bored out of your gourd by now. Sorry about the wait.",
"This doesn't work great on mobile. Chrome on Android *might* work, if you wait long enough.",
"It's possible this could take like 5 minutes. Wait if you want, or go try it on a powerful desktop machine maybe."
];
function UpdateText()
{
if (textCommentArray.length > textNum)
{
//we have more to show
const loader = document.querySelector("#loader");
loader.querySelector(".loadingtext").innerHTML = textCommentArray[textNum];
textNum++;
if (textNum > 1)
{
//keep rescheduling them after the first two messages
textIntervalHandle = window.setTimeout(UpdateText, textTimerIntervalMS);
}
}
}
</script>
</html>

View file

@ -0,0 +1,22 @@
echo For security reasons, Chrome won't properly download data from a file// address. By running this python based webserver chrome testing will work. I think it requires Python 3+ to be installed, this might happen automatically when you setup the Emscripten stuff
set CURPATH=%cd%
cd ..
call app_info_setup.bat
:um, why does the emsdk_env.bat not fully work unless I'm in the emscripten dir? Whatever, we'll move there and then back
cd %EMSCRIPTEN_ROOT%
call emsdk_env.bat
:Move back to original directory
cd %CURPATH%
emrun %APP_NAME%.html
pause
exit
:Another method that could be used, using a python server
start http://localhost:8000/%APP_NAME%.html
echo Ctrl-Pause to kill the server
python -m http.server --bind 127.0.0.1 8000
pause

40
html5/UploadToWebsite.bat Normal file
View file

@ -0,0 +1,40 @@
SET _FTP_USER_=rtsoft
SET _FTP_SITE_=rtsoft.com
SET WEB_SUB_DIR=web/dink
set CURPATH=%cd%
cd ..
call app_info_setup.bat
cd %CURPATH%
if not exist %APP_NAME%.js beeper.exe /p
:Get rid of files we don't actually need
del %APP_NAME%.js.orig.js
del temp.bc
:SSH transfer, this assumes you have ssh and valid keys setup already
copy /Y %APP_NAME%.html index.html
ssh %_FTP_USER_%@%_FTP_SITE_% "mkdir ~/www/%WEB_SUB_DIR%"
ssh %_FTP_USER_%@%_FTP_SITE_% "rm -rf ~/www/%WEB_SUB_DIR%/WebLoaderData"
rsync -avzr --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r -e "ssh" %APP_NAME%*.* %_FTP_USER_%@%_FTP_SITE_%:www/%WEB_SUB_DIR%
rsync -avzr --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r -e "ssh" WebLoaderData %_FTP_USER_%@%_FTP_SITE_%:www/%WEB_SUB_DIR%
rsync -avzr --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r -e "ssh" index.html %_FTP_USER_%@%_FTP_SITE_%:www/%WEB_SUB_DIR%
:Let's go ahead an open a browser to test it
:start http://www.%_FTP_SITE_%/%WEB_SUB_DIR%/%APP_NAME%.html
start http://www.%_FTP_SITE_%/%WEB_SUB_DIR%
:Old way, non ssh
REM get our ftp logon info
:call d:\projects\SetFTPLogonInfo.bat
:ncftpput -u %_FTP_USER_% -p %_FTP_PASS_% -R %_FTP_SITE_% /www/%WEB_SUB_DIR% %APP_NAME%*
:ncftpput -u %_FTP_USER_% -p %_FTP_PASS_% -R %_FTP_SITE_% /www/%WEB_SUB_DIR% WebLoaderData
:echo Files uploaded: http://www.%_FTP_SITE_%/%WEB_SUB_DIR%
:Let's go ahead an open a browser to test it
:start http://www.%_FTP_SITE_%/%WEB_SUB_DIR%/%APP_NAME%.html

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

171
html5/build_release.bat Normal file
View file

@ -0,0 +1,171 @@
:Set below to DEBUG=1 for debug mode builds - slower but way easier to see problems. Disables the ASYNC stuff as that doesn't seem to play
:well with the rest
SET DEBUG=0
:Set to 1, this causes some internal build changes, and the CustomMainFullTemplate.html to be copied to <AppName>.html instead of the default emscripten one
:Set to 0, you can easily see LogMsg's as they appear in the text window under the app area, so that might be better for debugging
SET USE_HTML5_CUSTOM_MAIN=1
:If 1, this is used:
SET CUSTOM_TEMPLATE=CustomMain4-3AspectRatioTemplate.html
:SET CUSTOM_TEMPLATE=CustomMainFullTemplate.html
set CURPATH=%cd%
cd ..
call app_info_setup.bat
:um, why does the emsdk_env.bat not fully work unless I'm in the emscripten dir? Whatever, we'll move there and then back
cd %EMSCRIPTEN_ROOT%
call emsdk_env.bat
:Move back to original directory
cd %CURPATH%
where /q emsdk_env.bat
if ERRORLEVEL 1 (
ECHO You need the environmental EMSCRIPTEN_ROOT set. This should be set in setup_base.bat in proton's main dir, then called from app_info_setup.bat.
beeper
pause
exit
)
where /q sed
if ERRORLEVEL 1 (
ECHO You need the utility sed in your path if you want insert.bat to work. Install tortoisegit, I think it comes with that.
beeper
pause
exit
)
:Oh, we better build our media just in case
cd ../media
:call update_media.bat
cd ../html5
SET SHARED=..\..\shared
SET APP=..\source
SET COMPPATH=%SHARED%\Entity
SET CLANMATH=%SHARED%\ClanLib-2.0\Sources\Core\Math
SET ZLIBPATH=%SHARED%\util\zlib
set PPATH=%SHARED%\Renderer\linearparticle\sources
set COMPPATH=%SHARED%\Entity
set PNGSRC=%SHARED%\Irrlicht\source\Irrlicht\libpng
set JPGSRC=%SHARED%\Irrlicht\source\Irrlicht\jpeglib
set LZMASRC=%SHARED%\Irrlicht\source\Irrlicht\lzma
:unused, for networking
:%SHARED%\Network\NetHTTP.cpp %SHARED%\Network\NetSocket.cpp %SHARED%\Network\NetUtils.cpp
set SRC= %SHARED%\PlatformSetup.cpp %SHARED%\html5\HTML5Main.cpp %SHARED%\html5\HTML5Utils.cpp %SHARED%\html5\NetHTTP_HTML5.cpp ^
%SHARED%\Audio\AudioManager.cpp %CLANMATH%\angle.cpp %CLANMATH%\mat3.cpp %CLANMATH%\mat4.cpp %CLANMATH%\rect.cpp %CLANMATH%\vec2.cpp %CLANMATH%\vec3.cpp ^
%CLANMATH%\vec4.cpp %SHARED%\Entity\Entity.cpp %SHARED%\Entity\Component.cpp %SHARED%\GUI\RTFont.cpp %SHARED%\Manager\Console.cpp %SHARED%\FileSystem\FileManager.cpp ^
%SHARED%\Manager\GameTimer.cpp %SHARED%\Manager\MessageManager.cpp %SHARED%\Manager\ResourceManager.cpp %SHARED%\Manager\VariantDB.cpp %SHARED%\Math\rtPlane.cpp %SHARED%\Math\WeightRand.cpp ^
%SHARED%\Math\rtRect.cpp %SHARED%\Renderer\RenderBatcher.cpp %SHARED%\Renderer\SoftSurface.cpp %SHARED%\Renderer\Surface.cpp %SHARED%\Renderer\SurfaceAnim.cpp ^
%SHARED%\util\CRandom.cpp %SHARED%\util\GLESUtils.cpp %SHARED%\util\MathUtils.cpp %SHARED%\util\MiscUtils.cpp %SHARED%\util\RenderUtils.cpp %SHARED%\util\ResourceUtils.cpp ^
%SHARED%\util\Variant.cpp %SHARED%\util\boost\libs\signals\src\connection.cpp %SHARED%\util\boost\libs\signals\src\named_slot_map.cpp %SHARED%\util\boost\libs\signals\src\signal_base.cpp ^
%SHARED%\util\boost\libs\signals\src\slot.cpp %SHARED%\util\boost\libs\signals\src\trackable.cpp %SHARED%\BaseApp.cpp %SHARED%\util\TextScanner.cpp %SHARED%\Entity\EntityUtils.cpp ^
%SHARED%\Network\NetSocket.cpp %SHARED%\Network\NetUtils.cpp %SHARED%\Audio\AudioManagerSDL.cpp %SHARED%\FileSystem\StreamingInstance.cpp %SHARED%\FileSystem\FileSystem.cpp ^
%SHARED%\FileSystem\StreamingInstanceZip.cpp %SHARED%\FileSystem\StreamingInstanceFile.cpp %SHARED%\FileSystem\FileSystemZip.cpp %SHARED%\util\unzip\unzip.c %SHARED%\util\unzip\ioapi.c %SHARED%\util\PrimeSearch.cpp ^
%SHARED%\Manager\AdManager.cpp %SHARED%/Renderer/JPGSurfaceLoader.cpp %SHARED%\util\archive\TarHandler.cpp %SHARED%\Gamepad\GamepadManager.cpp ^
%SHARED%\Gamepad\GamepadProvideriCade.cpp %SHARED%\Gamepad\Gamepad.cpp %SHARED%\Gamepad\GamepadProvider.cpp %SHARED%\util\bzip2\blocksort.c ^
%SHARED%\util\bzip2\bzlib.c %SHARED%\util\bzip2\crctable.c %SHARED%\util\bzip2\decompress.c %SHARED%\util\bzip2\huffman.c %SHARED%\util\bzip2\randtable.c ^
%SHARED%/util/bzip2/compress.c %SHARED%\Gamepad\GamepadiCade.cpp
set COMPONENT_SRC=%COMPPATH%\Button2DComponent.cpp %COMPPATH%\FilterInputComponent.cpp %COMPPATH%\FocusInputComponent.cpp %COMPPATH%\FocusRenderComponent.cpp %COMPPATH%\FocusUpdateComponent.cpp ^
%COMPPATH%\HTTPComponent.cpp %COMPPATH%\InputTextRenderComponent.cpp %COMPPATH%\InterpolateComponent.cpp %COMPPATH%\OverlayRenderComponent.cpp %COMPPATH%\ProgressBarComponent.cpp ^
%COMPPATH%\RectRenderComponent.cpp %COMPPATH%\ScrollBarRenderComponent.cpp %COMPPATH%\ScrollComponent.cpp %COMPPATH%\TapSequenceDetectComponent.cpp %COMPPATH%\TextBoxRenderComponent.cpp ^
%COMPPATH%\TextRenderComponent.cpp %COMPPATH%\TouchStripComponent.cpp %COMPPATH%\TrailRenderComponent.cpp %COMPPATH%\TyperComponent.cpp %COMPPATH%\UnderlineRenderComponent.cpp ^
%COMPPATH%\TouchHandlerComponent.cpp %COMPPATH%\CustomInputComponent.cpp %COMPPATH%\SelectButtonWithCustomInputComponent.cpp %COMPPATH%\SliderComponent.cpp %COMPPATH%\EmitVirtualKeyComponent.cpp ^
%COMPPATH%\RenderClipComponent.cpp %COMPPATH%\ArcadeInputComponent.cpp %COMPPATH%\UnpackArchiveComponent.cpp
REM **************************************** ZLIB SOURCE CODE FILES
set ZLIB_SRC=%ZLIBPATH%/deflate.c %ZLIBPATH%/gzio.c %ZLIBPATH%/infback.c %ZLIBPATH%/inffast.c %ZLIBPATH%/inflate.c %ZLIBPATH%/inftrees.c %ZLIBPATH%/trees.c %ZLIBPATH%/uncompr.c %ZLIBPATH%/zutil.c %ZLIBPATH%/adler32.c %ZLIBPATH%/compress.c %ZLIBPATH%/crc32.c
REM **************************************** PARTICLE SYSTEM SOURCE CODE FILES
set PARTICLE_SRC=%PPATH%/L_Defination.cpp %PPATH%/L_DroppingEffect.cpp %PPATH%/L_EffectEmitter.cpp %PPATH%/L_ExplosionEffect.cpp %PPATH%/L_MotionController.cpp %PPATH%/L_Particle.cpp ^
%PPATH%/L_ParticleEffect.cpp %PPATH%/L_ParticleMem.cpp %PPATH%/L_ParticleSystem.cpp %PPATH%/L_ShootingEffect.cpp %PPATH%/L_EffectManager.cpp
REM **************************************** JPEG SOURCE CODE FILES
set JPG_SRC=%JPGSRC%\jcapimin.c %JPGSRC%\jcapistd.c %JPGSRC%\jccoefct.c %JPGSRC%\jccolor.c %JPGSRC%\jcdctmgr.c %JPGSRC%\jchuff.c %JPGSRC%\jcinit.c %JPGSRC%\jcmainct.c ^
%JPGSRC%\jcmarker.c %JPGSRC%\jcmaster.c %JPGSRC%\jcomapi.c %JPGSRC%\jcparam.c %JPGSRC%\jcphuff.c %JPGSRC%\jcprepct.c %JPGSRC%\jcsample.c %JPGSRC%\jctrans.c ^
%JPGSRC%\jdapimin.c %JPGSRC%\jdapistd.c %JPGSRC%\jdatadst.c %JPGSRC%\jdatasrc.c %JPGSRC%\jdcoefct.c %JPGSRC%\jdcolor.c %JPGSRC%\jddctmgr.c ^
%JPGSRC%\jdhuff.c %JPGSRC%\jdinput.c %JPGSRC%\jdmainct.c %JPGSRC%\jdmarker.c %JPGSRC%\jdmaster.c %JPGSRC%\jdmerge.c %JPGSRC%\jdphuff.c %JPGSRC%\jdpostct.c ^
%JPGSRC%\jdsample.c %JPGSRC%\jdtrans.c %JPGSRC%\jerror.c %JPGSRC%\jfdctflt.c %JPGSRC%\jfdctfst.c %JPGSRC%\jfdctint.c %JPGSRC%\jidctflt.c %JPGSRC%\jidctfst.c ^
%JPGSRC%\jidctint.c %JPGSRC%\jidctred.c %JPGSRC%\jmemmgr.c %JPGSRC%\jmemnobs.c %JPGSRC%\jquant1.c %JPGSRC%\jquant2.c %JPGSRC%\jutils.c
REM **************************************** APP SOURCE CODE FILES
set APP_SRC=%APP%\App.cpp %APP%\Component\ActionButtonComponent.cpp %APP%\Component\CursorComponent.cpp %APP%\Component\DragControlComponent.cpp ^
%APP%\Component\FPSControlComponent.cpp %APP%\Component\InventoryComponent.cpp %APP%\dink\dink.cpp %APP%\dink\FFReader.cpp %APP%\dink\misc_util.cpp %APP%\dink\ScriptAccelerator.cpp ^
%APP%\video_gl.cpp ^
%APP%\GUI\AboutMenu.cpp %APP%\GUI\BrowseMenu.cpp %APP%\GUI\DebugMenu.cpp %APP%\GUI\DMODInstallMenu.cpp ^
%APP%\GUI\EnterURLMenu.cpp %APP%\GUI\DMODMenu.cpp %APP%\GUI\GameMenu.cpp %APP%\GUI\LoadMenu.cpp %APP%\GUI\LogMenu.cpp %APP%\GUI\MainMenu.cpp %APP%\GUI\OptionsMenu.cpp ^
%APP%\GUI\PauseMenu.cpp %APP%\GUI\PopUpMenu.cpp %APP%\GUI\QuickTipMenu.cpp %APP%\GUI\ReadTextMenu.cpp %APP%\GUI\ExpiredMenu.cpp
REM **************************************** END SOURCE
:unused so far: -s USE_GLFW=3 -s NO_EXIT_RUNTIME=1 -s FORCE_ALIGNED_MEMORY=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 -DRT_EMTERPRETER_ENABLED
:To skip font loading so it needs no resource files or zlib, add -DC_NO_ZLIB
SET CUSTOM_FLAGS= -DHAS_SOCKLEN_T -DBOOST_ALL_NO_LIB -DPLATFORM_HTML5 -DRT_USE_SDL_AUDIO -DRT_JPG_SUPPORT -DC_GL_MODE -s LEGACY_GL_EMULATION=1 -DPLATFORM_HTML5 -s TOTAL_MEMORY=16MB -Wno-c++11-compat-deprecated-writable-strings -Wno-shift-negative-value -s ALLOW_MEMORY_GROWTH=1
:unused: -s FULL_ES2=1 --emrun
IF %USE_HTML5_CUSTOM_MAIN% EQU 1 (
:add this define so we'll manually call mainf from the html later instead of it being auto
SET CUSTOM_FLAGS=%CUSTOM_FLAGS% -DRT_HTML5_USE_CUSTOM_MAIN -s EXPORTED_FUNCTIONS=['_mainf'] -s EXTRA_EXPORTED_RUNTIME_METHODS=['ccall','cwrap']
SET FINAL_EXTENSION=js
) else (
SET FINAL_EXTENSION=html
)
IF %DEBUG% EQU 0 (
echo Compiling in release mode
SET CUSTOM_FLAGS=%CUSTOM_FLAGS% -O2 -DNDEBUG -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 -DRT_EMTERPRETER_ENABLED -s WASM=1
) else (
echo Compiling in debug mode
SET CUSTOM_FLAGS=%CUSTOM_FLAGS% -D_DEBUG -s GL_UNSAFE_OPTS=0 -s WARN_ON_UNDEFINED_SYMBOLS=1 -s EXCEPTION_DEBUG=1 -s DEMANGLE_SUPPORT=1 -s ALIASING_FUNCTION_POINTERS=0 -s SAFE_HEAP=1 --emrun
)
SET INCLUDE_DIRS=-I%SHARED% -I%APP% -I../../shared/util/boost -I../../shared/ClanLib-2.0/Sources -I../../shared/Network/enet/include ^
-I%ZLIBPATH%
:compile some libs into a separate thing, otherwise our list of files is too long and breaks stuff
del %APP_NAME%.js*
del %APP_NAME%.html
del %APP_NAME%.wasm*
del %APP_NAME%.data
del %APP_NAME%.mem
del temp.bc
call emcc %CUSTOM_FLAGS% %INCLUDE_DIRS% ^
%ZLIB_SRC% %JPG_SRC% %PARTICLE_SRC% -o temp.bc
call emcc %CUSTOM_FLAGS% %INCLUDE_DIRS% ^
%APP_SRC% %SRC% %COMPONENT_SRC% temp.bc ^
--preload-file ../bin/interface@interface/ --preload-file ../bin/audio@audio/ --preload-file ../bin/dink_html5@dink/ --js-library %SHARED%\html5\SharedJSLIB.js -o %APP_NAME%.%FINAL_EXTENSION%
REM Make sure the file compiled ok
if not exist %APP_NAME%.js beeper.exe /p
IF %USE_HTML5_CUSTOM_MAIN% EQU 1 (
sed 's/RTTemplateName/%APP_NAME%/g' %CUSTOM_TEMPLATE% > %APP_NAME%.html
)
IF "%1" == "nopause" (
echo no pause wanted
) else (
echo Compile complete.
pause
)