some of Ray Chason's MSDOS and other fixes

This commit is contained in:
nhmall
2016-03-05 14:44:50 -05:00
parent ef9cd17942
commit 78857961d2
22 changed files with 1484 additions and 201 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 flag.h $NHDT-Date: 1451683047 2016/01/01 21:17:27 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.93 $ */
/* NetHack 3.6 flag.h $NHDT-Date: 1457207000 2016/03/05 19:43:20 $ $NHDT-Branch: chasonr $:$NHDT-Revision: 1.101 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -261,6 +261,8 @@ struct instance_flags {
#ifdef MSDOS
boolean hasvga; /* has a vga adapter */
boolean usevga; /* use the vga adapter */
boolean hasvesa; /* has a VESA-capable VGA adapter */
boolean usevesa; /* use the VESA-capable VGA adapter */
boolean grmode; /* currently in graphics mode */
#endif
#ifdef LAN_FEATURES

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 pcconf.h $NHDT-Date: 1432512776 2015/05/25 00:12:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.17 $ */
/* NetHack 3.6 pcconf.h $NHDT-Date: 1457207019 2016/03/05 19:43:39 $ $NHDT-Branch: chasonr $:$NHDT-Revision: 1.19 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -79,6 +79,7 @@
#if (defined(SCREEN_BIOS) || defined(SCREEN_DJGPPFAST)) && !defined(PC9800)
#ifdef USE_TILES
#define SCREEN_VGA /* Include VGA graphics routines in the build */
#define SCREEN_VESA
#endif
#endif
#else
@@ -86,6 +87,7 @@
#undef SCREEN_BIOS
#undef SCREEN_DJGPPFAST
#undef SCREEN_VGA
#undef SCREEN_VESA
#undef TERMLIB
#define ANSI_DEFAULT
#endif
@@ -310,9 +312,8 @@
#endif
/* SCREEN_8514, SCREEN_VESA are only placeholders presently - sub VGA instead
*/
#if defined(SCREEN_8514) || defined(SCREEN_VESA)
#if defined(SCREEN_8514)
#undef SCREEN_8514
#undef SCREEN_VESA
#define SCREEN_VGA
#endif
/* Graphical tile sanity checks */

43
include/tileset.h Normal file
View File

@@ -0,0 +1,43 @@
/* NetHack 3.6 tileset.h $NHDT-Date: 1457207052 2016/03/05 19:44:12 $ $NHDT-Branch: chasonr $:$NHDT-Revision: 1.0 $ */
/* Copyright (c) Ray Chason, 2016. */
/* NetHack may be freely redistributed. See license for details. */
#ifndef TILESET_H
#define TILESET_H
struct Pixel {
unsigned char r, g, b, a;
};
struct TileImage {
/* Image data */
unsigned width, height;
struct Pixel *pixels; /* for direct color */
unsigned char *indexes; /* for paletted images */
};
boolean FDECL(read_tiles, (const char *filename, BOOLEAN_P true_color));
const struct Pixel *NDECL(get_palette);
void NDECL(free_tiles);
const struct TileImage *FDECL(get_tile, (unsigned tile_index));
/* Used internally by the tile set code */
struct TileSetImage {
/* Image data */
unsigned width, height;
struct Pixel *pixels; /* for direct color */
unsigned char *indexes; /* for paletted images */
struct Pixel palette[256];
/* Image description from the file */
char *image_desc;
/* Tile dimensions */
unsigned tile_width, tile_height;
};
boolean FDECL(read_bmp_tiles, (const char *filename, struct TileSetImage *image));
boolean FDECL(read_gif_tiles, (const char *filename, struct TileSetImage *image));
boolean FDECL(read_png_tiles, (const char *filename, struct TileSetImage *image));
#endif