ok ca se lance
This commit is contained in:
parent
aea1502487
commit
7ecb677d97
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
class GoodPixelManager : public PixelManager{
|
class GoodPixelManager : public PixelManager{
|
||||||
|
|
||||||
void loadSprites(SpriteTasks& tasks) override;
|
void loadSprites(vector<Task>& tasks) override;
|
||||||
|
|
||||||
MySprite player;
|
MySprite player;
|
||||||
MySprite invaderA;
|
MySprite invaderA;
|
||||||
|
@ -40,22 +40,24 @@ typedef nsGui::GlutFont::GlutFonts Font;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// The convention seems to just add a number to the macro name
|
// The convention seems to just add a number to the macro name
|
||||||
#define ADD_TASK(X) ADD_TASK2(X, X)
|
#define ADD_SPRITE_TASK(X) ADD_SPRITE_TASK2(X, X)
|
||||||
#define ADD_TASK2(X, Y) tasks.push_back((X).asyncLoad("assets/"#Y".si2"));
|
#define ADD_SPRITE_TASK2(X, Y) tasks.push_back((X).asyncLoad("assets/"#Y".si2"));
|
||||||
|
|
||||||
typedef vector<future<void>> SpriteTasks;
|
typedef future<void> Task;
|
||||||
|
|
||||||
|
|
||||||
class PixelManager{
|
class PixelManager{
|
||||||
public:
|
public:
|
||||||
MinGL& window;
|
MinGL& window;
|
||||||
|
mutable vector<Task> drawTasks;
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief loads sprites in parallel using multiple threads
|
* @brief loads sprites in parallel using multiple threads
|
||||||
* @param[in] vec : We take his ownership, so
|
* @param[in] vec : We take his ownership, so
|
||||||
* @fn void loadSprites();
|
* @fn void loadSprites();
|
||||||
*/
|
*/
|
||||||
virtual void loadSprites(SpriteTasks& tasks);
|
virtual void loadSprites(vector<Task>& tasks);
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -244,20 +246,6 @@ public:
|
|||||||
* @fn void drawGodBench(int y) const
|
* @fn void drawGodBench(int y) const
|
||||||
*/
|
*/
|
||||||
void drawGodBench(int y) const;
|
void drawGodBench(int y) const;
|
||||||
|
|
||||||
/*!
|
|
||||||
* @brief display god's right hand
|
|
||||||
* @param[in] pos : pixel coordiniates of the hand
|
|
||||||
* @fn void drawGodRightHand(const Position& pos) const;
|
|
||||||
*/
|
|
||||||
void drawGodRightHand(const Position& pos) const;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @brief display god's left hand
|
|
||||||
* @param[in] pos : pixel coordiniates of the hand
|
|
||||||
* @fn void drawGodLeftHand(const Position& pos) const;
|
|
||||||
*/
|
|
||||||
void drawGodLeftHand(const Position& pos) const;
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief display god's face
|
* @brief display god's face
|
||||||
|
@ -101,8 +101,8 @@ void Game::displayGod() const {
|
|||||||
|
|
||||||
Position leftHand(GOD_HAND_DISTANCE, god.counter-GOD_BENCH_SIZE);
|
Position leftHand(GOD_HAND_DISTANCE, god.counter-GOD_BENCH_SIZE);
|
||||||
Position rightHand(pm->getScreenWidth()-GOD_HAND_DISTANCE-GOD_HAND_SIZE, god.counter-GOD_BENCH_SIZE);
|
Position rightHand(pm->getScreenWidth()-GOD_HAND_DISTANCE-GOD_HAND_SIZE, god.counter-GOD_BENCH_SIZE);
|
||||||
pm->drawGodLeftHand(leftHand);
|
pm->drawSprite(pm->leftHand);
|
||||||
pm->drawGodRightHand(rightHand);
|
pm->drawSprite(pm->rightHand);
|
||||||
pm->drawGodFace(god.counter - GOD_BENCH_SIZE);
|
pm->drawGodFace(god.counter - GOD_BENCH_SIZE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -110,8 +110,8 @@ void Game::displayGod() const {
|
|||||||
pm->drawGodBench(0);
|
pm->drawGodBench(0);
|
||||||
Position leftHand(GOD_HAND_DISTANCE, 0);
|
Position leftHand(GOD_HAND_DISTANCE, 0);
|
||||||
Position rightHand(god.getRightHandPos(pm->getScreenWidth()));
|
Position rightHand(god.getRightHandPos(pm->getScreenWidth()));
|
||||||
pm->drawGodLeftHand(leftHand);
|
pm->drawSprite(pm->leftHand);
|
||||||
pm->drawGodRightHand(rightHand);
|
pm->drawSprite(pm->rightHand);
|
||||||
pm->drawGodFace(0);
|
pm->drawGodFace(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -120,7 +120,7 @@ void Game::displayGod() const {
|
|||||||
// Bezier curve
|
// Bezier curve
|
||||||
// counter goes [0-100]
|
// counter goes [0-100]
|
||||||
pm->drawGodBench(0);
|
pm->drawGodBench(0);
|
||||||
pm->drawGodLeftHand(Position(GOD_HAND_DISTANCE, 0));
|
pm->drawSprite(pm->leftHand, Position(GOD_HAND_DISTANCE, 0));
|
||||||
pm->drawGodFace(0);
|
pm->drawGodFace(0);
|
||||||
|
|
||||||
Position pos(god.getRightHandPos(pm->getScreenWidth()));
|
Position pos(god.getRightHandPos(pm->getScreenWidth()));
|
||||||
@ -130,7 +130,7 @@ void Game::displayGod() const {
|
|||||||
applyBezier(pos, endPos, god.counter / 100.0);
|
applyBezier(pos, endPos, god.counter / 100.0);
|
||||||
|
|
||||||
// pos is now the position we need to draw our hand to
|
// pos is now the position we need to draw our hand to
|
||||||
pm->drawGodRightHand(pos);
|
pm->drawSprite(pm->rightHand, pos);
|
||||||
if(god.thrownInvType!=InvaderType::NONE){
|
if(god.thrownInvType!=InvaderType::NONE){
|
||||||
|
|
||||||
pos+=Position(GOD_HAND_SIZE/2, GOD_HAND_SIZE/2);
|
pos+=Position(GOD_HAND_SIZE/2, GOD_HAND_SIZE/2);
|
||||||
@ -141,7 +141,7 @@ void Game::displayGod() const {
|
|||||||
}
|
}
|
||||||
case GodState::THROW:{
|
case GodState::THROW:{
|
||||||
pm->drawGodBench(0);
|
pm->drawGodBench(0);
|
||||||
pm->drawGodLeftHand(Position(GOD_HAND_DISTANCE, 0));
|
pm->drawSprite(pm->leftHand, Position(GOD_HAND_DISTANCE, 0));
|
||||||
pm->drawGodFace(0);
|
pm->drawGodFace(0);
|
||||||
|
|
||||||
// compute start position (not sure if we should store it or compute it each time ?)
|
// compute start position (not sure if we should store it or compute it each time ?)
|
||||||
@ -160,7 +160,7 @@ void Game::displayGod() const {
|
|||||||
else handCounter = 30-god.counter;
|
else handCounter = 30-god.counter;
|
||||||
handPos = handPos + god.thrownVector * (handCounter / 100.0);
|
handPos = handPos + god.thrownVector * (handCounter / 100.0);
|
||||||
}
|
}
|
||||||
pm->drawGodRightHand(handPos);
|
pm->drawSprite(pm->rightHand);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ Game::Game() : WININIT {
|
|||||||
"\nValid values are : good,bad");
|
"\nValid values are : good,bad");
|
||||||
|
|
||||||
cout << "Loading sprites..." << endl;
|
cout << "Loading sprites..." << endl;
|
||||||
SpriteTasks tasks;
|
vector<Task> tasks;
|
||||||
chrono::high_resolution_clock::time_point start = chrono::high_resolution_clock::now();
|
chrono::high_resolution_clock::time_point start = chrono::high_resolution_clock::now();
|
||||||
|
|
||||||
pm->loadSprites(tasks);
|
pm->loadSprites(tasks);
|
||||||
@ -116,7 +116,7 @@ void Game::initGame(){
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define START_TIMER() DEBUG_INSTR(debugTime = chrono::high_resolution_clock::now())
|
#define START_TIMER() DEBUG_INSTR(debugTime = chrono::high_resolution_clock::now())
|
||||||
#define PRINT_TIMER(X) DEBUG_MSG((X) << " :" << chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now()-debugTime).count())
|
#define PRINT_TIMER(X) DEBUG_MSG((X) << ": " << chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now()-debugTime).count())
|
||||||
|
|
||||||
WinValue Game::enterGameLoop(){ // returns when game is finished
|
WinValue Game::enterGameLoop(){ // returns when game is finished
|
||||||
// computed in advance for performance reasons
|
// computed in advance for performance reasons
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "mySprite.h"
|
#include "mySprite.h"
|
||||||
|
|
||||||
future<void> MySprite::asyncLoad(const string& fname){
|
future<void> MySprite::asyncLoad(const string& fname){
|
||||||
|
DEBUG_MSG("Load file " << fname)
|
||||||
return std::async(std::launch::async, [fname, this]() -> void {
|
return std::async(std::launch::async, [fname, this]() -> void {
|
||||||
ptr = std::make_unique<nsGui::Sprite>(fname);
|
ptr = std::make_unique<nsGui::Sprite>(fname);
|
||||||
});
|
});
|
||||||
|
@ -25,73 +25,73 @@ PixelManager::PixelManager(MinGL& win) : window(win) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PixelManager::drawHeart(const Position& baseVector) const {
|
void PixelManager::drawHeart(const Position& baseVector) const {
|
||||||
window << Circle(Position(10, 10)+baseVector,10, nsGraphics::KRed);
|
window << Circle(Position(10, 10)+baseVector,10, nsGraphics::KRed);
|
||||||
window << Circle(Position(30, 10)+baseVector,10, nsGraphics::KRed);
|
window << Circle(Position(30, 10)+baseVector,10, nsGraphics::KRed);
|
||||||
window << Triangle(Position(0,10)+baseVector,Position(40,10)+baseVector,Position(20,40)+baseVector,nsGraphics::KRed);
|
window << Triangle(Position(0,10)+baseVector,Position(40,10)+baseVector,Position(20,40)+baseVector,nsGraphics::KRed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PixelManager::drawInvaderA(const Position& baseVector, unsigned size, const RGBAcolor& color) const {
|
void PixelManager::drawInvaderA(const Position& baseVector, unsigned size, const RGBAcolor& color) const {
|
||||||
float scale = size/(float)100;
|
float scale = size/(float)100;
|
||||||
window << Circle(Position(50*scale, 50*scale)+baseVector, 50*scale, nsGraphics::KGray);
|
window << Circle(Position(50*scale, 50*scale)+baseVector, 50*scale, nsGraphics::KGray);
|
||||||
window << Triangle(Position(35*scale, 50*scale)+baseVector, Position(15*scale, 25*scale)+baseVector, Position(15*scale, 75*scale)+baseVector, nsGraphics::KBlack);
|
window << Triangle(Position(35*scale, 50*scale)+baseVector, Position(15*scale, 25*scale)+baseVector, Position(15*scale, 75*scale)+baseVector, nsGraphics::KBlack);
|
||||||
window << Triangle(Position(25*scale, 50*scale)+baseVector, Position(10*scale, 25*scale)+baseVector, Position(10*scale, 75*scale)+baseVector, nsGraphics::KGray);
|
window << Triangle(Position(25*scale, 50*scale)+baseVector, Position(10*scale, 25*scale)+baseVector, Position(10*scale, 75*scale)+baseVector, nsGraphics::KGray);
|
||||||
window << Triangle(Position(65*scale, 50*scale)+baseVector, Position(85*scale, 25*scale)+baseVector, Position(85*scale, 75*scale)+baseVector, nsGraphics::KBlack);
|
window << Triangle(Position(65*scale, 50*scale)+baseVector, Position(85*scale, 25*scale)+baseVector, Position(85*scale, 75*scale)+baseVector, nsGraphics::KBlack);
|
||||||
window << Triangle(Position(75*scale, 50*scale)+baseVector, Position(90*scale, 25*scale)+baseVector, Position(90*scale, 75*scale)+baseVector, nsGraphics::KGray);
|
window << Triangle(Position(75*scale, 50*scale)+baseVector, Position(90*scale, 25*scale)+baseVector, Position(90*scale, 75*scale)+baseVector, nsGraphics::KGray);
|
||||||
window << Rectangle(Position(35*scale, 65*scale)+baseVector, Position(65*scale, 72*scale)+baseVector, nsGraphics::KBlack);
|
window << Rectangle(Position(35*scale, 65*scale)+baseVector, Position(65*scale, 72*scale)+baseVector, nsGraphics::KBlack);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PixelManager::drawInvaderB(const Position& baseVector, unsigned size, const RGBAcolor& color) const {
|
void PixelManager::drawInvaderB(const Position& baseVector, unsigned size, const RGBAcolor& color) const {
|
||||||
float scale = size/(float)100;
|
float scale = size/(float)100;
|
||||||
window << Circle(Position(50*scale, 50*scale)+baseVector, 50*scale, nsGraphics::KRed);
|
window << Circle(Position(50*scale, 50*scale)+baseVector, 50*scale, nsGraphics::KRed);
|
||||||
window << Rectangle(Position(25*scale, 30*scale)+baseVector, Position(45*scale, 40*scale)+baseVector, nsGraphics::KBlack);
|
window << Rectangle(Position(25*scale, 30*scale)+baseVector, Position(45*scale, 40*scale)+baseVector, nsGraphics::KBlack);
|
||||||
window << Rectangle(Position(55*scale, 30*scale)+baseVector, Position(75*scale, 40*scale)+baseVector, nsGraphics::KBlack);
|
window << Rectangle(Position(55*scale, 30*scale)+baseVector, Position(75*scale, 40*scale)+baseVector, nsGraphics::KBlack);
|
||||||
window << Rectangle(Position(35*scale, 65*scale)+baseVector, Position(65*scale, 72*scale)+baseVector, nsGraphics::KBlack);
|
window << Rectangle(Position(35*scale, 65*scale)+baseVector, Position(65*scale, 72*scale)+baseVector, nsGraphics::KBlack);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PixelManager::drawInvaderC(const Position& baseVector, unsigned size, const RGBAcolor& color) const {
|
void PixelManager::drawInvaderC(const Position& baseVector, unsigned size, const RGBAcolor& color) const {
|
||||||
float scale = size/(float)100;
|
float scale = size/(float)100;
|
||||||
window << Circle(Position(50*scale, 50*scale)+baseVector, 50*scale, nsGraphics::KGreen);
|
window << Circle(Position(50*scale, 50*scale)+baseVector, 50*scale, nsGraphics::KGreen);
|
||||||
window << Circle(Position(35*scale, 35*scale)+baseVector, 10*scale, nsGraphics::KBlack);
|
window << Circle(Position(35*scale, 35*scale)+baseVector, 10*scale, nsGraphics::KBlack);
|
||||||
window << Circle(Position(65*scale, 35*scale)+baseVector, 10*scale, nsGraphics::KBlack);
|
window << Circle(Position(65*scale, 35*scale)+baseVector, 10*scale, nsGraphics::KBlack);
|
||||||
window << Rectangle(Position(35*scale, 65*scale)+baseVector, Position(65*scale, 72*scale)+baseVector, nsGraphics::KBlack);
|
window << Rectangle(Position(35*scale, 65*scale)+baseVector, Position(65*scale, 72*scale)+baseVector, nsGraphics::KBlack);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PixelManager::drawPlayer(unsigned x, unsigned width, const nsGraphics::RGBAcolor& color) const {
|
void PixelManager::drawPlayer(unsigned x, unsigned width, const nsGraphics::RGBAcolor& color) const {
|
||||||
width = width-10-10;
|
width = width-10-10;
|
||||||
width = width/2;
|
width = width/2;
|
||||||
window << Triangle(Position(0+x, 720), Position(5+x, 720), Position(5+x, 720-PLAYER_HEIGHT/2), color);
|
window << Triangle(Position(0+x, 720), Position(5+x, 720), Position(5+x, 720-PLAYER_HEIGHT/2), color);
|
||||||
window << Rectangle(Position(5+x, 720), Position(5+width+x, 720-PLAYER_HEIGHT/2), color);
|
window << Rectangle(Position(5+x, 720), Position(5+width+x, 720-PLAYER_HEIGHT/2), color);
|
||||||
window << Rectangle(Position(5+width+x, 720), Position(15+width+x, 720-PLAYER_HEIGHT), color);
|
window << Rectangle(Position(5+width+x, 720), Position(15+width+x, 720-PLAYER_HEIGHT), color);
|
||||||
window << Rectangle(Position(15+width+x, 720), Position(15+width*2+x, 720-PLAYER_HEIGHT/2), color);
|
window << Rectangle(Position(15+width+x, 720), Position(15+width*2+x, 720-PLAYER_HEIGHT/2), color);
|
||||||
window << Triangle(Position(15+width*2+x, 720), Position(15+width*2+x, 720-PLAYER_HEIGHT/2), Position(20+width*2+x, 720), color);
|
window << Triangle(Position(15+width*2+x, 720), Position(15+width*2+x, 720-PLAYER_HEIGHT/2), Position(20+width*2+x, 720), color);
|
||||||
window << Triangle(Position(5+x,720-PLAYER_HEIGHT/2), Position(5+width+x,720-PLAYER_HEIGHT/2), Position(5+width+x,720-PLAYER_HEIGHT*0.9), color);
|
window << Triangle(Position(5+x,720-PLAYER_HEIGHT/2), Position(5+width+x,720-PLAYER_HEIGHT/2), Position(5+width+x,720-PLAYER_HEIGHT*0.9), color);
|
||||||
window << Triangle(Position(15+width+x,720-PLAYER_HEIGHT/2), Position(15+width*2+x,720-PLAYER_HEIGHT/2), Position(15+width+x,720-PLAYER_HEIGHT*0.9), color);
|
window << Triangle(Position(15+width+x,720-PLAYER_HEIGHT/2), Position(15+width*2+x,720-PLAYER_HEIGHT/2), Position(15+width+x,720-PLAYER_HEIGHT*0.9), color);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PixelManager::drawMissile(const Position& baseVector, unsigned width, const nsGraphics::RGBAcolor& color) const {
|
void PixelManager::drawMissile(const Position& baseVector, unsigned width, const nsGraphics::RGBAcolor& color) const {
|
||||||
window << Rectangle(baseVector, baseVector + Position(width, width * PROJ_LENGTH_FACTOR), color);
|
window << Rectangle(baseVector, baseVector + Position(width, width * PROJ_LENGTH_FACTOR), color);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PixelManager::drawTorpedo(const Position& baseVector, unsigned width, const nsGraphics::RGBAcolor& color) const {
|
void PixelManager::drawTorpedo(const Position& baseVector, unsigned width, const nsGraphics::RGBAcolor& color) const {
|
||||||
window << Rectangle(baseVector, baseVector + Position(width, width * PROJ_LENGTH_FACTOR), color);
|
window << Rectangle(baseVector, baseVector + Position(width, width * PROJ_LENGTH_FACTOR), color);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PixelManager::drawSprite(const MySprite& msp, const Position& pos) const {
|
void PixelManager::drawSprite(const MySprite& msp, const Position& pos) const {
|
||||||
// The sprite is associated with a Vec2D for whatever reason, so yeah, we modify it each time we draw it
|
// The sprite is associated with a Vec2D for whatever reason, so yeah, we modify it each time we draw it
|
||||||
msp.ptr->setPosition(pos);
|
msp.ptr->setPosition(pos);
|
||||||
msp.ptr->draw(window);
|
msp.ptr->draw(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PixelManager::drawGodBench(int y) const {
|
void PixelManager::drawGodBench(int y) const {
|
||||||
window << Rectangle(Position(0, y), Position(getScreenWidth(), y+GOD_BENCH_SIZE), nsGraphics::KGray);
|
window << Rectangle(Position(0, y), Position(getScreenWidth(), y+GOD_BENCH_SIZE), nsGraphics::KGray);
|
||||||
}
|
|
||||||
|
|
||||||
void PixelManager::drawGodRightHand(const Position& pos) const {
|
|
||||||
drawSprite(rightHand, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PixelManager::drawGodLeftHand(const Position& pos) const {
|
|
||||||
drawSprite(leftHand, pos);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PixelManager::drawGodFace(int y, bool angry) const {
|
void PixelManager::drawGodFace(int y, bool angry) const {
|
||||||
@ -110,5 +110,6 @@ void PixelManager::drawGodFace(int y, bool angry) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PixelManager::drawText(const Position& pos, const string& text, const nsGraphics::RGBAcolor& color, Font font) const {
|
void PixelManager::drawText(const Position& pos, const string& text, const nsGraphics::RGBAcolor& color, Font font) const {
|
||||||
window << Text(pos, text, color, font);
|
window << Text(pos, text, color, font);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
#include "pixelManager/goodPixelManager.h"
|
#include "pixelManager/goodPixelManager.h"
|
||||||
|
|
||||||
void GoodPixelManager::loadSprites(SpriteTasks& tasks) {
|
void GoodPixelManager::loadSprites(vector<Task>& tasks) {
|
||||||
PixelManager::loadSprites(tasks);
|
PixelManager::loadSprites(tasks);
|
||||||
ADD_TASK(player)
|
ADD_SPRITE_TASK(player)
|
||||||
ADD_TASK(invaderA)
|
ADD_SPRITE_TASK(invaderA)
|
||||||
ADD_TASK(invaderB)
|
ADD_SPRITE_TASK(invaderB)
|
||||||
ADD_TASK(invaderC)
|
ADD_SPRITE_TASK(invaderC)
|
||||||
ADD_TASK(missile)
|
ADD_SPRITE_TASK(missile)
|
||||||
ADD_TASK(torpedo)
|
ADD_SPRITE_TASK(torpedo)
|
||||||
}
|
}
|
||||||
|
|
||||||
GoodPixelManager::GoodPixelManager(MinGL& win) : PixelManager(win) {
|
GoodPixelManager::GoodPixelManager(MinGL& win) : PixelManager(win) {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#include "pixelManager/pixelManager.h"
|
#include "pixelManager/pixelManager.h"
|
||||||
|
|
||||||
|
|
||||||
void PixelManager::loadSprites(SpriteTasks& tasks){
|
void PixelManager::loadSprites(vector<Task>& tasks){
|
||||||
ADD_TASK(logo)
|
ADD_SPRITE_TASK(logo)
|
||||||
ADD_TASK(menuBackground)
|
ADD_SPRITE_TASK(menuBackground)
|
||||||
ADD_TASK(gameBackground)
|
ADD_SPRITE_TASK(gameBackground)
|
||||||
ADD_TASK2(rightHand, hand)
|
ADD_SPRITE_TASK2(rightHand, hand)
|
||||||
}
|
}
|
||||||
|
|
||||||
void PixelManager::startFrame() const {
|
void PixelManager::startFrame() const {
|
||||||
@ -13,6 +13,7 @@ void PixelManager::startFrame() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PixelManager::endFrame() const {
|
void PixelManager::endFrame() const {
|
||||||
|
for(Task& t : drawTasks)t.wait();
|
||||||
window.finishFrame();
|
window.finishFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user