
#include "spiel.hpp"

#include "pumpkin.xbm"



//class MapRGB : public Cunt
//{
	//public:
	Cunt* MapRGB::Routine(Api* shit)
	{
	
	shit->Lock();
          Uint32 fg = CalculatorLcdPixel,
		 bg = CalculatorLcdBG;
	  unsigned short bytePadedW = pumpkin_width + 8 - (pumpkin_width & 7);
	  for (unsigned short x = 0; x < pumpkin_width; x++) {
	    for (unsigned short y = 0; y < pumpkin_height; y++) {
	      unsigned int index = ((y * bytePadedW) + x);
	      unsigned char bitShift = index & 7;  // index & 7;
	      unsigned int byteIndex = index >> 3; // index >> 3;
	      unsigned char byteValue = pumpkin_bits[byteIndex];
	      unsigned char bitMask = 1 << bitShift;
	      unsigned char bitValue = bitMask & byteValue;
	      if (bitValue == 0)
	      shit->Plot(y,x,bg);
	      else
	      shit->Plot(y,x,fg);
	    }
	 }

	shit->Unlock();

	return 0;
	}
//};

//class DrawShit : public Cunt
//{
	//public:
	Cunt* DrawShit::Routine(Api* shit)
	{
	

	shit->Lock();
	/*
	Uint32 red = shit->Color(128, 0, 0);
	Uint32 green = shit->Color(0, 128, 0);
	Uint32 blue = shit->Color(0, 0, 128);
	for (int x = 16; x < 64; x++)
	for (int y = 16; y < 64; y++)
	if (x == y) shit->Plot(x,y,0);
	else shit->Plot(x,y,green);
	*/
	shit->Unlock();
	return 0;
	}
//};

//class EveryFrame : public Cunt
//{
	//public:
	Cunt* EveryFrame::Routine(Api* shit)
	{
		if (shit->Quit()) shit->Gtfo();
		shit->Refresh();

		shit->Delay(50);
		return 0;
		return this;
	}
//};

//class AudioFrame : public Cunt
//{
	//public:
	Cunt* AudioFrame::Routine(Api* shit)
	{
		SDL_LockAudio();

		//shit->sndgen = &SineWave<_RATE,220>;
		SDL_UnlockAudio();
		return 0;
	}
//};






