world.h #13

  • //
  • guest/
  • sam_stafford/
  • scenesaver/
  • world.h
  • View
  • Commits
  • Open Download .zip Download (1 KB)
struct Pixel;
class DNA;
class Animal;

class World
{
public:
	World( int imagec, char** imagev, int w, int h );

	void Display(); //OpenGL display function

	void FitnessCheck();
	void ImageCheck();

	void RenderChase();
	void RenderImage();
	void RenderVisible( Animal* a );
	void Resize( int w, int h ); //screen resize function
	void ScanDiffs(); //scan diffs and take appropriate actions

	void Load();
	void InsertAnimal( DNA* d );
	void Procreate( DNA* d );
	void Save();
	void ScreenShot( char* file );

	void CycleDisplayBuffer();
	void CycleDrawCreatures();
	void CycleCameraMode();
	void CycleChaseCam();
	void CycleImage();
	void Step();

	void Promote(); //promote back buffer to front

	Animal* pop; //ptr to highest-fitness animal
	int pop_c;

	Animal* chase; //chasecam target

	int fit_cycle;
	int image_cycle;

	char** image_v;
	int image_c;
	int image_i;

	int image_w, image_h;
	Pixel** image_p;

	int screen_w, screen_h;

	float world_l, world_r, world_t, world_b;

	int r_x, r_y, g_x, g_y, b_x, b_y; //pointers to strongest food

	float image_d; //starting diff total for the image
};
# Change User Description Committed
#13 5098 Sam Stafford Rollback the multithreaded image loading functionality.
 It didn't
really boost performance like I'd hoped it would - the CPU would still
swamp for a second while decoding the image, and there was no way
around that.
#12 4707 Sam Stafford Make image buffer match screen dimensions rather than first image
dimensions.  The first image is still used to determine the resolution.
 (If the first image matches the screen's dimensions, like it should,
this change does nothing.)
#11 4642 Sam Stafford Load images in a seperate thread to cut down on framerate lag.

Also moved to Qt 3.3.3.
#10 4458 Sam Stafford Allow screenshot to capture the current buffer rather than always
defaulting to the front one.  (This lets people take cool "diff"
screenshots.)
#9 4453 Sam Stafford Added screenshot feature, moved SceneSaver files to home directory
rather than system directory, added code to handle invalid or missing
images (loading a random color instead of crashing).

I think this thing's good to go.
#8 4451 Sam Stafford All significant variables are now user-tweakable.
#7 4449 Sam Stafford Speed lines, toggle creatures on and off.
#6 4448 Sam Stafford Turn this thing into a Windows screensaver.
#5 4446 Sam Stafford Finished neural inputs, made size hereditary, auto-rotation of images
once a certain amount of diffs have been consumed, saving genomes at
finish.
#4 4441 Sam Stafford Ported chase-cam view.
#3 4440 Sam Stafford Bug fixes, new features, the usual.
#2 4433 Sam Stafford More work on this little project.
 The AI is still nonexistent.
#1 4429 Sam Stafford A bit of work in progress that currently works as a crude image diff
tool.