#define _(STRING) gettext(STRING)
-
-// struct navit *sdl_gui_navit;
-
static int
gui_sdl_set_graphics(struct gui_priv *this_, struct graphics *gra)
{
glVertex3f( x+cursor_size,y+cursor_size, 0.0f);
glEnd();
glDisable(GL_BLEND);
-
}
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);
}
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");
}
}
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);
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);
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);
}
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");
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);
init_GL();
-// sdl_audio_init();
-
try
{
renderer = new CEGUI::OpenGLRenderer(0,XRES,YRES);
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("");
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;
sprintf(y,"%li",res->c->y);
ListboxTextItem* yitem = new ListboxTextItem(y);
-// item->setSelectionBrushImage(&ImagesetManager::getSingleton().getImageset("TaharezLook")->getImage("MultiListSelectionBrush"));
try
{
sprintf(y,"%li",res->c->y);
ListboxTextItem* yitem = new ListboxTextItem(y);
-// item->setSelectionBrushImage(&ImagesetManager::getSingleton().getImageset("TaharezLook")->getImage("MultiListSelectionBrush"));
try
{
if(sdl_gui_navit){
} else {
- printf("*** Invalid navit instance in sdl_events\n");
+ dbg(0,"*** Invalid navit instance in sdl_events\n");
}
{
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;
- }
- */
}
{
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)