Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone fixes #1155

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ endif()
add_subdirectory(deps/baseconfig EXCLUDE_FROM_ALL)

if(ICU_FOUND)
target_link_libraries(base PRIVATE ICU::data ICU::i18n ICU::io ICU::tu ICU::uc)
target_compile_definitions(base PRIVATE -DBUILD_WITH_ICU)
endif()

Expand Down
2 changes: 1 addition & 1 deletion deps/baseconfig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ endif()

# We don't need to link anything if we have win32 threads. Affects MinGW builds primarily.
if(CMAKE_USE_PTHREADS_INIT AND NOT CMAKE_USE_WIN32_THREADS_INIT)
target_link_libraries(base Threads::Threads)
target_link_libraries(base PRIVATE Threads::Threads)
endif()

# Check for best macro that expands to current function name.
Expand Down
2 changes: 2 additions & 0 deletions deps/baseconfig/src/unichar.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
#ifndef BASE_UNICHAR_H
#define BASE_UNICHAR_H
#include <wchar.h>
#include <string.h>

#ifdef U_CHAR
#error U_CHAR has been defined before
#endif

#ifdef BUILD_WITH_ICU
#include <unicode/uchar.h>
#include <unicode/ustring.h>
typedef UChar unichar_t;
#define U_CHAR(str) (u##str)
#elif defined _WIN32
Expand Down
172 changes: 172 additions & 0 deletions src/game/client/fxlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ static const FieldParse s_theFXListFieldParse[] = {
{ "TerrainScorch", reinterpret_cast<inifieldparse_t>(PICK_ADDRESS(0x004CAC80, 0x00760F20)) /*&TerrainScorchFXNugget::Parse */, nullptr, 0 },
{ "ParticleSystem", reinterpret_cast<inifieldparse_t>(PICK_ADDRESS(0x004CAE10, 0x00761350)) /*&ParticleSystemFXNugget::Parse */, nullptr, 0 },
{ "FXListAtBonePos", reinterpret_cast<inifieldparse_t>(PICK_ADDRESS(0x004CB8E0, 0x00761D00)) /*&FXListAtBonePosFXNugget::Parse */, nullptr, 0 },
#else // DUMMIES
// { "RayEffect", &RayEffectFXNugget::Parse, nullptr, 0 },
{ "Tracer", &TracerFXNugget::Parse, nullptr, 0 },
{ "LightPulse", &LightPulseFXNugget::Parse, nullptr, 0 },
{ "ViewShake", &ViewShakeFXNugget::Parse, nullptr, 0 },
{ "TerrainScorch", &TerrainScorchFXNugget::Parse, nullptr, 0 },
{ "ParticleSystem", &ParticleSystemFXNugget::Parse, nullptr, 0 },
{ "FXListAtBonePos", &FXListAtBonePosFXNugget::Parse, nullptr, 0 },
#endif
{ nullptr, nullptr, nullptr, 0 },
};
Expand Down Expand Up @@ -132,3 +140,167 @@ void SoundFXNugget::Parse(INI *ini, void *formal, void *, const void *)
ini->Init_From_INI(nugget, _fieldParse);
reinterpret_cast<FXList *>(formal)->Add_FXNugget(nugget);
}

void TracerFXNugget::Do_FX_Pos(
const Coord3D *primary, const Matrix3D *primary_mtx, float primary_speed, const Coord3D *secondary, float radius) const
{
captainslog_dbgassert(false, "TracerFXNugget::Do_FX_Pos not implemented!");
}

void TracerFXNugget::Do_FX_Obj(const Object *primary, const Object *secondary) const
{
captainslog_dbgassert(false, "TracerFXNugget::Do_FX_Obj not implemented!");
}

void TracerFXNugget::Parse(INI *ini, void *formal, void *, const void *)
{
static const FieldParse _fieldParse[] = {
{ "DecayAt", &INI::Parse_Int, nullptr, offsetof(TracerFXNugget, m_decayAt) },
{ "Length", &INI::Parse_Int, nullptr, offsetof(TracerFXNugget, m_length) },
{ "Width", &INI::Parse_Real, nullptr, offsetof(TracerFXNugget, m_width) },
{ "Color", &INI::Parse_RGB_Color, nullptr, offsetof(TracerFXNugget, m_color) },
{ "Speed", &INI::Parse_Int, nullptr, offsetof(TracerFXNugget, speed) },
{ "Probability", &INI::Parse_Real, nullptr, offsetof(TracerFXNugget, probability) },
{ nullptr, nullptr, nullptr, 0 },
};

TracerFXNugget *nugget = new TracerFXNugget{};
ini->Init_From_INI(nugget, _fieldParse);
reinterpret_cast<FXList *>(formal)->Add_FXNugget(nugget);
}

void LightPulseFXNugget::Do_FX_Pos(
const Coord3D *primary, const Matrix3D *primary_mtx, float primary_speed, const Coord3D *secondary, float radius) const
{
captainslog_dbgassert(false, "LightPulseFXNugget::Do_FX_Pos not implemented!");
}

void LightPulseFXNugget::Do_FX_Obj(const Object *primary, const Object *secondary) const
{
captainslog_dbgassert(false, "LightPulseFXNugget::Do_FX_Obj not implemented!");
}

void LightPulseFXNugget::Parse(INI *ini, void *formal, void *, const void *)
{
static const FieldParse _fieldParse[] = {
{ "Color", &INI::Parse_RGB_Color, nullptr, offsetof(LightPulseFXNugget, m_color) },
{ "Radius", &INI::Parse_Int, nullptr, offsetof(LightPulseFXNugget, m_radius) },
{ "RadiusAsPercentOfObjectSize",
&INI::Parse_Percent_To_Real,
nullptr,
offsetof(LightPulseFXNugget, m_radiusAsPercentOfObjectSize) },
{ "IncreaseTime", &INI::Parse_Int, nullptr, offsetof(LightPulseFXNugget, m_increaseTime) },
{ "DecreaseTime", &INI::Parse_Int, nullptr, offsetof(LightPulseFXNugget, m_decreaseTime) },
{ nullptr, nullptr, nullptr, 0 },
};

LightPulseFXNugget *nugget = new LightPulseFXNugget{};
ini->Init_From_INI(nugget, _fieldParse);
reinterpret_cast<FXList *>(formal)->Add_FXNugget(nugget);
}

void ViewShakeFXNugget::Do_FX_Pos(
const Coord3D *primary, const Matrix3D *primary_mtx, float primary_speed, const Coord3D *secondary, float radius) const
{
captainslog_dbgassert(false, "ViewShakeFXNugget::Do_FX_Pos not implemented!");
}

void ViewShakeFXNugget::Do_FX_Obj(const Object *primary, const Object *secondary) const
{
captainslog_dbgassert(false, "ViewShakeFXNugget::Do_FX_Obj not implemented!");
}

void ViewShakeFXNugget::Parse(INI *ini, void *formal, void *, const void *)
{
static const FieldParse _fieldParse[] = {
{ "Type", &INI::Parse_Index_List, g_shakeIntensityNames, offsetof(ViewShakeFXNugget, m_type) },
{ nullptr, nullptr, nullptr, 0 },
};

ViewShakeFXNugget *nugget = new ViewShakeFXNugget{};
ini->Init_From_INI(nugget, _fieldParse);
reinterpret_cast<FXList *>(formal)->Add_FXNugget(nugget);
}

void TerrainScorchFXNugget::Do_FX_Pos(
const Coord3D *primary, const Matrix3D *primary_mtx, float primary_speed, const Coord3D *secondary, float radius) const
{
captainslog_dbgassert(false, "TerrainScorchFXNugget::Do_FX_Pos not implemented!");
}

void TerrainScorchFXNugget::Do_FX_Obj(const Object *primary, const Object *secondary) const
{
captainslog_dbgassert(false, "TerrainScorchFXNugget::Do_FX_Obj not implemented!");
}

void TerrainScorchFXNugget::Parse(INI *ini, void *formal, void *, const void *)
{
static const FieldParse _fieldParse[] = {
{ "Type", &INI::Parse_AsciiString, nullptr, offsetof(TerrainScorchFXNugget, m_type) },
{ "Radius", &INI::Parse_Int, nullptr, offsetof(TerrainScorchFXNugget, m_radius) },
{ nullptr, nullptr, nullptr, 0 },
};

TerrainScorchFXNugget *nugget = new TerrainScorchFXNugget{};
ini->Init_From_INI(nugget, _fieldParse);
reinterpret_cast<FXList *>(formal)->Add_FXNugget(nugget);
}

void ParticleSystemFXNugget::Do_FX_Pos(
const Coord3D *primary, const Matrix3D *primary_mtx, float primary_speed, const Coord3D *secondary, float radius) const
{
captainslog_dbgassert(false, "ParticleSystemFXNugget::Do_FX_Pos not implemented!");
}

void ParticleSystemFXNugget::Do_FX_Obj(const Object *primary, const Object *secondary) const
{
captainslog_dbgassert(false, "ParticleSystemFXNugget::Do_FX_Obj not implemented!");
}

void ParticleSystemFXNugget::Parse(INI *ini, void *formal, void *, const void *)
{
static const FieldParse _fieldParse[] = {
{ "Name", &INI::Parse_AsciiString, nullptr, offsetof(ParticleSystemFXNugget, m_sysName) },
{ "Count", &INI::Parse_Int, nullptr, offsetof(ParticleSystemFXNugget, m_count) },
{ "Radius", &GameClientRandomVariable::Parse, nullptr, offsetof(ParticleSystemFXNugget, m_radius) },
{ "InitialDelay", &GameClientRandomVariable::Parse, nullptr, offsetof(ParticleSystemFXNugget, m_initialDelay) },
{ "AttachToObject", &INI::Parse_Bool, nullptr, offsetof(ParticleSystemFXNugget, m_attachToObject) },
{ "Offset", &INI::Parse_Coord3D, nullptr, offsetof(ParticleSystemFXNugget, m_offset) },
{ "Height", &GameClientRandomVariable::Parse, nullptr, offsetof(ParticleSystemFXNugget, m_height) },
{ "OrientToObject", &INI::Parse_Bool, nullptr, offsetof(ParticleSystemFXNugget, m_orientToObject) },
{ "RotateY", &INI::Parse_Angle_Real, nullptr, offsetof(ParticleSystemFXNugget, m_rotateY) },
{ "Ricochet", &INI::Parse_Bool, nullptr, offsetof(ParticleSystemFXNugget, m_ricochet) },
{ "CreateAtGroundHeight", &INI::Parse_Bool, nullptr, offsetof(ParticleSystemFXNugget, m_createAtGroundHeight) },
{ "UseCallersRadius", &INI::Parse_Bool, nullptr, offsetof(ParticleSystemFXNugget, m_useCallersRadius) },
{ nullptr, nullptr, nullptr, 0 },
};

ParticleSystemFXNugget *nugget = new ParticleSystemFXNugget{};
ini->Init_From_INI(nugget, _fieldParse);
reinterpret_cast<FXList *>(formal)->Add_FXNugget(nugget);
}

void FXListAtBonePosFXNugget::Do_FX_Pos(
const Coord3D *primary, const Matrix3D *primary_mtx, float primary_speed, const Coord3D *secondary, float radius) const
{
captainslog_dbgassert(false, "FXListAtBonePosFXNugget::Do_FX_Pos not implemented!");
}

void FXListAtBonePosFXNugget::Do_FX_Obj(const Object *primary, const Object *secondary) const
{
captainslog_dbgassert(false, "FXListAtBonePosFXNugget::Do_FX_Obj not implemented!");
}

void FXListAtBonePosFXNugget::Parse(INI *ini, void *formal, void *, const void *)
{
static const FieldParse _fieldParse[] = {
{ "FX", &FXList::Parse, nullptr, offsetof(FXListAtBonePosFXNugget, m_fx) },
{ "BoneName", &INI::Parse_AsciiString, nullptr, offsetof(FXListAtBonePosFXNugget, m_boneName) },
{ "OrientToBone", &INI::Parse_Bool, nullptr, offsetof(FXListAtBonePosFXNugget, m_orientToBone) },
{ nullptr, nullptr, nullptr, 0 },
};

FXListAtBonePosFXNugget *nugget = new FXListAtBonePosFXNugget{};
ini->Init_From_INI(nugget, _fieldParse);
reinterpret_cast<FXList *>(formal)->Add_FXNugget(nugget);
}
Loading
Loading