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

Problem on MorphOS platform #1

Open
papiosaur opened this issue Nov 24, 2024 · 3 comments
Open

Problem on MorphOS platform #1

papiosaur opened this issue Nov 24, 2024 · 3 comments

Comments

@papiosaur
Copy link

On MorphOS, sometimes, the game quit when i select Play button (not always). Possibility to fix that please? I don't found the problem...

@mvlassis
Copy link
Owner

Hello! Thanks for showing interest in this project. Unfortunately, this was one of my first programming projects, so I haven't included any debugging capabilities. Also, I don't run a computer that runs MorphOS so debugging by myself is difficult.

It's interesting that this is happening not consistently, can you notice if there are specific instances when the issue occurs? Also, if you enter the options and change any setting, do you encounter any issues?

@papiosaur
Copy link
Author

Hello! Thanks for quicks answer! No problem i understand. My problem : the game quit sometimes when i valid Play button. MorphOS is more sensible with memory access, maybe it's a problem with renderer (destroy old textures or/and create new textures) ? All options work fine if the game is launched. Unfortunally i'm a newbie in C++/SDL2 and i can't help.

@papiosaur
Copy link
Author

This is the log if could help:

src/game.cpp: In member function 'void Game::exit()':
src/game.cpp:87:9: warning: deleting object of abstract class type 'State' which has non-virtual destructor will cause undefined behavior [-Wdelete-non-virtual-dtor]
87 | delete i;
| ^~~~~~~~
src/game.cpp: In static member function 'static void Game::pushNewGame()':
src/game.cpp:131:5: warning: deleting object of polymorphic class type 'GameState' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
131 | delete Game::getInstance()->mPlayState;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/game.cpp:134:5: warning: label 'Game' defined but not used [-Wunused-label]
134 | Game:getInstance()->pushState(Game::getInstance()->mPlayState);
| ^~~~
src/game.cpp: In static member function 'static void Game::pushOptions()':
src/game.cpp:140:5: warning: deleting object of polymorphic class type 'OptionsState' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
140 | delete Game::getInstance()->mOptionsState;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/game.cpp: In static member function 'static void Game::pushPaused()':
src/game.cpp:149:5: warning: deleting object of polymorphic class type 'PausedState' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
149 | delete Game::getInstance()->mPausedState;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ppc-morphos-g++-11 -noixemul -O2 -Wall -I/gg/usr/local/include -I/gg/usr/local/include/SDL2 -Isrc -D__MORPHOS_SHAREDLIBS -std=c++17 -DNDEBUG -D__AMIGADATE__="26.11.2024" -c src/gamestate.cpp -o src/gamestate.o
src/gamestate.cpp: In member function 'void GameState::handleEvent(Action)':
src/gamestate.cpp:257:11: warning: enumeration value 'stay_idle' not handled in switch [-Wswitch]
257 | switch(action)
| ^
src/gamestate.cpp:257:11: warning: enumeration value 'back' not handled in switch [-Wswitch]
src/gamestate.cpp:257:11: warning: enumeration value 'select' not handled in switch [-Wswitch]
ppc-morphos-g++-11 -noixemul -O2 -Wall -I/gg/usr/local/include -I/gg/usr/local/include/SDL2 -Isrc -D__MORPHOS_SHAREDLIBS -std=c++17 -DNDEBUG -D__AMIGADATE__="26.11.2024" -c src/inputmanager.cpp -o src/inputmanager.o
ppc-morphos-g++-11 -noixemul -O2 -Wall -I/gg/usr/local/include -I/gg/usr/local/include/SDL2 -Isrc -D__MORPHOS_SHAREDLIBS -std=c++17 -DNDEBUG -D__AMIGADATE__="26.11.2024" -c src/main.cpp -o src/main.o
ppc-morphos-g++-11 -noixemul -O2 -Wall -I/gg/usr/local/include -I/gg/usr/local/include/SDL2 -Isrc -D__MORPHOS_SHAREDLIBS -std=c++17 -DNDEBUG -D__AMIGADATE__="26.11.2024" -c src/menustate.cpp -o src/menustate.o
src/menustate.cpp: In member function 'virtual void MenuState::update()':
src/menustate.cpp:86:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Button*>::size_type' {aka 'unsigned int'} [-Wsign-compare]
86 | if (index < mButtons.size()-1)
| ~~~~~~^~~~~~~~~~~~~~~~~~~
src/menustate.cpp:67:16: warning: enumeration value 'stay_idle' not handled in switch [-Wswitch]
67 | switch (mInputManager->getAction())
| ^
src/menustate.cpp:67:16: warning: enumeration value 'back' not handled in switch [-Wswitch]
src/menustate.cpp:67:16: warning: enumeration value 'move_left' not handled in switch [-Wswitch]
src/menustate.cpp:67:16: warning: enumeration value 'move_right' not handled in switch [-Wswitch]
src/menustate.cpp:67:16: warning: enumeration value 'drop' not handled in switch [-Wswitch]
src/menustate.cpp:67:16: warning: enumeration value 'rotate' not handled in switch [-Wswitch]
src/menustate.cpp:67:16: warning: enumeration value 'hold' not handled in switch [-Wswitch]
src/menustate.cpp:67:16: warning: enumeration value 'pause' not handled in switch [-Wswitch]
ppc-morphos-g++-11 -noixemul -O2 -Wall -I/gg/usr/local/include -I/gg/usr/local/include/SDL2 -Isrc -D__MORPHOS_SHAREDLIBS -std=c++17 -DNDEBUG -D__AMIGADATE__="26.11.2024" -c src/optionsstate.cpp -o src/optionsstate.o
src/optionsstate.cpp: In member function 'virtual void OptionsState::update()':
src/optionsstate.cpp:93:16: warning: enumeration value 'stay_idle' not handled in switch [-Wswitch]
93 | switch (mInputManager->getAction())
| ^
src/optionsstate.cpp:93:16: warning: enumeration value 'drop' not handled in switch [-Wswitch]
src/optionsstate.cpp:93:16: warning: enumeration value 'rotate' not handled in switch [-Wswitch]
src/optionsstate.cpp:93:16: warning: enumeration value 'hold' not handled in switch [-Wswitch]
src/optionsstate.cpp:93:16: warning: enumeration value 'pause' not handled in switch [-Wswitch]
src/optionsstate.cpp: In member function 'void OptionsState::changeGhostBlock(OptionsState::SettingChange)':
src/optionsstate.cpp:233:35: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
233 | if ( s == SettingChange::left && config::ghost_piece_enabled || s == SettingChange::right && !config::ghost_piece_enabled)
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ppc-morphos-g++-11 -noixemul -O2 -Wall -I/gg/usr/local/include -I/gg/usr/local/include/SDL2 -Isrc -D__MORPHOS_SHAREDLIBS -std=c++17 -DNDEBUG -D__AMIGADATE__="26.11.2024" -c src/pausedstate.cpp -o src/pausedstate.o
src/pausedstate.cpp: In member function 'virtual void PausedState::update()':
src/pausedstate.cpp:79:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Button*>::size_type' {aka 'unsigned int'} [-Wsign-compare]
79 | if (index < mButtons.size()-1)
| ~~~~~~^~~~~~~~~~~~~~~~~~~
src/pausedstate.cpp:60:16: warning: enumeration value 'stay_idle' not handled in switch [-Wswitch]
60 | switch (mInputManager->getAction())
| ^
src/pausedstate.cpp:60:16: warning: enumeration value 'back' not handled in switch [-Wswitch]
src/pausedstate.cpp:60:16: warning: enumeration value 'move_up' not handled in switch [-Wswitch]
src/pausedstate.cpp:60:16: warning: enumeration value 'move_down' not handled in switch [-Wswitch]
src/pausedstate.cpp:60:16: warning: enumeration value 'drop' not handled in switch [-Wswitch]
src/pausedstate.cpp:60:16: warning: enumeration value 'rotate' not handled in switch [-Wswitch]
src/pausedstate.cpp:60:16: warning: enumeration value 'hold' not handled in switch [-Wswitch]
src/pausedstate.cpp:60:16: warning: enumeration value 'pause' not handled in switch [-Wswitch]
ppc-morphos-g++-11 -noixemul -O2 -Wall -I/gg/usr/local/include -I/gg/usr/local/include/SDL2 -Isrc -D__MORPHOS_SHAREDLIBS -std=c++17 -DNDEBUG -D__AMIGADATE__="26.11.2024" -c src/piece.cpp -o src/piece.o
src/piece.cpp: In constructor 'Piece::Piece(int, int)':
src/piece.cpp:7:18: warning: '*this.Piece::piece_type' is used uninitialized [-Wuninitialized]
7 | p_piece_type = piece_type;
| ~~~~~~~~~~~~~^~~~~~~~~~~~
src/piece.cpp:8:16: warning: '*this.Piece::rotation' is used uninitialized [-Wuninitialized]
8 | p_rotation = rotation;
| ~~~~~~~~~~~^~~~~~~~~~
ppc-morphos-g++-11 -noixemul -O2 -Wall -I/gg/usr/local/include -I/gg/usr/local/include/SDL2 -Isrc -D__MORPHOS_SHAREDLIBS -std=c++17 -DNDEBUG -D__AMIGADATE__="26.11.2024" -c src/renderer.cpp -o src/renderer.o
ppc-morphos-g++-11 -noixemul -O2 -Wall -I/gg/usr/local/include -I/gg/usr/local/include/SDL2 -Isrc -D__MORPHOS_SHAREDLIBS -std=c++17 -DNDEBUG -D__AMIGADATE__="26.11.2024" -c src/state.cpp -o src/state.o
ppc-morphos-g++-11 -noixemul -O2 -Wall -I/gg/usr/local/include -I/gg/usr/local/include/SDL2 -Isrc -D__MORPHOS_SHAREDLIBS -std=c++17 -DNDEBUG -D__AMIGADATE__="26.11.2024" -c src/texture.cpp -o src/texture.o
ppc-morphos-g++-11 -noixemul -O2 -Wall -I/gg/usr/local/include -I/gg/usr/local/include/SDL2 -Isrc -D__MORPHOS_SHAREDLIBS -std=c++17 -DNDEBUG -D__AMIGADATE__="26.11.2024" -c src/utilities.cpp -o src/utilities.o
ppc-morphos-g++-11 src/board.o src/button.o src/config.o src/game.o src/gamestate.o src/inputmanager.o src/main.o src/menustate.o src/optionsstate.o src/pausedstate.o src/piece.o src/renderer.o src/state.o src/texture.o src/utilities.o -noixemul -Wall -L/gg/usr/local/lib -lSDL2_ttf -lSDL2_mixer -lSDL2_gfx -lSDL2_image -lSDL2 -lc -lm -lGL -o Pixeltetris
ppc-morphos-strip --strip-all Pixeltetris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants