2006-03-20 17:12:09 +00:00
|
|
|
/*
|
2014-06-01 17:55:23 +00:00
|
|
|
* Portions of this file are copyright Rebirth contributors and licensed as
|
|
|
|
* described in COPYING.txt.
|
|
|
|
* Portions of this file are copyright Parallax Software and licensed
|
|
|
|
* according to the Parallax license below.
|
|
|
|
* See COPYING.txt for license details.
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
|
|
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
|
|
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
|
|
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
|
|
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
|
|
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
|
|
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
|
|
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
|
|
|
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
|
|
|
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Routines to read/write pcx images.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-01-09 16:38:12 +00:00
|
|
|
#pragma once
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2013-10-26 03:40:50 +00:00
|
|
|
#include "pstypes.h"
|
2016-01-09 16:38:12 +00:00
|
|
|
#include "dxxsconf.h"
|
2016-03-19 19:08:10 +00:00
|
|
|
#include "dsx-ns.h"
|
2012-11-11 22:12:51 +00:00
|
|
|
|
2013-10-26 03:40:50 +00:00
|
|
|
struct grs_bitmap;
|
2015-12-22 04:18:50 +00:00
|
|
|
namespace dcx {
|
2013-01-06 21:11:53 +00:00
|
|
|
struct palette_array_t;
|
2015-12-22 04:18:50 +00:00
|
|
|
}
|
2013-10-26 03:40:50 +00:00
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
#define PCX_ERROR_NONE 0
|
|
|
|
#define PCX_ERROR_OPENING 1
|
|
|
|
#define PCX_ERROR_NO_HEADER 2
|
|
|
|
#define PCX_ERROR_WRONG_VERSION 3
|
|
|
|
#define PCX_ERROR_READING 4
|
|
|
|
#define PCX_ERROR_NO_PALETTE 5
|
|
|
|
#define PCX_ERROR_WRITING 6
|
|
|
|
#define PCX_ERROR_MEMORY 7
|
|
|
|
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I)
|
2015-12-13 18:00:49 +00:00
|
|
|
namespace dsx {
|
2013-03-03 01:03:33 +00:00
|
|
|
// Load bitmap for little-known 'baldguy' cheat.
|
2013-01-06 21:03:57 +00:00
|
|
|
extern int bald_guy_load( const char * filename, grs_bitmap * bmp,int bitmap_type ,palette_array_t &palette );
|
2015-12-13 18:00:48 +00:00
|
|
|
}
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
|
|
|
|
2015-12-13 18:00:49 +00:00
|
|
|
namespace dcx {
|
2015-12-13 18:00:48 +00:00
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
// Reads filename into bitmap bmp, and fills in palette. If bmp->bm_data==NULL,
|
|
|
|
// then bmp->bm_data is allocated and the w,h are filled.
|
|
|
|
// If palette==NULL the palette isn't read in. Returns error code.
|
|
|
|
|
2014-12-02 03:35:01 +00:00
|
|
|
int pcx_read_bitmap(const char * filename, grs_bitmap &bmp,int bitmap_type, palette_array_t &palette );
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
// Writes the bitmap bmp to filename, using palette. Returns error code.
|
|
|
|
|
2013-01-06 21:03:57 +00:00
|
|
|
extern int pcx_write_bitmap( const char * filename, grs_bitmap * bmp, palette_array_t &palette );
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2012-07-22 23:17:54 +00:00
|
|
|
extern const char *pcx_errormsg(int error_number);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-12-13 18:00:48 +00:00
|
|
|
}
|