Last change
on this file since 1999 was
1999,
checked in by sam, 10 years ago
|
neercs: don't show the FPS information unless the setup is open.
|
File size:
1.5 KB
|
Line | |
---|
1 | // |
---|
2 | // Neercs |
---|
3 | // |
---|
4 | // Copyright: (c) 2012 Sam Hocevar <sam@hocevar.net> |
---|
5 | // |
---|
6 | |
---|
7 | #if defined HAVE_CONFIG_H |
---|
8 | # include "config.h" |
---|
9 | #endif |
---|
10 | |
---|
11 | #if defined _WIN32 |
---|
12 | # include <direct.h> |
---|
13 | #endif |
---|
14 | |
---|
15 | #if defined _XBOX |
---|
16 | # define _USE_MATH_DEFINES /* for M_PI */ |
---|
17 | # include <xtl.h> |
---|
18 | # undef near /* Fuck Microsoft */ |
---|
19 | # undef far /* Fuck Microsoft again */ |
---|
20 | #elif defined _WIN32 |
---|
21 | # define _USE_MATH_DEFINES /* for M_PI */ |
---|
22 | # define WIN32_LEAN_AND_MEAN |
---|
23 | # include <windows.h> |
---|
24 | # undef near /* Fuck Microsoft */ |
---|
25 | # undef far /* Fuck Microsoft again */ |
---|
26 | #else |
---|
27 | # include <cmath> |
---|
28 | #endif |
---|
29 | |
---|
30 | #include <time.h> |
---|
31 | #include <caca.h> |
---|
32 | |
---|
33 | #include "core.h" |
---|
34 | #include "loldebug.h" |
---|
35 | |
---|
36 | using namespace std; |
---|
37 | using namespace lol; |
---|
38 | |
---|
39 | #include "neercs.h" |
---|
40 | #include "video/render.h" |
---|
41 | |
---|
42 | extern "C" |
---|
43 | { |
---|
44 | #include "old/neercs.h" |
---|
45 | } |
---|
46 | |
---|
47 | Neercs::Neercs(int argc, char **argv) |
---|
48 | : m_term(new Term(ivec2(45, 16))), |
---|
49 | m_render(new Render(m_term->GetCaca())), |
---|
50 | m_ready(false) |
---|
51 | { |
---|
52 | Ticker::Ref(m_term); |
---|
53 | Ticker::Ref(m_render); |
---|
54 | } |
---|
55 | |
---|
56 | void Neercs::TickGame(float seconds) |
---|
57 | { |
---|
58 | WorldEntity::TickGame(seconds); |
---|
59 | } |
---|
60 | |
---|
61 | void Neercs::TickDraw(float seconds) |
---|
62 | { |
---|
63 | WorldEntity::TickDraw(seconds); |
---|
64 | } |
---|
65 | |
---|
66 | Neercs::~Neercs() |
---|
67 | { |
---|
68 | Ticker::Unref(m_term); |
---|
69 | Ticker::Unref(m_render); |
---|
70 | } |
---|
71 | |
---|
72 | int main(int argc, char **argv) |
---|
73 | { |
---|
74 | Application app("Neercs", ivec2(800, 600), 60.0f); |
---|
75 | |
---|
76 | #if defined _MSC_VER && !defined _XBOX |
---|
77 | _chdir("../.."); |
---|
78 | #elif defined _WIN32 && !defined _XBOX |
---|
79 | _chdir("../.."); |
---|
80 | #endif |
---|
81 | |
---|
82 | new Neercs(argc, argv); |
---|
83 | app.ShowPointer(false); |
---|
84 | |
---|
85 | app.Run(); |
---|
86 | |
---|
87 | return EXIT_SUCCESS; |
---|
88 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.