3 کامیت‌ها 87222bd7fe ... 1275fe87f1

نویسنده SHA1 پیام تاریخ
  Asher Gordon 1275fe87f1 Fix compatibility with old INI files. 4 سال پیش
  Asher Gordon b41a785d30 Change BMP file references to PNG files. 4 سال پیش
  Asher Gordon 85dd6dccbe Replace VERZEHI and VERZELO with VERSION from config.h. 4 سال پیش
10فایلهای تغییر یافته به همراه164 افزوده شده و 104 حذف شده
  1. 0 1
      data/berusky3d-local.ini
  2. 0 1
      data/berusky3d.ini
  3. 7 3
      src/age/utils/ini.cpp
  4. 62 0
      src/age/utils/utils.cpp
  5. 3 0
      src/age/utils/utils.h
  6. 5 5
      src/kofola/3D_graphic.cpp
  7. 2 2
      src/kofola/3D_menus.cpp
  8. 72 79
      src/kofola/Menu.cpp
  9. 13 13
      src/kofola/Menu2.cpp
  10. 0 0
      src/kofola/Object.h

+ 0 - 1
data/berusky3d-local.ini

@@ -115,7 +115,6 @@ system_material_4=castice.b2t
 
 3dmenu_dir=3dmenu
 bitmap_subdir=bitmap
-data_subdir=.
 font_dir1=font_en
 font_dir2=font3d_en
 font_dir3=font_system_en

+ 0 - 1
data/berusky3d.ini

@@ -115,7 +115,6 @@ system_material_4=castice.b2t
 
 3dmenu_dir=3dmenu
 bitmap_subdir=bitmap
-data_subdir=.
 font_dir1=font_en
 font_dir2=font3d_en
 font_dir3=font_system_en

+ 7 - 3
src/age/utils/ini.cpp

