PS3 [Research] Modifying the Gaia Visualization (custom_render_plugin/earth.qrc)

[QUOTE = "DeViL303, post: 222337, membro: 22544"] Mod sem nuvens, parece um pouco legal. sprx anexado.

[ATTACH = cheio] 22355 [/ ATTACH]
[ATTACH = cheio] 22356 [/ ATTACH]
[ATTACH = cheio] 22357 [/ ATTACH]



Simplesmente parei de carregar como nuvens removendo esta linha (preenchida com zero):
22359 [/ ANEXO] [/ CITAÇÕES]
Muito bom Muito bom Devil303 teria como por mod relâmpago em alguns países simulando tempestades desculpe eu pensei alto aqui :)
 
@DeViL303

bear with me as I really do not know much about the QRC format itself, or how the lines and other files actually work within the system. Although I have managed to get things extracted from looking at wiki and referencing your batch file, which helped a lot.

I have been playing a bit with the debugger and trying your idea of getting earth and other qrc files playing while on xmb.....with mixed results lol

Patching the custom_render_plugin gives some interesting results, but a few issues, including the lines SPU thread always staying active and being prominent.

I tried a few things like not unloading or stopping the qgl_gaia_app, but it ends up just creating many instances of the same sprx in memory, which will eventually crash the system.

Being that there is an ELF file involved, or multiple, i was thinking that a new qrc would ultimately need built to actually replace the lines.qrc with another one.I just recently seen @pink1 post about creating the qrcf files, which is awesome!

I have some notes taken from the process i was going through, i will post below. I will see if i can get anything useful, as far as a patch or something, but i cannot guarantee that will go smooth! I did find a few useful breakpoints for when gaia is loading, unloading, changing scenes, and loading assets.

qrc magic
51 52 43 43 00 08 9A E0
51 52 43 43 00 08 9A XX




seems that the custom_render_plugin is responsible for loading and unloading qgl_gaia_app and calling exports for it




----------------------------------------------------------

Lines runs in spu thread

Type Status Name PC Details GUID Filename
SceQglLines (1 SPU Thread(s)) Running ID 0x4010200 Priority = 0xFA



----------------------------------------------------------

qglbase.sprx

Text Segment 0x970000
Data Segment 0x9E0000


BP 0x009720C0

LOAD:00000000000020C0 lwz r0, 0x4D4(r9)
LOAD:00000000000020C4 b UNK_LINES_QRC_FILENAME_1



0x970000+0x4CDA0=0x009BCDA0



----------------------------------------------------------

custom_render_plugin.sprx

Text Segment 0xC20000
Data Segment 0xB10000





Loading Plugin (export)

Branch To loading qgl_gaia_app.sprx
00C2C8B0 4BFFFDB0 b 0x00C2C660


BP 0x00CAB2A8
Loading plugin
LOAD:000000000008B2A8 _qgl_gaia_app_CD39A330

Refs (0xC20000+offset)
LOAD:00000000000037AC bl _qgl_gaia_app_CD39A330

r3 and r4 are pointers to what looks like gaia arguments for planet
r5-r7 other planet values?
r8 unknown pointer
r9 temp value put into r10 shifted (vsh handle?)
r12 temp memory?
r13 ptr to ptr unknown 0 value?

r0=0000000000C237A4 r8=00000000200401C8 r16=0000000000000000 r24=0000000000000000
r1=00000000D0008E50 r9=0100002A00000000 r17=0000000000000000 r25=0000000000000780
r2=0000000000B1BD60 r10=000000000100002A r18=0000000000000000 r26=0000000000000438
r3=00000000202B1100 r11=0000000000000000 r19=0000000000000000 r27=0000000000000000
r4=00000000202B1D08 r12=0000000020040000 r20=0000000000000000 r28=00000000200A4504
r5=0000000000000130 r13=0000000010007060 r21=0000000000000000 r29=00000000202B1100
r6=0000000000000001 r14=0000000000000000 r22=0000000000000000 r30=00000000200A4500
r7=0000000000005FD6 r15=0000000000000000 r23=0000000000000000 r31=00000000200A4500

xer=0000000020000000 ctr=0000000000603994 lr=0000000000C237B0 fpscr=BE224400

cr=28000022 cr0=EQ cr1=LT cr2= cr3= cr4= cr5= cr6=EQ cr7=EQ

pc=0000000000CAB2A8 li r12,0x0





Loading Textures and assets (export)

BP 0x00CAB270
Called when initially loading textures
Called directly after initial plugin loading and when starting a new track, triggering gaia
LOAD:000000000008B270 _qgl_gaia_app_C913B489

Refs (0xC20000+offset)
LOAD:000000000001716C bl _qgl_gaia_app_C913B489
LOAD:00000000000171F8 bl _qgl_gaia_app_C913B489
LOAD:00000000000178D0 bl _qgl_gaia_app_C913B489
LOAD:0000000000017908 bl _qgl_gaia_app_C913B489
LOAD:0000000000017B48 bl _qgl_gaia_app_C913B489
LOAD:0000000000017BD4 bl _qgl_gaia_app_C913B489
LOAD:0000000000017CE8 bl _qgl_gaia_app_C913B489
LOAD:0000000000017D4C bl _qgl_gaia_app_C913B489


Writes data to 0x202ACD80 in memory when loading


r3 unknown pointer
r4-r7 unknown values

r10 pointer
00CB0000 45 79 65 00 00 00 00 00 45 6E 76 52 6F 74 00 00 Eye.....EnvRot..
00CB0010 53 68 61 64 6F 77 50 61 72 61 6D 73 00 00 00 00 ShadowParams....
00CB0020 4C 75 6D 69 6E 61 6E 63 65 50 61 72 61 6D 73 00 LuminanceParams.
00CB0030 52 65 66 72 61 63 74 50 61 72 61 6D 73 00 00 00 RefractParams...
00CB0040 53 75 70 65 72 53 61 6D 70 6C 69 6E 67 00 00 00 SuperSampling...
00CB0050 4E 6F 72 6D 61 6C 4D 61 70 00 00 00 00 00 00 00 NormalMap.......
00CB0060 45 6E 76 4D 61 70 00 00 44 69 66 66 75 73 65 4D EnvMap..DiffuseM
00CB0070 61 70 00 00 00 00 00 00 42 61 63 6B 67 72 6F 75 ap......Backgrou
00CB0080 6E 64 4D 61 70 00 00 00 54 65 78 74 75 72 65 32 ndMap...Texture2
00CB0090 44 4F 62 6A 65 63 74 00 63 6F 6D 6D 6F 6E 3A 3A DObject.common::
00CB00A0 47 65 74 43 6F 6D 6D 6F 6E 48 65 61 70 28 29 00 GetCommonHeap().
00CB00B0 4E 4F 20 53 53 20 20 20 20 28 4E 4F 20 53 48 41 NO SS (NO SHA
00CB00C0 44 29 00 00 00 00 00 00 43 48 45 41 50 20 53 53 D)......CHEAP SS
00CB00D0 20 28 4E 4F 20 53 48 41 44 29 00 00 00 00 00 00 (NO SHAD)......
00CB00E0 46 55 4C 4C 20 53 53 20 20 28 4E 4F 20 53 48 41 FULL SS (NO SHA
00CB00F0 44 29 00 00 00 00 00 00 4E 4F 20 53 53 20 20 20 D)......NO SS
00CB0100 20 00 00 00 00 00 00 00 43 48 45 41 50 20 53 53 .......CHEAP SS
00CB0110 20 00 00 00 00 00 00 00 46 55 4C 4C 20 53 53 20 .......FULL SS

r11 and r12 varies

r0=0000000000000100 r8=8000000000564000 r16=0000000000000000 r24=0000000000B14398
r1=00000000D0008ED0 r9=0000000000000002 r17=0000000000000000 r25=0000000000000000
r2=0000000000B1BD60 r10=0000000000CB0000 r18=0000000000000000 r26=00000000D0009FD0
r3=00000000202A5080 r11=00000000202A5080 r19=0000000000000000 r27=0000000000000000
r4=0000000000000000 r12=80000000003B4680 r20=0000000000000000 r28=00000000200A3980
r5=0000000000000000 r13=0000000010007060 r21=0000000000000000 r29=0000000000000000
r6=0000000000000001 r14=0000000000000000 r22=0000000000000000 r30=00000000D0008F80
r7=0000000000000085 r15=0000000000000000 r23=0000000000000000 r31=00000000202A5080

xer=0000000000000000 ctr=0000000000000000 lr=0000000000C37170 fpscr=BE264400

cr=24004044 cr0=EQ cr1=GT cr2= cr3= cr4=GT cr5= cr6=GT cr7=GT

pc=0000000000CAB270 li r12,0x0





Changing Scenes (export)

BP 0x00CAB238
00CAB238 39800000 li r12,0x0

Gets called when changing scenes, during playing music
LOAD:000000000008B238 _qgl_gaia_app_824658CC

Refs (0xC20000+offset)
LOAD:00000000000100E0 bl _qgl_gaia_app_824658CC


On Scene Change (r11 varies)

r0=0000000001A7C81C r8=0000000010000060 r16=0000000000000000 r24=0000000000000000
r1=00000000D0008F40 r9=0000000000000002 r17=0000000000000000 r25=0000000000000000
r2=000000000123B2D0 r10=0000000010000080 r18=0000000000000000 r26=00000000D0009FD0
r3=000000002021BC00 r11=FFFCC90AC7D1DD7F r19=0000000000000000 r27=0000000000000000
r4=0000000010007060 r12=00000000012325D4 r20=0000000000000000 r28=0000000000746398
r5=0000000010007060 r13=0000000010007060 r21=0000000000000000 r29=0000000000000003
r6=0000000000000000 r14=0000000000000000 r22=0000000000000000 r30=000000002005FA80
r7=000000001000007C r15=0000000000000000 r23=0000000000000000 r31=000000002021BC00

xer=0000000000000000 ctr=0000000001A7C81C lr=0000000000C300E4 fpscr=BE204400

cr=22004044 cr0=EQ cr1=EQ cr2= cr3= cr4=GT cr5= cr6=GT cr7=GT

pc=0000000000CAB25C bctrl






Stopping plugin (export)

BP 0x00CAB858
00CAB858 39800000 li r12,0x0

LOAD:000000000008B858 _sysPrxForUser_sys_prx_stop_module

Refs (0xC20000+offset)
LOAD:00000000000034E8 bl _sysPrxForUser_sys_prx_stop_module

BP 0x00C234E8
00C234E8 48088371 bl 0x00CAB858


r0=0000000000C24534 r8=00000000D0008EE8 r16=0000000000000000 r24=0000000000000000
r1=00000000D0008E70 r9=0000000000B12C68 r17=0000000000000000 r25=0000000000000000
r2=0000000000B1BD60 r10=00000000200A9654 r18=0000000000000000 r26=00000000D0009FD0
r3=0000000023231D16 r11=0000000000B108E0 r19=0000000000000000 r27=00000000200A503C
r4=0000000000000000 r12=00000000009E29AC r20=0000000000000000 r28=00000000200A4500
r5=0000000000000000 r13=0000000010007060 r21=0000000000000000 r29=0000000023231D16
r6=00000000D0008EE0 r14=0000000000000000 r22=0000000000000000 r30=0000000000000000
r7=0000000000000000 r15=0000000000000000 r23=0000000000000000 r31=0000000000000008

xer=0000000020000000 ctr=0000000000C23550 lr=0000000000C24534 fpscr=AEA04400

cr=28000024 cr0=EQ cr1=LT cr2= cr3= cr4= cr5= cr6=EQ cr7=GT

pc=0000000000C234E8 bl 0x00CAB858







Unloading plugin (export)

BP 0xCAB970
00CAB970 39800000 li r12,0x0

LOAD:000000000008B970 _sysPrxForUser_sys_prx_unload_module

Refs (0xC20000+offset)
LOAD:0000000000003508 bl _sysPrxForUser_sys_prx_unload_module

BP 0xC23508
00C23508 48088469 bl 0x00CAB970


Do not NOP unload plugin (BAD IDEA! NOT STABLE! WILL KEEP OPENING NEW INSTANCES)
00C23508 60000000 nop

Plugin stays loaded after pressing circle or PS button, but still switches to lines.qrc on exit




Patching out all the plugin stop/unload has same result basically, with multiple instances being opened and still loading lines.qrc on exit
Also can crash (DATA_HTAB_MISS) after a few open/close music player

00C23540 7C832378 mr r3,r4
00C23544 60000000 nop PIPE
00C23548 7C832378 mr r3,r4
00C2354C 60000000 nop PIPE
00C23550 7C832378 mr r3,r4
00C23554 60000000 nop PIPE
00C23558 7C832378 mr r3,r4
00C2355C 60000000 nop




----------------------------------------------------------

qgl_gaia_app.sprx

Text Segment 0x1BD0000
Data Segment 0x1230000


Type Status Name PC Details GUID Filename
SceQglGaia (1 SPU Thread(s)) Running ID 0x4010400 Priority = 0xFA




Type Status Name PC Details GUID Filename
0x230F0F18 gaia_app_module Attrib = 0x00000000, Start = 0x012322FC, Stop = 0x01232304, Segments = 0x00000002 /dev_flash/vsh/module/qgl_gaia_app.sprx


gets unloaded when pressing PS button or circle to exit music player



----------------------------------------------------------


audioplayer_plugin.sprx

Text Segment 0x19F0000
Data Segment 0x11C0000

stays loaded when pressing PS button to exit music player and music stays playing

gets unloaded when pressing circle to exit music player


----------------------------------------------------------


soundvisualizer_plugin.sprx

Text Segment 0x1350000
Data Segment 0x1370000


stays loaded even when pressing circle to exit music player
Interesting stuff thanks for the notes and thanks for taking a look. So maybe we can make a lines.qrc with some earth.qrc contents or something. Pink1s tool will help there anyway if it is possible.

What makes it a little complicated IMO is that earth.qrc seems to have its own dedicated sprx but lines.qrc is called by custom_render_plugin.sprx which we need for lots of stuff apart from lines.qrc so we cant really replace that sprx.

@DeViL303 I paste You few pages ago i.e guetzli. It is Google app to make very high quality and lightweight JPEGs. It is slow but You will not find better I think.
https://github.com/google/guetzli/
Thanks, I missed that. Looks great.
 
Anybody know of a small command line tool for converting png to jpeg? I could use imagemagick if I cant find a lightweight tool but its 32MB so would rather not.

I made this tool... it's quite small (43kb if you have msvbvm50.dll already installed).
WIth the runtime install the zip is 958kb. That dll is used by most of my tools, so you probably have the runtime installed.

Usage: drag & drop the image file and it will convert the image (*.gif, *.tif, *.bmp, *.png) to *.jpg in the same path of the original file.

Add /png, /tif, /gif, /bmp or /jpg to the end of the command line if you need to convert to one of these other formats.

Add /replace if you need to replace the existing image.

You can drag & drop a single file or multiple images.
 

Attachments

Usage: drag & drop the image file and it will convert the image (*.gif, *.tif, *.bmp, *.png) to *.jpg in the same path of the original file.

Add /png, /tif, /gif, /bmp or /jpg to the end of the command line if you need to convert to one of these other formats.
Thanks aldo. That is great. I just realized I need to go the other way too. From JPG to PNG, can it do that?

I have been trying
Code:
cimg flatmap_clouds.jpg /png

Also what quality is it using or can I set that? ideally it would be 100% as there are lots of operations I do not want to risk losing any quality at all in each one. I need to go from JPG to PNG and then back to JPG for injection in some cases depending which images are supplied to the BAT.
 
Last edited:
Thanks aldo. That is great. I just realized I need to go the other way too. From JPG to PNG, can it do that?

I have been trying
Code:
cimg flatmap_clouds.jpg /png

Also what quality is it using or can I set that? ideally it would be 100% as there are lots of operations I do not want to risk losing any quality at all in each one. I need to go from JPG to PNG and then back to JPG for injection in some cases depending which images are supplied to the BAT.

Oops I forgot to add the switch /png. Anyway by it should convert *.jpg to *.png

I updated the zip including 2 versions (one for png and other for jpg). Also added the missing switch and changed the jpg quality to 100%
 

Attachments

Last edited:
Oops I forgot to add the switch /png. Anyway default it convert should convert *.jpg to *.png

I updated the zip including 2 versions (one for png and other for jpg). Also added the missing switch and changed the jpg quality to 100%
Awesome. So easy to use.
 
Here is QRC Injector v2.0.4

EDIT: small update from 2.0 , just some onscreen text changed.

