├── .clang-format
├── .github
└── workflows
│ ├── ci.yml
│ └── pr.yml
├── .gitignore
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── data
├── fonts
│ └── font.ttf
├── images
│ ├── iconEmpty.png
│ ├── layoutSwitchButton.png
│ ├── leftArrow.png
│ ├── noGameIcon.png
│ ├── rightArrow.png
│ └── settingsButton.png
└── sounds
│ ├── bgMusic.ogg
│ ├── button_click.mp3
│ └── settings_click_2.mp3
├── filelist.sh
└── src
├── Application.cpp
├── Application.h
├── common
└── common.h
├── entry.cpp
├── fs
├── CFile.cpp
├── CFile.hpp
├── DirList.cpp
├── DirList.h
├── FSUtils.cpp
└── FSUtils.h
├── game
├── GameList.cpp
└── GameList.h
├── gui
├── GameIcon.cpp
├── GameIcon.h
├── GameIconModel.h
├── GuiIconGrid.cpp
├── GuiIconGrid.h
└── GuiTitleBrowser.h
├── menu
├── GameSplashScreen.cpp
├── GameSplashScreen.h
├── KeyboardHelper.cpp
├── KeyboardHelper.h
├── MainDrcButtonsFrame.h
├── MainWindow.cpp
└── MainWindow.h
├── resources
├── Resources.cpp
└── Resources.h
├── system
└── CThread.h
└── utils
├── AsyncExecutor.cpp
├── AsyncExecutor.h
├── StringTools.cpp
├── StringTools.h
├── logger.h
├── utils.c
└── utils.h
/.clang-format:
--------------------------------------------------------------------------------
1 | # Generated from CLion C/C++ Code Style settings
2 | BasedOnStyle: LLVM
3 | AccessModifierOffset: -4
4 | AlignAfterOpenBracket: Align
5 | AlignConsecutiveAssignments: Consecutive
6 | AlignConsecutiveMacros: AcrossEmptyLinesAndComments
7 | AlignOperands: Align
8 | AllowAllArgumentsOnNextLine: false
9 | AllowAllConstructorInitializersOnNextLine: false
10 | AllowAllParametersOfDeclarationOnNextLine: false
11 | AllowShortBlocksOnASingleLine: Always
12 | AllowShortCaseLabelsOnASingleLine: false
13 | AllowShortFunctionsOnASingleLine: All
14 | AllowShortIfStatementsOnASingleLine: Always
15 | AllowShortLambdasOnASingleLine: All
16 | AllowShortLoopsOnASingleLine: true
17 | AlwaysBreakAfterReturnType: None
18 | AlwaysBreakTemplateDeclarations: Yes
19 | BreakBeforeBraces: Custom
20 | BraceWrapping:
21 | AfterCaseLabel: false
22 | AfterClass: false
23 | AfterControlStatement: Never
24 | AfterEnum: false
25 | AfterFunction: false
26 | AfterNamespace: false
27 | AfterUnion: false
28 | BeforeCatch: false
29 | BeforeElse: false
30 | IndentBraces: false
31 | SplitEmptyFunction: false
32 | SplitEmptyRecord: true
33 | BreakBeforeBinaryOperators: None
34 | BreakBeforeTernaryOperators: true
35 | BreakConstructorInitializers: BeforeColon
36 | BreakInheritanceList: BeforeColon
37 | ColumnLimit: 0
38 | CompactNamespaces: false
39 | ContinuationIndentWidth: 8
40 | IndentCaseLabels: true
41 | IndentPPDirectives: None
42 | IndentWidth: 4
43 | KeepEmptyLinesAtTheStartOfBlocks: true
44 | MaxEmptyLinesToKeep: 2
45 | NamespaceIndentation: All
46 | ObjCSpaceAfterProperty: false
47 | ObjCSpaceBeforeProtocolList: true
48 | PointerAlignment: Right
49 | ReflowComments: false
50 | SpaceAfterCStyleCast: true
51 | SpaceAfterLogicalNot: false
52 | SpaceAfterTemplateKeyword: false
53 | SpaceBeforeAssignmentOperators: true
54 | SpaceBeforeCpp11BracedList: false
55 | SpaceBeforeCtorInitializerColon: true
56 | SpaceBeforeInheritanceColon: true
57 | SpaceBeforeParens: ControlStatements
58 | SpaceBeforeRangeBasedForLoopColon: true
59 | SpaceInEmptyParentheses: false
60 | SpacesBeforeTrailingComments: 1
61 | SpacesInAngles: false
62 | SpacesInCStyleCastParentheses: false
63 | SpacesInContainerLiterals: false
64 | SpacesInParentheses: false
65 | SpacesInSquareBrackets: false
66 | TabWidth: 4
67 | UseTab: Never
68 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI-Release
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 |
8 | jobs:
9 | clang-format:
10 | runs-on: ubuntu-18.04
11 | steps:
12 | - uses: actions/checkout@v2
13 | - name: clang-format
14 | run: |
15 | docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./src
16 | build-binary:
17 | runs-on: ubuntu-18.04
18 | needs: clang-format
19 | steps:
20 | - uses: actions/checkout@v2
21 | - name: build binary
22 | run: |
23 | docker build . -t builder
24 | docker run --rm -v ${PWD}:/project builder make
25 | - uses: actions/upload-artifact@master
26 | with:
27 | name: binary
28 | path: "*.rpx"
29 | deploy-binary:
30 | needs: build-binary
31 | runs-on: ubuntu-18.04
32 | steps:
33 | - name: Get environment variables
34 | id: get_repository_name
35 | run: |
36 | echo REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//") >> $GITHUB_ENV
37 | echo DATETIME=$(echo $(date '+%Y%m%d-%H%M%S')) >> $GITHUB_ENV
38 | - uses: actions/download-artifact@master
39 | with:
40 | name: binary
41 | path: wiiu
42 | - name: zip artifact
43 | run: zip -r ${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip wiiu
44 | - name: Create Release
45 | id: create_release
46 | uses: actions/create-release@v1
47 | env:
48 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49 | with:
50 | tag_name: ${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }}
51 | release_name: Nightly-${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }}
52 | draft: false
53 | prerelease: true
54 | body: |
55 | Not a stable release:
56 | ${{ github.event.head_commit.message }}
57 | - name: Upload Release Asset
58 | id: upload-release-asset
59 | uses: actions/upload-release-asset@v1
60 | env:
61 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62 | with:
63 | upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
64 | asset_path: ./${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip
65 | asset_name: ${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip
66 | asset_content_type: application/zip
--------------------------------------------------------------------------------
/.github/workflows/pr.yml:
--------------------------------------------------------------------------------
1 | name: CI-PR
2 |
3 | on: [pull_request]
4 |
5 | jobs:
6 | clang-format:
7 | runs-on: ubuntu-18.04
8 | steps:
9 | - uses: actions/checkout@v2
10 | - name: clang-format
11 | run: |
12 | docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./src
13 | build-binary:
14 | runs-on: ubuntu-18.04
15 | needs: clang-format
16 | steps:
17 | - uses: actions/checkout@v2
18 | - name: build binary
19 | run: |
20 | docker build . -t builder
21 | docker run --rm -v ${PWD}:/project builder make
22 | - uses: actions/upload-artifact@master
23 | with:
24 | name: binary
25 | path: "*.rpx"
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.cbp
2 | *.elf
3 | *.rpx
4 | build/
5 | src/resources/filelist.h
6 | *.save-failed
7 | launchiine.layout
8 | cmake-build-debug/
9 | .idea/
10 | CMakeLists.txt
11 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM wiiuenv/devkitppc:20211229
2 |
3 | COPY --from=wiiuenv/libgui:20220109 /artifacts $DEVKITPRO
4 |
5 | WORKDIR project
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | {project} Copyright (C) {year} {fullname}
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | #-------------------------------------------------------------------------------
2 | .SUFFIXES:
3 | #-------------------------------------------------------------------------------
4 |
5 | ifeq ($(strip $(DEVKITPRO)),)
6 | $(error "Please set DEVKITPRO in your environment. export DEVKITPRO=/devkitpro")
7 | endif
8 |
9 | TOPDIR ?= $(CURDIR)
10 |
11 | include $(DEVKITPRO)/wut/share/wut_rules
12 |
13 | #-------------------------------------------------------------------------------
14 | # TARGET is the name of the output
15 | # BUILD is the directory where object files & intermediate files will be placed
16 | # SOURCES is a list of directories containing source code
17 | # DATA is a list of directories containing data files
18 | # INCLUDES is a list of directories containing header files
19 | #-------------------------------------------------------------------------------
20 | TARGET := men
21 | BUILD := build
22 | SOURCES := src \
23 | src/fs \
24 | src/game \
25 | src/gui \
26 | src/menu \
27 | src/resources \
28 | src/system \
29 | src/utils
30 | DATA := data \
31 | data/images \
32 | data/sounds \
33 | data/fonts
34 | INCLUDES := src
35 |
36 | #-------------------------------------------------------------------------------
37 | # options for code generation
38 | #-------------------------------------------------------------------------------
39 | CFLAGS := -g -Wall -O2 -ffunction-sections \
40 | $(MACHDEP)
41 |
42 | CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__
43 |
44 | CXXFLAGS := $(CFLAGS)
45 |
46 | ASFLAGS := -g $(ARCH)
47 | LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map)
48 |
49 | LIBS := -lgui -lfreetype -lgd -lpng -ljpeg -lz -lmad -lvorbisidec -logg -lbz2 -lwut
50 |
51 | #-------------------------------------------------------------------------------
52 | # list of directories containing libraries, this must be the top level
53 | # containing include and lib
54 | #-------------------------------------------------------------------------------
55 | LIBDIRS := $(PORTLIBS) $(WUT_ROOT) $(WUT_ROOT)/usr
56 |
57 | #-------------------------------------------------------------------------------
58 | # no real need to edit anything past this point unless you need to add additional
59 | # rules for different file extensions
60 | #-------------------------------------------------------------------------------
61 | ifneq ($(BUILD),$(notdir $(CURDIR)))
62 | #-------------------------------------------------------------------------------
63 | FILELIST := $(shell bash ./filelist.sh)
64 | export OUTPUT := $(CURDIR)/$(TARGET)
65 | export TOPDIR := $(CURDIR)
66 |
67 | export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
68 | $(foreach dir,$(DATA),$(CURDIR)/$(dir))
69 |
70 | export DEPSDIR := $(CURDIR)/$(BUILD)
71 |
72 | CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
73 | CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
74 | SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
75 | BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
76 |
77 | #-------------------------------------------------------------------------------
78 | # use CXX for linking C++ projects, CC for standard C
79 | #-------------------------------------------------------------------------------
80 | ifeq ($(strip $(CPPFILES)),)
81 | #-------------------------------------------------------------------------------
82 | export LD := $(CC)
83 | #-------------------------------------------------------------------------------
84 | else
85 | #-------------------------------------------------------------------------------
86 | export LD := $(CXX)
87 | #-------------------------------------------------------------------------------
88 | endif
89 | #-------------------------------------------------------------------------------
90 |
91 | export OFILES_BIN := $(addsuffix .o,$(BINFILES))
92 | export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
93 | export OFILES := $(OFILES_BIN) $(OFILES_SRC)
94 | export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES)))
95 |
96 | export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
97 | $(foreach dir,$(LIBDIRS),-I$(dir)/include) \
98 | -I$(CURDIR)/$(BUILD) -I$(PORTLIBS_PATH)/ppc/include/freetype2
99 |
100 | export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
101 |
102 | .PHONY: $(BUILD) clean all
103 |
104 | #-------------------------------------------------------------------------------
105 | all: $(BUILD)
106 |
107 | $(BUILD):
108 | @[ -d $@ ] || mkdir -p $@
109 | @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
110 |
111 | #-------------------------------------------------------------------------------
112 | clean:
113 | @echo clean ...
114 | @rm -fr $(BUILD) $(TARGET).rpx $(TARGET).elf
115 |
116 | #-------------------------------------------------------------------------------
117 | else
118 | .PHONY: all
119 |
120 | DEPENDS := $(OFILES:.o=.d)
121 |
122 | #-------------------------------------------------------------------------------
123 | # main targets
124 | #-------------------------------------------------------------------------------
125 | all : $(OUTPUT).rpx
126 |
127 | $(OUTPUT).rpx : $(OUTPUT).elf
128 | $(OUTPUT).elf : $(OFILES)
129 |
130 | $(OFILES_SRC) : $(HFILES_BIN)
131 |
132 | #-------------------------------------------------------------------------------
133 | # you need a rule like this for each extension you use as binary data
134 | #-------------------------------------------------------------------------------
135 | %.bin.o %_bin.h : %.bin
136 | @echo $(notdir $<)
137 | @$(bin2o)
138 |
139 | %.png.o %_png.h : %.png
140 | @echo $(notdir $<)
141 | @$(bin2o)
142 |
143 | %.jpg.o %_jpg.h : %.jpg
144 | @echo $(notdir $<)
145 | @$(bin2o)
146 |
147 | %.ogg.o %_ogg.h : %.ogg
148 | @echo $(notdir $<)
149 | @$(bin2o)
150 |
151 | %.mp3.o %_mp3.h : %.mp3
152 | @echo $(notdir $<)
153 | @$(bin2o)
154 |
155 | %.ttf.o %_ttf.h : %.ttf
156 | @echo $(notdir $<)
157 | @$(bin2o)
158 |
159 |
160 | -include $(DEPENDS)
161 |
162 | #-------------------------------------------------------------------------------
163 | endif
164 | #-------------------------------------------------------------------------------
165 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Launchiine (WIP)
2 |
3 | A simple Wii U Menu replacement, still in early development and not ready for a day to day usage
4 |
5 | ## Usage (Replace Wii U Menu via Mocha Payload):
6 | ([ENVIRONMENT] is a placeholder for the actual environment name.)
7 | - Place the `men.rpx` on the sd card in the directory `sd:/wiiu/environments/[ENVIRONMENT]/`.
8 | - Load the [MochaPayload](https://github.com/wiiu-env/MochaPayload) via the [EnvironmentLoader](https://github.com/wiiu-env/EnvironmentLoader) (e.g. [Tiramisu](https://github.com/wiiu-env/Tiramisu))
9 | - Load the Wii U Menu and launchiine should show up instead.
10 |
11 | ## Known Issues
12 | - Random crashes
13 | - The Keyboard input is implemented, but result is ignored.
14 | - nn::spm is not initalized and no quick start menu support. For the it's relying on the [AutobootModule](https://github.com/wiiu-env/AutobootModule) doing this.
15 | - No sound on splash screen.
16 | - Probably a lot more
17 |
18 | ## TODOs
19 | - Non-touch controls
20 | - Sound on splashscreen
21 | - Folder support
22 | - Preserve app order after closing/opening launchiine.
23 | - Display applets like the original Wii U Menu
24 | - Implement Account selection when no default account is set.
25 | - Implement update check/no way to update games
26 | - Properly implement nn::spm and nn:sl (external storage and quick start menu)
27 | - Fix search
28 | - Implement all the other stuff the Wii U Menu offers (Account creationg, switching between Accounts, set default account etc.)
29 | - Implement ways to launch the original Wii U Menu.
30 |
31 | ## Building
32 | Install the following dependencies:
33 | - [wut](https://github.com/devkitPro/wut)
34 | - [libgui](https://github.com/wiiu-env/libgui)
35 |
36 | Then build via `make`.
37 |
38 | ## Building using the Dockerfile
39 |
40 | It's possible to use a docker image for building. This way you don't need anything installed on your host system.
41 |
42 | ```
43 | # Build docker image (only needed once)
44 | docker build . -t launchiine-builder
45 |
46 | # make
47 | docker run -it --rm -v ${PWD}:/project launchiine-builder make
48 |
49 | # make clean
50 | docker run -it --rm -v ${PWD}:/project launchiine-builder make clean
51 | ```
52 |
--------------------------------------------------------------------------------
/data/fonts/font.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wiiu-env/launchiine/bd31cbe4f4487851e6a2aa79ad30fba5b73107d3/data/fonts/font.ttf
--------------------------------------------------------------------------------
/data/images/iconEmpty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wiiu-env/launchiine/bd31cbe4f4487851e6a2aa79ad30fba5b73107d3/data/images/iconEmpty.png
--------------------------------------------------------------------------------
/data/images/layoutSwitchButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wiiu-env/launchiine/bd31cbe4f4487851e6a2aa79ad30fba5b73107d3/data/images/layoutSwitchButton.png
--------------------------------------------------------------------------------
/data/images/leftArrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wiiu-env/launchiine/bd31cbe4f4487851e6a2aa79ad30fba5b73107d3/data/images/leftArrow.png
--------------------------------------------------------------------------------
/data/images/noGameIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wiiu-env/launchiine/bd31cbe4f4487851e6a2aa79ad30fba5b73107d3/data/images/noGameIcon.png
--------------------------------------------------------------------------------
/data/images/rightArrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wiiu-env/launchiine/bd31cbe4f4487851e6a2aa79ad30fba5b73107d3/data/images/rightArrow.png
--------------------------------------------------------------------------------
/data/images/settingsButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wiiu-env/launchiine/bd31cbe4f4487851e6a2aa79ad30fba5b73107d3/data/images/settingsButton.png
--------------------------------------------------------------------------------
/data/sounds/bgMusic.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wiiu-env/launchiine/bd31cbe4f4487851e6a2aa79ad30fba5b73107d3/data/sounds/bgMusic.ogg
--------------------------------------------------------------------------------
/data/sounds/button_click.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wiiu-env/launchiine/bd31cbe4f4487851e6a2aa79ad30fba5b73107d3/data/sounds/button_click.mp3
--------------------------------------------------------------------------------
/data/sounds/settings_click_2.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wiiu-env/launchiine/bd31cbe4f4487851e6a2aa79ad30fba5b73107d3/data/sounds/settings_click_2.mp3
--------------------------------------------------------------------------------
/filelist.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 | #
3 | # Automatic resource file list generation
4 | # Created by Dimok
5 |
6 | outFile="./src/resources/filelist.h"
7 | count_old=$(cat $outFile 2>/dev/null | tr -d '\n\n' | sed 's/[^0-9]*\([0-9]*\).*/\1/')
8 |
9 | count=0
10 | if [[ $OSTYPE == darwin* ]];
11 | then
12 |
13 | for i in $(gfind ./data/images/ ./data/sounds/ ./data/fonts/ -maxdepth 1 -type f \( ! -printf "%f\n" \) | sort -f)
14 | do
15 | files[count]=$i
16 | count=$((count+1))
17 | done
18 |
19 | else
20 |
21 | for i in $(find ./data/images/ ./data/sounds/ ./data/fonts/ -maxdepth 1 -type f \( ! -printf "%f\n" \) | sort -f)
22 | do
23 | files[count]=$i
24 | count=$((count+1))
25 | done
26 |
27 | fi
28 |
29 | if [ "$count_old" != "$count" ] || [ ! -f $outFile ]
30 | then
31 |
32 | echo "Generating filelist.h for $count files." >&2
33 | cat < $outFile
34 | /****************************************************************************
35 | * Resource files.
36 | * This file is generated automatically.
37 | * Includes $count files.
38 | *
39 | * NOTE:
40 | * Any manual modification of this file will be overwriten by the generation.
41 | ****************************************************************************/
42 | #ifndef _FILELIST_H_
43 | #define _FILELIST_H_
44 |
45 | typedef struct _RecourceFile
46 | {
47 | const char *filename;
48 | const unsigned char *DefaultFile;
49 | const unsigned int &DefaultFileSize;
50 | unsigned char *CustomFile;
51 | unsigned int CustomFileSize;
52 | } RecourceFile;
53 |
54 | EOF
55 |
56 | for i in ${files[@]}
57 | do
58 | filename=${i%.*}
59 | extension=${i##*.}
60 | echo '#include "'$filename'_'$extension'.h"' >> $outFile
61 | done
62 |
63 | echo '' >> $outFile
64 | echo 'static RecourceFile RecourceList[] =' >> $outFile
65 | echo '{' >> $outFile
66 |
67 | for i in ${files[@]}
68 | do
69 | filename=${i%.*}
70 | extension=${i##*.}
71 | echo -e '\t{"'$i'", '$filename'_'$extension', '$filename'_'$extension'_size, NULL, 0},' >> $outFile
72 | done
73 |
74 | echo -e '\t{NULL, NULL, 0, NULL, 0}' >> $outFile
75 | echo '};' >> $outFile
76 |
77 | echo '' >> $outFile
78 | echo '#endif' >> $outFile
79 |
80 | fi
81 |
--------------------------------------------------------------------------------
/src/Application.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | * Copyright (C) 2015 Dimok
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ****************************************************************************/
17 | #include "Application.h"
18 | #include "common/common.h"
19 | #include "resources/Resources.h"
20 | #include "utils/AsyncExecutor.h"
21 | #include "utils/logger.h"
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
30 | #include
31 | #include
32 | #include
33 |
34 | Application *Application::applicationInstance = nullptr;
35 | bool Application::exitApplication = false;
36 | bool Application::quitRequest = false;
37 |
38 | Application::Application()
39 | : CThread(CThread::eAttributeAffCore1 | CThread::eAttributePinnedAff, 0, 0x800000), bgMusic(nullptr), video(nullptr), mainWindow(nullptr), fontSystem(nullptr), exitCode(0) {
40 | controller[0] = new VPadController(GuiTrigger::CHANNEL_1);
41 | controller[1] = new WPadController(GuiTrigger::CHANNEL_2);
42 | controller[2] = new WPadController(GuiTrigger::CHANNEL_3);
43 | controller[3] = new WPadController(GuiTrigger::CHANNEL_4);
44 | controller[4] = new WPadController(GuiTrigger::CHANNEL_5);
45 |
46 | //! create bgMusic
47 | bgMusic = new GuiSound(Resources::GetFile("bgMusic.ogg"), Resources::GetFileSize("bgMusic.ogg"));
48 | bgMusic->SetLoop(true);
49 | bgMusic->Play();
50 | bgMusic->SetVolume(50);
51 |
52 | AsyncExecutor::execute([] { DEBUG_FUNCTION_LINE("Hello"); });
53 |
54 | exitApplication = false;
55 |
56 | ProcUIInit(OSSavesDone_ReadyToRelease);
57 | }
58 |
59 | Application::~Application() {
60 | DEBUG_FUNCTION_LINE("Destroy music");
61 | delete bgMusic;
62 |
63 | DEBUG_FUNCTION_LINE("Destroy controller");
64 |
65 | for (auto &i : controller) {
66 | delete i;
67 | }
68 |
69 | DEBUG_FUNCTION_LINE("Clear resources");
70 | Resources::Clear();
71 |
72 | DEBUG_FUNCTION_LINE("Stop sound handler");
73 | SoundHandler::DestroyInstance();
74 |
75 | DEBUG_FUNCTION_LINE("Clear AsyncExecutor");
76 | AsyncExecutor::destroyInstance();
77 |
78 | ProcUIShutdown();
79 | }
80 |
81 | int32_t Application::exec() {
82 | //! start main GX2 thread
83 | resumeThread();
84 | //! now wait for thread to finish
85 | shutdownThread();
86 |
87 | return exitCode;
88 | }
89 |
90 | void Application::quit(int32_t code) {
91 | exitCode = code;
92 | exitApplication = true;
93 | quitRequest = true;
94 | }
95 |
96 | void Application::fadeOut() {
97 | GuiImage fadeOut(video->getTvWidth(), video->getTvHeight(), (GX2Color){0, 0, 0, 255});
98 |
99 | for (int32_t i = 0; i < 255; i += 10) {
100 | if (i > 255)
101 | i = 255;
102 |
103 | fadeOut.setAlpha(i / 255.0f);
104 |
105 | //! start rendering DRC
106 | video->prepareDrcRendering();
107 | mainWindow->drawDrc(video);
108 |
109 | GX2SetDepthOnlyControl(GX2_DISABLE, GX2_DISABLE, GX2_COMPARE_FUNC_ALWAYS);
110 | fadeOut.draw(video);
111 | GX2SetDepthOnlyControl(GX2_ENABLE, GX2_ENABLE, GX2_COMPARE_FUNC_LEQUAL);
112 |
113 | video->drcDrawDone();
114 |
115 | //! start rendering TV
116 | video->prepareTvRendering();
117 |
118 | mainWindow->drawTv(video);
119 |
120 | GX2SetDepthOnlyControl(GX2_DISABLE, GX2_DISABLE, GX2_COMPARE_FUNC_ALWAYS);
121 | fadeOut.draw(video);
122 | GX2SetDepthOnlyControl(GX2_ENABLE, GX2_ENABLE, GX2_COMPARE_FUNC_LEQUAL);
123 |
124 | video->tvDrawDone();
125 |
126 | //! as last point update the effects as it can drop elements
127 | mainWindow->updateEffects();
128 |
129 | video->waitForVSync();
130 | }
131 | }
132 |
133 | bool Application::procUI() {
134 | bool executeProcess = false;
135 |
136 | switch (ProcUIProcessMessages(true)) {
137 | case PROCUI_STATUS_EXITING: {
138 | DEBUG_FUNCTION_LINE("PROCUI_STATUS_EXITING");
139 | exitCode = EXIT_SUCCESS;
140 | exitApplication = true;
141 | break;
142 | }
143 | case PROCUI_STATUS_RELEASE_FOREGROUND: {
144 | DEBUG_FUNCTION_LINE("PROCUI_STATUS_RELEASE_FOREGROUND");
145 | if (video != nullptr) {
146 | // we can turn ofF the screen but we don't need to and it will display the last image
147 | video->tvEnable(true);
148 | video->drcEnable(true);
149 |
150 | DEBUG_FUNCTION_LINE("delete fontSystem");
151 | delete fontSystem;
152 | fontSystem = nullptr;
153 |
154 | DEBUG_FUNCTION_LINE("delete video");
155 | delete video;
156 | video = nullptr;
157 |
158 | DEBUG_FUNCTION_LINE("deinitialze memory");
159 | libgui_memoryRelease();
160 | ProcUIDrawDoneRelease();
161 | } else {
162 | ProcUIDrawDoneRelease();
163 | }
164 | break;
165 | }
166 | case PROCUI_STATUS_IN_FOREGROUND: {
167 | if (!quitRequest) {
168 | if (video == nullptr) {
169 | DEBUG_FUNCTION_LINE("PROCUI_STATUS_IN_FOREGROUND");
170 | DEBUG_FUNCTION_LINE("initialze memory");
171 | libgui_memoryInitialize();
172 |
173 | DEBUG_FUNCTION_LINE("Initialize video");
174 | video = new CVideo(GX2_TV_SCAN_MODE_720P, GX2_DRC_RENDER_MODE_SINGLE);
175 | DEBUG_FUNCTION_LINE("Video size %i x %i", video->getTvWidth(), video->getTvHeight());
176 |
177 | //! setup default Font
178 | DEBUG_FUNCTION_LINE("Initialize main font system");
179 | auto *fontSystem = new FreeTypeGX(Resources::GetFile("font.ttf"), Resources::GetFileSize("font.ttf"), true);
180 | GuiText::setPresetFont(fontSystem);
181 |
182 | if (mainWindow == nullptr) {
183 | DEBUG_FUNCTION_LINE("Initialize main window");
184 | mainWindow = new MainWindow(video->getTvWidth(), video->getTvHeight());
185 | }
186 | }
187 | executeProcess = true;
188 | }
189 | break;
190 | }
191 | case PROCUI_STATUS_IN_BACKGROUND:
192 | default:
193 | break;
194 | }
195 |
196 | return executeProcess;
197 | }
198 |
199 | void Application::executeThread() {
200 | DEBUG_FUNCTION_LINE("Entering main loop");
201 |
202 | //! main GX2 loop (60 Hz cycle with max priority on core 1)
203 | while (!exitApplication) {
204 | if (!procUI()) {
205 | continue;
206 | }
207 |
208 | mainWindow->lockGUI();
209 | mainWindow->process();
210 |
211 | //! Read out inputs
212 | for (auto &i : controller) {
213 | if (!i->update(video->getTvWidth(), video->getTvHeight()))
214 | continue;
215 |
216 | //! update controller states
217 | mainWindow->update(i);
218 | }
219 |
220 | //! start rendering DRC
221 | video->prepareDrcRendering();
222 | mainWindow->drawDrc(video);
223 | video->drcDrawDone();
224 |
225 | //! start rendering TV
226 | video->prepareTvRendering();
227 | mainWindow->drawTv(video);
228 | video->tvDrawDone();
229 |
230 | //! enable screen after first frame render
231 | if (video->getFrameCount() == 0) {
232 | video->tvEnable(true);
233 | video->drcEnable(true);
234 | }
235 |
236 | //! as last point update the effects as it can drop elements
237 | mainWindow->updateEffects();
238 | mainWindow->unlockGUI();
239 |
240 | video->waitForVSync();
241 | }
242 |
243 | if (bgMusic) {
244 | bgMusic->SetVolume(0);
245 | }
246 |
247 | DEBUG_FUNCTION_LINE("delete mainWindow");
248 | delete mainWindow;
249 | mainWindow = nullptr;
250 |
251 | DEBUG_FUNCTION_LINE("delete fontSystem");
252 | delete fontSystem;
253 | fontSystem = nullptr;
254 |
255 | DEBUG_FUNCTION_LINE("delete video");
256 | delete video;
257 | video = nullptr;
258 |
259 | DEBUG_FUNCTION_LINE("deinitialize memory");
260 | libgui_memoryRelease();
261 | }
262 |
--------------------------------------------------------------------------------
/src/Application.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | * Copyright (C) 2015 Dimok
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ****************************************************************************/
17 | #ifndef _APPLICATION_H
18 | #define _APPLICATION_H
19 |
20 | #include "menu/MainWindow.h"
21 | #include "system/CThread.h"
22 | #include
23 |
24 | // forward declaration
25 | class FreeTypeGX;
26 |
27 | class Application : public CThread {
28 | public:
29 | static Application *instance() {
30 | if (!applicationInstance)
31 | applicationInstance = new Application();
32 | return applicationInstance;
33 | }
34 |
35 | static void destroyInstance() {
36 | if (applicationInstance) {
37 | delete applicationInstance;
38 | applicationInstance = nullptr;
39 | }
40 | }
41 |
42 | CVideo *getVideo(void) const {
43 | return video;
44 | }
45 |
46 | MainWindow *getMainWindow(void) const {
47 | return mainWindow;
48 | }
49 |
50 | GuiSound *getBgMusic(void) const {
51 | return bgMusic;
52 | }
53 |
54 | int exec(void);
55 |
56 | void fadeOut(void);
57 |
58 | void quit(int code);
59 |
60 | private:
61 | Application();
62 |
63 | virtual ~Application();
64 |
65 | bool procUI(void);
66 |
67 | static Application *applicationInstance;
68 | static bool exitApplication;
69 | static bool quitRequest;
70 |
71 | void executeThread(void);
72 |
73 | GuiSound *bgMusic;
74 | CVideo *video;
75 | MainWindow *mainWindow;
76 | FreeTypeGX *fontSystem;
77 | GuiController *controller[5]{};
78 | int exitCode;
79 | BOOL sFromHBL = FALSE;
80 | };
81 |
82 | #endif //_APPLICATION_H
83 |
--------------------------------------------------------------------------------
/src/common/common.h:
--------------------------------------------------------------------------------
1 | #ifndef COMMON_H
2 | #define COMMON_H
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | #define LAUNCHIINE_VERSION "v0.1"
9 | #define META_PATH "/meta"
10 |
11 | #ifdef __cplusplus
12 | }
13 | #endif
14 |
15 | #endif /* COMMON_H */
16 |
--------------------------------------------------------------------------------
/src/entry.cpp:
--------------------------------------------------------------------------------
1 | #include "Application.h"
2 | #include "common/common.h"
3 | #include "utils/logger.h"
4 | #include
5 | #include
6 | #include
7 |
8 | int32_t main(int32_t argc, char **argv) {
9 | bool moduleInit;
10 | bool cafeInit = false;
11 | bool udpInit = false;
12 |
13 | if (!(moduleInit = WHBLogModuleInit())) {
14 | cafeInit = WHBLogCafeInit();
15 | udpInit = WHBLogUdpInit();
16 | }
17 | DEBUG_FUNCTION_LINE("Starting launchiine " LAUNCHIINE_VERSION "");
18 |
19 | DEBUG_FUNCTION_LINE("Start main application");
20 | Application::instance()->exec();
21 |
22 | DEBUG_FUNCTION_LINE("Main application stopped");
23 | Application::destroyInstance();
24 |
25 | DEBUG_FUNCTION_LINE("Peace out...");
26 |
27 | if (cafeInit) {
28 | WHBLogCafeDeinit();
29 | }
30 |
31 | if (udpInit) {
32 | WHBLogUdpDeinit();
33 | }
34 |
35 | if (moduleInit) {
36 | WHBLogModuleDeinit();
37 | }
38 | return 0;
39 | }
40 |
--------------------------------------------------------------------------------
/src/fs/CFile.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | CFile::CFile() {
9 | iFd = -1;
10 | mem_file = nullptr;
11 | filesize = 0;
12 | pos = 0;
13 | }
14 |
15 | CFile::CFile(const std::string &filepath, eOpenTypes mode) {
16 | iFd = -1;
17 | this->open(filepath, mode);
18 | }
19 |
20 | CFile::CFile(const uint8_t *mem, int32_t size) {
21 | iFd = -1;
22 | this->open(mem, size);
23 | }
24 |
25 | CFile::~CFile() {
26 | this->close();
27 | }
28 |
29 | int32_t CFile::open(const std::string &filepath, eOpenTypes mode) {
30 | this->close();
31 | int32_t openMode = 0;
32 |
33 | // This depend on the devoptab implementation.
34 | // see https://github.com/devkitPro/wut/blob/master/libraries/wutdevoptab/devoptab_fs_open.c#L21 fpr reference
35 |
36 | switch (mode) {
37 | default:
38 | case ReadOnly: // file must exist
39 | openMode = O_RDONLY;
40 | break;
41 | case WriteOnly: // file will be created / zerod
42 | openMode = O_TRUNC | O_CREAT | O_WRONLY;
43 | break;
44 | case ReadWrite: // file must exist
45 | openMode = O_RDWR;
46 | break;
47 | case Append: // append to file, file will be created if missing. write only
48 | openMode = O_CREAT | O_APPEND | O_WRONLY;
49 | break;
50 | }
51 |
52 | //! Using fopen works only on the first launch as expected
53 | //! on the second launch it causes issues because we don't overwrite
54 | //! the .data sections which is needed for a normal application to re-init
55 | //! this will be added with launching as RPX
56 | iFd = ::open(filepath.c_str(), openMode);
57 | if (iFd < 0)
58 | return iFd;
59 |
60 |
61 | filesize = ::lseek(iFd, 0, SEEK_END);
62 | ::lseek(iFd, 0, SEEK_SET);
63 |
64 | return 0;
65 | }
66 |
67 | int32_t CFile::open(const uint8_t *mem, int32_t size) {
68 | this->close();
69 |
70 | mem_file = mem;
71 | filesize = size;
72 |
73 | return 0;
74 | }
75 |
76 | void CFile::close() {
77 | if (iFd >= 0)
78 | ::close(iFd);
79 |
80 | iFd = -1;
81 | mem_file = nullptr;
82 | filesize = 0;
83 | pos = 0;
84 | }
85 |
86 | int32_t CFile::read(uint8_t *ptr, size_t size) {
87 | if (iFd >= 0) {
88 | int32_t ret = ::read(iFd, ptr, size);
89 | if (ret > 0)
90 | pos += ret;
91 | return ret;
92 | }
93 |
94 | int32_t readsize = size;
95 |
96 | if (readsize > (int64_t) (filesize - pos))
97 | readsize = filesize - pos;
98 |
99 | if (readsize <= 0)
100 | return readsize;
101 |
102 | if (mem_file != nullptr) {
103 | memcpy(ptr, mem_file + pos, readsize);
104 | pos += readsize;
105 | return readsize;
106 | }
107 |
108 | return -1;
109 | }
110 |
111 | int32_t CFile::write(const uint8_t *ptr, size_t size) {
112 | if (iFd >= 0) {
113 | size_t done = 0;
114 | while (done < size) {
115 | int32_t ret = ::write(iFd, ptr, size - done);
116 | if (ret <= 0)
117 | return ret;
118 |
119 | ptr += ret;
120 | done += ret;
121 | pos += ret;
122 | }
123 | return done;
124 | }
125 |
126 | return -1;
127 | }
128 |
129 | int32_t CFile::seek(long int offset, int32_t origin) {
130 | int32_t ret = 0;
131 | int64_t newPos = pos;
132 |
133 | if (origin == SEEK_SET) {
134 | newPos = offset;
135 | } else if (origin == SEEK_CUR) {
136 | newPos += offset;
137 | } else if (origin == SEEK_END) {
138 | newPos = filesize + offset;
139 | }
140 |
141 | if (newPos < 0) {
142 | pos = 0;
143 | } else {
144 | pos = newPos;
145 | }
146 |
147 | if (iFd >= 0)
148 | ret = ::lseek(iFd, pos, SEEK_SET);
149 |
150 | if (mem_file != nullptr) {
151 | if (pos > filesize) {
152 | pos = filesize;
153 | }
154 | }
155 |
156 | return ret;
157 | }
158 |
159 | int32_t CFile::fwrite(const char *format, ...) {
160 | char tmp[512];
161 | tmp[0] = 0;
162 | int32_t result = -1;
163 |
164 | va_list va;
165 | va_start(va, format);
166 | if ((vsprintf(tmp, format, va) >= 0)) {
167 | result = this->write((uint8_t *) tmp, strlen(tmp));
168 | }
169 | va_end(va);
170 |
171 |
172 | return result;
173 | }
174 |
--------------------------------------------------------------------------------
/src/fs/CFile.hpp:
--------------------------------------------------------------------------------
1 | #ifndef CFILE_HPP_
2 | #define CFILE_HPP_
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 |
11 | class CFile {
12 | public:
13 | enum eOpenTypes {
14 | ReadOnly,
15 | WriteOnly,
16 | ReadWrite,
17 | Append
18 | };
19 |
20 | CFile();
21 |
22 | CFile(const std::string &filepath, eOpenTypes mode);
23 |
24 | CFile(const uint8_t *memory, int32_t memsize);
25 |
26 | virtual ~CFile();
27 |
28 | int32_t open(const std::string &filepath, eOpenTypes mode);
29 |
30 | int32_t open(const uint8_t *memory, int32_t memsize);
31 |
32 | BOOL isOpen() const {
33 | if (iFd >= 0)
34 | return true;
35 |
36 | if (mem_file)
37 | return true;
38 |
39 | return false;
40 | }
41 |
42 | void close();
43 |
44 | int32_t read(uint8_t *ptr, size_t size);
45 |
46 | int32_t write(const uint8_t *ptr, size_t size);
47 |
48 | int32_t fwrite(const char *format, ...);
49 |
50 | int32_t seek(long int offset, int32_t origin);
51 |
52 | uint64_t tell() {
53 | return pos;
54 | };
55 |
56 | uint64_t size() {
57 | return filesize;
58 | };
59 |
60 | void rewind() {
61 | this->seek(0, SEEK_SET);
62 | };
63 |
64 | protected:
65 | int32_t iFd;
66 | const uint8_t *mem_file;
67 | uint64_t filesize;
68 | uint64_t pos;
69 | };
70 |
71 | #endif
72 |
--------------------------------------------------------------------------------
/src/fs/DirList.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | * Copyright (C) 2010
3 | * by Dimok
4 | *
5 | * This software is provided 'as-is', without any express or implied
6 | * warranty. In no event will the authors be held liable for any
7 | * damages arising from the use of this software.
8 | *
9 | * Permission is granted to anyone to use this software for any
10 | * purpose, including commercial applications, and to alter it and
11 | * redistribute it freely, subject to the following restrictions:
12 | *
13 | * 1. The origin of this software must not be misrepresented; you
14 | * must not claim that you wrote the original software. If you use
15 | * this software in a product, an acknowledgment in the product
16 | * documentation would be appreciated but is not required.
17 | *
18 | * 2. Altered source versions must be plainly marked as such, and
19 | * must not be misrepresented as being the original software.
20 | *
21 | * 3. This notice may not be removed or altered from any source
22 | * distribution.
23 | *
24 | * DirList Class
25 | * for WiiXplorer 2010
26 | ***************************************************************************/
27 | #include
28 | #include
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 | #include
35 |
36 | #include
37 | #include
38 |
39 | DirList::DirList() {
40 | Flags = 0;
41 | Filter = 0;
42 | Depth = 0;
43 | }
44 |
45 | DirList::DirList(const std::string &path, const char *filter, uint32_t flags, uint32_t maxDepth) {
46 | this->LoadPath(path, filter, flags, maxDepth);
47 | this->SortList();
48 | }
49 |
50 | DirList::~DirList() {
51 | ClearList();
52 | }
53 |
54 | BOOL DirList::LoadPath(const std::string &folder, const char *filter, uint32_t flags, uint32_t maxDepth) {
55 | if (folder.empty())
56 | return false;
57 |
58 | Flags = flags;
59 | Filter = filter;
60 | Depth = maxDepth;
61 |
62 | std::string folderpath(folder);
63 | uint32_t length = folderpath.size();
64 |
65 | //! clear path of double slashes
66 | StringTools::RemoveDoubleSlashs(folderpath);
67 |
68 | //! remove last slash if exists
69 | if (length > 0 && folderpath[length - 1] == '/')
70 | folderpath.erase(length - 1);
71 |
72 | //! add root slash if missing
73 | if (folderpath.find('/') == std::string::npos) {
74 | folderpath += '/';
75 | }
76 |
77 | return InternalLoadPath(folderpath);
78 | }
79 |
80 | BOOL DirList::InternalLoadPath(std::string &folderpath) {
81 | if (folderpath.size() < 3)
82 | return false;
83 |
84 | struct dirent *dirent = nullptr;
85 | DIR *dir = nullptr;
86 |
87 | dir = opendir(folderpath.c_str());
88 | if (dir == nullptr)
89 | return false;
90 |
91 | while ((dirent = readdir(dir)) != 0) {
92 | BOOL isDir = dirent->d_type & DT_DIR;
93 | const char *filename = dirent->d_name;
94 |
95 | if (isDir) {
96 | if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0)
97 | continue;
98 |
99 | if ((Flags & CheckSubfolders) && (Depth > 0)) {
100 | int32_t length = folderpath.size();
101 | if (length > 2 && folderpath[length - 1] != '/') {
102 | folderpath += '/';
103 | }
104 | folderpath += filename;
105 |
106 | Depth--;
107 | InternalLoadPath(folderpath);
108 | folderpath.erase(length);
109 | Depth++;
110 | }
111 |
112 | if (!(Flags & Dirs))
113 | continue;
114 | } else if (!(Flags & Files)) {
115 | continue;
116 | }
117 |
118 | if (Filter) {
119 | char *fileext = strrchr(filename, '.');
120 | if (!fileext)
121 | continue;
122 |
123 | if (StringTools::strtokcmp(fileext, Filter, ",") == 0)
124 | AddEntrie(folderpath, filename, isDir);
125 | } else {
126 | AddEntrie(folderpath, filename, isDir);
127 | }
128 | }
129 | closedir(dir);
130 |
131 | return true;
132 | }
133 |
134 | void DirList::AddEntrie(const std::string &filepath, const char *filename, BOOL isDir) {
135 | if (!filename)
136 | return;
137 |
138 | int32_t pos = FileInfo.size();
139 |
140 | FileInfo.resize(pos + 1);
141 |
142 | FileInfo[pos].FilePath = (char *) malloc(filepath.size() + strlen(filename) + 2);
143 | if (!FileInfo[pos].FilePath) {
144 | FileInfo.resize(pos);
145 | return;
146 | }
147 |
148 | sprintf(FileInfo[pos].FilePath, "%s/%s", filepath.c_str(), filename);
149 | FileInfo[pos].isDir = isDir;
150 | }
151 |
152 | void DirList::ClearList() {
153 | for (uint32_t i = 0; i < FileInfo.size(); ++i) {
154 | if (FileInfo[i].FilePath) {
155 | free(FileInfo[i].FilePath);
156 | FileInfo[i].FilePath = nullptr;
157 | }
158 | }
159 |
160 | FileInfo.clear();
161 | std::vector().swap(FileInfo);
162 | }
163 |
164 | const char *DirList::GetFilename(int32_t ind) const {
165 | if (!valid(ind))
166 | return "";
167 |
168 | return StringTools::FullpathToFilename(FileInfo[ind].FilePath);
169 | }
170 |
171 | static BOOL SortCallback(const DirEntry &f1, const DirEntry &f2) {
172 | if (f1.isDir && !(f2.isDir))
173 | return true;
174 | if (!(f1.isDir) && f2.isDir)
175 | return false;
176 |
177 | if (f1.FilePath && !f2.FilePath)
178 | return true;
179 | if (!f1.FilePath)
180 | return false;
181 |
182 | if (strcasecmp(f1.FilePath, f2.FilePath) > 0)
183 | return false;
184 |
185 | return true;
186 | }
187 |
188 | void DirList::SortList() {
189 | if (FileInfo.size() > 1)
190 | std::sort(FileInfo.begin(), FileInfo.end(), SortCallback);
191 | }
192 |
193 | void DirList::SortList(BOOL (*SortFunc)(const DirEntry &a, const DirEntry &b)) {
194 | if (FileInfo.size() > 1)
195 | std::sort(FileInfo.begin(), FileInfo.end(), SortFunc);
196 | }
197 |
198 | uint64_t DirList::GetFilesize(int32_t index) const {
199 | struct stat st;
200 | const char *path = GetFilepath(index);
201 |
202 | if (!path || stat(path, &st) != 0)
203 | return 0;
204 |
205 | return st.st_size;
206 | }
207 |
208 | int32_t DirList::GetFileIndex(const char *filename) const {
209 | if (!filename)
210 | return -1;
211 |
212 | for (uint32_t i = 0; i < FileInfo.size(); ++i) {
213 | if (strcasecmp(GetFilename(i), filename) == 0)
214 | return i;
215 | }
216 |
217 | return -1;
218 | }
219 |
--------------------------------------------------------------------------------
/src/fs/DirList.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | * Copyright (C) 2010
3 | * by Dimok
4 | *
5 | * This software is provided 'as-is', without any express or implied
6 | * warranty. In no event will the authors be held liable for any
7 | * damages arising from the use of this software.
8 | *
9 | * Permission is granted to anyone to use this software for any
10 | * purpose, including commercial applications, and to alter it and
11 | * redistribute it freely, subject to the following restrictions:
12 | *
13 | * 1. The origin of this software must not be misrepresented; you
14 | * must not claim that you wrote the original software. If you use
15 | * this software in a product, an acknowledgment in the product
16 | * documentation would be appreciated but is not required.
17 | *
18 | * 2. Altered source versions must be plainly marked as such, and
19 | * must not be misrepresented as being the original software.
20 | *
21 | * 3. This notice may not be removed or altered from any source
22 | * distribution.
23 | *
24 | * DirList Class
25 | * for WiiXplorer 2010
26 | ***************************************************************************/
27 | #ifndef ___DIRLIST_H_
28 | #define ___DIRLIST_H_
29 |
30 | #include
31 | #include
32 | #include
33 |
34 | typedef struct {
35 | char *FilePath;
36 | BOOL isDir;
37 | } DirEntry;
38 |
39 | class DirList {
40 | public:
41 | //!Constructor
42 | DirList(void);
43 |
44 | //!\param path Path from where to load the filelist of all files
45 | //!\param filter A fileext that needs to be filtered
46 | //!\param flags search/filter flags from the enum
47 | DirList(const std::string &path, const char *filter = nullptr, uint32_t flags = Files | Dirs, uint32_t maxDepth = 0xffffffff);
48 |
49 | //!Destructor
50 | virtual ~DirList();
51 |
52 | //! Load all the files from a directory
53 | BOOL LoadPath(const std::string &path, const char *filter = nullptr, uint32_t flags = Files | Dirs, uint32_t maxDepth = 0xffffffff);
54 |
55 | //! Get a filename of the list
56 | //!\param list index
57 | const char *GetFilename(int32_t index) const;
58 |
59 | //! Get the a filepath of the list
60 | //!\param list index
61 | const char *GetFilepath(int32_t index) const {
62 | if (!valid(index))
63 | return "";
64 | else
65 | return FileInfo[index].FilePath;
66 | }
67 |
68 | //! Get the a filesize of the list
69 | //!\param list index
70 | uint64_t GetFilesize(int32_t index) const;
71 |
72 | //! Is index a dir or a file
73 | //!\param list index
74 | BOOL IsDir(int32_t index) const {
75 | if (!valid(index))
76 | return false;
77 | return FileInfo[index].isDir;
78 | };
79 |
80 | //! Get the filecount of the whole list
81 | int32_t GetFilecount() const {
82 | return FileInfo.size();
83 | };
84 |
85 | //! Sort list by filepath
86 | void SortList();
87 |
88 | //! Custom sort command for custom sort functions definitions
89 | void SortList(BOOL (*SortFunc)(const DirEntry &a, const DirEntry &b));
90 |
91 | //! Get the index of the specified filename
92 | int32_t GetFileIndex(const char *filename) const;
93 |
94 | //! Enum for search/filter flags
95 | enum {
96 | Files = 0x01,
97 | Dirs = 0x02,
98 | CheckSubfolders = 0x08,
99 | };
100 |
101 | protected:
102 | // Internal parser
103 | BOOL InternalLoadPath(std::string &path);
104 |
105 | //!Add a list entrie
106 | void AddEntrie(const std::string &filepath, const char *filename, BOOL isDir);
107 |
108 | //! Clear the list
109 | void ClearList();
110 |
111 | //! Check if valid pos is requested
112 | inline BOOL valid(uint32_t pos) const {
113 | return (pos < FileInfo.size());
114 | };
115 |
116 | uint32_t Flags;
117 | uint32_t Depth;
118 | const char *Filter;
119 | std::vector FileInfo;
120 | };
121 |
122 | #endif
123 |
--------------------------------------------------------------------------------
/src/fs/FSUtils.cpp:
--------------------------------------------------------------------------------
1 | #include "fs/FSUtils.h"
2 | #include "fs/CFile.hpp"
3 | #include "utils/logger.h"
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | int32_t FSUtils::LoadFileToMem(const char *filepath, uint8_t **inbuffer, uint32_t *size) {
11 | //! always initialze input
12 | *inbuffer = nullptr;
13 | if (size)
14 | *size = 0;
15 |
16 | int32_t iFd = open(filepath, O_RDONLY);
17 | if (iFd < 0)
18 | return -1;
19 |
20 | uint32_t filesize = lseek(iFd, 0, SEEK_END);
21 | lseek(iFd, 0, SEEK_SET);
22 |
23 | uint8_t *buffer = (uint8_t *) malloc(filesize);
24 | if (buffer == nullptr) {
25 | close(iFd);
26 | return -2;
27 | }
28 |
29 | uint32_t blocksize = 0x4000;
30 | uint32_t done = 0;
31 | int32_t readBytes = 0;
32 |
33 | while (done < filesize) {
34 | if (done + blocksize > filesize) {
35 | blocksize = filesize - done;
36 | }
37 | readBytes = read(iFd, buffer + done, blocksize);
38 | if (readBytes <= 0)
39 | break;
40 | done += readBytes;
41 | }
42 |
43 | close(iFd);
44 |
45 | if (done != filesize) {
46 | free(buffer);
47 | buffer = nullptr;
48 | return -3;
49 | }
50 |
51 | *inbuffer = buffer;
52 |
53 | //! sign is optional input
54 | if (size) {
55 | *size = filesize;
56 | }
57 |
58 | return filesize;
59 | }
60 |
61 | int32_t FSUtils::CheckFile(const char *filepath) {
62 | if (!filepath)
63 | return 0;
64 |
65 | struct stat filestat;
66 |
67 | char dirnoslash[strlen(filepath) + 2];
68 | snprintf(dirnoslash, sizeof(dirnoslash), "%s", filepath);
69 |
70 | while (dirnoslash[strlen(dirnoslash) - 1] == '/')
71 | dirnoslash[strlen(dirnoslash) - 1] = '\0';
72 |
73 | char *notRoot = strrchr(dirnoslash, '/');
74 | if (!notRoot) {
75 | strcat(dirnoslash, "/");
76 | }
77 |
78 | if (stat(dirnoslash, &filestat) == 0)
79 | return 1;
80 |
81 | return 0;
82 | }
83 |
84 | int32_t FSUtils::CreateSubfolder(const char *fullpath) {
85 | if (!fullpath)
86 | return 0;
87 |
88 | int32_t result = 0;
89 |
90 | char dirnoslash[strlen(fullpath) + 1];
91 | strcpy(dirnoslash, fullpath);
92 |
93 | int32_t pos = strlen(dirnoslash) - 1;
94 | while (dirnoslash[pos] == '/') {
95 | dirnoslash[pos] = '\0';
96 | pos--;
97 | }
98 |
99 | if (CheckFile(dirnoslash)) {
100 | return 1;
101 | } else {
102 | char parentpath[strlen(dirnoslash) + 2];
103 | strcpy(parentpath, dirnoslash);
104 | char *ptr = strrchr(parentpath, '/');
105 |
106 | if (!ptr) {
107 | //!Device root directory (must be with '/')
108 | strcat(parentpath, "/");
109 | struct stat filestat;
110 | if (stat(parentpath, &filestat) == 0)
111 | return 1;
112 |
113 | return 0;
114 | }
115 |
116 | ptr++;
117 | ptr[0] = '\0';
118 |
119 | result = CreateSubfolder(parentpath);
120 | }
121 |
122 | if (!result)
123 | return 0;
124 |
125 | if (mkdir(dirnoslash, 0777) == -1) {
126 | return 0;
127 | }
128 |
129 | return 1;
130 | }
131 |
132 | int32_t FSUtils::saveBufferToFile(const char *path, void *buffer, uint32_t size) {
133 | CFile file(path, CFile::WriteOnly);
134 | if (!file.isOpen()) {
135 | DEBUG_FUNCTION_LINE("Failed to open %s", path);
136 | return 0;
137 | }
138 | int32_t written = file.write((const uint8_t *) buffer, size);
139 | file.close();
140 | return written;
141 | }
142 |
--------------------------------------------------------------------------------
/src/fs/FSUtils.h:
--------------------------------------------------------------------------------
1 | #ifndef __FS_UTILS_H_
2 | #define __FS_UTILS_H_
3 |
4 | #include
5 |
6 | class FSUtils {
7 | public:
8 | static int32_t LoadFileToMem(const char *filepath, uint8_t **inbuffer, uint32_t *size);
9 |
10 | //! todo: C++ class
11 | static int32_t CreateSubfolder(const char *fullpath);
12 |
13 | static int32_t CheckFile(const char *filepath);
14 |
15 | static int32_t saveBufferToFile(const char *path, void *buffer, uint32_t size);
16 | };
17 |
18 | #endif // __FS_UTILS_H_
19 |
--------------------------------------------------------------------------------
/src/game/GameList.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | #include "GameList.h"
10 | #include "common/common.h"
11 | #include "utils/AsyncExecutor.h"
12 |
13 | #include "fs/FSUtils.h"
14 | #include "utils/logger.h"
15 |
16 | GameList::GameList() {
17 | }
18 |
19 | GameList::~GameList() {
20 | stopAsyncLoading = true;
21 | DCFlushRange(&stopAsyncLoading, sizeof(stopAsyncLoading));
22 | clear();
23 | };
24 |
25 | void GameList::clear() {
26 | lock();
27 | for (auto const &x : fullGameList) {
28 | if (x != nullptr) {
29 | if (x->imageData != nullptr) {
30 | AsyncExecutor::pushForDelete(x->imageData);
31 | x->imageData = nullptr;
32 | }
33 | delete x;
34 | }
35 | }
36 | fullGameList.clear();
37 | //! Clear memory of the vector completely
38 | std::vector().swap(fullGameList);
39 | unlock();
40 | titleListChanged(this);
41 | }
42 |
43 | gameInfo *GameList::getGameInfo(uint64_t titleId) {
44 | gameInfo *result = nullptr;
45 | lock();
46 | for (uint32_t i = 0; i < fullGameList.size(); ++i) {
47 | if (titleId == fullGameList[i]->titleId) {
48 | result = fullGameList[i];
49 | break;
50 | }
51 | }
52 | unlock();
53 | return result;
54 | }
55 |
56 | int32_t GameList::readGameList() {
57 | // Clear list
58 | for (auto const &x : fullGameList) {
59 | delete x;
60 | }
61 |
62 | fullGameList.clear();
63 | //! Clear memory of the vector completely
64 | std::vector().swap(fullGameList);
65 |
66 | int32_t cnt = 0;
67 |
68 | MCPError mcp = MCP_Open();
69 | if (mcp < 0) {
70 | return 0;
71 | }
72 |
73 | MCPError titleCount = MCP_TitleCount(mcp);
74 | if (titleCount < 0) {
75 | MCP_Close(mcp);
76 | return 0;
77 | }
78 |
79 | std::vector titles(titleCount);
80 | uint32_t realTitleCount = 0;
81 |
82 | static const std::vector menuAppTypes{
83 | MCP_APP_TYPE_GAME,
84 | MCP_APP_TYPE_GAME_WII,
85 | MCP_APP_TYPE_SYSTEM_APPS,
86 | MCP_APP_TYPE_SYSTEM_SETTINGS,
87 | MCP_APP_TYPE_FRIEND_LIST,
88 | MCP_APP_TYPE_MIIVERSE,
89 | MCP_APP_TYPE_ESHOP,
90 | MCP_APP_TYPE_BROWSER,
91 | MCP_APP_TYPE_DOWNLOAD_MANAGEMENT,
92 | MCP_APP_TYPE_ACCOUNT_APPS,
93 | };
94 |
95 | for (auto appType : menuAppTypes) {
96 | uint32_t titleCountByType = 0;
97 | MCPError err = MCP_TitleListByAppType(mcp, appType, &titleCountByType, titles.data() + realTitleCount,
98 | (titles.size() - realTitleCount) * sizeof(decltype(titles)::value_type));
99 | if (err < 0) {
100 | MCP_Close(mcp);
101 | return 0;
102 | }
103 | realTitleCount += titleCountByType;
104 | }
105 | if (realTitleCount != titles.size()) {
106 | titles.resize(realTitleCount);
107 | }
108 |
109 | for (auto title_candidate : titles) {
110 | auto *newGameInfo = new gameInfo;
111 | newGameInfo->titleId = title_candidate.titleId;
112 | newGameInfo->appType = title_candidate.appType;
113 | newGameInfo->gamePath = title_candidate.path;
114 | newGameInfo->name = "";
115 | newGameInfo->imageData = nullptr;
116 | DCFlushRange(newGameInfo, sizeof(gameInfo));
117 |
118 | fullGameList.push_back(newGameInfo);
119 | titleAdded(newGameInfo);
120 | cnt++;
121 | }
122 |
123 | AsyncExecutor::execute([this] {
124 | lock();
125 | for (auto header : fullGameList) {
126 | DCFlushRange(&stopAsyncLoading, sizeof(stopAsyncLoading));
127 | if (stopAsyncLoading) {
128 | DEBUG_FUNCTION_LINE("Stop async title loading");
129 | break;
130 | }
131 |
132 | DEBUG_FUNCTION_LINE("Load extra infos of %016llX", header->titleId);
133 | auto *meta = (ACPMetaXml *) calloc(1, 0x4000); //TODO fix wut
134 | if (meta) {
135 | auto acp = ACPGetTitleMetaXml(header->titleId, meta);
136 | if (acp >= 0) {
137 | header->name = meta->shortname_en;
138 | }
139 | free(meta);
140 | }
141 |
142 | if (header->imageData == nullptr) {
143 | std::string filepath = "fs:" + header->gamePath + META_PATH + "/iconTex.tga";
144 | uint8_t *buffer = nullptr;
145 | uint32_t bufferSize = 0;
146 | int iResult = FSUtils::LoadFileToMem(filepath.c_str(), &buffer, &bufferSize);
147 | if (iResult > 0) {
148 | auto *imageData = new GuiImageData(buffer, bufferSize, GX2_TEX_CLAMP_MODE_MIRROR);
149 | header->imageData = imageData;
150 |
151 | //! free original image buffer which is converted to texture now and not needed anymore
152 | free(buffer);
153 | }
154 | }
155 | DCFlushRange(header, sizeof(gameInfo));
156 | titleUpdated(header);
157 | }
158 | unlock();
159 | });
160 |
161 | return cnt;
162 | }
163 |
164 | void GameList::updateTitleInfo() {
165 | for (int i = 0; i < this->size(); i++) {
166 | gameInfo *newHeader = this->at(i);
167 |
168 | bool hasChanged = false;
169 |
170 | if (newHeader->name.empty()) {
171 | auto *meta = (ACPMetaXml *) calloc(1, 0x4000); //TODO fix wut
172 | if (meta) {
173 | auto acp = ACPGetTitleMetaXml(newHeader->titleId, meta);
174 | if (acp >= 0) {
175 | newHeader->name = meta->shortname_en;
176 | hasChanged = true;
177 | }
178 | free(meta);
179 | }
180 | }
181 |
182 | if (newHeader->imageData == nullptr) {
183 | std::string filepath = "fs:" + newHeader->gamePath + META_PATH + "/iconTex.tga";
184 | uint8_t *buffer = nullptr;
185 | uint32_t bufferSize = 0;
186 | int iResult = FSUtils::LoadFileToMem(filepath.c_str(), &buffer, &bufferSize);
187 |
188 | if (iResult > 0) {
189 | auto *imageData = new GuiImageData(buffer, bufferSize, GX2_TEX_CLAMP_MODE_MIRROR);
190 | newHeader->imageData = imageData;
191 | hasChanged = true;
192 |
193 | //! free original image buffer which is converted to texture now and not needed anymore
194 | free(buffer);
195 | }
196 | }
197 | if (hasChanged) {
198 | DCFlushRange(newHeader, sizeof(gameInfo));
199 | titleUpdated(newHeader);
200 | }
201 | }
202 | }
203 |
204 | int32_t GameList::load() {
205 | lock();
206 | if (fullGameList.empty()) {
207 | readGameList();
208 | }
209 |
210 | AsyncExecutor::execute([&] { updateTitleInfo(); });
211 |
212 | titleListChanged(this);
213 |
214 | int res = fullGameList.size();
215 | unlock();
216 | return res;
217 | }
218 |
--------------------------------------------------------------------------------
/src/game/GameList.h:
--------------------------------------------------------------------------------
1 | #ifndef GAME_LIST_H_
2 | #define GAME_LIST_H_
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 |
12 | typedef struct _gameInfo {
13 | uint64_t titleId;
14 | MCPAppType appType;
15 | std::string name;
16 | std::string gamePath;
17 | GuiImageData *imageData;
18 | } gameInfo;
19 |
20 | class GameList {
21 | public:
22 | GameList();
23 |
24 | ~GameList();
25 |
26 | int32_t size() {
27 | lock();
28 | int32_t res = fullGameList.size();
29 | unlock();
30 | return res;
31 | }
32 |
33 | int32_t gameCount() {
34 | lock();
35 | int32_t res = fullGameList.size();
36 | unlock();
37 | return res;
38 | }
39 |
40 | gameInfo *at(int32_t i) {
41 | return operator[](i);
42 | }
43 |
44 | gameInfo *operator[](int32_t i) {
45 | lock();
46 | gameInfo *res = nullptr;
47 | if (i < 0 || i >= (int32_t) fullGameList.size()) {
48 | res = nullptr;
49 | } else {
50 | res = fullGameList[i];
51 | }
52 | unlock();
53 | return res;
54 | }
55 |
56 | gameInfo *getGameInfo(uint64_t titleId);
57 |
58 | void clear();
59 |
60 | std::vector &getFullGameList(void) {
61 | return fullGameList;
62 | }
63 |
64 | int32_t load();
65 |
66 | sigslot::signal1 titleListChanged;
67 | sigslot::signal1 titleUpdated;
68 | sigslot::signal1 titleAdded;
69 |
70 | void lock() {
71 | _lock.lock();
72 | }
73 |
74 | void unlock() {
75 | _lock.unlock();
76 | }
77 |
78 | protected:
79 | int32_t readGameList();
80 |
81 | void updateTitleInfo();
82 |
83 | std::vector fullGameList;
84 |
85 | std::recursive_mutex _lock;
86 |
87 | bool stopAsyncLoading = false;
88 | };
89 |
90 | #endif
91 |
--------------------------------------------------------------------------------
/src/gui/GameIcon.cpp:
--------------------------------------------------------------------------------
1 | #include "GameIcon.h"
2 | #include "Application.h"
3 | #include "GameIconModel.h"
4 | #include "utils/logger.h"
5 | #include "utils/utils.h"
6 | #include
7 | #include
8 | #include
9 |
10 | static const float cfIconMirrorScale = 1.15f;
11 | static const float cfIconMirrorAlpha = 0.45f;
12 |
13 | GameIcon::GameIcon(GuiImageData *preloadImage)
14 | : GuiImage(preloadImage) {
15 | bSelected = false;
16 | bRenderStroke = true;
17 | bRenderReflection = false;
18 | bIconLast = false;
19 | strokeFractalEnable = 1;
20 | strokeBlurBorder = 0.0f;
21 | distanceFadeout = 0.0f;
22 | rotationX = 0.0f;
23 | reflectionAlpha = 0.4f;
24 | strokeWidth = 2.35f;
25 | colorIntensity = glm::vec4(1.0f);
26 | colorIntensityMirror = colorIntensity;
27 | alphaFadeOutNorm = glm::vec4(0.0f);
28 | alphaFadeOutRefl = glm::vec4(-1.0f, 0.0f, 0.9f, 1.0f);
29 | selectionBlurOuterColorIntensity = glm::vec4(0.09411764f * 1.15f, 0.56862745f * 1.15f, 0.96862745098f * 1.15f, 1.0f);
30 | selectionBlurOuterSize = 1.65f;
31 | selectionBlurOuterBorderSize = 0.5f;
32 | selectionBlurInnerColorIntensity = glm::vec4(0.46666667f, 0.90588235f, 1.0f, 1.0f);
33 | selectionBlurInnerSize = 1.45f;
34 | selectionBlurInnerBorderSize = 0.95f;
35 |
36 | vtxCount = sizeof(cfGameIconPosVtxs) / (Shader3D::cuVertexAttrSize);
37 |
38 | //! texture and vertex coordinates
39 | posVtxs = (float *) memalign(GX2_VERTEX_BUFFER_ALIGNMENT, sizeof(cfGameIconPosVtxs));
40 | texCoords = (float *) memalign(GX2_VERTEX_BUFFER_ALIGNMENT, sizeof(cfGameIconTexCoords));
41 |
42 | if (posVtxs) {
43 | memcpy((float *) posVtxs, cfGameIconPosVtxs, sizeof(cfGameIconPosVtxs));
44 | GX2Invalidate(GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER, (float *) posVtxs, sizeof(cfGameIconPosVtxs));
45 | }
46 | if (texCoords) {
47 | memcpy((float *) texCoords, cfGameIconTexCoords, sizeof(cfGameIconTexCoords));
48 | GX2Invalidate(GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER, (float *) texCoords, sizeof(cfGameIconTexCoords));
49 | }
50 |
51 | //! create vertexes for the mirror frame
52 | texCoordsMirror = (float *) memalign(GX2_VERTEX_BUFFER_ALIGNMENT, sizeof(cfGameIconTexCoords));
53 |
54 | if (texCoordsMirror) {
55 | for (uint32_t i = 0; i < vtxCount; i++) {
56 | texCoordsMirror[i * 2 + 0] = texCoords[i * 2 + 0] * cfIconMirrorScale - ((cfIconMirrorScale - 1.0f) - (cfIconMirrorScale - 1.0f) * 0.5f);
57 | texCoordsMirror[i * 2 + 1] = texCoords[i * 2 + 1] * cfIconMirrorScale - ((cfIconMirrorScale - 1.0f) - (cfIconMirrorScale - 1.0f) * 0.5f);
58 | }
59 | GX2Invalidate(GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER, texCoordsMirror, sizeof(cfGameIconTexCoords));
60 | }
61 |
62 | //! setup stroke of the icon
63 | strokePosVtxs = (float *) memalign(GX2_VERTEX_BUFFER_ALIGNMENT, sizeof(cfGameIconStrokeVtxs));
64 | if (strokePosVtxs) {
65 | memcpy(strokePosVtxs, cfGameIconStrokeVtxs, sizeof(cfGameIconStrokeVtxs));
66 | GX2Invalidate(GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER, strokePosVtxs, sizeof(cfGameIconStrokeVtxs));
67 | }
68 | strokeTexCoords = (float *) memalign(GX2_VERTEX_BUFFER_ALIGNMENT, cuGameIconStrokeVtxCount * Shader::cuTexCoordAttrSize);
69 | if (strokeTexCoords) {
70 | for (size_t i = 0, n = 0; i < cuGameIconStrokeVtxCount; n += 2, i += 3) {
71 | strokeTexCoords[n] = (1.0f + strokePosVtxs[i]) * 0.5f;
72 | strokeTexCoords[n + 1] = 1.0f - (1.0f + strokePosVtxs[i + 1]) * 0.5f;
73 | }
74 | GX2Invalidate(GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER, strokeTexCoords, cuGameIconStrokeVtxCount * Shader::cuTexCoordAttrSize);
75 | }
76 | strokeColorVtxs = (uint8_t *) memalign(GX2_VERTEX_BUFFER_ALIGNMENT, cuGameIconStrokeVtxCount * Shader::cuColorAttrSize);
77 | if (strokeColorVtxs) {
78 | for (size_t i = 0; i < (cuGameIconStrokeVtxCount * Shader::cuColorAttrSize); i++)
79 | strokeColorVtxs[i] = 0xff;
80 | GX2Invalidate(GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER, strokeColorVtxs, cuGameIconStrokeVtxCount * Shader::cuColorAttrSize);
81 | }
82 | }
83 |
84 | GameIcon::~GameIcon() {
85 | //! remove image so it can not be drawn anymore from this point on
86 | imageData = nullptr;
87 |
88 | //! main image vertexes
89 | if (posVtxs) {
90 | free((void *) posVtxs);
91 | posVtxs = nullptr;
92 | }
93 | if (texCoords) {
94 | free((void *) texCoords);
95 | texCoords = nullptr;
96 | }
97 | //! mirror image vertexes
98 | if (texCoordsMirror) {
99 | free(texCoordsMirror);
100 | texCoordsMirror = nullptr;
101 | }
102 | //! stroke image vertexes
103 | if (strokePosVtxs) {
104 | free(strokePosVtxs);
105 | strokePosVtxs = nullptr;
106 | }
107 | if (strokeTexCoords) {
108 | free(strokeTexCoords);
109 | strokeTexCoords = nullptr;
110 | }
111 | if (strokeColorVtxs) {
112 | free(strokeColorVtxs);
113 | strokeColorVtxs = nullptr;
114 | }
115 | }
116 |
117 | bool GameIcon::checkRayIntersection(const glm::vec3 &rayOrigin, const glm::vec3 &rayDirFrac) {
118 | //! since we always face the camera we can just check the AABB intersection
119 | //! otherwise an OOB intersection would be required
120 |
121 | float currPosX = getCenterX() * Application::instance()->getVideo()->getWidthScaleFactor() * 2.0f;
122 | float currPosY = getCenterY() * Application::instance()->getVideo()->getHeightScaleFactor() * 2.0f;
123 | float currPosZ = getDepth() * Application::instance()->getVideo()->getDepthScaleFactor() * 2.0f;
124 | float currScaleX = getScaleX() * (float) getWidth() * Application::instance()->getVideo()->getWidthScaleFactor();
125 | float currScaleY = getScaleY() * (float) getHeight() * Application::instance()->getVideo()->getHeightScaleFactor();
126 | float currScaleZ = getScaleZ() * (float) getWidth() * Application::instance()->getVideo()->getDepthScaleFactor();
127 | //! lb is the corner of AABB with minimal coordinates - left bottom, rt is maximal corner
128 | glm::vec3 lb(currPosX - currScaleX, currPosY - currScaleY, currPosZ - currScaleZ);
129 | glm::vec3 rt(currPosX + currScaleX, currPosY + currScaleY, currPosZ + currScaleZ);
130 |
131 | float t1 = (lb.x - rayOrigin.x) * rayDirFrac.x;
132 | float t2 = (rt.x - rayOrigin.x) * rayDirFrac.x;
133 | float t3 = (lb.y - rayOrigin.y) * rayDirFrac.y;
134 | float t4 = (rt.y - rayOrigin.y) * rayDirFrac.y;
135 | float t5 = (lb.z - rayOrigin.z) * rayDirFrac.z;
136 | float t6 = (rt.z - rayOrigin.z) * rayDirFrac.z;
137 |
138 | float tmin = std::max(std::max(std::min(t1, t2), std::min(t3, t4)), std::min(t5, t6));
139 | float tmax = std::min(std::min(std::max(t1, t2), std::max(t3, t4)), std::max(t5, t6));
140 |
141 | //! if tmax < 0, ray (line) is intersecting AABB, but whole AABB is behing us
142 | if (tmax < 0) {
143 | //t = tmax;
144 | return false;
145 | }
146 |
147 | //! if tmin > tmax, ray doesn't intersect AABB
148 | if (tmin > tmax) {
149 | //t = tmax;
150 | return false;
151 | }
152 |
153 | //t = tmin;
154 | return true;
155 | }
156 |
157 | void GameIcon::draw(CVideo *pVideo, const glm::mat4 &projectionMtx, const glm::mat4 &viewMtx, const glm::mat4 &modelView) {
158 | if (imageData == nullptr) {
159 | return;
160 | }
161 | //! first setup 2D GUI positions
162 | float currPosX = getCenterX() * pVideo->getWidthScaleFactor() * 2.0f;
163 | float currPosY = getCenterY() * pVideo->getHeightScaleFactor() * 2.0f;
164 | float currPosZ = getDepth() * pVideo->getDepthScaleFactor() * 2.0f;
165 | float currScaleX = getScaleX() * (float) getWidth() * pVideo->getWidthScaleFactor();
166 | float currScaleY = getScaleY() * (float) getHeight() * pVideo->getHeightScaleFactor();
167 | float currScaleZ = getScaleZ() * (float) getWidth() * pVideo->getDepthScaleFactor();
168 | float strokeScaleX = pVideo->getWidthScaleFactor() * strokeWidth * 0.25f + cfIconMirrorScale;
169 | float strokeScaleY = pVideo->getHeightScaleFactor() * strokeWidth * 0.25f + cfIconMirrorScale;
170 |
171 | for (int32_t iDraw = 0; iDraw < 2; iDraw++) {
172 | glm::vec4 *alphaFadeOut;
173 | glm::mat4 m_iconView;
174 | glm::mat4 m_mirrorView;
175 | glm::mat4 m_strokeView;
176 |
177 | if (iDraw == RENDER_REFLECTION) {
178 | //! Reflection render
179 | if (!bRenderReflection)
180 | continue;
181 | m_iconView = glm::translate(modelView, glm::vec3(currPosX, -currScaleY * 2.0f - currPosY, currPosZ + cosf(DegToRad(rotationX)) * currScaleZ * 2.0f));
182 | m_iconView = glm::rotate(m_iconView, DegToRad(rotationX), glm::vec3(1.0f, 0.0f, 0.0f));
183 | m_iconView = glm::scale(m_iconView, glm::vec3(currScaleX, -currScaleY, currScaleZ));
184 |
185 | colorIntensity[3] = reflectionAlpha * getAlpha();
186 | selectionBlurOuterColorIntensity[3] = colorIntensity[3] * 0.7f;
187 | selectionBlurInnerColorIntensity[3] = colorIntensity[3] * 0.7f;
188 | alphaFadeOut = &alphaFadeOutRefl;
189 |
190 | GX2SetCullOnlyControl(GX2_FRONT_FACE_CCW, GX2_ENABLE, GX2_DISABLE);
191 | } else {
192 | //! Normal render
193 | m_iconView = glm::translate(modelView, glm::vec3(currPosX, currPosY, currPosZ));
194 | m_iconView = glm::rotate(m_iconView, DegToRad(rotationX), glm::vec3(1.0f, 0.0f, 0.0f));
195 | m_iconView = glm::scale(m_iconView, glm::vec3(currScaleX, currScaleY, currScaleZ));
196 |
197 | colorIntensity[3] = getAlpha();
198 | selectionBlurOuterColorIntensity[3] = colorIntensity[3];
199 | selectionBlurInnerColorIntensity[3] = colorIntensity[3];
200 | alphaFadeOut = &alphaFadeOutNorm;
201 | }
202 |
203 | m_mirrorView = glm::scale(m_iconView, glm::vec3(cfIconMirrorScale, cfIconMirrorScale, cfIconMirrorScale));
204 |
205 | colorIntensityMirror[3] = cfIconMirrorAlpha * colorIntensity[3];
206 |
207 | if (!bIconLast) {
208 | Shader3D::instance()->setShaders();
209 | Shader3D::instance()->setProjectionMtx(projectionMtx);
210 | Shader3D::instance()->setViewMtx(viewMtx);
211 | Shader3D::instance()->setTextureAndSampler(imageData->getTexture(), imageData->getSampler());
212 | Shader3D::instance()->setAlphaFadeOut(*alphaFadeOut);
213 | Shader3D::instance()->setDistanceFadeOut(distanceFadeout);
214 |
215 | //! render the real symbol
216 | Shader3D::instance()->setModelViewMtx(m_iconView);
217 | Shader3D::instance()->setColorIntensity(colorIntensity);
218 | Shader3D::instance()->setAttributeBuffer(vtxCount, posVtxs, texCoords);
219 | Shader3D::instance()->draw(GX2_PRIMITIVE_MODE_QUADS, vtxCount);
220 | }
221 |
222 |
223 | if (bSelected) {
224 | strokeFractalEnable = 0;
225 |
226 | GX2SetDepthOnlyControl(GX2_ENABLE, GX2_DISABLE, GX2_COMPARE_FUNC_LEQUAL);
227 | m_strokeView = glm::scale(m_iconView, glm::vec3(selectionBlurOuterSize, selectionBlurOuterSize, 0.0f));
228 | ShaderFractalColor::instance()->setShaders();
229 | ShaderFractalColor::instance()->setProjectionMtx(projectionMtx);
230 | ShaderFractalColor::instance()->setViewMtx(viewMtx);
231 | ShaderFractalColor::instance()->setModelViewMtx(m_strokeView);
232 | ShaderFractalColor::instance()->setFractalColor(strokeFractalEnable);
233 | ShaderFractalColor::instance()->setBlurBorder(selectionBlurOuterBorderSize);
234 | ShaderFractalColor::instance()->setColorIntensity(selectionBlurOuterColorIntensity);
235 | ShaderFractalColor::instance()->setAlphaFadeOut(*alphaFadeOut);
236 | ShaderFractalColor::instance()->setAttributeBuffer();
237 | ShaderFractalColor::instance()->draw();
238 |
239 | m_strokeView = glm::scale(m_iconView, glm::vec3(selectionBlurInnerSize, selectionBlurInnerSize, 0.0f));
240 | ShaderFractalColor::instance()->setBlurBorder(selectionBlurInnerBorderSize);
241 | ShaderFractalColor::instance()->setColorIntensity(selectionBlurInnerColorIntensity);
242 | ShaderFractalColor::instance()->draw();
243 | GX2SetDepthOnlyControl(GX2_ENABLE, GX2_ENABLE, GX2_COMPARE_FUNC_LEQUAL);
244 | }
245 |
246 | if (iDraw == RENDER_NORMAL && bRenderStroke) {
247 | strokeFractalEnable = 1;
248 | //! now render the icon stroke
249 | //! make the stroke a little bigger than the mirror, just by the line width on each side
250 | m_strokeView = glm::scale(m_iconView, glm::vec3(strokeScaleX, strokeScaleY, cfIconMirrorScale));
251 |
252 | ShaderFractalColor::instance()->setShaders();
253 | ShaderFractalColor::instance()->setLineWidth(strokeWidth);
254 | ShaderFractalColor::instance()->setProjectionMtx(projectionMtx);
255 | ShaderFractalColor::instance()->setViewMtx(viewMtx);
256 | ShaderFractalColor::instance()->setModelViewMtx(m_strokeView);
257 | ShaderFractalColor::instance()->setFractalColor(strokeFractalEnable);
258 | ShaderFractalColor::instance()->setBlurBorder(strokeBlurBorder);
259 | ShaderFractalColor::instance()->setColorIntensity(colorIntensity);
260 | ShaderFractalColor::instance()->setAlphaFadeOut(*alphaFadeOut);
261 | ShaderFractalColor::instance()->setAttributeBuffer(cuGameIconStrokeVtxCount, strokePosVtxs, strokeTexCoords, strokeColorVtxs);
262 | ShaderFractalColor::instance()->draw(GX2_PRIMITIVE_MODE_LINE_STRIP, cuGameIconStrokeVtxCount);
263 | }
264 |
265 | //! render the background mirror frame
266 | Shader3D::instance()->setShaders();
267 | Shader3D::instance()->setProjectionMtx(projectionMtx);
268 | Shader3D::instance()->setViewMtx(viewMtx);
269 | Shader3D::instance()->setTextureAndSampler(imageData->getTexture(), imageData->getSampler());
270 | Shader3D::instance()->setAlphaFadeOut(*alphaFadeOut);
271 | Shader3D::instance()->setDistanceFadeOut(distanceFadeout);
272 | Shader3D::instance()->setModelViewMtx(m_mirrorView);
273 | Shader3D::instance()->setColorIntensity(colorIntensityMirror);
274 | Shader3D::instance()->setAttributeBuffer(vtxCount, posVtxs, texCoordsMirror);
275 | Shader3D::instance()->draw(GX2_PRIMITIVE_MODE_QUADS, vtxCount);
276 |
277 | if (bIconLast) {
278 | Shader3D::instance()->setShaders();
279 | Shader3D::instance()->setProjectionMtx(projectionMtx);
280 | Shader3D::instance()->setViewMtx(viewMtx);
281 | Shader3D::instance()->setTextureAndSampler(imageData->getTexture(), imageData->getSampler());
282 | Shader3D::instance()->setAlphaFadeOut(*alphaFadeOut);
283 | Shader3D::instance()->setDistanceFadeOut(distanceFadeout);
284 |
285 | //! render the real symbol
286 | Shader3D::instance()->setModelViewMtx(m_iconView);
287 | Shader3D::instance()->setColorIntensity(colorIntensity);
288 | Shader3D::instance()->setAttributeBuffer(vtxCount, posVtxs, texCoords);
289 | Shader3D::instance()->draw(GX2_PRIMITIVE_MODE_QUADS, vtxCount);
290 | }
291 |
292 | //! return back normal culling
293 | if (iDraw == RENDER_REFLECTION) {
294 | GX2SetCullOnlyControl(GX2_FRONT_FACE_CCW, GX2_DISABLE, GX2_ENABLE);
295 | }
296 | }
297 | }
298 |
--------------------------------------------------------------------------------
/src/gui/GameIcon.h:
--------------------------------------------------------------------------------
1 | #ifndef _GAME_ICON_H_
2 | #define _GAME_ICON_H_
3 |
4 | #include
5 | #include
6 |
7 | class GameIcon : public GuiImage {
8 | public:
9 | GameIcon(GuiImageData *preloadImage);
10 |
11 | virtual ~GameIcon();
12 |
13 | void setRotationX(float r) {
14 | rotationX = r;
15 | }
16 |
17 | void setColorIntensity(const glm::vec4 &color) {
18 | colorIntensity = color;
19 | colorIntensityMirror = colorIntensity;
20 | selectionBlurOuterColorIntensity = color * glm::vec4(0.09411764f * 1.15f, 0.56862745f * 1.15f, 0.96862745098f * 1.15f, 1.0f);
21 | selectionBlurInnerColorIntensity = color * glm::vec4(0.46666667f, 0.90588235f, 1.0f, 1.0f);
22 | }
23 |
24 | const glm::vec4 &getColorIntensity() const {
25 | return colorIntensity;
26 | }
27 |
28 | void setAlphaFadeOutNorm(const glm::vec4 &a) {
29 | alphaFadeOutNorm = a;
30 | }
31 |
32 | void setAlphaFadeOutRefl(const glm::vec4 &a) {
33 | alphaFadeOutRefl = a;
34 | }
35 |
36 | void setRenderReflection(bool enable) {
37 | bRenderReflection = enable;
38 | }
39 |
40 | void setSelected(bool enable) {
41 | bSelected = enable;
42 | }
43 |
44 | void setStrokeRender(bool enable) {
45 | bRenderStroke = enable;
46 | }
47 |
48 | void setRenderIconLast(bool enable) {
49 | bIconLast = enable;
50 | }
51 |
52 | void draw(CVideo *pVideo) {
53 | static const glm::mat4 identity(1.0f);
54 | draw(pVideo, identity, identity, identity);
55 | }
56 |
57 | void draw(CVideo *pVideo, const glm::mat4 &projection, const glm::mat4 &view, const glm::mat4 &modelView);
58 |
59 | bool checkRayIntersection(const glm::vec3 &rayOrigin, const glm::vec3 &rayDirFrac);
60 |
61 | private:
62 | enum eRenderState {
63 | RENDER_REFLECTION,
64 | RENDER_NORMAL
65 | };
66 |
67 | bool bSelected;
68 | bool bRenderStroke;
69 | bool bRenderReflection;
70 | bool bIconLast;
71 | glm::vec4 colorIntensity;
72 | glm::vec4 colorIntensityMirror;
73 | glm::vec4 alphaFadeOutNorm;
74 | glm::vec4 alphaFadeOutRefl;
75 |
76 | float reflectionAlpha;
77 | float strokeWidth;
78 | float rotationX;
79 | float rgbReduction;
80 | float distanceFadeout;
81 | float *texCoordsMirror;
82 | float *strokePosVtxs;
83 | float *strokeTexCoords;
84 | uint8_t *strokeColorVtxs;
85 | int32_t strokeFractalEnable;
86 | float strokeBlurBorder;
87 | glm::vec4 selectionBlurOuterColorIntensity;
88 | float selectionBlurOuterSize;
89 | float selectionBlurOuterBorderSize;
90 | glm::vec4 selectionBlurInnerColorIntensity;
91 | float selectionBlurInnerSize;
92 | float selectionBlurInnerBorderSize;
93 | };
94 |
95 | #endif // _GAME_ICON_H_
96 |
--------------------------------------------------------------------------------
/src/gui/GuiIconGrid.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | * Copyright (C) 2015 Dimok
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ****************************************************************************/
17 | #include "Application.h"
18 | #include "common/common.h"
19 | #include "gui/GameIcon.h"
20 | #include "utils/logger.h"
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include