Пример #1
0
	void define( const std::string& errorclass, const std::string& message)
	{
		if (m_hintar.empty()) throw std::logic_error( "hint table definition without start");
		std::vector<Hint>& top = m_hintar.back();
		if (findHint( m_hintar.size(), errorclass)) throw std::runtime_error( std::string( "duplicate definition of hint for error class '") + errorclass + "' for same statement");
		top.push_back( Hint( errorclass, message));
	}
Пример #2
0
void make_sym(const unsigned char * buf, size_t len, const char * s)
{
  SymN(s, 0);
  assume_len(&len, false, sizeof(len));
  Hint(s);
  Nondet();
  store_buf(buf);
}
Пример #3
0
bool CPatternManager::HasHint(int board_index, int i, StepType t)
{
  vector<int> hints = m_patternList[i].FindPatternAt(m_board, board_index, t);
  if (hints.size() > 0)
  {
    m_hintList.push_back(Hint(hints));
  }
  return hints.size() > 0;
}
Пример #4
0
void WLayout::setLayoutHint(const std::string& name, const std::string& value)
{
  if (impl_)
    impl_->setHint(name, value);
  else {
    if (!hints_)
      hints_ = new HintsList();
    hints_->push_back(Hint(name, value));
  }
}
Пример #5
0
void hint(const unsigned char * buf, size_t len, const char * name)
{
  load_buf(buf, len, "");
  Hint(name);
  store_buf(buf);
}
Пример #6
0
void CHintBar::Hint(uint iRscID)
{
	CString strHint(iRscID);
	Hint(strHint);
}
Пример #7
0
/* Initialises the video subsystem.

   Note: dynamic resolution change is not supported. */
int InitVideo(void)
{	
	char title[32];
	SDL_Surface *new_screen = NULL;
	int sdl_flags = 0;
	int w, h = 0;
	int rw, rh;

	sdl_flags |= SDL_HWPALETTE;
	sdl_flags |= SDL_SWSURFACE;

	if (Hint(HINT_FULLSCREEN)) sdl_flags |= SDL_FULLSCREEN;

	if (screen == NULL) {
		rw = w = Hint(HINT_WIDTH);
		rh = h = Hint(HINT_HEIGHT);
	} else {
		/* We do this because the game dies horribly if you try to
		dynamically change the _virtual_ resolution */
		rw = w = screen_w;
		rh = h = screen_h;
	}

	if (Hint(HINT_SCALEFACTOR) > 1) {
		rw *= Hint(HINT_SCALEFACTOR);
		rh *= Hint(HINT_SCALEFACTOR);
	}

	if (!Hint(HINT_FORCEMODE)) {
		if (!ValidMode(w, h)) {
			printf("!!! Invalid Video Mode %dx%d\n", w, h);
			return -1;
		}
	} else {
		printf("\n");
		printf("  BIG FAT WARNING: If this blows up in your face,\n");
		printf("  and mutilates your cat, please don't cry.\n");
		printf("\n");
	}

	printf("Window dimensions:\t%dx%d\n", rw, rh);
	new_screen = SDL_SetVideoMode(rw, rh, 8, sdl_flags);

	if (new_screen == NULL) {
		printf("ERROR: InitVideo: %s\n", SDL_GetError() );
		return -1;
	}	

	if (screen == NULL) { /* only do this the first time */
		debug(D_NORMAL, "setting caption and icon...\n");
		sprintf(title, "C-Dogs %s [Port %s]", CDOGS_VERSION, CDOGS_SDL_VERSION);
		SDL_WM_SetCaption(title, NULL);
		SDL_WM_SetIcon(SDL_LoadBMP(GetDataFilePath("cdogs_icon.bmp")), NULL);
		SDL_ShowCursor(SDL_DISABLE);
	} else {
		debug(D_NORMAL, "Changed video mode...\n");
	}

	if (screen == NULL) {
		screen_w = Hint(HINT_WIDTH);
		screen_h = Hint(HINT_HEIGHT);
	}

	screen = new_screen;
	
	SetClip(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
	debug(D_NORMAL, "Internal dimensions:\t%dx%d\n", SCREEN_WIDTH, SCREEN_HEIGHT);

	SetPalette(gPalette);
			
	return 0;
}
Пример #8
0
int Gfx_GetHint(const GFX_Hint h)
{
	if (h < 0 || h >= HINT_END) return 0;
	return Hint(h);
}