Code:
cls
@echo off
echo                         +----------------------+
echo                               QRC Injector
echo                                   v2.0.4
echo                           Support at PSX-Place
echo                         +----------------------+
echo                         JPG/PNG REQUIREMENTS:
echo.              If using tile_clouds.jpg it must be 512x512
echo.              If using tile_ground.jpg it must be 512x512
echo.              If using tile_specular.jpg it must be 512x512
echo               If using face_clouds.jpg it must be 1024x1024
echo               If using face_ground.jpg it must be 1024x1024
echo               If using face_specular.jpg it must be 1024x1024
echo               If using flatmap_clouds.jpg it can be any size
echo               If using flatmap_ground.jpg it can be any size
echo               If using flatmap_specular.png it can be any size
echo               If using flatmap_clouds.png it can be any size
echo               If using flatmap_ground.png it can be any size
echo               If using flatmap_specular.jpg it can be any size
echo               If using cubemap_clouds.jpg it must be 4096x3072
echo               If using cubemap_ground.jpg it must be 4096x3072
echo               If using cubemap_specular.jpg it must be 4096x3072
echo               If stars.png OR stars.jpg exists it will be injected (1024x1024)
echo               If using logo.jpg and fill.jpg they must be 1024x1024
echo               If using 0.jpg to 5.jpg they must all be 1024x1024
echo               If using banner.jpg it must be 4096x512 fill.jpg 1024x1024
echo               If using tile.jpg it must be 512x512
@pause
:options
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo +------------------------------------------------------------------------------+
echo                             QRC Injector v2.0.4
echo.
echo                               OPTIONS MENU
echo +------------------------------------------------------------------------------+
echo                        SELECT AN OPTION FROM 0 to 9
echo +------------------------------------------------------------------------------+
echo 0)  Apply flatmap_clouds, flatmap_ground and flatmap_specular (jpg or png)
echo 1)  Apply tile_clouds.jpg tile_ground.jpg and tile_specular.jpg to all 72 slots
echo 2)  Apply face_clouds.jpg face_ground.jpg face_specular.jpg to all 6 faces
echo 3)  Apply cubemap_clouds.jpg cubemap_ground.jpg and cubemap_specular.jpg
echo 4)  Apply logo.jpg to only 2 opposite faces on the equator, fill.jpg the rest
echo 5)  Apply logo.jpg to 4 faces around the equator, fill.jpg north+south
echo 6)  Apply individual 0.jpg to 5.jpg to the 6 faces
echo 7)  Apply banner.jpg all around the equator like a belt
echo 8)  Clone tile.jpg to 4k and apply wrapped with correct distortion
echo 9)  Clone tile.jpg to 8k and apply wrapped with correct distortion
echo.
echo.
echo.
echo.
set /p op=Type option:
if "%op%"=="0" goto flatmap_to_qrc_info
if "%op%"=="1" goto tile_to_qrc_info
if "%op%"=="2" goto face_to_qrc_info
if "%op%"=="3" goto cubemap_to_qrc_info
if "%op%"=="4" goto logo1_info
if "%op%"=="5" goto logo2_info
if "%op%"=="6" goto 6_sides_info
if "%op%"=="7" goto banner_info
if "%op%"=="8" goto create_4k_from_512x512_info
if "%op%"=="9" goto create_8k_from_512x512_info
:flatmap_to_qrc_info
echo .
echo You chose to inject flatmap_clouds, flatmap_ground and flatmap_specular (jpg OR png)
echo If stars.jpg OR stars.png exist they will be injected too.
echo Working...
Goto flatmap_to_qrc
:tile_to_qrc_info
echo .
echo You chose to inject tile_clouds.jpg tile_ground.jpg and tile_specular.jpg (512x512)
echo The images will be applied to every one of the 24 slots in all 3 layers
echo If stars.jpg OR stars.png exist they will be injected too.
echo Working....
goto tile_to_qrc
:face_to_qrc_info
echo .
echo You chose to inject face.jpg (1024x1024) to earth.qrc
echo The jpg will be applied to every one of the 6 cube faces in all 3 layers
echo If stars.jpg OR stars.png exist they will be injected too.
echo Working....
goto face_to_qrc
:cubemap_to_qrc_info
echo .
echo You chose to inject cubemap.jpg (4096x3072) to earth.qrc
echo The 3 cubemap jpgs will be applied all around the cube in all 3 layers
echo If stars.jpg OR stars.png exist they will be injected too.
echo Working....
goto cubemap_to_qrc
:logo1_info
echo .
echo You chose to inject logo.jpg and fill.jpg (1024x1024) to earth.qrc
echo The logo.jpg will be applied front + back faces, fill.jpg on sides + top + bottom
echo If stars.jpg OR stars.png exist they will be injected too.
if not exist logo.jpg goto file_not_found_logo
if not exist fill.jpg goto file_not_found_fill
echo Working....
goto logo_to_qrc
:logo2_info
echo .
echo You chose to inject logo.jpg and fill.jpg (1024x1024) to earth.qrc
echo The logo.jpg will be applied to front + back + side faces, fill.jpg to top + bottom
echo If stars.jpg OR stars.png exist they will be injected too.
if not exist logo.jpg goto file_not_found_logo
if not exist fill.jpg goto file_not_found_fill
echo Working....
goto logo2_to_qrc
:banner_info
echo .
echo You chose to inject banner.jpg (4096x512) to earth.qrc
echo The banner.jpg will be applied all around the equator lke a belt
echo If stars.jpg OR stars.png exist they will be injected too.
if not exist banner.jpg goto file_not_found_banner
if not exist fill.jpg goto file_not_found_fill
echo Working....
goto banner_to_qrc
:6_sides_info
echo .
echo You chose to inject 6 individual sides 0.jpg to 5.jpg (1024x1024) to earth.qrc
echo These will be applied to every face using official numbering of the faces
echo If stars.jpg OR stars.png exist they will be injected too.
if not exist 0.jpg goto file_not_found_0
if not exist 1.jpg goto file_not_found_1
if not exist 2.jpg goto file_not_found_2
if not exist 3.jpg goto file_not_found_3
if not exist 4.jpg goto file_not_found_4
if not exist 5.jpg goto file_not_found_5
echo Working....
goto 6_sides_to_qrc
:create_4k_from_512x512_info
echo .
echo You chose to clone tile.jpg (512x512) into a 4096x2048 jpg
echo The tile.jpg will be prepared into 4k and then injected as wrapper
echo If stars.jpg OR stars.png exist they will be injected too.
if not exist tile.jpg goto file_not_found_tile
echo.
echo Working....
goto create_4k_from_512x512
:create_8k_from_512x512_info
echo .
echo You chose to clone tile.jpg (512x512) into a 8192x4096 jpg.
echo The tile.jpg will be prepared into 8k and then injected as wrapper
echo If stars.jpg OR stars.png exist they will be injected too.
if not exist tile.jpg goto file_not_found_tile
echo.
echo Working....
goto create_8k_from_512x512
:flatmap_to_qrc
echo checking for flatmap PNGs or JPGs
if exist flatmap_clouds.png goto convert_flatmap_png_to_qrc
if exist flatmap_ground.png goto convert_flatmap_png_to_qrc
if exist flatmap_specular.png goto convert_flatmap_png_to_qrc
echo .
echo No flatmap_*.png images found..searching for flatmap_*.jpgs.
if exist flatmap_clouds.jpg goto convert_flatmap_jpg_to_qrc
if exist flatmap_ground.jpg goto convert_flatmap_jpg_to_qrc
if exist flatmap_specular.jpg goto convert_flatmap_jpg_to_qrc
if exist stars.jpg goto convert_jpg_to_dds
echo .
echo No flatmap_*.jpg images found
pause
goto options
:convert_flatmap_png_to_qrc
if exist "bin\temp\" DEL "bin\temp" /Q /S
if exist earth.qrc DEL "earth.qrc" /Q /S
if not exist "bin\temp\Cube_faces" MkDir "bin\temp\Cube_faces"
if not exist "bin\temp\Tiles" MkDir "bin\temp\Tiles"
echo Completed: bin\temp folder cleared
echo .
echo converting PNG flatmaps to Cubemaps
bin\planettool.exe --output cubex "bin\temp\cubemap_clouds.png" --input latlong "flatmap_clouds.png" --rotate 0 45 0 --size 1024
bin\planettool.exe --output cubex "bin\temp\cubemap_ground.png" --input latlong "flatmap_ground.png" --rotate 0 45 0 --size 1024
bin\planettool.exe --output cubex "bin\temp\cubemap_specular.png" --input latlong "flatmap_specular.png" --rotate 0 45 0 --size 1024
echo .
echo PNG Cubemaps created
echo .
bin\cimg_png "bin\temp\cubemap_clouds.png"
bin\cimg_png "bin\temp\cubemap_ground.png"
bin\cimg_png "bin\temp\cubemap_specular.png"
echo .
echo JPG Cubemaps created
bin\jpegtran -rotate 180 "bin\temp\cubemap_clouds.jpg" "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg"
bin\jpegtran -rotate 180 "bin\temp\cubemap_ground.jpg" "bin\temp\Cube_faces\cubemap_ground_rotated.jpg"
bin\jpegtran -rotate 180 "bin\temp\cubemap_specular.jpg" "bin\temp\Cube_faces\cubemap_specular_rotated.jpg"
echo Completed: cubemaps rotated to suit PS3 orientation
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face5.jpg"
echo Completed: 6 cloud faces created
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face5.jpg"
echo Completed: 6 ground faces created
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face5.jpg"
echo Completed: 6 specular faces created
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\01.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\02.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\03.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\04.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\05.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\06.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\07.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\08.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\09.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\10.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\11.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\12.jpg"
echo Completed: 12 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\13.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\14.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\15.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\16.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\17.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\18.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\19.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\20.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\21.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\22.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\23.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\24.jpg"
echo Completed: 24 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\25.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\26.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\27.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\28.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\29.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\30.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\31.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\32.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\33.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\34.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\35.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\36.jpg"
echo Completed: 36 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\37.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\38.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\39.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\40.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\41.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\42.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\43.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\44.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\45.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\46.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\47.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\48.jpg"
echo Completed: 48 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\49.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\50.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\51.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\52.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\53.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\54.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\55.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\56.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\57.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\58.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\59.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\60.jpg"
echo Completed: 60 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\61.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\62.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\63.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\64.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\65.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\66.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\67.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\68.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\69.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\70.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\71.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\72.jpg"
echo Completed: 72 out of 72 jpgs cut
goto inject_jpgs
:convert_flatmap_jpg_to_qrc
if exist "bin\temp\" DEL "bin\temp" /Q /S
if exist earth.qrc DEL "earth.qrc" /Q /S
if not exist "bin\temp\Cube_faces" MkDir "bin\temp\Cube_faces"
if not exist "bin\temp\Tiles" MkDir "bin\temp\Tiles"
echo Completed: bin\temp folder cleared
echo .
echo Converting JPGs to PNG
bin\cimg_png flatmap_clouds.jpg
bin\cimg_png flatmap_ground.jpg
bin\cimg_png flatmap_specular.jpg
echo flatmap PNGs created
echo .
echo converting PNG flatmaps to Cubemaps
bin\planettool.exe --output cubex "bin\temp\cubemap_clouds.png" --input latlong "flatmap_clouds.png" --rotate 0 45 0 --size 1024
bin\planettool.exe --output cubex "bin\temp\cubemap_ground.png" --input latlong "flatmap_ground.png" --rotate 0 45 0 --size 1024
bin\planettool.exe --output cubex "bin\temp\cubemap_specular.png" --input latlong "flatmap_specular.png" --rotate 0 45 0 --size 1024
echo .
echo PNG Cubemaps created
echo .
bin\cimg_jpg "bin\temp\cubemap_clouds.png"
bin\cimg_jpg "bin\temp\cubemap_ground.png"
bin\cimg_jpg "bin\temp\cubemap_specular.png"
echo .
echo JPG Cubemaps created
bin\jpegtran -rotate 180 "bin\temp\cubemap_clouds.jpg" "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg"
bin\jpegtran -rotate 180 "bin\temp\cubemap_ground.jpg" "bin\temp\Cube_faces\cubemap_ground_rotated.jpg"
bin\jpegtran -rotate 180 "bin\temp\cubemap_specular.jpg" "bin\temp\Cube_faces\cubemap_specular_rotated.jpg"
echo .
echo Completed: cubemaps rotated to suit PS3 orientation
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face5.jpg"
echo Completed: 6 cloud faces created
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face5.jpg"
echo Completed: 6 ground faces created
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face5.jpg"
echo Completed: 6 specular faces created
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\01.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\02.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\03.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\04.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\05.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\06.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\07.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\08.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\09.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\10.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\11.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\12.jpg"
echo Completed: 12 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\13.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\14.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\15.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\16.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\17.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\18.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\19.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\20.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\21.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\22.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\23.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\24.jpg"
echo Completed: 24 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\25.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\26.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\27.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\28.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\29.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\30.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\31.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\32.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\33.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\34.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\35.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\36.jpg"
echo Completed: 36 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\37.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\38.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\39.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\40.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\41.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\42.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\43.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\44.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\45.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\46.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\47.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\48.jpg"
echo Completed: 48 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\49.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\50.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\51.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\52.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\53.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\54.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\55.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\56.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\57.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\58.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\59.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\60.jpg"
echo Completed: 60 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\61.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\62.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\63.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\64.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\65.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\66.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\67.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\68.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\69.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\70.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\71.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\72.jpg"
echo Completed: 72 out of 72 jpgs cut
goto inject_jpgs
:convert_flatmap_jpg_to_qrc
echo stars.jpg found - converting to DDS
bin\nvdxt -file stars.jpg -dxt1c
echo .
goto inject_dds
:inject_dds
echo injecting DDS...
@bin\binsert 0x01F53460 stars.dds bin\temp\earth.qrcf
echo .
echo DDS successully injected - Compressing QRCF....
goto compress_qrcf_to_qrc
:create_4k_from_512x512
if exist "bin\temp\" DEL "bin\temp" /Q /S
if exist earth.qrc DEL "earth.qrc" /Q /S
if not exist "bin\temp\Cube_faces" MkDir "bin\temp\Cube_faces"
if not exist "bin\temp\Tiles" MkDir "bin\temp\Tiles"
echo Completed: bin\temp folder cleared
bin\jpegtran -crop 4096x2048+0+0 -outfile 4096x2048.jpg tile.jpg
bin\jpegtran -drop +512+0 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +1024+0 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +1536+0 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
echo .
bin\jpegtran -drop +2048+0 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +2560+0 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +3072+0 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +3584+0 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
echo Step 1 of 4 completed successfully
bin\jpegtran -drop +0+512 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +512+512 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +1024+512 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +1536+512 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
echo .
bin\jpegtran -drop +2048+512 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +2560+512 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +3072+512 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +3584+512 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
echo Step 2 of 4 completed successfully
bin\jpegtran -drop +0+1024 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +512+1024 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +1024+1024 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +1536+1024 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
echo .
bin\jpegtran -drop +2048+1024 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +2560+1024 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +3072+1024 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +3584+1024 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
echo Step 3 of 4 completed successfully
bin\jpegtran -drop +0+1536 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +512+1536 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +1024+1536 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +1536+1536 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
echo .
bin\jpegtran -drop +2048+1536 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +2560+1536 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +3072+1536 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
bin\jpegtran -drop +3584+1536 tile.jpg -outfile 4096x2048.jpg 4096x2048.jpg
echo Step 4 of 4 completed successfully
echo .
copy 4096x2048.jpg "bin\temp\flatmap_clouds.jpg"
copy "bin\temp\flatmap_clouds.jpg" "bin\temp\flatmap_ground.jpg"
copy "bin\temp\flatmap_clouds.jpg" "bin\temp\flatmap_specular.jpg"
echo .
echo Converting JPGs to PNG
bin\cimg_png bin\temp\flatmap_clouds.jpg
bin\cimg_png bin\temp\flatmap_ground.jpg
bin\cimg_png bin\temp\flatmap_specular.jpg
echo flatmap PNGs created
echo .
echo converting PNG flatmaps to Cubemaps
bin\planettool.exe --output cubex "bin\temp\cubemap_clouds.png" --input latlong "bin\temp\flatmap_clouds.png" --rotate 0 45 0 --size 1024
bin\planettool.exe --output cubex "bin\temp\cubemap_ground.png" --input latlong "bin\temp\flatmap_ground.png" --rotate 0 45 0 --size 1024
bin\planettool.exe --output cubex "bin\temp\cubemap_specular.png" --input latlong "bin\temp\flatmap_specular.png" --rotate 0 45 0 --size 1024
echo .
echo PNG Cubemaps created
echo .
bin\cimg_jpg bin\temp\cubemap_clouds.png
bin\cimg_jpg bin\temp\cubemap_ground.png
bin\cimg_jpg bin\temp\cubemap_specular.png
echo .
echo JPG Cubemaps created
bin\jpegtran -rotate 180 "bin\temp\cubemap_clouds.jpg" "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg"
bin\jpegtran -rotate 180 "bin\temp\cubemap_ground.jpg" "bin\temp\Cube_faces\cubemap_ground_rotated.jpg"
bin\jpegtran -rotate 180 "bin\temp\cubemap_specular.jpg" "bin\temp\Cube_faces\cubemap_specular_rotated.jpg"
echo .
echo Completed: cubemaps rotated to suit PS3 orientation
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face5.jpg"
echo Completed: 6 cloud faces created
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face5.jpg"
echo Completed: 6 ground faces created
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face5.jpg"
echo Completed: 6 specular faces created
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\01.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\02.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\03.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\04.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\05.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\06.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\07.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\08.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\09.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\10.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\11.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\12.jpg"
echo Completed: 12 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\13.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\14.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\15.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\16.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\17.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\18.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\19.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\20.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\21.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\22.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\23.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\24.jpg"
echo Completed: 24 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\25.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\26.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\27.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\28.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\29.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\30.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\31.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\32.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\33.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\34.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\35.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\36.jpg"
echo Completed: 36 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\37.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\38.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\39.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\40.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\41.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\42.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\43.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\44.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\45.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\46.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\47.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\48.jpg"
echo Completed: 48 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\49.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\50.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\51.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\52.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\53.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\54.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\55.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\56.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\57.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\58.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\59.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\60.jpg"
echo Completed: 60 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\61.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\62.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\63.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\64.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\65.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\66.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\67.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\68.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\69.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\70.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\71.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\72.jpg"
echo Completed: 72 out of 72 jpgs cut
goto inject_jpgs
:create_8k_from_512x512
if exist "bin\temp\" DEL "bin\temp" /Q /S
if exist earth.qrc DEL "earth.qrc" /Q /S
if not exist "bin\temp\Cube_faces" MkDir "bin\temp\Cube_faces"
if not exist "bin\temp\Tiles" MkDir "bin\temp\Tiles"
echo Completed: bin\temp folder cleared
bin\jpegtran -crop 4096x2048+0+0 -outfile temp.jpg tile.jpg
bin\jpegtran -drop +512+0 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +1024+0 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +1536+0 tile.jpg -outfile temp.jpg temp.jpg
echo .
bin\jpegtran -drop +2048+0 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +2560+0 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +3072+0 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +3584+0 tile.jpg -outfile temp.jpg temp.jpg
echo Step 1 of 8 completed successfully
bin\jpegtran -drop +0+512 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +512+512 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +1024+512 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +1536+512 tile.jpg -outfile temp.jpg temp.jpg
echo .
bin\jpegtran -drop +2048+512 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +2560+512 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +3072+512 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +3584+512 tile.jpg -outfile temp.jpg temp.jpg
echo Step 2 of 8 completed successfully
bin\jpegtran -drop +0+1024 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +512+1024 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +1024+1024 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +1536+1024 tile.jpg -outfile temp.jpg temp.jpg
echo .
bin\jpegtran -drop +2048+1024 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +2560+1024 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +3072+1024 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +3584+1024 tile.jpg -outfile temp.jpg temp.jpg
echo Step 3 of 8 completed successfully
bin\jpegtran -drop +0+1536 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +512+1536 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +1024+1536 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +1536+1536 tile.jpg -outfile temp.jpg temp.jpg
echo .
bin\jpegtran -drop +2048+1536 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +2560+1536 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +3072+1536 tile.jpg -outfile temp.jpg temp.jpg
bin\jpegtran -drop +3584+1536 tile.jpg -outfile temp.jpg temp.jpg
echo Step 4 of 8 completed successfully
bin\jpegtran -crop 8192x4096+0+0 -outfile 8192x4096.jpg temp.jpg
echo .
echo Step 5 of 8 completed successfully
bin\jpegtran -drop +4096+0 temp.jpg -outfile 8192x4096.jpg 8192x4096.jpg
echo .
echo Step 6 of 8 completed successfully
bin\jpegtran -drop +0+2048 temp.jpg -outfile 8192x4096.jpg 8192x4096.jpg
echo .
echo Step 7 of 8 completed successfully
bin\jpegtran -drop +4096+2048 temp.jpg -outfile 8192x4096.jpg 8192x4096.jpg
echo .
echo Step 8 of 8 completed successfully
DEL "temp.jpg" /Q /S
echo .
copy 8192x4096.jpg "bin\temp\flatmap_clouds.jpg"
copy "bin\temp\flatmap_clouds.jpg" "bin\temp\flatmap_ground.jpg"
copy "bin\temp\flatmap_clouds.jpg" "bin\temp\flatmap_specular.jpg"
echo .
echo Converting JPGs to PNG
bin\cimg_png bin\temp\flatmap_clouds.jpg
bin\cimg_png bin\temp\flatmap_ground.jpg
bin\cimg_png bin\temp\flatmap_specular.jpg
echo flatmap PNGs created
echo .
echo converting PNG flatmaps to Cubemaps
bin\planettool.exe --output cubex "bin\temp\cubemap_clouds.png" --input latlong "bin\temp\flatmap_clouds.png" --rotate 0 45 0 --size 1024
bin\planettool.exe --output cubex "bin\temp\cubemap_ground.png" --input latlong "bin\temp\flatmap_ground.png" --rotate 0 45 0 --size 1024
bin\planettool.exe --output cubex "bin\temp\cubemap_specular.png" --input latlong "bin\temp\flatmap_specular.png" --rotate 0 45 0 --size 1024
echo .
echo PNG Cubemaps created
echo .
bin\cimg_jpg bin\temp\cubemap_clouds.png
bin\cimg_jpg bin\temp\cubemap_ground.png
bin\cimg_jpg bin\temp\cubemap_specular.png
echo .
echo JPG Cubemaps created
bin\jpegtran -rotate 180 "bin\temp\cubemap_clouds.jpg" "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg"
bin\jpegtran -rotate 180 "bin\temp\cubemap_ground.jpg" "bin\temp\Cube_faces\cubemap_ground_rotated.jpg"
bin\jpegtran -rotate 180 "bin\temp\cubemap_specular.jpg" "bin\temp\Cube_faces\cubemap_specular_rotated.jpg"
echo .
echo Completed: cubemaps rotated to suit PS3 orientation
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face5.jpg"
echo Completed: 6 cloud faces created
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face5.jpg"
echo Completed: 6 ground faces created
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face5.jpg"
echo Completed: 6 specular faces created
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\01.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\02.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\03.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\04.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\05.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\06.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\07.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\08.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\09.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\10.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\11.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\12.jpg"
echo Completed: 12 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\13.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\14.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\15.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\16.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\17.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\18.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\19.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\20.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\21.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\22.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\23.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\24.jpg"
echo Completed: 24 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\25.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\26.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\27.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\28.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\29.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\30.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\31.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\32.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\33.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\34.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\35.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\36.jpg"
echo Completed: 36 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\37.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\38.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\39.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\40.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\41.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\42.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\43.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\44.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\45.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\46.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\47.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\48.jpg"
echo Completed: 48 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\49.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\50.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\51.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\52.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\53.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\54.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\55.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\56.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\57.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\58.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\59.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\60.jpg"
echo Completed: 60 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\61.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\62.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\63.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\64.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\65.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\66.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\67.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\68.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\69.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\70.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\71.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\72.jpg"
echo Completed: 72 out of 72 jpgs cut
goto inject_jpgs
:tile_to_qrc
echo .
@if exist earth.qrc DEL "earth.qrc" /Q /S
echo earth.qrc cleared
@if exist "bin\temp\" DEL "bin\temp" /Q /S
echo .
@if not exist "bin\temp\Cube_faces" MkDir "bin\temp\Cube_faces"
@if not exist "bin\temp\Tiles" MkDir "bin\temp\Tiles"
echo Completed: bin\temp folder cleared
bin\jpegtran -crop 1024x1024+0+0 -outfile bin\temp\face_clouds.jpg tile_clouds.jpg
bin\jpegtran -drop +512+0 tile_clouds.jpg -outfile bin\temp\face_clouds.jpg bin\temp\face_clouds.jpg
bin\jpegtran -drop +512+512 tile_clouds.jpg -outfile bin\temp\face_clouds.jpg bin\temp\face_clouds.jpg
echo .
bin\jpegtran -drop +512+512 tile_clouds.jpg -outfile bin\temp\face_clouds.jpg bin\temp\face_clouds.jpg
bin\jpegtran -drop +0+512 tile_clouds.jpg -outfile bin\temp\face_clouds.jpg bin\temp\face_clouds.jpg
bin\jpegtran -crop 4096x3072+1024+0 -outfile bin\temp\cubemap_clouds.jpg bin\temp\face_clouds.jpg
echo Completed: tile_clouds.jpg cloned into 1024x1024 for each of the 6 faces
bin\jpegtran -crop 1024x1024+0+0 -outfile bin\temp\face_ground.jpg tile_ground.jpg
bin\jpegtran -drop +512+0 tile_ground.jpg -outfile bin\temp\face_ground.jpg bin\temp\face_ground.jpg
bin\jpegtran -drop +512+512 tile_ground.jpg -outfile bin\temp\face_ground.jpg bin\temp\face_ground.jpg
echo .
bin\jpegtran -drop +512+512 tile_ground.jpg -outfile bin\temp\face_ground.jpg bin\temp\face_ground.jpg
bin\jpegtran -drop +0+512 tile_ground.jpg -outfile bin\temp\face_ground.jpg bin\temp\face_ground.jpg
bin\jpegtran -crop 4096x3072+1024+0 -outfile bin\temp\cubemap_ground.jpg bin\temp\face_ground.jpg
echo Completed: tile_ground.jpg cloned into 1024x1024 for each of the 6 faces
bin\jpegtran -crop 1024x1024+0+0 -outfile bin\temp\face_specular.jpg tile_specular.jpg
bin\jpegtran -drop +512+0 tile_specular.jpg -outfile bin\temp\face_specular.jpg bin\temp\face_specular.jpg
bin\jpegtran -drop +512+512 tile_specular.jpg -outfile bin\temp\face_specular.jpg bin\temp\face_specular.jpg
echo .
bin\jpegtran -drop +512+512 tile_specular.jpg -outfile bin\temp\face_specular.jpg bin\temp\face_specular.jpg
bin\jpegtran -drop +0+512 tile_specular.jpg -outfile bin\temp\face_specular.jpg bin\temp\face_specular.jpg
bin\jpegtran -crop 4096x3072+1024+0 -outfile bin\temp\cubemap_specular.jpg bin\temp\face_specular.jpg
echo Completed: tile_specular.jpg cloned into 1024x1024 for each of the 6 faces
bin\jpegtran -drop +1024+1024 bin\temp\face_clouds.jpg -outfile bin\temp\cubemap_clouds.jpg bin\temp\cubemap_clouds.jpg
bin\jpegtran -drop +1024+2048 bin\temp\face_clouds.jpg -outfile bin\temp\cubemap_clouds.jpg bin\temp\cubemap_clouds.jpg
echo .
bin\jpegtran -drop +2048+1024 bin\temp\face_clouds.jpg -outfile bin\temp\cubemap_clouds.jpg bin\temp\cubemap_clouds.jpg
bin\jpegtran -drop +3072+1024 bin\temp\face_clouds.jpg -outfile bin\temp\cubemap_clouds.jpg bin\temp\cubemap_clouds.jpg
bin\jpegtran -drop +0+1024 bin\temp\face_clouds.jpg -outfile bin\temp\cubemap_clouds.jpg bin\temp\cubemap_clouds.jpg
echo Completed: face_clouds.jpg cloned into 4096x3072 cubemap cross (clouds)
bin\jpegtran -drop +1024+1024 bin\temp\face_ground.jpg -outfile bin\temp\cubemap_ground.jpg bin\temp\cubemap_ground.jpg
bin\jpegtran -drop +1024+2048 bin\temp\face_ground.jpg -outfile bin\temp\cubemap_ground.jpg bin\temp\cubemap_ground.jpg
echo .
bin\jpegtran -drop +2048+1024 bin\temp\face_ground.jpg -outfile bin\temp\cubemap_ground.jpg bin\temp\cubemap_ground.jpg
bin\jpegtran -drop +3072+1024 bin\temp\face_ground.jpg -outfile bin\temp\cubemap_ground.jpg bin\temp\cubemap_ground.jpg
bin\jpegtran -drop +0+1024 bin\temp\face_ground.jpg -outfile bin\temp\cubemap_ground.jpg bin\temp\cubemap_ground.jpg
echo Completed: face_ground.jpg cloned into 4096x3072 cubemap cross (ground)
bin\jpegtran -drop +1024+1024 bin\temp\face_specular.jpg -outfile bin\temp\cubemap_specular.jpg bin\temp\cubemap_specular.jpg
bin\jpegtran -drop +1024+2048 bin\temp\face_specular.jpg -outfile bin\temp\cubemap_specular.jpg bin\temp\cubemap_specular.jpg
echo .
bin\jpegtran -drop +2048+1024 bin\temp\face_specular.jpg -outfile bin\temp\cubemap_specular.jpg bin\temp\cubemap_specular.jpg
bin\jpegtran -drop +3072+1024 bin\temp\face_specular.jpg -outfile bin\temp\cubemap_specular.jpg bin\temp\cubemap_specular.jpg
bin\jpegtran -drop +0+1024 bin\temp\face_specular.jpg -outfile bin\temp\cubemap_specular.jpg bin\temp\cubemap_specular.jpg
echo Completed: face_specular.jpg cloned into 4096x3072 cubemap cross (specular)
echo .
bin\jpegtran -rotate 180 "bin\temp\cubemap_clouds.jpg" "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg"
bin\jpegtran -rotate 180 "bin\temp\cubemap_ground.jpg" "bin\temp\Cube_faces\cubemap_ground_rotated.jpg"
bin\jpegtran -rotate 180 "bin\temp\cubemap_specular.jpg" "bin\temp\Cube_faces\cubemap_specular_rotated.jpg"
echo Completed: cubemaps rotated to suit PS3 orientation
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face5.jpg"
echo Completed: 6 cloud faces created
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face5.jpg"
echo Completed: 6 ground faces created
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face5.jpg"
echo Completed: 6 specular faces created
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\01.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\02.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\03.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\04.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\05.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\06.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\07.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\08.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\09.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\10.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\11.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\12.jpg"
echo Completed: 12 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\13.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\14.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\15.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\16.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\17.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\18.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\19.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\20.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\21.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\22.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\23.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\24.jpg"
echo Completed: 24 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\25.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\26.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\27.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\28.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\29.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\30.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\31.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\32.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\33.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\34.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\35.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\36.jpg"
echo Completed: 36 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\37.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\38.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\39.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\40.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\41.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\42.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\43.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\44.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\45.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\46.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\47.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\48.jpg"
echo Completed: 48 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\49.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\50.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\51.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\52.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\53.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\54.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\55.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\56.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\57.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\58.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\59.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\60.jpg"
echo Completed: 60 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\61.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\62.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\63.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\64.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\65.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\66.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\67.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\68.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\69.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\70.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\71.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\72.jpg"
echo Completed: 72 out of 72 jpgs cut
goto inject_jpgs
:face_to_qrc
if exist "bin\temp\" DEL "bin\temp" /Q /S
if exist earth.qrc DEL "earth.qrc" /Q /S
if not exist "bin\temp\Cube_faces" MkDir "bin\temp\Cube_faces"
if not exist "bin\temp\Tiles" MkDir "bin\temp\Tiles"
echo Completed: bin\temp folder cleared
bin\jpegtran -crop 4096x3072+1024+0 -outfile bin\temp\cubemap_clouds.jpg face_clouds.jpg
bin\jpegtran -crop 4096x3072+1024+0 -outfile bin\temp\cubemap_ground.jpg face_ground.jpg
echo.
bin\jpegtran -crop 4096x3072+1024+0 -outfile bin\temp\cubemap_specular.jpg face_specular.jpg
echo Completed: Cubemap templates created
bin\jpegtran -drop +1024+1024 face_clouds.jpg -outfile bin\temp\cubemap_clouds.jpg bin\temp\cubemap_clouds.jpg
bin\jpegtran -drop +1024+2048 face_clouds.jpg -outfile bin\temp\cubemap_clouds.jpg bin\temp\cubemap_clouds.jpg
echo .
bin\jpegtran -drop +2048+1024 face_clouds.jpg -outfile bin\temp\cubemap_clouds.jpg bin\temp\cubemap_clouds.jpg
bin\jpegtran -drop +3072+1024 face_clouds.jpg -outfile bin\temp\cubemap_clouds.jpg bin\temp\cubemap_clouds.jpg
bin\jpegtran -drop +0+1024 face_clouds.jpg -outfile bin\temp\cubemap_clouds.jpg bin\temp\cubemap_clouds.jpg
echo Completed: face_clouds.jpg cloned into 4096x3072 cubemap_clouds.jpg
bin\jpegtran -drop +1024+1024 face_ground.jpg -outfile bin\temp\cubemap_ground.jpg bin\temp\cubemap_ground.jpg
bin\jpegtran -drop +1024+2048 face_ground.jpg -outfile bin\temp\cubemap_ground.jpg bin\temp\cubemap_ground.jpg
echo .
bin\jpegtran -drop +2048+1024 face_ground.jpg -outfile bin\temp\cubemap_ground.jpg bin\temp\cubemap_ground.jpg
bin\jpegtran -drop +3072+1024 face_ground.jpg -outfile bin\temp\cubemap_ground.jpg bin\temp\cubemap_ground.jpg
bin\jpegtran -drop +0+1024 face_ground.jpg -outfile bin\temp\cubemap_ground.jpg bin\temp\cubemap_ground.jpg
echo Completed: face_ground.jpg cloned into 4096x3072 cubemap_ground.jpg
bin\jpegtran -drop +1024+1024 face_specular.jpg -outfile bin\temp\cubemap_specular.jpg bin\temp\cubemap_specular.jpg
bin\jpegtran -drop +1024+2048 face_specular.jpg -outfile bin\temp\cubemap_specular.jpg bin\temp\cubemap_specular.jpg
echo .
bin\jpegtran -drop +2048+1024 face_specular.jpg -outfile bin\temp\cubemap_specular.jpg bin\temp\cubemap_specular.jpg
bin\jpegtran -drop +3072+1024 face_specular.jpg -outfile bin\temp\cubemap_specular.jpg bin\temp\cubemap_specular.jpg
bin\jpegtran -drop +0+1024 face_specular.jpg -outfile bin\temp\cubemap_specular.jpg bin\temp\cubemap_specular.jpg
echo Completed: face_specular.jpg cloned into 4096x3072 cubemap_specular.jpg
bin\jpegtran -rotate 180 "bin\temp\cubemap_clouds.jpg" "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg"
bin\jpegtran -rotate 180 "bin\temp\cubemap_ground.jpg" "bin\temp\Cube_faces\cubemap_ground_rotated.jpg"
echo .
bin\jpegtran -rotate 180 "bin\temp\cubemap_specular.jpg" "bin\temp\Cube_faces\cubemap_specular_rotated.jpg"
echo Completed: cubemaps rotated to suit PS3 orientation
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face5.jpg"
echo Completed: 6 cloud faces created
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face5.jpg"
echo Completed: 6 ground faces created
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face5.jpg"
echo Completed: 6 specular faces created
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\01.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\02.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\03.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\04.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\05.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\06.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\07.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\08.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\09.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\10.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\11.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\12.jpg"
echo Completed: 12 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\13.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\14.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\15.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\16.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\17.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\18.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\19.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\20.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\21.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\22.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\23.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\24.jpg"
echo Completed: 24 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\25.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\26.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\27.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\28.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\29.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\30.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\31.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\32.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\33.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\34.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\35.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\36.jpg"
echo Completed: 36 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\37.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\38.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\39.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\40.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\41.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\42.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\43.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\44.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\45.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\46.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\47.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\48.jpg"
echo Completed: 48 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\49.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\50.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\51.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\52.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\53.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\54.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\55.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\56.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\57.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\58.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\59.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\60.jpg"
echo Completed: 60 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\61.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\62.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\63.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\64.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\65.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\66.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\67.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\68.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\69.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\70.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\71.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\72.jpg"
echo Completed: 72 out of 72 jpgs cut
goto inject_jpgs
:cubemap_to_qrc
if exist "bin\temp\" DEL "bin\temp" /Q /S
if exist earth.qrc DEL "earth.qrc" /Q /S
if not exist "bin\temp\Cube_faces" MkDir "bin\temp\Cube_faces"
if not exist "bin\temp\Tiles" MkDir "bin\temp\Tiles"
echo Completed: bin\temp folder cleared
echo .
bin\jpegtran -rotate 180 cubemap_clouds.jpg "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg"
bin\jpegtran -rotate 180 cubemap_ground.jpg "bin\temp\Cube_faces\cubemap_ground_rotated.jpg"
bin\jpegtran -rotate 180 cubemap_specular.jpg "bin\temp\Cube_faces\cubemap_specular_rotated.jpg"
echo Completed: cubemaps rotated to suit PS3 orientation
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_clouds_rotated.jpg" "bin\temp\Cube_faces\clouds_face5.jpg"
echo Completed: 6 cloud faces created
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_ground_rotated.jpg" "bin\temp\Cube_faces\ground_face5.jpg"
echo Completed: 6 ground faces created
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face2.jpg"
echo .
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_specular_rotated.jpg" "bin\temp\Cube_faces\specular_face5.jpg"
echo Completed: 6 specular faces created
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\01.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\02.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\03.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face0.jpg" "bin\temp\Tiles\04.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\05.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\06.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\07.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face1.jpg" "bin\temp\Tiles\08.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\09.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\10.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\11.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face2.jpg" "bin\temp\Tiles\12.jpg"
echo Completed: 12 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\13.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\14.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\15.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face3.jpg" "bin\temp\Tiles\16.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\17.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\18.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\19.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face4.jpg" "bin\temp\Tiles\20.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\21.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\22.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\23.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\clouds_face5.jpg" "bin\temp\Tiles\24.jpg"
echo Completed: 24 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\25.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\26.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\27.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face0.jpg" "bin\temp\Tiles\28.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\29.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\30.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\31.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face1.jpg" "bin\temp\Tiles\32.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\33.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\34.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\35.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face2.jpg" "bin\temp\Tiles\36.jpg"
echo Completed: 36 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\37.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\38.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\39.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face3.jpg" "bin\temp\Tiles\40.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\41.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\42.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\43.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face4.jpg" "bin\temp\Tiles\44.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\45.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\46.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\47.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\ground_face5.jpg" "bin\temp\Tiles\48.jpg"
echo Completed: 48 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\49.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\50.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\51.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face0.jpg" "bin\temp\Tiles\52.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\53.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\54.jpg"
echo .
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\55.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face1.jpg" "bin\temp\Tiles\56.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\57.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\58.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\59.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face2.jpg" "bin\temp\Tiles\60.jpg"
echo Completed: 60 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\61.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\62.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\63.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face3.jpg" "bin\temp\Tiles\64.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\65.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\66.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\67.jpg"
echo .
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face4.jpg" "bin\temp\Tiles\68.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\69.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\70.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\71.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\specular_face5.jpg" "bin\temp\Tiles\72.jpg"
echo Completed: 72 out of 72 jpgs cut
goto inject_jpgs
:logo_to_qrc
if exist "bin\temp\" DEL "bin\temp" /Q /S
if exist earth.qrc DEL "earth.qrc" /Q /S
if not exist "bin\temp\Cube_faces" MkDir "bin\temp\Cube_faces"
if not exist "bin\temp\Tiles" MkDir "bin\temp\Tiles"
echo Completed: bin\temp folder cleared
bin\jpegtran -crop 4096x3072+1024+0 -outfile bin\temp\cubemap.jpg fill.jpg
echo .
bin\jpegtran -drop +1024+1024 logo.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +1024+2048 fill.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +2048+1024 fill.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +3072+1024 logo.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +0+1024 fill.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
echo Completed: logo.jpg and fill.jpg applied into 4096x3072 cubemap cross
echo .
bin\jpegtran -rotate 180 "bin\temp\cubemap.jpg" "bin\temp\Cube_faces\cubemap_rotated.jpg"
echo Completed: cubemap rotated to suit PS3 orientation
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face2.jpg"
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face5.jpg"
echo Completed: Face 0.jpg to 5.jpg cut out
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\01.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\02.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\03.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\04.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\05.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\06.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\07.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\08.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\09.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\10.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\11.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\12.jpg"
echo Completed: 12 out of 72 jpg tiles cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\13.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\14.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\15.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\16.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\17.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\18.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\19.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\20.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\21.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\22.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\23.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\24.jpg"
echo Completed: 24 out of 72 jpg tiles cut
goto inject_jpgs
:logo2_to_qrc
if exist "bin\temp\" DEL "bin\temp" /Q /S
if exist earth.qrc DEL "earth.qrc" /Q /S
if not exist "bin\temp\Cube_faces" MkDir "bin\temp\Cube_faces"
if not exist "bin\temp\Tiles" MkDir "bin\temp\Tiles"
echo Completed: bin\temp folder cleared
bin\jpegtran -crop 4096x3072+1024+0 -outfile bin\temp\cubemap.jpg fill.jpg
echo .
bin\jpegtran -drop +1024+1024 logo.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +1024+2048 fill.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +2048+1024 logo.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +3072+1024 logo.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +0+1024 logo.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
echo Completed: logo.jpg and logo.jpg applied into 4096x3072 cubemap cross
echo .
bin\jpegtran -rotate 180 "bin\temp\cubemap.jpg" "bin\temp\Cube_faces\cubemap_rotated.jpg"
echo Completed: cubemap rotated to suit PS3 orientation
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face2.jpg"
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face5.jpg"
echo .
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\01.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\02.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\03.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\04.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\05.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\06.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\07.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\08.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\09.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\10.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\11.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\12.jpg"
echo Completed: 12 out of 24 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\13.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\14.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\15.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\16.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\17.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\18.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\19.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\20.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\21.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\22.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\23.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\24.jpg"
echo Completed: 24 out of 24 jpgs cut
goto inject_jpgs
:6_sides_to_qrc
if exist "bin\temp\" DEL "bin\temp" /Q /S
if exist earth.qrc DEL "earth.qrc" /Q /S
if not exist "bin\temp\Cube_faces" MkDir "bin\temp\Cube_faces"
if not exist "bin\temp\Tiles" MkDir "bin\temp\Tiles"
echo Completed: bin\temp folder cleared
bin\jpegtran -crop 4096x3072+1024+0 -outfile bin\temp\cubemap.jpg 4.jpg
echo .
bin\jpegtran -drop +3072+1024 0.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +2048+1024 1.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +1024+1024 2.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +0+1024 3.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +1024+2048 5.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
echo Completed: 0.jpg to 5.jpg made into 4096x3072 cubemap cross
echo .
bin\jpegtran -rotate 180 "bin\temp\cubemap.jpg" "bin\temp\Cube_faces\cubemap_rotated.jpg"
echo Completed: cubemap rotated to suit PS3 orientation
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face2.jpg"
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face5.jpg"
echo .
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\01.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\02.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\03.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\04.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\05.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\06.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\07.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\08.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\09.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\10.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\11.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\12.jpg"
echo Completed: 12 out of 24 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\13.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\14.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\15.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\16.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\17.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\18.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\19.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\20.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\21.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\22.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\23.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\24.jpg"
echo Completed: 24 out of 24 jpgs cut
goto inject_jpgs
:banner_to_qrc
if exist "bin\temp\" DEL "bin\temp" /Q /S
if exist earth.qrc DEL "earth.qrc" /Q /S
if not exist "bin\temp\Cube_faces" MkDir "bin\temp\Cube_faces"
if not exist "bin\temp\Tiles\" MkDir "bin\temp\Tiles\"
echo Completed: bin\temp folder cleared
bin\jpegtran -crop 4096x3072+1024+0 -outfile bin\temp\cubemap.jpg fill.jpg
echo .
bin\jpegtran -drop +1024+1024 fill.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +1024+2048 fill.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +2048+1024 fill.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +3072+1024 fill.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +0+1024 fill.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
bin\jpegtran -drop +0+1280 banner.jpg -outfile bin\temp\cubemap.jpg bin\temp\cubemap.jpg
echo Completed: banner.jpg and fill.jpg applied into 4096x3072 cubemap cross
echo .
bin\jpegtran -rotate 180 "bin\temp\cubemap.jpg" "bin\temp\Cube_faces\cubemap_rotated.jpg"
echo Completed: cubemap rotated to suit PS3 orientation
bin\jpegtran -crop 1024x1024+0+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face0.jpg"
bin\jpegtran -crop 1024x1024+3072+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face1.jpg"
bin\jpegtran -crop 1024x1024+2048+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face2.jpg"
bin\jpegtran -crop 1024x1024+1024+1024 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face3.jpg"
bin\jpegtran -crop 1024x1024+2048+0 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face4.jpg"
bin\jpegtran -crop 1024x1024+2048+2048 "bin\temp\Cube_faces\cubemap_rotated.jpg" "bin\temp\Cube_faces\face5.jpg"
echo .
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\01.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\02.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\03.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face0.jpg" "bin\temp\Tiles\04.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\05.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\06.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\07.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face1.jpg" "bin\temp\Tiles\08.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\09.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\10.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\11.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face2.jpg" "bin\temp\Tiles\12.jpg"
echo Completed: 24 out of 72 jpgs cut
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\13.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\14.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\15.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face3.jpg" "bin\temp\Tiles\16.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\17.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\18.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\19.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face4.jpg" "bin\temp\Tiles\20.jpg"
bin\jpegtran -crop 512x512+0+0 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\21.jpg"
bin\jpegtran -crop 512x512+512+0 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\22.jpg"
bin\jpegtran -crop 512x512+0+512 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\23.jpg"
bin\jpegtran -crop 512x512+512+512 "bin\temp\Cube_faces\face5.jpg" "bin\temp\Tiles\24.jpg"
echo Completed: 24 out of 24 jpgs cut
goto inject_jpgs
:inject_jpgs
@copy bin\earth_template.qrcf bin\temp\earth.qrcf
echo .
echo Completed: Base template created
echo .
@bin\binsert 0x000658F0 bin\temp\Tiles\01.jpg bin\temp\earth.qrcf
@bin\binsert 0x000CBE80 bin\temp\Tiles\02.jpg bin\temp\earth.qrcf
@bin\binsert 0x00132410 bin\temp\Tiles\03.jpg bin\temp\earth.qrcf
@bin\binsert 0x001989A0 bin\temp\Tiles\04.jpg bin\temp\earth.qrcf
@bin\binsert 0x001FEF30 bin\temp\Tiles\05.jpg bin\temp\earth.qrcf
@bin\binsert 0x002654C0 bin\temp\Tiles\06.jpg bin\temp\earth.qrcf
@bin\binsert 0x002CBA50 bin\temp\Tiles\07.jpg bin\temp\earth.qrcf
@bin\binsert 0x00331FE0 bin\temp\Tiles\08.jpg bin\temp\earth.qrcf
@bin\binsert 0x00398570 bin\temp\Tiles\09.jpg bin\temp\earth.qrcf
@bin\binsert 0x003FEB00 bin\temp\Tiles\10.jpg bin\temp\earth.qrcf
@bin\binsert 0x00465090 bin\temp\Tiles\11.jpg bin\temp\earth.qrcf
echo
@bin\binsert 0x004CB620 bin\temp\Tiles\12.jpg bin\temp\earth.qrcf
@bin\binsert 0x00531BB0 bin\temp\Tiles\13.jpg bin\temp\earth.qrcf
@bin\binsert 0x00598140 bin\temp\Tiles\14.jpg bin\temp\earth.qrcf
@bin\binsert 0x005FE6D0 bin\temp\Tiles\15.jpg bin\temp\earth.qrcf
@bin\binsert 0x00664C60 bin\temp\Tiles\16.jpg bin\temp\earth.qrcf
@bin\binsert 0x006CB1F0 bin\temp\Tiles\17.jpg bin\temp\earth.qrcf
@bin\binsert 0x00731780 bin\temp\Tiles\18.jpg bin\temp\earth.qrcf
@bin\binsert 0x00797D10 bin\temp\Tiles\19.jpg bin\temp\earth.qrcf
@bin\binsert 0x007FE2A0 bin\temp\Tiles\20.jpg bin\temp\earth.qrcf
@bin\binsert 0x00864830 bin\temp\Tiles\21.jpg bin\temp\earth.qrcf
@bin\binsert 0x008CADC0 bin\temp\Tiles\22.jpg bin\temp\earth.qrcf
@bin\binsert 0x00931350 bin\temp\Tiles\23.jpg bin\temp\earth.qrcf
@bin\binsert 0x009978E0 bin\temp\Tiles\24.jpg bin\temp\earth.qrcf
echo Completed: Cloud layer injected
@bin\binsert 0x034A8A50 bin\temp\Tiles\25.jpg bin\temp\earth.qrcf
@bin\binsert 0x0350EFE0 bin\temp\Tiles\26.jpg bin\temp\earth.qrcf
@bin\binsert 0x03575570 bin\temp\Tiles\27.jpg bin\temp\earth.qrcf
@bin\binsert 0x035DBB00 bin\temp\Tiles\28.jpg bin\temp\earth.qrcf
@bin\binsert 0x03642090 bin\temp\Tiles\29.jpg bin\temp\earth.qrcf
@bin\binsert 0x036A8620 bin\temp\Tiles\30.jpg bin\temp\earth.qrcf
@bin\binsert 0x0370EBB0 bin\temp\Tiles\31.jpg bin\temp\earth.qrcf
@bin\binsert 0x03775140 bin\temp\Tiles\32.jpg bin\temp\earth.qrcf
@bin\binsert 0x037DB6D0 bin\temp\Tiles\33.jpg bin\temp\earth.qrcf
@bin\binsert 0x03841C60 bin\temp\Tiles\34.jpg bin\temp\earth.qrcf
@bin\binsert 0x038A81F0 bin\temp\Tiles\35.jpg bin\temp\earth.qrcf
echo .
@bin\binsert 0x0390E780 bin\temp\Tiles\36.jpg bin\temp\earth.qrcf
@bin\binsert 0x03974D10 bin\temp\Tiles\37.jpg bin\temp\earth.qrcf
@bin\binsert 0x039DB2A0 bin\temp\Tiles\38.jpg bin\temp\earth.qrcf
@bin\binsert 0x03A41830 bin\temp\Tiles\39.jpg bin\temp\earth.qrcf
@bin\binsert 0x03AA7DC0 bin\temp\Tiles\40.jpg bin\temp\earth.qrcf
@bin\binsert 0x03B0E350 bin\temp\Tiles\41.jpg bin\temp\earth.qrcf
@bin\binsert 0x03B748E0 bin\temp\Tiles\42.jpg bin\temp\earth.qrcf
@bin\binsert 0x03BDAE70 bin\temp\Tiles\43.jpg bin\temp\earth.qrcf
@bin\binsert 0x03C41400 bin\temp\Tiles\44.jpg bin\temp\earth.qrcf
@bin\binsert 0x03CA7990 bin\temp\Tiles\45.jpg bin\temp\earth.qrcf
@bin\binsert 0x03D0DF20 bin\temp\Tiles\46.jpg bin\temp\earth.qrcf
@bin\binsert 0x03D744B0 bin\temp\Tiles\47.jpg bin\temp\earth.qrcf
@bin\binsert 0x03DDAA40 bin\temp\Tiles\48.jpg bin\temp\earth.qrcf
echo Completed: Ground layer injected
@bin\binsert 0x03E40FD0 bin\temp\Tiles\49.jpg bin\temp\earth.qrcf
@bin\binsert 0x03EA7560 bin\temp\Tiles\50.jpg bin\temp\earth.qrcf
@bin\binsert 0x03F0DAF0 bin\temp\Tiles\51.jpg bin\temp\earth.qrcf
@bin\binsert 0x03F74080 bin\temp\Tiles\52.jpg bin\temp\earth.qrcf
@bin\binsert 0x03FDA610 bin\temp\Tiles\53.jpg bin\temp\earth.qrcf
@bin\binsert 0x04040BA0 bin\temp\Tiles\54.jpg bin\temp\earth.qrcf
@bin\binsert 0x040A7130 bin\temp\Tiles\55.jpg bin\temp\earth.qrcf
@bin\binsert 0x0410D6C0 bin\temp\Tiles\56.jpg bin\temp\earth.qrcf
@bin\binsert 0x04173C50 bin\temp\Tiles\57.jpg bin\temp\earth.qrcf
@bin\binsert 0x041DA1E0 bin\temp\Tiles\58.jpg bin\temp\earth.qrcf
@bin\binsert 0x04240770 bin\temp\Tiles\59.jpg bin\temp\earth.qrcf
echo .
@bin\binsert 0x042A6D00 bin\temp\Tiles\60.jpg bin\temp\earth.qrcf
@bin\binsert 0x0430D290 bin\temp\Tiles\61.jpg bin\temp\earth.qrcf
@bin\binsert 0x04373820 bin\temp\Tiles\62.jpg bin\temp\earth.qrcf
@bin\binsert 0x043D9DB0 bin\temp\Tiles\63.jpg bin\temp\earth.qrcf
@bin\binsert 0x04440340 bin\temp\Tiles\64.jpg bin\temp\earth.qrcf
@bin\binsert 0x044A68D0 bin\temp\Tiles\65.jpg bin\temp\earth.qrcf
@bin\binsert 0x0450CE60 bin\temp\Tiles\66.jpg bin\temp\earth.qrcf
@bin\binsert 0x045733F0 bin\temp\Tiles\67.jpg bin\temp\earth.qrcf
@bin\binsert 0x045D9980 bin\temp\Tiles\68.jpg bin\temp\earth.qrcf
@bin\binsert 0x0463FF10 bin\temp\Tiles\69.jpg bin\temp\earth.qrcf
@bin\binsert 0x046A64A0 bin\temp\Tiles\70.jpg bin\temp\earth.qrcf
@bin\binsert 0x0470CA30 bin\temp\Tiles\71.jpg bin\temp\earth.qrcf
@bin\binsert 0x04772FC0 bin\temp\Tiles\72.jpg bin\temp\earth.qrcf
echo.
echo Completed: 01.jpg to 72.jpg injected into template QRCF file.
echo.
echo checking for stars.png OR stars.jpg
if exist stars.png goto convert_png_to_dds
if exist stars.jpg goto convert_jpg_to_dds
echo .
echo stars.jpg OR stars.png not found..skipping
goto compress_qrcf_to_qrc
:convert_png_to_dds
echo stars.png found - converting to DDS
bin\nvdxt -file stars.png
echo .
move stars.dds "bin\temp\stars.dds"
goto inject_dds
:convert_jpg_to_dds
echo stars.jpg found - converting to DDS
bin\nvdxt -file stars.jpg -dxt1c
echo .
move stars.dds "bin\temp\stars.dds"
goto inject_dds
:inject_dds
echo injecting DDS...
@bin\binsert 0x01F53460 bin\temp\stars.dds bin\temp\earth.qrcf
echo .
echo DDS successully injected
goto compress_qrcf_to_qrc
:compress_qrcf_to_qrc
echo.
echo Compressing QRCF to QRC..Working..
bin\zlib.exe -c "bin\temp\earth.qrcf" earth.qrc -h
echo Completed: earth.qrcf compressed to earth.qrc
echo.
if exist bin\temp\earth.qrcf echo QRCF successfully created
if not exist bin\temp\earth.qrcf echo ERROR - QRCF PROCESS FAILED
echo .
if exist earth.qrc echo PROCESS COMPLETED - QRC successfully created
if not exist earth.qrc echo ERROR - QRC PROCESS FAILED
echo .
echo Do you want to return to the options menu
@pause
goto options
:file_not_found_tile
echo Check your files - tile.jpg not found
@pause
goto options
:file_not_found_face
echo Check your files - face.jpg not found
@pause
goto options
:file_not_found_cubemap
echo Check your files - cubemap jpg not found
@pause
goto options
:file_not_found_logo
echo Check your files - logo.jpg not found
@pause
goto options
:file_not_found_fill
echo Check your files - fill.jpg not found
@pause
goto options
:file_not_found_banner
echo Check your files - banner.jpg not found
@pause
goto options
:file_not_found_0
echo Check your files - 0.jpg not found
@pause
goto options
:file_not_found_1
echo Check your files - 1.jpg not found
@pause
goto options
:file_not_found_2
echo Check your files - 2.jpg not found
@pause
goto options
:file_not_found_3
echo Check your files - 3.jpg not found
@pause
goto options
:file_not_found_4
echo Check your files - 4.jpg not found
@pause
goto options
:file_not_found_5
echo Check your files - 5.jpg not found
@pause
goto options
:files_not_found_tiles
echo Check your files - 01.jpg to 24.jpg not found in bin\temp\optimized\
@pause
goto options
Credits DeViL303 , Pink1, Sandunagas, Berion, Aldostools, Cypher_CG89

