Browse Source

ps3: some compilation fixes.

undefined
Sam Hocevar 11 years ago
parent
commit
a7d169caff
2 changed files with 13 additions and 30 deletions
  1. +5
    -0
      src/gpu/shader.cpp
  2. +8
    -30
      src/lol/base/string.h

+ 5
- 0
src/gpu/shader.cpp View File

@@ -404,7 +404,12 @@ Shader::Shader(char const *vert, char const *frag)


int Shader::GetAttribCount() const int Shader::GetAttribCount() const
{ {
#if !defined __CELLOS_LV2__
return data->attrib_locations.Count(); return data->attrib_locations.Count();
#else
// TODO
return 0;
#endif
} }


ShaderAttrib Shader::GetAttribLocation(VertexUsage usage, int index) const ShaderAttrib Shader::GetAttribLocation(VertexUsage usage, int index) const


+ 8
- 30
src/lol/base/string.h View File

@@ -192,40 +192,18 @@ public:
return -1; return -1;
} }


bool StartsWith(char const* token) const
bool StartsWith(String const &s) const
{ {
const char* p = C();
while (*token != '\0')
{
if (*p != *token)
return false;

++p;
++token;
}

return true;
using namespace std;
return Count() >= s.Count()
&& memcmp(C(), s.C(), s.Count()) == 0;
} }


bool EndsWith(char const* token) const
bool EndsWith(String const &s) const
{ {
const char* p = C();
int token_idx = strlen(token) - 1;
int c_idx = strlen(p) - 1;

if (c_idx < token_idx)
return false;

while (token_idx >= 0)
{
if (token[token_idx] != p[c_idx])
return false;

--token_idx;
--c_idx;
}

return true;
using namespace std;
return Count() >= s.Count()
&& memcmp(C() + Count() - s.Count(), s.C(), s.Count()) == 0;
} }


inline String operator +(String const &s) const inline String operator +(String const &s) const


Loading…
Cancel
Save