Beispiel #1
0
UINT32 lsasquad_state::screen_update_lsasquad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	bitmap.fill(511, cliprect);

	draw_layer(bitmap, cliprect, m_scrollram + 0x000);
	draw_layer(bitmap, cliprect, m_scrollram + 0x080);
	draw_sprites(bitmap, cliprect);
	draw_layer(bitmap, cliprect, m_scrollram + 0x100);
	return 0;
}
Beispiel #2
0
static INT32 DrvDraw()
{
	if (DrvRecalc) {
		for (INT32 i = 0; i < 0x800; i+=2) {
			speedspn_palette_write(i);
		}
		DrvRecalc = 0;
	}

	if (*display_enable)
	{
		draw_layer();
		draw_sprites();
	}
	else
	{
		for (INT32 i = 0; i < nScreenWidth * nScreenHeight; i++) {
			pTransDraw[i] = black_color;
		}
	}

	BurnTransferCopy(DrvPalette);

	return 0;
}
Beispiel #3
0
enum piglit_result
piglit_display(void)
{
	GLboolean pass = GL_TRUE;
	int layer;
	GLuint tex;

	glClearColor(1.0, 1.0, 1.0, 1.0);
	glClear(GL_COLOR_BUFFER_BIT);

	tex = create_array_fbo();

	for (layer = 0; layer < NUM_LAYERS; layer++) {
		int x = 1 + layer * (BUF_WIDTH + 1);
		int y = 1;
		draw_layer(x, y, layer);
	}

	for (layer = 0; layer < NUM_LAYERS; layer++) {
		int x = 1 + layer * (BUF_WIDTH + 1);
		int y = 1;
		pass &= test_layer_drawing(x, y, layer_color[layer]);
	}

	glDeleteTextures(1, &tex);

	glutSwapBuffers();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
static int DrvDraw()
{
	if (DrvRecalc) {
		for (int i = 0; i < 0x1000; i++) {
			int rgb = Palette[i];
			DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0);
		}
	}

	BurnTransferClear();
	draw_layer();

	draw_sprites();

	BurnTransferCopy(DrvPalette);

	return 0;
}
void draw_network(TDirectory* d)
{
   Bool_t __PRINT_LOGO__ = kTRUE;

   // create canvas
   TStyle* TMVAStyle = gROOT->GetStyle("TMVA"); // the TMVA style
   Int_t canvasColor = TMVAStyle->GetCanvasColor(); // backup
   TMVAStyle->SetCanvasColor( c_DarkBackground );

   static icanvas = -1;
   icanvas++;
   TCanvas* c = new TCanvas( Form( "c%i", icanvas ), Form("Neural Network Layout for: %s", d->GetName()), 
                             100 + (icanvas)*40, 0 + (icanvas+1)*20, 1000, 650  );

   TIter next = d->GetListOfKeys();
   TKey *key;
   TString hName = "weights_hist";
   Int_t numHists = 0;

   // loop over all histograms with hName in name
   while (key = (TKey*)next()) {
      TClass *cl = gROOT->GetClass(key->GetClassName());
      if (!cl->InheritsFrom("TH2F")) continue;    
      TH2F *h = (TH2F*)key->ReadObj();    
      if (TString(h->GetName()).Contains( hName )) {
         numHists++;
      }
   }

   // loop over all histograms with hName in name again
   next.Reset();
   Double_t maxWeight = 0;

   // find max weight
   while (key = (TKey*)next()) {

      //cout << "Title: " << key->GetTitle() << endl;
      TClass *cl = gROOT->GetClass(key->GetClassName());
      if (!cl->InheritsFrom("TH2F")) continue;    

      TH2F* h = (TH2F*)key->ReadObj();    
      if (TString(h->GetName()).Contains( hName )){
 
         Int_t n1 = h->GetNbinsX();
         Int_t n2 = h->GetNbinsY();
         for (Int_t i = 0; i < n1; i++) {
            for (Int_t j = 0; j < n2; j++) {
               Double_t weight = TMath::Abs(h->GetBinContent(i+1, j+1));
               if (maxWeight < weight) maxWeight = weight;
            }
         }
      }
   }

   // draw network
   next.Reset();
   Int_t count = 0;
   while (key = (TKey*)next()) {

      TClass *cl = gROOT->GetClass(key->GetClassName());
      if (!cl->InheritsFrom("TH2F")) continue;    

      TH2F* h = (TH2F*)key->ReadObj();    
      if (TString(h->GetName()).Contains( hName )){
         draw_layer(c, h, count++, numHists+1, maxWeight);
      }
   }

   draw_layer_labels(numHists+1);

   // ============================================================
   if (__PRINT_LOGO__) TMVAGlob::plot_logo();
   // ============================================================  

   c->Update();

   TString fname = "plots/network";
   TMVAGlob::imgconv( c, fname );

   TMVAStyle->SetCanvasColor( canvasColor );
}
Beispiel #6
0
uint32_t fuuki16_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	uint16_t layer0_scrollx, layer0_scrolly;
	uint16_t layer1_scrollx, layer1_scrolly;
	uint16_t layer2_scrollx, layer2_scrolly;
	uint16_t scrollx_offs, scrolly_offs;

	/*
	It's not independent bits causing layers to switch, that wouldn't make sense with 3 bits.
	See fuukifg3 for more justification
	*/
	static const int pri_table[6][3] = {
		{ 0, 1, 2 },
		{ 0, 2, 1 },
		{ 1, 0, 2 },
		{ 1, 2, 0 },
		{ 2, 0, 1 },
		{ 2, 1, 0 }};

	int tm_front  = pri_table[m_priority[0] & 0x0f][0];
	int tm_middle = pri_table[m_priority[0] & 0x0f][1];
	int tm_back   = pri_table[m_priority[0] & 0x0f][2];

	flip_screen_set(m_vregs[0x1e / 2] & 1);

	/* Layers scrolling */

	scrolly_offs = m_vregs[0xc / 2] - (flip_screen() ? 0x103 : 0x1f3);
	scrollx_offs = m_vregs[0xe / 2] - (flip_screen() ? 0x2a7 : 0x3f6);

	layer0_scrolly = m_vregs[0x0 / 2] + scrolly_offs;
	layer0_scrollx = m_vregs[0x2 / 2] + scrollx_offs;
	layer1_scrolly = m_vregs[0x4 / 2] + scrolly_offs;
	layer1_scrollx = m_vregs[0x6 / 2] + scrollx_offs;

	layer2_scrolly = m_vregs[0x8 / 2];
	layer2_scrollx = m_vregs[0xa / 2];

	m_tilemap[0]->set_scrollx(0, layer0_scrollx);
	m_tilemap[0]->set_scrolly(0, layer0_scrolly);
	m_tilemap[1]->set_scrollx(0, layer1_scrollx);
	m_tilemap[1]->set_scrolly(0, layer1_scrolly);

	m_tilemap[2]->set_scrollx(0, layer2_scrollx + 0x10);
	m_tilemap[2]->set_scrolly(0, layer2_scrolly /*+ 0x02*/);
	m_tilemap[3]->set_scrollx(0, layer2_scrollx + 0x10);
	m_tilemap[3]->set_scrolly(0, layer2_scrolly /*+ 0x02*/);

	/* The backmost tilemap decides the background color(s) but sprites can
	   go below the opaque pixels of that tilemap. We thus need to mark the
	   transparent pixels of this layer with a different priority value */