Allows up to 52MB QRCs to be created. 30MB for the JPGs = 10MB per layer approx = 415KB for each of the 72 tile jpgs (512x512) , and optionally 21.5MB for the stars PNG/JPG (1024x1024) (injected as DDS)

upload_2020-2-5_0-15-51.png

upload_2020-2-5_0-16-26.png


It can handle flatmaps, cubemaps, faces, tiles, logos, banners.

For flatmaps (option 0) it can do jpg or png at any size. For ALL options it will also inject stars.png OR stars.jpg as DDS for the background (if it exists).

For other options it only accepts jpgs for now.

Option 8 takes a 512x512 tile.jpg like this:
tile.jpg

and does this in one step (injected into all 3 layers)
upload_2020-2-4_22-41-19.png

Option 9 takes the same 512x512 tile.jpg and does this in one step (injected into all 3 layers)
upload_2020-2-4_22-42-36.png


Note: This is getting big now so might have bugs..Its also getting slow due to all the steps, please test and report back if you can thanks. :)

Thanks to Pink1, Sandungas, Berion, Cypher_CG89, Aldostools and to all the creators of the exes in use.

upload_2020-2-4_22-46-47.png

Same video I posted before of me using a slightly earlier build on some flatmaps:

Warning: This now has no optimizing step. It will inject the images at full quality. If by some chance your stars.png/jpg ends up being more than 21.5MB when injected as stars.dds, or any of the injected jpgs (01.jpg to 72.jpg) end up being bigger than 415KB each it will create a corrupt earth.qrc. Its unlikely you will go over this tbh. I might add a check for this in future if anyone hits this limit.