@@ -208,14 +208,18 @@ int ini_write_string_section(FFILE f_in, FFILE f_out, const char *p_section,
 
   if(found) {
     file_copy(f_in, f_out, file_start);
-    fprintf(f_out,"%s=%s\n",p_template, p_value);
+    // If 'p_value' is NULL, delete it.
+    if (p_value)
+      fprintf(f_out,"%s=%s\n",p_template, p_value);
     fseek(f_in, file_end, SEEK_SET);
     file_copy(f_in, f_out);
   }
   else {
     file_copy(f_in, f_out);
-    fprintf(f_out,"\n[%s]\n",p_section);
-    fprintf(f_out,"%s=%s\n",p_template, p_value);
+    if (p_value) {
+      fprintf(f_out,"\n[%s]\n",p_section);
+      fprintf(f_out,"%s=%s\n",p_template, p_value);
+    }
   }
 
   return(TRUE);

+ 62 - 0
src/age/utils/utils.cpp

@@ -37,6 +37,10 @@
 #include "utils.h"
 #include "ini.h"
 #include "mem_alloc.h"
+#include "3d_all.h"
+
+// We want to use the FFILE defined in utils.h, not zlib_io.h.
+#undef FFILE
 
 /*
  * Utility
@@ -218,6 +222,64 @@ char * return_file(const char *p_path, char *p_buffer, int max_lenght)
   return(p_buffer);
 }
 
+// Get a new setting (e.g. "texture_dir0") or, failing that, guess the
+// value from the old setting (e.g. "texture_file0").
+void get_dir_from_pak(const char *section,
+  const char *new_key, const char *old_key, const char *default_value,
+  char *out, size_t out_len, const char *ini_file)
+{
+  char old[MAX_FILENAME];
+  size_t old_len;
+
+  // Get the old and new settings.
+  GetPrivateProfileString(section, new_key, "",
+                          out, out_len, ini_file);
+  GetPrivateProfileString(section, old_key, "",
+                          old, MAX_FILENAME, ini_file);
+  old_len = strlen(old);
+  if (old_len > 4 && !strcmp(old + old_len - 4, ".pak"))
+    old_len -= 4;
+  else
+    old_len = 0;
+  old[old_len] = '\0';
+
+  if (*out) {
+    // We were able to get the new setting. Remove the old one if it's
+    // the same as the new one except with a .pak extension.
+    if (old_len && !strcmp(out, old))
+      WritePrivateProfileString(section, old_key, NULL, ini_file);
+    return;
+  }
+
+  // The new setting does not exist, so use the old one.
+  if (!*old) {
+    // The old setting does not exist either; use the default.
+    strncpy(out, default_value, out_len);
+    return;
+  }
+
+  if (!old_len) {
+    // The old setting didn't have a .pak extension. There's not much
+    // we can do in this case, so just print a warning and use the
+    // default.
+    kwarning(TRUE, "Cannot guess %s from %s=%s",
+             new_key, old_key, old);
+    strncpy(out, default_value, out_len);
+    return;
+  }
+
+
+  // Now use the old setting without the .pak extension as the new
+  // setting.
+  strncpy(out, old, out_len);
+
+  // Write the new setting to the INI file and delete the old one.
+  WritePrivateProfileString(section, new_key, out, ini_file);
+  WritePrivateProfileString(section, old_key, NULL, ini_file);
+  kprintf(TRUE, "Replaced %s=%s.pak with %s=%s",
+          old_key, out, new_key, out);
+}
+
 /*----------------------------------------------------------------------------
     ffile file interface - normal files
   ----------------------------------------------------------------------------

+ 3 - 0
src/age/utils/utils.h

@@ -90,6 +90,9 @@ char * construct_path(char *p_buffer, size_t max_length, int n_components, ...);
 char * return_path_ext(const char *p_file, const char *p_cwd, char *p_buffer, int max_lenght);
 char * return_dir(const char *p_file, char *p_buffer, int max_lenght);
 char * return_file(const char *p_path, char *p_buffer, int max_lenght);
+void get_dir_from_pak(const char *section,
+  const char *new_key, const char *old_key, const char *default_value,
+  char *out, size_t out_len, const char *ini_file);
 
 bool   dir_create(const char *p_dir);
 char * dir_home_get(char *p_dir, int max);

+ 5 - 5
src/kofola/3D_graphic.cpp

@@ -148,7 +148,7 @@ void _3d_Get_Cursor_Name(char *cName)
   GetPrivateProfileString("game", "cursor", "cursor", filename, 32, ini_file);
 
   strcpy(cName, filename);
-  strcat(cName, ".bmp");
+  strcat(cName, ".png");
 
   strcat(filename, ".inf");
 
@@ -364,11 +364,11 @@ void _3d_Load_Indikace(void)
 
   txt_trida(TEXT_MENU);
   kom_set_default_text_config(0, 0, 1, 0, 0, 1);
-  txt_nahraj_texturu_z_func(p3DMDir, "camera1.bmp", &sIndikace[0], 0, 1,
+  txt_nahraj_texturu_z_func(p3DMDir, "camera1.png", &sIndikace[0], 0, 1,
     NULL, bmp_nahraj);
-  txt_nahraj_texturu_z_func(p3DMDir, "vitamin1.bmp", &sIndikace[1], 0, 1,
+  txt_nahraj_texturu_z_func(p3DMDir, "vitamin1.png", &sIndikace[1], 0, 1,
     NULL, bmp_nahraj);
-  txt_nahraj_texturu_z_func(p3DMDir, "lock1.bmp", &sIndikace[2], 0, 1,
+  txt_nahraj_texturu_z_func(p3DMDir, "lock1.png", &sIndikace[2], 0, 1,
     NULL, bmp_nahraj);
   kom_ret_default_text_config();
 }
@@ -391,7 +391,7 @@ void _3d_Gen_Hints(HINT_TEXTURE * bTexture, int tsize)
   }
 
   kom_set_default_text_config(0, 0, 1, 0, 0, 1);
-  txt_nahraj_texturu_z_func(p3DMDir, "hint_frame.bmp", &bTexture[0].text,
+  txt_nahraj_texturu_z_func(p3DMDir, "hint_frame.png", &bTexture[0].text,
     0, 1, NULL, bmp_nahraj);
   kom_ret_default_text_config();
 

+ 2 - 2
src/kofola/3D_menus.cpp

@@ -1480,7 +1480,7 @@ void _3d_Obsluha_Game_Menu(char *bCursor, int *Cursor_Time_Out,
 
 void _3d_Start_Settings(void)
 {  
-  ddxLoadBitmap("settings.bmp", pBmpDir);
+  ddxLoadBitmap("settings.png", pBmpDir);
 }
 
 int _3d_BackPack2Hint(int idx)
@@ -1687,7 +1687,7 @@ void _3d_Nahraj_Kuk(void)
 {
   txt_trida(TEXT_MENU);
   kom_set_default_text_config(0, 0, 1, 0, 0, 1);
-  txt_nahraj_texturu_z_func(p3DMDir, "brouk1.bmp", &sKuk.text, 0, 1, NULL, bmp_nahraj);
+  txt_nahraj_texturu_z_func(p3DMDir, "brouk1.png", &sKuk.text, 0, 1, NULL, bmp_nahraj);
   kom_ret_default_text_config();
 }
 

+ 72 - 79
src/kofola/Menu.cpp

@@ -5,6 +5,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
+#include "config.h"
 #include "3d_all.h"
 #include "Berusky3d_kofola_interface.h"
 #include "game_logic.h"
@@ -1186,7 +1187,7 @@ void InitTab3d(CONTROL_LIST_ITEM * citem, int *hdcTab)
   int i;
   int iClock;
 
-  iClock = ddxLoadBitmap("clock1-1.bmp", pBmpDir);
+  iClock = ddxLoadBitmap("clock1-1.png", pBmpDir);
   ddxResizeCursorBack(iClock);
   DrawClock(&iClock, 0);
 
@@ -1305,7 +1306,7 @@ void InitTabControls(CONTROL_LIST_ITEM * citem, int *hdcTab)
   char ctext[MAX_FILENAME];
   int iClock;
 
-  iClock = ddxLoadBitmap("clock1-1.bmp", pBmpDir);
+  iClock = ddxLoadBitmap("clock1-1.png", pBmpDir);
   ddxResizeCursorBack(iClock);
   DrawClock(&iClock, 0);
 
@@ -2167,7 +2168,7 @@ void GetRunMenuNewGameSceneLoadGame(char *cscene, char *cscenemap,
       break;
   }
 
-  sprintf(cscenemap, "scene%d_map.bmp", iActualScene);
+  sprintf(cscenemap, "scene%d_map.png", iActualScene);
   sprintf(csceneanim, "scene%d_anim", iActualScene);
   sprintf(cscenelevel, "scene%d_levels.txt", iActualScene);
   sprintf(cscene, "Mmnew_game_scene%d_map.txt", iActualScene);
@@ -2234,7 +2235,7 @@ void RunMenuNewGameScene(char *p_File_Name, HWND hWnd, AUDIO_DATA * p_ad,
   }
   else if (!iActualScene) {
     RunMenuSceneMap("Mmnew_game_scene0_map.txt", NULL, p_ad, cpu,
-      "scene0_map.bmp", "scene0_anim", 0, 200, 20, "scene0_levels.txt", 0, 0,
+      "scene0_map.png", "scene0_anim", 0, 200, 20, "scene0_levels.txt", 0, 0,
       0, NULL, 1, 975, 7);
 
     bLoadGame = 0;
@@ -2246,7 +2247,7 @@ void RunMenuNewGameScene(char *p_File_Name, HWND hWnd, AUDIO_DATA * p_ad,
   }
   else if (iActualScene == 10) {
     RunMenuSceneMap("Mmnew_game_scene10_map.txt", NULL, p_ad, cpu,
-      "scene10_map.bmp", "scene10_anim", 10, 300, 15, "scene10_levels.txt",
+      "scene10_map.png", "scene10_anim", 10, 300, 15, "scene10_levels.txt",
       920, 2, 0, NULL, 0, 706, 6);
 
     bLoadGame = 0;
@@ -2258,7 +2259,7 @@ void RunMenuNewGameScene(char *p_File_Name, HWND hWnd, AUDIO_DATA * p_ad,
   }
   else if (iActualScene == 11) {
     RunMenuSceneMap("Mmnew_game_scene11_map.txt", NULL, p_ad, cpu,
-      "scene11_map.bmp", "scene11_anim", 11, 315, 15, "scene11_levels.txt",
+      "scene11_map.png", "scene11_anim", 11, 315, 15, "scene11_levels.txt",
       920, 2, 0, NULL, 0, 750, 5);
 
     bLoadGame = 0;
@@ -2270,7 +2271,7 @@ void RunMenuNewGameScene(char *p_File_Name, HWND hWnd, AUDIO_DATA * p_ad,
   }
   else if (iActualScene == 12) {
     RunMenuSceneMap("Mmnew_game_scene12_map.txt", NULL, p_ad, cpu,
-      "scene12_map.bmp", "scene12_anim", 12, 330, 15, "scene12_levels.txt",
+      "scene12_map.png", "scene12_anim", 12, 330, 15, "scene12_levels.txt",
       920, 7, 0, NULL, 0, 973, 229);
 
     bLoadGame = 0;
@@ -2535,73 +2536,73 @@ BEGIN_MENU_NEWGAMESCENE:
 
         if (!strcmp(res[resid].cParam[1], "SCENE1")) {
           iActualScene = 1;
-          RunStretchAnimation("scene1_map.bmp", 0, 129, p_ad);
+          RunStretchAnimation("scene1_map.png", 0, 129, p_ad);
           RunMenuSceneMap("Mmnew_game_scene1_map.txt", NULL, p_ad, cpu,
-            "scene1_map.bmp", "scene1_anim", 1, 0, 11, "scene1_levels.txt",
+            "scene1_map.png", "scene1_anim", 1, 0, 11, "scene1_levels.txt",
             919, 677, 0, NULL, 0, 713, 679);
         }
 
         if (!strcmp(res[resid].cParam[1], "SCENE2")) {
           iActualScene = 2;
-          RunStretchAnimation("scene2_map.bmp", 215, 0, p_ad);
+          RunStretchAnimation("scene2_map.png", 215, 0, p_ad);
           RunMenuSceneMap("Mmnew_game_scene2_map.txt", NULL, p_ad, cpu,
-            "scene2_map.bmp", "scene2_anim", 2, 11, 10, "scene2_levels.txt",
+            "scene2_map.png", "scene2_anim", 2, 11, 10, "scene2_levels.txt",
             916, 8, 0, NULL, 0, 971, 703);
         }
 
         if (!strcmp(res[resid].cParam[1], "SCENE3")) {
           iActualScene = 3;
-          RunStretchAnimation("scene3_map.bmp", 177, 248, p_ad);
+          RunStretchAnimation("scene3_map.png", 177, 248, p_ad);
           RunMenuSceneMap("Mmnew_game_scene3_map.txt", NULL, p_ad, cpu,
-            "scene3_map.bmp", "scene3_anim", 3, 21, 12, "scene3_levels.txt",
+            "scene3_map.png", "scene3_anim", 3, 21, 12, "scene3_levels.txt",
             918, 7, 0, NULL, 0, 973, 413);
         }
 
         if (!strcmp(res[resid].cParam[1], "SCENE4")) {
           iActualScene = 4;
-          RunStretchAnimation("scene4_map.bmp", 444, 64, p_ad);
+          RunStretchAnimation("scene4_map.png", 444, 64, p_ad);
           RunMenuSceneMap("Mmnew_game_scene4_map.txt", NULL, p_ad, cpu,
-            "scene4_map.bmp", "scene4_anim", 4, 33, 10, "scene4_levels.txt",
+            "scene4_map.png", "scene4_anim", 4, 33, 10, "scene4_levels.txt",
             197, 9, 0, NULL, 0, 8, 16);
         }
 
         if (!strcmp(res[resid].cParam[1], "SCENE5")) {
           iActualScene = 5;
-          RunStretchAnimation("scene5_map.bmp", 465, 386, p_ad);
+          RunStretchAnimation("scene5_map.png", 465, 386, p_ad);
           RunMenuSceneMap("Mmnew_game_scene5_map.txt", NULL, p_ad, cpu,
-            "scene5_map.bmp", "scene5_anim", 5, 43, 10, "scene5_levels.txt",
+            "scene5_map.png", "scene5_anim", 5, 43, 10, "scene5_levels.txt",
             918, 9, 0, NULL, 0, 976, 309);
         }
 
         if (!strcmp(res[resid].cParam[1], "SCENE6")) {
           iActualScene = 6;
-          RunStretchAnimation("scene6_map.bmp", 37, 495, p_ad);
+          RunStretchAnimation("scene6_map.png", 37, 495, p_ad);
           RunMenuSceneMap("Mmnew_game_scene6_map.txt", NULL, p_ad, cpu,
-            "scene6_map.bmp", "scene6_anim", 6, 53, 10, "scene6_levels.txt",
+            "scene6_map.png", "scene6_anim", 6, 53, 10, "scene6_levels.txt",
             920, 8, 0, NULL, 0, 967, 211);
         }
 
         if (!strcmp(res[resid].cParam[1], "SCENE7")) {
           iActualScene = 7;
-          RunStretchAnimation("scene7_map.bmp", 616, 638, p_ad);
+          RunStretchAnimation("scene7_map.png", 616, 638, p_ad);
           RunMenuSceneMap("Mmnew_game_scene7_map.txt", NULL, p_ad, cpu,
-            "scene7_map.bmp", "scene7_anim", 7, 63, 10, "scene7_levels.txt",
+            "scene7_map.png", "scene7_anim", 7, 63, 10, "scene7_levels.txt",
             11, 6, 0, NULL, 0, 8, 279);
         }
 
         if (!strcmp(res[resid].cParam[1], "SCENE8")) {
           iActualScene = 8;
-          RunStretchAnimation("scene8_map.bmp", 836, 469, p_ad);
+          RunStretchAnimation("scene8_map.png", 836, 469, p_ad);
           RunMenuSceneMap("Mmnew_game_scene8_map.txt", NULL, p_ad, cpu,
-            "scene8_map.bmp", "scene8_anim", 8, 73, 12, "scene8_levels.txt",
+            "scene8_map.png", "scene8_anim", 8, 73, 12, "scene8_levels.txt",
             15, 677, 0, NULL, 0, 12, 490);
         }
 
         if (!strcmp(res[resid].cParam[1], "SCENE9")) {
           iActualScene = 9;
-          RunStretchAnimation("scene9_map.bmp", 836, 49, p_ad);
+          RunStretchAnimation("scene9_map.png", 836, 49, p_ad);
           RunMenuSceneMap("Mmnew_game_scene9_map.txt", NULL, p_ad, cpu,
-            "scene9_map.bmp", "scene9_anim", 9, 85, 10, "scene9_levels.txt",
+            "scene9_map.png", "scene9_anim", 9, 85, 10, "scene9_levels.txt",
             918, 7, 0, NULL, 0, 971, 338);
         }
 
@@ -2692,7 +2693,7 @@ void LoadSceneMap(int *pBmp, char *cSceneBmp, char *cSceneAnim, int iScene,
   pBmp[0] = ddxLoadBitmap(cSceneBmp, pBmpDir);
 
   for (i = 1; i < 6; i++) {
-    sprintf(text, "%s%d.bmp", cSceneAnim, i);
+    sprintf(text, "%s%d.png", cSceneAnim, i);
     pBmp[i] = ddxLoadBitmap(text, pBmpDir);
     DrawClock(iClock, i);
   }
@@ -2703,48 +2704,48 @@ void LoadSceneMap(int *pBmp, char *cSceneBmp, char *cSceneAnim, int iScene,
     case 3:
     case 4:
     case 7:
-      pBmp[6] = ddxLoadBitmap("level_green.bmp", pBmpDir);
-      pBmp[7] = ddxLoadBitmap("level_ok_green.bmp", pBmpDir);
-      pBmp[8] = ddxLoadBitmap("b1_green.bmp", pBmpDir);
-      pBmp[9] = ddxLoadBitmap("b2_green.bmp", pBmpDir);
-      pBmp[10] = ddxLoadBitmap("level_green_l.bmp", pBmpDir);
-      pBmp[11] = ddxLoadBitmap("level_ok_green_l.bmp", pBmpDir);
+      pBmp[6] = ddxLoadBitmap("level_green.png", pBmpDir);
+      pBmp[7] = ddxLoadBitmap("level_ok_green.png", pBmpDir);
+      pBmp[8] = ddxLoadBitmap("b1_green.png", pBmpDir);
+      pBmp[9] = ddxLoadBitmap("b2_green.png", pBmpDir);
+      pBmp[10] = ddxLoadBitmap("level_green_l.png", pBmpDir);
+      pBmp[11] = ddxLoadBitmap("level_ok_green_l.png", pBmpDir);
       break;
     case 5:
     case 8:
-      pBmp[6] = ddxLoadBitmap("level_brown.bmp", pBmpDir);
-      pBmp[7] = ddxLoadBitmap("level_ok_brown.bmp", pBmpDir);
-      pBmp[8] = ddxLoadBitmap("b1_brown.bmp", pBmpDir);
-      pBmp[9] = ddxLoadBitmap("b2_brown.bmp", pBmpDir);
-      pBmp[10] = ddxLoadBitmap("level_brown_l.bmp", pBmpDir);
-      pBmp[11] = ddxLoadBitmap("level_ok_brown_l.bmp", pBmpDir);
+      pBmp[6] = ddxLoadBitmap("level_brown.png", pBmpDir);
+      pBmp[7] = ddxLoadBitmap("level_ok_brown.png", pBmpDir);
+      pBmp[8] = ddxLoadBitmap("b1_brown.png", pBmpDir);
+      pBmp[9] = ddxLoadBitmap("b2_brown.png", pBmpDir);
+      pBmp[10] = ddxLoadBitmap("level_brown_l.png", pBmpDir);
+      pBmp[11] = ddxLoadBitmap("level_ok_brown_l.png", pBmpDir);
       break;
     case 0:
-      pBmp[6] = ddxLoadBitmap("level_tutorial.bmp", pBmpDir);
-      pBmp[7] = ddxLoadBitmap("level_ok_tutorial.bmp", pBmpDir);
-      pBmp[8] = ddxLoadBitmap("b1_blue.bmp", pBmpDir);
-      pBmp[9] = ddxLoadBitmap("b2_blue.bmp", pBmpDir);
-      pBmp[10] = ddxLoadBitmap("level_tutorial_l.bmp", pBmpDir);
-      pBmp[11] = ddxLoadBitmap("level_ok_tutorial_l.bmp", pBmpDir);
+      pBmp[6] = ddxLoadBitmap("level_tutorial.png", pBmpDir);
+      pBmp[7] = ddxLoadBitmap("level_ok_tutorial.png", pBmpDir);
+      pBmp[8] = ddxLoadBitmap("b1_blue.png", pBmpDir);
+      pBmp[9] = ddxLoadBitmap("b2_blue.png", pBmpDir);
+      pBmp[10] = ddxLoadBitmap("level_tutorial_l.png", pBmpDir);
+      pBmp[11] = ddxLoadBitmap("level_ok_tutorial_l.png", pBmpDir);
       break;
     case 6:
     case 9:
     case 10:
     case 11:
-      pBmp[6] = ddxLoadBitmap("level_blue.bmp", pBmpDir);
-      pBmp[7] = ddxLoadBitmap("level_ok_blue.bmp", pBmpDir);
-      pBmp[8] = ddxLoadBitmap("b1_blue.bmp", pBmpDir);
-      pBmp[9] = ddxLoadBitmap("b2_blue.bmp", pBmpDir);
-      pBmp[10] = ddxLoadBitmap("level_blue_l.bmp", pBmpDir);
-      pBmp[11] = ddxLoadBitmap("level_ok_blue_l.bmp", pBmpDir);
+      pBmp[6] = ddxLoadBitmap("level_blue.png", pBmpDir);
+      pBmp[7] = ddxLoadBitmap("level_ok_blue.png", pBmpDir);
+      pBmp[8] = ddxLoadBitmap("b1_blue.png", pBmpDir);
+      pBmp[9] = ddxLoadBitmap("b2_blue.png", pBmpDir);
+      pBmp[10] = ddxLoadBitmap("level_blue_l.png", pBmpDir);
+      pBmp[11] = ddxLoadBitmap("level_ok_blue_l.png", pBmpDir);
       break;
     case 12:
-      pBmp[6] = ddxLoadBitmap("level_yellow.bmp", pBmpDir);
-      pBmp[7] = ddxLoadBitmap("level_ok_yellow.bmp", pBmpDir);
-      pBmp[8] = ddxLoadBitmap("b1_yellow.bmp", pBmpDir);
-      pBmp[9] = ddxLoadBitmap("b2_yellow.bmp", pBmpDir);
-      pBmp[10] = ddxLoadBitmap("level_yellow_l.bmp", pBmpDir);
-      pBmp[11] = ddxLoadBitmap("level_ok_yellow_l.bmp", pBmpDir);
+      pBmp[6] = ddxLoadBitmap("level_yellow.png", pBmpDir);
+      pBmp[7] = ddxLoadBitmap("level_ok_yellow.png", pBmpDir);
+      pBmp[8] = ddxLoadBitmap("b1_yellow.png", pBmpDir);
+      pBmp[9] = ddxLoadBitmap("b2_yellow.png", pBmpDir);
+      pBmp[10] = ddxLoadBitmap("level_yellow_l.png", pBmpDir);
+      pBmp[11] = ddxLoadBitmap("level_ok_yellow_l.png", pBmpDir);
       break;
   }
 
@@ -2756,7 +2757,7 @@ void DrawLevelHint(int x, int y, int iLevel)
   int idx;
   char text[MAX_FILENAME];
 
-  sprintf(text, "t_%d.bmp", iLevel - 200);
+  sprintf(text, "t_%d.png", iLevel - 200);
 
   idx = ddxLoadBitmap(text, pBmpDir);
 
@@ -3001,17 +3002,17 @@ void CorrectTV(CMD_LINE * res, int iAnim, int iLast, int x, int y, int idx,
   switch (iScene) {
     case 5:
     case 8:
-      tvcoridx = ddxLoadBitmap("tvcor_brown.bmp", pBmpDir);
+      tvcoridx = ddxLoadBitmap("tvcor_brown.png", pBmpDir);
       break;
     case 0:
     case 6:
     case 9:
     case 10:
     case 11:
-      tvcoridx = ddxLoadBitmap("tvcor_blue.bmp", pBmpDir);
+      tvcoridx = ddxLoadBitmap("tvcor_blue.png", pBmpDir);
       break;
     case 12:
-      tvcoridx = ddxLoadBitmap("tvcor_yellow.bmp", pBmpDir);
+      tvcoridx = ddxLoadBitmap("tvcor_yellow.png", pBmpDir);
       break;
   }
 
@@ -3138,7 +3139,7 @@ int LoadClock(int *iClock)
 /*void MenuInitHint(char bTutorial)
 {
 	if(bTutorial)
-		_2d_hint.iSurface = ddxLoadBitmap("hint_frame.bmp", pBmpDir);
+		_2d_hint.iSurface = ddxLoadBitmap("hint_frame.png", pBmpDir);
 	else
 		_2d_hint.iSurface = -1;
 
@@ -5818,7 +5819,7 @@ void RunMenuCinemax(void)
   int c = 0;
   int cib;
 
-  cib = ddxLoadBitmap("cinemax.bmp", pBmpDir);
+  cib = ddxLoadBitmap("cinemax.png", pBmpDir);
 
   if (cib == -1)
     return;
@@ -5851,16 +5852,8 @@ void RunMenuCinemax(void)
 
 void RunMenuDrawVersion(int iSurface)
 {
-  char text[MAX_FILENAME];
-
-  sprintf(text, "v%d.%d", VERZEHI, VERZELO);
-
-  //co_Set_Text_RightWC(HDC2DD, text, 1, 990, 318);
-  co_Set_Text_RightWC(HDC2DD, text, 0, 1024, 0);
-  //co_Set_Text(HDC2DD, 280, 0, "##sale", 0);
-
-  co_Set_Text_RightWC(iSurface, text, 0, 1024, 0);
-  //co_Set_Text(iSurface, 280, 0, "##sale", 0);
+  co_Set_Text_RightWC(HDC2DD, VERSION, 0, 1024, 0);
+  co_Set_Text_RightWC(iSurface, VERSION, 0, 1024, 0);
 }
 
 void RunMenuDrawDemoEndScreen(void)
@@ -5870,7 +5863,7 @@ void RunMenuDrawDemoEndScreen(void)
   ddxSetFlip(1);
 
   key[0] = 0;
-  idx = ddxLoadBitmap("final_screen.bmp", pBmpDir);
+  idx = ddxLoadBitmap("final_screen.png", pBmpDir);
 
   if (idx == -1)
     return;
@@ -6227,7 +6220,7 @@ BEGIN_MENU:
 
         if (!strcmp(res[resid].cParam[1], "CIBRA")) {
           StopAll();
-          RunMenuCibron("cibra.bmp");
+          RunMenuCibron("cibra.png");
           click = 0;
         }
 
@@ -7297,7 +7290,7 @@ int RunMenuComixB(char *p_File_Name, HWND hWnd, AUDIO_DATA * p_ad, int iScene)
   char dir[MAX_FILENAME];
   char filename[MAX_FILENAME];
 
-  iClock = ddxLoadBitmap("clock1-1.bmp", pBmpDir);
+  iClock = ddxLoadBitmap("clock1-1.png", pBmpDir);
   ddxResizeCursorBack(iClock);
   DrawClock(&iClock, 0);
 
@@ -7336,13 +7329,13 @@ int RunMenuComixB(char *p_File_Name, HWND hWnd, AUDIO_DATA * p_ad, int iScene)
   ddxCleareSurface(FontDC);
 
   DrawClock(&iClock, 0);
-  iTVBmp = ddxLoadBitmap("televize.bmp", pBmpDir);
-  iTVTBmp = ddxLoadBitmap("televizet.bmp", pBmpDir);
+  iTVBmp = ddxLoadBitmap("televize.png", pBmpDir);
+  iTVTBmp = ddxLoadBitmap("televizet.png", pBmpDir);
 
   DrawClock(&iClock, 0);
   iTVBut = LoadCList("telload.txt", &ccc, &ccc, &ccc, pBmpDir);
 
-  sprintf(ccomix, "comix%d.bmp", iScene);  
+  sprintf(ccomix, "comix%d.png", iScene);
   iComix = ddxLoadBitmap(ccomix, pBmpDir);
 
   if (iTVBmp == -1 || iTVBut == -1 || iComix == -1 || iTVTBmp == -1) {
@@ -7751,7 +7744,7 @@ int RunMenuComix(char *p_File_Name, HWND hWnd, AUDIO_DATA * p_ad, int iScene)
 
   ddxSetFlip(0);
 
-  iClock = ddxLoadBitmap("clock1-1.bmp", pBmpDir);
+  iClock = ddxLoadBitmap("clock1-1.png", pBmpDir);
   ddxResizeCursorBack(iClock);
   DrawClock(&iClock, 0);
 

+ 13 - 13
src/kofola/Menu2.cpp

@@ -1088,7 +1088,7 @@ void RunMenuSettings2(char *p_File_Name, AUDIO_DATA * p_ad,
   ddx2DeviceSetScreenRecCallback(ddx2ScreenResDefaultCallback);
 
   ddx2CleareSurface(DDX2_BACK_BUFFER);
-  sh = ddx2LoadBitmap("settings.bmp", pBmpDir);
+  sh = ddx2LoadBitmap("settings.png", pBmpDir);
   LoadHelp("3dsettings_load.txt");
 
   ddx2FillRect(DDX2_BACK_BUFFER, &rTMP, RGB(255, 0, 255));
@@ -1783,7 +1783,7 @@ int RunMenuLoadGameLoad2(char *p_File_Name, AUDIO_DATA * p_ad,
   ddx2DeviceSetRender(TRUE);
 
   ddx2CleareSurface(DDX2_BACK_BUFFER);
-  sh = ddx2LoadBitmap("smallmenu.bmp", pBmpDir);
+  sh = ddx2LoadBitmap("smallmenu.png", pBmpDir);
 
   ddx2SetRect(&rTMP, 1);
 
@@ -2620,9 +2620,9 @@ void RunMenuHelp2(char *p_File_Name, AUDIO_DATA * p_ad, LEVELINFO * p_Level,
   am_FlipA(p_Level, p_am, 1, &rline, CLIST_ITEMC, 0, 0, 0);
 
   ddx2CleareSurface(DDX2_BACK_BUFFER);
-  sh = ddx2LoadBitmap("help_frame.bmp", pBmpDir);
-  sh1 = ddx2LoadBitmap("set_back2-1.bmp", pBmpDir);
-  sh2 = ddx2LoadBitmap("set_back1-1.bmp", pBmpDir);
+  sh = ddx2LoadBitmap("help_frame.png", pBmpDir);
+  sh1 = ddx2LoadBitmap("set_back2-1.png", pBmpDir);
+  sh2 = ddx2LoadBitmap("set_back1-1.png", pBmpDir);
 
   ddx2FillRect(DDX2_BACK_BUFFER, &rTMP, RGB(255, 0, 255));
   ddx2SetRect(&rTMP, 1);
@@ -3136,12 +3136,12 @@ void RunMenuLevelStats2(char *p_File_Name, AUDIO_DATA * p_ad,
     case 3:
     case 4:
     case 7:
-      sh = ddx2LoadBitmap("end_screen3.bmp", pBmpDir);
+      sh = ddx2LoadBitmap("end_screen3.png", pBmpDir);
       ifdx = 2;
       break;
     case 5:
     case 8:
-      sh = ddx2LoadBitmap("end_screen1.bmp", pBmpDir);
+      sh = ddx2LoadBitmap("end_screen1.png", pBmpDir);
       ifdx = 0;
       break;
     case 0:
@@ -3149,15 +3149,15 @@ void RunMenuLevelStats2(char *p_File_Name, AUDIO_DATA * p_ad,
     case 9:
     case 10:
     case 11:
-      sh = ddx2LoadBitmap("end_screen2.bmp", pBmpDir);
+      sh = ddx2LoadBitmap("end_screen2.png", pBmpDir);
       ifdx = 1;
       break;
     case 12:
-      sh = ddx2LoadBitmap("end_screen4.bmp", pBmpDir);
+      sh = ddx2LoadBitmap("end_screen4.png", pBmpDir);
       ifdx = 3;
       break;
     default:
-      sh = ddx2LoadBitmap("end_screen4.bmp", pBmpDir);
+      sh = ddx2LoadBitmap("end_screen4.png", pBmpDir);
       ifdx = 3;
       break;
   }
@@ -3519,7 +3519,7 @@ void RunMenuTutorial2(char *p_File_Name, AUDIO_DATA * p_ad,
 
   txt_trida(TEXT_MENU);
   kom_set_default_text_config(0, 0, 1, 0, 0, 1);
-  txt_nahraj_texturu_z_func(p3DMDir, "tutor_frame.bmp", &ttext, 0, 1, NULL, bmp_nahraj);
+  txt_nahraj_texturu_z_func(p3DMDir, "tutor_frame.png", &ttext, 0, 1, NULL, bmp_nahraj);
   kom_ret_default_text_config();
 
   _2d_Clear_RectLine(&rline);
@@ -3910,11 +3910,11 @@ void RunMenuLoadScreen2(void)
   if (iActualScene < 13) {
     char text[256];
 
-    sprintf(text, "scene%d.bmp", iActualScene);
+    sprintf(text, "scene%d.png", iActualScene);
     iLoadScreenBitmap = ddx2LoadBitmap(text, pBmpDir);
   }
   else
-    iLoadScreenBitmap = ddx2LoadBitmap("LoadScreen.bmp", pBmpDir);
+    iLoadScreenBitmap = ddx2LoadBitmap("LoadScreen.png", pBmpDir);
 
   ddx2SetRect(&iLoadScreenRect, 1);
 

+ 0 - 0
src/kofola/Object.h


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است