void ConfigureButtonsFrame::drawChildren(menu::Graphics &gfx) { if(isVisible()) { int base_x = 204; int base_y = 188; int lines[NUM_LINES][4] = {{164, 265, 221, 244}, //D-pad (17,56) {476, 265, 419, 244}, //Tri,Squ,Cir,Cro btns (215,56) {275, 160, 302, 240}, //SELECT (98,52) {365, 160, 338, 242}, //START (134,54) {220, 170, 242, 192}, //L1 (38,4) {420, 170, 398, 192}, //R1 (194,4) {220, 200, 232, 204}, //L2 (28,16) {420, 200, 408, 204}, //R2 (204,16) {260, 345, 278, 294}, //AnalogL (74,106) {380, 345, 362, 294}};//AnalogR (158,106) GXColor controllerColors[6] = { { 1, 29, 169, 255}, //blue {254, 32, 21, 255}, //orange/red { 8, 147, 48, 255}, //green {255, 192, 1, 255}, //yellow/gold {150, 150, 255, 255}, //light blue lines {255, 255, 255, 255}};//white //Draw PSX Controller menu::Image* controllerIcon = NULL; // gfx.setColor(controllerColors[activePad]); gfx.setColor(controllerColors[5]); controllerIcon = menu::Resources::getInstance().getImage(menu::Resources::IMAGE_PSX_CONTROLLER); controllerIcon->activateImage(GX_TEXMAP0); // GX_SetTevColorIn(GX_TEVSTAGE0,GX_CC_ZERO,GX_CC_ZERO,GX_CC_ZERO,GX_CC_RASC); GX_SetTevColorIn(GX_TEVSTAGE0,GX_CC_ZERO,GX_CC_TEXC,GX_CC_RASC,GX_CC_ZERO); GX_SetTevColorOp(GX_TEVSTAGE0,GX_TEV_ADD,GX_TB_ZERO,GX_CS_SCALE_1,GX_TRUE,GX_TEVPREV); GX_SetTevAlphaIn(GX_TEVSTAGE0,GX_CA_ZERO,GX_CA_RASA,GX_CA_TEXA,GX_CA_ZERO); GX_SetTevAlphaOp(GX_TEVSTAGE0,GX_TEV_ADD,GX_TB_ZERO,GX_CS_SCALE_1,GX_TRUE,GX_TEVPREV); gfx.enableBlending(true); gfx.drawImage(0, base_x, base_y, 232, 152, 0, 1, 0, 1); gfx.setTEV(GX_PASSCLR); //Draw lines and circles gfx.setColor(controllerColors[5]); gfx.setLineWidth(1); gfx.drawCircle(115, 300, 60, 33); gfx.drawCircle(525, 300, 60, 33); for (int i=0; i<NUM_LINES; i++) gfx.drawLine(lines[i][0], lines[i][1], lines[i][2], lines[i][3]); //Draw buttons menu::ComponentList::const_iterator iteration; for (iteration = componentList.begin(); iteration != componentList.end(); iteration++) { (*iteration)->draw(gfx); } } }
void ConfigureButtonsFrame::drawChildren(menu::Graphics &gfx) { if(isVisible()) { int base_x = 216; int base_y = 182; int lines[NUM_LINES][4] = {{320, 160, 320, 237}, //START {174, 235, 240, 235}, //D-pad {466, 235, 404, 235}, //C-pad {264, 197, 220, 170}, //L {376, 197, 420, 170}, //R {295, 313, 250, 365}, //Z {320, 299, 320, 415}, //Analog {320, 415, 125, 415}, //Invert Y {373, 268, 373, 325}, //B {373, 325, 435, 405}};//A GXColor controllerColors[5] = { { 1, 29, 169, 255}, //blue {254, 32, 21, 255}, //orange/red { 8, 147, 48, 255}, //green {255, 192, 1, 255}, //yellow/gold {150, 150, 255, 255}}; //Draw N64 Controller menu::Image* controllerIcon = NULL; gfx.setColor(controllerColors[activePad]); controllerIcon = menu::Resources::getInstance().getImage(menu::Resources::IMAGE_N64_CONTROLLER); controllerIcon->activateImage(GX_TEXMAP0); GX_SetTevColorIn(GX_TEVSTAGE0,GX_CC_ZERO,GX_CC_ZERO,GX_CC_ZERO,GX_CC_RASC); GX_SetTevColorOp(GX_TEVSTAGE0,GX_TEV_ADD,GX_TB_ZERO,GX_CS_SCALE_1,GX_TRUE,GX_TEVPREV); GX_SetTevAlphaIn(GX_TEVSTAGE0,GX_CA_ZERO,GX_CA_RASA,GX_CA_TEXA,GX_CA_ZERO); GX_SetTevAlphaOp(GX_TEVSTAGE0,GX_TEV_ADD,GX_TB_ZERO,GX_CS_SCALE_1,GX_TRUE,GX_TEVPREV); gfx.enableBlending(true); gfx.drawImage(0, base_x, base_y, 208, 200, 0, 1, 0, 1); gfx.setTEV(GX_PASSCLR); //Draw lines and circles gfx.setColor(controllerColors[4]); gfx.setLineWidth(2); gfx.drawCircle(125, 270, 60, 33); gfx.drawCircle(515, 270, 60, 33); for (int i=0; i<NUM_LINES; i++) gfx.drawLine(lines[i][0], lines[i][1], lines[i][2], lines[i][3]); //Draw buttons menu::ComponentList::const_iterator iteration; for (iteration = componentList.begin(); iteration != componentList.end(); ++iteration) { (*iteration)->draw(gfx); } } }