source: abuse/branches/lol/src/points.cpp @ 732

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

build: SDL2 compilation fixes.

File size: 951 bytes
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 HAVE_CONFIG_H
12#   include "config.h"
13#endif
14
15#include <string.h>
16
17#include "common.h"
18
19#include "points.h"
20#include "dev.h"
21
22point_list::point_list(unsigned char how_many, unsigned char *Data)
23{
24  tot=how_many;
25  if (tot)
26  {
27    data=(unsigned char *)malloc((int)how_many*2);
28    memcpy(data,Data,(int)tot*2);
29  } else data=NULL;
30}
31
32point_list::point_list(bFILE *fp)
33{
34  fp->read(&tot,1);
35  if (tot)
36  {
37    data=(unsigned char *)malloc((int)tot*2);
38    fp->read(data,(int)tot*2);
39  } else data=NULL;
40}
41
42void point_list::save(bFILE *fp)
43{
44  fp->write(&tot,1);
45  if (tot) fp->write(data,(int)tot*2);
46}
47
48
49
Note: See TracBrowser for help on using the repository browser.