Some cleanup
authorkazer_ <kazer_@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Fri, 16 Nov 2007 15:04:07 +0000 (15:04 +0000)
committerkazer_ <kazer_@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Fri, 16 Nov 2007 15:04:07 +0000 (15:04 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@562 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/src/gui/sdl/gui_sdl_window.cpp
navit/src/gui/sdl/sdl_events.cpp

index 38ec7f1..b6ae880 100644 (file)
@@ -60,9 +60,6 @@ GLuint * DLid;
 
 #define _(STRING)    gettext(STRING)
 
-
-// struct navit *sdl_gui_navit;
-
 static int
 gui_sdl_set_graphics(struct gui_priv *this_, struct graphics *gra)
 {
@@ -88,7 +85,6 @@ void drawCursor() {
                         glVertex3f( x+cursor_size,y+cursor_size, 0.0f);
                 glEnd();
                 glDisable(GL_BLEND);
-
  }
 
 
@@ -132,8 +128,6 @@ sdl_update_roadbook(struct navigation *nav)
 
                list=navigation_list_new(nav);  
                while ((item=navigation_list_get_item(list))) {
-                               
-//                     printf("SDL : %s\n", str);
                        mcl->addRow();
                        item_attr_get(item, attr_navigation_short, &attr);
                        ListboxTextItem* itemListbox = new ListboxTextItem(attr.u.str);
@@ -144,8 +138,8 @@ sdl_update_roadbook(struct navigation *nav)
        }
        catch (CEGUI::Exception& e)
        {
-               fprintf(stderr,"CEGUI Exception occured: \n%s\n", e.getMessage().c_str());
-               printf("Missing control!...\n");
+               dbg(0,"CEGUI Exception occured: \n%s\n", e.getMessage().c_str());
+               dbg(0,"Missing control!\n");
        }
 
 }
@@ -170,21 +164,7 @@ static int gui_run_main_loop(struct gui_priv *this_)
        t=navit_get_trans(this_->nav);
        transform_set_size(t, 800, 600);        
        navit_draw(this_->nav);
-/*
-        glNewList(DLid,GL_COMPILE);
-                int x=400;
-                int y=400;
-                float cursor_size=15.0f;
-                glColor4f(1.0f,0.0f,0.0f,0.75f);
-                glEnable(GL_BLEND);
-                glBegin(GL_TRIANGLES);
-                        glVertex3f( x, y-cursor_size, 0.0f);
-                        glVertex3f(x-cursor_size,y+cursor_size, 0.0f);
-                        glVertex3f( x+cursor_size,y+cursor_size, 0.0f);
-                glEnd();
-                glDisable(GL_BLEND);
-        glEndList();
-*/
+
        GLuint cursorDL;
        cursorDL=glGenLists(1);
        glNewList(cursorDL,GL_COMPILE);
@@ -214,9 +194,9 @@ static int gui_run_main_loop(struct gui_priv *this_)
                if(VIEW_MODE==VM_3D){
                        gluLookAt(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ);
                }
-               
 
-               // FIXME This is to draw a ground. This is ugly and need to be fixed. Without it, we see the color of sky under the roads.
+               // FIXME This is to draw a ground. This is ugly and need to be fixed.
+               // Without it, we see the color of sky under the roads.
                glColor4f(0.0f,0.7f,0.35f,1.0f);
                glBegin(GL_POLYGON);
                        glVertex3f( -800,-600*3, 0.0f);
@@ -230,7 +210,8 @@ static int gui_run_main_loop(struct gui_priv *this_)
                        profile(0,"graphics_redraw");
                if (!g_main_context_iteration (NULL, FALSE))
                        sleep(1);
-//             profile_timer("main context");
+               if(enable_timer)
+                       profile(0,"main context");
 
        //      graphics_get_data(this_->gra,DLid);
                
@@ -267,14 +248,6 @@ static int gui_run_main_loop(struct gui_priv *this_)
                }
                WindowManager::getSingleton().getWindow("OSD/Satellites")->setText(fps);
 
-               /*
-               glcRenderStyle(GLC_TEXTURE);
-               glColor3f(1, 0, 0);
-               glRotatef(180,1,0,0);
-               glScalef(64, 64, 0);
-               glcRenderString(fps);
-               */
-
                if(enable_timer)
                        profile(0,"fps");
 
