Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- drx::util::IMAP<drx::gfx::COLOR>* clrs = new drx::util::IMAP<drx::gfx::COLOR>;
- SINT counter = 0;
- std::mutex* m = new std::mutex;
- while (!this->fs.eof()) {
- this->fs.getline(line, 256);
- this->pool.Queue([=, &counter] {
- std::unique_lock<std::mutex> lock(*m);
- /*
- Parse line
- */
- counter++;
- });
- }
- do { std::this_thread::sleep_for(std::chrono::milliseconds(1)); } while (this->pool.job.size() > 0);
- // done, set colors to sprite
- to.size = { 0, 0, wt, ht };
- for (int x = 0; x < to.size.w; x++) {
- drx:util::IMAP<drx::gfx::COLOR> clr;
- to.pixel << clr;
- }
- for (int p = 0, x = 0, y = 0; p < clrs->length; p++) {
- if (!clrs->Null(p)) {
- to.pixel[x] << *clrs->package[p].item;
- } else {
- drx::gfx::COLOR color = { 0, 0, 0, 1 };
- to.pixel[x] << color;
- }
- y++;
- if (y == to.size.h) {
- y = 0;
- x++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment