Вопрос Чамсы крашат о_О

Участник
Статус
Оффлайн
Регистрация
22 Дек 2018
Сообщения
617
Реакции[?]
182
Поинты[?]
12K
Код:
#include "chams.hpp"
#include <fstream>

#include "../valve_sdk/csgostructs.hpp"
#include "../options.hpp"
#include "../hooks.hpp"
#include "../helpers/input.hpp"
Chams::Chams() {
    materialRegular = g_MatSystem->FindMaterial("debug/debugambientcube", "Model textures");
    materialFlat = g_MatSystem->FindMaterial("debug/debugdrawflat", "Model textures");
    materialGold = g_MatSystem->FindMaterial("models/inventory_items/trophy_majors/gold", TEXTURE_GROUP_OTHER);
    materialGlass = g_MatSystem->FindMaterial("models/inventory_items/cologne_prediction/cologne_prediction_glass", TEXTURE_GROUP_OTHER);
    materialGloss = g_MatSystem->FindMaterial("models/inventory_items/trophy_majors/gloss", TEXTURE_GROUP_OTHER);
    materialCrystal = g_MatSystem->FindMaterial("models/inventory_items/trophy_majors/crystal_clear", TEXTURE_GROUP_OTHER);
    materialCrystalBlue = g_MatSystem->FindMaterial("models/inventory_items/trophy_majors/crystal_blue", TEXTURE_GROUP_OTHER);
    materialSilver = g_MatSystem->FindMaterial("models/inventory_items/hydra_crystal/hydra_crystal_detail", TEXTURE_GROUP_OTHER);
}

Chams::~Chams()
{
}




void Chams::OverrideMaterial(bool ignoreZ, bool flat, bool wireframe, bool glass, const Color& rgba, bool modulate, bool gold, bool crystal, bool crystal2, bool silver)
{
    IMaterial* material = nullptr;

    if (modulate) {
        if (flat)
            material = materialFlat;
        else if (gold)
            material = materialGold;
        else if (crystal)
            material = materialCrystal;
        else if (glass)
            material = materialGlass;
        else if (crystal2)
            material = materialCrystalBlue;
        else if (silver)
            material = materialSilver;
        else
            material = materialRegular;
    }

    bool bFound = false;
    IMaterialVar* pMatVar = material->FindVar("$envmaptint", &bFound);


    material->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, ignoreZ);
    material->SetMaterialVarFlag(MATERIAL_VAR_WIREFRAME, wireframe);
    material->ColorModulate(
        rgba.r() / 255.0f,
        rgba.g() / 255.0f,
        rgba.b() / 255.0f);

    material->AlphaModulate(
        rgba.a() / 255.0f);

    material->IncrementReferenceCount();

    g_MdlRender->ForcedMaterialOverride(material);
}





