소스 검색

Update lol-core and remove deprecated headers.

legacy
Sam Hocevar 4 년 전
부모
커밋
60d9abc6d6
11개의 변경된 파일21개의 추가작업 그리고 141개의 파일을 삭제
  1. +9
    -0
      doc/samples/btphystest.cpp
  2. +1
    -1
      lol-core
  3. +1
    -1
      src/Makefile.am
  4. +1
    -2
      src/lol-core.vcxproj
  5. +1
    -2
      src/lol-core.vcxproj.filters
  6. +0
    -2
      src/lol/extras.h
  7. +0
    -82
      src/numeric.h
  8. +3
    -3
      src/t/Makefile.am
  9. +0
    -42
      src/t/math/interp.cpp
  10. +1
    -2
      src/t/test-math.vcxproj
  11. +4
    -4
      src/textureimage.cpp

+ 9
- 0
doc/samples/btphystest.cpp 파일 보기

@@ -60,6 +60,15 @@ int gNumObjects = 16;

LOLFX_RESOURCE_DECLARE(front_camera_sprite);

//Damp for float
template <typename T1, typename T2, typename Tf>
static inline T1 damp(const T1 &a, const T2 &b, const Tf &x, const Tf &dt)
{
if (dt <= .0f)
return a;
return lol::lerp(a, b, dt / (dt + x));
}

