rnd-20001215-1-src
[rocksndiamonds.git] / src / libgame / system.c
index 8a5feabea7f532cc343c83acc8e1661b72f14c87..22e9f2f1bda51bbe253367997c80a1d10bd2c069 100644 (file)
@@ -441,6 +441,8 @@ inline Pixel GetPixelFromRGB(Bitmap *bitmap, unsigned int color_r,
 
 #if defined(TARGET_SDL)
   pixel = SDL_MapRGB(bitmap->surface->format, color_r, color_g, color_b);
+#elif defined(TARGET_ALLEGRO)
+  pixel = AllegroAllocColorCell(color_r << 8, color_g << 8, color_b << 8);
 #elif defined(TARGET_X11_NATIVE)
   XColor xcolor;
 
@@ -555,10 +557,8 @@ inline boolean ChangeVideoModeIfNeeded(boolean fullscreen)
 Bitmap *LoadImage(char *basename)
 {
   Bitmap *new_bitmap;
-  char filename[256];
-
-  sprintf(filename, "%s/%s/%s",
-         options.ro_base_directory, GRAPHICS_DIRECTORY, basename);
+  char *filename = getPath3(options.ro_base_directory, GRAPHICS_DIRECTORY,
+                           basename);
 
 #if defined(TARGET_SDL)
   new_bitmap = SDLLoadImage(filename);
@@ -566,6 +566,8 @@ Bitmap *LoadImage(char *basename)
   new_bitmap = X11LoadImage(filename);
 #endif
 
+  free(filename);
+
   return new_bitmap;
 }