@@ -326,7 +299,6 @@ struct gui_methods gui_sdl_methods = {
 int init_GL() {
 
        dbg(1,"init_GL()\n");
-//     glClearColor(1.0,0.9,0.7,0);
 
        // Blue sky
        glClearColor(0.3,0.7,1.0,0);
@@ -534,8 +506,6 @@ static void init_sdlgui(char * skin_layout,int fullscreen)
 
        init_GL();
        
-//     sdl_audio_init();
-
        try
        {
                renderer = new CEGUI::OpenGLRenderer(0,XRES,YRES);
index 4ba6cfd..389625d 100644 (file)
@@ -74,7 +74,6 @@ bool handleItemSelect(int r)
 
        if(SDL_dest.current_search==SRCH_COUNTRY){
                country_edit->setText(item->getText());
-               // FIXME Need to record the country here so all searches are made by default in this country
                twn_edit->activate();
                SDL_dest.current_search=SRCH_TOWN;
                myRoot->getChild("Navit/Keyboard")->getChild("Navit/Keyboard/Input")->setText("");
@@ -118,53 +117,6 @@ bool handleItemSelect(int r)
                myRoot->getChild("Navit/Keyboard")->getChild("Navit/Keyboard/Input")->setText("");
 
 
-               /*
-               ListboxItem * itemid = mcl->getItemAtGridReference(MCLGridRef(r,1));
-               int segment_id=atoi(itemid->getText().c_str());
-               printf("street seg id : %li\n",segment_id);
-
-               extern struct container *co;
-               struct block_info res_blk_inf;
-               struct street_str *res_str;
-               street_get_by_id(co->map_data, 33, segment_id,&res_blk_inf,&res_str );
-
-               struct street_coord * streetcoord;
-               streetcoord=street_coord_get(&res_blk_inf,res_str);
-
-               printf("Street coordinates : %i,%i\n",streetcoord->c->x,streetcoord->c->y);
-
-               char xbuff [256];
-               sprintf(xbuff,"%li",streetcoord->c->x);
-               char ybuff [256];
-               sprintf(ybuff,"%li",streetcoord->c->y);
-
-               Window* Dest_x = static_cast<Window*>(myRoot->getChild("DestinationWindow")->getChild("DestinationWindow/Dest_x"));
-               Dest_x->setText(xbuff);
-
-               Window* Dest_y = static_cast<Window*>(myRoot->getChild("DestinationWindow")->getChild("DestinationWindow/Dest_y"));
-               Dest_y->setText(ybuff);
-
-               struct street_name name;
-//             printf("street_name_get_by_id returns : %i\n",street_name_get_by_id(&name, res_blk_inf.mdata, res_str->nameid));
-               street_name_get_by_id(&name, res_blk_inf.mdata, res_str->nameid);
-//             printf("name1:%s / name2%s\n",name.name1,name.name2);
-
-               struct street_name_number_info num;
-               struct street_name_info inf;
-
-               SDL_dest.current_search=SRCH_NUMBER;
-               mcl->resetList();
-
-               while (street_name_get_info(&inf, &name)) {
-                       while(street_name_get_number_info(&num,&inf)){
-//                             printf(" House Number : %i -> %i\n",num.first,num.last);
-                               for(int i=num.first;i<=num.last;i+=2){
-                                       add_number_to_list(i,num.c->x,num.c->y);
-                               }
-                       }
-               }
-               */
-//             route_to(streetcoord->c->x,streetcoord->c->y);
        } else if (SDL_dest.current_search==SRCH_NUMBER){
 
                struct coord pos;
@@ -313,7 +265,6 @@ void handle_destination_change(){
                                sprintf(y,"%li",res->c->y);
                        
                                ListboxTextItem* yitem = new ListboxTextItem(y);
-//                             item->setSelectionBrushImage(&ImagesetManager::getSingleton().getImageset("TaharezLook")->getImage("MultiListSelectionBrush"));
                        
                                try
                                {
@@ -360,7 +311,6 @@ void handle_destination_change(){
                                sprintf(y,"%li",res->c->y);
                        
                                ListboxTextItem* yitem = new ListboxTextItem(y);
-//                             item->setSelectionBrushImage(&ImagesetManager::getSingleton().getImageset("TaharezLook")->getImage("MultiListSelectionBrush"));
                        
                                try
                                {
@@ -398,7 +348,7 @@ bool DialogWindowSwitch(const CEGUI::EventArgs& event)
 
        if(sdl_gui_navit){      
        } else {
-               printf("*** Invalid navit instance in sdl_events\n");
+               dbg(0,"*** Invalid navit instance in sdl_events\n");
        }
 
 
@@ -528,13 +478,6 @@ bool ZoomIn(const CEGUI::EventArgs& event)
 {
        extern struct navit *sdl_gui_navit;
        navit_zoom_in(sdl_gui_navit, 2);
-       /*
-       extern struct container *co;
-       struct transformation *t=co->trans;
-       if(t->scale>1){
-               t->scale/=2;
-       }
-       */
 
 }
 
@@ -542,11 +485,6 @@ bool ZoomOut(const CEGUI::EventArgs& event)
 {
        extern struct navit *sdl_gui_navit;
        navit_zoom_out(sdl_gui_navit, 2);
-       /*
-       extern struct container *co;
-       struct transformation *t=co->trans;
-       t->scale*=2;
-       */
 }
 
 bool ButtonQuit(const CEGUI::EventArgs& event)