void Chams::OnDrawModelExecute(IMatRenderContext* ctx, const DrawModelState_t& state, const ModelRenderInfo_t& info, matrix3x4_t* matrix) {
    static auto fnDME = Hooks::mdlrender_hook.GetOriginal<decltype(&Hooks::hkDrawModelExecute)>();

    const auto mdl = info.pModel;

    bool is_arm = strstr(mdl->szName, "arms") != nullptr;
    bool is_player = strstr(mdl->szName, "models/player") != nullptr;
    bool is_sleeve = strstr(mdl->szName, "sleeve") != nullptr;
    bool is_weapon = strstr(mdl->szName, "weapons/v_") != nullptr;

    if (is_player && g_Options.chams_player_enabled) {

        auto ent = C_BasePlayer::GetPlayerByIndex(info.entity_index);

        if (ent && g_LocalPlayer && ent->IsAlive()) {

            const auto enemy = ent->m_iTeamNum() != g_LocalPlayer->m_iTeamNum();
            const auto clr_front = enemy ? Color(g_Options.color_chams_player_enemy_visible) : Color(g_Options.color_chams_player_ally_visible);
            const auto clr_back = enemy ? Color(g_Options.color_chams_player_enemy_occluded) : Color(g_Options.color_chams_player_ally_occluded);

            if (!enemy && g_Options.chams_player_enemies_only)
                return;

            if (g_Options.chams_player_enemies_player) {
                OverrideMaterial(
                    true,
                    g_Options.chams_player_flat,
                    g_Options.chams_player_wireframe,
                    g_Options.chams_player_glass,
                    clr_back,
                    g_Options.chams_player_modulate,
                    g_Options.chams_player_gold,
                    g_Options.chams_player_crystal,
                    g_Options.chams_player_crystal2,
                    g_Options.chams_player_silver
                );

                fnDME(g_MdlRender, 0, ctx, state, info, matrix);

                g_MdlRender->ForcedMaterialOverride(nullptr);

                OverrideMaterial(
                    false,
                    g_Options.chams_player_flat,
                    g_Options.chams_player_wireframe,
                    g_Options.chams_player_glass,
                    clr_front,
                    g_Options.chams_player_modulate,
                    g_Options.chams_player_gold,
                    g_Options.chams_player_crystal,
                    g_Options.chams_player_crystal2,
                    g_Options.chams_player_silver
                    );
            }
            else {
                OverrideMaterial(
                    false,
                    g_Options.chams_player_flat,
                    g_Options.chams_player_wireframe,
                    g_Options.chams_player_glass,


                    clr_front,
                    false,
                    false,
                    false,
                    false,
                    false);
            }
        }
    }
    else if (is_sleeve && g_Options.chams_sleeves_enabled) {

        OverrideMaterial(
            false,
            g_Options.chams_sleeves_flat,
            false,
            false,
            Color(g_Options.color_chams_sleeves),
            true,
            false,
            false,
            false,
            false
        );
    }
    else if (!is_arm && !is_sleeve && is_weapon && g_Options.chams_weapon_enabled)
    {
        OverrideMaterial(
            false,
            g_Options.chams_weapon_flat,
            false,
            false,
            Color(g_Options.color_chams_weapons),
            true,
            false,
            false,
            false,
            false
        );
    }
    else if (is_arm && !is_sleeve) {
        auto material = g_MatSystem->FindMaterial(mdl->szName, TEXTURE_GROUP_MODEL);
        if (!material)
            return;
        if (g_Options.other_no_hands) {
            material->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
            g_MdlRender->ForcedMaterialOverride(material);
        }
        else if (g_Options.other_hand_chams) {

            OverrideMaterial(
                false,
                g_Options.chams_hand_flat,
                false,
                false,
                Color(g_Options.color_chams_hands),
                true,
                false,
                false,
                false,
                false
            );
        }
    }

    bool forced_mat = !g_MdlRender->IsForcedMaterialOverride();
    if (forced_mat) {
    

        if (forced_mat)
            g_MdlRender->ForcedMaterialOverride(NULL);
    }

}
Код:
#pragma once

#include "../singleton.hpp"

class IMatRenderContext;
struct DrawModelState_t;
struct ModelRenderInfo_t;
class matrix3x4_t;
class IMaterial;
class Color;

class Chams
    : public Singleton<Chams>
{
    friend class Singleton<Chams>;

    Chams();
    ~Chams();

public:
    void OnDrawModelExecute(
        IMatRenderContext* ctx,
        const DrawModelState_t& state,
        const ModelRenderInfo_t& pInfo,
        matrix3x4_t* pCustomBoneToWorld
    );

private:
    void OverrideMaterial(bool ignoreZ, bool flat, bool wireframe, bool glass, const Color& rgba, bool modulate, bool gold, bool crystal , bool crystal2,  bool silver);

    IMaterial* materialRegular = nullptr;
    IMaterial* materialRegularIgnoreZ = nullptr;
    IMaterial* materialFlatIgnoreZ = nullptr;
    IMaterial* materialFlat = nullptr;
    IMaterial* materialGold = nullptr;
    IMaterial* materialGlass = nullptr;
    IMaterial* materialGloss = nullptr;
    IMaterial* materialCrystal = nullptr;
    IMaterial* materialCrystalBlue = nullptr;
    IMaterial* materialSilver = nullptr;
};
 
Пользователь
Статус
Оффлайн
Регистрация
19 Авг 2020
Сообщения
193
Реакции[?]
40
Поинты[?]
0
Необходима минимальная информация, банально где именно крашит? Вообще по хорошему данные с отладки дай, тогда и можно будет нормально посмотреть что не так.
 
coder of the year
Участник
Статус
Оффлайн
Регистрация
13 Мар 2019
Сообщения
886
Реакции[?]
266
Поинты[?]
4K
мужик что это за параша, я даже читать это не могу, возьми нормальную систему чамсов от ревива
поменяй код в overridematerial на