If you have issues you can check the sizes in the bin\temp folder. All files from all stages can be checked there.
 

Attachments

Last edited:
@sandungas you asked me to keep a look out for things to do with the DDS file in the qrc to do with the stars...

This is interesting... I have found a string referencing a non existent, or deleted, folder within the qrc. which just by looking at the name indicates there may have been a proper cubemap or jpgs for the skybox and the stars at some point but was removed...

.\qgl_gaia_app.prx: %s%s/%.1d/%.1d/%.3d_%.3d.%s
.\qgl_gaia_app.prx: earth/flashrom/clouds
>>>> .\qgl_gaia_app.prx: earth/flashrom/stars.2 <<<<<<
.\qgl_gaia_app.prx: earth/flashrom/ground_cm
.\qgl_gaia_app.prx: earth/flashrom/specular
.\qgl_gaia_app.prx: earth
.\qgl_gaia_app.prx: earth/camera/4m
.\qgl_gaia_app.prx: CachedValue
.\qgl_gaia_app.prx: _this_heap

So far the only other place referencing "earth/flashrom/face_neg_z_ul.dds" is here in the strings which points towards the VPO and FPOs above it as applying things to it in a sense. And these 2 entries are not too far apart from each other in the prx.

.\qgl_gaia_app.prx: FrameBufferObject
.\qgl_gaia_app.prx: common::GetCommonHeap()
.\qgl_gaia_app.prx: Texture2DObject
.\qgl_gaia_app.prx: lib/gaia/TiledStars.vpo
.\qgl_gaia_app.prx: lib/gaia/TiledStars.fpo
.\qgl_gaia_app.prx: lib/gaia/TiledStarsCopy.fpo
>>> .\qgl_gaia_app.prx: earth/flashrom/face_neg_z_ul.dds <<<
.\qgl_gaia_app.prx: Temp
.\qgl_gaia_app.prx: JPEG_BLOCK_INFO
.\qgl_gaia_app.prx: JpegAndMask
.\qgl_gaia_app.prx: BankFileFetcher
.\qgl_gaia_app.prx: gaia::GetGaiaHeap()

