void GuiEditSign::drawScreen(int i, int j, float f) { func_578_i(); drawCenteredString(field_6451_g, screenTitle_02, width / 2, 40, 0xffffff); GL11.glPushMatrix(); GL11.glTranslatef(width / 2, height / 2, 50); float f1 = 93.75; GL11.glScalef(-f1, -f1, -f1); GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); Block block = entitySign.getBlockType(); if(block == Block.pressurePlateWoodActive) { float f2 = (float)(entitySign.getBlockMetadata_00() * 360) / 16; GL11.glRotatef(f2, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(0.0F, 0.3125, 0.0F); } else { int k = entitySign.getBlockMetadata_00(); float f3 = 0.0F; if(k == 2) { f3 = 180; } if(k == 4) { f3 = 90; } if(k == 5) { f3 = -90; } GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(0.0F, 0.3125, 0.0F); } if((field_4189_i / 6) % 2 == 0) { entitySign.lineBeingEdited = editLine; } TileEntityRenderer.field_1554_a.func_1032_a(entitySign, -0.5, -0.75, -0.5, 0.0F); entitySign.lineBeingEdited = -1; GL11.glPopMatrix(); super.drawScreen(i, j, f); }
static inline void render1(void) { scanKeys(); // cpuEndSlice(); playerControls(NULL); updateControls(); // iprintf("controls : %d \n",cpuEndSlice()); updatePlayer(NULL); // iprintf("player : %d \n",cpuEndSlice()); updatePortals(); updateTurrets(); updateBigButtons(); updateTimedButtons(); updateEnergyDevices(); updateEnergyBalls(); updatePlatforms(); updateCubeDispensers(); updateEmancipators(); updateEmancipationGrids(); updateDoors(); updateWallDoors(); // iprintf("updates : %d \n",cpuEndSlice()); // if(currentPortal)GFX_CLEAR_COLOR=currentPortal->color|(31<<16); // else GFX_CLEAR_COLOR=0; u16 color=getCurrentPortalColor(getPlayer()->object->position); // NOGBA("col %d",color); // GFX_CLEAR_COLOR=color|(31<<16); GFX_CLEAR_COLOR=RGB15(0,0,0)|(31<<16); #ifdef DEBUG_GAME if(fifoCheckValue32(FIFO_USER_08))iprintf("\x1b[0J"); while(fifoCheckValue32(FIFO_USER_08)){int32 cnt=fifoGetValue32(FIFO_USER_08);iprintf("ALERT %d \n",cnt);NOGBA("ALERT %d \n",cnt);} #else while(fifoCheckValue32(FIFO_USER_08)){int32 cnt=fifoGetValue32(FIFO_USER_08);NOGBA("ALERT %d \n",cnt);} #endif projectCamera(NULL); glPushMatrix(); glScalef32(SCALEFACT,SCALEFACT,SCALEFACT); renderGun(NULL); transformCamera(NULL); cpuEndSlice(); // drawRoomsGame(128, color); drawRoomsGame(0, color); // drawCell(getCurrentCell(getPlayer()->currentRoom,getPlayerCamera()->position)); // iprintf("room : %d \n",cpuEndSlice()); updateParticles(); drawParticles(); // iprintf("particles : %d \n",cpuEndSlice()); drawOBBs(); // iprintf("OBBs : %d \n",cpuEndSlice()); drawBigButtons(); drawTimedButtons(); drawEnergyDevices(); drawEnergyBalls(); drawPlatforms(); drawCubeDispensers(); drawTurretsStuff(); drawEmancipators(); drawEmancipationGrids(); drawDoors(); drawWallDoors(NULL); drawSludge(&gameRoom); // iprintf("stuff : %d \n",cpuEndSlice()); drawPortal(&portal1); drawPortal(&portal2); glPopMatrix(1); //HUD TEST if(levelInfoCounter>0 && (levelTitle || levelAuthor)) { levelInfoCounter--; glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); glOrthof32(inttof32(0), inttof32(255), inttof32(191), inttof32(0), -inttof32(1), inttof32(1)); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); if(levelTitle)drawCenteredString(levelTitle, inttof32(17)/10, (82)); if(levelAuthor)drawCenteredString(levelAuthor, inttof32(1), (100)); glPopMatrix(1); glMatrixMode(GL_PROJECTION); glPopMatrix(1); } glFlush(0); }
void QueryServersUserInterface::render() { if(shouldSort) { shouldSort = false; sort(); } glColor3f(1,1,1); drawCenteredString(vertMargin, 25, "CHOOSE A SERVER TO JOIN:"); drawCenteredString(canvasHeight - vertMargin - 40, 18, "UP, DOWN, PAGEUP, PAGEDOWN to select, ENTER to join."); drawCenteredString(canvasHeight - vertMargin - 20, 18, "LEFT, RIGHT select sort column, SPACE to sort. ESC exits."); U32 top = vertMargin + 45; U32 bottom = canvasHeight - vertMargin - 60; for(S32 i = 0; i < columns.size(); i++) { drawString(columns[i].xStart, top, 24, columns[i].name); } S32 x1 = columns[sortColumn].xStart - 2; S32 x2; if(sortColumn == columns.size() - 1) x2 = 799; else x2 = columns[sortColumn+1].xStart - 6; glBegin(GL_LINE_LOOP); glVertex2f(x1, top - 2); glVertex2f(x2, top - 2); glVertex2f(x2, top + 26); glVertex2f(x1, top + 26); glEnd(); top += 30; U32 totalRows = (bottom - top) / 24; if(!(totalRows & 1)) totalRows--; bottom = top + totalRows * 24; U32 serversAboveBelow = totalRows >> 1; if(servers.size()) { S32 selectedIndex = findSelectedIndex(); if(selectedIndex == -1) selectedIndex = 0; S32 firstServer = selectedIndex - serversAboveBelow; S32 lastServer = selectedIndex + serversAboveBelow; if(firstServer < 0) { lastServer -= firstServer; firstServer = 0; } if(lastServer >= servers.size()) { lastServer = servers.size() - 1; } for(S32 i = firstServer; i <= lastServer; i++) { U32 y = top + (i - firstServer) * 24; U32 fontSize = 21; ServerRef &s = servers[i]; if(i == selectedIndex) { glColor3f(0,0,0.4); glBegin(GL_POLYGON); glVertex2f(0, y); glVertex2f(799, y); glVertex2f(799, y + 23); glVertex2f(0, y + 23); glEnd(); glColor3f(0,0,1.0); glBegin(GL_LINE_LOOP); glVertex2f(0, y); glVertex2f(799, y); glVertex2f(799, y + 23); glVertex2f(0, y + 23); glEnd(); } glColor3f(1,1,1); drawString(columns[0].xStart, y, fontSize, s.serverName); glColor3f(0,1,0); if(s.dedicated) { glPushMatrix(); glTranslatef(columns[1].xStart+5, y+2, 0); glScalef(5, 5, 1); renderDedicatedIcon(); glPopMatrix(); } if(s.passwordRequired) { glPushMatrix(); glTranslatef(columns[1].xStart + 25, y+2, 0); glScalef(5, 5, 1); renderLockIcon(); glPopMatrix(); } if(s.pingTime < 100) glColor3f(0,1,0); else if(s.pingTime < 250) glColor3f(1,1,0); else glColor3f(1,0,0); drawStringf(columns[2].xStart, y, fontSize, "%d", s.pingTime); if(s.playerCount == s.maxPlayers) glColor3f(1,0,0); else if(s.playerCount == 0) glColor3f(1,1,0); else glColor3f(0,1,0); if(s.playerCount < 0) drawString(columns[3].xStart, y, fontSize, "?? / ??"); else drawStringf(columns[3].xStart, y, fontSize, "%d / %d", s.playerCount, s.maxPlayers); glColor3f(1,1,1); drawString(columns[4].xStart, y, fontSize, s.serverAddress.toString()); } } glColor3f(0.7, 0.7, 0.7); for(S32 i = 1; i < columns.size(); i++) { glBegin(GL_LINES); glVertex2f(columns[i].xStart - 4, top - 30); glVertex2f(columns[i].xStart - 4, bottom); glEnd(); } glBegin(GL_LINES); glVertex2f(0, top - 3); glVertex2f(800, top - 3); glEnd(); }
void MenuUserInterface::render() { if(gClientGame->getConnectionToServer()) { gGameUserInterface.render(); glColor4f(0, 0, 0, 0.6); glEnable(GL_BLEND); glBegin(GL_POLYGON); glVertex2f(0, 0); glVertex2f(canvasWidth, 0); glVertex2f(canvasWidth, canvasHeight); glVertex2f(0, canvasHeight); glEnd(); glDisable(GL_BLEND); } glColor3f(1,1,1); drawCenteredString( vertMargin, 30, menuTitle); drawCenteredString( vertMargin + 35, 18, menuSubTitle); drawCenteredString( canvasHeight - vertMargin - 20, 18, menuFooter); if(selectionIndex >= menuItems.size()) selectionIndex = 0; S32 offset = 0; S32 count = menuItems.size(); if(count > 7) { count = 7; offset = selectionIndex - 3; if(offset < 0) offset = 0; else if(offset + count >= menuItems.size()) offset = menuItems.size() - count; } U32 yStart = (canvasHeight - count * 45) / 2; //glColor3f(0,1,0); for(S32 i = 0; i < count; i++) { U32 y = yStart + i * 45; if(selectionIndex == i + offset) { glColor3f(0,0,0.4); glBegin(GL_POLYGON); glVertex2f(0, y - 2); glVertex2f(800, y - 2); glVertex2f(800, y + 25 + 5); glVertex2f(0, y + 25 + 5); glEnd(); glColor3f(0,0,1); glBegin(GL_LINES); glVertex2f(0, y - 2); glVertex2f(799, y - 2); glVertex2f(799, y + 25 + 5); glVertex2f(0, y + 25 + 5); glEnd(); } glColor3f(1,1,1); drawCenteredString(y, 25, menuItems[i+offset].mText); } }