ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/dclient/src/backend/ndk/pad.cpp
(Generate patch)

Comparing deliantra/dclient/src/backend/ndk/pad.cpp (file contents):
Revision 1.1 by sf-pippijn, Tue Oct 19 09:45:09 2010 UTC vs.
Revision 1.3 by sf-pippijn, Wed Oct 20 09:21:48 2010 UTC

5 * This file is covered by the GNU Library General Public License, 5 * This file is covered by the GNU Library General Public License,
6 * which should be included with libncursesxx as the file COPYING. 6 * which should be included with libncursesxx as the file COPYING.
7 */ 7 */
8#include <ndk++/pad.hh> 8#include <ndk++/pad.hh>
9 9
10#include <ndk++/application.hh>
10#include <ndk++/window.hh> 11#include <ndk++/window.hh>
11 12
12#include <stdexcept> 13#include <stdexcept>
13 14
14using ndk::pad; 15using ndk::pad;
16pad::pad () 17pad::pad ()
17 : pad_ (newpad (1, 1), delwin) 18 : pad_ (newpad (1, 1), delwin)
18{ 19{
19 if (!pad_) 20 if (!pad_)
20 throw std::runtime_error ("newpad failed"); 21 throw std::runtime_error ("newpad failed");
21 keypad (win (), TRUE); /* initialize advanced keycodes for this window */ 22 app->enable_keypad (win ());
22} 23}
23 24
24pad::~pad () 25pad::~pad ()
25{ 26{
26} 27}
50} 51}
51 52
52void 53void
53pad::draw (window &viewport, int x, int y) 54pad::draw (window &viewport, int x, int y)
54{ 55{
55 return_unless (copywin (win (), viewport.win (), y, x, 1, 1, 56 return_unless (copywin (win (), viewport.win (), y + 1, x, 1, 1,
56 viewport.height () - 2, viewport.width () - 2, FALSE) == OK); 57 viewport.height () - 2, viewport.width () - 2, FALSE) == OK);
57} 58}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines