projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20070424-1-src
[rocksndiamonds.git]
/
src
/
libgame
/
msdos.c
diff --git
a/src/libgame/msdos.c
b/src/libgame/msdos.c
index 61e1eaf2a3efbdee6b205d0ad557734aa56a4089..60728bef8b6fdb69390d4c9b1d5c879e97be0486 100644
(file)
--- a/
src/libgame/msdos.c
+++ b/
src/libgame/msdos.c
@@
-1,7
+1,7
@@
/***********************************************************
* Artsoft Retro-Game Library *
*----------------------------------------------------------*
/***********************************************************
* Artsoft Retro-Game Library *
*----------------------------------------------------------*
-* (c) 1994-200
1
Artsoft Entertainment *
+* (c) 1994-200
6
Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
@@
-54,22
+54,16
@@
static int global_colormap_entries_used = 0;
boolean wait_for_vsync;
boolean wait_for_vsync;
-/*
-extern int playing_sounds;
-extern struct SoundControl playlist[NUM_MIXER_CHANNELS];
-extern struct SoundControl emptySoundControl;
-*/
-
static BITMAP *Read_PCX_to_AllegroBitmap(char *);
static void allegro_init_drivers()
{
int i;
static BITMAP *Read_PCX_to_AllegroBitmap(char *);
static void allegro_init_drivers()
{
int i;
- for (i
=0; i<
MAX_EVENT_BUFFER; i++)
+ for (i
= 0; i <
MAX_EVENT_BUFFER; i++)
event_buffer[i].type = 0;
event_buffer[i].type = 0;
- for (i
=0; i<
MAX_SCANCODES; i++)
+ for (i
= 0; i <
MAX_SCANCODES; i++)
key_press_state[i] = KeyReleaseMask;
last_mouse_pos = mouse_pos;
key_press_state[i] = KeyReleaseMask;
last_mouse_pos = mouse_pos;
@@
-250,7
+244,7
@@
Pixel AllegroAllocColorCell(int r, int g, int b)
b >>= 10;
/* try to use existing colors from the global colormap */
b >>= 10;
/* try to use existing colors from the global colormap */
- for (i
=0; i<
global_colormap_entries_used; i++)
+ for (i
= 0; i <
global_colormap_entries_used; i++)
{
if (r == global_colormap[i].r &&
g == global_colormap[i].g &&
{
if (r == global_colormap[i].r &&
g == global_colormap[i].g &&
@@
-303,7
+297,7
@@
Display *XOpenDisplay(char *display_name)
Screen *screen;
Display *display;
BITMAP *mouse_bitmap = NULL;
Screen *screen;
Display *display;
BITMAP *mouse_bitmap = NULL;
- char *mouse_filename =
getCustomImageFilename(program.msdos_pointe
r_filename);
+ char *mouse_filename =
getCustomImageFilename(program.msdos_curso
r_filename);
if ((mouse_bitmap = Read_PCX_to_AllegroBitmap(mouse_filename)) == NULL)
return NULL;
if ((mouse_bitmap = Read_PCX_to_AllegroBitmap(mouse_filename)) == NULL)
return NULL;
@@
-384,8
+378,7
@@
Status XStringListToTextProperty(char **list, int count,
void XFree(void *data)
{
void XFree(void *data)
{
- if (data)
- free(data);
+ checked_free(data);
}
GC XCreateGC(Display *display, Drawable d, unsigned long value_mask,
}
GC XCreateGC(Display *display, Drawable d, unsigned long value_mask,
@@
-522,7
+515,7
@@
static BITMAP *Image_to_AllegroBitmap(Image *image)
clear(bitmap);
/* try to use existing colors from the global colormap */
clear(bitmap);
/* try to use existing colors from the global colormap */
- for (i
=0; i<
MAX_COLORS; i++)
+ for (i
= 0; i <
MAX_COLORS; i++)
{
if (!image->rgb.color_used[i])
continue;
{
if (!image->rgb.color_used[i])
continue;
@@
-533,8
+526,8
@@
static BITMAP *Image_to_AllegroBitmap(Image *image)
}
/* copy bitmap data */
}
/* copy bitmap data */
- for (y
=0; y<
image->height; y++)
- for (x
=0; x<
image->width; x++)
+ for (y
= 0; y <
image->height; y++)
+ for (x
= 0; x <
image->width; x++)
putpixel(bitmap, x, y, pixel_mapping[*src_ptr++]);
return bitmap;
putpixel(bitmap, x, y, pixel_mapping[*src_ptr++]);
return bitmap;
@@
-604,11
+597,9
@@
void XFreePixmap(Display *display, Pixmap pixmap)
void XFreeGC(Display *display, GC gc)
{
void XFreeGC(Display *display, GC gc)
{
- XGCValues *gcv;
+ XGCValues *gcv
= (XGCValues *)gc
;
- gcv = (XGCValues *)gc;
- if (gcv)
- free(gcv);
+ checked_free(gcv);
}
void XUnmapWindow(Display *display, Window window)
}
void XUnmapWindow(Display *display, Window window)
@@
-622,11
+613,8
@@
void XCloseDisplay(Display *display)
if (is_screen_bitmap(bitmap))
destroy_bitmap(bitmap);
if (is_screen_bitmap(bitmap))
destroy_bitmap(bitmap);
- if (display->screens)
- free(display->screens);
-
- if (display)
- free(display);
+ checked_free(display->screens);
+ checked_free(display);
/* return to text mode (or DOS box on Windows screen) */
set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
/* return to text mode (or DOS box on Windows screen) */
set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
@@
-677,7
+665,7
@@
static void HandleKeyboardRaw(int mode)
{
int i;
{
int i;
- for (i
=0; i<
MAX_SCANCODES; i++)
+ for (i
= 0; i <
MAX_SCANCODES; i++)
{
int scancode, new_state, event_type;
char key_pressed;
{
int scancode, new_state, event_type;
char key_pressed;
@@
-789,7
+777,7
@@
int XPending(Display *display)
/* mouse button event */
if (mouse_b != last_mouse_b)
{
/* mouse button event */
if (mouse_b != last_mouse_b)
{
- for (i
=0; i<3; i++)
/* check all three mouse buttons */
+ for (i
= 0; i < 3; i++)
/* check all three mouse buttons */
{
int bitmask = (1 << i);
{
int bitmask = (1 << i);
@@
-923,6
+911,14
@@
Pixel AllegroGetPixel(Drawable d, int x, int y)
return getpixel((BITMAP *)d, x, y);
}
return getpixel((BITMAP *)d, x, y);
}
+void AllegroZoomBitmap(Drawable src, Drawable dst,
+ int src_width, int src_height,
+ int dst_width, int dst_height)
+{
+ stretch_blit((BITMAP *)src, (BITMAP *)dst,
+ 0, 0, src_width, src_height, 0, 0, dst_width, dst_height);
+}
+
void MSDOSOpenAudio(void)
{
if (allegro_init_audio())
void MSDOSOpenAudio(void)
{
if (allegro_init_audio())
@@
-936,7
+932,7
@@
void MSDOSOpenAudio(void)
audio.music_channel = MUSIC_CHANNEL;
audio.first_sound_channel = FIRST_SOUND_CHANNEL;
audio.music_channel = MUSIC_CHANNEL;
audio.first_sound_channel = FIRST_SOUND_CHANNEL;
-
InitPlaylist
();
+
Mixer_InitChannels
();
}
}
}
}
@@
-967,7
+963,7
@@
void MSDOSInitJoysticks()
install_joystick(JOY_TYPE_AUTODETECT) == 0)
joystick.status = JOYSTICK_ACTIVATED;
install_joystick(JOY_TYPE_AUTODETECT) == 0)
joystick.status = JOYSTICK_ACTIVATED;
- for (i
=0; i<
MAX_PLAYERS; i++)
+ for (i
= 0; i <
MAX_PLAYERS; i++)
{
char *device_name = setup.input[i].joy.device_name;
int joystick_nr = getJoystickNrFromDeviceName(device_name);
{
char *device_name = setup.input[i].joy.device_name;
int joystick_nr = getJoystickNrFromDeviceName(device_name);