Skip to content

Commit

Permalink
Merge from dev [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
xrSimpodin committed Nov 30, 2020
2 parents 2deb1c6 + 9622916 commit f56f895
Show file tree
Hide file tree
Showing 49 changed files with 253 additions and 349 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ jobs:
set CONFIGURATION=${{ matrix.Configuration }}
set PLATFORM=${{ matrix.Platform }}
set OGSR_ARTIFACT_NAME=OGSR_Engine_SHOC_EDITION_%PLATFORM%_%APPVEYOR_BUILD_VERSION%_%CONFIGURATION%.7z
echo ::set-env name=Build_type::%OGSR_ARTIFACT_NAME%
cd bin_%PLATFORM%
md ..\Game\Resources_SoC_1.0006\bin_%PLATFORM%
Expand All @@ -49,18 +46,18 @@ jobs:
7z a -t7z -m0=LZMA2:d=96m:fb=273 -mx=9 -mmt=2 ..\..\%OGSR_ARTIFACT_NAME% .\
- name: Upload OGSR artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: ${{ env.Build_type }}
path: .\${{ env.Build_type }}
name: OGSR_Engine_SHOC_EDITION_${{ matrix.Platform }}_2.1.${{ github.run_number }}_${{ matrix.Configuration }}.7z
path: .\OGSR_Engine_SHOC_EDITION_${{ matrix.Platform }}_2.1.${{ github.run_number }}_${{ matrix.Configuration }}.7z

- name: Upload release asset
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1.0.1
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: .\${{ env.Build_type }}
asset_name: ${{ env.Build_type }}
asset_path: .\OGSR_Engine_SHOC_EDITION_${{ matrix.Platform }}_2.1.${{ github.run_number }}_${{ matrix.Configuration }}.7z
asset_name: OGSR_Engine_SHOC_EDITION_${{ matrix.Platform }}_2.1.${{ github.run_number }}_${{ matrix.Configuration }}.7z
asset_content_type: application/zip
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@
#endif
//////////////////////////////////////////////////////////////////////////////////////////

#define USE_GRASS_WAVE // enable grass wave
#define GRASS_WAVE_FREQ float(0.7) // frequency of waves
#define GRASS_WAVE_POWER float(3.0) // brightness of waves

#endif // common_defines_h_included
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ struct p_bumped
// Defer flat
struct v2p_flat
{
#if defined(USE_R2_STATIC_SUN) && !defined(USE_LM_HEMI)
#if ((defined(USE_R2_STATIC_SUN) && !defined(USE_LM_HEMI)) || defined(USE_GRASS_WAVE))
float4 tcdh : TEXCOORD0; // Texture coordinates, w=sun_occlusion
#else
float2 tcdh : TEXCOORD0; // Texture coordinates
Expand All @@ -399,7 +399,7 @@ struct v2p_flat

struct p_flat
{
#if defined(USE_R2_STATIC_SUN) && !defined(USE_LM_HEMI)
#if ((defined(USE_R2_STATIC_SUN) && !defined(USE_LM_HEMI)) || defined(USE_GRASS_WAVE))
float4 tcdh : TEXCOORD0; // Texture coordinates, w=sun_occlusion
#else
float2 tcdh : TEXCOORD0; // Texture coordinates
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ v2p_flat main ( v_in I )
O.tcdh.w = s;
#endif

#ifdef USE_GRASS_WAVE
O.tcdh.z = 1.f;
#endif

#ifdef USE_TDETAIL
O.tcdbump = O.tcdh * dt_params; // dt tc
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ v2p_flat main (v_detail v)
O.tcdh.w = c0.x; // (,,,dir-occlusion)
# endif

#ifdef USE_GRASS_WAVE
O.tcdh.z = 1.f;
#endif

O.position = float4 (Pe, c0.w );

return O;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ v2p_flat main (v_detail v)
# if defined(USE_R2_STATIC_SUN)
O.tcdh.w = c0.x; // (,,,dir-occlusion)
# endif

#ifdef USE_GRASS_WAVE
float _dp = calc_cyclic (dot(pos,wave*GRASS_WAVE_FREQ));
O.tcdh.z = consts.w+consts.z*max(0.f, _dp)*frac*GRASS_WAVE_POWER;
#endif

O.position = float4 (Pe, c0.w );

return O;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ v2p_flat _main( v_model I )
O.tcdh.w = L_material.y; // (,,,dir-occlusion)
#endif

#ifdef USE_GRASS_WAVE
O.tcdh.z = 1.f;
#endif

#ifdef USE_TDETAIL
O.tcdbump = O.tcdh*dt_params; // dt tc
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ v2p_flat main (v_tree I)
o.tcdh.w = suno; // (,,,dir-occlusion)
#endif

#ifdef USE_TDETAIL
#ifdef USE_GRASS_WAVE
o.tcdh.z = 1.f;
#endif

#ifdef USE_TDETAIL
o.tcdbump = o.tcdh*dt_params; // dt tc
#endif
#endif

return o;
}
Expand Down
Binary file added Game/dlls/discord-rpc_x64.dll
Binary file not shown.
Binary file added Game/dlls/discord-rpc_x86.dll
Binary file not shown.
77 changes: 0 additions & 77 deletions ogsr_engine/xrCore/ChooseTypes.H

This file was deleted.

12 changes: 12 additions & 0 deletions ogsr_engine/xrCore/_std_extensions.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "stdafx.h"

#include <time.h>
#include <codecvt>

char* timestamp (string64& dest)
{
Expand Down Expand Up @@ -34,3 +35,14 @@ char* xr_strdup( const char* string ) {
CopyMemory( memory, string, len );
return memory;
}

// Очень полезная штука из OpenXRay
std::string StringToUTF8(const char* in)
{
const size_t len = strlen(in);
static const std::locale locale{ "" };
using wcvt = std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t>;
std::wstring wstr(len, L'\0');
std::use_facet<std::ctype<wchar_t>>(locale).widen(in, in + len, wstr.data());
return wcvt{}.to_bytes(wstr.data(), wstr.data() + wstr.size());
}
2 changes: 2 additions & 0 deletions ogsr_engine/xrCore/_std_extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,5 @@ inline char* xr_strconcat(StrType& dest, const StrType2& arg1, const Args&... ar
#define xr_strcpy strcpy_s
#define xr_sprintf sprintf_s
#define xr_strcat strcat_s

XRCORE_API std::string StringToUTF8(const char* in);
4 changes: 4 additions & 0 deletions ogsr_engine/xrCore/xrCore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
<PostBuildEvent>
<Command>
copy /Y "$(SolutionDir)\Game\dlls\dbghelp_x86.dll" "$(OutDir)dbghelp.dll"
copy /Y "$(SolutionDir)\Game\dlls\discord-rpc_x86.dll" "$(OutDir)discord-rpc.dll"
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
Expand Down Expand Up @@ -175,6 +176,7 @@
<PostBuildEvent>
<Command>
copy /Y "$(SolutionDir)\Game\dlls\dbghelp_x86.dll" "$(OutDir)dbghelp.dll"
copy /Y "$(SolutionDir)\Game\dlls\discord-rpc_x86.dll" "$(OutDir)discord-rpc.dll"
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
Expand Down Expand Up @@ -228,6 +230,7 @@
<PostBuildEvent>
<Command>
copy /Y "$(SolutionDir)\Game\dlls\dbghelp_x64.dll" "$(OutDir)dbghelp.dll"
copy /Y "$(SolutionDir)\Game\dlls\discord-rpc_x64.dll" "$(OutDir)discord-rpc.dll"
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
Expand Down Expand Up @@ -285,6 +288,7 @@
<PostBuildEvent>
<Command>
copy /Y "$(SolutionDir)\Game\dlls\dbghelp_x64.dll" "$(OutDir)dbghelp.dll"
copy /Y "$(SolutionDir)\Game\dlls\discord-rpc_x64.dll" "$(OutDir)discord-rpc.dll"
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
Expand Down
18 changes: 0 additions & 18 deletions ogsr_engine/xrGame/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1352,24 +1352,6 @@ bool CActor::use_bolts () const
return CInventoryOwner::use_bolts();
};

int g_iCorpseRemove = 1;

bool CActor::NeedToDestroyObject() const
{
if(g_Alive()) return false;
if(g_iCorpseRemove == -1) return false;
if(g_iCorpseRemove == 0 && m_bAllowDeathRemove) return true;
return (TimePassedAfterDeath()>m_dwBodyRemoveTime && m_bAllowDeathRemove);
}

ALife::_TIME_ID CActor::TimePassedAfterDeath() const
{
if(!g_Alive())
return Level().timeServer() - GetLevelDeathTime();
else
return 0;
}


void CActor::OnItemTake (CInventoryItem *inventory_item)
{
Expand Down
11 changes: 1 addition & 10 deletions ogsr_engine/xrGame/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,6 @@ struct SDefNewsMsg{

virtual bool unlimited_ammo ();

virtual bool NeedToDestroyObject() const;
virtual ALife::_TIME_ID TimePassedAfterDeath() const;


public:
//свойства артефактов
virtual void UpdateArtefactsOnBelt();
Expand Down Expand Up @@ -276,10 +272,7 @@ struct SDefNewsMsg{
u8 m_loaded_ph_box_id;
private:
void SwitchOutBorder(bool new_border_state);
public:
bool m_bAllowDeathRemove;
// u32 m_u32RespawnTime;

public:
////////////////////////////////////////////////////////
void SetZoomRndSeed (s32 Seed = 0);
s32 GetZoomRndSeed () { return m_ZoomRndSeed; };
Expand Down Expand Up @@ -655,8 +648,6 @@ virtual bool can_validate_position_on_spawn (){return false;}
// virtual void UpdatePosStack ( u32 Time0, u32 Time1 );
virtual void MoveActor (Fvector NewPos, Fvector NewDir);

virtual void SpawnAmmoForWeapon (CInventoryItem *pIItem);
virtual void RemoveAmmoForWeapon (CInventoryItem *pIItem);
virtual void spawn_supplies ();
virtual bool human_being () const
{
Expand Down
2 changes: 0 additions & 2 deletions ogsr_engine/xrGame/Actor_Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,6 @@ BOOL CActor::net_Spawn (CSE_Abstract* DC)
hit_slowmo = 0.f;

OnChangeVisual();
//----------------------------------
m_bAllowDeathRemove = false;

// m_bHasUpdate = false;
m_bInInterpolation = false;
Expand Down
25 changes: 0 additions & 25 deletions ogsr_engine/xrGame/Actor_Weapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,28 +224,3 @@ Fvector CActor::weapon_recoil_last_delta()

return (result);
}
//////////////////////////////////////////////////////////////////////////

void CActor::SpawnAmmoForWeapon (CInventoryItem *pIItem)
{
if (OnClient()) return;
if (!pIItem) return;

CWeaponMagazined* pWM = smart_cast<CWeaponMagazined*> (pIItem);
if (!pWM || !pWM->AutoSpawnAmmo()) return;

pWM->SpawnAmmo(0xffffffff, NULL, ID());
};

void CActor::RemoveAmmoForWeapon (CInventoryItem *pIItem)
{
if (OnClient()) return;
if (!pIItem) return;

CWeaponMagazined* pWM = smart_cast<CWeaponMagazined*> (pIItem);
if (!pWM || !pWM->AutoSpawnAmmo()) return;

CWeaponAmmo* pAmmo = smart_cast<CWeaponAmmo*>(inventory().GetAny(*(pWM->m_ammoTypes[0]) ));
if (!pAmmo) return;
pAmmo->DestroyObject();
};
4 changes: 0 additions & 4 deletions ogsr_engine/xrGame/Entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ void CEntity::Load (LPCSTR section)
#pragma todo("Jim to Dima: no specific figures or comments needed")
m_fMorale = 66.f;

//время убирания тела с уровня
m_dwBodyRemoveTime = READ_IF_EXISTS(pSettings,r_u32,section,"body_remove_time",BODY_REMOVE_TIME);
//////////////////////////////////////

m_forget_killer_time = READ_IF_EXISTS( pSettings, r_u32, section, "forget_killer_time", FORGET_KILLER_TIME ) * 1000;
}

Expand Down
2 changes: 0 additions & 2 deletions ogsr_engine/xrGame/Entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class CEntity :
CEntityConditionSimple* m_entity_condition;

protected:
//время через которое мертвое тело убирется с уровня
ALife::_TIME_ID m_dwBodyRemoveTime;
u32 m_forget_killer_time;
protected:
virtual CEntityConditionSimple *create_entity_condition (CEntityConditionSimple* ec);
Expand Down
5 changes: 0 additions & 5 deletions ogsr_engine/xrGame/GameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,11 +819,6 @@ CScriptGameObject *CGameObject::lua_game_object() const
return (m_lua_game_object);
}

bool CGameObject::NeedToDestroyObject() const
{
return false;
}

void CGameObject::DestroyObject()
{

Expand Down
1 change: 0 additions & 1 deletion ogsr_engine/xrGame/GameObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ class CGameObject :

virtual bool IsVisibleForZones () { return true; }
///////////////////////////////////////////////////////////////////////
virtual bool NeedToDestroyObject () const;
virtual void DestroyObject ();
///////////////////////////////////////////////////////////////////////

Expand Down
Loading

0 comments on commit f56f895

Please sign in to comment.