diff options
author | Max Horn | 2009-02-24 23:16:42 +0000 |
---|---|---|
committer | Max Horn | 2009-02-24 23:16:42 +0000 |
commit | e5a7b99cee400ca9ff0e3d59f748eca935c37d01 (patch) | |
tree | 8d8938588cd6abcc4e0f18efade27c7ec441b2ac | |
parent | 4f8e9511a137c1755b826b3680d58217aba78ed1 (diff) | |
download | scummvm-rg350-e5a7b99cee400ca9ff0e3d59f748eca935c37d01.tar.gz scummvm-rg350-e5a7b99cee400ca9ff0e3d59f748eca935c37d01.tar.bz2 scummvm-rg350-e5a7b99cee400ca9ff0e3d59f748eca935c37d01.zip |
SCI: Don't #include headers in other headers if a forward declaration of a few types suffices (reduces header interdependencies)
svn-id: r38872
-rw-r--r-- | engines/sci/engine/kernel.cpp | 1 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cfsml | 1 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cpp | 79 | ||||
-rw-r--r-- | engines/sci/engine/vm.cpp | 1 | ||||
-rw-r--r-- | engines/sci/engine/vm.h | 3 |
5 files changed, 45 insertions, 40 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 938fcb3ea6..5e847bb235 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -28,6 +28,7 @@ #include "common/system.h" #include "sci/sci.h" +#include "sci/engine/intmap.h" #include "sci/engine/gc.h" #include "sci/engine/kernel.h" #include "sci/include/sciresource.h" diff --git a/engines/sci/engine/savegame.cfsml b/engines/sci/engine/savegame.cfsml index e60a801ab0..42afd7626d 100644 --- a/engines/sci/engine/savegame.cfsml +++ b/engines/sci/engine/savegame.cfsml @@ -38,6 +38,7 @@ #include "sci/sfx/sfx_engine.h" #include "sci/include/engine.h" #include "sci/engine/heap.h" +#include "sci/engine/intmap.h" #ifdef _WIN32 #pragma warning( disable : 4101 ) diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index e393fb4117..e38d917291 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -38,6 +38,7 @@ #include "sci/sfx/sfx_engine.h" #include "sci/include/engine.h" #include "sci/engine/heap.h" +#include "sci/engine/intmap.h" #ifdef _WIN32 #pragma warning( disable : 4101 ) @@ -4010,7 +4011,7 @@ _cfsml_read_script_t(Common::SeekableReadStream *fh, script_t* save_struc, const // Auto-generated CFSML declaration and function block ends here // Auto-generation performed by cfsml.pl 0.8.2 -#line 447 "engines/sci/engine/savegame.cfsml" +#line 448 "engines/sci/engine/savegame.cfsml" void write_songlib_t(Common::WriteStream *fh, songlib_t *songlib) { song_t *seeker = *(songlib->lib); @@ -4027,7 +4028,7 @@ void write_songlib_t(Common::WriteStream *fh, songlib_t *songlib) { _cfsml_write_song_t(fh, seeker); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 459 "engines/sci/engine/savegame.cfsml" +#line 460 "engines/sci/engine/savegame.cfsml" seeker = seeker->next; } WSprintf(fh, "]\n"); @@ -4075,7 +4076,7 @@ int read_songlib_t(Common::SeekableReadStream *fh, songlib_t *songlib, const cha } } // End of auto-generated CFSML data reader code -#line 483 "engines/sci/engine/savegame.cfsml" +#line 484 "engines/sci/engine/savegame.cfsml" song_lib_add(*songlib, newsong); } l = fh->readLine(); // "]" @@ -4090,7 +4091,7 @@ void write_song_tp(Common::WriteStream *fh, song_t **foo) { _cfsml_write_song_t(fh, *foo); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 493 "engines/sci/engine/savegame.cfsml" +#line 494 "engines/sci/engine/savegame.cfsml" } song_iterator_t *build_iterator(EngineState *s, int song_nr, int type, songit_id_t id); @@ -4124,7 +4125,7 @@ int read_song_tp(Common::SeekableReadStream *fh, song_t **foo, const char *lastv } } // End of auto-generated CFSML data reader code -#line 503 "engines/sci/engine/savegame.cfsml" +#line 504 "engines/sci/engine/savegame.cfsml" (*foo)->delay = 0; (*foo)->it = NULL; (*foo)->next_playing = (*foo)->next_stopping = (*foo)->next = NULL; @@ -4137,7 +4138,7 @@ void write_IntMapperPtr(Common::WriteStream *fh, IntMapper **foo) { _cfsml_write_IntMapper(fh, *foo); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 511 "engines/sci/engine/savegame.cfsml" +#line 512 "engines/sci/engine/savegame.cfsml" } int read_IntMapperPtr(Common::SeekableReadStream *fh, IntMapper **foo, const char *lastval, int *line, int *hiteof) { @@ -4166,7 +4167,7 @@ int read_IntMapperPtr(Common::SeekableReadStream *fh, IntMapper **foo, const cha } } // End of auto-generated CFSML data reader code -#line 516 "engines/sci/engine/savegame.cfsml" +#line 517 "engines/sci/engine/savegame.cfsml" (*foo)->holes = NULL; return 0; } @@ -4182,7 +4183,7 @@ void write_IntMapperNodePtr(Common::WriteStream *fh, IntMapper::Node **foo) { write_IntMapperNodePtr(fh, &((*foo)->next)); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 527 "engines/sci/engine/savegame.cfsml" +#line 528 "engines/sci/engine/savegame.cfsml" } else WSprintf(fh, "L"); WSprintf(fh, "]"); @@ -4230,7 +4231,7 @@ void write_menubar_tp(Common::WriteStream *fh, menubar_t **foo) { _cfsml_write_menubar_t(fh, (*foo)); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 570 "engines/sci/engine/savegame.cfsml" +#line 571 "engines/sci/engine/savegame.cfsml" } else { // Nothing to write WSprintf(fh, "\\null\\"); } @@ -4266,7 +4267,7 @@ int read_menubar_tp(Common::SeekableReadStream *fh, menubar_t **foo, const char } } // End of auto-generated CFSML data reader code -#line 582 "engines/sci/engine/savegame.cfsml" +#line 583 "engines/sci/engine/savegame.cfsml" } return *hiteof; } @@ -4304,7 +4305,7 @@ void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t *foo) { _cfsml_write_int(fh, &foo->segmgr_id); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 615 "engines/sci/engine/savegame.cfsml" +#line 616 "engines/sci/engine/savegame.cfsml" switch (foo->type) { case MEM_OBJ_SCRIPT: #line 818 "engines/sci/engine/savegame.cfsml" @@ -4312,7 +4313,7 @@ void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t *foo) { _cfsml_write_script_t(fh, &foo->data.script); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 618 "engines/sci/engine/savegame.cfsml" +#line 619 "engines/sci/engine/savegame.cfsml" break; case MEM_OBJ_CLONES: #line 818 "engines/sci/engine/savegame.cfsml" @@ -4320,7 +4321,7 @@ void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t *foo) { _cfsml_write_clone_table_t(fh, &foo->data.clones); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 621 "engines/sci/engine/savegame.cfsml" +#line 622 "engines/sci/engine/savegame.cfsml" break; case MEM_OBJ_LOCALS: #line 818 "engines/sci/engine/savegame.cfsml" @@ -4328,7 +4329,7 @@ void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t *foo) { _cfsml_write_local_variables_t(fh, &foo->data.locals); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 624 "engines/sci/engine/savegame.cfsml" +#line 625 "engines/sci/engine/savegame.cfsml" break; case MEM_OBJ_SYS_STRINGS: #line 818 "engines/sci/engine/savegame.cfsml" @@ -4336,7 +4337,7 @@ void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t *foo) { _cfsml_write_sys_strings_t(fh, &foo->data.sys_strings); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 627 "engines/sci/engine/savegame.cfsml" +#line 628 "engines/sci/engine/savegame.cfsml" break; case MEM_OBJ_STACK: #line 818 "engines/sci/engine/savegame.cfsml" @@ -4344,7 +4345,7 @@ void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t *foo) { _cfsml_write_int(fh, &foo->data.stack.nr); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 630 "engines/sci/engine/savegame.cfsml" +#line 631 "engines/sci/engine/savegame.cfsml" break; case MEM_OBJ_HUNK: break; @@ -4354,7 +4355,7 @@ void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t *foo) { _cfsml_write_list_table_t(fh, &foo->data.lists); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 635 "engines/sci/engine/savegame.cfsml" +#line 636 "engines/sci/engine/savegame.cfsml" break; case MEM_OBJ_NODES: #line 818 "engines/sci/engine/savegame.cfsml" @@ -4362,7 +4363,7 @@ void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t *foo) { _cfsml_write_node_table_t(fh, &foo->data.nodes); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 638 "engines/sci/engine/savegame.cfsml" +#line 639 "engines/sci/engine/savegame.cfsml" break; case MEM_OBJ_DYNMEM: #line 818 "engines/sci/engine/savegame.cfsml" @@ -4370,7 +4371,7 @@ void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t *foo) { _cfsml_write_dynmem_t(fh, &foo->data.dynmem); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 641 "engines/sci/engine/savegame.cfsml" +#line 642 "engines/sci/engine/savegame.cfsml" break; default: break; @@ -4410,7 +4411,7 @@ int read_mem_obj_t(Common::SeekableReadStream *fh, mem_obj_t *foo, const char *l } } // End of auto-generated CFSML data reader code -#line 655 "engines/sci/engine/savegame.cfsml" +#line 656 "engines/sci/engine/savegame.cfsml" switch (foo->type) { case MEM_OBJ_SCRIPT: // Auto-generated CFSML data reader code @@ -4439,7 +4440,7 @@ int read_mem_obj_t(Common::SeekableReadStream *fh, mem_obj_t *foo, const char *l } } // End of auto-generated CFSML data reader code -#line 658 "engines/sci/engine/savegame.cfsml" +#line 659 "engines/sci/engine/savegame.cfsml" break; case MEM_OBJ_CLONES: // Auto-generated CFSML data reader code @@ -4468,7 +4469,7 @@ int read_mem_obj_t(Common::SeekableReadStream *fh, mem_obj_t *foo, const char *l } } // End of auto-generated CFSML data reader code -#line 661 "engines/sci/engine/savegame.cfsml" +#line 662 "engines/sci/engine/savegame.cfsml" break; case MEM_OBJ_LOCALS: // Auto-generated CFSML data reader code @@ -4497,7 +4498,7 @@ int read_mem_obj_t(Common::SeekableReadStream *fh, mem_obj_t *foo, const char *l } } // End of auto-generated CFSML data reader code -#line 664 "engines/sci/engine/savegame.cfsml" +#line 665 "engines/sci/engine/savegame.cfsml" break; case MEM_OBJ_SYS_STRINGS: // Auto-generated CFSML data reader code @@ -4526,7 +4527,7 @@ int read_mem_obj_t(Common::SeekableReadStream *fh, mem_obj_t *foo, const char *l } } // End of auto-generated CFSML data reader code -#line 667 "engines/sci/engine/savegame.cfsml" +#line 668 "engines/sci/engine/savegame.cfsml" break; case MEM_OBJ_LISTS: // Auto-generated CFSML data reader code @@ -4555,7 +4556,7 @@ int read_mem_obj_t(Common::SeekableReadStream *fh, mem_obj_t *foo, const char *l } } // End of auto-generated CFSML data reader code -#line 670 "engines/sci/engine/savegame.cfsml" +#line 671 "engines/sci/engine/savegame.cfsml" break; case MEM_OBJ_NODES: // Auto-generated CFSML data reader code @@ -4584,7 +4585,7 @@ int read_mem_obj_t(Common::SeekableReadStream *fh, mem_obj_t *foo, const char *l } } // End of auto-generated CFSML data reader code -#line 673 "engines/sci/engine/savegame.cfsml" +#line 674 "engines/sci/engine/savegame.cfsml" break; case MEM_OBJ_STACK: // Auto-generated CFSML data reader code @@ -4613,7 +4614,7 @@ int read_mem_obj_t(Common::SeekableReadStream *fh, mem_obj_t *foo, const char *l } } // End of auto-generated CFSML data reader code -#line 676 "engines/sci/engine/savegame.cfsml" +#line 677 "engines/sci/engine/savegame.cfsml" foo->data.stack.entries = (reg_t *)sci_calloc(foo->data.stack.nr, sizeof(reg_t)); break; case MEM_OBJ_HUNK: @@ -4646,7 +4647,7 @@ int read_mem_obj_t(Common::SeekableReadStream *fh, mem_obj_t *foo, const char *l } } // End of auto-generated CFSML data reader code -#line 683 "engines/sci/engine/savegame.cfsml" +#line 684 "engines/sci/engine/savegame.cfsml" break; default: break; @@ -4662,7 +4663,7 @@ void write_mem_obj_tp(Common::WriteStream *fh, mem_obj_t **foo) { write_mem_obj_t(fh, (*foo)); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 694 "engines/sci/engine/savegame.cfsml" +#line 695 "engines/sci/engine/savegame.cfsml" } else { // Nothing to write WSprintf(fh, "\\null\\"); } @@ -4697,7 +4698,7 @@ int read_mem_obj_tp(Common::SeekableReadStream *fh, mem_obj_t **foo, const char } } // End of auto-generated CFSML data reader code -#line 705 "engines/sci/engine/savegame.cfsml" +#line 706 "engines/sci/engine/savegame.cfsml" return *hiteof; } return 0; @@ -4709,13 +4710,13 @@ void write_SegManagerPtr(Common::WriteStream *fh, SegManager **foo) { _cfsml_write_bool(fh, &((*foo)->isSci1_1)); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 712 "engines/sci/engine/savegame.cfsml" +#line 713 "engines/sci/engine/savegame.cfsml" #line 818 "engines/sci/engine/savegame.cfsml" // Auto-generated CFSML data writer code _cfsml_write_SegManager(fh, *foo); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 713 "engines/sci/engine/savegame.cfsml" +#line 714 "engines/sci/engine/savegame.cfsml" } int read_SegManagerPtr(Common::SeekableReadStream *fh, SegManager **foo, const char *lastval, int *line, int *hiteof) { @@ -4746,7 +4747,7 @@ int read_SegManagerPtr(Common::SeekableReadStream *fh, SegManager **foo, const c } } // End of auto-generated CFSML data reader code -#line 720 "engines/sci/engine/savegame.cfsml" +#line 721 "engines/sci/engine/savegame.cfsml" *foo = new SegManager(sci11); token = _cfsml_get_identifier(fh, line, hiteof, &assignment); // Auto-generated CFSML data reader code @@ -4773,7 +4774,7 @@ int read_SegManagerPtr(Common::SeekableReadStream *fh, SegManager **foo, const c } } // End of auto-generated CFSML data reader code -#line 723 "engines/sci/engine/savegame.cfsml" +#line 724 "engines/sci/engine/savegame.cfsml" return 0; } @@ -4825,13 +4826,13 @@ int gamestate_save(EngineState *s, Common::WriteStream *fh, const char* savename _cfsml_write_SavegameMetadata(fh, meta); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 770 "engines/sci/engine/savegame.cfsml" +#line 771 "engines/sci/engine/savegame.cfsml" #line 818 "engines/sci/engine/savegame.cfsml" // Auto-generated CFSML data writer code _cfsml_write_EngineState(fh, s); WSprintf(fh, "\n"); // End of auto-generated CFSML data writer code -#line 771 "engines/sci/engine/savegame.cfsml" +#line 772 "engines/sci/engine/savegame.cfsml" delete meta; @@ -5142,7 +5143,7 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { } } // End of auto-generated CFSML data reader code -#line 1050 "engines/sci/engine/savegame.cfsml" +#line 1051 "engines/sci/engine/savegame.cfsml" if ((meta->savegame_version < FREESCI_MINIMUM_SAVEGAME_VERSION) || (meta->savegame_version > FREESCI_CURRENT_SAVEGAME_VERSION)) { if (meta->savegame_version < FREESCI_MINIMUM_SAVEGAME_VERSION) @@ -5197,7 +5198,7 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { } } // End of auto-generated CFSML data reader code -#line 1073 "engines/sci/engine/savegame.cfsml" +#line 1074 "engines/sci/engine/savegame.cfsml" sfx_exit(&s->sound); _gamestate_unfrob(retval); @@ -5317,7 +5318,7 @@ bool get_savegame_metadata(Common::SeekableReadStream* stream, SavegameMetadata* } } // End of auto-generated CFSML data reader code -#line 1161 "engines/sci/engine/savegame.cfsml" +#line 1162 "engines/sci/engine/savegame.cfsml" if (read_eof) return false; diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index b922bee8e8..30c7b1462e 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -28,6 +28,7 @@ #include "sci/include/sciresource.h" #include "sci/include/engine.h" #include "sci/include/versions.h" +#include "sci/engine/intmap.h" #include "sci/engine/kdebug.h" #include "sci/engine/kernel.h" #include "sci/engine/kernel_types.h" diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h index c80bd7c37a..721360932f 100644 --- a/engines/sci/engine/vm.h +++ b/engines/sci/engine/vm.h @@ -32,11 +32,12 @@ #include "sci/include/vm_types.h" // for reg_t #include "sci/include/heapmgr.h" -#include "sci/engine/intmap.h" #include "sci/engine/sys_strings.h" namespace Sci { +struct IntMapper; + #define VM_STACK_SIZE 0x1000 /* Number of bytes to be allocated for the stack */ |