diff --git a/test/ZFontTest.cpp b/test/ZFontTest.cpp index 8ddef4a..6f0e98a 100644 --- a/test/ZFontTest.cpp +++ b/test/ZFontTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -/*$Id: ZFontTest.cpp,v 1.15 2003/09/09 02:45:58 cozman Exp $*/ +/*$Id: ZFontTest.cpp,v 1.16 2003/09/24 02:05:56 cozman Exp $*/ #include #include @@ -42,7 +42,9 @@ void Test() //Open and Setup all the Fonts and Create Images// ZImage text[6]; - ZFont almonte("data/almontew.ttf",48), axaxax("data/axaxax.ttf",32), betsy("data/betsy.ttf",64); + ZFont almonte("data/almontew.ttf",48), axaxax("data/axaxax.ttf",32), betsy;//("data/betsy.ttf",64); + betsy.OpenFromZip("data/data.zip","betsy.ttf",20); + betsy.Resize(64); almonte.SetColor(255,0,0,128); almonte.DrawText("This is the font test.",text[0]); axaxax.SetColor(0,255,255); @@ -77,9 +79,10 @@ void Test() } while(!engine->QuitRequested()); //quit only when engine has encountered a quit request } -int ZE_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { if(Initialize()) Test(); + ZEngine::ReleaseInstance(); return 0; } diff --git a/test/ZImageTest.cpp b/test/ZImageTest.cpp index 67497d5..80bfdd4 100644 --- a/test/ZImageTest.cpp +++ b/test/ZImageTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -/*$Id: ZImageTest.cpp,v 1.24 2003/09/09 02:45:58 cozman Exp $*/ +/*$Id: ZImageTest.cpp,v 1.25 2003/09/24 02:05:56 cozman Exp $*/ #include #include @@ -41,9 +41,9 @@ void Test() ZEngine *engine = ZEngine::GetInstance(); float angle=0.0f,movDelta; Uint8 alpha=128,alphaDelta=1; + SDL_Surface *temp; //Open and Setup all the Images// - SDL_Surface *temp; ZImage image1,image2,image3,image4,textImage; ZFont font("data/almontew.ttf",30); ZRect clipRect(400,300,30,30); @@ -51,14 +51,14 @@ void Test() font.SetColor(0,255,0); font.SetBGColor(0,0,255); - temp = SDL_LoadBMP("data/test02.bmp"); //this is a separate surface - image1.Attach(temp); //this attaches the surface into itself - image2.Open("data/test01.bmp"); - image3.OpenFromImage(image2.Surface(),5,5,20,20); - image4.Open("data/test02.bmp"); - temp = NULL; //and temp will now be controlled and freed by image1 + temp = SDL_LoadBMP("data/rainbow.bmp"); //this is a separate surface + image1.OpenFromZip("data/data.zip","test02.bmp"); image1.SetColorKey(255,0,255); + image2.Open("data/test01.bmp"); image2.SetColorKey(255,0,255); + image3.OpenFromImage(image2.Surface(),5,5,20,20); + image4.Attach(temp); //this attaches the surface into itself + #if (GFX_BACKEND == ZE_OGL) image4.Resize(400,300); image4.Flip(true,false); @@ -110,7 +110,7 @@ void Test() engine->Clear(); //clear screen //draw the images// alpha += alphaDelta; - if(alpha ==255 || alpha == 0) + if(alpha == 255 || alpha == 0) alphaDelta *= -1; image1.SetAlpha(alpha); image1.Draw(0,0); @@ -134,9 +134,12 @@ void Test() } while(!engine->QuitRequested()); //quit only when engine has encountered a quit request } -int ZE_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { + //atexit(ZEngine::ReleaseInstance); if(Initialize()) Test(); + ZImage img("data/test01.bmp"); + ZEngine::ReleaseInstance(); return 0; } diff --git a/test/ZMouseTest.cpp b/test/ZMouseTest.cpp index a8d6538..b966551 100644 --- a/test/ZMouseTest.cpp +++ b/test/ZMouseTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -/*$Id: ZMouseTest.cpp,v 1.16 2003/09/09 02:45:58 cozman Exp $*/ +/*$Id: ZMouseTest.cpp,v 1.17 2003/09/24 02:05:56 cozman Exp $*/ #include #include @@ -87,9 +87,10 @@ void Test() } while(!engine->QuitRequested()); //quit only when engine has encountered a quit request } -int ZE_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { if(Initialize()) Test(); + ZEngine::ReleaseInstance(); return 0; } diff --git a/test/ZMusicTest.cpp b/test/ZMusicTest.cpp index 2fa5e89..7fb5552 100644 --- a/test/ZMusicTest.cpp +++ b/test/ZMusicTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -/*$Id: ZMusicTest.cpp,v 1.17 2003/09/09 02:45:58 cozman Exp $*/ +/*$Id: ZMusicTest.cpp,v 1.18 2003/09/24 02:05:56 cozman Exp $*/ #include #include @@ -103,9 +103,10 @@ void Test() } } -int ZE_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { if(Initialize()) Test(); + ZEngine::ReleaseInstance(); return 0; } diff --git a/test/ZParticleTest.cpp b/test/ZParticleTest.cpp index a6fd063..09a5b8b 100755 --- a/test/ZParticleTest.cpp +++ b/test/ZParticleTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -/*$Id: ZParticleTest.cpp,v 1.5 2003/09/09 02:45:58 cozman Exp $*/ +/*$Id: ZParticleTest.cpp,v 1.6 2003/09/24 02:05:56 cozman Exp $*/ #include #include @@ -147,9 +147,10 @@ void Test() } while(!engine->QuitRequested()); //quit only when engine has encountered a quit request } -int ZE_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { if(Initialize()) Test(); + ZEngine::ReleaseInstance(); return 0; } diff --git a/test/ZRectTest.cpp b/test/ZRectTest.cpp index 9e800c0..f181835 100644 --- a/test/ZRectTest.cpp +++ b/test/ZRectTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -/*$Id: ZRectTest.cpp,v 1.18 2003/09/09 02:45:58 cozman Exp $*/ +/*$Id: ZRectTest.cpp,v 1.19 2003/09/24 02:05:56 cozman Exp $*/ #include #include @@ -82,9 +82,10 @@ void Test() } while(!engine->QuitRequested()); } -int ZE_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { if(Initialize()) Test(); + ZEngine::ReleaseInstance(); return 0; } diff --git a/test/ZSoundTest.cpp b/test/ZSoundTest.cpp index 155bda8..cc5bf09 100644 --- a/test/ZSoundTest.cpp +++ b/test/ZSoundTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -/*$Id: ZSoundTest.cpp,v 1.16 2003/09/09 02:45:58 cozman Exp $*/ +/*$Id: ZSoundTest.cpp,v 1.17 2003/09/24 02:05:56 cozman Exp $*/ #include #include @@ -46,8 +46,10 @@ void Test() ZImage text[6]; int sampleNum = 0; - for(int i=0; i < 5; i++) - sample[i].Open(FormatStr("data/%s.wav",name[i].c_str())); + for(int i=0; i < 4; i++) + sample[i].OpenFromZip("data/data.zip",FormatStr("%s.wav",name[i].c_str())); + sample[i].Open("data/whip.wav"); + font.DrawText("(P)ause\t(U)npause",text[0]); font.DrawText("(F)ade Out\t(H)alt\t",text[1]); @@ -99,9 +101,10 @@ void Test() } while(!engine->QuitRequested()); //quit only when engine has encountered a quit request } -int ZE_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { if(Initialize()) Test(); + ZEngine::ReleaseInstance(); return 0; } diff --git a/test/ZTimerTest.cpp b/test/ZTimerTest.cpp index a1cb2b1..69f232c 100644 --- a/test/ZTimerTest.cpp +++ b/test/ZTimerTest.cpp @@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions. and the home of this Library is http://www.zengine.sourceforge.net *******************************************************************************/ -/*$Id: ZTimerTest.cpp,v 1.16 2003/09/09 02:45:58 cozman Exp $*/ +/*$Id: ZTimerTest.cpp,v 1.17 2003/09/24 02:05:56 cozman Exp $*/ #include #include @@ -117,9 +117,10 @@ void Test() } while(!engine->QuitRequested()); //quit only when engine has encountered a quit request } -int ZE_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { if(Initialize()) Test(); + ZEngine::ReleaseInstance(); return 0; }