::@ECHO OFF
:: %1 - Amount of memory in MB
:: %2 - Selected language code ("en")
:: %3 - Path to the image list .txt-file.
:: %4 & %5 - for the future.

if [%1] == [] (
   set Xmx=2048
) else (
   set Xmx=%1
)
:: check processor architecture and select appropriate jre

set Arch=x64
if "%PROCESSOR_ARCHITECTURE%" == "x86" (
   if not defined PROCESSOR_ARCHITEW6432 set Arch=x86
)

:: Run with 32 bit jre is 64 bit is not present
IF NOT EXIST .\jre_x64\bin\java.exe GOTO JRE32

if "%Arch%" == "x64" (
   GOTO JRE64
) else (
   GOTO JRE32
)


:JRE32
.\jre_x86\bin\java.exe -Xmx%Xmx%m -Djogamp.gluegen.UseTempJarCache=false -Dsun.java2d.d3d=true -Djava.library.path=.\lib32\;.; -jar RomexisViewer.jar %2 %3 %4 %5

exit


:JRE64
.\jre_x64\bin\java.exe -Xmx%Xmx%m -Djogamp.gluegen.UseTempJarCache=false -Dsun.java2d.d3d=true -Djava.library.path=.\lib64\;.; -jar RomexisViewer.jar %2 %3 %4 %5

exit

