- rename standard integer types to a more familiar (u)int(8/16/32) - many function/struct renames. i don't _really_ know if what i've done for this is better, but it "feels" better to me. many draw/blit function names are shorter which is nice, at least. kinda important to me because i develop this on a real DOS machine in 80x50 text mode. - add 'extern "C"' blocks to headers for C++ compiler usage - draw/pixel color value arguments for functions should all have been changed to be uint8 instead of a full 32-bit int. feels right, but maybe should've left alone... - small fix to keyboard handler. noticed a problem on one thinkpad laptop. was a result of what i think was a typo in a constant value used during the part of the interrupt handler that tells the keyboard controller the key event was processed - fix uncommon potential crash function return in draw_filled_rect - renamed low-level "direct" assembly functions to "lowlevel_xxx" to be a little bit more explicit about what they are - add some convenience event helper functions for determining event types - add fixed point atan2 - fixed some tabs/spaces inconsistences (should all be spaces now?) - maybe some other minor things i've forgotten
164 lines
3.2 KiB
C
Executable file
164 lines
3.2 KiB
C
Executable file
#ifndef LIBDGL_DGLBLIT_H
|
|
#define LIBDGL_DGLBLIT_H
|
|
|
|
#include "dglgfx.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
void blit_region(
|
|
const SURFACE *src,
|
|
SURFACE *dest,
|
|
int src_x,
|
|
int src_y,
|
|
int src_width,
|
|
int src_height,
|
|
int dest_x,
|
|
int dest_y
|
|
);
|
|
|
|
void blit_region_f(
|
|
const SURFACE *src,
|
|
SURFACE *dest,
|
|
int src_x,
|
|
int src_y,
|
|
int src_width,
|
|
int src_height,
|
|
int dest_x,
|
|
int dest_y
|
|
);
|
|
|
|
void blit_sprite_region(
|
|
const SURFACE *src,
|
|
SURFACE *dest,
|
|
int src_x,
|
|
int src_y,
|
|
int src_width,
|
|
int src_height,
|
|
int dest_x,
|
|
int dest_y
|
|
);
|
|
|
|
void blit_sprite_region_f(
|
|
const SURFACE *src,
|
|
SURFACE *dest,
|
|
int src_x,
|
|
int src_y,
|
|
int src_width,
|
|
int src_height,
|
|
int dest_x,
|
|
int dest_y
|
|
);
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
void lowlevel_blit_4(
|
|
int width4,
|
|
int lines,
|
|
uint8 *dest,
|
|
const uint8 *src,
|
|
int dest_y_inc,
|
|
int src_y_inc
|
|
);
|
|
|
|
void lowlevel_blit_4r(
|
|
int width4,
|
|
int lines,
|
|
int remainder,
|
|
uint8 *dest,
|
|
const uint8 *src,
|
|
int dest_y_inc,
|
|
int src_y_inc
|
|
);
|
|
|
|
void lowlevel_blit_r(
|
|
int width,
|
|
int lines,
|
|
uint8 *dest,
|
|
const uint8 *src,
|
|
int dest_y_inc,
|
|
int src_y_inc
|
|
);
|
|
|
|
void lowlevel_blit_sprite_4(
|
|
int width4,
|
|
int lines,
|
|
uint8 *dest,
|
|
const uint8 *src,
|
|
int dest_y_inc,
|
|
int src_y_inc
|
|
);
|
|
|
|
void lowlevel_blit_sprite_4r(
|
|
int width4,
|
|
int lines,
|
|
uint8 *dest,
|
|
const uint8 *src,
|
|
int remainder,
|
|
int dest_y_inc,
|
|
int src_y_inc
|
|
);
|
|
|
|
void lowlevel_blit_sprite_r(
|
|
int width,
|
|
int lines,
|
|
uint8 *dest,
|
|
const uint8 *src,
|
|
int dest_y_inc,
|
|
int src_y_inc
|
|
);
|
|
|
|
void lowlevel_blit_sprite_8(
|
|
int width8,
|
|
int lines,
|
|
uint8 *dest,
|
|
const uint8 *src,
|
|
int dest_y_inc,
|
|
int src_y_inc
|
|
);
|
|
|
|
void lowlevel_blit_sprite_8r(
|
|
int width8,
|
|
int lines,
|
|
uint8 *dest,
|
|
const uint8 *src,
|
|
int remainder,
|
|
int dest_y_inc,
|
|
int src_y_inc
|
|
);
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
static void blit(const SURFACE *src, SURFACE *dest, int x, int y);
|
|
static void blit_f(const SURFACE *src, SURFACE *dest, int x, int y);
|
|
static void blit_sprite(const SURFACE *src, SURFACE *dest, int x, int y);
|
|
static void blit_sprite_f(const SURFACE *src, SURFACE *dest, int x, int y);
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
static void blit(const SURFACE *src, SURFACE *dest, int x, int y) {
|
|
blit_region(src, dest, 0, 0, src->width, src->height, x, y);
|
|
}
|
|
|
|
static void blit_f(const SURFACE *src, SURFACE *dest, int x, int y) {
|
|
blit_region_f(src, dest, 0, 0, src->width, src->height, x, y);
|
|
}
|
|
|
|
static void blit_sprite(const SURFACE *src, SURFACE *dest, int x, int y) {
|
|
blit_sprite_region(src, dest, 0, 0, src->width, src->height, x, y);
|
|
}
|
|
|
|
static void blit_sprite_f(const SURFACE *src, SURFACE *dest, int x, int y) {
|
|
blit_sprite_region_f(src, dest, 0, 0, src->width, src->height, x, y);
|
|
}
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|