//  draw_layer(screen, bitmap, cliprect, tm_back, TILEMAP_DRAW_OPAQUE, 0);

	/* Actually, bg colour is simply the last pen i.e. 0x1fff -pjp */
	bitmap.fill((0x800 * 4) - 1, cliprect);
	screen.priority().fill(0, cliprect);

	draw_layer(screen, bitmap, cliprect, tm_back,   0, 1);
	draw_layer(screen, bitmap, cliprect, tm_middle, 0, 2);
	draw_layer(screen, bitmap, cliprect, tm_front,  0, 4);

	m_fuukivid->draw_sprites(screen, bitmap, cliprect, flip_screen(), nullptr);

	return 0;
}
Beispiel #7
0
void hc_map::draw(unsigned int grid, signed int _x, signed int _y, signed int _w, signed int _h)
{
	if(width * 16 < _w)
	{
		_x += (_w - width * 16) / 2;
		_w = width * 16;
	}
	if(height * 16 < _h)
	{
		_y += (_h - height * 16) / 2;
		_h = height * 16;
	}

	vector<layer>::iterator it;
	list<npc*>::iterator it_npc;

    signed int mx = 0;
	signed int my = 0;

	//get_offset(&mx, &my);

	SDL_SetRenderTarget(ren, tex);
	for(it = background.begin(); it != background.end(); it++)
	{
		draw_layer(&(*it), mx, my);
	}

	for(it = block.begin(); it != block.end(); it++)
	{
		draw_layer(&(*it), mx, my);
	}

    for(auto _npcs : npcs)
    {
        _npcs->draw(-mx, -my);
    }

    for(it = hover.begin(); it != hover.end(); it++)
	{
		draw_layer(&(*it), mx, my);
	}

	for(it = foreground.begin(); it != foreground.end(); it++)
	{
		draw_layer(&(*it), mx, my);
	}

	get_offset(_w, _h, &mx, &my);

	if(grid == 1)
    {
        draw_grid(_x - mx, _y - my);
    }
    SDL_SetRenderTarget(ren, nullptr);

    SDL_Rect dest, src;
    dest.x = _x;
    dest.y = _y;
    dest.w = _w;
    dest.h = _h;

    get_offset(_w, _h, &mx, &my);
    src.x = mx;
    src.y = my;
    src.w = _w;
    src.h = _h;

    SDL_RenderCopy(ren, tex, &src, &dest);
}