@@ -265,13 +265,13 @@ void drawTexturedRectangle(std::pair<float, float> texTopLeft, float sideLength,
265265 glVertex2d (screenTopLeft.first + screenSideLength, screenTopLeft.second + 0 .0f );
266266
267267
268- texCoordPair ({texTopLeft.first + 0 .0f , texTopLeft.second + sideLength});
269- glVertex2d (screenTopLeft.first + 0 .0f , screenTopLeft.second + screenSideLength);
270-
271268 texCoordPair ({texTopLeft.first + sideLength, texTopLeft.second + sideLength});
272269 glVertex2d (screenTopLeft.first + screenSideLength, screenTopLeft.second + screenSideLength);
273270
271+ texCoordPair ({texTopLeft.first + 0 .0f , texTopLeft.second + sideLength});
272+ glVertex2d (screenTopLeft.first + 0 .0f , screenTopLeft.second + screenSideLength);
274273
274+ /*
275275 //redraw the image for reasons
276276 texCoordPair({texTopLeft.first + sideLength, texTopLeft.second + sideLength});
277277 glVertex2d(screenTopLeft.first + screenSideLength, screenTopLeft.second + screenSideLength);
@@ -285,6 +285,7 @@ void drawTexturedRectangle(std::pair<float, float> texTopLeft, float sideLength,
285285 texCoordPair({texTopLeft.first + 0.0f, texTopLeft.second + 0.0f});
286286 glVertex2d(screenTopLeft.first + 0.0f, screenTopLeft.second + 0.0f);
287287
288+ */
288289
289290
290291
@@ -304,23 +305,32 @@ void DrawingGameVisitor::visit(GameDice& dice) {
304305
305306 glColor3d (1.0 , 1.0 , 1.0 );
306307 static const std::map<int , std::pair<float , float >> topLeftOffset = {
307- make_pair (1 , make_pair (4 .f , 8 .f )),
308- make_pair (2 , make_pair (134 .f , 8 .f )),
309- make_pair (3 , make_pair (264 .f , 8 .f )),
310- make_pair (4 , make_pair (4 .f , 142 .f )),
308+ make_pair (1 , make_pair (9 .f , 3 .f )),
309+ make_pair (2 , make_pair (134 .f , 3 .f )),
310+ make_pair (3 , make_pair (259 .f , 3 .f )),
311+ make_pair (4 , make_pair (9 .f , 142 .f )),
311312 make_pair (5 , make_pair (134 .f , 142 .f )),
312- make_pair (6 , make_pair (264 .f , 142 .f ))
313+ make_pair (6 , make_pair (259 .f , 142 .f ))
313314 };
314315
315- drawTexturedRectangle (topLeftOffset.find (dice.getFirst ())->second , 96 .f ,
316- make_pair (.8f , .9f ), 0.03 );
316+ drawTexturedRectangle (topLeftOffset.find (dice.getFirst ())->second , 95 .f ,
317+ make_pair (.7f , .9f ), 0.06 );
317318
318319
319- drawTexturedRectangle (topLeftOffset.find (dice.getSecond ())->second , 96 .f ,
320- make_pair (.84f , .9f ), 0.03 );
320+ drawTexturedRectangle (topLeftOffset.find (dice.getSecond ())->second , 95 .f ,
321+ make_pair (.78f , .9f ), 0.06 );
321322
322- glBindTexture (GL_TEXTURE_2D, 0 );
323+
324+
325+ // render all dice
326+ // drawTexturedRectangle(make_pair(9.f, 3.f), 95.f, make_pair(.6f, .9f), 0.06);
327+ // drawTexturedRectangle(make_pair(8.f, 4.f), 96.f, make_pair(.67f, .95f), 0.06);
328+ // drawTexturedRectangle(make_pair(16.f, 8.f), 96.f, make_pair(.74f, .95f), 0.06);
329+ // drawTexturedRectangle(make_pair(2.f, 8.f), 96.f, make_pair(.6f, .95f), 0.06);
330+ // drawTexturedRectangle(make_pair(2.f, 8.f), 96.f, make_pair(.6f, .95f), 0.06);
331+ // drawTexturedRectangle(make_pair(2.f, 8.f), 96.f, make_pair(.6f, .95f), 0.06);
323332
333+ glBindTexture (GL_TEXTURE_2D, 0 );
324334 // hardcoded 2 die for testing
325335 // drawTexturedRectangle(make_pair(4.f, 8.f), 96.f, make_pair(.7f, .9f), 0.03);
326336
@@ -396,10 +406,7 @@ void DrawingGameVisitor::visit(ResourceTile& tile) {
396406 glBindTexture (GL_TEXTURE_2D, 0 );
397407
398408
399- static const GLuint diceTextures = loadImageAsTexture (" resources/catan_dice_new.bmp" );
400- glBindTexture (GL_TEXTURE_2D, diceTextures);
401- drawTexturedRectangle (make_pair (4 .f , 8 .f ), 96 .f , make_pair (.7f , .9f ), 0.03 );
402- glBindTexture (GL_TEXTURE_2D, 0 );
409+
403410
404411
405412}
0 commit comments