I have only been through a small part of the files for this as running each file through up to 6 tools each can get a bit ..... annoying lol... So will keep an eye out for anything else interesting or anything else to do with this.
 
I was looking at those vpos, I was thinking maybe that the TiledStarsCopy.fpo might have been added later, and its smaller, so if we swapped those maybe it will enable something, maybe the big one is not in use now. idk.. those are some things i was planning to try:

upload_2020-2-5_20-33-13.png
 
I was looking at those vpos, I was thinking maybe that the TiledStarsCopy.fpo might have been added later, and its smaller, so if we swapped those maybe it will enable something, maybe the big one is not in use now. idk.. those are some things i was planning to try:

View attachment 23614

I would say that was a good logical guess > TiledStarsCopy.fpo contains 7 params and 6 instructions. I have not done a trace of these instructions yet...

Attached is the disassembled FPO and VPO's from " lib\gaia " in the earth.qrc. This is all I have done with these so far, just some basic dissemblance, no trace back of functions yet to sprxs etc... for anyone who wants to take a poke through them...
 

Attachments

I would say that was a good logical guess > TiledStarsCopy.fpo contains 7 params and 6 instructions. I have not done a trace of these instructions yet...

Attached is the disassembled FPO and VPO's from " lib\gaia " in the earth.qrc. This is all I have done with these so far, just some basic dissemblance, no trace back of functions yet to sprxs etc... for anyone who wants to take a poke through them...
Interesting possibly the same situation with skybox and skybox2 then, they are almost the same, but skybox2 is like a stripped down version of skybox :

