15 #include "BgBitmapDlg.h"
30 static char THIS_FILE[] = __FILE__;
83 CDialog::DoDataExchange(pDX);
107 DDV_MinMaxInt(pDX,
s_pitch, 0, 359);
109 DDV_MinMaxInt(pDX,
s_bank, 0, 359);
113 DDV_MinMaxFloat(pDX,
s_scale, 0.1
f, 50.0
f);
116 DDV_MinMaxInt(pDX,
b_pitch, 0, 359);
118 DDV_MinMaxInt(pDX,
b_bank, 0, 359);
125 DDV_MinMaxInt(pDX,
b_div_x, 1, 5);
127 DDV_MinMaxInt(pDX,
b_div_y, 1, 5);
157 ON_CBN_SELCHANGE(
IDC_SUN1, OnSunDropdownChange)
161 ON_CBN_SELCHANGE(
IDC_SBITMAP, OnBitmapDropdownChange)
193 const static
float delta = .00001
f;
207 box = (CComboBox *) GetDlgItem(IDC_NEBCOLOR);
215 GetDlgItem(
IDC_TOTAL)->SetWindowText(buf);
217 build_nebfile_list();
237 if (m_skybox_pitch < 0)
238 m_skybox_pitch = m_skybox_pitch + 360;
239 if (m_skybox_bank < 0)
240 m_skybox_bank = m_skybox_bank + 360;
241 if (m_skybox_heading < 0)
242 m_skybox_heading = m_skybox_heading + 360;
253 if(m_neb2_texture == CB_ERR){
271 m_neb_intensity = CString(
"3000");
274 m_neb_intensity = CString(itoa((
int)
Neb2_awacs, whee, 10));
281 ((CButton*)GetDlgItem(IDC_FULLNEB))->SetCheck(1);
288 GetDlgItem(IDC_NEBCOLOR)->EnableWindow(
FALSE);
303 sprintf(temp,
"Background %d", i + 1);
305 ((CComboBox*) GetDlgItem(IDC_BACKGROUND_NUM))->AddString(temp);
308 ((CComboBox*) GetDlgItem(IDC_BACKGROUND_NUM))->SetCurSel(0);
320 m_amb_red.SetRange(1,255);
321 m_amb_green.SetRange(1,255);
322 m_amb_blue.SetRange(1,255);
328 sprintf(buf,
"Red: %d", m_amb_red.GetPos());
330 sprintf(buf,
"Green: %d", m_amb_green.GetPos());
332 sprintf(buf,
"Blue: %d", m_amb_blue.GetPos());
499 char palette_filename[1024];
506 mprintf((
"Loading palette %s\n", palette_filename ));
536 CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
540 GetDlgItem(
IDC_TOTAL)->SetWindowText(buf);
647 box->AddString(
"None");
660 CComboBox *ccb = (CComboBox*) GetDlgItem(
IDC_SUN1);
675 for (idx = 0; idx < (
int)background->
suns.size(); idx++)
677 clb->AddString(background->
suns[idx].filename);
681 if (background->
suns.size() > 0)
742 drop_index = ((CComboBox*) GetDlgItem(
IDC_SUN1))->FindString(-1, sle->
filename);
743 if(drop_index != CB_ERR)
744 ((CComboBox*) GetDlgItem(
IDC_SUN1))->SetCurSel(drop_index);
773 ((CListBox*) GetDlgItem(
IDC_SUN1_LIST))->SetCurSel(add_index);
805 int new_index = ((CComboBox*) GetDlgItem(
IDC_SUN1))->GetCurSel();
806 Assert(new_index != CB_ERR);
809 if(new_index != CB_ERR)
811 ((CComboBox*) GetDlgItem(
IDC_SUN1))->GetLBText(new_index,
s_name);
824 CComboBox *ccb = (CComboBox*) GetDlgItem(
IDC_SBITMAP);
839 for (idx = 0; idx < (
int)background->
bitmaps.size(); idx++)
841 clb->AddString(background->
bitmaps[idx].filename);
845 if (background->
bitmaps.size() > 0)
910 if(drop_index != CB_ERR)
911 ((CComboBox*) GetDlgItem(
IDC_SBITMAP))->SetCurSel(drop_index);
972 int new_index = ((CComboBox*) GetDlgItem(
IDC_SBITMAP))->GetCurSel();
973 Assert(new_index != CB_ERR);
976 if(new_index != CB_ERR)
1000 this->SetDlgItemInt(
id, *var);
1007 if (*var == (max+1))
1012 this->SetDlgItemInt(
id, *var);
1023 this->GetDlgItemText(
id, buf, 16);
1025 *var = (
float)atof(buf);
1028 CString error_msg =
"Please Enter a number between ";
1029 error_msg += min_ch;
1030 error_msg +=
" and ";
1031 error_msg += max_ch;
1036 this->SetDlgItemText(
id, min_ch);
1043 this->SetDlgItemText(
id, max_ch);
1054 *var=this->GetDlgItemInt(
id);
1058 CString error_msg =
"Please Enter a number between ";
1059 error_msg += min_ch;
1060 error_msg +=
" and ";
1061 error_msg += max_ch;
1066 SetDlgItemInt(
id, min);
1073 SetDlgItemInt(
id, max);
1080 NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
1090 NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
1100 NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
1159 NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
1170 NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
1181 NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
1220 NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
1229 NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
1238 NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
1268 CFileDialog cfd(
TRUE,
".fs2", NULL, 0,
"FreeSpace2 Missions (*.fs2)|*.fs2||\0");
1269 char filename[256], error_str[1024];
1278 if (cfd.DoModal() == IDCANCEL)
1281 strcpy_s(filename, cfd.GetPathName());
1316 if (dlg.DoModal() == IDCANCEL)
1322 for (i = 0; i < which + 1; i++)
1333 mprintf((
"BGBITMAPDLG: Unable to parse '%s'! Error message = %s.\n", filename, e.what()));
1334 sprintf(error_str,
"Could not parse file: %s\n\nError message: %s", filename, e.what());
1414 CFileDialog dlg(
TRUE, NULL, filename, OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR,
Model_file_ext);
1417 if (dlg.DoModal() == IDOK) {
1455 CFileDialog dlg(
TRUE, NULL, filename, OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR,
Image_file_ext);
1458 if (dlg.DoModal() == IDOK) {
void record_window_data(window_data *wndd, CWnd *wnd)
#define IDC_SBITMAP_DIV_X
#define IDC_SWAP_BACKGROUND
int stars_get_num_entries(bool is_a_sun, bool bitmap_count)
matrix skybox_orientation
virtual void DoDataExchange(CDataExchange *pDX)
char Neb2_texture_name[MAX_FILENAME_LEN]
SCP_vector< starfield_list_entry > suns
#define IDC_SKY_FLAG_NO_GLOW
afx_msg void OnKillfocusSun1H()
#define MISSION_FLAG_FULLNEB
afx_msg void OnKillfocusSun1Scale()
void reinitialize_lists()
afx_msg void OnKillfocusSkyboxB()
void nebula_init(const char *filename, int pitch, int bank, int heading)
#define IDC_IMPORT_BACKGROUND
const char * stars_get_name_FRED(int index, bool is_a_sun)
background_t Backgrounds[MAX_BACKGROUNDS]
#define IDC_SBITMAP_SCALE_Y
afx_msg void OnKillfocusSbitmapDivY()
afx_msg void OnDeltaposSkyboxPSpin(NMHDR *pNMHDR, LRESULT *pResult)
matrix * vm_angles_2_matrix(matrix *m, const angles *a)
afx_msg void OnDeltaposSbitmapPSpin(NMHDR *pNMHDR, LRESULT *pResult)
void stars_set_background_orientation(matrix *orient)
afx_msg void OnKillfocusSkyboxP()
afx_msg void OnAddBitmap()
void get_data_spinner(NM_UPDOWN *pUD, int id, int *var, int min, int max)
int init_window(window_data *wndd, CWnd *wnd, int adjust=0, int pre=0)
void update_data(int update=1)
#define IDC_SBITMAP_P_SPIN
afx_msg void OnSwapBackground()
afx_msg void OnKillfocusSbitmapB()
afx_msg void OnImportBackground()
afx_msg void OnDeltaposSun1PSpin(NMHDR *pNMHDR, LRESULT *pResult)
void parse_one_background(background_t *background)
afx_msg void OnBackgroundDropdownChange()
#define IDC_SKYBOX_H_SPIN
afx_msg void OnKillfocusSun1B()
char Neb2_poof_filenames[MAX_NEB2_POOFS][MAX_FILENAME_LEN]
void sun_data_save_current()
GLenum GLuint GLenum GLsizei const GLchar * buf
bg_bitmap_dlg * Bg_bitmap_dialog
#define IDC_SKY_FLAG_CLAMP
void OnOrientationChange()
#define gr_set_ambient_light
#define IDC_SBITMAP_SCALE_X
afx_msg void OnBitmapDropdownChange()
#define IDC_SKY_FLAG_NO_CULL
#define IDC_AMBIENT_G_SLIDER
int cfile_push_chdir(int type)
Push current directory onto a 'stack' and change to a new directory.
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
afx_msg void OnKillfocusSbitmapDivX()
char Neb2_bitmap_filenames[MAX_NEB2_BITMAPS][MAX_FILENAME_LEN]
afx_msg void OnKillfocusSbitmapH()
void stars_set_background_model(char *model_name, char *texture_name, int flags)
void stars_load_background(int background_idx)
#define IDC_SBITMAP_H_SPIN
char * Nebula_filenames[NUM_NEBULAS]
#define IDC_SKY_FLAG_NO_ZBUFF
afx_msg void OnSkyboxBrowse()
#define IDC_SKY_FLAG_XPARENT
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
SCP_vector< storm_type > Storm_types
#define IDC_NEB_FAR_MULTIPLIER
#define IDC_SKYBOX_P_SPIN
#define IDC_SKY_FLAG_NO_LIGHTING
int get_active_background()
int required_string(const char *pstr)
afx_msg void OnDeltaposSbitmapBSpin(NMHDR *pNMHDR, LRESULT *pResult)
char skybox_model[MAX_FILENAME_LEN]
afx_msg void OnKillfocusSbitmapScaleY()
angles * vm_extract_angles_matrix(angles *a, const matrix *m)
void read_file_text(const char *filename, int mode, char *processed_text, char *raw_text)
int get_swap_background()
afx_msg void OnDeltaposSun1BSpin(NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
#define IDC_AMBIENT_G_TEXT
#define IDC_SBITMAP_B_SPIN
void string_copy(char *dest, const CString &src, int max_len, int modify)
void stars_swap_backgrounds(int idx1, int idx2)
afx_msg void OnSunDropdownChange()
#define IDC_NEB_TOGGLE_TRAILS
#define IDC_AMBIENT_B_SLIDER
void set_modified(BOOL arg)
void reset_parse(char *text)
GLuint const GLchar * name
afx_msg void OnKillfocusSun1P()
void stars_load_first_valid_background()
#define IDC_BACKGROUND_SWAP_NUM
int bm_load(const char *real_filename)
Loads a bitmap so we can draw with it later.
afx_msg void OnSelchangeNebcolor()
#define IDC_AMBIENT_B_TEXT
#define IDC_AMBIENT_R_SLIDER
afx_msg void OnKillfocusSbitmapP()
typedef float(SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID)()
afx_msg void OnEnvmapBrowse()
afx_msg void OnKillfocusSbitmapScaleX()
#define IDC_BACKGROUND_NUM
#define MISSION_FLAG_TOGGLE_SHIP_TRAILS
afx_msg void OnKillfocusSkyboxH()
char Mission_parse_storm_name[NAME_LENGTH]
#define IDC_ENVMAP_BROWSE
afx_msg void OnDeltaposSun1HSpin(NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void OnDeltaposSbitmapHSpin(NMHDR *pNMHDR, LRESULT *pResult)
int GetChosenBackground()
afx_msg void OnDelBitmap()
afx_msg void OnSelchangeNebpattern()
int MessageBox(HWND h, const char *s1, const char *s2, int i)
#define IDC_SBITMAP_DIV_Y
int ENVMAP
References a map that is for environment mapping -Bobboau.
#define IDC_NEB2_INTENSITY
#define IDC_SKYBOX_B_SPIN
#define IDC_NEB_NEAR_MULTIPLIER
afx_msg void OnDeltaposSkyboxBSpin(NMHDR *pNMHDR, LRESULT *pResult)
#define IDC_NEB2_LIGHTNING
bg_bitmap_dlg(CWnd *pParent=NULL)
SCP_vector< starfield_list_entry > bitmaps
void get_data_float(int id, float *var, float max, float min)
void get_data_int(int id, int *var, int min, int max)
void stars_pack_backgrounds()
char envmap_name[MAX_FILENAME_LEN]
#define NUM_NEBULA_COLORS
char filename[MAX_FILENAME_LEN]
afx_msg void OnDeltaposSkyboxHSpin(NMHDR *pNMHDR, LRESULT *pResult)
void bitmap_data_save_current()
char * Nebula_colors[NUM_NEBULA_COLORS]
int skip_to_string(char *pstr, char *end)
void build_nebfile_list()
#define IDC_AMBIENT_R_TEXT
int skip_to_start_of_string(char *pstr, char *end)
#define MISSION_FLAG_SUBSPACE
afx_msg void OnBitmapChange()
void palette_load_table(const char *filename)
afx_msg void OnSunChange()