C++:
   IMaterial* material = nullptr;

   if (modulate) {
        if (flat)
            material = materialFlat;
        else if (gold)
            material = materialGold;
        else if (crystal)
            material = materialCrystal;
        else if (glass)
            material = materialGlass;
        else if (crystal2)
            material = materialCrystalBlue;
        else if (silver)
            material = materialSilver;
        else
            material = materialRegular;

    bool bFound = false;
    IMaterialVar* pMatVar = material->FindVar("$envmaptint", &bFound);


    material->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, ignoreZ);
    material->SetMaterialVarFlag(MATERIAL_VAR_WIREFRAME, wireframe);
    material->ColorModulate(
        rgba.r() / 255.0f,
        rgba.g() / 255.0f,
        rgba.b() / 255.0f);

    material->AlphaModulate(
        rgba.a() / 255.0f);

    material->IncrementReferenceCount();

    g_MdlRender->ForcedMaterialOverride(material);
}
возможно из за этого, ибо без modulate у тебя будет нуллптр материал накладываться
 
Последнее редактирование:
Участник
Статус
Оффлайн
Регистрация
22 Дек 2018
Сообщения
617
Реакции[?]
182
Поинты[?]
12K
Необходима минимальная информация, банально где именно крашит? Вообще по хорошему данные с отладки дай, тогда и можно будет нормально посмотреть что не так.
Дебаг для начала
в дебаге.............. просто чамсы не работают о_О
до этого было так (не крашило)
C++:
#include "chams.hpp"
#include <fstream>

#include "../valve_sdk/csgostructs.hpp"
#include "../options.hpp"
#include "../hooks.hpp"
#include "../helpers/input.hpp"
Chams::Chams() {
    materialRegular = g_MatSystem->FindMaterial("debug/debugambientcube", "Model textures");
    materialFlat = g_MatSystem->FindMaterial("debug/debugdrawflat", "Model textures");
    materialGold = g_MatSystem->FindMaterial("models/inventory_items/trophy_majors/gold", TEXTURE_GROUP_OTHER);
    materialGlass = g_MatSystem->FindMaterial("models/inventory_items/cologne_prediction/cologne_prediction_glass", TEXTURE_GROUP_OTHER);
    materialGloss = g_MatSystem->FindMaterial("models/inventory_items/trophy_majors/gloss", TEXTURE_GROUP_OTHER);
    materialCrystal = g_MatSystem->FindMaterial("models/inventory_items/trophy_majors/crystal_clear", TEXTURE_GROUP_OTHER);
    materialCrystalBlue = g_MatSystem->FindMaterial("models/inventory_items/trophy_majors/crystal_blue", TEXTURE_GROUP_OTHER);
    materialSilver = g_MatSystem->FindMaterial("models/inventory_items/hydra_crystal/hydra_crystal_detail", TEXTURE_GROUP_OTHER);
}

Chams::~Chams()
{
}




void Chams::OverrideMaterial(bool ignoreZ, bool flat, bool wireframe, bool glass, const Color& rgba, bool modulate, bool gold, bool crystal, bool crystal2, bool silver)
{
    IMaterial* material = nullptr;

    if (modulate) {
        if (flat)
            material = materialFlat;
        else if (gold)
            material = materialGold;
        else if (crystal)
            material = materialCrystal;
        else if (glass)
            material = materialGlass;
        else if (crystal2)
            material = materialCrystalBlue;
        else if (silver)
            material = materialSilver;
        else
            material = materialRegular;
    }

    bool bFound = false;
    IMaterialVar* pMatVar = material->FindVar("$envmaptint", &bFound);


    material->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, ignoreZ);

    material->SetMaterialVarFlag(MATERIAL_VAR_WIREFRAME, wireframe);
    material->ColorModulate(
        rgba.r() / 255.0f,
        rgba.g() / 255.0f,
        rgba.b() / 255.0f);

    material->AlphaModulate(
        rgba.a() / 255.0f);

    material->IncrementReferenceCount();

    g_MdlRender->ForcedMaterialOverride(material);
}