Code:
# profile sce_fp_rsx
# parameterCount 12
# instructionCount 9
# attributeInputMask Tex0
# registerCount 2
index: type: name: semantic: res: # of const, const offset
#0: float3: uvw: in.TEXCOORD0: TEXCOORD0
#1: float4: col: out.COLOR0: COLOR0
#2: samplerCUBE: _SkyBox: : TEXUNIT0
#3: sampler2D: _PostEffect: : TEXUNIT1
#4: float2: _ScreenSizeRcp: : UNDEFINED: num 1 offsets: 64
#5: float: _Brightness: : UNDEFINED: num 1 offsets: 32
#6: float2: _Wpos: in.WPOS: WPOS
#7: float3: ray: in.TEXCOORD1: TEXCOORD1
#8: float3: _CamPos: : UNDEFINED
#9: float: _GlareShadow: : UNDEFINED
#10: float4: _HDRParams: : UNDEFINED
#11: float: _Exp: : UNDEFINED
TEXR R0.xyz, g[TEX0], TEX0;
MULR R1.xyz, R0, _Brightness.x; # {0x00000000(0), 0x00000000(0), 0x00000000(0), 0x00000000(0)}
MULR R0.xy, f[WPOS], _ScreenSizeRcp.xyxx; # {0x00000000(0), 0x00000000(0), 0x00000000(0), 0x00000000(0)}
TEXR R0, R0, TEX1;
MADR R0.xyz, R1, R0.w, R0;
MOVR R0.w, {0x3f800000(1), 0x00000000(0), 0x00000000(0), 0x00000000(0)}.x; # last instruction
END

