From: <au...@us...> - 2010-01-04 18:06:08
|
Revision: 4392 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4392&view=rev Author: auria Date: 2010-01-04 18:05:56 +0000 (Mon, 04 Jan 2010) Log Message: ----------- Fixed reported bug with musical note placement in in-game music credits Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-01-04 02:53:37 UTC (rev 4391) +++ main/trunk/src/states_screens/race_gui.cpp 2010-01-04 18:05:56 UTC (rev 4392) @@ -680,9 +680,12 @@ { if (!UserConfigParams::m_music) return; // show no music description when it's off + gui::IGUIFont* font = irr_driver->getRaceFont(); + + // ---- Manage pulsing effect // 3.0 is the duration of ready/set (TODO: don't hardcode) float timeProgression = (float)(RaceManager::getWorld()->m_auxiliary_timer - 2.0f) / - (float)(stk_config->m_music_credit_time - 2.0f); + (float)(stk_config->m_music_credit_time - 2.0f); const int x_pulse = (int)(sin(RaceManager::getWorld()->m_auxiliary_timer*9.0f)*10.0f); const int y_pulse = (int)(cos(RaceManager::getWorld()->m_auxiliary_timer*9.0f)*10.0f); @@ -697,52 +700,68 @@ resize = 1.0f - (timeProgression - 0.9f)/0.1f; } + const float resize3 = resize*resize*resize; + // ---- Get song name, and calculate its size, allowing us to position stuff const MusicInformation* mi=sound_manager->getCurrentMusic(); - if(!mi) return; + if (!mi) return; - const float resize3 = resize*resize*resize; + std::string s="\""+mi->getTitle()+"\""; + core::stringw thetext(s.c_str()); - const int y = UserConfigParams::m_height - 80; + core::dimension2d< u32 > textSize = font->getDimension(thetext.c_str()); + int textWidth = textSize.Width; + + int textWidth2 = 0; + core::stringw thetext_composer; + if (mi->getComposer()!="") + { + std::string s = "by "+mi->getComposer(); + thetext_composer = s.c_str(); + textWidth2 = font->getDimension(thetext_composer.c_str()).Width; + } + const int max_text_size = (int)(UserConfigParams::m_width*2.0f/3.0f); + if (textWidth > max_text_size) textWidth = max_text_size; + if (textWidth2 > max_text_size) textWidth2 = max_text_size; + + const int ICON_SIZE = 64; + const int y = UserConfigParams::m_height - 80; + // the 20 is an arbitrary space left between the note icon and the text + const int noteX = (UserConfigParams::m_width / 2) - std::max(textWidth, textWidth2)/2 - ICON_SIZE/2 - 20; + const int noteY = y; + // the 20 is an arbitrary space left between the note icon and the text + const int textXFrom = (UserConfigParams::m_width / 2) - std::max(textWidth, textWidth2)/2 + 20; + const int textXTo = (UserConfigParams::m_width / 2) + std::max(textWidth, textWidth2)/2 + 20; + + // ---- Draw "by" text const int text_y = (int)(UserConfigParams::m_height - 80*(resize3) + 40*(1-resize)); static const video::SColor white = video::SColor(255, 255, 255, 255); - gui::IGUIFont* font = irr_driver->getRaceFont(); if(mi->getComposer()!="") { - core::rect<s32> pos_by((UserConfigParams::m_width>>1) + 32, text_y+40, - (UserConfigParams::m_width>>1) + 32, text_y+40); + core::rect<s32> pos_by(textXFrom, text_y+40, + textXTo, text_y+40); std::string s="by "+mi->getComposer(); font->draw(core::stringw(s.c_str()).c_str(), pos_by, white, true, true); } - - std::string s="\""+mi->getTitle()+"\""; - - // Draw text - core::stringw thetext(s.c_str()); - - core::dimension2d< u32 > textSize = font->getDimension(thetext.c_str()); - const int textWidth = textSize.Width; - core::rect<s32> pos((UserConfigParams::m_width >> 1) + 32, text_y, - (UserConfigParams::m_width >> 1) + 32, text_y); + // ---- Draw "song name" text + core::rect<s32> pos(textXFrom, text_y, + textXTo, text_y); - font->draw(thetext.c_str(), pos, white, true, true); + font->draw(thetext.c_str(), pos, white, true /* hcenter */, true /* vcenter */); + + // Draw music icon + int iconSizeX = (int)(ICON_SIZE*resize + x_pulse*resize*resize); + int iconSizeY = (int)(ICON_SIZE*resize + y_pulse*resize*resize); - - - int iconSizeX = (int)(64*resize + x_pulse*resize*resize); - int iconSizeY = (int)(64*resize + y_pulse*resize*resize); - - // Draw music icon video::ITexture *t = m_music_icon->getTexture(); - const int noteX = (UserConfigParams::m_width >> 1) - textWidth/2 - 32; - const int noteY = y; - core::rect<s32> dest(noteX-iconSizeX/2+20, noteY-iconSizeY/2+32, - noteX+iconSizeX/2+20, noteY+iconSizeY/2+32); + core::rect<s32> dest(noteX-iconSizeX/2+20, noteY-iconSizeY/2+ICON_SIZE/2, + noteX+iconSizeX/2+20, noteY+iconSizeY/2+ICON_SIZE/2); const core::rect<s32> source(core::position2d<s32>(0,0), t->getOriginalSize()); irr_driver->getVideoDriver()->draw2DImage(t, dest, source, NULL, NULL, true); + } // drawGlobalMusicDescription This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-01-05 11:31:16
|
Revision: 4402 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4402&view=rev Author: hikerstk Date: 2010-01-05 11:31:10 +0000 (Tue, 05 Jan 2010) Log Message: ----------- Fixed speedometer display for irrlicht 1.7 (no change for irr 1.6). Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-01-05 04:27:39 UTC (rev 4401) +++ main/trunk/src/states_screens/race_gui.cpp 2010-01-05 11:31:10 UTC (rev 4402) @@ -560,12 +560,10 @@ } video::SMaterial m; m.setTexture(0, m_speed_bar_icon->getTexture()); + m.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; irr_driver->getVideoDriver()->setMaterial(m); -#define DOES_NOT_WORK_ATM -#ifdef DOES_NOT_WORK_ATM irr_driver->getVideoDriver()->draw2DVertexPrimitiveList(vertices, count, index, count-2, video::EVT_STANDARD, scene::EPT_TRIANGLE_FAN); -#endif } // drawSpeed //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-02-19 00:53:14
|
Revision: 4766 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4766&view=rev Author: auria Date: 2010-02-19 00:53:08 +0000 (Fri, 19 Feb 2010) Log Message: ----------- Fixed messages saying 'tux has been', to now say 'tux has been eliminated' (strangely enough, the text is no more centered with this fix, even though I believe it should) Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-02-18 21:30:34 UTC (rev 4765) +++ main/trunk/src/states_screens/race_gui.cpp 2010-02-19 00:53:08 UTC (rev 4766) @@ -644,25 +644,30 @@ const core::recti &viewport, const core::vector2df &scaling) { + //TODO: don't hardcode, detect dynamically from font size + const int MESSAGE_MAX_HEIGHT = 70; + // First line of text somewhat under the top of the screen. For now // start just under the timer display int y = (int)(scaling.Y*164 + UserConfigParams::m_height - viewport.LowerRightCorner.Y ); - int x = (viewport.LowerRightCorner.X - viewport.UpperLeftCorner.X)>>1; + const int x = (viewport.LowerRightCorner.X - viewport.UpperLeftCorner.X)/2; + const int w = (viewport.LowerRightCorner.X + viewport.UpperLeftCorner.X)/2; + // The message are displayed in reverse order, so that a multi-line // message (addMessage("1", ...); addMessage("2",...) is displayed // in the right order: "1" on top of "2" - for(AllMessageType::const_iterator i=m_messages.begin();i!=m_messages.end(); ++i) + for (AllMessageType::const_iterator i = m_messages.begin(); i != m_messages.end(); ++i) { TimedMessage const &msg = *i; // Display only messages for all karts, or messages for this kart - if( msg.m_kart && msg.m_kart!=kart) continue; + if (msg.m_kart && msg.m_kart!=kart) continue; - core::rect<s32> pos(x, y, x, y); + core::rect<s32> pos(x - w/2, y, x + w/2, y + MESSAGE_MAX_HEIGHT); GUIEngine::getFont()->draw(core::stringw(msg.m_message.c_str()).c_str(), - pos, msg.m_color, true, true); - y+=40; + pos, msg.m_color, true /* hcenter */, true /* vcenter */); + y += MESSAGE_MAX_HEIGHT; } // for i in all messages } // drawAllMessages This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-02-20 20:16:33
|
Revision: 4778 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4778&view=rev Author: auria Date: 2010-02-20 20:16:26 +0000 (Sat, 20 Feb 2010) Log Message: ----------- Fixed plunger-in-face display Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-02-20 15:23:29 UTC (rev 4777) +++ main/trunk/src/states_screens/race_gui.cpp 2010-02-20 20:16:26 UTC (rev 4778) @@ -234,12 +234,12 @@ drawSpeed (kart, viewport, scaling); drawLap (info, kart, viewport, scaling); - if(kart->hasViewBlockedByPlunger()) + if (kart->hasViewBlockedByPlunger()) { int offset_y = viewport.UpperLeftCorner.Y; - const int screen_width = viewport.LowerRightCorner.X-viewport.UpperLeftCorner.X; - const int plunger_size = viewport.UpperLeftCorner.Y-viewport.LowerRightCorner.Y; + const int screen_width = viewport.LowerRightCorner.X - viewport.UpperLeftCorner.X; + const int plunger_size = viewport.LowerRightCorner.Y - viewport.UpperLeftCorner.Y; int plunger_x = viewport.UpperLeftCorner.X + screen_width/2 - plunger_size/2; video::ITexture *t=m_plunger_face->getTexture(); @@ -247,10 +247,10 @@ plunger_x+plunger_size, offset_y+plunger_size); const core::rect<s32> source(core::position2d<s32>(0,0), t->getOriginalSize()); - static const video::SColor white = video::SColor(255, 255, 255, 255); + //static const video::SColor white = video::SColor(255, 255, 255, 255); - irr_driver->getVideoDriver()->draw2DImage(t, dest, source, 0, - &white, true); + irr_driver->getVideoDriver()->draw2DImage(t, dest, source, NULL /* clip */, + NULL /* color */, true /* alpha */); } } // renderPlayerView This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-02-24 02:11:44
|
Revision: 4819 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4819&view=rev Author: auria Date: 2010-02-24 02:11:33 +0000 (Wed, 24 Feb 2010) Log Message: ----------- Fixed color display in 3 strikes mode Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-02-24 01:57:25 UTC (rev 4818) +++ main/trunk/src/states_screens/race_gui.cpp 2010-02-24 02:11:33 UTC (rev 4819) @@ -356,9 +356,9 @@ if (info[i].time.size() > 0) { - static video::SColor color = video::SColor(255, (int)(255*info[i].r), - (int)(255*info[i].g), - (int)(255*info[i].b) ); + video::SColor color = video::SColor(255, (int)(255*info[i].r), + (int)(255*info[i].g), + (int)(255*info[i].b) ); core::rect<s32> pos(x+ICON_PLAYER_WIDTH, y+5, x+ICON_PLAYER_WIDTH, y+5); core::stringw s=info[i].time.c_str(); font->draw(s.c_str(), pos, color); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-02-26 19:30:59
|
Revision: 4862 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4862&view=rev Author: auria Date: 2010-02-26 19:30:53 +0000 (Fri, 26 Feb 2010) Log Message: ----------- Draw plunger-in-face first and not last, so messages are not hidden under the plunger Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-02-26 19:21:53 UTC (rev 4861) +++ main/trunk/src/states_screens/race_gui.cpp 2010-02-26 19:30:53 UTC (rev 4862) @@ -224,34 +224,37 @@ { const core::recti &viewport = kart->getCamera()->getViewport(); const core::vector2df &scaling = kart->getCamera()->getScaling(); - drawAllMessages (kart, viewport, scaling); - if(!World::getWorld()->isRacePhase()) return; - - RaceGUI::KartIconDisplayInfo* info = World::getWorld()->getKartsDisplayInfo(); - - drawPowerupIcons (kart, viewport, scaling); - drawEnergyMeter (kart, viewport, scaling); - drawSpeed (kart, viewport, scaling); - drawLap (info, kart, viewport, scaling); - + if (kart->hasViewBlockedByPlunger()) { int offset_y = viewport.UpperLeftCorner.Y; - + const int screen_width = viewport.LowerRightCorner.X - viewport.UpperLeftCorner.X; const int plunger_size = viewport.LowerRightCorner.Y - viewport.UpperLeftCorner.Y; int plunger_x = viewport.UpperLeftCorner.X + screen_width/2 - plunger_size/2; - + video::ITexture *t=m_plunger_face->getTexture(); core::rect<s32> dest(plunger_x, offset_y, plunger_x+plunger_size, offset_y+plunger_size); const core::rect<s32> source(core::position2d<s32>(0,0), t->getOriginalSize()); - + //static const video::SColor white = video::SColor(255, 255, 255, 255); - + irr_driver->getVideoDriver()->draw2DImage(t, dest, source, NULL /* clip */, NULL /* color */, true /* alpha */); } + + + drawAllMessages (kart, viewport, scaling); + if(!World::getWorld()->isRacePhase()) return; + + RaceGUI::KartIconDisplayInfo* info = World::getWorld()->getKartsDisplayInfo(); + + drawPowerupIcons (kart, viewport, scaling); + drawEnergyMeter (kart, viewport, scaling); + drawSpeed (kart, viewport, scaling); + drawLap (info, kart, viewport, scaling); + } // renderPlayerView //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-04-25 18:11:42
|
Revision: 5267 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5267&view=rev Author: auria Date: 2010-04-25 18:11:36 +0000 (Sun, 25 Apr 2010) Log Message: ----------- Added a FIXME explaining the cause of some bug; didn't fix the bug yet, though, cause I'm not sure what the best way to fix it is. Will need to discuss with Joerg Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-04-25 17:58:22 UTC (rev 5266) +++ main/trunk/src/states_screens/race_gui.cpp 2010-04-25 18:11:36 UTC (rev 5267) @@ -619,7 +619,11 @@ + (int)(0.15f*UserConfigParams::m_width*scaling.X); pos.UpperLeftCorner.Y = viewport.LowerRightCorner.Y; gui::IGUIFont* font = GUIEngine::getFont(); + + //FIXME: font height is multiplied by "scaling.Y" here, but the font itself is actually not scaled, + // resulting in overlapping of the two lines int font_height = (int)(font->getDimension(L"X").Height*scaling.Y); + if (kart->hasFinishedRace()) { static video::SColor color = video::SColor(255, 255, 255, 255); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-04-27 21:44:09
|
Revision: 5293 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5293&view=rev Author: mbjornstk Date: 2010-04-27 21:44:01 +0000 (Tue, 27 Apr 2010) Log Message: ----------- Make minimap scale with window size. "Lap n/m" text still to be adjusted. Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-04-27 13:11:17 UTC (rev 5292) +++ main/trunk/src/states_screens/race_gui.cpp 2010-04-27 21:44:01 UTC (rev 5293) @@ -47,15 +47,21 @@ */ RaceGUI::RaceGUI() { - m_marker_rendered_size = 32; - m_marker_ai_size = 14; - m_marker_player_size = 16; - m_map_rendered_width = 128; - m_map_rendered_height = 128; - m_map_width = 100; - m_map_height = 100; - m_map_left = 10; - m_map_bottom = 10; + // Originally m_map_height was 100, and we take 480 as minimum res + const float scaling = irr_driver->getFrameSize().Height / 480.0; + // Marker texture has to be power-of-two for (old) OpenGL compliance + m_marker_rendered_size = 2 << ((int) ceil(1.0 + log(32.0 * scaling))); + m_marker_ai_size = 14.0 * scaling; + m_marker_player_size = 16.0 * scaling; + m_map_width = 100.0 * scaling; + m_map_height = 100.0 * scaling; + m_map_left = 10.0 * scaling; + m_map_bottom = 10.0 * scaling; + // Minimap is also rendered bigger via OpenGL, so find power-of-two again + const int map_texture = 2 << ((int) ceil(1.0 + log(128.0 * scaling))); + m_map_rendered_width = map_texture; + m_map_rendered_height = map_texture; + m_max_font_height = GUIEngine::getFontHeight() + 10; m_small_font_max_height = GUIEngine::getSmallFontHeight() + 5; @@ -64,9 +70,9 @@ { m_map_left = UserConfigParams::m_width - m_map_width; } - + m_speed_meter_icon = material_manager->getMaterial("speedback.png"); - m_speed_bar_icon = material_manager->getMaterial("speedfore.png"); + m_speed_bar_icon = material_manager->getMaterial("speedfore.png"); m_plunger_face = material_manager->getMaterial("plungerface.png"); m_music_icon = material_manager->getMaterial("notes.png"); createMarkerTexture(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-04-27 22:51:16
|
Revision: 5295 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5295&view=rev Author: mbjornstk Date: 2010-04-27 22:51:07 +0000 (Tue, 27 Apr 2010) Log Message: ----------- Remove exclamation mark that showed "flying" (it was half off screen). Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-04-27 22:43:44 UTC (rev 5294) +++ main/trunk/src/states_screens/race_gui.cpp 2010-04-27 22:51:07 UTC (rev 5295) @@ -542,25 +542,13 @@ meter_texture->getOriginalSize()); video->draw2DImage(meter_texture, meter_pos, meter_texture_coords, NULL, NULL, true); - // Indicate when the kart is off ground - // ------------------------------------ - if ( !kart->isOnGround() ) - { - static video::SColor color = video::SColor(255, 255, 255, 255); - core::rect<s32> pos(offset.X-(int)(30*minRatio), - offset.Y-(int)(10*minRatio), - offset.X-(int)(30*minRatio), - offset.Y-(int)(10*minRatio) ); - GUIEngine::getFont()->draw(core::stringw("!").c_str(), pos, color); - } - const float speed = kart->getSpeed(); if(speed <=0) return; // Nothing to do if speed is negative. // Draw the actual speed bar (if the speed is >0) // ---------------------------------------------- float speed_ratio = speed/KILOMETERS_PER_HOUR/110.0f; - if(speed_ratio>1) speed_ratio = 1; + if(speed_ratio>1 || !kart->isOnGround()) speed_ratio = 1; video::ITexture *bar_texture = m_speed_bar_icon->getTexture(); core::dimension2du bar_size = bar_texture->getOriginalSize(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-06-29 00:59:26
|
Revision: 5587 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5587&view=rev Author: auria Date: 2010-06-29 00:59:20 +0000 (Tue, 29 Jun 2010) Log Message: ----------- Started implementing scalable race GUI : race GUI will now be not so small on high resolutions Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-06-28 23:34:08 UTC (rev 5586) +++ main/trunk/src/states_screens/race_gui.cpp 2010-06-29 00:59:20 UTC (rev 5587) @@ -257,8 +257,13 @@ void RaceGUI::renderPlayerView(const Kart *kart) { const core::recti &viewport = kart->getCamera()->getViewport(); - const core::vector2df &scaling = kart->getCamera()->getScaling(); + core::vector2df scaling = kart->getCamera()->getScaling(); + //std::cout << "Applied ratio : " << viewport.getWidth()/800.0f << std::endl; + scaling *= viewport.getWidth()/800.0f; // scale race GUI along screen size + + //std::cout << "Scale : " << scaling.X << ", " << scaling.Y << std::endl; + if (kart->hasViewBlockedByPlunger()) { int offset_y = viewport.UpperLeftCorner.Y; @@ -536,9 +541,11 @@ int meter_width = (int)(SPEEDWIDTH*minRatio); int meter_height = (int)(SPEEDWIDTH*minRatio); core::vector2di offset = viewport.UpperLeftCorner; - offset.X += (int)((UserConfigParams::m_width-10)*scaling.X) - meter_width; + offset.X += viewport.getWidth() - meter_width - (int)(10*scaling.X); offset.Y = viewport.LowerRightCorner.Y-(int)(10*scaling.Y); + std::cout << "speedometer : " << meter_width << "x" << meter_height << " @ " << offset.X << ", " << offset.Y << std::endl; + // First draw the meter (i.e. the background which contains the numbers etc. // ------------------------------------------------------------------------- video::IVideoDriver *video = irr_driver->getVideoDriver(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-06-29 01:24:03
|
Revision: 5588 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5588&view=rev Author: auria Date: 2010-06-29 01:23:56 +0000 (Tue, 29 Jun 2010) Log Message: ----------- More work on scalable race GUI : race GUI will now be not so small on high resolutions (we need higher-definition weapon icons\!) Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-06-29 00:59:20 UTC (rev 5587) +++ main/trunk/src/states_screens/race_gui.cpp 2010-06-29 01:23:56 UTC (rev 5588) @@ -378,7 +378,7 @@ int y; - int ICON_WIDTH=40; + int ICON_WIDTH=40*(UserConfigParams::m_width/800.0f); int ICON_PLAYER_WIDTH=50; if(UserConfigParams::m_height<600) { @@ -447,12 +447,10 @@ int nSize=(int)(64.0f*std::min(scaling.X, scaling.Y)); - int x1 = (int)((UserConfigParams::m_width/2-32) * scaling.X) - + viewport.UpperLeftCorner.X; - //int y1 = UserConfigParams::m_height - viewport.LowerRightCorner.Y - // + (int)(20 * scaling.Y)+nSize; - int y1 = viewport.UpperLeftCorner.Y - + (int)(20 * scaling.Y); + int itemSpacing = std::min(scaling.X, scaling.Y)*30; + + int x1 = viewport.UpperLeftCorner.X + viewport.getWidth()/2 - (n * itemSpacing)/2; + int y1 = viewport.UpperLeftCorner.Y + (int)(20 * scaling.Y); assert(powerup != NULL); assert(powerup->getIcon() != NULL); @@ -462,7 +460,7 @@ for ( int i = 0 ; i < n ; i++ ) { - int x2=(int)(x1+i*std::min(scaling.X, scaling.Y)*30); + int x2=(int)(x1+i*itemSpacing); core::rect<s32> pos(x2, y1, x2+nSize, y1+nSize); irr_driver->getVideoDriver()->draw2DImage(t, pos, rect, NULL, NULL, true); @@ -543,8 +541,6 @@ core::vector2di offset = viewport.UpperLeftCorner; offset.X += viewport.getWidth() - meter_width - (int)(10*scaling.X); offset.Y = viewport.LowerRightCorner.Y-(int)(10*scaling.Y); - - std::cout << "speedometer : " << meter_width << "x" << meter_height << " @ " << offset.X << ", " << offset.Y << std::endl; // First draw the meter (i.e. the background which contains the numbers etc. // ------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-06-29 11:11:09
|
Revision: 5590 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5590&view=rev Author: hikerstk Date: 2010-06-29 11:11:03 +0000 (Tue, 29 Jun 2010) Log Message: ----------- Fixed VS compiler warnings. Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-06-29 01:45:14 UTC (rev 5589) +++ main/trunk/src/states_screens/race_gui.cpp 2010-06-29 11:11:03 UTC (rev 5590) @@ -378,7 +378,7 @@ int y; - int ICON_WIDTH=40*(UserConfigParams::m_width/800.0f); + int ICON_WIDTH=(int)(40*(UserConfigParams::m_width/800.0f)); int ICON_PLAYER_WIDTH=50; if(UserConfigParams::m_height<600) { @@ -447,7 +447,7 @@ int nSize=(int)(64.0f*std::min(scaling.X, scaling.Y)); - int itemSpacing = std::min(scaling.X, scaling.Y)*30; + int itemSpacing = (int)(std::min(scaling.X, scaling.Y)*30); int x1 = viewport.UpperLeftCorner.X + viewport.getWidth()/2 - (n * itemSpacing)/2; int y1 = viewport.UpperLeftCorner.Y + (int)(20 * scaling.Y); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-07-02 23:14:50
|
Revision: 5621 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5621&view=rev Author: auria Date: 2010-07-02 23:14:44 +0000 (Fri, 02 Jul 2010) Log Message: ----------- Fixed a couple issues in race GUI Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-07-02 17:47:54 UTC (rev 5620) +++ main/trunk/src/states_screens/race_gui.cpp 2010-07-02 23:14:44 UTC (rev 5621) @@ -379,7 +379,7 @@ int y; int ICON_WIDTH=(int)(40*(UserConfigParams::m_width/800.0f)); - int ICON_PLAYER_WIDTH=50; + int ICON_PLAYER_WIDTH=(int)(50*(UserConfigParams::m_width/800.0f)); if(UserConfigParams::m_height<600) { ICON_WIDTH = 27; @@ -474,11 +474,13 @@ const core::vector2df &scaling) { float state = (float)(kart->getEnergy()) / MAX_ITEMS_COLLECTED; - int x = (int)((UserConfigParams::m_width-24) * scaling.X) + viewport.UpperLeftCorner.X; //int y = (int)(250 * scaling.Y) + viewport.UpperLeftCorner.Y; - int y = viewport.LowerRightCorner.Y - (int)(250 * scaling.Y); int w = (int)(16 * scaling.X); int h = (int)(UserConfigParams::m_height/4 * scaling.Y); + + int x = viewport.LowerRightCorner.X - w - 5; + int y = viewport.LowerRightCorner.Y - (int)(250 * scaling.Y); + float coin_target = (float)race_manager->getCoinTarget(); int th = (int)(h*(coin_target/MAX_ITEMS_COLLECTED)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-07-07 21:50:38
|
Revision: 5667 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5667&view=rev Author: hikerstk Date: 2010-07-07 21:50:32 +0000 (Wed, 07 Jul 2010) Log Message: ----------- Fixed memory leak. Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-07-07 19:31:54 UTC (rev 5666) +++ main/trunk/src/states_screens/race_gui.cpp 2010-07-07 21:50:32 UTC (rev 5667) @@ -149,9 +149,6 @@ core::vector2df center((float)((m_marker_rendered_size>>1)+i*m_marker_rendered_size), (float)(m_marker_rendered_size>>1) ); int count = kp->getShape(); - //core::array<core::vector2df> vertices; - video::S3DVertex *vertices = new video::S3DVertex[count+1]; - unsigned short int *index = new unsigned short int[count+1]; video::ITexture *t = kp->getMinimapIcon(); if(t) { @@ -169,6 +166,8 @@ } else // no special minimap icon defined { + video::S3DVertex *vertices = new video::S3DVertex[count+1]; + unsigned short int *index = new unsigned short int[count+1]; video::SColor color = kp->getColor(); createRegularPolygon(count, (float)radius, center, color, vertices, index); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-07-08 05:14:48
|
Revision: 5673 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5673&view=rev Author: hikerstk Date: 2010-07-08 05:14:42 +0000 (Thu, 08 Jul 2010) Log Message: ----------- Fixed delete being inconsistent with new. Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-07-08 02:32:50 UTC (rev 5672) +++ main/trunk/src/states_screens/race_gui.cpp 2010-07-08 05:14:42 UTC (rev 5673) @@ -173,8 +173,8 @@ vertices, index); irr_driver->getVideoDriver()->draw2DVertexPrimitiveList(vertices, count, index, count-2, video::EVT_STANDARD, scene::EPT_TRIANGLE_FAN); - delete vertices; - delete index; + delete [] vertices; + delete [] index; } // if special minimap icon defined } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-08-29 12:56:15
|
Revision: 5806 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5806&view=rev Author: hikerstk Date: 2010-08-29 12:56:08 +0000 (Sun, 29 Aug 2010) Log Message: ----------- Fixed bug 3041526 - speedometer display was incorrect for higher speeds. Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-08-28 23:34:25 UTC (rev 5805) +++ main/trunk/src/states_screens/race_gui.cpp 2010-08-29 12:56:08 UTC (rev 5806) @@ -540,17 +540,17 @@ const int SPEEDWIDTH = 128; int meter_width = (int)(SPEEDWIDTH*minRatio); int meter_height = (int)(SPEEDWIDTH*minRatio); - core::vector2di offset = viewport.UpperLeftCorner; - offset.X += viewport.getWidth() - meter_width - (int)(10*scaling.X); - offset.Y = viewport.LowerRightCorner.Y-(int)(10*scaling.Y); + core::vector2df offset; + offset.X = (float)(viewport.LowerRightCorner.X-meter_width) - 10.0f*scaling.X; + offset.Y = viewport.LowerRightCorner.Y-10*scaling.Y; // First draw the meter (i.e. the background which contains the numbers etc. // ------------------------------------------------------------------------- video::IVideoDriver *video = irr_driver->getVideoDriver(); - const core::rect<s32> meter_pos(offset.X, - offset.Y-meter_height, - offset.X+meter_width, - offset.Y); + const core::rect<s32> meter_pos((int)offset.X, + (int)(offset.Y-meter_height), + (int)(offset.X+meter_width), + (int)offset.Y); video::ITexture *meter_texture = m_speed_meter_icon->getTexture(); const core::rect<s32> meter_texture_coords(core::position2d<s32>(0,0), meter_texture->getOriginalSize()); @@ -566,37 +566,65 @@ video::ITexture *bar_texture = m_speed_bar_icon->getTexture(); core::dimension2du bar_size = bar_texture->getOriginalSize(); - video::S3DVertex vertices[4]; + video::S3DVertex vertices[5]; + unsigned int count; - vertices[0].TCoords = core::vector2df(1.0f, 1.0f); - vertices[0].Pos = core::vector3df((float)meter_pos.LowerRightCorner.X, - (float)meter_pos.LowerRightCorner.Y, - 0); + // There are three different polygons used, depending on + // the speed ratio. Consider the speed-display texture: + // + // C----x----D (position of v,w,x,y vary depending on + // | | speed) + // w y + // | | + // B----A----E + // For speed ratio <= r1 the triangle ABw is used, with w between B and C. + // For speed ratio <= r2 the quad ABCx is used, with x between C and D. + // For speed ratio > r2 the poly ABCDy is used, with y between D and E. + + vertices[0].TCoords = core::vector2df(0.5f, 1.0f); + vertices[0].Pos = core::vector3df(offset.X+meter_width/2, offset.Y, 0); vertices[1].TCoords = core::vector2df(0, 1.0f); - vertices[1].Pos = core::vector3df((float)meter_pos.UpperLeftCorner.X, - (float)meter_pos.LowerRightCorner.Y, 0); - unsigned int count; - if(speed_ratio<=0.5f) + vertices[1].Pos = core::vector3df(offset.X, offset.Y, 0); + // The speed ratios at which different triangles must be used. + // These values should be adjusted in case that the speed display + // is not linear enough. Mostly the speed values are below 0.7, it + // needs some zipper to get closer to 1. + const float r1 = 0.4f; + const float r2 = 0.8f; + if(speed_ratio<=r1) { - count = 3; - vertices[2].TCoords = core::vector2df(0, 1-2*speed_ratio); - vertices[2].Pos = core::vector3df((float)meter_pos.UpperLeftCorner.X, - (float)meter_pos.LowerRightCorner.Y-speed_ratio*2*meter_height, - 0); + count = 3; + float f = speed_ratio/r1; + vertices[2].TCoords = core::vector2df(0, 1.0f-f); + vertices[2].Pos = core::vector3df(offset.X, offset.Y-f*meter_height,0); } + else if(speed_ratio<=r2) + { + count = 4; + float f = (speed_ratio - r1)/(r2-r1); + vertices[2].TCoords = core::vector2df(0,0); + vertices[2].Pos = core::vector3df(offset.X, offset.Y-meter_height, 0); + vertices[3].TCoords = core::vector2df(f, 0); + vertices[3].Pos = core::vector3df(offset.X+f*meter_width, + offset.Y-meter_height, + 0); + } else { - count = 4; + count = 5; + float f = (speed_ratio - r2)/(1-r2); vertices[2].TCoords = core::vector2df(0,0); - vertices[2].Pos = core::vector3df((float)offset.X, - (float)(offset.Y-meter_height), - 0); - vertices[3].TCoords = core::vector2df(2*speed_ratio-1.0f, 0); - vertices[3].Pos = core::vector3df(offset.X+2*(speed_ratio-0.5f)*meter_width, - (float)(offset.Y-meter_height), - 0); + vertices[2].Pos = core::vector3df(offset.X, offset.Y-meter_height, 0); + vertices[3].TCoords = core::vector2df(1, 0); + vertices[3].Pos = core::vector3df(offset.X+meter_width, + offset.Y-meter_height, + 0); + vertices[4].TCoords = core::vector2df(1.0f, f); + vertices[4].Pos = core::vector3df(offset.X+meter_width, + offset.Y - (1-f)*meter_height, + 0); } - short int index[4]; + short int index[5]; for(unsigned int i=0; i<count; i++) { index[i]=i; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-02 12:47:34
|
Revision: 5862 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5862&view=rev Author: hikerstk Date: 2010-09-02 12:47:28 +0000 (Thu, 02 Sep 2010) Log Message: ----------- Fixed (at least one) bug in new race gui which caused battle mode not to work anymore (battle modes don't have distance along track). Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-09-02 12:31:05 UTC (rev 5861) +++ main/trunk/src/states_screens/race_gui.cpp 2010-09-02 12:47:28 UTC (rev 5862) @@ -432,28 +432,38 @@ //x,y is the target position int lap = info[kart->getWorldKartId()].lap; - float distance= - world->getDistanceDownTrackForKart(kart_id) - +world->getTrack()->getTrackLength()*lap; - if (previous_distance-distance<m_dist_show_overlap) + + // In battle mode there is no distance along track etc. + if(race_manager->getMinorMode()==RaceManager::MINOR_MODE_3_STRIKES) { - //linear translation : form (0,ICON_PLAYER_WIDTH+2) to - // (previous_x-x_base+(ICON_PLAYER_WIDTH+2)/2,0) - x=(int)(x_base+(1-(previous_distance-distance) - /m_dist_show_overlap) - *(previous_x-x_base+(ICON_PLAYER_WIDTH+2)/2)); - y=(int)(previous_y+(previous_distance-distance) - /m_dist_show_overlap*(ICON_PLAYER_WIDTH+2)); + x = x_base; + y = previous_y+ICON_PLAYER_WIDTH+2; } else { - x=x_base; - y=previous_y+ICON_PLAYER_WIDTH+2; - } + float distance = world->getDistanceDownTrackForKart(kart_id) + + world->getTrack()->getTrackLength()*lap; + if (previous_distance-distance<m_dist_show_overlap) + { + //linear translation : form (0,ICON_PLAYER_WIDTH+2) to + // (previous_x-x_base+(ICON_PLAYER_WIDTH+2)/2,0) + x=(int)(x_base+(1-(previous_distance-distance) + /m_dist_show_overlap) + *(previous_x-x_base+(ICON_PLAYER_WIDTH+2)/2)); + y=(int)(previous_y+(previous_distance-distance) + /m_dist_show_overlap*(ICON_PLAYER_WIDTH+2)); + } + else + { + x=x_base; + y=previous_y+ICON_PLAYER_WIDTH+2; + } + previous_distance=distance; + } // not three-strike-battle previous_x=x;//save coord of the previous kart in list previous_y=y; - previous_distance=distance; + //initialize m_previous_icons_position if (m_previous_icons_position.size()<kart_amount) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-09-04 18:20:17
|
Revision: 5882 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5882&view=rev Author: auria Date: 2010-09-04 18:20:11 +0000 (Sat, 04 Sep 2010) Log Message: ----------- Reversed WIP icon background patch that I accidentally committed Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-09-03 20:14:39 UTC (rev 5881) +++ main/trunk/src/states_screens/race_gui.cpp 2010-09-04 18:20:11 UTC (rev 5882) @@ -509,15 +509,7 @@ kart->getController()->isPlayerController() ? ICON_PLAYER_WIDTH : ICON_WIDTH; const core::rect<s32> pos(x, y, x+w, y+w); - - //to bring to light the player's icon: add a background - if (kart->getController()->isPlayerController()) - { - video::SColor color=kart->getKartProperties()->getColor(); - color.setAlpha(100+30*cos(World::getWorld()->getTime()*2)); - irr_driver->getVideoDriver()->draw2DRectangle(color,pos); - } - + // Fixes crash bug, why are certain icons not showing up? if ((icon != NULL) && (!kart->playingEmergencyAnimation())) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-05 01:05:58
|
Revision: 5896 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5896&view=rev Author: hikerstk Date: 2010-09-05 01:05:52 +0000 (Sun, 05 Sep 2010) Log Message: ----------- Removed compiler warnings. Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-09-05 01:04:50 UTC (rev 5895) +++ main/trunk/src/states_screens/race_gui.cpp 2010-09-05 01:05:52 UTC (rev 5896) @@ -522,7 +522,7 @@ { colors[i]=kart->getKartProperties()->getColor(); colors[i].setAlpha( - 100+100*cos(M_PI/2*i+World::getWorld()->getTime()*2)); + 100+(int)(100*cos(M_PI/2*i+World::getWorld()->getTime()*2))); } const core::rect<s32> rect(core::position2d<s32>(0,0), m_icons_frame->getTexture()->getOriginalSize()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-05 23:42:06
|
Revision: 5899 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5899&view=rev Author: hikerstk Date: 2010-09-05 23:41:59 +0000 (Sun, 05 Sep 2010) Log Message: ----------- Bugfix in new animated icons: if the kart positions were not in the right order when stk is started (i.e. kart with world id 8 is on position 10 instead of 9) then the race gui would crash. While this situation should not happen (the incorrect position happens if a kart has an invalid start position and is therefore rescued when the 'go' happens), this patch avoids a crash, helping tpo diagnose other problems. Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-09-05 14:05:59 UTC (rev 5898) +++ main/trunk/src/states_screens/race_gui.cpp 2010-09-05 23:41:59 UTC (rev 5899) @@ -400,6 +400,23 @@ { int x_base = 15; int y_base = 20; + int ICON_WIDTH=(int)(40*(UserConfigParams::m_width/800.0f)); + int ICON_PLAYER_WIDTH=(int)(50*(UserConfigParams::m_width/800.0f)); + if(UserConfigParams::m_height<600) + { + ICON_WIDTH = 27; + ICON_PLAYER_WIDTH = 35; + } + + //initialize m_previous_icons_position + if(m_previous_icons_position.size()==0) + { + for(unsigned int i=0; i<race_manager->getNumberOfKarts(); i++) + { + core::vector2d<s32> pos(x_base,y_base+i*(ICON_PLAYER_WIDTH+2)); + m_previous_icons_position.push_back(pos); + } + } // Special case : when 3 players play, use 4th window to display such stuff if (race_manager->getNumLocalPlayers() == 3) @@ -413,13 +430,6 @@ float previous_distance=10000.0;//far ahead - int ICON_WIDTH=(int)(40*(UserConfigParams::m_width/800.0f)); - int ICON_PLAYER_WIDTH=(int)(50*(UserConfigParams::m_width/800.0f)); - if(UserConfigParams::m_height<600) - { - ICON_WIDTH = 27; - ICON_PLAYER_WIDTH = 35; - } int previous_x=x_base; int previous_y=y_base-ICON_PLAYER_WIDTH-2; @@ -467,14 +477,6 @@ previous_x=x;//save coord of the previous kart in list previous_y=y; - - //initialize m_previous_icons_position - if (m_previous_icons_position.size()<kart_amount) - { - core::vector2d<s32> pos(x,y); - m_previous_icons_position.push_back(pos); - } - //soft movement using previous position: x=(int)((x+m_previous_icons_position[kart_id].X*m_icons_inertia) /(m_icons_inertia+1)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-07 13:46:57
|
Revision: 5912 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5912&view=rev Author: hikerstk Date: 2010-09-07 13:46:51 +0000 (Tue, 07 Sep 2010) Log Message: ----------- Applied jmimu's patch to fix bug 3059574 "Race icons disappearing", which is triggered when AI karts have finished the race. Thanks a lot! Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-09-07 13:38:23 UTC (rev 5911) +++ main/trunk/src/states_screens/race_gui.cpp 2010-09-07 13:46:51 UTC (rev 5912) @@ -408,23 +408,26 @@ ICON_PLAYER_WIDTH = 35; } + // Special case : when 3 players play, use 4th window to display such stuff + if (race_manager->getNumLocalPlayers() == 3) + { + x_base = UserConfigParams::m_width/2 + 15; + y_base = UserConfigParams::m_height/2 + 20; + } + + LinearWorld *world = (LinearWorld*)(World::getWorld()); //initialize m_previous_icons_position if(m_previous_icons_position.size()==0) { for(unsigned int i=0; i<race_manager->getNumberOfKarts(); i++) { - core::vector2d<s32> pos(x_base,y_base+i*(ICON_PLAYER_WIDTH+2)); + const Kart *kart = world->getKart(i); + int position = kart->getPosition(); + core::vector2d<s32> pos(x_base,y_base+(position-1)*(ICON_PLAYER_WIDTH+2)); m_previous_icons_position.push_back(pos); } } - // Special case : when 3 players play, use 4th window to display such stuff - if (race_manager->getNumLocalPlayers() == 3) - { - x_base = UserConfigParams::m_width/2 + 15; - y_base = UserConfigParams::m_height/2 + 20; - } - int x; int y; float previous_distance=10000.0;//far ahead @@ -435,7 +438,6 @@ int previous_y=y_base-ICON_PLAYER_WIDTH-2; gui::ScalableFont* font = GUIEngine::getFont(); - LinearWorld *world = (LinearWorld*)(World::getWorld()); const unsigned int kart_amount = world->getNumKarts(); for(int position = 1; position <= (int)kart_amount ; position++) @@ -457,7 +459,7 @@ { float distance = world->getDistanceDownTrackForKart(kart_id) + world->getTrack()->getTrackLength()*lap; - if (previous_distance-distance<m_dist_show_overlap) + if ((previous_distance-distance<m_dist_show_overlap) && (!kart->hasFinishedRace())) { //linear translation : form (0,ICON_PLAYER_WIDTH+2) to // (previous_x-x_base+(ICON_PLAYER_WIDTH+2)/2,0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-08 05:56:24
|
Revision: 5918 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5918&view=rev Author: hikerstk Date: 2010-09-08 05:56:18 +0000 (Wed, 08 Sep 2010) Log Message: ----------- Applied jmimu's patch, to fix the real problem with the disappearing icons. Thanks for the patch! Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-09-07 23:44:33 UTC (rev 5917) +++ main/trunk/src/states_screens/race_gui.cpp 2010-09-08 05:56:18 UTC (rev 5918) @@ -430,7 +430,7 @@ int x; int y; - float previous_distance=10000.0;//far ahead + float previous_distance=0.0;//no need to be far ahead, first kart won't try to overlap @@ -459,7 +459,7 @@ { float distance = world->getDistanceDownTrackForKart(kart_id) + world->getTrack()->getTrackLength()*lap; - if ((previous_distance-distance<m_dist_show_overlap) && (!kart->hasFinishedRace())) + if ((position>1) && (previous_distance-distance<m_dist_show_overlap) && (!kart->hasFinishedRace())) { //linear translation : form (0,ICON_PLAYER_WIDTH+2) to // (previous_x-x_base+(ICON_PLAYER_WIDTH+2)/2,0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-14 00:57:33
|
Revision: 5990 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5990&view=rev Author: hikerstk Date: 2010-09-14 00:57:27 +0000 (Tue, 14 Sep 2010) Log Message: ----------- Fixed compiler warning. Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-09-14 00:56:42 UTC (rev 5989) +++ main/trunk/src/states_screens/race_gui.cpp 2010-09-14 00:57:27 UTC (rev 5990) @@ -446,7 +446,7 @@ const unsigned int kart_amount = world->getNumKarts(); //where is the limit to hide last icons - float y_icons_limit=UserConfigParams::m_height-m_map_height-ICON_PLAYER_WIDTH; + int y_icons_limit=UserConfigParams::m_height-m_map_height-ICON_PLAYER_WIDTH; if (race_manager->getNumLocalPlayers() == 3) y_icons_limit=UserConfigParams::m_height-ICON_WIDTH; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-10-01 23:46:52
|
Revision: 6191 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6191&view=rev Author: auria Date: 2010-10-01 23:46:46 +0000 (Fri, 01 Oct 2010) Log Message: ----------- Hopefully fixed nitrobar going off-screen at large resolutions : use a percentage of screensize, or an sbolute size multiplied by the scale parameter, but not both toghether. Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2010-10-01 23:25:51 UTC (rev 6190) +++ main/trunk/src/states_screens/race_gui.cpp 2010-10-01 23:46:46 UTC (rev 6191) @@ -710,7 +710,7 @@ float state = (float)(kart->getEnergy()) / MAX_ITEMS_COLLECTED; //int y = (int)(250 * scaling.Y) + viewport.UpperLeftCorner.Y; int w = (int)(16 * scaling.X); - int h = (int)(UserConfigParams::m_height/4 * scaling.Y); + int h = (int)(viewport.getHeight()/3); int x = viewport.LowerRightCorner.X - w - 5; int y = viewport.LowerRightCorner.Y - (int)(250 * scaling.Y); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2013-09-03 23:59:56
|
Revision: 13622 http://sourceforge.net/p/supertuxkart/code/13622 Author: auria Date: 2013-09-03 23:59:53 +0000 (Tue, 03 Sep 2013) Log Message: ----------- Scale down speedometer text when speedometer is small Modified Paths: -------------- main/trunk/src/states_screens/race_gui.cpp Modified: main/trunk/src/states_screens/race_gui.cpp =================================================================== --- main/trunk/src/states_screens/race_gui.cpp 2013-09-03 20:53:33 UTC (rev 13621) +++ main/trunk/src/states_screens/race_gui.cpp 2013-09-03 23:59:53 UTC (rev 13622) @@ -602,11 +602,11 @@ } // drawEnergyMeter //----------------------------------------------------------------------------- + void RaceGUI::drawSpeedAndEnergy(const AbstractKart* kart, const core::recti &viewport, const core::vector2df &scaling) { - float minRatio = std::min(scaling.X, scaling.Y); const int SPEEDWIDTH = 128; int meter_width = (int)(SPEEDWIDTH*minRatio); @@ -722,8 +722,15 @@ pos.LowerRightCorner.X=(int)(offset.X + 0.8f*meter_width); pos.LowerRightCorner.Y=(int)(offset.X - 0.5f*meter_height); - gui::ScalableFont* font = GUIEngine::getLargeFont(); + gui::ScalableFont* font; + if (pos.getWidth() > 55) + font = GUIEngine::getLargeFont(); + else if (pos.getWidth() > 40) + font = GUIEngine::getFont(); + else + font = GUIEngine::getSmallFont(); + static video::SColor color = video::SColor(255, 255, 255, 255); char str[256]; sprintf(str, "%d", (int)(speed*10)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |