RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    How to change button icons? [DONE]

    Scheduled Pinned Locked Moved Projects and Themes
    themesretropieiconschange
    65 Posts 15 Posters 28.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jacobfk20
      last edited by

      @masteryoer It's actually been so long that I don't remember :)
      I've also noticed that res2h has been removed from this branch for some time, it used to be included and that's what I use.

      Maybe if you upload your resource.h file or tell me what the compilation error is I can help you further.

      M 1 Reply Last reply Reply Quote 0
      • M
        masteryoer @jacobfk20
        last edited by

        @jacobfk20

        It's still referenced in the emulationstation branch. It's in data/resources/generate.sh with a link to the fit repo for building it. Maybe I'll find an old source and see if I can use that one. It seems to be breaking whenever I use it.

        I should be moving my .png or .svg over to the resources folder, then running res2h to create the header and .cpp file right? It also looks like it makes a frame.png.cpp file too. (I was changing the UIs frame element around dialogs and Windows)

        1 Reply Last reply Reply Quote 0
        • M
          masteryoer @herb_fargus
          last edited by

          @herb_fargus

          Yeah, I know where to change it at, but simply replacing the resources doesn't seem to work. I used frame.png which is the window border around the dialogues, changed it to a new look and replaced the original one, then recompiled and the old one was still being used.

          1 Reply Last reply Reply Quote 0
          • J
            jacobfk20
            last edited by

            @masteryoer So you're overwriting the current frame.png.cpp in data/converted with your new convered version, right?

            M 1 Reply Last reply Reply Quote 0
            • M
              masteryoer @jacobfk20
              last edited by masteryoer

              @jacobfk20

              I was attempting to. The res2h executable does it for you. I think the newer version I am using does it wrong though because it changed all the const chars to const uint16/32 and it broke resources.h

              Here is the output of a couple files that were modified using the new build of res2h

              https://gist.github.com/Ex0r/f63702473eec69ee689f9dfe18b8ba1c

              There is both old and new notice the differences

              1 Reply Last reply Reply Quote 0
              • J
                jacobfk20
                last edited by jacobfk20

                @masteryoer Ah, ok. Yes, it should be a const unsigned char. It would give error on compilation when ES attempts to bring the resource in expecting a const char*. Maybe there is a option in res2h you need to do to export as const char?

                I went and looked at the res2h git and it was recently updated to support 32/64 bit archives. So to do this the program will now keep it in uint8, 16, 32, or 64 depending on size.
                ES should expects a const char* so this is what is most likely causing you issue. A quick fix would be to get an older version of res2h that exports the const char source.

                M 1 Reply Last reply Reply Quote 0
                • M
                  masteryoer @jacobfk20
                  last edited by masteryoer

                  @jacobfk20

                  Ahh, that explains a lot. I take it, if the older version doesnt support 32 or 64 bit, I won't be able to use that version on my windows machine? Or no?

                  Thanks for the info.

                  Hmm. I went all the way back to the earliest release he has available, 0.3 beta, here: https://github.com/HorstBaerbel/res2h/releases

                  using the precompiled windows binary, and it's still doing it. At this point, I am not sure what's going on, or how to fix it. Perhaps it needs to be compiled and built on the raspberry pi?

                  1 Reply Last reply Reply Quote 0
                  • J
                    jacobfk20
                    last edited by

                    @masteryoer You can! It'll work just fine :) That 32/64 bit update just allows the archive to be stored in something bigger than an 8 bit const char array.

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      masteryoer @jacobfk20
                      last edited by

                      @jacobfk20

                      I am an idiot, completely. It's late and i've been looking at code all day. So the problem, it appears, is that if you dont remove everything from your 'converted' folder before you run it, it tries to convert that stuff too, and it makes duplicates with the 16/32 bit stuff in it.

                      I deleted the entire folder and re-ran res2h, and it created the correct files, using the correct const unsigned char* like it's supposed to..

                      now to test if it works.

                      1 Reply Last reply Reply Quote 1
                      • M
                        masteryoer
                        last edited by

                        Okay, something is seriously wrong. That res2h application is not working, regardless of what you do. As soon as you change a resource and run the application to convert it, it breaks the entire source and it fails to compile. I've given up trying to figure out what's wrong with it.

                        1 Reply Last reply Reply Quote 0
                        • J
                          jacobfk20
                          last edited by

                          @masteryoer Well, good on ya for trying. Send me the file you want converted and I'll see if I can get it for ya.

                          M 1 Reply Last reply Reply Quote 0
                          • M
                            masteryoer @jacobfk20
                            last edited by

                            @jacobfk20

                            There would be more than one of them, I am just trying to test out how it would look. I am not sure how I want the UI to look yet, so it would be nice to compile it myself as I go along and make changes. It looks like there's the option to NOT compile into the source, but I am not sure how to enable that.

                            There are checks in the ResourcesUtil.cpp to see if the 'resources' were compiled in, and if not load them from the path.

                            M 1 Reply Last reply Reply Quote 0
                            • M
                              masteryoer @masteryoer
                              last edited by

                              @masteryoer if that's could be enabled somehow, I think it would make it a lot easier for me, as well as theme builders and modders, to include ES menu elements

                              1 Reply Last reply Reply Quote 0
                              • ohmycommodoreO
                                ohmycommodore
                                last edited by

                                Sure would be nice for the kids (and us old forgetful guys) to see a pic of the buttons we have to push :) Good idea, at least for those of us with PS controllers.

                                1 Reply Last reply Reply Quote 1
                                • J
                                  jacobfk20
                                  last edited by jacobfk20

                                  @masteryoer Use the Beta release 0.3.2. It outputs the headers and source identical to the original ES resources. This is the exact command I used as well.
                                  res2h resources converted -h Resources.h -u ResourceUtil.cpp -s
                                  *This was done in windows.

                                  It matched ES's original resource.h and resourceUtil.cpp exactly, though some files were in different orders.

                                  M 1 Reply Last reply Reply Quote 0
                                  • M
                                    masteryoer @jacobfk20
                                    last edited by

                                    @jacobfk20

                                    Okay, I will give that a try. Doesn't it compile for you?

                                    1 Reply Last reply Reply Quote 0
                                    • J
                                      jacobfk20
                                      last edited by

                                      I Haven't gotten that far yet :)

                                      M 1 Reply Last reply Reply Quote 0
                                      • J
                                        jacobfk20
                                        last edited by

                                        @masteryoer It compiled fine.
                                        I replaced the resources.h and resourceUtil.cpp with the newly generated ones and replaced all converted images.

                                        1 Reply Last reply Reply Quote 0
                                        • M
                                          masteryoer @jacobfk20
                                          last edited by

                                          @jacobfk20

                                          I got it!! Thanks for the help! (using your command, but there's t ypo it should be ResourceUtil.cpp not ResourcesUtil.cpp), and disabling Thumbs.db in windows, I was able to get a working build with my new UI changes in it

                                          Now I can continue to theme my xcade system :)

                                          1 Reply Last reply Reply Quote 1
                                          • J
                                            jacobfk20
                                            last edited by

                                            @masteryoer Glad you were able to get it :)

                                            So you used beta 0.3.2 right?

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.