source: abuse/trunk/src/chat.cpp

Last change on this file was 555, checked in by Sam Hocevar, 8 years ago

ps3: make everything compile on the PS3. Of course, nothing links yet
because so much support is missing.

File size: 1.1 KB
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *  Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
5 *
6 *  This software was released into the Public Domain. As with most public
7 *  domain software, no warranty is made or implied by Crack dot Com, by
8 *  Jonathan Clark, or by Sam Hocevar.
9 */
10
11#if defined HAVE_CONFIG_H
12#   include "config.h"
13#endif
14
15#include "common.h"
16
17#include "chat.h"
18#include "dev.h"
19
20chat_console *chat = NULL;
21
22chat_console::chat_console(JCFont *font, int width, int height) :
23  console(font,width,height<4 ? 4 : height,symbol_str("CHAT"))
24{
25    hide();
26    clear();
27    cx = 0;
28    cy = h - 1;
29    lastx = xres / 2 - screen_w() / 2;
30    lasty = yres - h;
31}
32
33void chat_console::clear()
34{
35  memset(screen,' ',w*h);
36  memset(screen+w*(h-2),'-',w);
37  redraw();
38}
39
40void chat_console::put_all(char *st)
41{
42  memmove(screen,screen+w,w*(h-3));
43  memset(screen+w*(h-3),' ',w);
44  memcpy(screen+w*(h-3),st,strlen(st));
45  redraw();
46}
47
48
49void chat_console::draw_user(char *st)
50{
51  memset(screen+w*(h-1),' ',w);
52  memcpy(screen+w*(h-1),st,strlen(st));
53  cx=strlen(st);
54  cy=h-1;
55  redraw();
56}
57
Note: See TracBrowser for help on using the repository browser.