Skip to content

Commit 14629d4

Browse files
committed
Merge branch 'carbon' into w2c
2 parents 77f8dea + f211ec6 commit 14629d4

3 files changed

Lines changed: 56 additions & 27 deletions

File tree

premake5.lua

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
toolset("v143")
22
systemversion("10.0.20348.0")
33

4-
54
local function execute(command)
65
local result, _ = os.outputof(command)
76

87
return result
98
end
10-
local cn = execute("echo %COMPUTERNAME%")
119

12-
local ta = ".asi"
10+
local target_extension = ".asi"
11+
12+
local function is_abominator()
13+
local name = execute("echo %COMPUTERNAME%")
1314

14-
local a = {
15-
}
16-
local function aa()
17-
local a = execute("echo %COMPUTERNAME%")
18-
return string.find(a,"ABOMINATOR")
15+
return string.find(name,"ABOMINATOR")
16+
end
17+
18+
local function set_defines()
19+
if is_abominator() then
20+
defines("ABOMINATOR")
21+
end
1922
end
20-
function set_name()
21-
if aa() then
23+
24+
local function set_name()
25+
if is_abominator() then
2226
filter "configurations:debug"
2327
targetname "%{prj.name}-debug"
2428

@@ -32,10 +36,9 @@ function set_name()
3236
end
3337
end
3438

35-
36-
if aa() then
39+
if is_abominator() then
3740
print('hi')
38-
ta = ".dll"
41+
target_extension = ".dll"
3942
end
4043

4144
workspace "hyperlinked"
@@ -73,6 +76,8 @@ workspace "hyperlinked"
7376
"multiprocessorcompile",
7477
}
7578

79+
set_defines()
80+
7681
defines {
7782
"NOMINMAX",
7883
"_CRT_SECURE_NO_WARNINGS",
@@ -175,14 +180,14 @@ workspace "hyperlinked"
175180
project "hyperlinked"
176181
language "c++"
177182
kind "sharedlib"
178-
targetextension(ta)
179183

180-
postbuildcommands {
181-
-- Copy commands
182-
"if \"%COMPUTERNAME%\" == \"ABOMINATOR\" ( copy /y \"$(TargetPath)\" \"D:\\Development\\nfsco\\nfsco\\install\\bin\\\" )",
183-
}
184+
targetextension(target_extension)
185+
186+
postbuildcommands {
187+
"if \"%COMPUTERNAME%\" == \"ABOMINATOR\" ( copy /y \"$(TargetPath)\" \"D:\\Development\\nfsco\\nfsco\\install\\bin\\\" )",
188+
}
184189

185-
set_name()
190+
set_name()
186191

187192
-- pchheader "stdafx.hpp"
188193
-- pchsource "src/hyperlinked/stdafx.cpp"

src/hyperlib/renderer/culling.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,13 @@ namespace hyper
5151
case view_id::env_y_neg:
5252
case view_id::env_z_pos:
5353
case view_id::env_z_neg:
54+
// no idea what nonsense flags were used in HDReflections (0x8002), but literally the ONLY way to make this reflect lights is to set it to...
55+
// exclude_main_view, which INCLUDES the main view in the reflections????????
56+
#if defined(ABOMINATOR)
57+
flags = instance_flags::exclude_main_view | instance_flags::exclude_disable_rendering | instance_flags::exclude_group_disable;
58+
#else
5459
flags |= instance_flags::include_reflection_ng | instance_flags::include_reflection | instance_flags::envmap_shadow | instance_flags::environment_map;
60+
#endif
5561
break;
5662
}
5763

src/hyperlib/renderer/effect.cpp

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -433,14 +433,32 @@ namespace hyper
433433
lighting::ingame_light_params.y = lighting::default_ingame_light_y;
434434
lighting::ingame_light_params.w = lighting::default_ingame_light_w;
435435

436-
if (game_flow::manager::instance.current_state == game_flow::state::racing)
437-
{
438-
this->set_vector_unchecked(parameter_type::cvVertexPowerBrightness, lighting::ingame_light_params);
439-
}
440-
else
436+
const auto in_frontend = game_flow::manager::instance.current_state == game_flow::state::in_frontend;
437+
438+
#if defined(ABOMINATOR)
439+
// copy the vector.
440+
auto vector = (in_frontend) ? lighting::frontend_light_params : lighting::ingame_light_params;
441+
#else
442+
const auto& vector = (in_frontend) ? lighting::frontend_light_params : lighting::ingame_light_params;
443+
#endif
444+
445+
#if defined(ABOMINATOR)
446+
const auto render_target = render_target::current;
447+
448+
if (render_target->view_id >= view_id::env_z_pos)
441449
{
442-
this->set_vector_unchecked(parameter_type::cvVertexPowerBrightness, lighting::frontend_light_params);
450+
if (in_frontend)
451+
{
452+
vector.x += 2.5f;
453+
vector.y -= 1.0f;
454+
}
455+
else
456+
{
457+
vector.y -= 0.4f;
458+
}
443459
}
460+
#endif
461+
this->set_vector_unchecked(parameter_type::cvVertexPowerBrightness, vector);
444462
}
445463
}
446464

@@ -668,7 +686,7 @@ namespace hyper
668686

669687
for (technique* i = this->supported_table_.begin(); i != this->supported_table_.end(); ++i)
670688
{
671-
if (length == i->name.length() && ::memcmp(name, i->name, length))
689+
if (length == i->name.length() && !::memcmp(name, i->name, length))
672690
{
673691
return i;
674692
}
@@ -795,7 +813,7 @@ namespace hyper
795813
{
796814
for (size_t i = 0u; i < shader_lib::inputs_.length(); ++i)
797815
{
798-
if (::strcmp(name, shader_lib::inputs_[i].effect_name))
816+
if (!::strcmp(name, shader_lib::inputs_[i].effect_name))
799817
{
800818
return &shader_lib::inputs_[i];
801819
}

0 commit comments

Comments
 (0)