Code Monkey home page Code Monkey logo

Comments (3)

qwertychouskie avatar qwertychouskie commented on July 29, 2024 1

AFAIR this also used to be an issue with the powerup icons when you got a gift box, but I think that was fixed at some point. Likely the same fix needs to be applied here.

For reference, here's the code that draws the currently held powerup icons, which does work: https://github.com/supertuxkart/stk-code/blob/master/src/states_screens/race_gui_base.cpp#L1203

video::ITexture *iconItem = powerup->getIcon()->getTexture() seems to be working as expected.

The plunger-in-face code also works as expected: https://github.com/supertuxkart/stk-code/blob/master/src/states_screens/race_gui_base.cpp#L1226

powerup_manager->getIcon(PowerupManager::POWERUP_PLUNGER)->getTexture();

Meanwhile, the attachment code is what is not working: https://github.com/supertuxkart/stk-code/blob/master/src/states_screens/race_gui_base.cpp#L1241

attachment_manager->getIcon(kart->getAttachment()->getType())->getTexture();

Seems like powerup_manager->getIcon() works properly, but attachment_manager->getIcon() does not.

from stk-code.

qwertychouskie avatar qwertychouskie commented on July 29, 2024

Side note: PowerupManager::unloadPowerups() is a completely unused function, should probably be removed.

from stk-code.

qwertychouskie avatar qwertychouskie commented on July 29, 2024

It seems that the powerup manager has an explicitly defined constructor that resetsm_all_icons: https://github.com/supertuxkart/stk-code/blob/master/src/items/powerup_manager.cpp#L48

Meanwhile the attachment manager doesn't have any explicitly defined constructor.

Perhaps this is the difference?

from stk-code.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.