本文整理汇总了C++中drawMap函数的典型用法代码示例。如果您正苦于以下问题:C++ drawMap函数的具体用法?C++ drawMap怎么用?C++ drawMap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drawMap函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: playGame
bool playGame(Affichage A, Damier *map, Snake *snake, Sound sound)
{
int end = 0;
bool win = FALSE;
Position newPos = initPosition();
Input input = initInput();
Chrono chrono = initChrono();
Timer timer = initTimer();
setProiesToMap(map);
drawTile(A, TILE_TITLE);
drawTextChrono(chrono, A);
drawMap(A, *map, newPosition(MAXCASES/2 + 3,MAXCASES/2), *snake);
startChrono(&chrono);
while (1)
{
setTimer(&timer);
newPos = updatePositions(map, snake, &input);
if (input.end)
break;
if (testPosMap(newPos))
{
end = addPositionSnake(map, snake, newPos, sound);
if (end)
{
win = FALSE;
break;
}
}
setPositionsToMap(map, snake);
drawChrono(chrono, A);
drawMap(A, *map, newPos, *snake);
if(endChrono(chrono))
{
win = FALSE;
break;
}
if (endGame(map))
{
win = TRUE;
break;
}
reguleFPS(&timer);
}
deleteChrono(&chrono);
return win;
}
示例2: drawMap
/**
* \brief Draws the base map, voronoi points and critical points, lines
* and regions on to image. Should be only used for testing the
* output for Topological Mapper.
* \param image OpenCV image we are drawing output on
*/
void TopologicalMapper::drawOutput(cv::Mat &image) {
VoronoiApproximator::drawOutput(image);
drawMap(image, 2 * map_resp_.map.info.width);
drawConnectedComponents(image, 2 * map_resp_.map.info.width);
drawCriticalPoints(image, 2 * map_resp_.map.info.width);
drawMap(image, 3 * map_resp_.map.info.width);
drawRegionGraph(image, 3 * map_resp_.map.info.width);
drawMap(image, 4 * map_resp_.map.info.width);
drawPointGraph(image, 4 * map_resp_.map.info.width);
}
示例3: display
void display(void)
{
// Clear the color buffer, restore the background
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Load the identity matrix, clear all the previous transformations
glLoadIdentity();
// Set up the camera
mot_MoveCamera();
// Collisions with blocks
doMagic();
mot_SetCamera();
// Set light position
vect_Vector eyePos = mot_GetEyePos(), targetPos = mot_GetTargetPos(), pos;
pos = vect_Substract(targetPos, eyePos);
vect_Normalize(&pos);
pos = vect_Multiply(pos, -1);
pos = vect_Add(pos, eyePos);
lightPos[0] = pos.x;
lightPos[1] = pos.y;
lightPos[2] = pos.z;
glLightfv(GL_LIGHT0, GL_POSITION, lightPos);
drawMap(Map);
drawGuides();
// Swap buffers in GPU
glutSwapBuffers();
}
示例4: display
//Main display function
void display(void)
{
glClearColor(0.2f, 0.3f, 1.0f, 0.9f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(0.0f, 0.0f, 0.0f);
glPushMatrix();
glMatrixMode(GL_MODELVIEW);
glViewport(0, (WINDOW_HEIGHT / 3) * 2, WINDOW_WIDTH, WINDOW_HEIGHT - (WINDOW_HEIGHT / 3) * 2);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, (GLdouble)WINDOW_WIDTH, (WINDOW_HEIGHT / 3) * 2, (GLdouble)WINDOW_HEIGHT, -1.0, 1.0);
//draw the user interface **NOT THE MINI MAP**
drawUI();
glPopMatrix();
glPushMatrix();
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
//draw the actual world, with lighting
theWorld.Draw(continuousRendering);
glDisable(GL_LIGHTING);
glPopMatrix();
//draw the mini map interface
drawMap();
glutSwapBuffers();
}
示例5: drawHUD
void drawHUD(ViewCamera& currentView, PlayerController* player, GameWorld* world, GameRenderer* render)
{
if(player && player->getCharacter()) {
drawMap(currentView, player, world, render);
drawPlayerInfo(player, world, render);
}
}
示例6: updateEvents
void LabEngine::doMap() {
static uint16 amigaMapPalette[] = {
0x0BA8, 0x0C11, 0x0A74, 0x0076,
0x0A96, 0x0DCB, 0x0CCA, 0x0222,
0x0444, 0x0555, 0x0777, 0x0999,
0x0AAA, 0x0ED0, 0x0EEE, 0x0694
};
_graphics->_fadePalette = amigaMapPalette;
updateEvents();
loadMapData();
_graphics->blackAllScreen();
_interface->attachButtonList(&_mapButtonList);
drawMap(_roomNum, _roomNum, _maps[_roomNum]._pageNumber, true);
_event->mouseShow();
_graphics->screenUpdate();
processMap(_roomNum);
_event->mouseHide();
_interface->attachButtonList(nullptr);
_graphics->fade(false);
_graphics->blackAllScreen();
_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0);
freeMapData();
_event->mouseShow();
_graphics->screenUpdate();
}
示例7: drawMap
void cOutput::drawFrameUnitSelection(Uint32 ticks)
{
drawMap();
drawEntities();
if(pUnitSelectionInputs->doDrawRect){ drawSelectionRectangle(&(pUnitSelectionInputs->DrawRect)); }
if(selectedNumber > 0)
{
drawUnitHud(ticks);
}
else if(selectedBuildings > 0)
{
///TODO
//drawBuildingHud();
}
if(drawAoe != -1)
{
applyDrawAoe((pMousePosition->X)/TILE_WIDTH,(pMousePosition->Y)/TILE_HEIGHT,drawAoe);
}
// Draw the cursor
cSurface::Draw(mScreen,cursorGraphic[pUnitSelectionInputs->cursorType],pMousePosition->X+CURSOR_OFFSET_X,pMousePosition->Y+CURSOR_OFFSET_Y);
//Show the new screen
SDL_Flip(mScreen);
}
示例8: setup
void setup(void) {
Serial.begin(9600);
pinMode(JOYSTICK_BUTTON, INPUT);
pinMode(RATING_LED_0, OUTPUT);
pinMode(RATING_LED_1, OUTPUT);
pinMode(RATING_LED_2, OUTPUT);
pinMode(RATING_LED_3, OUTPUT);
pinMode(RATING_LED_4, OUTPUT);
digitalWrite(JOYSTICK_BUTTON, HIGH);
tft.initR(INITR_REDTAB);
Serial.print("Initializing SD card...");
if (!SD.begin(SD_CS)) {
Serial.println("failed!");
return;
}
Serial.println("OK!");
drawMap();
// test out reading blocks from the SD card
if (!card.init(SPI_HALF_SPEED, SD_CS)) {
Serial.println("Raw SD Initialization has failed");
while (1) {}; // Just wait, stuff exploded.
}
verticalMidpoint = getVertical();
}
示例9: navigateToWaypoint
void navigateToWaypoint(float xtarget, float ytarget)
{
while(!atTarget(xtarget, x) || (!atTarget(ytarget, y)))
{
float distance = calcDistance(xtarget, ytarget);
float angle = calcAngle(xtarget, ytarget);
float driveDistance = 0; //initialise
if (distance < stepDistance)
{
driveDistance = distance;
}
else
{
driveDistance = stepDistance;
}
// co-ordinate system is different so cos and sin are swapped - take from current location not origin
float tempWaypointX = x + (driveDistance * cos(angle));
float tempWaypointY = y + (driveDistance * sin(angle));
driveToWaypoint(tempWaypointX, tempWaypointY);
monteCarlo();
eraseDisplay();
drawMap();
drawParticles();
wait1Msec(100);
}
PlayTone(784, 15);
}
示例10: ABPointMake
BAGamesCommand BAGame::enemyRound(){
// store information
ABPoint playerCursor = ABPointMake(6, 4);
ABPoint selectedTargetTile = ABPointMake(-1, -1);
bool targetLocked = false;
bool cursorFlip = true;
while(true){
if (!arduboy.nextFrame()) continue;
if (arduboy.everyXFrames(10)) cursorFlip = !cursorFlip;
// handle input
globalInput.updateInput();
if(globalInput.pressed(B_BUTTON)){
playSoundSuccess();
return BAGamesCommandNext;
}
// clear screen
arduboy.clear();
// Draw map of enemy
drawMap(player, true);
arduboy.display();
}
}
示例11: startGame
void startGame(LifeMap& gameMap) {
int step;
for(step = 0; gameMap.isChange(); step++) {
gamePlay::showGamePlayInfo(step, gameMap);
drawMap(gameMap);
TCODConsole::root->flush();
gameMap.nextStep();
Sleep(delay);
TCOD_key_t key = TCODConsole::checkForKeypress();
if(key.c == 'p') {
gamePlay::showPause();
TCODConsole::waitForKeypress(true);
}
else {
if(key.vk == TCODK_ESCAPE)
break;
}
}
if(!gameMap.isChange()) {
gamePlay::showFinish();
TCODConsole::waitForKeypress(true);
}
gamePlay::showScore(step-1, gameMap);
while(TCODConsole::waitForKeypress(true).vk != TCODK_ESCAPE) {}
}
示例12: drawMap
int Model::step() {
drawMap();
int res;
while (1) {
for(vector<PlayerPtr>::iterator it=players.begin()+1; it!=players.end(); ++it) {
if((res = players.begin()->get()->turn()) != GAME_RUNNING)
return res;
if((res = it->get()->turn()) != GAME_RUNNING) //Each player implements his own turn() method (ai or real)
if (res != GAME_NO_WAY)
return res;
drawMap();
}
}
}
示例13: drawImage
void LEditor::draw()
{
drawImage(background, 0, 0);
drawMap();
SDL_Flip(screen);
}
示例14: SDL_BlitSurface
void App::updateDisplay()
{
//Apply the image
SDL_BlitSurface(bgIMG, NULL, mainWin.gScreenSurface, NULL);
drawMap();
//Update the surface
SDL_UpdateWindowSurface(mainWin.gWindow);
}
示例15: main
task main() {
clearDebugStream();
nMotorEncoder[LEFT_WHEEL] = 0;
nMotorEncoder[RIGHT_WHEEL] = 0;
bPlaySounds = true;
set_starting_position(84.0, 30.0, 0.0);
drawMap();
StartTask(vehicle_compute_position);
//StartTask(vehicle_draw_position);
navigate_to_waypoint(104, 30);
drawParticles();
navigate_to_waypoint(124, 30);
drawParticles();
navigate_to_waypoint(144, 30);
drawParticles();
navigate_to_waypoint(180, 30);
drawParticles();
navigate_to_waypoint(180, 54);
drawParticles();
navigate_to_waypoint(164, 54);
drawParticles();
navigate_to_waypoint(126, 54);
drawParticles();
// Moved left
// Going up
navigate_to_waypoint(126, 74);
drawParticles();
navigate_to_waypoint(126, 94);
drawParticles();
navigate_to_waypoint(126, 104);
drawParticles();
navigate_to_waypoint(126, 124);
drawParticles();
navigate_to_waypoint(126, 144);
drawParticles();
navigate_to_waypoint(126, 168);
drawParticles();
navigate_to_waypoint(126, 148);
drawParticles();
navigate_to_waypoint(126, 126);
drawParticles();
// From here, move in 20 cm ranges
navigate_to_waypoint(30, 54);
drawParticles();
navigate_to_waypoint(84, 54);
drawParticles();
navigate_to_waypoint(84, 30);
drawParticles();
StopTask(vehicle_compute_position);
//StopTask(vehicle_draw_position);
wait10Msec(60000); // wait 1MIN
}