void Chams::OnDrawModelExecute(IMatRenderContext* ctx, const DrawModelState_t& state, const ModelRenderInfo_t& info, matrix3x4_t* matrix) {
    static auto fnDME = Hooks::mdlrender_hook.GetOriginal<decltype(&Hooks::hkDrawModelExecute)>();

    const auto mdl = info.pModel;

    bool is_arm = strstr(mdl->szName, "arms") != nullptr;
    bool is_player = strstr(mdl->szName, "models/player") != nullptr;
    bool is_sleeve = strstr(mdl->szName, "sleeve") != nullptr;
    bool is_weapon = strstr(mdl->szName, "weapons/v_") != nullptr;

    if (is_player && g_Options.chams_player_enabled) {

        auto ent = C_BasePlayer::GetPlayerByIndex(info.entity_index);

        if (ent && g_LocalPlayer && ent->IsAlive()) {

            const auto enemy = ent->m_iTeamNum() != g_LocalPlayer->m_iTeamNum();
            const auto clr_front = enemy ? Color(g_Options.color_chams_player_enemy_visible) : Color(g_Options.color_chams_player_ally_visible);
            const auto clr_back = enemy ? Color(g_Options.color_chams_player_enemy_occluded) : Color(g_Options.color_chams_player_ally_occluded);

            if (!enemy && g_Options.chams_player_enemies_only)
                return;

            if (g_Options.chams_player_enemies_player) {
                OverrideMaterial(
                    true,
                    g_Options.chams_player_flat,
                    g_Options.chams_player_wireframe,
                    false,
                    clr_back);

                fnDME(g_MdlRender, 0, ctx, state, info, matrix);

                g_MdlRender->ForcedMaterialOverride(nullptr);

                OverrideMaterial(
                    false,
                    g_Options.chams_player_flat,
                    g_Options.chams_player_wireframe,

                    false,
                    clr_front);
            }
            else {
                OverrideMaterial(
                    false,
                    g_Options.chams_player_flat,
                    g_Options.chams_player_wireframe,
                    g_Options.chams_player_glass,
            

                    clr_front);
            }
        }
    }
    else if (is_sleeve && g_Options.chams_sleeves_enabled) {

        OverrideMaterial(
            false,
            g_Options.chams_sleeves_flat,
            false,
            false,
            Color(g_Options.color_chams_sleeves),
            true,
            false,
            false,
            false,
            false
        );
    }
    else if (!is_arm && !is_sleeve && is_weapon && g_Options.chams_weapon_enabled)
    {
        OverrideMaterial(
            false,
            g_Options.chams_weapon_flat,
            false,
            false,
            Color(g_Options.color_chams_weapons),
            true,
            false,
            false,
            false,
            false
        );
    }
    else if (is_arm && !is_sleeve) {
        auto material = g_MatSystem->FindMaterial(mdl->szName, TEXTURE_GROUP_MODEL);
        if (!material)
            return;
        if (g_Options.other_no_hands) {
            material->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
            g_MdlRender->ForcedMaterialOverride(material);
        }
        else if (g_Options.other_hand_chams) {

            OverrideMaterial(
                false,
                g_Options.chams_hand_flat,
                false,
                false,
                Color(g_Options.color_chams_hands),
                true,
                false,
                false,
                false,
                false
            );
        }
    }

    bool forced_mat = !g_MdlRender->IsForcedMaterialOverride();
    if (forced_mat) {
    

        if (forced_mat)
            g_MdlRender->ForcedMaterialOverride(NULL);
    }

}
C++:
#pragma once

#include "../singleton.hpp"

class IMatRenderContext;
struct DrawModelState_t;
struct ModelRenderInfo_t;
class matrix3x4_t;
class IMaterial;
class Color;

class Chams
    : public Singleton<Chams>
{
    friend class Singleton<Chams>;

    Chams();
    ~Chams();

public:
    void OnDrawModelExecute(
        IMatRenderContext* ctx,
        const DrawModelState_t& state,
        const ModelRenderInfo_t& pInfo,
        matrix3x4_t* pCustomBoneToWorld
    );

private:
    void OverrideMaterial(bool ignoreZ, bool flat, bool wireframe, bool glass, const Color& rgba, bool modulate = true, bool gold = false, bool crystal = false, bool crystal2 = false, bool silver = false);

    IMaterial* materialRegular = nullptr;
    IMaterial* materialRegularIgnoreZ = nullptr;
    IMaterial* materialFlatIgnoreZ = nullptr;
    IMaterial* materialFlat = nullptr;
    IMaterial* materialGold = nullptr;
    IMaterial* materialGlass = nullptr;
    IMaterial* materialGloss = nullptr;
    IMaterial* materialCrystal = nullptr;
    IMaterial* materialCrystalBlue = nullptr;
    IMaterial* materialSilver = nullptr;
};
я попытался добавить виды чамсов и оно начало крашить =(
 
Последнее редактирование:
EVOLUTION ?
Забаненный
Статус
Оффлайн
Регистрация
30 Июл 2019
Сообщения
1,162
Реакции[?]
269
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
#include "chams.hpp"
#include <fstream>

#include "../valve_sdk/csgostructs.hpp"
#include "../options.hpp"
#include "../hooks.hpp"
#include "../helpers/input.hpp"
Chams::Chams() {
    materialRegular = g_MatSystem->FindMaterial("debug/debugambientcube", "Model textures");
    materialFlat = g_MatSystem->FindMaterial("debug/debugdrawflat", "Model textures");
    materialGold = g_MatSystem->FindMaterial("models/inventory_items/trophy_majors/gold", TEXTURE_GROUP_OTHER);
    materialGlass = g_MatSystem->FindMaterial("models/inventory_items/cologne_prediction/cologne_prediction_glass", TEXTURE_GROUP_OTHER);
    materialGloss = g_MatSystem->FindMaterial("models/inventory_items/trophy_majors/gloss", TEXTURE_GROUP_OTHER);
    materialCrystal = g_MatSystem->FindMaterial("models/inventory_items/trophy_majors/crystal_clear", TEXTURE_GROUP_OTHER);
    materialCrystalBlue = g_MatSystem->FindMaterial("models/inventory_items/trophy_majors/crystal_blue", TEXTURE_GROUP_OTHER);
    materialSilver = g_MatSystem->FindMaterial("models/inventory_items/hydra_crystal/hydra_crystal_detail", TEXTURE_GROUP_OTHER);
}

Chams::~Chams()
{
}




void Chams::OverrideMaterial(bool ignoreZ, bool flat, bool wireframe, bool glass, const Color& rgba, bool modulate, bool gold, bool crystal, bool crystal2, bool silver)
{
    IMaterial* material = nullptr;

    if (modulate) {
        if (flat)
            material = materialFlat;
        else if (gold)
            material = materialGold;
        else if (crystal)
            material = materialCrystal;
        else if (glass)
            material = materialGlass;
        else if (crystal2)
            material = materialCrystalBlue;
        else if (silver)
            material = materialSilver;
        else
            material = materialRegular;
    }

    bool bFound = false;
    IMaterialVar* pMatVar = material->FindVar("$envmaptint", &bFound);


    material->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, ignoreZ);
    material->SetMaterialVarFlag(MATERIAL_VAR_WIREFRAME, wireframe);
    material->ColorModulate(
        rgba.r() / 255.0f,
        rgba.g() / 255.0f,
        rgba.b() / 255.0f);

    material->AlphaModulate(
        rgba.a() / 255.0f);

    material->IncrementReferenceCount();

    g_MdlRender->ForcedMaterialOverride(material);
}





