void RenderPolygons() { for (fdword i = 0; i < polyPrimitiveCount; i++) { switch(polyPrimitives[i].m_type) { case PolyPrimitive::POLY_LINE: RenderLine(polyPrimitives[i]); break; case PolyPrimitive::POLY_VECTOR: RenderVector(polyPrimitives[i]); break; case PolyPrimitive::POLY_RECTANGLE: RenderRectangle(polyPrimitives[i]); break; case PolyPrimitive::POLY_CIRCLE: RenderCircle(polyPrimitives[i]); break; case PolyPrimitive::POLY_FILLED_RECTANGLE: RenderFilledRectangle(polyPrimitives[i]); break; case PolyPrimitive::POLY_FILLED_CIRCLE: RenderFilledCircle(polyPrimitives[i]); break; } } polyPrimitiveCount = 0; }
void cLevelLayerGridData::DebugRender(float e_fRandomColor) { int l_iWidth = GetWidth(); int l_iHeight = GetHeight(); Vector3 l_vPos = m_pImage->GetPos(); RenderRectangle(Vector2(l_vPos.x,l_vPos.y),(float)l_iWidth,(float)l_iHeight,Vector4::One*e_fRandomColor+Vector4(0.5,0,0,0),0); }
void RenderMenuScreen() { unsigned char color; for (int i = 0; i < 3; i++) { if (i == highlight) { color = 255; } else { color = 0; } RenderRectangle(MENUBUTTONOFFSET, MENUBUTTONTOP + MENUBUTTONSPACING * i, MENUBUTTONWIDTH, MENUBUTTONHEIGHT, color, color, color); } RenderString("Conway's game of life", 3, 170, 150, 255, 255, 255); RenderString("Use arrow keys to switch modes, enter to start", 1, 240, 260, 255, 255, 255); RenderString("Controls:", 1, 70, TOPCONTROLS - 30, 255, 255, 255); RenderString("Space: Start and stop", 1, 10, TOPCONTROLS, 255, 255, 255); RenderString("C: Clear grid", 1, 10, TOPCONTROLS + CONTROLSPACING, 255, 255, 255); RenderString("G: Toggle grid", 1, 10, TOPCONTROLS + CONTROLSPACING * 2, 255, 255, 255); RenderString("L: Load .cells preset", 1, 10, TOPCONTROLS + CONTROLSPACING * 3, 255, 255, 255); RenderString("R: Randomize", 1, 10, TOPCONTROLS + CONTROLSPACING * 4, 255, 255, 255); RenderString("Esc: Exit to menu screen", 1, 10, TOPCONTROLS + CONTROLSPACING * 5, 255, 255, 255); RenderString("Up/down arrow keys: Change speed", 1, 10, TOPCONTROLS + CONTROLSPACING * 6, 255, 255, 255); RenderString("Left mouse button: Toggle cell life", 1, 10, TOPCONTROLS + CONTROLSPACING * 7, 255, 255, 255); RenderString("Right mouse button: Toggle cell color", 1, 10, TOPCONTROLS + CONTROLSPACING * 8, 255, 255, 255); if (highlight == 0) { color = 0; } else { color = 255; } RenderString("Original", 2, MENUBUTTONOFFSET + 30, MENUBUTTONTOP + 10, color, color, color); if (highlight == 1) { color = 0; } else { color = 255; } RenderString("Immigration", 2, MENUBUTTONOFFSET + 2, MENUBUTTONTOP + MENUBUTTONSPACING + 10, color, color, color); if (highlight == 2) { color = 0; } else { color = 255; } RenderString("Rainbow", 2, MENUBUTTONOFFSET + 40, MENUBUTTONTOP + MENUBUTTONSPACING * 2 + 10, color, color, color); };
INT APU_INTERNAL::Process( INT channel ) { switch( channel ) { case 0: return RenderRectangle( ch0 ); case 1: return RenderRectangle( ch1 ); case 2: return RenderTriangle(); case 3: return RenderNoise(); case 4: return RenderDPCM(); default: return 0; } return 0; }
static INT Process( APU_INTERNAL *pme, INT channel ) { switch( channel ) { case 0: return RenderRectangle( pme, &pme->ch0 ); case 1: return RenderRectangle( pme, &pme->ch1 ); case 2: return RenderTriangle(pme); case 3: return RenderNoise(pme); case 4: return RenderDPCM(pme); default: return 0; } return 0; }
void CTreemap::RenderLeaf(CDC *pdc, Item *item, const double *surface) { CRect rc= item->TmiGetRectangle(); if (m_options.grid) { rc.top++; rc.left++; if (rc.Width() <= 0 || rc.Height() <= 0) return; } RenderRectangle(pdc, rc, surface, item->TmiGetGraphColor()); }
void RenderString(unsigned char *str2, int size, int X, int Y, unsigned int red, unsigned int green, unsigned int blue) { while (*str2 != '\0' && *str2 != 254) { for (int j = 0; j < 15; j++) { for (int k = 0; k < 7; k++) { if (characters[*str2][j][k] == 1) { RenderRectangle(X + k * size, Y + j * size, size, size, red, green, blue); } } } X += size * 9; str2++; } };
void CTreemap::DrawColorPreview(CDC *pdc, const CRect& rc, COLORREF color, const Options *options) { if (options != NULL) SetOptions(options); double surface[4]; for (int i=0; i < 4; i++) surface[i]= 0; AddRidge(rc, surface, m_options.height * m_options.scaleFactor); RenderRectangle(pdc, rc, surface, color); if (m_options.grid) { CPen pen(PS_SOLID, 1, m_options.gridColor); CSelectObject sopen(pdc, &pen); CSelectStockObject sobrush(pdc, NULL_BRUSH); pdc->Rectangle(rc); } }
void RenderLoadScreen() { int yPos = 1; unsigned char color; for (int i = 0; i < MAXFILES; i++) { strcpy(str, fileList[i]); unsigned char *pathPointer = str; if (*pathPointer == NULL) { if (highlight > i - 1) { highlight = i - 1; } break; } pathPointer += strlen(fileList[i]) - 6; *pathPointer = 254; while (*(pathPointer - 1) != '\\') { pathPointer--; } if (highlight == i) { color = 255; } else { color = 0; } RenderRectangle(8, yPos, (strlen(pathPointer) - 6) * 10, 16, color, color, color); switch (color) { case 0: color = 255; break; case 255: color = 0; break; } RenderString(pathPointer, 1, 10, yPos, color, color, color); yPos += 20; if (highlight == i) { FILE *fp; fp = fopen(fileList[highlight], "r"); unsigned char *strStart; unsigned char character; int yPos = 10; while ((character = fgetc(fp)) == '!') { strStart = str; while ((character = fgetc(fp)) != '\n') { *(strStart++) = character; } *strStart = 254; RenderString(str, 1, 200, yPos, 255, 255, 255); yPos += 20; } fclose(fp); } } };