Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CR] feat: iOS build #77197

Draft
wants to merge 51 commits into
base: master
Choose a base branch
from
Draft

Conversation

sonphantrung
Copy link
Contributor

@sonphantrung sonphantrung commented Oct 20, 2024

Summary

None

Purpose of change

  1. I want to play DDA on my iPhone
  2. The ones provided on the App Store are outdated and I can't afford as I'm broke
  3. I want to have an easier way of compiling iOS builds

Describe the solution

This is a sequel of @smileynet's #61550 (attribution will be added later). Additionally:

  • I have fixed some "angled" includes
  • I aimed for feature parity with Android. To achieve this, I utilized Swift's fairly new C++ interop feature for exposing vars to existing code

Describe alternatives you've considered

Play on PC 😢

Testing

Additional context

Compared to compiling Mindustry/Shattered Pixel Dungeon, this thing is far tougher for a person not having a Mac like me. Any helps are appreciated!

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. NPC / Factions NPCs, AI, Speech, Factions, Ownership Code: Build Issues regarding different builds and build environments Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs Mechanics: Weather Rain, snow, portal storms and non-temperature environment Mechanics: Enchantments / Spells Enchantments and spells astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Oct 20, 2024
@sonphantrung
Copy link
Contributor Author

image

Compiled (albeit having problems)

@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Oct 22, 2024
@sonphantrung sonphantrung changed the title feat: iOS build [CR] feat: iOS build Oct 27, 2024
@github-actions github-actions bot added Info / User Interface Game - player communication, menus, etc. Bionics CBM (Compact Bionic Modules) Map / Mapgen Overmap, Mapgen, Map extras, Map display labels Oct 30, 2024
@sonphantrung
Copy link
Contributor Author

OK, so now I'm having this problem when compiling:

/Users/runner/work/Cataclysm-Compiler/Cataclysm-Compiler/src/input_context.cpp:164:43: error: no member named 'input_context_stack' in 'input_context'
std::list<input_context *> input_context::input_context_stack;
                           ~~~~~~~~~~~~~~~^
/Users/runner/work/Cataclysm-Compiler/Cataclysm-Compiler/src/input_context.cpp:166:42: error: unknown type name 'manual_key'
void input_context::register_manual_key( manual_key mk )
                                         ^
/Users/runner/work/Cataclysm-Compiler/Cataclysm-Compiler/src/input_context.cpp:169:16: error: unknown type name 'manual_key'
    for( const manual_key &manual_key : registered_manual_keys )
               ^
/Users/runner/work/Cataclysm-Compiler/Cataclysm-Compiler/src/input_context.cpp:169:41: error: use of undeclared identifier 'registered_manual_keys'
    for( const manual_key &manual_key : registered_manual_keys )
                                        ^
/Users/runner/work/Cataclysm-Compiler/Cataclysm-Compiler/src/input_context.cpp:174:5: error: use of undeclared identifier 'registered_manual_keys'; did you mean 'register_manual_key'?
    registered_manual_keys.push_back( mk );
    ^~~~~~~~~~~~~~~~~~~~~~
    register_manual_key
/Users/runner/work/Cataclysm-Compiler/Cataclysm-Compiler/src/input_context.cpp:166:21: note: 'register_manual_key' declared here
void input_context::register_manual_key( manual_key mk )
                    ^
/Users/runner/work/Cataclysm-Compiler/Cataclysm-Compiler/src/input_context.cpp:177:21: error: out-of-line definition of 'register_manual_key' does not match any declaration in 'input_context'
void input_context::register_manual_key( int key, const std::string text )
                    ^~~~~~~~~~~~~~~~~~~
/Users/runner/work/Cataclysm-Compiler/Cataclysm-Compiler/src/input_context.cpp:180:16: error: unknown type name 'manual_key'
    for( const manual_key &manual_key : registered_manual_keys )
               ^