BtPhysTest::BtPhysTest(bool editor)
{
m_init_status = 0;


+ 1
- 1
lol-core

@@ -1 +1 @@
Subproject commit d22746ebaf889679f9fd5f5aecb8882ff614ee73
Subproject commit 80481a587ce2ed0ca69f4a1c117ed903a1ae816a

+ 1
- 1
src/Makefile.am 파일 보기

@@ -12,7 +12,7 @@ liblol_core_a_SOURCES = \
textureimage.cpp textureimage.h textureimage-private.h \
tileset.cpp tileset.h video.cpp video.h \
profiler.cpp profiler.h text.cpp text.h emitter.cpp emitter.h \
numeric.h messageservice.cpp messageservice.h \
messageservice.cpp messageservice.h \
gradient.cpp gradient.h gradient.lolfx \
platform.cpp platform.h sprite.cpp sprite.h camera.cpp camera.h \
light.cpp light.h \


+ 1
- 2
src/lol-core.vcxproj 파일 보기

@@ -270,7 +270,6 @@
<ClInclude Include="mesh\mesh.h" />
<ClInclude Include="mesh\primitivemesh.h" />
<ClInclude Include="messageservice.h" />
<ClInclude Include="numeric.h" />
<ClInclude Include="platform.h" />
<ClInclude Include="private\nx\nx-app.h">
<ExcludedFromBuild Condition="'$(Platform)'!='NX64'">true</ExcludedFromBuild>
@@ -374,4 +373,4 @@
<ImportGroup Label="ExtensionTargets">
<Import Project="$(LolDir)\build\msbuild\lolfx.targets" />
</ImportGroup>
</Project>
</Project>

+ 1
- 2
src/lol-core.vcxproj.filters 파일 보기

@@ -396,7 +396,6 @@
<Filter>mesh</Filter>
</ClInclude>
<ClInclude Include="messageservice.h" />
<ClInclude Include="numeric.h" />
<ClInclude Include="platform.h" />
<ClInclude Include="profiler.h" />
<ClInclude Include="scene.h" />
@@ -646,4 +645,4 @@
<Filter>external</Filter>
</CopyFileToFolders>
</ItemGroup>
</Project>
</Project>

+ 0
- 2
src/lol/extras.h 파일 보기

@@ -17,8 +17,6 @@
// --------------------------------------------------------
//

#include <lol/../numeric.h>

// Static classes
#include <lol/../platform.h>
#include <lol/../video.h>


+ 0
- 82
src/numeric.h 파일 보기

@@ -1,82 +0,0 @@
//
// Lol Engine
//
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
//

#pragma once

//
// The Matrix classes
// ------------------
//

#include <lol/math> // lol::lerp, lol::clamp
#include <algorithm> // std::swap
#include <cstdlib>
#include <stdint.h>

namespace lol
{

/* Next power of two. */
template <typename T> static inline T PotUp(T val)
{
val = val - 1;
if (sizeof(val) > 4) val = val | ((uint64_t)val >> 32);
if (sizeof(val) > 2) val = val | ((uint64_t)val >> 16);
if (sizeof(val) > 1) val = val | ((uint64_t)val >> 8);
val = val | ((uint64_t)val >> 4);
val = val | ((uint64_t)val >> 2);
val = val | ((uint64_t)val >> 1);
return val + 1;
}

//Damp for float
template <typename T1, typename T2, typename Tf> static inline T1 damp(const T1 &a, const T2 &b, const Tf &x, const Tf &dt)
{
if (dt <= .0f)
return a;
return lol::lerp(a, b, dt / (dt + x));
}

//SmoothClamp clamps x in [a - sd, b + sd] and returns a value in [a, b] that is smoothed at the borders.
static inline float SmoothClamp(float &x, float a, float b, float sd)
{
if (b < a)
std::swap(a, b);

float tx = x;
float ta = a - sd;
float tb = b + sd;
if (sd > 0.f)
{
if ((b - a) < 2.f * sd)
sd = .5f * (b - a);

if (tx < a + sd && tx > a - sd)
{
float t = (tx - a) / sd;
t = 0.25f * (t + 1.0f) * (t + 1.0f);
tx = a + t * sd;
}
else if (tx < b + sd && tx > b - sd)
{
float t = -(tx - b) / sd;
t = 0.25f * (t + 1.0f) * (t + 1.0f);
tx = b - t * sd;
}
}

x = lol::clamp(x, ta, tb);
return lol::clamp(tx, a, b);
}

} /* namespace lol */


+ 3
- 3
src/t/Makefile.am 파일 보기

@@ -33,9 +33,9 @@ test_base_DEPENDENCIES = @LOL_DEPS@

test_math_SOURCES = test-common.cpp \
math/array2d.cpp math/array3d.cpp math/arraynd.cpp math/box.cpp \
math/cmplx.cpp math/half.cpp math/interp.cpp math/matrix.cpp \
math/quat.cpp math/rand.cpp math/real.cpp math/rotation.cpp \
math/trig.cpp math/vector.cpp math/polynomial.cpp math/noise/simplex.cpp \
math/cmplx.cpp math/half.cpp math/matrix.cpp math/quat.cpp \
math/rand.cpp math/real.cpp math/rotation.cpp math/trig.cpp \
math/vector.cpp math/polynomial.cpp math/noise/simplex.cpp \
math/bigint.cpp math/sqt.cpp math/numbers.cpp
test_math_DEPENDENCIES = @LOL_DEPS@



+ 0
- 42
src/t/math/interp.cpp 파일 보기

@@ -1,42 +0,0 @@
//
// Lol Engine — Unit tests
//
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
//

#if HAVE_CONFIG_H
# include "config.h"
#endif

#include <lol/unit_test>
#include <../legacy/lol/math/interp.h>

namespace lol
{

lolunit_declare_fixture(interp_test)
{
lolunit_declare_test(time_interp_test)
{
TimeInterp<float> ti;

ti.Set(1.f, 10.f);
ti.Set(1.f, 20.f);
ti.Set(1.f, 30.f);

lolunit_assert_doubles_equal(0.f, ti.Get(-3.0f), 1.e-5f);
lolunit_assert_doubles_equal(10.f, ti.Get(-2.0f), 1.e-5f);
lolunit_assert_doubles_equal(20.f, ti.Get(-1.0f), 1.e-5f);
lolunit_assert_doubles_equal(30.f, ti.Get(0.0f), 1.e-5f);
lolunit_assert_doubles_equal(40.f, ti.Get(1.0f), 1.e-5f);
}
};

} /* namespace lol */


+ 1
- 2
src/t/test-math.vcxproj 파일 보기

@@ -47,7 +47,6 @@
<ClCompile Include="math\bigint.cpp" />
<ClCompile Include="math\cmplx.cpp" />
<ClCompile Include="math\half.cpp" />
<ClCompile Include="math\interp.cpp" />
<ClCompile Include="math\matrix.cpp" />
<ClCompile Include="math\noise\simplex.cpp" />
<ClCompile Include="math\numbers.cpp" />
@@ -82,4 +81,4 @@
<ImportGroup Label="ExtensionTargets">
<Import Project="$(LolDir)\build\msbuild\lolfx.targets" />
</ImportGroup>
</Project>
</Project>

+ 4
- 4
src/textureimage.cpp 파일 보기

@@ -81,8 +81,8 @@ void TextureImage::Init(std::string const &path, image* img)
m_data->m_texture = nullptr;
m_data->m_image = img;
m_data->m_image_size = m_data->m_image->size();
m_data->m_texture_size = ivec2(PotUp(m_data->m_image_size.x),
PotUp(m_data->m_image_size.y));
m_data->m_texture_size = ivec2(lol::bit_ceil(m_data->m_image_size.x),
lol::bit_ceil(m_data->m_image_size.y));

m_drawgroup = tickable::group::draw::texture;
}
@@ -153,8 +153,8 @@ void TextureImage::UpdateTexture(image* img)
{
m_data->m_image = img;
m_data->m_image_size = m_data->m_image->size();
m_data->m_texture_size = ivec2(PotUp(m_data->m_image_size.x),
PotUp(m_data->m_image_size.y));
m_data->m_texture_size = ivec2(lol::bit_ceil(m_data->m_image_size.x),
lol::bit_ceil(m_data->m_image_size.y));
}

Texture * TextureImage::GetTexture()


불러오는 중...
취소
저장