Skip to content

Commit

Permalink
Merge pull request OpenEnroth#1344 from captainurist/macos_fixes_401
Browse files Browse the repository at this point in the history
Dropped some unused code
  • Loading branch information
captainurist authored Oct 16, 2023
2 parents b1dd43f + 5e71e12 commit ba457aa
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 859 deletions.
2 changes: 0 additions & 2 deletions src/Engine/Graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ set(ENGINE_GRAPHICS_SOURCES
DecalBuilder.cpp
DecorationList.cpp
FrameLimiter.cpp
HWLContainer.cpp
IRenderFactory.cpp
Image.cpp
ImageLoader.cpp
Expand Down Expand Up @@ -48,7 +47,6 @@ set(ENGINE_GRAPHICS_HEADERS
DecorationList.h
FaceEnums.h
FrameLimiter.h
HWLContainer.h
IRender.h
IRenderFactory.h
Image.h
Expand Down
134 changes: 0 additions & 134 deletions src/Engine/Graphics/HWLContainer.cpp

This file was deleted.

39 changes: 0 additions & 39 deletions src/Engine/Graphics/HWLContainer.h

This file was deleted.

53 changes: 0 additions & 53 deletions src/Engine/Graphics/Overlays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,59 +94,6 @@ void OverlayList::InitializeSprites() {
pSpriteFrameTable->InitializeSprite(pOverlays[i].uSpriteFramesetID);
}

//----- (00458E4F) --------------------------------------------------------
bool OverlayList::FromFileTxt(const char *Args) {
FILE *v4; // eax@1
unsigned int v5; // esi@3
void *v7; // eax@9
// FILE *v8; // ST0C_4@11
char *i; // eax@11
char Buf[490]; // [sp+10h] [bp-2F0h]@3
FrameTableTxtLine v18; // [sp+204h] [bp-FCh]@4
FrameTableTxtLine v19; // [sp+280h] [bp-80h]@4
FILE *File; // [sp+2FCh] [bp-4h]@1
unsigned int Argsa; // [sp+308h] [bp+8h]@3

pOverlays.clear();
v4 = fopen(Args, "r");
File = v4;
if (!v4) Error("ObjectDescriptionList::load - Unable to open file: %s.");

v5 = 0;
Argsa = 0;
if (fgets(Buf, sizeof(Buf), v4)) {
do {
*strchr(Buf, 10) = 0;
memcpy(&v19, txt_file_frametable_parser(Buf, &v18), sizeof(v19));
if (v19.uPropCount && *v19.pProperties[0] != 47) ++Argsa;
} while (fgets(Buf, sizeof(Buf), File));
v5 = Argsa;
}
pOverlays.reserve(v5);

fseek(File, 0, 0);
for (i = fgets(Buf, sizeof(Buf), File); i; i = fgets(Buf, sizeof(Buf), File)) {
*strchr(Buf, 10) = 0;
memcpy(&v19, txt_file_frametable_parser(Buf, &v18), sizeof(v19));
if (v19.uPropCount && *v19.pProperties[0] != 47) {
OverlayDesc &overlay = pOverlays.emplace_back();

overlay.uOverlayID = atoi(v19.pProperties[0]);
if (!iequals(v19.pProperties[1], "center")) {
if (iequals(v19.pProperties[1], "transparent"))
overlay.uOverlayType = 2;
else
overlay.uOverlayType = 1;
} else {
overlay.uOverlayType = 0;
}
overlay.uSpriteFramesetID = pSpriteFrameTable->FastFindSprite(v19.pProperties[2]);
}
}
fclose(File);
return 1;
}

//----- (0045855F) --------------------------------------------------------
void ActiveOverlay::Reset() {
this->indexToOverlayList = 0;
Expand Down
1 change: 0 additions & 1 deletion src/Engine/Graphics/Overlays.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ struct OverlayDesc {
};

struct OverlayList {
bool FromFileTxt(const char *Args);
void InitializeSprites();

std::vector<OverlayDesc> pOverlays;
Expand Down
101 changes: 0 additions & 101 deletions src/Engine/Objects/Monsters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,107 +291,6 @@ int ParseSpecialAttack(char *spec_att_str) {
return 0;
}

//----- (004598FC) --------------------------------------------------------
bool MonsterList::FromFileTxt(const char *Args) {
FILE *v3; // eax@1
unsigned int v4; // esi@3
void *v5; // eax@9
FILE *v6; // ST14_4@11
char *i; // eax@11
signed int v8; // esi@12
uint16_t v9; // ax@16
const char *v10; // ST18_4@16
uint16_t v11; // ax@16
const char *v12; // ST14_4@16
uint16_t v13; // ax@16
const char *v14; // ST10_4@16
int16_t v15; // ax@16
const char *v16; // ST0C_4@16
int v17; // esi@16
uint8_t v18; // al@16
signed int v19; // esi@16
uint16_t v20; // ax@17
int v21; // ecx@17
char Buf[490]; // [sp+4h] [bp-304h]@3
FrameTableTxtLine v24; // [sp+1F8h] [bp-110h]@4
FrameTableTxtLine v25; // [sp+274h] [bp-94h]@4
int v26; // [sp+2F0h] [bp-18h]@16
FILE *File; // [sp+304h] [bp-4h]@1
unsigned int Argsa; // [sp+310h] [bp+8h]@3
int Argsb; // [sp+310h] [bp+8h]@16

v3 = fopen(Args, "r");
File = v3;
if (!v3) Error("MonsterRaceListStruct::load - Unable to open file: %s.");

v4 = 0;
Argsa = 0;
if (fgets(Buf, sizeof(Buf), v3)) {
do {
*strchr(Buf, 10) = 0;
memcpy(&v25, frame_table_txt_parser(Buf, &v24), sizeof(v25));
if (v25.uPropCount && *v25.pProperties[0] != 47) ++Argsa;
} while (fgets(Buf, sizeof(Buf), File));
v4 = Argsa;
}

v6 = File;
fseek(v6, 0, 0);
MonsterId monsterId = MONSTER_INVALID;
for (i = fgets(Buf, sizeof(Buf), File); i; i = fgets(Buf, sizeof(Buf), File)) {
*strchr(Buf, 10) = 0;
memcpy(&v25, frame_table_txt_parser(Buf, &v24), sizeof(v25));
v8 = 0;
if (v25.uPropCount && *v25.pProperties[0] != 47) {
monsterId = static_cast<MonsterId>(std::to_underlying(monsterId) + 1);
MonsterDesc &monster = this->pMonsters[monsterId];

monster.pMonsterName = v25.pProperties[0];

constexpr std::array<std::pair<ActorAnimation, int>, 8> mapping = {{
{ANIM_Standing, 1},
{ANIM_Walking, 2},
{ANIM_Bored, 3},
{ANIM_AtkMelee, 4},
{ANIM_AtkRanged, 4},
{ANIM_GotHit, 5},
{ANIM_Dying, 6},
{ANIM_Dead, 7},
}};

do {
monster.pSpriteNames[mapping[v8].first] = v25.pProperties[mapping[v8].second];
++v8;
} while (v8 < 8);
v9 = atoi(v25.pProperties[8]);
v10 = v25.pProperties[9];
monster.uMonsterHeight = v9;
v11 = atoi(v10);
v12 = v25.pProperties[10];
monster.uMovementSpeed = v11;
v13 = atoi(v12);
v14 = v25.pProperties[11];
monster.uMonsterRadius = v13;
v15 = atoi(v14);
v16 = v25.pProperties[12];
monster.uToHitRadius = v15;
v17 = (uint8_t)atoi(v16);
Argsb = atoi(v25.pProperties[13]) & 0xFF;
v26 = atoi(v25.pProperties[14]) & 0xFF;
v18 = atoi(v25.pProperties[15]);
monster.sTintColor = Color(v18, v26, Argsb, v17);
v19 = 0;
do {
v20 = atoi(v25.pProperties[v19 + 16]);
v21 = v19++;
monster.pSoundSampleIDs[v21] = v20;
} while (v19 < 4);
}
}
fclose(File);
return 1;
}

//----- (004563FF) --------------------------------------------------------
MonsterId MonsterStats::FindMonsterByTextureName(const std::string &monster_textr_name) {
for (MonsterId i : pInfos.indices()) {
Expand Down
1 change: 0 additions & 1 deletion src/Engine/Objects/Monsters.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ struct MonsterDesc {

struct MonsterList {
MonsterId GetMonsterIDByName(const std::string &pMonsterName);
bool FromFileTxt(const char *Args);

IndexedArray<MonsterDesc, MONSTER_FIRST, MONSTER_LAST> pMonsters;
};
Expand Down
Loading

0 comments on commit ba457aa

Please sign in to comment.