the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 56 lines 1.3 kB view raw
1#include "stdafx.h" 2#include "GuiParticles.h" 3#include "GuiParticle.h" 4#include "Textures.h" 5 6GuiParticles::GuiParticles(Minecraft *mc) 7{ 8 this->mc = mc; 9} 10 11void GuiParticles::tick() 12{ 13 for (unsigned int i = 0; i < particles.size(); i++) 14 { 15 GuiParticle *gp = particles[i]; 16 17 gp->preTick(); 18 gp->tick(this); 19 20 if (gp->removed) 21 { 22 particles.erase(particles.begin()+i); 23 i--; 24 } 25 } 26} 27 28void GuiParticles::add(GuiParticle *guiParticle) 29{ 30 particles.push_back(guiParticle); 31 guiParticle->preTick(); 32} 33 34void GuiParticles::render(float a) 35{ 36 // 4J Stu - Never used 37#if 0 38 mc->textures->bindTexture(L"/gui/particles.png"); 39 40 AUTO_VAR(itEnd, particles.end()); 41 for (AUTO_VAR(it, particles.begin()); it != itEnd; it++) 42 { 43 GuiParticle *gp = *it; //particles[i]; 44 int xx = (int) (gp->xo + (gp->x - gp->xo) * a - 4); 45 int yy = (int) (gp->yo + (gp->y - gp->yo) * a - 4); 46 47 float alpha = ((float) (gp->oA + (gp->a - gp->oA) * a)); 48 float r = ((float) (gp->oR + (gp->r - gp->oR) * a)); 49 float g = ((float) (gp->oG + (gp->g - gp->oG) * a)); 50 float b = ((float) (gp->oB + (gp->b - gp->oB) * a)); 51 52 glColor4f(r, g, b, alpha); 53 blit(xx, yy, 8 * 5, 0, 8, 8); 54 } 55#endif 56}