| 147 | } |
| 148 | |
| 149 | void ImageComponent::buildImageArray(int posX, int posY, GLfloat* points, GLfloat* texs, float px, float py) |
| 150 | { |
| 151 | points[0] = posX - (mSize.x() * mOrigin.x()); points[1] = posY - (mSize.y() * mOrigin.y()); |
| 152 | points[2] = posX - (mSize.x() * mOrigin.x()); points[3] = posY + (mSize.y() * (1 - mOrigin.y())); |
| 153 | points[4] = posX + (mSize.x() * (1 - mOrigin.x())); points[5] = posY - (mSize.y() * mOrigin.y()); |
| 154 | |
| 155 | points[6] = posX + (mSize.x() * (1 - mOrigin.x())); points[7] = posY - (mSize.y() * mOrigin.y()); |
| 156 | points[8] = posX - (mSize.x() * mOrigin.x()); points[9] = posY + (mSize.y() * (1 - mOrigin.y())); |
| 157 | points[10] = posX + (mSize.x() * (1 -mOrigin.x())); points[11] = posY + (mSize.y() * (1 - mOrigin.y())); |
| 158 | |
| 159 | |
| 160 | |
| 161 | texs[0] = 0; texs[1] = py; |
| 162 | texs[2] = 0; texs[3] = 0; |
| 163 | texs[4] = px; texs[5] = py; |
| 164 | |
| 165 | texs[6] = px; texs[7] = py; |
| 166 | texs[8] = 0; texs[9] = 0; |
| 167 | texs[10] = px; texs[11] = 0; |
| 168 | |
| 169 | if(mFlipX) |
| 170 | { |
| 171 | for(int i = 0; i < 11; i += 2) |
| 172 | if(texs[i] == px) |
| 173 | texs[i] = 0; |
| 174 | else |
| 175 | texs[i] = px; |
| 176 | } |
| 177 | if(mFlipY) |
| 178 | { |
| 179 | for(int i = 1; i < 12; i += 2) |
| 180 | if(texs[i] == py) |
| 181 | texs[i] = 0; |
| 182 | else |
| 183 | texs[i] = py; |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | void ImageComponent::drawImageArray(GLfloat* points, GLfloat* texs, GLubyte* colors, unsigned int numArrays) |
| 188 | { |
nothing calls this directly
no outgoing calls
no test coverage detected