fcGrass.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //---------------------------------------------------------------------------
  2. #include <fmx.h>
  3. #include "stdlib.h"
  4. #pragma hdrstop
  5. #include "fcGrass.h"
  6. #include "GBE.Grass.hpp"
  7. //---------------------------------------------------------------------------
  8. #pragma package(smart_init)
  9. #pragma resource "*.fmx"
  10. TFormGrass *FormGrass;
  11. //---------------------------------------------------------------------------
  12. __fastcall TFormGrass::TFormGrass(TComponent* Owner)
  13. : TForm(Owner)
  14. {
  15. }
  16. //---------------------------------------------------------------------------
  17. void __fastcall TFormGrass::FormCreate(TObject *Sender)
  18. {
  19. int i;
  20. TGBEGrass *GBEGrass;
  21. Randomize();
  22. for (i = 0; i <= 500; i++)
  23. {
  24. GBEGrass = new TGBEGrass (this);
  25. GBEGrass->Position->X = Random(40)-20;
  26. GBEGrass->Position->Z = Random(40)-20;
  27. GBEGrass->RotationAngle->Y = Random(360);
  28. if (i / 10 == 0)
  29. GBEGrass->MaterialSource = TextureMaterialSource2;
  30. else
  31. {
  32. if (i / 2 == 0)
  33. GBEGrass->MaterialSource = TextureMaterialSource;
  34. else
  35. GBEGrass->MaterialSource = TextureMaterialSource1;
  36. }
  37. GBEGrass->Width = 5;
  38. GBEGrass->Height = 5;
  39. GBEGrass->Depth = 0;
  40. GBEGrass->Parent = Dummy;
  41. GBEGrass->Temps = 0.1;
  42. }
  43. }
  44. //---------------------------------------------------------------------------