the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 88 lines 1.7 kB view raw
1#include "stdafx.h" 2#include "FlippedIcon.h" 3#include "SharedConstants.h" 4 5FlippedIcon::FlippedIcon(Icon *base, bool horizontal, bool vertical) : base(base), horizontal(horizontal), vertical(vertical) 6{ 7} 8 9int FlippedIcon::getX() const 10{ 11 return base->getX(); 12} 13 14int FlippedIcon::getY() const 15{ 16 return base->getY(); 17} 18 19int FlippedIcon::getWidth() const 20{ 21 return base->getWidth(); 22} 23 24int FlippedIcon::getHeight() const 25{ 26 return base->getHeight(); 27} 28 29float FlippedIcon::getU0(bool adjust/*=false*/) const 30{ 31 if (horizontal) return base->getU1(adjust); 32 return base->getU0(adjust); 33} 34 35float FlippedIcon::getU1(bool adjust/*=false*/) const 36{ 37 if (horizontal) return base->getU0(adjust); 38 return base->getU1(adjust); 39} 40 41float FlippedIcon::getU(double offset, bool adjust/*=false*/) const 42{ 43 float diff = getU1(adjust) - getU0(adjust); 44 return getU0(adjust) + (diff * ((float) offset / SharedConstants::WORLD_RESOLUTION)); 45} 46 47float FlippedIcon::getV0(bool adjust/*=false*/) const 48{ 49 if (vertical) return base->getV0(adjust); 50 return base->getV0(adjust); 51} 52 53float FlippedIcon::getV1(bool adjust/*=false*/) const 54{ 55 if (vertical) return base->getV0(adjust); 56 return base->getV1(adjust); 57} 58 59float FlippedIcon::getV(double offset, bool adjust/*=false*/) const 60{ 61 float diff = getV1(adjust) - getV0(adjust); 62 return getV0(adjust) + (diff * ((float) offset / SharedConstants::WORLD_RESOLUTION)); 63} 64 65wstring FlippedIcon::getName() const 66{ 67 return base->getName(); 68} 69 70int FlippedIcon::getSourceWidth() const 71{ 72 return base->getSourceWidth(); 73} 74 75int FlippedIcon::getSourceHeight() const 76{ 77 return base->getSourceHeight(); 78} 79 80int FlippedIcon::getFlags() const 81{ 82 return base->getFlags(); 83} 84 85void FlippedIcon::setFlags(int flags) 86{ 87 base->setFlags(flags); 88}