bool step()

in roboschool/cpp-household/python-binding.cpp [356:392]


	bool step(int repeat)
	{
		bool have_window = window && window->isVisible();
		bool slowmo = wref->cx && wref->cx->slowmo && window && window->isVisible();
		if (slowmo) {
			wref->bullet_step(1);
			int counter = 1;
			int old_s = 0;
			for (int i=0; i<10; i++) {
				int new_s = i*repeat/10;
				if (new_s > old_s) {
					old_s = new_s;
					wref->bullet_step(1);
					counter++;
				}
				if (slowmo || i==0) {
					app->process_events();
					if (have_window) {
						window->render_on_offscreen_surface();
						window->repaint();
					}
				}
			}
			assert(counter==repeat);
		} else {
			wref->bullet_step(repeat);
			if (app) {
				app->process_events();
				if (have_window) {
					window->render_on_offscreen_surface();
					window->repaint();
				}
			}
		}

		return false;
	}