Commit dfb87d50 authored by chili's avatar chili
Browse files

disable assorted scene genny

parent eaec9510
...@@ -11,53 +11,53 @@ App::App() ...@@ -11,53 +11,53 @@ App::App()
: :
wnd( 800,600,"The Donkey Fart Box" ) wnd( 800,600,"The Donkey Fart Box" )
{ {
class Factory //class Factory
{ //{
public: //public:
Factory( Graphics& gfx ) // Factory( Graphics& gfx )
: // :
gfx( gfx ) // gfx( gfx )
{} // {}
std::unique_ptr<Drawable> operator()() // std::unique_ptr<Drawable> operator()()
{ // {
switch( typedist( rng ) ) // switch( typedist( rng ) )
{ // {
case 0: // case 0:
return std::make_unique<Pyramid>( // return std::make_unique<Pyramid>(
gfx,rng,adist,ddist, // gfx,rng,adist,ddist,
odist,rdist // odist,rdist
); // );
case 1: // case 1:
return std::make_unique<Box>( // return std::make_unique<Box>(
gfx,rng,adist,ddist, // gfx,rng,adist,ddist,
odist,rdist,bdist // odist,rdist,bdist
); // );
case 2: // case 2:
return std::make_unique<Melon>( // return std::make_unique<Melon>(
gfx,rng,adist,ddist, // gfx,rng,adist,ddist,
odist,rdist,longdist,latdist // odist,rdist,longdist,latdist
); // );
default: // default:
assert( false && "bad drawable type in factory" ); // assert( false && "bad drawable type in factory" );
return {}; // return {};
} // }
} // }
private: //private:
Graphics& gfx; // Graphics& gfx;
std::mt19937 rng{ std::random_device{}() }; // std::mt19937 rng{ std::random_device{}() };
std::uniform_real_distribution<float> adist{ 0.0f,PI * 2.0f }; // std::uniform_real_distribution<float> adist{ 0.0f,PI * 2.0f };
std::uniform_real_distribution<float> ddist{ 0.0f,PI * 0.5f }; // std::uniform_real_distribution<float> ddist{ 0.0f,PI * 0.5f };
std::uniform_real_distribution<float> odist{ 0.0f,PI * 0.08f }; // std::uniform_real_distribution<float> odist{ 0.0f,PI * 0.08f };
std::uniform_real_distribution<float> rdist{ 6.0f,20.0f }; // std::uniform_real_distribution<float> rdist{ 6.0f,20.0f };
std::uniform_real_distribution<float> bdist{ 0.4f,3.0f }; // std::uniform_real_distribution<float> bdist{ 0.4f,3.0f };
std::uniform_int_distribution<int> latdist{ 5,20 }; // std::uniform_int_distribution<int> latdist{ 5,20 };
std::uniform_int_distribution<int> longdist{ 10,40 }; // std::uniform_int_distribution<int> longdist{ 10,40 };
std::uniform_int_distribution<int> typedist{ 0,2 }; // std::uniform_int_distribution<int> typedist{ 0,2 };
}; //};
Factory f( wnd.Gfx() ); //Factory f( wnd.Gfx() );
drawables.reserve( nDrawables ); //drawables.reserve( nDrawables );
std::generate_n( std::back_inserter( drawables ),nDrawables,f ); //std::generate_n( std::back_inserter( drawables ),nDrawables,f );
wnd.Gfx().SetProjection( DirectX::XMMatrixPerspectiveLH( 1.0f,3.0f / 4.0f,0.5f,40.0f ) ); wnd.Gfx().SetProjection( DirectX::XMMatrixPerspectiveLH( 1.0f,3.0f / 4.0f,0.5f,40.0f ) );
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment