Changeset 2257


Ignore:
Timestamp:
Jan 22, 2013, 1:48:51 AM (10 years ago)
Author:
sam
Message:

core: move the Log and Timer classes to the sys/ subdirectory, use
the String class instead of the stack for logging, and get rid of
the old and useless BitField class.

Location:
trunk/src
Files:
1 deleted
4 edited
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r2238 r2257  
    1010    audio.cpp audio.h scene.cpp scene.h font.cpp font.h layer.cpp layer.h \
    1111    map.cpp map.h entity.cpp entity.h ticker.cpp ticker.h lolgl.h \
    12     tileset.cpp tileset.h forge.cpp forge.h video.cpp video.h log.cpp log.h \
    13     timer.cpp timer.h bitfield.h profiler.cpp profiler.h \
     12    tileset.cpp tileset.h forge.cpp forge.h video.cpp video.h \
    1413    world.cpp world.h sample.cpp sample.h sampler.cpp sampler.h \
    15     text.cpp text.h emitter.cpp emitter.h numeric.h \
     14    profiler.cpp profiler.h text.cpp text.h emitter.cpp emitter.h numeric.h \
    1615    worldentity.cpp worldentity.h gradient.cpp gradient.h gradient.lolfx \
    1716    platform.cpp platform.h sprite.cpp sprite.h camera.cpp camera.h \
    1817    \
    19     lol/unit.h lol/debug.h \
    2018    lol/base/types.h lol/base/array.h lol/base/string.h lol/base/hash.h \
    2119    lol/base/map.h \
    2220    lol/math/vector.h lol/math/half.h lol/math/real.h lol/math/remez.h \
    23     lol/math/math.h \
    24     lol/math/geometry.h \
    25     lol/sys/init.h \
     21    lol/math/math.h lol/math/geometry.h \
     22    lol/sys/init.h lol/sys/log.h lol/sys/thread.h lol/sys/timer.h \
    2623    lol/image/color.h \
     24    lol/unit.h lol/debug.h \
    2725    \
    2826    generated/location.hh generated/position.hh generated/stack.hh \
     
    7270    mesh/mesh.cpp mesh/mesh.h \
    7371    \
    74     sys/init.cpp \
    75     sys/threadbase.h sys/thread.h \
     72    sys/init.cpp sys/log.cpp sys/timer.cpp \
     73    sys/threadbase.h \
    7674    \
    7775    image/image.cpp image/image.h image/image-private.h \
  • trunk/src/core.h

    r2238 r2257  
    9090
    9191#include <lol/sys/init.h>
     92#include <lol/sys/log.h>
    9293#include <lol/sys/thread.h>
     94#include <lol/sys/timer.h>
    9395
    9496#include <lol/image/color.h>
    9597
    9698#include "numeric.h"
    97 #include "timer.h"
    9899
    99100// Static classes
    100 #include "log.h"
    101101#include "platform.h"
    102102#include "video.h"
  • trunk/src/lol/sys/log.h

    r2256 r2257  
    22// Lol Engine
    33//
    4 // Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
    55//   This program is free software; you can redistribute it and/or
    66//   modify it under the terms of the Do What The Fuck You Want To
     
    1515//
    1616
    17 #if !defined __LOL_LOG_H__
    18 #define __LOL_LOG_H__
     17#if !defined __LOL_SYS_LOG_H__
     18#define __LOL_SYS_LOG_H__
    1919
    2020#include <stdint.h>
     
    5252} /* namespace lol */
    5353
    54 #endif // __LOL_LOG_H__
     54#endif // __LOL_SYS_LOG_H__
    5555
  • trunk/src/lol/sys/timer.h

    r2256 r2257  
    22// Lol Engine
    33//
    4 // Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
    55//   This program is free software; you can redistribute it and/or
    66//   modify it under the terms of the Do What The Fuck You Want To
     
    1414//
    1515
    16 #if !defined __LOL_TIMER_H__
    17 #define __LOL_TIMER_H__
     16#if !defined __LOL_SYS_TIMER_H__
     17#define __LOL_SYS_TIMER_H__
    1818
    1919namespace lol
     
    3838} /* namespace lol */
    3939
    40 #endif // __LOL_TIMER_H__
     40#endif // __LOL_SYS_TIMER_H__
    4141
  • trunk/src/lolcore.vcxproj

    r2239 r2257  
    273273    <ClCompile Include="input\stick.cpp" />
    274274    <ClCompile Include="layer.cpp" />
    275     <ClCompile Include="log.cpp" />
    276275    <ClCompile Include="map.cpp" />
    277276    <ClCompile Include="math\geometry.cpp" />
     
    295294    <ClCompile Include="sprite.cpp" />
    296295    <ClCompile Include="sys\init.cpp" />
     296    <ClCompile Include="sys\log.cpp" />
     297    <ClCompile Include="sys\timer.cpp" />
    297298    <ClCompile Include="text.cpp" />
    298299    <ClCompile Include="ticker.cpp" />
     
    307308    <ClInclude Include="application\application.h" />
    308309    <ClInclude Include="audio.h" />
    309     <ClInclude Include="bitfield.h" />
    310310    <ClInclude Include="bullet\btBulletCollisionCommon.h" />
    311311    <ClInclude Include="bullet\btBulletDynamicsCommon.h" />
     
    585585    <ClInclude Include="input\stick.h" />
    586586    <ClInclude Include="layer.h" />
    587     <ClInclude Include="log.h" />
    588587    <ClInclude Include="loldebug.h" />
    589588    <ClInclude Include="lolgl.h" />
     
    602601    <ClInclude Include="lol\math\vector.h" />
    603602    <ClInclude Include="lol\sys\init.h" />
     603    <ClInclude Include="lol\sys\log.h" />
    604604    <ClInclude Include="lol\sys\thread.h" />
     605    <ClInclude Include="lol\sys\timer.h" />
    605606    <ClInclude Include="lol\unit.h" />
    606607    <ClInclude Include="mesh\mesh.h" />
  • trunk/src/lolcore.vcxproj.filters

    r2226 r2257  
    193193      <Filter>...</Filter>
    194194    </ClCompile>
    195     <ClCompile Include="log.cpp">
    196       <Filter>...</Filter>
    197     </ClCompile>
    198195    <ClCompile Include="map.cpp">
    199196      <Filter>...</Filter>
     
    753750      <Filter>...</Filter>
    754751    </ClInclude>
    755     <ClInclude Include="bitfield.h">
    756       <Filter>...</Filter>
    757     </ClInclude>
    758752    <ClInclude Include="camera.h">
    759753      <Filter>...</Filter>
     
    784778    </ClInclude>
    785779    <ClInclude Include="layer.h">
    786       <Filter>...</Filter>
    787     </ClInclude>
    788     <ClInclude Include="log.h">
    789780      <Filter>...</Filter>
    790781    </ClInclude>
  • trunk/src/sys/log.cpp

    r2256 r2257  
    8383    };
    8484
    85     char buf[4096];
    86     vsnprintf(buf, 4095, fmt, ap);
    87     buf[4095] = '\0';
    88 
    89     __android_log_print(prio[type], "LOL", "[%d] %s", (int)gettid(), buf);
     85    String buf = String::Printf(fmt, ap);
     86    __android_log_print(prio[type], "LOL", "[%d] %s", (int)gettid(), &buf[0]);
    9087
    9188#else
     
    9996
    10097#   if defined _WIN32
    101     char buf[4096];
    102     vsnprintf(buf, 4095, fmt, ap);
    103     buf[4095] = '\0';
    104     OutputDebugString(prefix[type]);
    105     OutputDebugString(": ");
    106     OutputDebugString(buf);
     98    String buf = String(prefix[type]) + ": " + String::Printf(fmt, ap);
     99    OutputDebugString(&buf[0]);
    107100#   else
    108101    fprintf(stderr, "%s: ", prefix[type]);
Note: See TracChangeset for help on using the changeset viewer.