瀏覽代碼

fixed 7 files out of 2745:

- removed 0 CR characters
 - removed 21 trailing whitespaces
 - replaced 42 tabs with spaces
legacy
Lolbot lolbot 11 年之前
父節點
當前提交
8cc04f0ba9
共有 6 個檔案被更改,包括 30 行新增30 行删除
  1. +17
    -17
      src/gpu/shader.cpp
  2. +6
    -6
      src/lol/base/map.h
  3. +1
    -1
      src/lol/gpu/texture.h
  4. +1
    -1
      src/lol/math/vector.h
  5. +1
    -1
      test/meshviewer.cpp
  6. +4
    -4
      test/unit/string.cpp

+ 17
- 17
src/gpu/shader.cpp 查看文件

@@ -60,8 +60,8 @@ private:
ID3DXConstantTable *vert_table, *frag_table;
#elif !defined __CELLOS_LV2__
GLuint prog_id, vert_id, frag_id;
// Benlitz: using a simple array could be faster since there is never more than a few attribute locations to store
Map<String, GLint> attrib_locations;
// Benlitz: using a simple array could be faster since there is never more than a few attribute locations to store
Map<String, GLint> attrib_locations;
#else
CGprogram vert_id, frag_id;
#endif
@@ -334,21 +334,21 @@ ShaderAttrib Shader::GetAttribLocation(char const *attr,
ret.m_flags |= (uint64_t)(uint16_t)index;
#if defined USE_D3D9 || defined _XBOX
#elif !defined __CELLOS_LV2__
GLint l;
if (!data->attrib_locations.TryGetValue(attr, l))
{
l = glGetAttribLocation(data->prog_id, attr);
if (l < 0)
{
Log::Warn("tried to query invalid attribute: %s\n", attr);
l = 0;
}
else
{
data->attrib_locations[String(attr)] = l;
}
}
GLint l;
if (!data->attrib_locations.TryGetValue(attr, l))
{
l = glGetAttribLocation(data->prog_id, attr);
if (l < 0)
{
Log::Warn("tried to query invalid attribute: %s\n", attr);
l = 0;
}
else
{
data->attrib_locations[String(attr)] = l;
}
}
ret.m_flags |= (uint64_t)(uint32_t)l << 32;
#else
/* FIXME: can we do this at all on the PS3? */


+ 6
- 6
src/lol/base/map.h 查看文件

@@ -24,13 +24,13 @@ namespace lol
template<typename K, typename V> class Map : protected Hash<K>
{
public:
/* If E is different from K, Hash<K> must implement operator()(E const&)
/* If E is different from K, Hash<K> must implement operator()(E const&)
* and an equality operator between K and E must exist in order to use this method.
*/

/* I choose to make this inline because passing the key by reference
* is usually suboptimal. */
template <typename E>
template <typename E>
inline V const& operator[] (E const &key) const
{
/* Look for the hash in our table and return the value. */
@@ -44,7 +44,7 @@ public:
return V();
}

template <typename E>
template <typename E>
inline V & operator[] (E const &key)
{
/* Look for the hash in our table and return the value if found. */
@@ -58,7 +58,7 @@ public:
return m_array.Last().m3;
}

template <typename E>
template <typename E>
inline void Remove(E const &key)
{
uint32_t hash = ((Hash<K> const &)*this)(key);
@@ -71,7 +71,7 @@ public:
}
}

template <typename E>
template <typename E>
inline bool HasKey(E const &key)
{
uint32_t hash = ((Hash<K> const &)*this)(key);
@@ -82,7 +82,7 @@ public:
return false;
}

template <typename E>
template <typename E>
inline bool TryGetValue(E const &key, V& value)
{
uint32_t hash = ((Hash<K> const &)*this)(key);


+ 1
- 1
src/lol/gpu/texture.h 查看文件

@@ -100,7 +100,7 @@ public:

void SetMagFiltering(TextureMagFilter filter);
void SetMinFiltering(TextureMinFilter filter);
void GenerateMipmaps();
void GenerateMipmaps();

ShaderTexture GetTexture() const;



+ 1
- 1
src/lol/math/vector.h 查看文件

@@ -1792,7 +1792,7 @@ template <typename T> struct Mat4
static Mat4<T> frustum(T left, T right, T bottom, T top, T near, T far);
static Mat4<T> perspective(T fov_y, T width, T height, T near, T far);
static Mat4<T> shifted_perspective(T fov_y, T screen_size, T screen_ratio_xy, T draw_distance);
void printf() const;

template<class U>


+ 1
- 1
test/meshviewer.cpp 查看文件

@@ -274,7 +274,7 @@ public:
cur_cam->SetProjection(mat4::shifted_perspective(m_fov_damp, screen_size * fov_ratio * 1.1f, 1600.f / 600.f, 1000.f));

vec3 cam_center = cam_min_max[0] + min_max_diff * .5f;
vec4 test = inverse(world_cam) * vec4(.0f,.0f,-1.0f,1.f);
test = test;
test = inverse(world_cam) * vec4(.0f,.0f,.0f,1.f);


+ 4
- 4
test/unit/string.cpp 查看文件

@@ -123,9 +123,9 @@ LOLUNIT_FIXTURE(StringTest)
LOLUNIT_ASSERT(!(s1 != s3));
}

LOLUNIT_TEST(StringCharsEqual)
LOLUNIT_TEST(StringCharsEqual)
{
char const* sz = "abc";
char const* sz = "abc";
String s1("abc");
String s2("ab");

@@ -135,9 +135,9 @@ LOLUNIT_FIXTURE(StringTest)
LOLUNIT_ASSERT(!(sz == s2));
}

LOLUNIT_TEST(StringCharsDifferent)
LOLUNIT_TEST(StringCharsDifferent)
{
char const* sz = "abc";
char const* sz = "abc";
String s1("ab");
String s2("abc");



Loading…
取消
儲存