Skip to content

Commit

Permalink
Убрал ненужные дефайны,
Browse files Browse the repository at this point in the history
GetWindowLong --> GetWindowLongPtr
SetWindowLong --> SetWindowLongPtr

https://github.com/xrOxygen/xray-oxygen/commit/269b610cde6972843ff8c327607035452407e649
  • Loading branch information
xrSimpodin committed Sep 2, 2018
1 parent 8cfb312 commit 9798a84
Show file tree
Hide file tree
Showing 23 changed files with 24 additions and 119 deletions.
5 changes: 0 additions & 5 deletions ogsr_engine/COMMON/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ enum {
rsOcclusionDraw = (1ul<<12ul),
rsOcclusionStats = (1ul<<13ul),

mtSound = (1ul<<14ul),
mtPhysics = (1ul<<15ul),
mtNetwork = (1ul<<16ul),
mtParticles = (1ul<<17ul),

rsCameraPos = (1ul<<18ul),
rsR2 = (1ul<<19ul),

Expand Down
2 changes: 1 addition & 1 deletion ogsr_engine/Layers/xrRender/xrRender_console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ class CCC_BuildSSA : public IConsole_Command
//-----------------------------------------------------------------------

Flags32 ps_r2_dof_flags = { 0 };
Flags32 ps_r2_pp_flags = { DEF_R2_PP_FLAGS };
Flags32 ps_r2_pp_flags = { 0 };
Flags32 ps_service_flags = { 0 };
Flags32 ps_r2_test_flags = { 0 };
float ssa_discard = 3.5f;
Expand Down
41 changes: 0 additions & 41 deletions ogsr_engine/build_config_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@
// патроны.
#define NO_AUTO_RELOAD_WPN

// включает хранилище скриптовых переменных в сейвы
#define SCRIPT_VARS_STORAGE

// включает экспорт функции setup_game_icon в Lua
#define SCRIPT_ICONS_CONTROL

// Выключает использование анимации рассматривания болта, подкидывания гранат
// и кручения ножа, т.е. anim_playing.
#define STOP_ANIM_PLAYING
Expand All @@ -83,18 +77,10 @@
// KRodin: По умолчанию используется реализация из xp-dev, т.к. реализация из CoC лично у меня глючит.
//#define LOAD_SCRIPTS_SUBDIRS

// включает экспорт класса CEffectorZoomInertion для управления движением
// прицела
#define SCRIPT_EZI_CONTROL

// Вычисление и использование правильного положения солнца, вместо позиции из
// погодных конфигов.
#define DYNAMIC_SUN_MOVEMENT

// Выключить музыкальный эмбиент по умолчанию. Можно включить командой
// "g_music_tracks on".
#define G_MUSIC_TRACKS_OFF

// Запрещает заряжать в дробовики патроны разного типа
#define SHOTG_EXTRA_AMMO_FIX

Expand Down Expand Up @@ -199,9 +185,6 @@
// Включает вылет, если в vertex() будет передан не валидный вертекс.
//#define CRASH_ON_INVALID_VERTEX_ID

// Патроны используются только с пояса (by Karlan)
#define AMMO_FROM_BELT

// Включает раскраску предметов в окне торговца.
//#define COLORIZE_OTHER_TRADE

Expand Down Expand Up @@ -243,9 +226,6 @@
// Валидатор желательно использовать только при отладке проблем с памятью.
//#define USE_MEMORY_VALIDATOR

// Флаги рендера R2 по умолчанию. Включен "r_glows_use on".
#define DEF_R2_PP_FLAGS R_FLAG_GLOW_USE

// Включает учет параметра k_ap у патрона при расчета урона для НПС
// Формула такая же как при расчете урона для ГГ
// Может потребовать перенстройку конфигов патронов
Expand All @@ -254,24 +234,3 @@
// В этом режиме удаление поршня, в котором указаны <article>, удалит и эти
// статьи.
//#define REMOVE_ARTICLES_ON_DISABLE_INFO

// Включает подсветку патронов и аддонов для выбранного оружия в окнах
// инвентаря, торговли и обыска. Что-то на подобии ЗП. Настраивается
// через конфиг. Нужно добавить куда-нибудь в system.ltx:
//
// [dragdrop]
// ; цвет подсвеченной иконки
// color_ammo = 212, 8, 185, 255 ;RGBA
// ; подсвечивать этим цветом иконку
// colorize_ammo = true
// ; подсвечивать ячейку, в которой(ых) находится предмет, как в
// ; ЗП. Для этого режима нужно заменить ui\ui_grid.dds на вариант из
// ; ЗП, что бы там было 4 плашки, а не 2, как в ТЧ. В конфигах
// ; инвентаря должен быть включен показ сетки.
// highlight_cop = true
// ; подсвечивать ячейки с предметами, которые находятся в слотах и на поясе.
// ; Работает только при включенном highlight_cop.
// highlight_equipped = true
// ; предметы на поясе и в слотах будут не продаваемыми
// equipped_untradable = true
#define COLORIZE_WPN_AMMO_AND_ADDONS
8 changes: 0 additions & 8 deletions ogsr_engine/xrGame/EffectorZoomInertion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
#include "stdafx.h"
#include "EffectorZoomInertion.h"


#define EFFECTOR_ZOOM_SECTION "zoom_inertion_effector"

#ifdef SCRIPT_EZI_CONTROL
#include "Actor.h"

bool __declspec(dllexport) external_zoom_osc = false; // alpet: ôëàæîê âíåøíåãî ðàññ÷åòà êîëåáàíèé ïðèöåëà (èç ñêðèïòîâ).
Expand All @@ -30,9 +28,6 @@
return NULL;
}

