Ignore:
Timestamp:
Mar 13, 2013, 1:48:14 PM (8 years ago)
Author:
sam
Message:

base: roll our own constants because it’s always a pain in the ass
to get M_PI from the platform headers and cast it to float.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/term/term.cpp

    r2177 r2587  
    55#if defined HAVE_CONFIG_H
    66#   include "config.h"
    7 #endif
    8 
    9 #if defined _XBOX
    10 #   define _USE_MATH_DEFINES /* for M_PI */
    11 #   include <xtl.h>
    12 #elif defined _WIN32
    13 #   define _USE_MATH_DEFINES /* for M_PI */
    14 #   define WIN32_LEAN_AND_MEAN
    15 #   include <windows.h>
    167#endif
    178
     
    208199    for(int i = 0; i < h; i++)
    209200    {
    210         float a = M_PI / 180 * i * 16 + m_time * 4;
    211         float b = M_PI / 180 * i * 12;
     201        float a = F_PI / 180 * i * 16 + m_time * 4;
     202        float b = F_PI / 180 * i * 12;
    212203        int x = w / 2  - 14 + w / 4 * lol::cos(a) + w / 4 * lol::sin(b);
    213204        caca_put_str(m_caca, x, i, "LOL WUT! NEERCS SI TEH RULEZ");
     
    217208    for(int i = 0; i < w; i++)
    218209    {
    219         float a = m_time * 1 + M_PI / 180 * i * 8;
    220         float b = m_time * -2 + M_PI / 180 * i * 5;
     210        float a = m_time * 1 + F_PI / 180 * i * 8;
     211        float b = m_time * -2 + F_PI / 180 * i * 5;
    221212        int y = h / 2 + h / 4 * lol::cos(a) + h / 4 * lol::sin(b);
    222213        caca_set_color_argb(m_caca, hex_color(0.25f + 0.5f / w * i - 0.25f / h * y, 0.25f, 0.25f + 0.25f / w * i + 0.25f / h * y), bg_color);
Note: See TracChangeset for help on using the changeset viewer.