6 #include "ShipTexturesDlg.h"
12 static char THIS_FILE[] = __FILE__;
36 CDialog::DoDataExchange(pDX);
57 int i,
z, not_found, temp_bmp, temp_frames, temp_fps;
62 OnSelchangeOldTextureList();
72 missing_files = _T(
"");
73 for (i=0; i<texture_count; i++)
76 if (strlen(new_texture_name[i]))
79 if (!
stricmp(new_texture_name[i],
"invisible"))
83 temp_bmp =
bm_load( new_texture_name[i] );
88 temp_bmp =
bm_load_animation(new_texture_name[i], &temp_frames, &temp_fps, NULL, 1);
96 missing_files += new_texture_name[
i];
97 missing_files +=
'\n';
106 message =
"FRED was unable to find ";
108 message += ((not_found > 1) ?
" files:\n" :
" file:\n");
109 message += missing_files;
110 message +=
"\nContinue anyway?";
134 texture_set(&(*ii), &(*end));
142 for (i=0; i<texture_count; i++)
145 if (strlen(new_texture_name[i]))
165 int i, j, k,
z, duplicate;
177 *old_texture_name[
i] = 0;
178 *new_texture_name[
i] = 0;
194 if (!strlen(texture_file))
198 p = strchr( texture_file,
'.' );
209 if (!
stricmp(old_texture_name[k], texture_file))
223 strcpy_s(old_texture_name[texture_count], texture_file);
235 z = box->AddString(old_texture_name[i]);
247 if (!
stricmp(old_texture_name[i], ii->old_texture))
250 strcpy_s(new_texture_name[i], ii->new_texture);
268 CDialog::OnInitDialog();
277 return CDialog::Create(
IDD, pParentWnd);
284 if (query_modified()) {
298 int CShipTexturesDlg::query_modified()
316 strlwr(new_texture_name[active_texture_index]);
319 p = strchr( new_texture_name[active_texture_index],
'.' );
322 mprintf((
"ignoring extension on file '%s'\n", new_texture_name[active_texture_index] ));
334 m_new_texture = CString(new_texture_name[active_texture_index]);
340 void CShipTexturesDlg::sort_textures(
int test)
342 int i, j, str_check = 0;
346 for (j = 0; j <
i; j++)
351 str_check =
stricmp(old_texture_name[i], old_texture_name[j]);
354 str_check =
stricmp(new_texture_name[i], new_texture_name[j]);
363 swap_strings(old_texture_name[i], old_texture_name[j]);
366 swap_strings(new_texture_name[i], new_texture_name[j]);
372 void CShipTexturesDlg::swap_strings(
char *str1,
char *str2)
afx_msg void OnSelchangeOldTextureList()
polymodel * model_get(int model_num)
char ship_name[NAME_LENGTH]
CShipTexturesDlg(CWnd *pParent=NULL)
GLenum GLuint GLenum GLsizei const GLchar * message
GLenum GLuint GLenum GLsizei const GLchar * buf
int bm_load_animation(const char *real_filename, int *nframes, int *fps, int *keyframe, int can_drop_frames, int dir_type)
Loads a bitmap sequance so we can draw with it.
virtual void DoDataExchange(CDataExchange *pDX)
texture_map maps[MAX_MODEL_TEXTURES]
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
const char * bm_get_filename(int handle)
Gets the filename of the bitmap indexed by handle, which must exist.
int bm_load(const char *real_filename)
Loads a bitmap so we can draw with it later.
#define MAX_REPLACEMENT_TEXTURES
#define MB_ICONEXCLAMATION
#define IDC_OLD_TEXTURE_LIST
char old_texture[MAX_FILENAME_LEN]
texture_info textures[TM_NUM_TYPES]
SCP_vector< ship_info > Ship_info
int MessageBox(HWND h, const char *s1, const char *s2, int i)
virtual BOOL OnInitDialog()
SCP_vector< texture_replace > Fred_texture_replacements
char ship_name[NAME_LENGTH]
char new_texture[MAX_FILENAME_LEN]
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, CCreateContext *pContext=NULL)