Skip to content

Commit 227be5e

Browse files
committed
PROJECT: fixed 64-bit build on Windows, added proper 64-bit mariadb library, removed unneeded SSL libraries
1 parent 63a3988 commit 227be5e

File tree

10 files changed

+33
-18
lines changed

10 files changed

+33
-18
lines changed

lib64/libmariadb64.lib

7.5 KB
Binary file not shown.

libeay32.dll

-1.13 MB
Binary file not shown.

libmariadb64.dll

-20.5 KB
Binary file not shown.

src/common/cbasetypes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#define CYGWIN
3838
#endif
3939

40-
#if !defined(__64BIT__) && defined(__x86_64__)
40+
#if !defined(__64BIT__) && (defined(__x86_64__) || defined(_WIN64))
4141
#define __64BIT__
4242
#endif
4343

src/common/zlib.cpp

+16-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <string.h>
66

77
uint32 zlib_compress_table[512];
8-
uint32 zlib_decompress_table[2556];
8+
uintptr zlib_decompress_table[2556];
99

1010
int32 zlib_init()
1111
{
@@ -21,18 +21,23 @@ int32 zlib_init()
2121
fread(zlib_compress_table, sizeof(uint32), 512, fp);
2222
fclose(fp);
2323

24+
uint32 temp_decompress_table[2556];
2425
fp = fopen("decompress.dat","rb");
2526
if( fp == NULL )
2627
ShowFatalError("zlib_init: can't open file <decompress.dat> \n");
2728
fseek(fp,0,SEEK_END);
2829
size = ftell(fp);
2930
rewind(fp);
30-
fread(zlib_decompress_table, sizeof(char), size, fp);
31+
fread(temp_decompress_table, sizeof(char), size, fp);
3132
fclose(fp);
3233

33-
for(i = 0; i < size/4; i++)
34-
if(zlib_decompress_table[i] > 0xff)
35-
zlib_decompress_table[i] = zlib_decompress_table[i] - 0x15b3aaa0 + (uintptr)zlib_decompress_table;
34+
for (i = 0; i < size / 4; i++)
35+
{
36+
if (temp_decompress_table[i] > 0xff)
37+
zlib_decompress_table[i] = (uintptr)((uintptr*)zlib_decompress_table + ((temp_decompress_table[i] - 0x15b3aaa0) / 4));
38+
else
39+
zlib_decompress_table[i] = temp_decompress_table[i];
40+
}
3641

3742

3843
return 0;
@@ -77,9 +82,9 @@ int32 zlib_compress(char * input,uint32 var1, char * output, uint32 var2, uint
7782
return (cume+8);
7883
};
7984

80-
uint32 zlib_decompress(char *in,uint32 inSize, char *out, uint32 outSize, uint32 *table)
85+
uint32 zlib_decompress(char *in,uint32 inSize, char *out, uint32 outSize, uintptr *table)
8186
{
82-
uint32 * follow = (uint32*)(uintptr)table[0];
87+
uintptr* follow = (uintptr*)table[0];
8388
uint32 i, j=0;
8489

8590
if(in[0] != 1)
@@ -88,16 +93,16 @@ uint32 zlib_decompress(char *in,uint32 inSize, char *out, uint32 outSize, uint32
8893

8994
for(i = 0; i < inSize ;i++){
9095
if((in[i/8]>>(i&7))&1)
91-
follow = (uint32*)(uintptr)follow[1];
96+
follow = (uintptr*)follow[1];
9297
else
93-
follow = (uint32*)(uintptr)follow[0];
98+
follow = (uintptr*)follow[0];
9499
if(follow[0] == 0){
95100
if(follow[1]==0){
96-
void *ptr = (void*)(uintptr)follow[3];
101+
void *ptr = (void*)follow[3];
97102
out[j] = (uintptr)(ptr) & 255;
98103
if(++j >= outSize)
99104
return -1;
100-
follow = (uint32*)(uintptr)table[0];
105+
follow = (uintptr*)table[0];
101106
}
102107
}
103108
}

src/common/zlib.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
#include "../common/cbasetypes.h"
66

77
extern uint32 zlib_compress_table[];
8-
extern uint32 zlib_decompress_table[];
8+
extern uintptr zlib_decompress_table[];
99

1010
int32 zlib_init();
1111

1212
int32 zlib_compress_sub(char * output,uint32 var1,uint32 cume, char * lookup1,uint32 var2,uint32 var3,uint32 lookup2);
1313
int32 zlib_compress(char * input,uint32 var1, char * output, uint32 var2, uint32 * lookup);
1414

15-
uint32 zlib_decompress(char *in,uint32 inSize, char *out, uint32 outSize, uint32 *table);
15+
uint32 zlib_decompress(char *in,uint32 inSize, char *out, uint32 outSize, uintptr *table);
1616

1717

1818
#endif

src/map/utils/charutils.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -2168,7 +2168,7 @@ void BuildingCharSkillsTable(CCharEntity* PChar)
21682168
uint16 artsSkill = battleutils::GetMaxSkill(SKILL_ENH,JOB_RDM,PChar->GetMLevel()); //B+ skill
21692169
uint16 skillCapD = battleutils::GetMaxSkill((SKILLTYPE)i, JOB_SCH, PChar->GetMLevel()); // D skill cap
21702170
uint16 skillCapE = battleutils::GetMaxSkill(SKILL_DRK, JOB_RDM, PChar->GetMLevel()); // E skill cap
2171-
uint16 currentSkill = dsp_cap((PChar->RealSkills.skill[i] / 10), 0, std::max(MaxMSkill, MaxSSkill)); // working skill before bonuses
2171+
uint16 currentSkill = dsp_cap((PChar->RealSkills.skill[i] / 10), 0, dsp_max(MaxMSkill, MaxSSkill)); // working skill before bonuses
21722172
uint16 artsBaseline = 0; // Level based baseline to which to raise skills
21732173
if(PChar->GetMJob() < 51)
21742174
{
@@ -2194,20 +2194,20 @@ void BuildingCharSkillsTable(CCharEntity* PChar)
21942194
{
21952195
// If the player's skill is below the E cap
21962196
// give enough bonus points to raise it to the arts baseline
2197-
skillBonus += std::max(artsBaseline - currentSkill, 0);
2197+
skillBonus += dsp_max(artsBaseline - currentSkill, 0);
21982198
}
21992199
else if (currentSkill < skillCapD)
22002200
{
22012201
//if the skill is at or above the E cap but below the D cap
22022202
// raise it up to the B+ skill cap minus the difference between the current skill rank and the scholar base skill cap (D)
22032203
// i.e. give a bonus of the difference between the B+ skill cap and the D skill cap
2204-
skillBonus += std::max((artsSkill - skillCapD), 0);
2204+
skillBonus += dsp_max((artsSkill - skillCapD), 0);
22052205
}
22062206
else if (currentSkill < artsSkill)
22072207
{
22082208
// If the player's skill is at or above the D cap but below the B+ cap
22092209
// give enough bonus points to raise it to the B+ cap
2210-
skillBonus += std::max(artsSkill - currentSkill, 0);
2210+
skillBonus += dsp_max(artsSkill - currentSkill, 0);
22112211
}
22122212

22132213
if (PChar->StatusEffectContainer->HasStatusEffect(EFFECT_LIGHT_ARTS) ||

ssleay32.dll

-263 KB
Binary file not shown.

win32/DSGame-server/DSGame-server.vcxproj

+2
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@
7676
</PropertyGroup>
7777
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
7878
<OutDir>..\..\</OutDir>
79+
<TargetName>$(ProjectName)_64</TargetName>
7980
</PropertyGroup>
8081
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8182
<OutDir>..\..\</OutDir>
83+
<TargetName>$(ProjectName)_64</TargetName>
8284
</PropertyGroup>
8385
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8486
<ClCompile>

win32/DSGame-server/DSGame-server.vcxproj.user

+8
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,12 @@
1010
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
1111
<LocalDebuggerWorkingDirectory>..\..\</LocalDebuggerWorkingDirectory>
1212
</PropertyGroup>
13+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
14+
<LocalDebuggerWorkingDirectory>$(MSBuildProjectDirectory)\..\..\</LocalDebuggerWorkingDirectory>
15+
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
16+
</PropertyGroup>
17+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
18+
<LocalDebuggerWorkingDirectory>$(MSBuildProjectDirectory)\..\..\</LocalDebuggerWorkingDirectory>
19+
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
20+
</PropertyGroup>
1321
</Project>

0 commit comments

Comments
 (0)