Skip to content

Commit

Permalink
All creation/pre-creation code (rooms and instances) returns variants…
Browse files Browse the repository at this point in the history
… (default 0).
  • Loading branch information
sorlok committed Jan 6, 2015
1 parent 1ad56ef commit 542f504
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions CompilerSource/compiler/components/write_room_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ wto.open((makedir +"Preprocessor_Environment_Editable/IDE_EDIT_roomcreates.h").c
parsed_room *pr = parsed_rooms[es->rooms[i].id];
for (map<int,parsed_room::parsed_icreatecode>::iterator it = pr->instance_create_codes.begin(); it != pr->instance_create_codes.end(); it++)
{
wto << "void room_"<< es->rooms[i].id <<"_instancecreate_" << it->first << "()\n{\n ";
wto << "variant room_"<< es->rooms[i].id <<"_instancecreate_" << it->first << "()\n{\n ";
if (mode == emode_debug) {
wto << "enigma::debug_scope $current_scope(\"'instance creation' for instance '" << it->first << "'\");\n";
}
Expand All @@ -215,12 +215,12 @@ wto.open((makedir +"Preprocessor_Environment_Editable/IDE_EDIT_roomcreates.h").c
syntOvr.empty() ? it->second.pe->synt : syntOvr,
it->second.pe->strc, it->second.pe->strs, 2, wto
);
wto << "}\n\n";
wto << " return 0;\n}\n\n";
}

for (map<int,parsed_room::parsed_icreatecode>::iterator it = pr->instance_precreate_codes.begin(); it != pr->instance_precreate_codes.end(); it++)
{
wto << "void room_"<< es->rooms[i].id <<"_instanceprecreate_" << it->first << "()\n{\n ";
wto << "variant room_"<< es->rooms[i].id <<"_instanceprecreate_" << it->first << "()\n{\n ";
if (mode == emode_debug) {
wto << "enigma::debug_scope $current_scope(\"'instance preCreation' for instance '" << it->first << "'\");\n";
}
Expand All @@ -239,10 +239,10 @@ wto.open((makedir +"Preprocessor_Environment_Editable/IDE_EDIT_roomcreates.h").c
syntOvr.empty() ? it->second.pe->synt : syntOvr,
it->second.pe->strc, it->second.pe->strs, 2, wto
);
wto << "}\n\n";
wto << " return 0;\n}\n\n";
}

wto << "void roomprecreate" << es->rooms[i].id << "()\n{\n ";
wto << "variant roomprecreate" << es->rooms[i].id << "()\n{\n ";
if (mode == emode_debug) {
wto << "enigma::debug_scope $current_scope(\"'room preCreation' for room '" << es->rooms[i].name << "'\");\n";
}
Expand All @@ -253,9 +253,9 @@ wto.open((makedir +"Preprocessor_Environment_Editable/IDE_EDIT_roomcreates.h").c
for (map<int,parsed_room::parsed_icreatecode>::iterator it = pr->instance_precreate_codes.begin(); it != pr->instance_precreate_codes.end(); it++)
wto << "\n room_"<< es->rooms[i].id <<"_instanceprecreate_" << it->first << "();";

wto << "\n}\n";
wto << "\n return 0;\n }\n";

wto << "void roomcreate" << es->rooms[i].id << "()\n{\n ";
wto << "variant roomcreate" << es->rooms[i].id << "()\n{\n ";
if (mode == emode_debug) {
wto << "enigma::debug_scope $current_scope(\"'room creation' for room '" << es->rooms[i].name << "'\");\n";
}
Expand All @@ -265,7 +265,7 @@ wto.open((makedir +"Preprocessor_Environment_Editable/IDE_EDIT_roomcreates.h").c
for (map<int,parsed_room::parsed_icreatecode>::iterator it = pr->instance_create_codes.begin(); it != pr->instance_create_codes.end(); it++)
wto << "\n room_"<< es->rooms[i].id <<"_instancecreate_" << it->first << "();";

wto << "\n}\n";
wto << "\n return 0;\n }\n";
}
wto.close();

Expand Down
4 changes: 2 additions & 2 deletions ENIGMAsystem/SHELL/Universal_System/roomsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ namespace enigma

int backcolor;
bool drawbackcolor;
void(*createcode)();
void(*precreatecode)();
variant(*createcode)();
variant(*precreatecode)();
int width, height, spd, persistent;
int views_enabled;
viewstruct views[10];
Expand Down

0 comments on commit 542f504

Please sign in to comment.