Browse Source

gpu: sip an empty LolFx class that embeds the compiler.

legacy
Sam Hocevar sam 12 years ago
parent
commit
26c432be90
6 changed files with 96 additions and 0 deletions
  1. +1
    -0
      src/Makefile.am
  2. +1
    -0
      src/core.h
  3. +51
    -0
      src/gpu/lolfx.cpp
  4. +35
    -0
      src/gpu/lolfx.h
  5. +2
    -0
      src/lolcore.vcxproj
  6. +6
    -0
      src/lolcore.vcxproj.filters

+ 1
- 0
src/Makefile.am View File

@@ -56,6 +56,7 @@ liblol_a_SOURCES = \
gpu/emptymaterial.lolfx \
gpu/testmaterial.lolfx \
\
gpu/lolfx.cpp gpu/lolfx.h \
gpu/lolfx-compiler.cpp gpu/lolfx-compiler.h \
generated/lolfx-parser.cpp generated/lolfx-parser.h \
generated/lolfx-scanner.cpp \


+ 1
- 0
src/core.h View File

@@ -113,6 +113,7 @@ static inline int isnan(float f)
#include "dict.h"
#include "map.h"
#include "layer.h"
#include "gpu/lolfx.h"
#include "gpu/shader.h"
#include "gpu/indexbuffer.h"
#include "gpu/vertexbuffer.h"


+ 51
- 0
src/gpu/lolfx.cpp View File

@@ -0,0 +1,51 @@
//
// Lol Engine
//
// Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
// This program is free software; 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 Sam Hocevar. See
// http://sam.zoy.org/projects/COPYING.WTFPL for more details.
//

//
// The LolFx class
// ---------------
//

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

#if defined _XBOX
# define _USE_MATH_DEFINES /* for M_PI */
# include <xtl.h>
# undef near /* Fuck Microsoft */
# undef far /* Fuck Microsoft again */
#elif defined _WIN32
# define _USE_MATH_DEFINES /* for M_PI */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# undef near /* Fuck Microsoft */
# undef far /* Fuck Microsoft again */
#endif

#include "core.h"
#include "gpu/lolfx-compiler.h"

namespace lol
{

LolFx::LolFx()
{
;
}

bool LolFx::Compile(char const *command)
{
LolFxCompiler lc(*this);
return lc.ParseString(command);
}

} /* namespace lol */


+ 35
- 0
src/gpu/lolfx.h View File

@@ -0,0 +1,35 @@
//
// Lol Engine
//
// Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
// This program is free software; 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 Sam Hocevar. See
// http://sam.zoy.org/projects/COPYING.WTFPL for more details.
//

//
// The LolFx class
// ---------------
//

#if !defined __GPU_LOLFX_H__
#define __GPU_LOLFX_H__

namespace lol
{

class LolFx
{
friend class LolFxParser;

public:
LolFx();

bool Compile(char const *command);
};

} /* namespace lol */

#endif /* __GPU_LOLFX_H__ */


+ 2
- 0
src/lolcore.vcxproj View File

@@ -252,6 +252,7 @@
<ClCompile Include="gpu\framebuffer.cpp" />
<ClCompile Include="gpu\indexbuffer.cpp" />
<ClCompile Include="gpu\lolfx-compiler.cpp" />
<ClCompile Include="gpu\lolfx.cpp" />
<ClCompile Include="gpu\shader.cpp" />
<ClCompile Include="gpu\vertexbuffer.cpp" />
<ClCompile Include="gradient.cpp" />
@@ -564,6 +565,7 @@
<ClInclude Include="gpu\framebuffer.h" />
<ClInclude Include="gpu\indexbuffer.h" />
<ClInclude Include="gpu\lolfx-compiler.h" />
<ClInclude Include="gpu\lolfx.h" />
<ClInclude Include="gpu\shader.h" />
<ClInclude Include="gpu\vertexbuffer.h" />
<ClInclude Include="gradient.h" />


+ 6
- 0
src/lolcore.vcxproj.filters View File

@@ -625,6 +625,9 @@
<ClCompile Include="gpu\lolfx-compiler.cpp">
<Filter>src\gpu</Filter>
</ClCompile>
<ClCompile Include="gpu\lolfx.cpp">
<Filter>src\gpu</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="image\image.h">
@@ -1560,6 +1563,9 @@
<ClInclude Include="gpu\lolfx-compiler.h">
<Filter>src\gpu</Filter>
</ClInclude>
<ClInclude Include="gpu\lolfx.h">
<Filter>src\gpu</Filter>
</ClInclude>
<ClInclude Include="generated\lolfx-parser.h">
<Filter>src\gpu</Filter>
</ClInclude>


Loading…
Cancel
Save