[Frontierproject-cvs] frontierproject/src widget_painter.cpp, 1.21, 1.22
Status: Pre-Alpha
Brought to you by:
bdragon28
|
From: Brandon B. <bdr...@us...> - 2006-05-31 22:31:34
|
Update of /cvsroot/frontierproject/frontierproject/src In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv7115/src Modified Files: widget_painter.cpp Log Message: Move some stuff around in Painter. TRYING to make it a bit easier to understand... Index: widget_painter.cpp =================================================================== RCS file: /cvsroot/frontierproject/frontierproject/src/widget_painter.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** widget_painter.cpp 18 May 2006 07:44:50 -0000 1.21 --- widget_painter.cpp 31 May 2006 22:31:30 -0000 1.22 *************** *** 127,134 **** largestFont -> create(); ! uMinX = TheGalaxy->MinX(); ! uMinY = TheGalaxy->MinY(); ! uMaxX = TheGalaxy->MaxX(); ! uMaxY = TheGalaxy->MaxY(); d_drawFlags = static_cast<FXbool*>(autoTarget::tieBool("/painter/show/planetnames",true)->getData()); --- 127,134 ---- largestFont -> create(); ! uMinX = static_cast<FXshort>(TheGalaxy->MinX()); ! uMinY = static_cast<FXshort>(TheGalaxy->MinY()); ! uMaxX = static_cast<FXshort>(TheGalaxy->MaxX()); ! uMaxY = static_cast<FXshort>(TheGalaxy->MaxY()); d_drawFlags = static_cast<FXbool*>(autoTarget::tieBool("/painter/show/planetnames",true)->getData()); *************** *** 164,168 **** FreeStars::Planet *curPlanet; int i; ! FXlong X,Y,W,H; dc.setForeground(FXRGB(96,0,0)); //Darkish red --- 164,169 ---- FreeStars::Planet *curPlanet; int i; ! FXshort pX,pY; ! FXshort X,Y,W,H; dc.setForeground(FXRGB(96,0,0)); //Darkish red *************** *** 173,180 **** if(curPlanet->GetOwner() == TheGame->GetCurrentPlayer()) { ! X = (u2sx(curPlanet->GetPosX())-u2sl(curPlanet->GetScanSpace()/2)); ! Y = (u2sy(curPlanet->GetPosY())-u2sl(curPlanet->GetScanSpace()/2)); W = u2sl(curPlanet->GetScanSpace()); ! dc.fillArc(X,Y,W,W,64*0,64*360); } } --- 174,184 ---- if(curPlanet->GetOwner() == TheGame->GetCurrentPlayer()) { ! pX = u2sx(curPlanet->GetPosX()); ! pY = u2sy(curPlanet->GetPosY()); ! X = (pX-u2sl(curPlanet->GetScanSpace()/2)); ! Y = (pY-u2sl(curPlanet->GetScanSpace()/2)); W = u2sl(curPlanet->GetScanSpace()); ! H = u2sl(curPlanet->GetScanSpace()); ! dc.fillArc(X,Y,W,H,64*0,64*360); } } *************** *** 190,197 **** ! X = (u2sx(curPlanet->GetPosX())-u2sl(curPlanet->GetScanPenetrating()/2)); ! Y = (u2sy(curPlanet->GetPosY())-u2sl(curPlanet->GetScanPenetrating()/2)); W = u2sl(curPlanet->GetScanPenetrating()); ! dc.fillArc(X,Y,W,W,64*0,64*360); } } --- 194,202 ---- ! X = (pX-u2sl(curPlanet->GetScanPenetrating()/2)); ! Y = (pY-u2sl(curPlanet->GetScanPenetrating()/2)); W = u2sl(curPlanet->GetScanPenetrating()); ! H = u2sl(curPlanet->GetScanPenetrating()); ! dc.fillArc(X,Y,W,H,64*0,64*360); } } *************** *** 280,284 **** Fleet *f; ! long X1, Y1, X2, Y2; int i=0; int j=0; --- 285,289 ---- Fleet *f; ! // long X1, Y1, X2, Y2; int i=0; int j=0; *************** *** 488,493 **** { using FreeStars::Planet; ! int foo; ! FXint X, Y, W, H; dc.setForeground(FXRGB(0,255,0)); --- 493,500 ---- { using FreeStars::Planet; ! // int foo; ! ! FXshort pX, pY; ! FXshort X, Y, W, H; dc.setForeground(FXRGB(0,255,0)); *************** *** 500,507 **** if (curPlanet) { ! X = (u2sx(curPlanet->GetPosX())-(getPlanetWidth(curPlanet))/2); ! Y = (u2sy(curPlanet->GetPosY())-(getPlanetWidth(curPlanet))/2); W = getPlanetWidth(curPlanet); ! H = getPlanetWidth(curPlanet); dc.fillArc(X,Y,W,H,64*0,64*360); --- 507,521 ---- if (curPlanet) { ! ! pX = u2sx(curPlanet->GetPosX()); ! pY = u2sy(curPlanet->GetPosY()); W = getPlanetWidth(curPlanet); ! H = getPlanetWidth(curPlanet); //@@@? ! ! X = pX - (W/2); ! Y = pY - (H/2); ! ! // X = (u2sx(curPlanet->GetPosX())-(getPlanetWidth(curPlanet))/2); ! // Y = (u2sy(curPlanet->GetPosY())-(getPlanetWidth(curPlanet))/2); dc.fillArc(X,Y,W,H,64*0,64*360); *************** *** 511,524 **** { //user wants planet text. ! dc.setForeground (FXRGB (0, 0, 0)); ! dc.drawText (u2sx(curPlanet->GetPosX())+10, ! u2sy(curPlanet->GetPosY())+ 10, //en.world.planets[foo].name->text(), //en.world.planets[foo].name->length()); curPlanet->GetName().c_str(), curPlanet->GetName().length()); ! dc.setForeground (FXRGB (255, 255, 255)); ! dc.drawText (u2sx(curPlanet->GetPosX())+ 11, ! u2sy(curPlanet->GetPosY())+ 11, //en.world.planets[foo].name->text(), //en.world.planets[foo].name->length()); --- 525,538 ---- { //user wants planet text. ! dc.setForeground(FXRGB(0,0,0)); ! dc.drawText(pX+10, ! pY+ 10, //en.world.planets[foo].name->text(), //en.world.planets[foo].name->length()); curPlanet->GetName().c_str(), curPlanet->GetName().length()); ! dc.setForeground(FXRGB(255,255,255)); ! dc.drawText(pX+ 11, ! pY+ 11, //en.world.planets[foo].name->text(), //en.world.planets[foo].name->length()); *************** *** 536,540 **** // In theory, it works. using FreeStars::Planet; ! FXlong X,Y; Planet *curPlanet; int i; --- 550,554 ---- // In theory, it works. using FreeStars::Planet; ! FXshort X,Y; Planet *curPlanet; int i; *************** *** 641,646 **** } ! cursorx = co->GetPosX(); //@@@ Behavior is NOT like this. ! cursory = co->GetPosY(); hasselection = true; --- 655,660 ---- } ! cursorx = static_cast<FXshort>(co->GetPosX()); //@@@ Behavior is NOT like this. ! cursory = static_cast<FXshort>(co->GetPosY()); hasselection = true; *************** *** 657,662 **** event = ev; ! FXlong x1 = s2ux(ev->win_x); ! FXlong y1 = s2uy(ev->win_y); --- 671,676 ---- event = ev; ! FXshort x1 = s2ux(ev->win_x); ! FXshort y1 = s2uy(ev->win_y); *************** *** 669,673 **** //End Debug ! int i; FXMenuCommand *mc = 0; --- 683,687 ---- //End Debug ! // int i; FXMenuCommand *mc = 0; *************** *** 722,727 **** FXPoint foo[3]; ! long x = u2sx(cursorx); ! long y = u2sy(cursory); foo[0].x = (int) x; --- 736,741 ---- FXPoint foo[3]; ! FXshort x = u2sx(cursorx); ! FXshort y = u2sy(cursory); foo[0].x = (int) x; *************** *** 774,779 **** event = ev; ! FXlong x1 = s2ux(ev->win_x); ! FXlong y1 = s2uy(ev->win_y); deque<SpaceObject *> *d; --- 788,793 ---- event = ev; ! FXshort x1 = s2ux(ev->win_x); ! FXshort y1 = s2uy(ev->win_y); deque<SpaceObject *> *d; *************** *** 819,824 **** } ///// End shifted click handling ///// ! cursorx = d->at(0)->GetPosX(); //@@@ Behavior is NOT like this. ! cursory = d->at(0)->GetPosY(); hasselection = true; --- 833,838 ---- } ///// End shifted click handling ///// ! cursorx = static_cast<FXshort>(d->at(0)->GetPosX()); //@@@ Behavior is NOT like this. ! cursory = static_cast<FXshort>(d->at(0)->GetPosY()); hasselection = true; *************** *** 929,936 **** { case -120: ! setZoom(zoom*0.8); break; case 120: ! setZoom(zoom*1.2); break; }; --- 943,950 ---- { case -120: ! setZoom(zoom*0.8f); break; case 120: ! setZoom(zoom*1.2f); break; }; *************** *** 945,952 **** { case ID_ZOOMIN: ! setZoom(zoom*1.5); break; case ID_ZOOMOUT: ! setZoom(zoom*0.5); break; case ID_TOGGLE_SHOWPLANETNAMES: --- 959,966 ---- { case ID_ZOOMIN: ! setZoom(zoom*1.5f); break; case ID_ZOOMOUT: ! setZoom(zoom*0.5f); break; case ID_TOGGLE_SHOWPLANETNAMES: *************** *** 981,988 **** */ ! FXlong w_Painter::u2sx(FXlong x) ! { ! return FXlong(zoom*(x-uMinX) + getXPosition()); ! } FXlong w_Painter::u2sy(FXlong y) --- 995,1003 ---- */ ! /* ! FXshort w_Painter::u2sx(FXshort x) ! { ! return FXlong(zoom*(x-uMinX) + getXPosition()); ! } FXlong w_Painter::u2sy(FXlong y) *************** *** 1005,1006 **** --- 1020,1022 ---- return FXlong(w*zoom); } + */ \ No newline at end of file |