/Users/runner/work/Cataclysm-Compiler/Cataclysm-Compiler/src/input_context.cpp:180:41: error: use of undeclared identifier 'registered_manual_keys'
    for( const manual_key &manual_key : registered_manual_keys )
                                        ^
/Users/runner/work/Cataclysm-Compiler/Cataclysm-Compiler/src/input_context.cpp:185:5: error: use of undeclared identifier 'registered_manual_keys'; did you mean 'register_manual_key'?
    registered_manual_keys.push_back( manual_key( key, text ) );
    ^~~~~~~~~~~~~~~~~~~~~~
    register_manual_key
/Users/runner/work/Cataclysm-Compiler/Cataclysm-Compiler/src/input_context.cpp:177:21: note: 'register_manual_key' declared here
void input_context::register_manual_key( int key, const std::string text )
                    ^
/Users/runner/work/Cataclysm-Compiler/Cataclysm-Compiler/src/input_context.cpp:185:39: error: use of undeclared identifier 'manual_key'
    registered_manual_keys.push_back( manual_key( key, text ) );
                                      ^
10 errors generated.

How is this error supposed to happen?????? It's defined in input_context.h w/ correctly added ifdefs!

@github-actions github-actions bot removed the astyled astyled PR, label is assigned by github actions label Oct 31, 2024
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Oct 31, 2024
@DivineEssentia
Copy link

In your build, will it have support for ipads with keyboards? Thanks!

@github-actions github-actions bot removed the astyled astyled PR, label is assigned by github actions label Nov 1, 2024
@sonphantrung
Copy link
Contributor Author

In your build, will it have support for ipads with keyboards? Thanks!

TBF, it should, as SDL have done most of the heavy-lifting already, but I don't know whether the key repeat bug still exists nowadays.

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Nov 1, 2024
@DivineEssentia
Copy link

In your build, will it have support for ipads with keyboards? Thanks!

TBF, it should, as SDL have done most of the heavy-lifting already, but I don't know whether the key repeat bug still exists nowadays.

Cool. That's good to know. Also, on Yuri Apollov's app, every time you press Enter or ESC, it has a chance to fire twice and it's really irritating, making the game nearly unplayable. This started when I updated to iPadOS 17 and I've seen no bug reports on the internet.

@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Nov 2, 2024
@Brambor Brambor added the Help Wanted Not particularly urgent or easy (see Good First Issue for this), but help is appreciated with this! label Nov 14, 2024
@Brambor
Copy link
Contributor

Brambor commented Nov 14, 2024

I am adding the "Help Wanted" tag as you asked for help in #77476

Now I see the problem isn't defined. I cannot help myself, I don't even own any Apples. But I recommend asking on Discord.

@sonphantrung
Copy link
Contributor Author

sonphantrung commented Nov 15, 2024

Current problems:

  • Compiler complains about certain classes/variables from input_context.h isn't available (which is why I temporarily removed the ifdef guards)
  • The (screen) rectangle doesn't fully respect the phone's screen (leading to the game UI only appears on the top-left corner)
  • Shortcuts don't spawn right away (had to do the hacky "putting app to background, trigger on-screen keyboard input" for it to show up, barely.
  • Touch input doesn't work/functioning correctly (Putting in debug msgs does show up btw, but things like the joystick, main menu select, shortcut inputs don't work)

And I'm banned from the Dev Discord server, so I can't do much other than researching stuffs myself.

@Brambor
Copy link
Contributor

Brambor commented Dec 5, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bionics CBM (Compact Bionic Modules) [C++] Changes (can be) made in C++. Previously named `Code` Code: Build Issues regarding different builds and build environments Code: Tests Measurement, self-control, statistics, balancing. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Documentation> Design documents, internal info, guides and help. Help Wanted Not particularly urgent or easy (see Good First Issue for this), but help is appreciated with this! Info / User Interface Game - player communication, menus, etc. [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display [Markdown] Markdown issues and PRs Mechanics: Enchantments / Spells Enchantments and spells Mechanics: Weather Rain, snow, portal storms and non-temperature environment Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants