Hello,
I have been following this thread very closely for some time.
For about a week now, I have been working on an idea that I had about a year ago. But somehow I didn't have the time or the desire to do it.
But now it is almost finished.
I'll try to explain what I have in mind.
I have added a new command ...
AssignZip(zipfile[, password])
After this or more command(s) have been executed. This zip file(s) will be added to the search path of Agk.
This means that if an image or other file is to be loaded and it is not found in the conventional paths, the file is searched for in these ZIP file(s).
If the file exists, it is loaded directly from the ZIP file. This is done without first unpacking the file on the hard disk.
This works excellently at the moment. At least in the tests I have carried out so far.
The only thing that doesn't work at the moment is streaming music from an encrypted file. It works fine as long as it's a zipped file.
But as soon as it is password protected, it no longer works.
I know that sounds too fantastic. That's why I have uploaded my test app in the attachment.
The code looks like this.
void app::Begin(void)
{
agk::SetVirtualResolution (1024, 768);
agk::SetClearColor( 151,170,204 ); // light blue
agk::SetSyncRate(60,0);
agk::SetScissor(0,0,0,0);
int cube = agk::CreateObjectBox(40, 40, 40);
agk::Create3DPhysicsDynamicBody(cube);
agk::SetObjectShapeBox(cube);
agk::SetObjectColor(cube, 255, 0, 0, 255);
//agk::AssignZip("media/pwdTest.zip", "Pa55w0rd");
agk::AssignZip("media/Text.zip");
agk::LoadObject(1, "media/Original_Soldier.X");
agk::LoadObjectWithChildren(2, "");
agk::SetObjectScale(1, 0.1f, 0.1f, 0.1f);
agk::SetObjectPosition(1, 3, 0, 0);
agk::LoadFont(1, "font/Oxanium-Regular.ttf");
agk::SetPrintFont(1);
agk::SetPrintSize(24);
agk::LoadSprite(1,"background/space.jpg");
agk::CreateSprite(1, 1);
agk::LoadImage(2, "images/MetalBlock1.png");
agk::CreateSprite(2, 2);
agk::LoadImage(3, "images/pill-anim-test.gif");
agk::CreateSprite(3, 3);
agk::SetSpritePosition(3, 0, 96);
agk::LoadImage(4, "font/custom.png");
agk::CreateText(4, "Custom Text!");
agk::SetTextFontImage(4, 4);
agk::SetTextPosition(4, 96, 32);
agk::SetTextSize(4, 32);
agk::LoadMusicOGG(1, "music/track1.ogg");
agk::PlayMusicOGG(1, 1);
agk::LoadSoundOGG(2, "sfx/laser.ogg");
agk::LoadSound(1, "sfx/playerhit.wav");
agk::PlaySound(1);
agk::LoadImage(15, "spine/test.png");
agk::LoadSkeleton2DFromSpineFile(1, "spine/spineboy.json", 1, 15, 1);
agk::SetSkeleton2DPosition(1, 512, 768);
agk::PlaySkeleton2DAnimation(1, "walk", 0, 1, 0.3);
agk::LoadImageResized(5, "images/MetalBlock1.png", 2.5, 1.5, 0);
agk::CreateSprite(5, 5);
agk::SetSpritePosition(5, 0, 176);
}
int app::Loop (void)
{
agk::Print( agk::ScreenFPS() );
agk::Print(agk::GetMusicLoopCountOGG(1));
agk::Print(agk::GetMusicPlayingOGG(1));
agk::Print(agk::GetMusicPositionOGG(1));
agk::Sync();
return 0; // return 1 to close app
}