//--------------------------------------------------------------------------- /* demo.cpp ** Pieni demonnäköinen kikkailu about-lootaksi ** ** Tekijät: Tommi Lahtonen ** Tehty: Huhtikuu 1997 ** ** Muutettu: 07.9.1997 ** Mitä muutettu: Muutettu ulkonäkö täysin, edelleen hyvin huonoa ** koodia, voisi nopeuttaa huomattavasti. ** Ja haukkuisin kyllä lyttyäkin lytympään muutenkin koodista, ** sen kommentoinnista ja muuttujien nimien valinnasta/ vl 7.1.2000!!! ** */ #include #pragma hdrstop #include #include "demo.h" //--------------------------------------------------------------------------- #pragma resource "*.dfm" TDemotus *Demotus; //--------------------------------------------------------------------------- __fastcall TDemotus::TDemotus(TComponent* Owner) : TForm(Owner), teksti(" Winkerho v1.0 by Vesa Lappalainen (vesal@mit.jyu.fi) & Tommi Lahtonen (tlahtone@cc.hut.fi) ... ") { int i; phase = 0; vari = 0; suunta = 1; scrollpos = 1; logotin = 0; // luodaan kuvat kaksoisbufferointia varten for( i=0;i<2;i++) { images[i] = new TImage(this); images[i]->ClientWidth = ClientWidth; images[i]->ClientHeight = ClientHeight; images[i]->Canvas->Brush->Color = clBlack; bitmaps[i] = new Graphics::TBitmap(); bitmaps[i]->Width = ClientWidth; bitmaps[i]->Height = ClientHeight; } // bitmaps[0]->Handle = CreateCompatibleBitmap(Canvas->Handle, ClientWidth, ClientHeight); // bitmaps[1]->Handle = CreateCompatibleBitmap(Canvas->Handle, ClientWidth, ClientHeight); scroll = 8; // lasketaan liikeratoja for( i=0;iClientHeight; hazw = Hazlogo->ClientWidth; // väritemppuilua for( i=0;iClientRect, apu2 = Texbar2->ClientRect , apu3 = Hazlogo->ClientRect; // int foo = apu.Bottom; // int bar = apu2.Right; int foo1 = apu3.Bottom, bar1 = apu3.Right; TImage *kuva, *clear; // Graphics::TBitmap *image; // *tyhja; if (phase) { kuva = images[0]; clear = images[1]; // image = bitmaps[0]; // tyhja = bitmaps[1]; phase = 0; } else { kuva = images[1]; clear = images[0]; // image = bitmaps[1]; // tyhja = bitmaps[0]; phase = 1; } kuva->Canvas->Pen->Color = clLime; // int count = 0; apu3.Right = apu3.Left + bar1 + y[index[40]]/2; apu3.Bottom = apu3.Top + foo1 + x[index[10]]/2; kuva->Canvas->CopyRect(apu3, Hazlogo->Canvas, Hazlogo->ClientRect); for(int i=0;iCanvas->Pen->Color = colorit[i]; kuva->Canvas->MoveTo(xx[i],xx[i]); kuva->Canvas->LineTo(i, yy[xx[i]]); } kuva->Canvas->Font->Color = TColor(0x00ffffff); AnsiString txt = teksti; kuva->Canvas->Font->Size = 12; kuva->Canvas->TextOut(scroll-10, ClientHeight-40, //ikuva->ClientHeight-20, txt.SubString(scrollpos,90).c_str()); if (scroll<=0) { scroll = kuva->Canvas->TextWidth(AnsiString(txt[scrollpos])); scrollpos++; } else scroll -= 1; if ( scrollpos > strlen(teksti) ) scrollpos = 1; clear->Canvas->FillRect(clear->ClientRect); Canvas->CopyRect(ClientRect, kuva->Canvas, kuva->ClientRect); for(int i=0;i=lkm) index[i] = 0; } if (index[0]>=30) logotin = 0; else logotin = 1; for(int i=0;i=ClientWidth) xx[i] = 0; } } //---------------------------------------------------------------------------