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

organize all available statetype variables in a states[] array #17

Merged
merged 8 commits into from
Jul 13, 2020

Conversation

fabiangreffrath
Copy link
Owner

This replaces the current relying on a specific order in which global variables
are stored in the executable for e.g. saving and restoring of savegames and thus
does not require the -fno-toplevel-reorder compiler flag anymore.

Fixes #15.

This replaces the current relying on a specific order in which global variables
are stored in the executable for e.g. saving and restoring of savegames and thus
does not require the -fno-toplevel-reorder compiler flag anymore.

Fixes #15.
extern void T_UShoot (objtype *);
extern void T_Will (objtype *);

statetype states[numstates] = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the moment it is const, yes. But once I will tackle #13, sprite numbers will have to get shuffled around.

@fabiangreffrath fabiangreffrath merged commit f7e2b2c into master Jul 13, 2020
@fabiangreffrath fabiangreffrath deleted the states branch July 13, 2020 12:10
fabiangreffrath added a commit that referenced this pull request Jul 14, 2020
* fix all compiler warnings, pt 1

* fix all compiler warnings, pt 2

* fix all compiler warnings, pt 3

* fix all cppcheck warnings

* fix all compiler warnings, pt 4

* add Travis CI

* git update-index --chmod=+x ./.travis.sh

* switch Travis CI template to C++

* fix ignoring return value of read()

* fix ignoring return value of read(), pt 2

* fix ignoring return value of fread(), pt 1

* fix output between x and y bytes into a destination of size z

* remove license-mame.txt, we are not using code under this license anymore

* organize all available statetype variables in a states[] array (#17)

* organize all available statetype variables in a states[] array

This replaces the current relying on a specific order in which global variables
are stored in the executable for e.g. saving and restoring of savegames and thus
does not require the -fno-toplevel-reorder compiler flag anymore.

Fixes #15.

* add the files containing the states[] array

* simplify pointer arithmetics in SaveTheGame()/LoadTheGame()

* display a message and quit the game when an invalid savegame is loaded

There is currently no other way to "unload" the savegame.

* back to main menu on failure instead of quitting

* add copyright headers to newly added files

* prevent crashes for subsequent games when loading invalid savegame

* add some minimalistic comments

* fix all compiler warnings, pt 1

* fix all compiler warnings, pt 2

* fix all compiler warnings, pt 3

* fix all cppcheck warnings

* fix all compiler warnings, pt 4

* add Travis CI

* git update-index --chmod=+x ./.travis.sh

* switch Travis CI template to C++

* fix ignoring return value of read()

* fix ignoring return value of read(), pt 2

* fix ignoring return value of fread(), pt 1

* fix output between x and y bytes into a destination of size z

* unbreak rebase breakage

* fix some more "ignoring return value of read()/write()/fread()" warnings

* fix "ignoring return value of read()" in wl_menu.cpp

* fix some misc errors

* fix SOD compilation

* fix "the current #pragma pack aligment value is modified" warning with clang++

* let Travis CI build 6 separate binaries

* include wl_def.h in dosbox/dbopl.cpp instead of setting "#pragma pack()" there
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

Successfully merging this pull request may close these issues.

do not require "-fno-toplevel-reorder" anymore
2 participants