void Chams::OnDrawModelExecute(IMatRenderContext* ctx, const DrawModelState_t& state, const ModelRenderInfo_t& info, matrix3x4_t* matrix) {
    static auto fnDME = Hooks::mdlrender_hook.GetOriginal<decltype(&Hooks::hkDrawModelExecute)>();

    const auto mdl = info.pModel;

    bool is_arm = strstr(mdl->szName, "arms") != nullptr;
    bool is_player = strstr(mdl->szName, "models/player") != nullptr;
    bool is_sleeve = strstr(mdl->szName, "sleeve") != nullptr;
    bool is_weapon = strstr(mdl->szName, "weapons/v_") != nullptr;

    if (is_player && g_Options.chams_player_enabled) {

        auto ent = C_BasePlayer::GetPlayerByIndex(info.entity_index);

        if (ent && g_LocalPlayer && ent->IsAlive()) {

            const auto enemy = ent->m_iTeamNum() != g_LocalPlayer->m_iTeamNum();
            const auto clr_front = enemy ? Color(g_Options.color_chams_player_enemy_visible) : Color(g_Options.color_chams_player_ally_visible);
            const auto clr_back = enemy ? Color(g_Options.color_chams_player_enemy_occluded) : Color(g_Options.color_chams_player_ally_occluded);

            if (!enemy && g_Options.chams_player_enemies_only)
                return;

            if (g_Options.chams_player_enemies_player) {
                OverrideMaterial(
                    true,
                    g_Options.chams_player_flat,
                    g_Options.chams_player_wireframe,
                    g_Options.chams_player_glass,
                    clr_back,
                    g_Options.chams_player_modulate,
                    g_Options.chams_player_gold,
                    g_Options.chams_player_crystal,
                    g_Options.chams_player_crystal2,
                    g_Options.chams_player_silver
                );

                fnDME(g_MdlRender, 0, ctx, state, info, matrix);

                g_MdlRender->ForcedMaterialOverride(nullptr);

                OverrideMaterial(
                    false,
                    g_Options.chams_player_flat,
                    g_Options.chams_player_wireframe,
                    g_Options.chams_player_glass,
                    clr_front,
                    g_Options.chams_player_modulate,
                    g_Options.chams_player_gold,
                    g_Options.chams_player_crystal,
                    g_Options.chams_player_crystal2,
                    g_Options.chams_player_silver
                    );
            }
            else {
                OverrideMaterial(
                    false,
                    g_Options.chams_player_flat,
                    g_Options.chams_player_wireframe,
                    g_Options.chams_player_glass,


                    clr_front,
                    false,
                    false,
                    false,
                    false,
                    false);
            }
        }
    }
    else if (is_sleeve && g_Options.chams_sleeves_enabled) {

        OverrideMaterial(
            false,
            g_Options.chams_sleeves_flat,
            false,
            false,
            Color(g_Options.color_chams_sleeves),
            true,
            false,
            false,
            false,
            false
        );
    }
    else if (!is_arm && !is_sleeve && is_weapon && g_Options.chams_weapon_enabled)
    {
        OverrideMaterial(
            false,
            g_Options.chams_weapon_flat,
            false,
            false,
            Color(g_Options.color_chams_weapons),
            true,
            false,
            false,
            false,
            false
        );
    }
    else if (is_arm && !is_sleeve) {
        auto material = g_MatSystem->FindMaterial(mdl->szName, TEXTURE_GROUP_MODEL);
        if (!material)
            return;
        if (g_Options.other_no_hands) {
            material->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
            g_MdlRender->ForcedMaterialOverride(material);
        }
        else if (g_Options.other_hand_chams) {

            OverrideMaterial(
                false,
                g_Options.chams_hand_flat,
                false,
                false,
                Color(g_Options.color_chams_hands),
                true,
                false,
                false,
                false,
                false
            );
        }
    }

    bool forced_mat = !g_MdlRender->IsForcedMaterialOverride();
    if (forced_mat) {
  

        if (forced_mat)
            g_MdlRender->ForcedMaterialOverride(NULL);
    }

}
Код:
#pragma once

#include "../singleton.hpp"

class IMatRenderContext;
struct DrawModelState_t;
struct ModelRenderInfo_t;
class matrix3x4_t;
class IMaterial;
class Color;

class Chams
    : public Singleton<Chams>
{
    friend class Singleton<Chams>;

    Chams();
    ~Chams();

public:
    void OnDrawModelExecute(
        IMatRenderContext* ctx,
        const DrawModelState_t& state,
        const ModelRenderInfo_t& pInfo,
        matrix3x4_t* pCustomBoneToWorld
    );

private:
    void OverrideMaterial(bool ignoreZ, bool flat, bool wireframe, bool glass, const Color& rgba, bool modulate, bool gold, bool crystal , bool crystal2,  bool silver);

    IMaterial* materialRegular = nullptr;
    IMaterial* materialRegularIgnoreZ = nullptr;
    IMaterial* materialFlatIgnoreZ = nullptr;
    IMaterial* materialFlat = nullptr;
    IMaterial* materialGold = nullptr;
    IMaterial* materialGlass = nullptr;
    IMaterial* materialGloss = nullptr;
    IMaterial* materialCrystal = nullptr;
    IMaterial* materialCrystalBlue = nullptr;
    IMaterial* materialSilver = nullptr;
};
говно код здраствуйте.
C++:
void OverrideMaterial(bool ignoreZ, bool flat, bool wireframe, bool glass, const Color& rgba, bool modulate, bool gold, bool crystal , bool crystal2,  bool silver);
зачем?!
C++:
void OverrideMaterial(int type, bool ignore, const Color& rgba, bool modulate);
для чего ещё куча булов?!
дальше...
крашит? компили в дебаге, подключайся к процессу отладчиком и смотри стек вызовов
if (modulate) { if (flat) material = materialFlat; else if (gold) material = materialGold; else if (crystal) material = materialCrystal; else if (glass) material = materialGlass; else if (crystal2) material = materialCrystalBlue; else if (silver) material = materialSilver; else material = materialRegular; }
это, на это:
C++:
switch (type)
    {
    case 0: material = materialFlat; break;
    case 1: material = materialGold; break;
    case 2: material = materialCrystal; break;
//и т.д.
    }
в дебаге.............. просто чамсы не работают о_О
не могут чамсы не работать в дебаге, значит ты уже что-то сломал
 
Сверху Снизу