Changeset 2354


Ignore:
Timestamp:
Feb 5, 2013, 12:48:19 AM (7 years ago)
Author:
sam
Message:

base: move headers around and promote gpu/ to lol/gpu/.

Location:
trunk/src
Files:
5 added
7 edited
1 copied
6 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r2289 r2354  
    1717    light.cpp light.h \
    1818    \
     19    $(liblol_headers) \
     20    $(liblol_sources) \
     21    \
     22    $(ps3_sources) \
     23    $(xbox_sources) \
     24    $(nacl_sources) \
     25    $(sdl_sources) \
     26    $(d3d9_sources) \
     27    $(android_sources) \
     28    \
     29    $(bullet_sources)
     30liblol_a_CPPFLAGS = @LOL_CFLAGS@ -I$(srcdir)/bullet
     31
     32EXTRA_DIST = easymesh/easymesh-scanner.l easymesh/easymesh-parser.y \
     33             gpu/lolfx-scanner.l gpu/lolfx-parser.y
     34
     35liblol_headers = \
     36    lol/base/base.h \
    1937    lol/base/log.h lol/base/array.h lol/base/types.h lol/base/array.h \
    2038    lol/base/string.h lol/base/hash.h lol/base/map.h \
    21     lol/math/vector.h lol/math/half.h lol/math/real.h lol/math/remez.h \
    22     lol/math/math.h lol/math/geometry.h \
     39    \
     40    lol/math/math.h \
     41    lol/math/functions.h lol/math/vector.h lol/math/half.h lol/math/real.h \
     42    lol/math/remez.h lol/math/math.h lol/math/geometry.h \
     43    \
     44    lol/sys/sys.h \
    2345    lol/sys/init.h lol/sys/thread.h lol/sys/timer.h \
     46    \
     47    lol/image/image.h \
    2448    lol/image/color.h \
    25     lol/unit.h \
    26     \
     49    \
     50    lol/gpu/gpu.h \
     51    lol/gpu/shader.h lol/gpu/indexbuffer.h lol/gpu/vertexbuffer.h \
     52    lol/gpu/gpu/framebuffer.h lol/gpu/texture.h lol/gpu/lolfx.h \
     53    \
     54    lol/unit.h
     55
     56liblol_sources = \
    2757    generated/location.hh generated/position.hh generated/stack.hh \
    2858    \
     
    3767    generated/easymesh-scanner.cpp \
    3868    \
    39     $(ps3_sources) \
    40     $(xbox_sources) \
    41     $(nacl_sources) \
    42     $(sdl_sources) \
    43     $(d3d9_sources) \
    44     $(android_sources) \
    45     \
    4669    base/hash.cpp base/log.cpp base/string.cpp \
    4770    \
    4871    math/vector.cpp math/real.cpp math/half.cpp math/trig.cpp \
    4972    math/geometry.cpp \
     73    \
     74    gpu/shader.cpp gpu/indexbuffer.cpp gpu/vertexbuffer.cpp \
     75    gpu/framebuffer.cpp gpu/texture.cpp \
    5076    \
    5177    input/input.cpp input/input.h \
    5278    input/keyboard.cpp input/keyboard.h \
    5379    input/stick.cpp input/stick.h \
    54     \
    55     gpu/shader.cpp gpu/shader.h \
    56     gpu/indexbuffer.cpp gpu/indexbuffer.h \
    57     gpu/vertexbuffer.cpp gpu/vertexbuffer.h \
    58     gpu/framebuffer.cpp gpu/framebuffer.h \
    59     gpu/texture.cpp gpu/texture.h \
    6080    \
    6181    gpu/defaultmaterial.lolfx \
     
    6484    gpu/testmaterial.lolfx \
    6585    \
    66     gpu/lolfx.cpp gpu/lolfx.h \
     86    gpu/lolfx.cpp \
    6787    gpu/lolfx-compiler.cpp gpu/lolfx-compiler.h \
    6888    generated/lolfx-parser.cpp generated/lolfx-parser.h \
     
    82102    loldebug.h \
    83103    debug/fps.cpp debug/fps.h \
    84     debug/record.cpp debug/record.h debug/stats.cpp debug/stats.h \
    85     \
    86     $(bullet_sources)
    87 liblol_a_CPPFLAGS = @LOL_CFLAGS@ -I$(srcdir)/bullet
    88 
    89 EXTRA_DIST = easymesh/easymesh-scanner.l easymesh/easymesh-parser.y \
    90              gpu/lolfx-scanner.l gpu/lolfx-parser.y
     104    debug/record.cpp debug/record.h debug/stats.cpp debug/stats.h
    91105
    92106sdl_sources = \
  • trunk/src/core.h

    r2289 r2354  
    8080
    8181// Base types
    82 #include <lol/base/types.h>
    83 #include <lol/base/log.h>
    84 #include <lol/base/assert.h>
    85 #include <lol/base/array.h>
    86 #include <lol/base/string.h>
    87 #include <lol/base/hash.h>
    88 #include <lol/base/map.h>
    89 
     82#include <lol/base/base.h>
    9083#include <lol/math/math.h>
    91 #include <lol/math/half.h>
    92 #include <lol/math/real.h>
    93 #include <lol/math/vector.h>
    94 #include <lol/math/geometry.h>
    95 
    96 #include <lol/sys/init.h>
    97 #include <lol/sys/thread.h>
    98 #include <lol/sys/timer.h>
    99 
    100 #include <lol/image/color.h>
     84#include <lol/sys/sys.h>
     85#include <lol/image/image.h>
     86#include <lol/gpu/gpu.h>
    10187
    10288#include "numeric.h"
     
    131117#include "map.h"
    132118#include "layer.h"
    133 #include "gpu/lolfx.h"
    134 #include "gpu/shader.h"
    135 #include "gpu/texture.h"
    136 #include "gpu/indexbuffer.h"
    137 #include "gpu/vertexbuffer.h"
    138 #include "gpu/framebuffer.h"
    139119#include "mesh/mesh.h"
    140120#include "image/image.h"
  • trunk/src/lol/gpu/framebuffer.h

    r2349 r2354  
    1414//
    1515
    16 #if !defined __LOL_FRAMEBUFFER_H__
    17 #define __LOL_FRAMEBUFFER_H__
     16#if !defined __LOL_GPU_FRAMEBUFFER_H__
     17#define __LOL_GPU_FRAMEBUFFER_H__
    1818
    1919#include <cstring>
     
    3939} /* namespace lol */
    4040
    41 #endif // __LOL_FRAMEBUFFER_H__
     41#endif // __LOL_GPU_FRAMEBUFFER_H__
    4242
  • trunk/src/lol/gpu/indexbuffer.h

    r2349 r2354  
    1414//
    1515
    16 #if !defined __LOL_INDEXBUFFER_H__
    17 #define __LOL_INDEXBUFFER_H__
     16#if !defined __LOL_GPU_INDEXBUFFER_H__
     17#define __LOL_GPU_INDEXBUFFER_H__
    1818
    1919#include <cstring>
     
    4040} /* namespace lol */
    4141
    42 #endif // __LOL_INDEXBUFFER_H__
     42#endif // __LOL_GPU_INDEXBUFFER_H__
    4343
  • trunk/src/lol/gpu/lolfx.h

    r2349 r2354  
    1414//
    1515
    16 #if !defined __GPU_LOLFX_H__
    17 #define __GPU_LOLFX_H__
     16#if !defined __LOL_GPU_LOLFX_H__
     17#define __LOL_GPU_LOLFX_H__
    1818
    19 #include "gpu/shader.h"
     19#include <lol/gpu/shader.h>
    2020
    2121namespace lol
     
    4545} /* namespace lol */
    4646
    47 #endif /* __GPU_LOLFX_H__ */
     47#endif /* __LOL_GPU_LOLFX_H__ */
    4848
  • trunk/src/lol/gpu/shader.h

    r2349 r2354  
    1414//
    1515
    16 #if !defined __LOL_SHADER_H__
    17 #define __LOL_SHADER_H__
     16#if !defined __LOL_GPU_SHADER_H__
     17#define __LOL_GPU_SHADER_H__
    1818
    1919#include <stdint.h>
     
    103103} /* namespace lol */
    104104
    105 #endif // __LOL_SHADER_H__
     105#endif // __LOL_GPU_SHADER_H__
    106106
  • trunk/src/lol/gpu/texture.h

    r2349 r2354  
    1414//
    1515
    16 #if !defined __LOL_TEXTURE_H__
    17 #define __LOL_TEXTURE_H__
     16#if !defined __LOL_GPU_TEXTURE_H__
     17#define __LOL_GPU_TEXTURE_H__
    1818
    1919namespace lol
     
    5656} /* namespace lol */
    5757
    58 #endif // __LOL_TEXTURE_H__
     58#endif // __LOL_GPU_TEXTURE_H__
    5959
  • trunk/src/lol/gpu/vertexbuffer.h

    • Property svn:keywords set to Id
    r2349 r2354  
    1414//
    1515
    16 #if !defined __LOL_VERTEXBUFFER_H__
    17 #define __LOL_VERTEXBUFFER_H__
     16#if !defined __LOL_GPU_VERTEXBUFFER_H__
     17#define __LOL_GPU_VERTEXBUFFER_H__
    1818
    1919#include <cstring>
     
    223223} /* namespace lol */
    224224
    225 #endif // __LOL_VERTEXBUFFER_H__
    226 
     225#endif // __LOL_GPU_VERTEXBUFFER_H__
     226
  • trunk/src/lol/math/functions.h

    r2349 r2354  
    1515//
    1616
    17 #if !defined __LOL_MATH_MATH_H__
    18 #define __LOL_MATH_MATH_H__
     17#if !defined __LOL_MATH_FUNCTIONS_H__
     18#define __LOL_MATH_FUNCTIONS_H__
    1919
    2020#include <cmath>
     
    174174} /* namespace lol */
    175175
    176 #endif // __LOL_MATH_MATH_H__
     176#endif // __LOL_MATH_FUNCTIONS_H__
    177177
  • trunk/src/lol/math/geometry.h

    r2232 r2354  
    1212//
    1313// Various geometry functions
    14 // -----------------------
     14// --------------------------
    1515//
    1616
    17 #if !defined __LOL_GEOMETRY_GEOMETRY_H__
    18 #define __LOL_GEOMETRY_GEOMETRY_H__
     17#if !defined __LOL_MATH_GEOMETRY_H__
     18#define __LOL_MATH_GEOMETRY_H__
    1919
    2020#include <cmath>
     
    5252} /* namespace lol */
    5353
    54 #endif // __LOL_GEOMETRY_GEOMETRY_H__
     54#endif // __LOL_MATH_GEOMETRY_H__
    5555
  • trunk/src/lol/math/half.h

    r2192 r2354  
    1414//
    1515
    16 #if !defined __LOL_HALF_H__
    17 #define __LOL_HALF_H__
     16#if !defined __LOL_MATH_HALF_H__
     17#define __LOL_MATH_HALF_H__
    1818
    1919#include <cstdio>
     
    182182} /* namespace lol */
    183183
    184 #endif // __LOL_HALF_H__
     184#endif // __LOL_MATH_HALF_H__
    185185
  • trunk/src/lol/math/math.h

    r2308 r2354  
    33//
    44// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
    5 // Copyright: (c) 2012-2013 Benjamin "Touky" Huet <huet.benjamin@gmail.com>
    65//   This program is free software; you can redistribute it and/or
    76//   modify it under the terms of the Do What The Fuck You Want To
     
    109//
    1110
    12 //
    13 // Various maths functions
    14 // -----------------------
    15 //
    16 
    1711#if !defined __LOL_MATH_MATH_H__
    1812#define __LOL_MATH_MATH_H__
    1913
    20 #include <cmath>
    21 #include <cstdio>
    22 #include <algorithm>
    23 
    24 #include <stdint.h>
    25 
    26 namespace lol
    27 {
    28 
    29 /* This is OUR namespace. Don't let Windows headers fuck with it. */
    30 #undef min
    31 #undef max
    32 
    33 /* Standard cmath functions */
    34 static inline double sqrt(double const &x) { return std::sqrt(x); }
    35 static inline float sqrt(float const &x) { return std::sqrt(x); }
    36 
    37 static inline double exp(double const &x) { return std::exp(x); }
    38 static inline float exp(float const &x) { return std::exp(x); }
    39 
    40 static inline double sin(double const &x) { return std::sin(x); }
    41 static inline double cos(double const &x) { return std::cos(x); }
    42 static inline double tan(double const &x) { return std::tan(x); }
    43 static inline float sin(float const &x) { return std::sin(x); }
    44 static inline float cos(float const &x) { return std::cos(x); }
    45 static inline float tan(float const &x) { return std::tan(x); }
    46 
    47 static inline double asin(double const &x) { return std::asin(x); }
    48 static inline double acos(double const &x) { return std::acos(x); }
    49 static inline double atan(double const &x) { return std::atan(x); }
    50 static inline float asin(float const &x) { return std::asin(x); }
    51 static inline float acos(float const &x) { return std::acos(x); }
    52 static inline float atan(float const &x) { return std::atan(x); }
    53 
    54 static inline double atan2(double const &y, double const &x)
    55 {
    56     return std::atan2(y, x);
    57 }
    58 
    59 static inline float atan2(float const &y, float const &x)
    60 {
    61     return std::atan2(y, x);
    62 }
    63 
    64 static inline double pow(double const &x, double const &y)
    65 {
    66     return std::pow(x, y);
    67 }
    68 
    69 static inline float pow(float const &x, float const &y)
    70 {
    71     return std::pow(x, y);
    72 }
    73 
    74 /* Our extensions */
    75 static inline void sincos(double const &x, double *s, double *c)
    76 {
    77     *s = std::sin(x);
    78     *c = std::cos(x);
    79 }
    80 
    81 static inline void sincos(float const &x, float *s, float *c)
    82 {
    83     *s = std::sin(x);
    84     *c = std::cos(x);
    85 }
    86 
    87 static inline float lerp(float const &a, float const &b, float const &x)
    88 {
    89     return a + (b - a) * x;
    90 }
    91 
    92 static inline double lerp(double const &a, double const &b, double const &x)
    93 {
    94     return a + (b - a) * x;
    95 }
    96 
    97 static inline ldouble lerp(ldouble const &a, ldouble const &b, ldouble const &x)
    98 {
    99     return a + (b - a) * x;
    100 }
    101 
    102 
    103 /* These accelerated functions will be merged into the above, one day */
    104 double lol_sin(double);
    105 double lol_cos(double);
    106 double lol_tan(double);
    107 void lol_sincos(double, double*, double*);
    108 void lol_sincos(float, float*, float*);
    109 double lol_asin(double);
    110 double lol_acos(double);
    111 double lol_atan(double);
    112 double lol_atan2(double, double);
    113 
    114 /* C++ doesn't define abs() and fmod() for all types; we add these for
    115  * convenience to avoid adding complexity to vector.h. */
    116 static inline int8_t abs(int8_t x) { return std::abs(x); }
    117 static inline uint8_t abs(uint8_t x) { return x; }
    118 static inline int16_t abs(int16_t x) { return std::abs(x); }
    119 static inline uint16_t abs(uint16_t x) { return x; }
    120 static inline int32_t abs(int32_t x) { return std::abs(x); }
    121 static inline uint32_t abs(uint32_t x) { return x; }
    122 #if defined __native_client__
    123 /* The pepper 19 toolchain doesn't provide abs() for long long int. */
    124 static inline int64_t abs(int64_t x) { return x > 0 ? x : -x; }
    125 #else
    126 static inline int64_t abs(int64_t x) { return std::abs(x); }
    127 #endif
    128 static inline uint64_t abs(uint64_t x) { return x; }
    129 static inline float abs(float x) { return std::abs(x); }
    130 static inline double abs(double x) { return std::abs(x); }
    131 static inline ldouble abs(ldouble x) { return std::abs(x); }
    132 
    133 static inline uint8_t fmod(uint8_t x, uint8_t y) { return x % y; }
    134 static inline int8_t fmod(int8_t x, int8_t y) { return x % y; }
    135 static inline uint16_t fmod(uint16_t x, uint16_t y) { return x % y; }
    136 static inline int16_t fmod(int16_t x, int16_t y) { return x % y; }
    137 static inline uint32_t fmod(uint32_t x, uint32_t y) { return x % y; }
    138 static inline int32_t fmod(int32_t x, int32_t y) { return x % y; }
    139 static inline uint64_t fmod(uint64_t x, uint64_t y) { return x % y; }
    140 static inline int64_t fmod(int64_t x, int64_t y) { return x % y; }
    141 static inline float fmod(float x, float y) { return std::fmod(x, y); }
    142 static inline double fmod(double x, double y) { return std::fmod(x, y); }
    143 static inline ldouble fmod(ldouble x, ldouble y) { return std::fmod(x, y); }
    144 
    145 static inline uint8_t fract(uint8_t x) { (void)x; return 0; }
    146 static inline int8_t fract(int8_t x) { (void)x; return 0; }
    147 static inline uint16_t fract(uint16_t x) { (void)x; return 0; }
    148 static inline int16_t fract(int16_t x) { (void)x; return 0; }
    149 static inline uint32_t fract(uint32_t x) { (void)x; return 0; }
    150 static inline int32_t fract(int32_t x) { (void)x; return 0; }
    151 static inline uint64_t fract(uint64_t x) { (void)x; return 0; }
    152 static inline int64_t fract(int64_t x) { (void)x; return 0; }
    153 static inline float fract(float x) { return x - std::floor(x); }
    154 static inline double fract(double x) { return x - std::floor(x); }
    155 static inline ldouble fract(ldouble x) { return x - std::floor(x); }
    156 
    157 #define LOL_MIN_MAX_CLAMP(T) \
    158     static inline T min(T x, T y) { return std::min(x, y); } \
    159     static inline T max(T x, T y) { return std::max(x, y); } \
    160     static inline T clamp(T x, T y, T z) { return min(max(x, y), z); }
    161 LOL_MIN_MAX_CLAMP(uint8_t)
    162 LOL_MIN_MAX_CLAMP(int8_t)
    163 LOL_MIN_MAX_CLAMP(uint16_t)
    164 LOL_MIN_MAX_CLAMP(int16_t)
    165 LOL_MIN_MAX_CLAMP(uint32_t)
    166 LOL_MIN_MAX_CLAMP(int32_t)
    167 LOL_MIN_MAX_CLAMP(uint64_t)
    168 LOL_MIN_MAX_CLAMP(int64_t)
    169 LOL_MIN_MAX_CLAMP(float)
    170 LOL_MIN_MAX_CLAMP(double)
    171 LOL_MIN_MAX_CLAMP(ldouble)
    172 #undef LOL_CLAMP
    173 
    174 } /* namespace lol */
     14#include <lol/math/functions.h>
     15#include <lol/math/half.h>
     16#include <lol/math/real.h>
     17#include <lol/math/vector.h>
     18#include <lol/math/geometry.h>
    17519
    17620#endif // __LOL_MATH_MATH_H__
  • trunk/src/lol/sys/thread.h

    r2238 r2354  
    1414//
    1515
    16 #if !defined __LOL_THREAD_H__
    17 #define __LOL_THREAD_H__
     16#if !defined __LOL_SYS_THREAD_H__
     17#define __LOL_SYS_THREAD_H__
    1818
    1919#if defined __CELLOS_LV2__
     
    4747} /* namespace lol */
    4848
    49 #endif // __LOL_THREAD_H__
     49#endif // __LOL_SYS_THREAD_H__
    5050
  • trunk/src/lolcore.vcxproj

    r2289 r2354  
    571571    <ClInclude Include="generated\position.hh" />
    572572    <ClInclude Include="generated\stack.hh" />
    573     <ClInclude Include="gpu\framebuffer.h" />
    574     <ClInclude Include="gpu\indexbuffer.h" />
    575573    <ClInclude Include="gpu\lolfx-compiler.h" />
    576     <ClInclude Include="gpu\lolfx.h" />
    577     <ClInclude Include="gpu\shader.h" />
    578     <ClInclude Include="gpu\texture.h" />
    579     <ClInclude Include="gpu\vertexbuffer.h" />
    580574    <ClInclude Include="gradient.h" />
    581575    <ClInclude Include="image\image-private.h" />
     
    590584    <ClInclude Include="lol\base\array.h" />
    591585    <ClInclude Include="lol\base\assert.h" />
     586    <ClInclude Include="lol\base\base.h" />
    592587    <ClInclude Include="lol\base\hash.h" />
    593588    <ClInclude Include="lol\base\log.h" />
     
    595590    <ClInclude Include="lol\base\string.h" />
    596591    <ClInclude Include="lol\base\types.h" />
     592    <ClInclude Include="lol\gpu\framebuffer.h" />
     593    <ClInclude Include="lol\gpu\gpu.h" />
     594    <ClInclude Include="lol\gpu\indexbuffer.h" />
     595    <ClInclude Include="lol\gpu\lolfx.h" />
     596    <ClInclude Include="lol\gpu\shader.h" />
     597    <ClInclude Include="lol\gpu\texture.h" />
     598    <ClInclude Include="lol\gpu\vertexbuffer.h" />
    597599    <ClInclude Include="lol\image\color.h" />
     600    <ClInclude Include="lol\image\image.h" />
     601    <ClInclude Include="lol\math\functions.h" />
    598602    <ClInclude Include="lol\math\geometry.h" />
    599603    <ClInclude Include="lol\math\half.h" />
     
    603607    <ClInclude Include="lol\math\vector.h" />
    604608    <ClInclude Include="lol\sys\init.h" />
     609    <ClInclude Include="lol\sys\sys.h" />
    605610    <ClInclude Include="lol\sys\thread.h" />
    606611    <ClInclude Include="lol\sys\timer.h" />
Note: See TracChangeset for help on using the changeset viewer.