// entscheidet ob UFO erstellt oder aktualisert wird void ufo(Game *g) { // 1:1 Chance nach MIN_UFO_PAUSE if (!g->enemyContainer.ufo.alive && (MIN_UFO_PAUSE + g->enemyContainer.ufo.lastufo) < ms_time() && (rand() % 2)) { g->enemyContainer.ufo.lastufo = ms_time(); g->enemyContainer.ufo.alive = true; g->enemyContainer.ufo.posx = -UFO_WIDTH; SDL_Rect rect = {g->enemyContainer.ufo.posx, BORDER_TOP + 5, UFO_WIDTH, UFO_HEIGHT}; drawSprite(g->screen, &rect, "ufo.bmp"); } else if (g->enemyContainer.ufo.alive) { // UFO lebt noch, Position Aktualisieren SDL_Rect rect = {g->enemyContainer.ufo.posx, BORDER_TOP + 5, UFO_WIDTH, UFO_HEIGHT}; SDL_FillRect(g->screen, &rect, SDL_MapRGB(g->screen->format, 0, 0, 0)); g->enemyContainer.ufo.posx += UFO_SPEED; rect.x = g->enemyContainer.ufo.posx; if (g->enemyContainer.ufo.posx < WIDTH) { // Zeichnen drawSprite(g->screen, &rect, "ufo.bmp"); } else { // Außerhalb g->enemyContainer.ufo.lastufo = ms_time(); g->enemyContainer.ufo.alive = false; } } else if ((MIN_UFO_PAUSE + g->enemyContainer.ufo.lastufo) < ms_time()) { // UFO Start verschieben g->enemyContainer.ufo.lastufo += ((rand() % 11) * 1000); } }
void render() { float rad; // radians of rotation based on frame counter // clear the colour (drawing) and depth sort back (offscreen) buffers glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // count the frame and base a rotation on it. frame++; rad = frame * (0.0175f); for (int i=0; i<max_flares; i++) { drawSprite( flares[i].x,flares[i].y,flare_size,flare_size,0,flareTex); } drawSprite( mx,my,64,64,0,flareTex); // see printf documentation for the formatting of variables... glPrintf(100, 240, font1,"frame=%i, mousebtn: %i, targets: %i", frame, mx, max_targets); // swap the front (visible) buffer for the back (offscreen) buffer swapBuffers(); }
void Screen::splashScreen() { byte *bgfile = _vm->_resman->openResource(2950); initialiseBackgroundLayer(NULL); initialiseBackgroundLayer(NULL); initialiseBackgroundLayer(_vm->fetchBackgroundLayer(bgfile)); initialiseBackgroundLayer(NULL); initialiseBackgroundLayer(NULL); _vm->fetchPalette(bgfile, _palette); setPalette(0, 256, _palette, RDPAL_FADE); renderParallax(_vm->fetchBackgroundLayer(bgfile), 2); closeBackgroundLayer(); byte *loadingBar = _vm->_resman->openResource(2951); byte *frame = _vm->fetchFrameHeader(loadingBar, 0); AnimHeader animHead; CdtEntry cdt; FrameHeader frame_head; animHead.read(_vm->fetchAnimHeader(loadingBar)); cdt.read(_vm->fetchCdtEntry(loadingBar, 0)); frame_head.read(_vm->fetchFrameHeader(loadingBar, 0)); SpriteInfo barSprite; barSprite.x = cdt.x; barSprite.y = cdt.y; barSprite.w = frame_head.width; barSprite.h = frame_head.height; barSprite.scale = 0; barSprite.scaledWidth = 0; barSprite.scaledHeight = 0; barSprite.type = RDSPR_RLE256FAST | RDSPR_TRANS; barSprite.blend = 0; barSprite.colourTable = 0; barSprite.data = frame + FrameHeader::size(); barSprite.isText = false; drawSprite(&barSprite); fadeUp(); waitForFade(); for (int i = 0; i < animHead.noAnimFrames; i++) { frame = _vm->fetchFrameHeader(loadingBar, i); barSprite.data = frame + FrameHeader::size(); drawSprite(&barSprite); updateDisplay(); _vm->_system->delayMillis(30); } _vm->_resman->closeResource(2951); fadeDown(); waitForFade(); }
void SLib::drawMap(std::map<int, std::map<int, int> > _map) { unsigned int i = 0; unsigned int j; this->m_window.clear(); while (i < _map.size()) { j = 0; while (j < _map[0].size()) { switch (_map[i][j]) { case 0: //WALL drawSprite(this->Wall, i, j); break; case 2: if (this->_type == NIBBLER) drawSprite(this->snake, i, j); //BODY else drawSprite(this->Pac, i, j); break; case 3: drawSprite(this->foodPicture, i, j); break; case 7: drawSprite(this->Rouge, i, j); //ROUGE break; case 4: drawSprite(this->Rose, i, j); //ROSE break; case 5: drawSprite(this->Orange, i, j); // ORANGE break; case 6: drawSprite(this->Bleu, i, j);//BLEU break; case 1: drawSprite(this->Grass, i, j); //FLOOR break; case 8: drawSprite(this->foo, i, j); break; } j++; } i++; } AffScore(); AffLife(); this->m_window.display(); }
void renderAlive(void) { if (aimY > 0.0f) { drawCanon(); drawBody(); } else { drawBody(); drawCanon(); } if (firing) drawFire(); drawSprite(locX+aimX, locY+aimY, SCALE_CROSSHAIR, 0.0f, BLOCK_CROSSHAIR1, 0); drawSprite(locX+lookX, locY+lookY, SCALE_CROSSHAIR, 0.0f, BLOCK_CROSSHAIR2, 0); }
//============================================================================= // Return the number of pixels colliding between the two sprites. // Pre: The device supports a stencil buffer and pOcclusionQuery points to // a valid occlusionQuery object. // Post: Returns the number of pixels of overlap //============================================================================= DWORD Graphics::pixelCollision(const SpriteData &sprite1, const SpriteData &sprite2) { if(!stencilSupport) // if no stencil buffer support return 0; beginScene(); // Set up stencil buffer using current entity device3d->SetRenderState(D3DRS_STENCILENABLE, true); device3d->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_ALWAYS); device3d->SetRenderState(D3DRS_STENCILREF, 0x1); device3d->SetRenderState(D3DRS_STENCILMASK, 0xffffffff); device3d->SetRenderState(D3DRS_STENCILWRITEMASK,0xffffffff); device3d->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_KEEP); device3d->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_REPLACE); // Write a 1 into the stencil buffer for each non-transparent pixel in ent spriteBegin(); // Enable stencil buffer (must be after spriteBegin) device3d->SetRenderState(D3DRS_STENCILENABLE, true); drawSprite(sprite2); // write 1s to stencil buffer spriteEnd(); // Change stencil buffer to only allow writes where the stencil value is 1 // (where the ent sprite is colliding with the current sprite) device3d->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_EQUAL); device3d->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_KEEP); // Begin occlusion query to count pixels that are drawn pOcclusionQuery->Issue(D3DISSUE_BEGIN); spriteBegin(); // Enable stencil buffer (must be after spriteBegin) device3d->SetRenderState(D3DRS_STENCILENABLE, true); drawSprite(sprite1); // draw current entity spriteEnd(); // End occlusion query pOcclusionQuery->Issue(D3DISSUE_END); // Wait until the GPU is finished. while(S_FALSE == pOcclusionQuery->GetData( &numberOfPixelsColliding, sizeof(DWORD), D3DGETDATA_FLUSH )) {} // Turn off stencil device3d->SetRenderState(D3DRS_STENCILENABLE, false); endScene(); return numberOfPixelsColliding; }
void Animation::draw(float deltaTime, float x, float y, float w, float h, const GameShader& shader) { time_ += deltaTime * speed_; if (reset_) { reset_ = false; lastTime_ = time_; } if (frames_.getSize() > 0) { // New frame? if (!end_ && time_ > frames_[index_].time_ + lastTime_) { if (loop_) { index_ = (1 + index_) % frames_.getSize(); } else { if (index_ + 1 < frames_.getSize()) { ++index_; } else { end_ = true; } } lastTime_ = time_; // Frame updated. } Frame& frame = frames_[index_]; drawSprite(frame.sprite_, shader, x, y, w * frame.sprite_.getWidth() / frame.bodyWidth_, h * frame.sprite_.getHeight() / frame.bodyWidth_); } }
void animate_spermicides(char *base) { if (spermicides->first == NULL) return; lst_iitem_t* curSp; int n = 0; for(curSp = spermicides->first; curSp != NULL; curSp = curSp->next) n++; for(curSp = spermicides->first; curSp != NULL; curSp = curSp->next){ destroySprite(curSp->spr, base); if (!check_spermicide_colision(curSp->spr,curSp->spr->y - curSp->spr->yspeed)) { curSp->spr->y -= curSp->spr->yspeed; drawSprite(curSp->spr, base); } else { deleteSprite(curSp->spr); curSp = lst_remove(spermicides, curSp->spr); if (curSp == NULL) break; } } }
static Boolean GraffitiFormHandleEvent(EventPtr event){ Boolean handled = false; switch (event->eType) { case frmOpenEvent: FrmDrawForm(FrmGetActiveForm()); handled = true; break; case keyDownEvent: if(event->data.keyDown.chr == sentence[offset]){ offset++; if(offset == StrLen(sentence)){ FrmGotoForm(WinForm); } } handled = true; break; case nilEvent: { if(offset < StrLen(sentence)){ updateSprite(&nextLetter); drawSprite(&nextLetter); } handled = true; break; } default: break; } return handled; }
static void Draw(struct SPRITE *s) { // pipe into standard draw routine, compensating for camera use drawSprite(s, s->box.centerX, s->box.bottom); }
void drawEntity(Game* game, Entity* entity) { if(entity->texture) { Pointf location = createPointf( entity->position.x - entity->origin.x, entity->position.y - entity->origin.y); drawTexture(game, entity->texture, location, entity->depth); } if(entity->drawRectangle) { Rectanglei rectangle = createRectanglei( (int)entity->position.x - entity->origin.x + entity->offset.x, (int)entity->position.y - entity->origin.y + entity->offset.y, entity->size.x, entity->size.y ); drawRectangle(game, rectangle, entity->color); } if(entity->sprite.alive) { drawSprite(game, &entity->sprite); } }
void SmallText(char* strg,int x,int y) //Output text (numbers only) using small graphics font { int str_length=strlen(strg)-1; int scr_print; for (scr_print=0;scr_print<=str_length;scr_print++) drawSprite(smallfont,screen,(strg[scr_print]-48)*8,0,(scr_print*8)+x,y,8,8); }
void Text(char* strg,int x,int y) //Output text using graphics font { int str_length=strlen(strg)-1; int scr_print; for (scr_print=0;scr_print<=str_length;scr_print++) drawSprite(font,screen,(strg[scr_print]-32)*16,0,(scr_print*16)+x,y,16,16); }
void drawTextbox(){ int i, j; int shiftX = (SCREEN_WIDTH / 2) - (textboxSprite->width / 2); int shiftY = SCREEN_HEIGHT - 20 - textboxSprite->height; int alphaX, alphaY; int charX, charY; int charNum; int OFFSET = 14; int LINE_SPACE = 6; drawSprite(textboxSprite, shiftX, shiftY); for (i = currLine; i < currLine + NUM_LINES && i < numLines; i++){ for (j = 0; j < NUM_CHAR_LINE; j++){ if (lines[i][j] == '\0'){ break; } charNum = lines[i][j] - 32; if (charNum < 0 || charNum > 94){ charNum = 99; } alphaX = ((lines[i][j] - 32) % ALPHA_WIDTH) * LETTER_WIDTH; alphaY = ((lines[i][j] - 32) / ALPHA_HEIGHT) * LETTER_HEIGHT; charX = shiftX + OFFSET + (j * LETTER_WIDTH); charY = shiftY + OFFSET + ((i - currLine) * (LINE_SPACE + LETTER_HEIGHT)); drawSpriteSrcDst(alphabetSprite, alphaX, alphaY, LETTER_WIDTH, LETTER_HEIGHT, charX, charY); } } }
/** * @brief Displays the players health bar. */ void healthBar() { Vec2d scale; scale.y= 1; scale.x = (float)(playerData.health)/playerData.maxhealth; drawSprite(health_bar,0,vec2d(10,50),scale,0,gt_graphics_get_active_renderer()); }
void ComposerEngine::redraw() { if (!_needsUpdate && _dirtyRects.empty()) return; for (Common::List<Sprite>::iterator i = _sprites.begin(); i != _sprites.end(); i++) { Common::Rect rect(i->_pos.x, i->_pos.y, i->_pos.x + i->_surface.w, i->_pos.y + i->_surface.h); bool intersects = false; for (uint j = 0; j < _dirtyRects.size(); j++) { if (!_dirtyRects[j].intersects(rect)) continue; intersects = true; break; } if (!intersects) continue; drawSprite(*i); } for (uint i = 0; i < _dirtyRects.size(); i++) { const Common::Rect &rect = _dirtyRects[i]; byte *pixels = (byte *)_screen.getBasePtr(rect.left, rect.top); _system->copyRectToScreen(pixels, _screen.pitch, rect.left, rect.top, rect.width(), rect.height()); } _system->updateScreen(); _needsUpdate = false; _dirtyRects.clear(); }
void drawShowCountDown(SDL_Surface* screen,int i) { psysSet_t ps; drawSprite(screen, graphics.countDownSpr[i], HSCREENW-140/2,HSCREENH-60/2); if(i!=lastShown) { ps.layer=PSYS_LAYER_TOP; ps.x=HSCREENW-140/2; ps.y=HSCREENH-60/2; ps.vel=20; // +/- in each dir ps.life=1000; ps.lifeVar=1300; ps.fade=0; ps.gravity=0; ps.bounce=1; //If 1, particles will bounce off screen borders ( (vel * -1)/2 ) ps.fadeColor=0x00; ps.srcImg=graphics.countDownSpr[i]->img; ps.srcRect=graphics.countDownSpr[i]->clip; spawnParticleSystem(&ps); lastShown=i; } }
int pause_menu() { static int i = 0; SDL_Renderer *render; render = gt_graphics_get_active_renderer(); SDL_RenderClear(gt_graphics_get_active_renderer()); ResetBuffer(); mainScreen = loadSprite("images/pause_screen.png",800,600,1); selection = loadSprite("images/selection.png",149,53,1); if(i == 0) { drawSprite(mainScreen,0,vec2d(0,0),vec2d(1,1),0,gt_graphics_get_active_renderer()); drawSprite(selection,0,vec2d(311,294),vec2d(1,1),0,gt_graphics_get_active_renderer()); }else if(i ==1) { drawSprite(mainScreen,0,vec2d(0,0),vec2d(1,1),0,gt_graphics_get_active_renderer()); drawSprite(selection,0,vec2d(311,377),vec2d(1,1),0,gt_graphics_get_active_renderer()); } NextFrame(); SDL_PumpEvents(); keys = SDL_GetKeyboardState(NULL); if(keys[SDL_SCANCODE_ESCAPE]) { done = 1; } if(keys[SDL_SCANCODE_DOWN]) { i = 1; } if(keys[SDL_SCANCODE_UP]) { i = 0; } if(keys[SDL_SCANCODE_RETURN]) { if(i == 0) { gameState = 1; } else { done = 1; } } return 1; }
void move() { // Для алгоритма поиска поути if(!path_find()) { if(playSound) soundBadMove(); return; } if(showPath) { // Рисуем шаги на экране path_save(); while(1) { switch(path_nextStep()) { case 1: drawSpriteStep(path_x, path_y+1, 0); break; case 2: drawSpriteStep(path_x, path_y-1, 1); break; case 3: drawSpriteStep(path_x+1, path_y, 2); break; case 4: drawSpriteStep(path_x-1, path_y, 3); break; } drawSprite(path_x, path_y, path_c); if(path_n==LAST_STEP) break; if(playSound) soundJumpSel(); delay(STEP_SPEED); }; // Удаляем нарисованные шаги с экрана path_load(); while(1) { drawSprite(path_x, path_y, 0); path_nextStep(); if(path_n==LAST_STEP) break; }; } else { drawSprite(selX, selY, 0); drawSprite(cursorX, cursorY, path_c); } // Реально перемещаем шарик. Все выше было лишь анимацией. game[cursorX][cursorY] = path_c; // Снимаем курсор selX = -1; // Очищаем игровое поле от временных значений path_end(); // Добавляем 3 шарика gameStep(); }
void updateBlocks(Game *g) { SDL_Rect rect; rect.h = 20; rect.w = 20; for (int i = 0; i < BLOCK_COUNT; i++) { for (int x = 0; x < BLOCK_WIDTH/BLOCK_TILE_WIDTH; x++) { for (int y = 0; y < BLOCK_HEIGHT/BLOCK_TILE_HEIGHT; y++) { rect.x = g->blocks[i].posx[x][y]; rect.y = g->blocks[i].posy[x][y]; if (g->blocks[i].damage[x][y] < MAX_BLOCK_DAMAGE) { if (x == 0 && y == 0) { drawSprite(g->screen, &rect, "block_topleft.bmp"); } else if (x == 3 && y == 0) { drawSprite(g->screen, &rect, "block_topright.bmp"); } else if (x == 0 && y == 2) { drawSprite(g->screen, &rect, "block_bottomleft.bmp"); } else if (x == 1 && y == 2) { drawSprite(g->screen, &rect, "block_bottommiddleleft.bmp"); } else if (x == 2 && y == 2) { drawSprite(g->screen, &rect, "block_bottommiddleright.bmp"); } else if (x == 3 && y == 2) { drawSprite(g->screen, &rect, "block_bottomright.bmp"); } else { drawSprite(g->screen, &rect, "block_fill.bmp"); } } else { SDL_FillRect(g->screen, &rect, SDL_MapRGB(g->screen->format, 0, 0, 0)); } } } } }
bool BaseSurfaceOSystem::displayTransform(int x, int y, Rect32 rect, Rect32 newRect, const TransformStruct &transform) { _rotation = (uint32)transform._angle; if (transform._angle < 0.0f) { warning("Negative rotation: %d %d", transform._angle, _rotation); _rotation = (uint32)(360.0f + transform._angle); warning("Negative post rotation: %d %d", transform._angle, _rotation); } return drawSprite(x, y, &rect, &newRect, transform); }
void drawCircle(glm::vec2 c, float r) { float hr = 0.5f * r; glBindTexture(GL_TEXTURE_2D, circleTexture); AABB bounds; bounds.include(c); bounds.expand(hr); drawSprite(bounds); }
void RenderManager::drawSpriteAnimation(SpriteAnimation* spriteAnimation) { if(spriteAnimation->_framesCount > 0) { if(spriteAnimation->_currentFrame < spriteAnimation->_framesCount) drawSprite(spriteAnimation->_spriteFrames[spriteAnimation->_currentFrame],spriteAnimation->_position.x,spriteAnimation->_position.x); } }
namespace SkRecords { bool Draw::skip(const PairedPushCull& r) { if (fCanvas->quickReject(r.base->rect)) { fIndex += r.skip; return true; } return false; } bool Draw::skip(const BoundedDrawPosTextH& r) { return fCanvas->quickRejectY(r.minY, r.maxY); } // NoOps draw nothing. template <> void Draw::draw(const NoOp&) {} #define DRAW(T, call) template <> void Draw::draw(const T& r) { fCanvas->call; } DRAW(Restore, restore()); DRAW(Save, save(r.flags)); DRAW(SaveLayer, saveLayer(r.bounds, r.paint, r.flags)); DRAW(PopCull, popCull()); DRAW(PushCull, pushCull(r.rect)); DRAW(Clear, clear(r.color)); DRAW(Concat, concat(r.matrix)); DRAW(SetMatrix, setMatrix(SkMatrix::Concat(fInitialCTM, r.matrix))); DRAW(ClipPath, clipPath(r.path, r.op, r.doAA)); DRAW(ClipRRect, clipRRect(r.rrect, r.op, r.doAA)); DRAW(ClipRect, clipRect(r.rect, r.op, r.doAA)); DRAW(ClipRegion, clipRegion(r.region, r.op)); DRAW(DrawBitmap, drawBitmap(r.bitmap, r.left, r.top, r.paint)); DRAW(DrawBitmapMatrix, drawBitmapMatrix(r.bitmap, r.matrix, r.paint)); DRAW(DrawBitmapNine, drawBitmapNine(r.bitmap, r.center, r.dst, r.paint)); DRAW(DrawBitmapRectToRect, drawBitmapRectToRect(r.bitmap, r.src, r.dst, r.paint, r.flags)); DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); DRAW(DrawOval, drawOval(r.oval, r.paint)); DRAW(DrawPaint, drawPaint(r.paint)); DRAW(DrawPath, drawPath(r.path, r.paint)); DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint)); DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); DRAW(DrawRRect, drawRRect(r.rrect, r.paint)); DRAW(DrawRect, drawRect(r.rect, r.paint)); DRAW(DrawSprite, drawSprite(r.bitmap, r.left, r.top, r.paint)); DRAW(DrawText, drawText(r.text, r.byteLength, r.x, r.y, r.paint)); DRAW(DrawTextOnPath, drawTextOnPath(r.text, r.byteLength, r.path, r.matrix, r.paint)); DRAW(DrawVertices, drawVertices(r.vmode, r.vertexCount, r.vertices, r.texs, r.colors, r.xmode.get(), r.indices, r.indexCount, r.paint)); #undef DRAW template <> void Draw::draw(const PairedPushCull& r) { this->draw(*r.base); } template <> void Draw::draw(const BoundedDrawPosTextH& r) { this->draw(*r.base); } } // namespace SkRecords
void DX11Surface::drawSpriteArray(Sprite* pSpriteArray, UINT uNumOfSprites) { assert(pSpriteArray != nullptr); for (int i = 0; i < uNumOfSprites; ++i) { drawSprite(pSpriteArray[i]); } m_uRenderCalls += uNumOfSprites; }
static void batRender(const Monster *bat) { if (bat->flags & FLAG_ALIVE) { if (bat->state == BAT_ATTACK) { drawSprite(bat->loc.x, bat->loc.y, 0.3f, 0.0f, BLOCK_BAT_ATTACK, 0); } else { float flapSpeed; switch (bat->state) { default : case BAT_FLY : flapSpeed = 5.0f; break; case BAT_CHARGE : flapSpeed = 1.0f; break; case BAT_ATTACK : flapSpeed = 25.0f; break; } drawSprite(bat->loc.x, bat->loc.y, 0.3f, 0.0f, animate(BLOCK_BAT1, 2, flapSpeed, elapse), 0); } } else { drawSprite(bat->loc.x, bat->loc.y, 0.4f, 0.0f, BLOCK_BAT_DEAD, 0); } }
bool BaseSurfaceOSystem::displayZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha, bool transparent, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) { _rotation = 0; TransformStruct transform; if (transparent) { transform = TransformStruct((int32)zoomX, (int32)zoomY, kDefaultAngle, kDefaultHotspotX, kDefaultHotspotY, blendMode, alpha, mirrorX, mirrorY); } else { transform = TransformStruct((int32)zoomX, (int32)zoomY, mirrorX, mirrorY); } return drawSprite(x, y, &rect, nullptr, transform); }
void EyedropperStatusDisplay::draw() { doublePair center = { 0, 0 }; setDrawColor( 1, 1, 1, 1 ); if( isCommandKeyDown() ) { if( mOnSprite != NULL ) { drawSprite( mOnSprite, center, mDrawScale ); } } else { if( mOffSprite != NULL ) { drawSprite( mOffSprite, center, mDrawScale ); } } }
void preparation_fenetre(SDL_Surface *src, SDL_Surface *dest, int win_x, int win_y, int win_l, int win_h) { Uint32 Pnoir = SDL_MapRGB(dest->format, 0, 0, 0); drawSprite(src, dest, win_x, win_y, win_x, win_y, win_l, win_h); ligneV(dest, win_x-1, win_y, win_h, Pnoir); ligneV(dest, win_x+win_l, win_y, win_h, Pnoir); ligneH(dest, win_x, win_y-1, win_l, Pnoir); ligneH(dest, win_x, win_y+win_h, win_l, Pnoir); }
/** * \brief The function that blits the sprite to dst * \param SDL_Surface Surface where the sprite will be drawn * \param x X-Coordinate, indicating the position on dst * \param y Y-Coordinate, indicating the position on dst */ void CSprite::drawSprite(const int x, const int y, const int w, const int h, const Uint8 alpha ) { #if SDL_VERSION_ATLEAST(2, 0, 0) SDL_SetSurfaceAlphaMod( mpSurface.get(), alpha); #else SDL_SetAlpha(mpSurface.get(), SDL_SRCALPHA, alpha); #endif drawSprite( g_pVideoDriver->getBlitSurface(), x, y, w, h ); }