ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/dclient/src/backend/ndk/color.cpp
Revision: 1.2
Committed: Sun Oct 24 20:31:50 2010 UTC (16 years ago) by sf-pippijn
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +2 -2 lines
Log Message:
use EV and plain sockets instead of asio

File Contents

# Content
1 /* color.cc
2 * This file is part of ncursesxx library
3 * Copyright (c) 2003,2004 by Stanislav Ievlev
4 *
5 * This file is covered by the GNU Library General Public License,
6 * which should be included with libncursesxx as the file COPYING.
7 */
8 #include <ndk/color.hh>
9
10 #include <ndk/application.hh>
11
12 #include <bitset>
13
14 using ndk::color;
15
16 static std::bitset<64> initialised;
17
18 color::color (short fg, short bg, attr_t attr)
19 : attr_ (attr)
20 , num_ (fg * 8 + bg + 1)
21 {
22 if (app->has_colors ())
23 if (!initialised[num_ - 1])
24 {
25 initialised[num_ - 1] = true;
26 return_unless (init_pair (num_, fg, bg) == OK);
27 }
28 }