Merge branch 'master' from Windows

This commit is contained in:
2015-01-04 22:56:16 -05:00
5 changed files with 19 additions and 7 deletions

View File

@@ -137,6 +137,7 @@
<ClCompile Include="..\..\boe.text.cpp" />
<ClCompile Include="..\..\boe.town.cpp" />
<ClCompile Include="..\..\boe.townspec.cpp" />
<ClCompile Include="..\..\oldstructs.cpp" />
<ClCompile Include="..\..\pcedit\pc.editors.cpp" />
</ItemGroup>
<ItemGroup>

View File

@@ -162,5 +162,8 @@
<ClCompile Include="..\..\boe.menus.win.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\oldstructs.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -2007,11 +2007,11 @@ void run_special(eSpecCtx which_mode,short which_type,short start_spec,location
if(cur_node.sd1 <= -10) cur_node.sd1 = univ.party.get_ptr(-cur_node.sd1);
if(cur_node.sd2 <= -10) cur_node.sd2 = univ.party.get_ptr(-cur_node.sd2);
if(cur_node.ex1a <= -10) cur_node.ex1a = univ.party.get_ptr(-cur_node.ex1a);
if(cur_node.ex1b <= -10) cur_node.ex1a = univ.party.get_ptr(-cur_node.ex1b);
if(cur_node.ex1c <= -10) cur_node.ex1a = univ.party.get_ptr(-cur_node.ex1c);
if(cur_node.ex2a <= -10) cur_node.ex1a = univ.party.get_ptr(-cur_node.ex2a);
if(cur_node.ex2b <= -10) cur_node.ex1a = univ.party.get_ptr(-cur_node.ex2b);
if(cur_node.ex2c <= -10) cur_node.ex1a = univ.party.get_ptr(-cur_node.ex2c);
if(cur_node.ex1b <= -10) cur_node.ex1b = univ.party.get_ptr(-cur_node.ex1b);
if(cur_node.ex1c <= -10) cur_node.ex1c = univ.party.get_ptr(-cur_node.ex1c);
if(cur_node.ex2a <= -10) cur_node.ex2a = univ.party.get_ptr(-cur_node.ex2a);
if(cur_node.ex2b <= -10) cur_node.ex2b = univ.party.get_ptr(-cur_node.ex2b);
if(cur_node.ex2c <= -10) cur_node.ex2c = univ.party.get_ptr(-cur_node.ex2c);
// TODO: Should pointers be allowed in message, pict, or jumpto as well?
//print_nums(1111,cur_spec_type,cur_node.type);

View File

@@ -8,22 +8,27 @@
#include "oldstructs.h"
#include <fstream>
#ifndef _WIN32
#include <unistd.h>
#endif
using namespace legacy;
#define STRUCT_INFO(what) \
log << #what << ": " << sizeof(what) << " bytes" << std::endl
what temp_##what; \
log << #what << ": " << sizeof(temp_##what) << " bytes" << std::endl
#define MEM_INFO(what,member) \
log << " " << #member << ": " << sizeof(what :: member) << " bytes, offset " \
log << " " << #member << ": " << sizeof(temp_##what . member) << " bytes, offset " \
<< offsetof(what,member) << std::endl
// This is just a function to output all known information about each struct and its members.
void debug_oldstructs(); // Suppress "no prototype" warning
void debug_oldstructs() {
#ifndef _WIN32
char cwd[256];
getcwd(cwd, 256);
printf("%s" ,cwd);
#endif
std::ofstream log("oldstructs.txt");
STRUCT_INFO(Rect);
MEM_INFO(Rect,top);