Changeset 5380 in orxonox.OLD for branches/2d-recalc/src/lib/gui
- Timestamp:
- Oct 15, 2005, 1:49:17 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2d-recalc/src/lib/gui/gl_gui/glmenu/glmenu_imagescreen.cc
r5373 r5380 200 200 /** 201 201 * draws the ImageScreen to the screenbuffer 202 * @todo redesign this whole function, as it is deprecated. 202 203 */ 203 204 void GLMenuImageScreen::draw () … … 209 210 210 211 /* screen size */ 211 int screenWidth =GraphicsEngine::getInstance()->getResolutionX();212 int screenHeight =GraphicsEngine::getInstance()->getResolutionY();213 214 int imageWidth = (int)(screenWidth * this->scaleX);215 int imageHeight = (int)(screenHeight * this->scaleY);216 217 int offsetX = (int)(this->offsetX * screenWidth);218 int offsetY = (int)(this->offsetY * screenHeight);212 float screenWidth = 1;//GraphicsEngine::getInstance()->getResolutionX(); 213 float screenHeight = 1;//GraphicsEngine::getInstance()->getResolutionY(); 214 215 float imageWidth = (screenWidth * this->scaleX); 216 float imageHeight = (screenHeight * this->scaleY); 217 218 float offsetX = (this->offsetX * screenWidth); 219 float offsetY = (this->offsetY * screenHeight); 219 220 220 221 /* loadbar pos */ 221 int barX = (int)(this->barX *screenWidth);222 int barY = (int)(this->barY *screenHeight);223 int barW = (int)(this->barW *screenWidth);224 int barH = (int)(this->barH *screenHeight);222 float barX = (this->barX *screenWidth); 223 float barY = (this->barY *screenHeight); 224 float barW = (this->barW *screenWidth); 225 float barH = (this->barH *screenHeight); 225 226 226 227 float val = (float)this->currentValue/(float)this->maxValue; … … 234 235 backMat->select(); 235 236 glBegin(GL_TRIANGLE_STRIP); 236 glTexCoord2i(0, 1); glVertex2 i(offsetX, offsetY + imageHeight);237 glTexCoord2i(1, 1); glVertex2 i(offsetX +imageWidth, offsetY + imageHeight);238 glTexCoord2i(0, 0); glVertex2 i(offsetX, offsetY);239 glTexCoord2i(1, 0); glVertex2 i(offsetX + imageWidth, offsetY);237 glTexCoord2i(0, 1); glVertex2f(offsetX, offsetY + imageHeight); 238 glTexCoord2i(1, 1); glVertex2f(offsetX +imageWidth, offsetY + imageHeight); 239 glTexCoord2i(0, 0); glVertex2f(offsetX, offsetY); 240 glTexCoord2i(1, 0); glVertex2f(offsetX + imageWidth, offsetY); 240 241 glEnd(); 241 242 … … 244 245 glBegin(GL_LINE_LOOP); 245 246 glColor3f(1.0, 1.0, 1.0); 246 glVertex2 i(barX - 2, barY - 2);247 glVertex2 i(barX + barW + 2, barY - 2);248 glVertex2 i(barX + barW + 2, barY + barH + 2);249 glVertex2 i(barX - 2, barY + barH + 2);247 glVertex2f(barX - .01, barY - .01); 248 glVertex2f(barX + barW + .01, barY - .01); 249 glVertex2f(barX + barW + .01, barY + barH + .01); 250 glVertex2f(barX - .01, barY + barH + .01); 250 251 glColor3f(1.0, 1.0, 1.0); 251 252 glEnd(); … … 254 255 barMat->select(); 255 256 glBegin(GL_TRIANGLE_STRIP); 256 glTexCoord2f(0, 1); glVertex2 i(barX, barY + barH);257 glTexCoord2f(val, 1); glVertex2 i(barX + (int)(val * this->barW * (float)screenWidth), barY + barH);258 glTexCoord2f(0, 0); glVertex2 i(barX, barY);259 glTexCoord2f(val, 0); glVertex2 i(barX + (int)(val * this->barW * (float)screenWidth), barY);257 glTexCoord2f(0, 1); glVertex2f(barX, barY + barH); 258 glTexCoord2f(val, 1); glVertex2f(barX + (val * this->barW * (float)screenWidth), barY + barH); 259 glTexCoord2f(0, 0); glVertex2f(barX, barY); 260 glTexCoord2f(val, 0); glVertex2f(barX + (val * this->barW * (float)screenWidth), barY); 260 261 glEnd(); 261 262 … … 263 264 glBegin(GL_QUADS); 264 265 glColor3f(0.0, 0.0, 0.0); 265 glVertex2 i(barX, barY);266 glVertex2 i(barX + barWidth, barY);267 glVertex2 i(barX + barWidth, barY + barHeight);268 glVertex2 i(barX, barY + barHeight);266 glVertex2f(barX, barY); 267 glVertex2f(barX + barWidth, barY); 268 glVertex2f(barX + barWidth, barY + barHeight); 269 glVertex2f(barX, barY + barHeight); 269 270 glColor3f(1.0, 1.0, 1.0); 270 271 glEnd(); … … 273 274 glBegin(GL_QUADS); 274 275 glColor3f(0.0, 0.0, 0.0); 275 glVertex2 i(barX-1, barY-1);276 glVertex2 i(barX + barWidth +1, barY-1);277 glVertex2 i(barX + barWidth+1, barY + barHeight+1);278 glVertex2 i(barX - 1, barY + barHeight +1);276 glVertex2f(barX-1, barY-1); 277 glVertex2f(barX + barWidth +1, barY-1); 278 glVertex2f(barX + barWidth+1, barY + barHeight+1); 279 glVertex2f(barX - 1, barY + barHeight +1); 279 280 glColor3f(1.0, 1.0, 1.0); 280 281 glEnd();
Note: See TracChangeset
for help on using the changeset viewer.