vs

Code:
# profile sce_fp_rsx
# parameterCount 14
# instructionCount 16
# attributeInputMask Tex0
# registerCount 2
index: type: name: semantic: res: # of const, const offset
#0: float3: uvw: in.TEXCOORD0: TEXCOORD0
#1: float4: col: out.COLOR0: COLOR0
#2: samplerCUBE: _SkyBox: : TEXUNIT0
#3: sampler2D: _PostEffect: : UNDEFINED
#4: float2: _ScreenSizeRcp: : UNDEFINED
#5: float: _Brightness: : UNDEFINED: num 1 offsets: 80
#6: float2: _Wpos: in.WPOS: WPOS
#7: float3: ray: in.TEXCOORD1: TEXCOORD1
#8: float3: _CamPos: : UNDEFINED
#9: float: _GlareShadow: : UNDEFINED
#10: float4: _HDRParams: : UNDEFINED
#11: samplerRECT: preexpose_ExposeTex0: TEXUNIT15: TEXUNIT15
#12: samplerRECT: preexpose_ExposeTex1: TEXUNIT14: TEXUNIT14
#13: samplerRECT: preexpose_Noise: TEXUNIT13: TEXUNIT13
TEXR R0, g[TEX0], TEX0;
MULR R0.w, R0, {0x40378f77(2.86813), 0x00000000(0), 0x00000000(0), 0x00000000(0)}.x;
EX2R R0.w, R0.w;
MULR R0.w, R0, _Brightness.x; # {0x00000000(0), 0x00000000(0), 0x00000000(0), 0x00000000(0)}
MULR R1.x, R0.w, {0x41915810(18.168), 0x00000000(0), 0x00000000(0), 0x00000000(0)}.x;
MOVR R0.w, R0.z;
MULR R0.xyz, R1.x, R0;
MAXH H2.w, R0.x, R0.y;
MOVH H2.z, R0;
TEXR R0.xy, R0, TEX15;
MOVH R0.xy, R0;
TEXR R0.z, H2.zwzz, TEX14;
MOVH R0.z, R0; # last instruction
END

Possibly just 2 versions of the same thing and not related to the downsize..
 
@sandungas you asked me to keep a look out for things to do with the DDS file in the qrc to do with the stars...

This is interesting... I have found a string referencing a non existent, or deleted, folder within the qrc. which just by looking at the name indicates there may have been a proper cubemap or jpgs for the skybox and the stars at some point but was removed...
Interesting, it looks we could add a "stars.2" file... i wonder what means that .2 file extension thought

So far the only other place referencing "earth/flashrom/face_neg_z_ul.dds" is here in the strings which points towards the VPO and FPOs above it as applying things to it in a sense. And these 2 entries are not too far apart from each other in the prx.



I have only been through a small part of the files for this as running each file through up to 6 tools each can get a bit ..... annoying lol... So will keep an eye out for anything else interesting or anything else to do with this.
What i was thinking is maybe there is some place where we could see the relationship in between the texture names of the starfield and the texture names of the sphere, but i have no idea if something like that could exist in the vpo/fpo files and the probability for it to exist

What i use to do for this massive searchs is to open a bunch of files in notepad++ (i made it with hundreds of xml's extracted from all the rcos of a specific firmware version)... then use the option "search in all opened files"
It could take some time to complete the search, lol, but it displays a list at bottom easy to check

In this case i would check for "001_001" (the filenames of the sphere textures) or things like "neg_z_ul" (the filenames of the starfield textures)
 
Interesting, it looks we could add a "stars.2" file... i wonder what means that .2 file extension thought
It does look like its its actually a folder with ".2" at the end, not a file , not 100% sure but its written in among lots of other known folders.

upload_2020-2-6_2-12-11.png



I wonder are these tga files in a bin or just missing?

upload_2020-2-6_2-13-39.png
 
That .tga files are missing :o

Btw, another replacement that most probably is going to work is...
"lib/gaia/SkyBox.fpo"
"lib/gaia/SkyBox2.fpo"

They just added a 2 at the end of the file name... so i guess the other without the 2 is version 1
 
It does look like its its actually a folder with ".2" at the end, not a file , not 100% sure but its written in among lots of other known folders.
upload_2020-2-6_2-12-11-png.23629
The 0x2E is taken as a character, as part of the string
It looks like a file... but a weird one

I wonder are these tga files in a bin or just missing?

upload_2020-2-6_2-13-39-png.23630
Btw, the fact that filenames doesnt contains an indication of the tile ID means that are .tga textures applyed over a whole cubeface
And thats the complete list in your screenshot, 6 cubefaces in total

*is the first time we see inside earth.qrc a single texture applyed to a whole cubeface as far i remember/know
 
Last edited:
I know it's a character, but you can have "." in a folder name, and all nearby entries are folders.
Ok, it could be a folder, i dont know, but initially looks a standard "path/name.ext", like in your other screenshot with the names ending in 0x2E (the dot) then tga
 
Interesting, it looks we could add a "stars.2" file... i wonder what means that .2 file extension thought

It does look like its its actually a folder with ".2" at the end, not a file , not 100% sure but its written in among lots of other known folders.

It's a folder not a file, I used a string extractor to get every string in the prx, so is an id in the prx.

Here are some things related to the qgl_gaia_app.sprx, again these are just basic things more or less, trolling through IDA looking at the sprx in detail will I am not up for doing yet lol, I may end up just making a DB file for other to look through while I am looking through other things...
 

Attachments

Similar threads

Back
Top