#else
#define external_zoom_osc 0
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
Expand Down Expand Up @@ -175,8 +170,6 @@ void set_target_point (CEffectorZoomInertion *E, const Fvector src) { E->m_vTar
#pragma optimize("s",on)
void CEffectorZoomInertion::script_register(lua_State *L)
{
#ifdef SCRIPT_EZI_CONTROL

module(L)
[

Expand All @@ -202,5 +195,4 @@ void CEffectorZoomInertion::script_register(lua_State *L)
def("find_effector_zi", &FindEffectorZoomInertion),
def("switch_zoom_osc", &switch_zoom_osc)
];
#endif
}
10 changes: 1 addition & 9 deletions ogsr_engine/xrGame/Inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,11 +817,7 @@ PIItem CInventory::GetAny(const char *name) const

PIItem CInventory::GetAmmo(const char *name, bool forActor) const
{
bool include_ruck = true;

#ifdef AMMO_FROM_BELT
include_ruck = !forActor || !psActorFlags.test(AF_AMMO_ON_BELT);
#endif
bool include_ruck = !forActor || !psActorFlags.test(AF_AMMO_ON_BELT);

PIItem itm;
if (include_ruck) {
Expand Down Expand Up @@ -1213,11 +1209,7 @@ PIItem CInventory::GetAmmoMaxCurr( const char *name, bool forActor ) const {
return false;
};

#if defined( AMMO_FROM_BELT )
bool include_ruck = !forActor || !psActorFlags.test( AF_AMMO_ON_BELT );
#else
bool include_ruck = true;
#endif

Iterate( false, callback );
if ( include_ruck ) {
Expand Down
3 changes: 1 addition & 2 deletions ogsr_engine/xrGame/Level_network_start_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ bool CLevel::net_start_client4 ()
// *note: release version always has "mt_*" enabled
Device.seqFrameMT.Remove (g_pNetProcessor);
Device.seqFrame.Remove (g_pNetProcessor);
if (psDeviceFlags.test(mtNetwork)) Device.seqFrameMT.Add (g_pNetProcessor,REG_PRIORITY_HIGH + 2);
else Device.seqFrame.Add (g_pNetProcessor,REG_PRIORITY_LOW - 2);
Device.seqFrameMT.Add(g_pNetProcessor,REG_PRIORITY_HIGH + 2);

if(!psNET_direct_connect)
{
Expand Down
3 changes: 1 addition & 2 deletions ogsr_engine/xrGame/PHWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ void CPHWorld::Create()
{
dWorldID phWorld=0;

if (psDeviceFlags.test(mtPhysics)) Device.seqFrameMT.Add (this,REG_PRIORITY_HIGH);
else Device.seqFrame.Add (this,REG_PRIORITY_LOW);
Device.seqFrameMT.Add(this,REG_PRIORITY_HIGH);

m_commander =xr_new<CPHCommander>();
//dVector3 extensions={2048,256,2048};
Expand Down
2 changes: 1 addition & 1 deletion ogsr_engine/xrGame/ParticlesObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void CParticlesObject::shedule_Update (u32 _dt)
if (m_bDead) return;
u32 dt = Device.dwTimeGlobal - dwLastTime;
if (dt) {
if (0){//.psDeviceFlags.test(mtParticles)) { //. AlexMX comment this line// NO UNCOMMENT - DON'T WORK PROPERLY
if constexpr(false) { //. AlexMX comment this line// NO UNCOMMENT - DON'T WORK PROPERLY
mt_dt = dt;
fastdelegate::FastDelegate0<> delegate (this,&CParticlesObject::PerformAllTheWork_mt);
Device.seqParallel.push_back (delegate);
Expand Down
2 changes: 0 additions & 2 deletions ogsr_engine/xrGame/Weapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1182,11 +1182,9 @@ int CWeapon::GetAmmoCurrent(bool use_item_to_spawn) const

bool include_ruck = true;

#ifdef AMMO_FROM_BELT
auto parent = const_cast<CObject*>(H_Parent());
auto pActor = smart_cast<CActor*>(parent);
include_ruck = !psActorFlags.test(AF_AMMO_ON_BELT) || !pActor;
#endif // AMMO_FROM_BELT

if (include_ruck)
{
Expand Down
3 changes: 2 additions & 1 deletion ogsr_engine/xrGame/WeaponMagazinedWGrenade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ BOOL CWeaponMagazinedWGrenade::net_Spawn(CSE_Abstract* DC)
}
else
{
m_DefaultCartridge2.Load(*m_ammoTypes2[m_ammoType2], u8(m_ammoType2));
ASSERT_FMT( m_ammoType2 < m_ammoTypes2.size(), "Ammo type [%u] not found in weapon [%s]. Something strange...", m_ammoType2, this->cName().c_str() );
m_DefaultCartridge2.Load(m_ammoTypes2.at(m_ammoType2).c_str(), u8(m_ammoType2));
while ((u32)iAmmoElapsed2 > m_magazine2.size())
m_magazine2.push_back(m_DefaultCartridge2);
}
Expand Down
6 changes: 2 additions & 4 deletions ogsr_engine/xrGame/alife_storage_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ void CALifeStorageManager::save (LPCSTR save_name, bool update_name)
spawns().save (stream);
objects().save (stream);
registry().save (stream);
#ifdef SCRIPT_VARS_STORAGE

g_ScriptVars.save (stream);
#endif

source_count = stream.tell();
void *source_data = stream.pointer();
Expand Down Expand Up @@ -114,10 +113,9 @@ void CALifeStorageManager::load (void *buffer, const u32 &buffer_size, LPCSTR fi
}

registry().load (source);
#ifdef SCRIPT_VARS_STORAGE

if ( !source.eof() )
g_ScriptVars.load( source );
#endif

can_register_objects (true);

Expand Down
19 changes: 8 additions & 11 deletions ogsr_engine/xrGame/console_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,15 @@ class CCC_DemoRecord : public IConsole_Command
{
public:

CCC_DemoRecord(LPCSTR N) : IConsole_Command(N) {};
CCC_DemoRecord(LPCSTR N) : IConsole_Command(N) {}
virtual void Execute(LPCSTR args) {
#ifndef DEBUG
if (GameID() != GAME_SINGLE)
{
Msg("For this game type Demo Record is disabled.");
if (!g_pGameLevel) { // level not loaded
Log("Demo Record is disabled when level is not loaded.");
return;
};
#endif
Console->Hide ();
}

Console->Hide();

string_path fn_;
strconcat (sizeof(fn_),fn_, args, ".xrdemo");
string_path fn;
Expand Down Expand Up @@ -1284,9 +1283,7 @@ void CCC_RegisterCommands()
//#endif // MASTER_GOLD

CMD3(CCC_Mask, "g_autopickup", &psActorFlags, AF_AUTOPICKUP);
#ifndef G_MUSIC_TRACKS_OFF
psActorFlags.set(AF_MUSIC_TRACKS, true);
#endif

CMD3(CCC_Mask, "g_music_tracks", &psActorFlags, AF_MUSIC_TRACKS);

CMD1(CCC_LuaHelp, "lua_help");
Expand Down
2 changes: 0 additions & 2 deletions ogsr_engine/xrGame/script_vars_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,9 @@ class CScriptVarsStorage:
DECLARE_SCRIPT_REGISTER_FUNCTION
};

#ifdef SCRIPT_VARS_STORAGE
add_to_type_list(CScriptVarsStorage)
#undef script_type_list
#define script_type_list save_type_list(CScriptVarsStorage)
#endif

extern CScriptVarsStorage g_ScriptVars;
extern int lua_pushsvt(lua_State *L, CScriptVarsTable *T);
2 changes: 0 additions & 2 deletions ogsr_engine/xrGame/ui/UICarBodyWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,7 @@ void CUICarBodyWnd::MoveItem(CUICellItem* itm)
bool CUICarBodyWnd::OnItemSelected(CUICellItem* itm)
{
SetCurrentItem(itm);
#ifdef COLORIZE_WPN_AMMO_AND_ADDONS
itm->ColorizeItems( { m_pUIOurBagList, m_pUIOthersBagList } );
#endif
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion ogsr_engine/xrGame/ui/UIDragDropListEx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ CUIDragDropListEx::CUIDragDropListEx()

SetDrawGrid(true);

colorize_ammo = READ_IF_EXISTS( pSettings, r_bool, "dragdrop", "colorize_ammo", true );
colorize_ammo = READ_IF_EXISTS( pSettings, r_bool, "dragdrop", "colorize_ammo", false );
highlight_cop = READ_IF_EXISTS( pSettings, r_bool, "dragdrop", "highlight_cop", false );
tx = highlight_cop ? 0.25f : 0.5f;
}
Expand Down
8 changes: 0 additions & 8 deletions ogsr_engine/xrGame/ui/UIMainIngameWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ DLL_API CUIMainIngameWnd* GetMainIngameWindow()
return NULL;
}

#ifdef SCRIPT_ICONS_CONTROL
CUIStatic * warn_icon_list[8] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };

// alpet: ��� ����������� �������� �������� ������ (������������ � NLC6 ������ �������� �����������). ����� �� ������ �� ���� ��� ��������� �����.
Expand Down Expand Up @@ -125,9 +124,6 @@ DLL_API CUIMainIngameWnd* GetMainIngameWindow()
}
return false;
}
#else
#define external_icon_ctrl 0
#endif

CUIMainIngameWnd::CUIMainIngameWnd()
{
Expand All @@ -140,15 +136,13 @@ CUIMainIngameWnd::CUIMainIngameWnd()
m_artefactPanel = xr_new<CUIArtefactPanel>();
m_pMPChatWnd = NULL;
m_pMPLogWnd = NULL;
#ifdef SCRIPT_ICONS_CONTROL
warn_icon_list[ewiWeaponJammed] = &UIWeaponJammedIcon;
warn_icon_list[ewiRadiation] = &UIRadiaitionIcon;
warn_icon_list[ewiWound] = &UIWoundIcon;
warn_icon_list[ewiStarvation] = &UIStarvationIcon;
warn_icon_list[ewiPsyHealth] = &UIPsyHealthIcon;
warn_icon_list[ewiInvincible] = &UIInvincibleIcon;
warn_icon_list[ewiArtefact] = &UIArtefactIcon;
#endif
}

#include "UIProgressShape.h"
Expand Down Expand Up @@ -1433,9 +1427,7 @@ void CUIMainIngameWnd::script_register(lua_State *L)
class_<CUIMainIngameWnd, CUIWindow>("CUIMainIngameWnd")
.def("GetStatic", &GetStaticRaw, raw<2>()),
def("get_main_window", &GetMainIngameWindow) // get_mainingame_window better??
#ifdef SCRIPT_ICONS_CONTROL
, def("setup_game_icon", &SetupGameIcon)
#endif
];

}
2 changes: 0 additions & 2 deletions ogsr_engine/xrGame/ui/UITradeWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,7 @@ bool CUITradeWnd::OnItemStartDrag(CUICellItem* itm)
bool CUITradeWnd::OnItemSelected(CUICellItem* itm)
{
SetCurrentItem(itm);
#ifdef COLORIZE_WPN_AMMO_AND_ADDONS
itm->ColorizeItems( { &m_uidata->UIOurTradeList, &m_uidata->UIOthersTradeList, &m_uidata->UIOurBagList, &m_uidata->UIOthersBagList } );
#endif
return false;
}

Expand Down
2 changes: 0 additions & 2 deletions ogsr_engine/xrGame/ui/uiinventorywnd2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,7 @@ bool CUIInventoryWnd::OnItemStartDrag(CUICellItem* itm)
bool CUIInventoryWnd::OnItemSelected(CUICellItem* itm)
{
SetCurrentItem(itm);
#ifdef COLORIZE_WPN_AMMO_AND_ADDONS
itm->ColorizeItems( { m_pUIBagList, m_pUIBeltList } );
#endif
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion ogsr_engine/xr_3da/Device_Initialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void CRenderDevice::Initialize()
}

// Save window properties
m_dwWindowStyle = GetWindowLong( m_hWnd, GWL_STYLE );
m_dwWindowStyle = GetWindowLongPtr( m_hWnd, GWL_STYLE );
GetWindowRect ( m_hWnd, &m_rcWindowBounds );
GetClientRect ( m_hWnd, &m_rcWindowClient );

Expand Down
6 changes: 3 additions & 3 deletions ogsr_engine/xr_3da/HW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ void CHW::updateWindowProps(HWND m_hWnd)
bool bBordersMode = strstr(Core.Params, "-draw_borders");
if (bBordersMode)
dwWindowStyle |= WS_BORDER | WS_DLGFRAME | WS_SYSMENU | WS_MINIMIZEBOX;
SetWindowLong( m_hWnd, GWL_STYLE, dwWindowStyle );
SetWindowLongPtr( m_hWnd, GWL_STYLE, dwWindowStyle );
// When moving from fullscreen to windowed mode, it is important to
// adjust the window size after recreating the device rather than
// beforehand to ensure that you get the window size you want. For
Expand Down Expand Up @@ -458,8 +458,8 @@ void CHW::updateWindowProps(HWND m_hWnd)
}
else
{
SetWindowLong(m_hWnd, GWL_STYLE, dwWindowStyle = (WS_POPUP | WS_VISIBLE));
SetWindowLong(m_hWnd, GWL_EXSTYLE, WS_EX_TOPMOST);
SetWindowLongPtr(m_hWnd, GWL_STYLE, dwWindowStyle /*= (WS_POPUP | WS_VISIBLE)*/);
//SetWindowLongPtr(m_hWnd, GWL_EXSTYLE, WS_EX_TOPMOST); // �� ��-�� ����� �� ���� � ������������� ������ ��� ���������� ���������� �������� ��� ����������?
}

ShowCursor(FALSE);
Expand Down
Loading

0 comments on commit 9798a84

Please sign in to comment.