Add rayman2 source files

This commit is contained in:
2024-09-18 02:33:44 +08:00
parent bcc093f8ed
commit fb036c54fd
14339 changed files with 2596224 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,20 @@
; This file is maintained by HCW. Do not modify this file directly.
[OPTIONS]
HCW=0
COMPRESS=4 Hall
LCID=0x40c 0x0 0x0 ;Fran<61>ais - standard
REPORT=Yes
FTS=1
CNT=..\..\..\exe\main\edt_data\Tools\Material\MatHelp.cnt
BMROOT=..\..\..\exe\main\edt_data\Tools\Material
HLP=..\..\..\exe\main\edt_data\tools\material\MatHelp.hlp
[FILES]
.\MatHelp.rtf
[WINDOWS]
MatHelp="",(652,102,360,600),54020,(r4227327),(r8421631),f3
[CONFIG]
BrowseButtons()

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,4 @@
del \\serveur-3\cpa\shadow\cpa\exe\gam\edt_data\tools\tgm*.*
del \\serveur-3\cpa\shadow\cpa\exe\gam\edt_data\tools\Material\*.*
xcopy x:\cpa\exe\gam\edt_data\tools\tgm*.* \\serveur-3\cpa\shadow\cpa\exe\gam\edt_data\tools
xcopy x:\cpa\exe\gam\edt_data\tools\Material\*.* \\serveur-3\cpa\shadow\cpa\exe\gam\edt_data\tools\Material /I

View File

@@ -0,0 +1 @@
Material v0.0.0

Binary file not shown.

View File

@@ -0,0 +1,316 @@
; CLW file contains information for the MFC ClassWizard v
[General Info]
Version=1
LastClass=DiaView
LastTemplate=CDialog
NewFileInclude1=#include "stdafx.h"
NewFileInclude2=#include "script1.h"
LastPage=0
ClassCount=9
Class1=DiaMeca
Class2=DiaCol
Class3=DiaSound
Class4=DiaView
ResourceCount=9
Resource1=IDD_SOUND_DIALOG
Resource2=IDD_LIST_DIALOG
Resource3=IDD_DIALOG_TEXTURELIST
Resource4=IDD_DIALOG_CHOOSECOLOR
Class5=CTextureDlg
Resource5=IDD_MAIN_DIALOG
Class6=DiaMain
Resource6=IDD_MECA_DIALOG
Class7=DiaText
Resource7=IDD_COLLISION_DIALOG
Class8=DiaList
Resource8=IDD_TEXTURE_DIALOG
Class9=CChooseColor
Resource9=IDD_VIEW_DIALOG
[CLS:DiaMeca]
Type=0
HeaderFile=\Cpa\tempgrp\TGM\src\diameca.hpp
ImplementationFile=\Cpa\tempgrp\TGM\src\diameca.cpp
BaseClass=CFormView
LastObject=IDC_EDIT_FRICTION
Filter=D
VirtualFilter=VWC
[CLS:DiaCol]
Type=0
HeaderFile=\Cpa\tempgrp\TGM\src\diacol.hpp
ImplementationFile=\Cpa\tempgrp\TGM\src\diacol.cpp
BaseClass=CFormView
Filter=D
VirtualFilter=VWC
LastObject=DiaCol
[CLS:DiaSound]
Type=0
HeaderFile=\Cpa\tempgrp\TGM\src\diasound.hpp
ImplementationFile=\Cpa\tempgrp\TGM\src\diasound.cpp
BaseClass=CFormView
LastObject=DiaSound
Filter=D
[CLS:DiaView]
Type=0
HeaderFile=\Cpa\TempGrp\TGM\src\diaview.hpp
ImplementationFile=\Cpa\TempGrp\TGM\src\diaview.cpp
BaseClass=CFormView
LastObject=IDC_CHECK_BACKFACE
Filter=D
VirtualFilter=VWC
[CLS:Diatext]
Type=0
HeaderFile=\Cpa\TempGrp\TGM\src\diatext.hpp
ImplementationFile=\Cpa\TempGrp\TGM\src\diatext.cpp
BaseClass=CFormView
LastObject=DiaText
Filter=D
VirtualFilter=VWC
[DLG:IDD_COLLISION_DIALOG]
Type=1
Class=DiaCol
ControlCount=44
Control1=IDC_CHECK_DISABLE_COLLISIONS,button,1342246915
Control2=IDC_RADIO_ZDM,button,1476526089
Control3=IDC_RADIO_ZDR,button,1476395017
Control4=IDC_RADIO_ZDE,button,1476395017
Control5=IDC_CHECK1,button,1476460547
Control6=IDC_CHECK2,button,1476460547
Control7=IDC_CHECK3,button,1476460547
Control8=IDC_CHECK4,button,1476460547
Control9=IDC_CHECK5,button,1476460547
Control10=IDC_CHECK6,button,1476460547
Control11=IDC_CHECK7,button,1476460547
Control12=IDC_CHECK8,button,1476460547
Control13=IDC_CHECK9,button,1476460547
Control14=IDC_CHECK10,button,1476460547
Control15=IDC_CHECK11,button,1476460547
Control16=IDC_CHECK12,button,1476460547
Control17=IDC_CHECK13,button,1476460547
Control18=IDC_CHECK14,button,1476460547
Control19=IDC_CHECK15,button,1476460547
Control20=IDC_CHECK16,button,1476460547
Control21=IDC_EDIT_NAME1,edit,1350631552
Control22=IDC_EDIT_NAME2,edit,1350631552
Control23=IDC_EDIT_NAME3,edit,1350631552
Control24=IDC_EDIT_NAME4,edit,1350631552
Control25=IDC_EDIT_NAME5,edit,1350631552
Control26=IDC_EDIT_NAME6,edit,1350631552
Control27=IDC_EDIT_NAME7,edit,1350631552
Control28=IDC_EDIT_NAME8,edit,1350631552
Control29=IDC_EDIT_NAME9,edit,1350631552
Control30=IDC_EDIT_NAME10,edit,1350631552
Control31=IDC_EDIT_NAME11,edit,1350631552
Control32=IDC_EDIT_NAME12,edit,1350631552
Control33=IDC_EDIT_NAME13,edit,1350631552
Control34=IDC_EDIT_NAME14,edit,1350631552
Control35=IDC_EDIT_NAME15,edit,1350631552
Control36=IDC_EDIT_NAME16,edit,1350631552
Control37=IDC_CHECK_LOCK_NAMES,button,1342246915
Control38=IDC_BUTTON_SAVE_NAMES,button,1342242816
Control39=IDC_BUTTON_COPYCOL,button,1476460544
Control40=IDC_BUTTON_PASTECOL,button,1476460544
Control41=IDC_BUTTON_RENAMECOL,button,1476460544
Control42=IDC_COMBO_COLMATNAME,combobox,1478557698
Control43=IDC_BUTTON_HIGHLIGHTCOLOR,button,1476493323
Control44=IDC_CHECK_HIGHLIGHT,button,1476460579
[DLG:IDD_VIEW_DIALOG]
Type=1
Class=DiaView
ControlCount=24
Control1=IDC_CHECK_TRANS,button,1476464643
Control2=IDC_STATIC,static,1342308865
Control3=IDC_STATIC,static,1342308865
Control4=IDC_STATIC,static,1342308865
Control5=IDC_EDIT_SPECEXP,edit,1484857472
Control6=IDC_SPIN_SPECEXP,msctls_updown32,1476395058
Control7=IDC_BUTTON_DIFFUSE,button,1476493323
Control8=IDC_BUTTON_AMBIENT,button,1476493323
Control9=IDC_BUTTON_SPECULAR,button,1476493323
Control10=IDC_CHECK_TEXTURE,button,1476464643
Control11=IDC_CHECK_GOURAUD,button,1476464643
Control12=IDC_EDIT_HORIZONTALSCROLL,edit,1484849281
Control13=IDC_EDIT_VERTICALSCROLL,edit,1484849281
Control14=IDC_CHECK_CHROME,button,1476460579
Control15=IDC_STATIC,static,1342308865
Control16=IDC_STATIC,static,1342308865
Control17=IDC_CHECK_ALPHASENSITIVE,button,1476464643
Control18=IDC_COMBO_ANIMATEDTEXTURES,combobox,1478557699
Control19=IDC_BUTTON_ADDANIMATED,button,1476460544
Control20=IDC_BUTTON_REMOVEANIMATED,button,1476460544
Control21=IDC_BUTTON_MOVEUP,button,1476460608
Control22=IDC_BUTTON_MOVEDOWN,button,1476460608
Control23=IDC_CHECK_AUTOSCROLL,button,1476464643
Control24=IDC_CHECK_BACKFACE,button,1476464643
[DLG:IDD_MECA_DIALOG]
Type=1
Class=DiaMeca
ControlCount=36
Control1=IDC_CHECK_DISABLE_MECHANICS,button,1342246915
Control2=IDC_STATIC_Slide,static,1342308352
Control3=IDC_STATIC_Adhesion,static,1342308352
Control4=IDC_STATIC_Progression,static,1342308352
Control5=IDC_STATIC_PenetrationSpeed,static,1342308352
Control6=IDC_STATIC_PenetrationMax,static,1342308352
Control7=IDC_EDIT_SLIDE,edit,1350631552
Control8=IDC_EDIT_ADHESION,edit,1350631552
Control9=IDC_EDIT_PROGRESSION,edit,1350631552
Control10=IDC_EDIT_PENETRATION_SPEED,edit,1350631552
Control11=IDC_EDIT_PENETRATION_MAX,edit,1350631552
Control12=IDC_SLIDER_SLIDE,msctls_trackbar32,1342242840
Control13=IDC_SLIDER_ADHESION,msctls_trackbar32,1342242840
Control14=IDC_SLIDER_PROGRESSION,msctls_trackbar32,1342242840
Control15=IDC_SLIDER_PENETRATION_SPEED,msctls_trackbar32,1342242840
Control16=IDC_SLIDER_PENETRATION_MAX,msctls_trackbar32,1342242840
Control17=IDC_BUTTON_SET_DEFAULT,button,1342242816
Control18=IDC_BUTTON_COPYMECA,button,1342242816
Control19=IDC_BUTTON_PASTEMECA,button,1342242816
Control20=IDC_BUTTON_RENAMEMECA,button,1342242816
Control21=IDC_COMBO_MECMATNAME,combobox,1478557698
Control22=IDC_BUTTON_HIGHLIGHTCOLOR,button,1476493323
Control23=IDC_CHECK_HIGHLIGHT,button,1476460579
Control24=IDC_CHECK_BASE_MECHANIC,button,1342246915
Control25=IDC_STATIC_Absorption,static,1342308352
Control26=IDC_STATIC_Friction,static,1342308352
Control27=IDC_EDIT_ABSORPTION,edit,1350631552
Control28=IDC_EDIT_FRICTION,edit,1350631552
Control29=IDC_SLIDER_ABSORPTION,msctls_trackbar32,1342242840
Control30=IDC_SLIDER_FRICTION,msctls_trackbar32,1342242840
Control31=IDC_STATIC_Rebound,static,1342308352
Control32=IDC_STATIC_Slide1,static,1342308352
Control33=IDC_EDIT_REBOUND,edit,1350631552
Control34=IDC_EDIT_SLIDE1,edit,1350631552
Control35=IDC_SLIDER_REBOUND,msctls_trackbar32,1342242840
Control36=IDC_SLIDER_SLIDE1,msctls_trackbar32,1342242840
[DLG:IDD_SOUND_DIALOG]
Type=1
Class=DiaSound
ControlCount=5
Control1=IDC_COMBO_TYPE,combobox,1344340227
Control2=IDC_STATIC_TYPE,static,1342308352
Control3=IDC_CHECK_DISABLE_SOUND,button,1342246915
Control4=IDC_BUTTON_COPYSOUND,button,1342242816
Control5=IDC_BUTTON_PASTESOUND,button,1342242816
[DLG:IDD_DIALOG_TEXTURELIST]
Type=1
Class=CTextureDlg
ControlCount=3
Control1=IDOK,button,1342242817
Control2=IDCANCEL,button,1342242816
Control3=IDC_BUTTON_REFRESH,button,1342242816
[CLS:CTextureDlg]
Type=0
HeaderFile=\Cpa\tempgrp\TGM\src\texturedlg.h
ImplementationFile=\cpa\tempgrp\tgm\src\texturedlg.cpp
BaseClass=CDialog
LastObject=CTextureDlg
[DLG:IDD_MAIN_DIALOG]
Type=1
Class=DiaMain
ControlCount=8
Control1=IDC_STATIC_FILE,static,1342308353
Control2=IDC_COMBO_FILE,combobox,1344340227
Control3=IDC_BUTTON_NEW,button,1476464384
Control4=IDC_BUTTON_COPY,button,1476464384
Control5=IDC_BUTTON_DELETE,button,1476464384
Control6=IDC_STATIC_NAME,static,1342308353
Control7=IDC_EDIT_NAME,edit,1350631552
Control8=IDC_BUTTON_PURGE,button,1476464384
[CLS:DiaMain]
Type=0
HeaderFile=..\src\diamain.hpp
ImplementationFile=..\src\diamain.cpp
BaseClass=CFormView
Filter=D
LastObject=DiaMain
VirtualFilter=VWC
[DLG:IDD_TEXTURE_DIALOG]
Type=1
Class=DiaText
ControlCount=17
Control1=IDC_BUTTON_VISUEL,button,1476493323
Control2=IDC_BUTTON_PRIORITY,button,1342242816
Control3=IDC_STATIC,static,1342308865
Control4=IDC_STATIC,static,1342308865
Control5=IDC_BUTTON_QUALITYLEVEL,button,1342242816
Control6=IDC_STATIC,static,1342308865
Control7=IDC_CHECK_HORIZONTALTILE,button,1476464419
Control8=IDC_CHECK_VERTICALTILE,button,1476464419
Control9=IDC_STATIC,static,1342308865
Control10=IDC_BUTTON_CHROMAKEYCOLOR,button,1476493323
Control11=IDC_BUTTON_SUPPLYTEXTURE,button,1342242816
Control12=IDC_STATIC,static,1342308865
Control13=IDC_CHECK_HORIZONTALFILTERING,button,1476464419
Control14=IDC_CHECK_VERTICALFILTERING,button,1476464419
Control15=IDC_CHECK_DEPTHFILTERING,button,1476464419
Control16=IDC_STATIC,static,1342308865
Control17=IDC_EDIT_DURATION,edit,1484849280
[CLS:DiaText]
Type=0
HeaderFile=\Cpa\tempgrp\TGM\src\diatext.hpp
ImplementationFile=\Cpa\tempgrp\TGM\src\diatext.cpp
BaseClass=CFormView
LastObject=DiaText
Filter=D
VirtualFilter=VWC
[DLG:IDD_LIST_DIALOG]
Type=1
Class=DiaList
ControlCount=0
[CLS:DiaList]
Type=0
HeaderFile=..\src\dialist.hpp
ImplementationFile=..\src\dialist.cpp
BaseClass=CFormView
Filter=D
LastObject=DiaList
VirtualFilter=VWC
[DLG:IDD_DIALOG_CHOOSECOLOR]
Type=1
Class=CChooseColor
ControlCount=15
Control1=IDOK,button,1342242817
Control2=IDCANCEL,button,1342242816
Control3=IDC_BUTTON_COLOR,button,1342242827
Control4=IDC_STATIC,static,1342308865
Control5=IDC_EDIT_RED,edit,1350631552
Control6=IDC_STATIC,static,1342308865
Control7=IDC_EDIT_GREEN,edit,1350631552
Control8=IDC_STATIC,static,1342308865
Control9=IDC_EDIT_BLUE,edit,1350631552
Control10=IDC_STATIC,static,1342308865
Control11=IDC_EDIT_ALPHA,edit,1350631552
Control12=IDC_SLIDER_RED,msctls_trackbar32,1342242836
Control13=IDC_SLIDER_GREEN,msctls_trackbar32,1342242836
Control14=IDC_SLIDER_BLUE,msctls_trackbar32,1342242836
Control15=IDC_SLIDER_ALPHA,msctls_trackbar32,1342242836
[CLS:CChooseColor]
Type=0
HeaderFile=..\src\choosecolor.hpp
ImplementationFile=..\src\choosecolor.cpp
BaseClass=CDialog
Filter=D
VirtualFilter=dWC
LastObject=CChooseColor

View File

@@ -0,0 +1,473 @@
//Microsoft Developer Studio generated resource script.
//
#include "matres.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// French (France) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_MECA_DIALOG DIALOGEX 0, 0, 172, 115
STYLE WS_CHILD
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
CONTROL "New mechanical characteristics",
IDC_CHECK_DISABLE_MECHANICS,"Button",BS_AUTOCHECKBOX |
BS_PUSHLIKE | WS_TABSTOP,4,4,110,11
CONTROL "",IDC_BUTTON_HIGHLIGHTCOLOR,"Button",BS_OWNERDRAW |
BS_FLAT | WS_DISABLED | WS_TABSTOP,118,4,33,11,
WS_EX_STATICEDGE
CONTROL "",IDC_CHECK_HIGHLIGHT,"Button",BS_AUTOCHECKBOX |
BS_LEFTTEXT | WS_DISABLED | WS_TABSTOP,152,6,16,8
COMBOBOX IDC_COMBO_MECMATNAME,4,18,164,162,CBS_DROPDOWN |
WS_DISABLED | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Copy",IDC_BUTTON_COPYMECA,4,35,51,11
PUSHBUTTON "Paste",IDC_BUTTON_PASTEMECA,61,35,51,11
PUSHBUTTON "Rename",IDC_BUTTON_RENAMEMECA,117,35,51,11
EDITTEXT IDC_EDIT_REBOUND,4,50,40,14,ES_AUTOHSCROLL
CONTROL "Slider1",IDC_SLIDER_REBOUND,"msctls_trackbar32",
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,50,50,55,13
LTEXT "Rebound",IDC_STATIC_Rebound,109,52,59,8
EDITTEXT IDC_EDIT_SLIDE,4,66,40,14,ES_AUTOHSCROLL
CONTROL "Slider2",IDC_SLIDER_SLIDE,"msctls_trackbar32",TBS_BOTH |
TBS_NOTICKS | WS_TABSTOP,50,66,55,13
LTEXT "Slide",IDC_STATIC_Slide,109,69,59,8
PUSHBUTTON "Set Default",IDC_BUTTON_SET_DEFAULT,4,92,164,11
END
IDD_SOUND_DIALOG DIALOG DISCARDABLE 0, 0, 172, 34
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
COMBOBOX IDC_COMBO_TYPE,27,18,75,110,CBS_DROPDOWNLIST | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
LTEXT "Type :",IDC_STATIC_TYPE,4,20,20,8
CONTROL "Enable Sound",IDC_CHECK_DISABLE_SOUND,"Button",
BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP,31,4,110,10
PUSHBUTTON "Copy",IDC_BUTTON_COPYSOUND,106,19,29,11
PUSHBUTTON "Paste",IDC_BUTTON_PASTESOUND,139,19,29,11
END
IDD_VIEW_DIALOG DIALOGEX 0, 0, 172, 92
STYLE WS_CHILD
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
CONTROL "Alpha sensitive",IDC_CHECK_ALPHASENSITIVE,"Button",
BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_DISABLED | WS_TABSTOP,
4,4,51,11
CONTROL "Transparent",IDC_CHECK_TRANS,"Button",BS_AUTOCHECKBOX |
BS_PUSHLIKE | WS_DISABLED | WS_TABSTOP,60,4,51,11
CONTROL "Textured",IDC_CHECK_TEXTURE,"Button",BS_AUTOCHECKBOX |
BS_PUSHLIKE | WS_DISABLED | WS_TABSTOP,117,4,51,11
CONTROL "",IDC_CHECK_GOURAUD,"Button",BS_AUTOCHECKBOX |
BS_PUSHLIKE | WS_DISABLED | WS_TABSTOP,4,19,51,11
CONTROL "Chrome",IDC_CHECK_CHROME,"Button",BS_AUTOCHECKBOX |
BS_LEFTTEXT | WS_DISABLED | WS_TABSTOP,59,19,50,11
CONTROL "Backface",IDC_CHECK_BACKFACE,"Button",BS_AUTOCHECKBOX |
BS_PUSHLIKE | WS_DISABLED | WS_TABSTOP,117,19,51,11
CONTROL "Autoscroll",IDC_CHECK_AUTOSCROLL,"Button",
BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_DISABLED | WS_TABSTOP,
4,33,51,11
EDITTEXT IDC_EDIT_HORIZONTALSCROLL,77,33,37,12,ES_CENTER |
ES_AUTOHSCROLL | WS_DISABLED
EDITTEXT IDC_EDIT_VERTICALSCROLL,131,33,37,12,ES_CENTER |
ES_AUTOHSCROLL | WS_DISABLED
CONTROL "",IDC_BUTTON_AMBIENT,"Button",BS_OWNERDRAW | BS_FLAT |
WS_DISABLED | WS_TABSTOP,51,48,26,11,WS_EX_STATICEDGE
CONTROL "",IDC_BUTTON_DIFFUSE,"Button",BS_OWNERDRAW | BS_FLAT |
WS_DISABLED | WS_TABSTOP,142,48,26,11,WS_EX_STATICEDGE
CONTROL "",IDC_BUTTON_SPECULAR,"Button",BS_OWNERDRAW | BS_FLAT |
WS_DISABLED | WS_TABSTOP,51,62,26,11,WS_EX_STATICEDGE
EDITTEXT IDC_EDIT_SPECEXP,95,61,60,12,ES_AUTOHSCROLL | ES_NUMBER |
WS_DISABLED
CONTROL "Spin1",IDC_SPIN_SPECEXP,"msctls_updown32",
UDS_SETBUDDYINT | UDS_AUTOBUDDY | UDS_ARROWKEYS |
WS_DISABLED,159,59,9,14
COMBOBOX IDC_COMBO_ANIMATEDTEXTURES,4,76,100,103,CBS_DROPDOWNLIST |
WS_DISABLED | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "+",IDC_BUTTON_ADDANIMATED,109,76,11,12,WS_DISABLED
PUSHBUTTON "-",IDC_BUTTON_REMOVEANIMATED,125,76,11,12,WS_DISABLED
PUSHBUTTON "",IDC_BUTTON_MOVEUP,141,76,11,12,BS_ICON | WS_DISABLED
PUSHBUTTON "",IDC_BUTTON_MOVEDOWN,157,76,11,12,BS_ICON |
WS_DISABLED
CTEXT "Diffuse",IDC_STATIC,95,48,43,11,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CTEXT "Ambient",IDC_STATIC,4,48,43,11,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CTEXT "Specular",IDC_STATIC,4,62,43,11,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CTEXT "H",IDC_STATIC,66,35,8,8,SS_CENTERIMAGE
CTEXT "V",IDC_STATIC,120,35,8,8,SS_CENTERIMAGE
END
IDD_COLLISION_DIALOG DIALOGEX 0, 0, 172, 182
STYLE WS_CHILD
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
CONTROL "New collision characteristics",
IDC_CHECK_DISABLE_COLLISIONS,"Button",BS_AUTOCHECKBOX |
BS_PUSHLIKE | WS_TABSTOP,4,4,110,10
CONTROL "",IDC_BUTTON_HIGHLIGHTCOLOR,"Button",BS_OWNERDRAW |
BS_FLAT | WS_DISABLED | WS_TABSTOP,118,4,33,11,
WS_EX_STATICEDGE
CONTROL "",IDC_CHECK_HIGHLIGHT,"Button",BS_AUTOCHECKBOX |
BS_LEFTTEXT | WS_DISABLED | WS_TABSTOP,152,6,16,8
COMBOBOX IDC_COMBO_COLMATNAME,4,17,164,161,CBS_DROPDOWN |
WS_DISABLED | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Copy",IDC_BUTTON_COPYCOL,4,34,51,11,WS_DISABLED
PUSHBUTTON "Paste",IDC_BUTTON_PASTECOL,61,34,51,11,WS_DISABLED
PUSHBUTTON "Rename",IDC_BUTTON_RENAMECOL,117,34,51,11,WS_DISABLED
CONTROL "Zdm",IDC_RADIO_ZDM,"Button",BS_AUTORADIOBUTTON |
WS_DISABLED | WS_GROUP,6,48,28,10
CONTROL "Zdr",IDC_RADIO_ZDR,"Button",BS_AUTORADIOBUTTON |
WS_DISABLED,72,48,28,10
CONTROL "Zde",IDC_RADIO_ZDE,"Button",BS_AUTORADIOBUTTON |
WS_DISABLED,138,48,28,10
CONTROL "",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,4,61,14,8
EDITTEXT IDC_EDIT_NAME1,19,59,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,4,74,14,8
EDITTEXT IDC_EDIT_NAME2,19,72,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,4,88,14,8
EDITTEXT IDC_EDIT_NAME3,19,85,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,4,101,14,8
EDITTEXT IDC_EDIT_NAME4,19,98,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,4,114,14,8
EDITTEXT IDC_EDIT_NAME5,19,111,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK6,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,4,127,14,8
EDITTEXT IDC_EDIT_NAME6,19,124,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK7,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,4,139,14,8
EDITTEXT IDC_EDIT_NAME7,19,137,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK8,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,4,152,14,8
EDITTEXT IDC_EDIT_NAME8,19,150,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK9,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,93,61,14,8
EDITTEXT IDC_EDIT_NAME9,108,59,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK10,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,93,74,14,8
EDITTEXT IDC_EDIT_NAME10,108,72,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK11,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,93,88,14,8
EDITTEXT IDC_EDIT_NAME11,108,85,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK12,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,93,101,14,8
EDITTEXT IDC_EDIT_NAME12,108,98,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK13,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,93,114,14,8
EDITTEXT IDC_EDIT_NAME13,108,111,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK14,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,93,127,14,8
EDITTEXT IDC_EDIT_NAME14,108,124,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK15,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,93,139,14,8
EDITTEXT IDC_EDIT_NAME15,108,137,60,12,ES_AUTOHSCROLL
CONTROL "",IDC_CHECK16,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
WS_TABSTOP,93,152,14,8
EDITTEXT IDC_EDIT_NAME16,108,150,60,12,ES_AUTOHSCROLL
CONTROL "Lock Names",IDC_CHECK_LOCK_NAMES,"Button",
BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP,4,167,75,11
PUSHBUTTON "Save Names",IDC_BUTTON_SAVE_NAMES,93,167,75,11
END
IDD_DIALOG_TEXTURELIST DIALOG DISCARDABLE 0, 0, 186, 150
STYLE WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
CAPTION "Choose a texture"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,7,129,50,14
PUSHBUTTON "Refresh",IDC_BUTTON_REFRESH,70,129,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,129,50,14
END
IDD_MAIN_DIALOG DIALOGEX 0, 0, 172, 76
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
COMBOBOX IDC_COMBO_FILE,40,4,97,86,CBS_DROPDOWNLIST | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Purge",IDC_BUTTON_PURGE,141,4,27,13,BS_CENTER |
BS_VCENTER | WS_DISABLED
EDITTEXT IDC_EDIT_NAME,40,20,128,13,ES_AUTOHSCROLL
PUSHBUTTON "New",IDC_BUTTON_NEW,4,39,51,11,BS_CENTER | BS_VCENTER |
WS_DISABLED
PUSHBUTTON "Clone",IDC_BUTTON_COPY,60,39,51,11,BS_CENTER |
BS_VCENTER | WS_DISABLED
PUSHBUTTON "Delete",IDC_BUTTON_DELETE,117,39,51,11,BS_CENTER |
BS_VCENTER | WS_DISABLED
CTEXT "File",IDC_STATIC_FILE,4,4,32,12,0,WS_EX_STATICEDGE
CTEXT "Name",IDC_STATIC_NAME,4,20,32,12,0,WS_EX_STATICEDGE
PUSHBUTTON "PreLoad GMT",IDC_BUTTON_LOADGMT,17,58,64,14
PUSHBUTTON "UnPreLoad GMT",IDC_BUTTON_UNLOADGMT,88,58,64,14
END
IDD_TEXTURE_DIALOG DIALOGEX 0, 0, 198, 111
STYLE WS_CHILD
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
PUSHBUTTON "",IDC_BUTTON_SUPPLYTEXTURE,4,4,74,11
CONTROL "",IDC_BUTTON_VISUEL,"Button",BS_OWNERDRAW | BS_NOTIFY |
BS_FLAT | WS_DISABLED | WS_TABSTOP,4,20,74,68
PUSHBUTTON "",IDC_BUTTON_PRIORITY,128,4,66,11
PUSHBUTTON "",IDC_BUTTON_QUALITYLEVEL,128,19,66,11
CONTROL "U",IDC_CHECK_HORIZONTALFILTERING,"Button",
BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_CENTER | BS_VCENTER |
WS_DISABLED | WS_TABSTOP,125,34,21,10
CONTROL "V",IDC_CHECK_VERTICALFILTERING,"Button",BS_AUTOCHECKBOX |
BS_LEFTTEXT | BS_CENTER | BS_VCENTER | WS_DISABLED |
WS_TABSTOP,149,34,21,10
CONTROL "Z",IDC_CHECK_DEPTHFILTERING,"Button",BS_AUTOCHECKBOX |
BS_LEFTTEXT | BS_CENTER | BS_VCENTER | WS_DISABLED |
WS_TABSTOP,173,34,21,10
CONTROL "U",IDC_CHECK_HORIZONTALTILE,"Button",BS_AUTOCHECKBOX |
BS_LEFTTEXT | BS_CENTER | BS_VCENTER | WS_DISABLED |
WS_TABSTOP,137,49,21,10
CONTROL "V",IDC_CHECK_VERTICALTILE,"Button",BS_AUTOCHECKBOX |
BS_LEFTTEXT | BS_CENTER | BS_VCENTER | WS_DISABLED |
WS_TABSTOP,161,49,21,10
CONTROL "",IDC_BUTTON_CHROMAKEYCOLOR,"Button",BS_OWNERDRAW |
WS_DISABLED | WS_TABSTOP,128,64,66,11
EDITTEXT IDC_EDIT_DURATION,128,78,66,12,ES_AUTOHSCROLL |
WS_DISABLED | NOT WS_BORDER,WS_EX_STATICEDGE
CONTROL "R:255 G:255 B:255",IDC_BUTTON_PIXELCOLOR,"Button",
BS_OWNERDRAW | BS_CENTER | BS_VCENTER | WS_DISABLED |
WS_TABSTOP,128,92,66,11
CTEXT "Priority",IDC_STATIC,84,4,40,11,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CTEXT "Quality",IDC_STATIC,84,19,40,11,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CTEXT "Tiling",IDC_STATIC,84,49,40,11,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CTEXT "Chromakey",IDC_STATIC,84,64,40,11,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CTEXT "Filtering",IDC_STATIC,84,34,40,11,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CTEXT "Duration (s)",IDC_STATIC,84,79,40,11,SS_CENTERIMAGE,
WS_EX_STATICEDGE
LTEXT "Pixel color:",IDC_STATIC,84,92,40,11,SS_CENTERIMAGE,
WS_EX_STATICEDGE
END
IDD_LIST_DIALOG DIALOG DISCARDABLE 0, 0, 180, 95
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
END
IDD_DIALOG_CHOOSECOLOR DIALOGEX 0, 0, 215, 114
STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION
CAPTION "Choose a color"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
CONTROL "Slider1",IDC_SLIDER_RED,"msctls_trackbar32",TBS_TOP |
TBS_NOTICKS | WS_TABSTOP,32,7,153,12
EDITTEXT IDC_EDIT_RED,187,7,22,12,ES_AUTOHSCROLL
CONTROL "Slider1",IDC_SLIDER_GREEN,"msctls_trackbar32",TBS_TOP |
TBS_NOTICKS | WS_TABSTOP,32,22,153,12
EDITTEXT IDC_EDIT_GREEN,187,22,22,12,ES_AUTOHSCROLL
CONTROL "Slider1",IDC_SLIDER_BLUE,"msctls_trackbar32",TBS_TOP |
TBS_NOTICKS | WS_TABSTOP,32,37,153,12
EDITTEXT IDC_EDIT_BLUE,187,37,22,12,ES_AUTOHSCROLL
CONTROL "Slider1",IDC_SLIDER_ALPHA,"msctls_trackbar32",TBS_TOP |
TBS_NOTICKS | WS_TABSTOP,32,52,153,12
EDITTEXT IDC_EDIT_ALPHA,187,52,22,12,ES_AUTOHSCROLL
CONTROL "",IDC_BUTTON_COLOR,"Button",BS_OWNERDRAW | WS_TABSTOP,
50,68,116,20,WS_EX_CLIENTEDGE
DEFPUSHBUTTON "OK",IDOK,27,94,38,14
PUSHBUTTON "Get texture color",IDC_TEXTURE_COLOR,78,95,60,14
PUSHBUTTON "Cancel",IDCANCEL,151,94,38,14
CTEXT "Red",IDC_STATIC,5,7,24,12,SS_CENTERIMAGE | SS_SUNKEN
CTEXT "Green",IDC_STATIC,5,21,24,12,SS_CENTERIMAGE | SS_SUNKEN
CTEXT "Blue",IDC_STATIC,5,37,24,12,SS_CENTERIMAGE | SS_SUNKEN
CTEXT "Alpha",IDC_STATIC,5,52,24,12,SS_CENTERIMAGE | SS_SUNKEN
END
IDD_DIALOG_LISTPRELOADGMT DIALOG DISCARDABLE 0, 0, 186, 170
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Preload GMT"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,7,149,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,149,50,14
LTEXT "Select the GMT file to unload",IDC_STATIC,7,7,172,10
LISTBOX IDC_LIST_GMT,7,18,172,122,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_MECA_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 168
TOPMARGIN, 4
BOTTOMMARGIN, 111
END
IDD_SOUND_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 168
TOPMARGIN, 4
BOTTOMMARGIN, 30
END
IDD_VIEW_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 168
TOPMARGIN, 4
BOTTOMMARGIN, 88
END
IDD_COLLISION_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 168
TOPMARGIN, 4
BOTTOMMARGIN, 178
END
IDD_DIALOG_TEXTURELIST, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 143
END
IDD_MAIN_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 168
TOPMARGIN, 4
BOTTOMMARGIN, 72
END
IDD_TEXTURE_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 194
TOPMARGIN, 4
BOTTOMMARGIN, 107
END
IDD_LIST_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 176
TOPMARGIN, 4
BOTTOMMARGIN, 91
END
IDD_DIALOG_CHOOSECOLOR, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 208
TOPMARGIN, 7
BOTTOMMARGIN, 107
END
IDD_DIALOG_LISTPRELOADGMT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 163
END
END
#endif // APSTUDIO_INVOKED
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"matres.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_BITMAP_HATCHED BITMAP DISCARDABLE "bitmap_h.bmp"
IDB_BITMAP_WORKAREA BITMAP DISCARDABLE "en_chantier.bmp"
IDB_BITMAP_CHOOSECOLOR BITMAP DISCARDABLE "colorchooser.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON_MOVEDOWN ICON DISCARDABLE "icodown.ico"
IDI_ICON_MOVEUP ICON DISCARDABLE "icoup.ico"
IDI_TGM_DLGBAR_ICON ICON DISCARDABLE "tgm_dlgb.ico"
#endif // French (France) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,183 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by TGM.rc
//
#define IDD_MECA_DIALOG 101
#define IDD_SOUND_DIALOG 102
#define IDD_VIEW_DIALOG 103
#define IDD_COLLISION_DIALOG 104
#define IDB_BITMAP_UNVIEWABLETEXTURE 106
#define IDB_BITMAP_NOTEXTURE 109
#define IDB_BITMAP_HATCHED 110
#define IDD_TEXTURE_DIALOG 111
#define IDB_BITMAP_WORKAREA 113
#define IDD_DIALOG_TEXTURELIST 114
#define IDD_MAIN_DIALOG 115
#define IDD_LIST_DIALOG 116
#define IDD_DIALOG_CHOOSECOLOR 117
#define IDI_ICON_MOVEDOWN 119
#define IDI_ICON_MOVEUP 122
#define IDB_BITMAP_CHOOSECOLOR 124
#define IDI_TGM_DLGBAR_ICON 125
#define IDD_DIALOG_LISTPRELOADGMT 126
#define IDC_RADIO_GOURAUD 1001
#define IDC_RADIO_FLAT 1002
#define IDC_CHECK_TRANS 1003
#define IDC_CHECK1 1004
#define IDC_CHECK3 1005
#define IDC_EDIT_SPECEXP 1006
#define IDC_CHECK4 1007
#define IDC_SPIN_SPECEXP 1008
#define IDC_CHECK5 1009
#define IDC_CHECK6 1010
#define IDC_CHECK7 1011
#define IDC_CHECK8 1012
#define IDC_CHECK9 1013
#define IDC_BUTTON_VISUEL 1014
#define IDC_CHECK10 1015
#define IDC_CHECK11 1016
#define IDC_BUTTON_DIFFUSE 1017
#define IDC_CHECK12 1018
#define IDC_BUTTON_AMBIENT 1019
#define IDC_CHECK13 1020
#define IDC_BUTTON_SPECULAR 1021
#define IDC_CHECK14 1022
#define IDC_CHECK15 1023
#define IDC_CHECK16 1024
#define IDC_BUTTON_REFRESH 1025
#define IDC_BUTTON_NEW 1026
#define IDC_BUTTON_COPY 1027
#define IDC_CHECK2 1028
#define IDC_BUTTON_DELETE 1029
#define IDC_CHECK_DISABLE_COLLISIONS 1030
#define IDC_EDIT_NAME 1031
#define IDC_CHECK_TEXTURE 1032
#define IDC_CHECK_GOURAUD 1033
#define IDC_EDIT_NAME1 1034
#define IDC_CHECK_BACKFACE 1034
#define IDC_EDIT_NAME2 1035
#define IDC_EDIT_NAME3 1036
#define IDC_EDIT_NAME4 1037
#define IDC_EDIT_NAME5 1038
#define IDC_CHECK_DISABLE_MECHANICS 1039
#define IDC_EDIT_NAME6 1040
#define IDC_EDIT_NAME7 1041
#define IDC_SLIDER_ABSORPTION 1042
#define IDC_EDIT_NAME8 1043
#define IDC_SLIDER_REBOUND 1044
#define IDC_EDIT_NAME9 1045
#define IDC_SLIDER_PENETRATION_SPEED 1046
#define IDC_EDIT_NAME10 1047
#define IDC_SLIDER_SLIDE 1048
#define IDC_EDIT_NAME11 1049
#define IDC_SLIDER_ADHESION 1050
#define IDC_EDIT_NAME12 1051
#define IDC_SLIDER_PENETRATION_MAX 1052
#define IDC_EDIT_NAME13 1053
#define IDC_SLIDER_PROGRESSION 1054
#define IDC_EDIT_NAME14 1055
#define IDC_EDIT_NAME15 1056
#define IDC_EDIT_NAME16 1057
#define IDC_EDIT_ABSORPTION 1058
#define IDC_EDIT_FRICTION 1059
#define IDC_CHECK_LOCK_NAMES 1060
#define IDC_EDIT_SLIDE 1061
#define IDC_BUTTON_SAVE_NAMES 1062
#define IDC_EDIT_ADHESION 1063
#define IDC_CHECK_DISABLE_SOUND 1064
#define IDC_EDIT_PROGRESSION 1065
#define IDC_BUTTON_COPYMECA 1066
#define IDC_EDIT_PENETRATION_SPEED 1067
#define IDC_EDIT_PENETRATION_MAX 1068
#define IDC_BUTTON_SET_DEFAULT 1069
#define IDC_BUTTON_PASTEMECA 1070
#define IDC_BUTTON_INSTANCIATEMECA 1071
#define IDC_BUTTON_RENAMEMECA 1072
#define IDC_CHECK_SOUND_DESCRIPTION 1073
#define IDC_BUTTON_COPYCOL 1074
#define IDC_BUTTON_PASTECOL 1075
#define IDC_BUTTON_INSTANCIATECOL 1076
#define IDC_BUTTON_RENAMECOL 1077
#define IDC_COMBO_TYPE 1078
#define IDC_STATIC_TYPE 1079
#define IDC_RADIO_NO_COLLISION 1080
#define IDC_BUTTON_COPYSOUND 1081
#define IDC_RADIO_ZDR 1082
#define IDC_BUTTON_PASTESOUND 1083
#define IDC_RADIO_ZDE 1084
#define IDC_BUTTON_INSTANCIATESOUND 1085
#define IDC_RADIO_ZDM 1086
#define IDC_STATIC_NAME 1087
#define IDC_EDIT_COLMATNAME 1088
#define IDC_EDIT_MECMATNAME 1089
#define IDC_COMBO_TYPE_COLLISION 1090
#define IDC_STATIC_FILE 1091
#define IDC_COMBO_TYPE_COLLISION2 1092
#define IDC_COMBO_ELEMENT_TYPE 1093
#define IDC_COMBO_FILE 1094
#define IDC_STATIC_Absorption 1095
#define IDC_STATIC_Friction 1096
#define IDC_STATIC_Slide 1097
#define IDC_STATIC_Adhesion 1098
#define IDC_STATIC_Progression 1099
#define IDC_STATIC_PenetrationSpeed 1100
#define IDC_STATIC_PenetrationMax 1101
#define IDC_COMBO_MECMATNAME 1102
#define IDC_COMBO_COLMATNAME 1103
#define IDC_CHECK_HIGHLIGHT 1104
#define IDC_BUTTON_HIGHLIGHTCOLOR 1105
#define IDC_EDIT_HORIZONTALSCROLL 1106
#define IDC_EDIT_VERTICALSCROLL 1107
#define IDC_STATIC_Rebound 1107
#define IDC_CHECK_CHROME 1108
#define IDC_STATIC_Slide1 1108
#define IDC_BUTTON_PRIORITY 1109
#define IDC_BUTTON_QUALITYLEVEL 1110
#define IDC_CHECK_HORIZONTALTILE 1111
#define IDC_CHECK_VERTICALTILE 1112
#define IDC_BUTTON_MIPMAPPING 1113
#define IDC_EDIT_CHROMAKEYALPHA 1114
#define IDC_BUTTON_CHROMAKEYCOLOR 1115
#define IDC_BUTTON_SUPPLYTEXTURE 1116
#define IDC_CHECK_HORIZONTALFILTERING 1117
#define IDC_CHECK_VERTICALFILTERING 1118
#define IDC_CHECK_DEPTHFILTERING 1119
#define IDC_BUTTON_PURGE 1120
#define IDC_BUTTON_PIXELCOLOR 1120
#define IDC_CHECK_ALPHASENSITIVE 1121
#define IDC_BUTTON_COLOR 1122
#define IDC_SLIDER_ALPHA 1123
#define IDC_EDIT_RED 1124
#define IDC_EDIT_GREEN 1125
#define IDC_EDIT_BLUE 1126
#define IDC_EDIT_ALPHA 1127
#define IDC_COMBO_ANIMATEDTEXTURES 1128
#define IDC_SLIDER_BLUE 1129
#define IDC_BUTTON_ADDANIMATED 1130
#define IDC_SLIDER_GREEN 1131
#define IDC_BUTTON_REMOVEANIMATED 1132
#define IDC_SLIDER_RED 1133
#define IDC_BUTTON_MOVEUP 1134
#define IDC_BUTTON_MOVEDOWN 1135
#define IDC_EDIT_DURATION 1136
#define IDC_CHECK_AUTOSCROLL 1137
#define IDC_CHECK_BASE_MECHANIC 1138
#define IDC_SLIDER_FRICTION 1139
#define IDC_SLIDER_SLIDE1 1140
#define IDC_EDIT_REBOUND 1141
#define IDC_EDIT_SLIDE1 1142
#define IDC_TEXTURE_COLOR 1142
#define IDC_BUTTON_LOADGMT 1143
#define IDC_BUTTON_UNLOADGMT 1144
#define IDC_LIST_GMT 1145
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 127
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1146
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@@ -0,0 +1,308 @@
//
/*=============================================================================
*
* Filename: CMatObj.cpp
* Version: 1.0
* Date: 06/11/96
* Author: B.G.
*
* Description: implementation of editor material class
*
*===========================================================================*/
#include "stdafx.h"
#include "Acp_base.h"
#include "itf.h"
#include "gmt.h"
#include "IncMEC.h"
#include "gli.h"
#include "x:\cpa\main\inc\_editid.h"
#include "inctex.h"
#include "_interf.hpp"
#include "CMatObj.hpp"
#include "GMatObj.hpp"
extern Material_Interface *gs_p_oMaterialInterface;
//=================================================================================
//=================================================================================
//=================================================================================
//constructor. the object is name with the following rules
//1. it is not a clone but will directly handle the engine material
// -> will take the name from the section for the engine material
//2. it is a clone, and a name is specified
// -> an underscore is added to the original's name,
// because someday the base constructor will add a number there
//3. it is a clone, and no name is specified
// -> the default name is given by the base constructor
//=================================================================================
tdoEditorCollideMaterial::tdoEditorCollideMaterial(
CPA_FileObject *_p_oOwnerFile,
CString _csId,
BOOL _bSectionAlreadyExists,
GMT_tdxHandleToCollideMaterial _hTemplateCollideMaterial
)
: CPA_SaveObject(
gs_p_oMaterialInterface, //editor
C_szCollideMaterialTypeName, //type
E_ss_Responsible, //responsibility
_p_oOwnerFile, //owner (there is none)
FALSE, //available
(char*)LPCTSTR(_p_oOwnerFile->GetCompletionPath(gs_p_oMaterialInterface, C_szFileReferencedNameKey)), //data path to complete the referenced section name
m_vCallBackSaveCMT//callback
)
{
//tell the file object that an object exists for its section
g_oCoherenceManager.m_fn_vAddALink(_p_oOwnerFile, this);
m_hCollideMaterial = _hTemplateCollideMaterial;
SetAvailable(_hTemplateCollideMaterial != GMT_C_InvalidCollideMaterial);
// construct section name (hack: szSectionName is here as an anti-bug for ...Split...
char szSectionName[SCR_CV_ui_Cfg_MaxLenName];
SCR_fn_v_RdL0_ComputeSectionName(
szSectionName,
(char*)LPCTSTR(_p_oOwnerFile->GetReferencedName(gs_p_oMaterialInterface, C_szFileReferencedNameKey)),
C_SectionCollideMaterial,
(char*)LPCTSTR(_csId)
);
// section object
SetSectionData(this) ;
SetReferencedSectionName(szSectionName) ;
// name
if ( fn_eRename(_csId) != E_mc_None )
SetDefaultValidName() ;
fn_vUpdateSectionName() ;
if ( _bSectionAlreadyExists )
fn_vSectionSaved(); //the section is saved, and has no pending notification
else
fn_vSectionDeleted(); //the section does not exist, and has no pending nofitication
if ( fn_bCanBeNotified() && !fn_bSectionExists() )
fn_vNotifySave();
m_bIsHighlighted = FALSE;
m_stHighlightColor.xR = (GEO_tdxColorValue) 0.7;
m_stHighlightColor.xG = (GEO_tdxColorValue) 0.3;
m_stHighlightColor.xB = (GEO_tdxColorValue) 0.0;
}
//=================================================================================
//=================================================================================
tdoEditorCollideMaterial::~tdoEditorCollideMaterial()
{
//remove myself totally from the coherence manager database
if ( !fn_bSectionExists() )
g_oCoherenceManager.m_fn_vRemoveAllLinks(this, C_cLinkedAsChild);
}
//=================================================================================
//=================================================================================
void tdoEditorCollideMaterial::m_vAssociateEngineMaterial(GMT_tdxHandleToCollideMaterial _hCollideMaterial, BOOL /*_bSectionAlreadyExists*/)
{
//make the list update the data sort order
fn_vUpdateData(_hCollideMaterial);
//now we can set the value that will be returned by GetData()
m_hCollideMaterial = _hCollideMaterial;
SetAvailable(_hCollideMaterial != GMT_C_InvalidCollideMaterial);
}
//================================================================================
//================================================================================
BOOL tdoEditorCollideMaterial::m_bIsReferenced()
{
return g_oCoherenceManager.m_fn_iGetFatherCount(this) > 1;
}
//=================================================================================
//=================================================================================
void tdoEditorCollideMaterial::m_vLoadAssociatedEngineMaterial()
{
if ( !fn_bIsAvailable() )
{
//if the section name is not in the linktable, analyse the section
SCR_tdst_Cxt_Values *p_stAnalyzeResult = SCR_fnp_st_RdL0_AnalyseSection(
(char *) LPCTSTR(GetReferencedSectionName()),
SCR_CDF_uw_Anl_Normal
);
GMT_tdxHandleToCollideMaterial hCollideMaterial = (GMT_tdxHandleToCollideMaterial) p_stAnalyzeResult->a_ulValues[0];
//there must not already exist an editor material for the loaded game material!
ASSERT(!gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hCollideMaterial));
//create the association
m_vAssociateEngineMaterial(hCollideMaterial, TRUE);
}
}
/*=================================================================================
//save a section of the form:
{CollideMaterial:<name>
Type(2)
Identifier(3)
}
//=================================================================================*/
void tdoEditorCollideMaterial::m_vCallBackSaveCMT(
SCR_tdst_File_Description *_p_stFile,
char *_p_szSectionName,
void *_p_vData,
SCR_tde_Ntfy_Action _eAction
)
{
tdoEditorCollideMaterial *p_oEditorMaterial = (tdoEditorCollideMaterial *) _p_vData;
if ( _eAction == SCR_EA_Ntfy_DeleteSection )
//now the section exists, if this was not the case
p_oEditorMaterial->fn_vSectionDeleted(); //the section does not exist, and has no pending nofitication
if ( _eAction != SCR_EA_Ntfy_AddSection && _eAction != SCR_EA_Ntfy_RebuildSection )
return;
if ( _eAction == SCR_EA_Ntfy_AddSection )
{
// go to end of file (we need all file directive to load this section)
SCR_fn_v_SvL1_ToEndSection(_p_stFile);
SCR_M_SvL0_SaveBlankLine (_p_stFile);
}
char szSectionName[SCR_CV_ui_Cfg_MaxLenName],szAction[SCR_CV_ui_Cfg_MaxLenName],szId[SCR_CV_ui_Cfg_MaxLenName];
// construct section name (hack: szSectionName is here as an anti-bug for ...Split...
SCR_fn_v_RdL0_SplitSectionName(_p_szSectionName, szSectionName, szAction, szId);
SCR_fn_v_RdL0_ComputeSectionName(szSectionName, NULL, szAction, szId);
// save begin section for the game material
SCR_M_SvL0_SaveBeginSection(_p_stFile, szSectionName, SCR_CC_C_Cfg_EOL);
//get the parameters we want to save
GMT_tdxHandleToCollideMaterial hMaterialCollide = p_oEditorMaterial->m_hGetEngineMaterial();
short wType, wIdentifier;
wType = GMT_fn_wGetTypeOfCollideMaterial(hMaterialCollide);
char *pszType = GMT_C_szZDE;
switch ( wType )
{
case GMT_C_wZDM:
pszType = GMT_C_szZDM;
break;
case GMT_C_wZDR:
pszType = GMT_C_szZDR;
break;
case GMT_C_wZDE:
pszType = GMT_C_szZDE;
break;
case GMT_C_wZDD:
pszType = GMT_C_szZDD;
break;
}
wIdentifier = GMT_fn_hGetCollideMaterialIdentifier(hMaterialCollide);
SCR_M_SvL0_SaveEntry(_p_stFile, C_EntryCollideMaterial, SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(
_p_stFile,
SCR_EF_SvL0_Scanf, 3, "%s,%hd",
pszType, wIdentifier
);
// End Section
SCR_M_SvL0_SaveEndSection(_p_stFile, SCR_CC_C_Cfg_EOL);
//now the section exists, if this was not the case
p_oEditorMaterial->fn_vSectionSaved(); // the section is saved and has no pending notification
}
//=================================================================================
//=================================================================================
BOOL tdoEditorCollideMaterial::m_bGetHighlightColor(GEO_tdstColor *_p_stColor /*= NULL*/)
{
if ( m_bIsHighlighted && _p_stColor )
*_p_stColor = m_stHighlightColor;
return m_bIsHighlighted;
}
//=================================================================================
//=================================================================================
void tdoEditorCollideMaterial::m_vSetHighlightColor(GEO_tdstColor _stColor)
{
m_stHighlightColor = _stColor;
}
//=================================================================================
//=================================================================================
//=================================================================================
// static functions for the class
//=================================================================================
//=================================================================================
//=================================================================================
SCR_tdst_Link_Table *tdoEditorCollideMaterial::m_p_stGetAssociatedLinkTable()
{
return GMT_fn_p_stGetZoneLinkTable();
}
BOOL tdoEditorCollideMaterial::m_bIsEngineMaterialValid(GMT_tdxHandleToCollideMaterial _hCollideMaterial)
{
return _hCollideMaterial != GMT_C_InvalidCollideMaterial;
}
/*CString tdoEditorCollideMaterial::m_csGetBaseDataPath()
{
return fn_szGetCollideMaterialDataPath();
}*/
void tdoEditorCollideMaterial::m_vInvalidateEngineMaterial(GMT_tdxHandleToCollideMaterial &r_hCollideMaterial)
{
r_hCollideMaterial = GMT_C_InvalidCollideMaterial;
}
CString tdoEditorCollideMaterial::m_csGetMaterialType()
{
return C_szCollideMaterialTypeName;
}
CString tdoEditorCollideMaterial::m_csGetScriptExtension()
{
return ".cmt";
}
//ROMTEAM WorldEditor (Cristi Petrescu 11/12/97)
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Method : word tdoEditorCollideMaterial::m_uwTypeOfZonesUsingMe (void)
// Date : 97.12.11
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Description :
// Tells which zone types are using this material
// The result is a word of bit flags
// Uses the coherence manager to find the objects using the material
// Author : Cristi Petrescu
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Modification :
// Date :
// By :
//////////////////////////////////////////////////////////////////////////////////////////////////////
WORD tdoEditorCollideMaterial::m_uwTypeOfZonesUsingMe (void)
{
CList< CPA_BaseObject *, CPA_BaseObject *> oFatherList;
int iNoObjects;
WORD uwResult = 0;
iNoObjects = g_oCoherenceManager . m_fn_iGetFatherList (this, & oFatherList);
if (iNoObjects)
{
POSITION xPos;
CPA_BaseObject* poBaseObject;
for ( xPos=oFatherList.GetHeadPosition(); xPos; oFatherList.GetNext(xPos) )
{
poBaseObject = oFatherList.GetAt (xPos);
if (poBaseObject -> fn_bIsOfType (C_szGameMaterialTypeName))
uwResult |= ((tdoEditorGameMaterial *) poBaseObject) -> m_uwTypeOfZonesUsingMe ();
}
}
return uwResult;
}
//ENDROMTEAM WorldEditor (Cristi Petrescu)

View File

@@ -0,0 +1,81 @@
/*=============================================================================
*
* Filename: CMatObj.hpp
* Version: 1.0
* Date: 06/11/96
* Author: B.G.
*
* Description: editor material class
*
*===========================================================================*/
#ifndef __CMATOBJ_HPP__
#define __CMATOBJ_HPP__
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
#include <afxtempl.h>
#include <afxcview.h>
#include "Acp_base.h"
#include "itf.h"
#include "gmt.h"
#include "scr.h"
#include "dpt.h"
#include "x:\cpa\main\inc\_editid.h"
class tdoEditorCollideMaterial : public CPA_SaveObject
{
public:
tdoEditorCollideMaterial(
CPA_FileObject *_p_oOwnerFile,
CString _csId,
BOOL _bSectionAlreadyExists,
GMT_tdxHandleToCollideMaterial _hTemplateCollideMaterial
);
~tdoEditorCollideMaterial();
GMT_tdxHandleToCollideMaterial m_hGetEngineMaterial() { return m_hCollideMaterial; }
static void m_vCallBackSaveCMT( // save the visual material section
SCR_tdst_File_Description *_p_stFile,
char *_p_szSectionName,
void *_p_vData,
SCR_tde_Ntfy_Action _eAction
);
void m_vAssociateEngineMaterial(GMT_tdxHandleToCollideMaterial _hCollideMaterial, BOOL _bSectionAlreadyExists);
BOOL m_bIsReferenced();
void m_vLoadAssociatedEngineMaterial();
BOOL m_bGetHighlightColor(GEO_tdstColor *_p_stColor = NULL);
void m_vSetHighlightColor(GEO_tdstColor _stColor);
void m_vEnableHighlight(BOOL _bEnable = TRUE) { m_bIsHighlighted = _bEnable; }
static SCR_tdst_Link_Table *m_p_stGetAssociatedLinkTable();
static BOOL m_bIsEngineMaterialValid(GMT_tdxHandleToCollideMaterial _hCollideMaterial);
//static CString m_csGetBaseDataPath();
static void m_vInvalidateEngineMaterial(GMT_tdxHandleToCollideMaterial &r_hCollideMaterial);
static CString m_csGetMaterialType();
static CString m_csGetScriptExtension();
//overloads from base class
virtual void *GetData(void) { return m_hCollideMaterial; }
virtual long GetDataType(void) { return 0; };
virtual tdeMissingCriteria fn_eCheckUnicity(const CString csNewName) { return fn_eCheckUnicityWithOwner(csNewName); }
//virtual void fn_vNotify(SCR_tde_Ntfy_Action _eAction);
//CString GetReferencedSectionName(void);
//ROMTEAM WorldEditor (Cristi Petrescu 11/12/97)
WORD m_uwTypeOfZonesUsingMe (void);
//ENDROMTEAM WorldEditor (Cristi Petrescu)
private:
GMT_tdxHandleToCollideMaterial m_hCollideMaterial;
BOOL m_bIsHighlighted;
GEO_tdstColor m_stHighlightColor;
};
#endif /* __CMATOBJ_HPP__ */

View File

@@ -0,0 +1,283 @@
/*=========================================================================
File Name: COPYPASTE.CPP
Purpose:
Implements tdoCopyBuffer, tdoPasteSubMaterialModif and tdoInstanciateSubMaterialModif classes
Author: Benoit Germain
Date: June 1997
==========================================================================*/
#include "stdafx.h"
#include "Acp_Base.h"
#include "itf.h"
#include "gmt.h"
#include "GMatObj.hpp"
#include "CopyPaste.hpp"
#include "inctex.h"
#include "_interf.hpp"
#include "diameca.hpp"
#include "diacol.hpp"
#include "diasound.hpp"
extern Material_Interface *gs_p_oMaterialInterface;
/*=========================================================================
implementation of tdoCopyBuffer
==========================================================================*/
void tdoCopyBuffer::m_vInvalidateAllHandlesAtConstruct()
{
m_eType = E_cbt_None;
DNM_fn_vInvalidateMatCharacteristics(&m_hMechanicsMaterialToPaste);
m_hCollideMaterialToPaste = GMT_C_InvalidCollideMaterial;
m_hSoundMaterialToPaste = GMT_C_InvalidSoundMaterial;
}
/*=========================================================================
==========================================================================*/
tdoCopyBuffer::tdoCopyBuffer(DNM_tdxHandleToMecMatCharacteristics _hMechanicsMaterial)
{
m_vInvalidateAllHandlesAtConstruct();
m_eType = E_cbt_Mechanics;
//create a copy of the material for paste operations
m_hMechanicsMaterialToPaste = DNM_fn_xMatCharacteristicsCreate();
if ( DNM_fn_bIsMatCharacteristicsValid(_hMechanicsMaterial) )
DNM_fn_vMatCharacteristicsCopy(m_hMechanicsMaterialToPaste, _hMechanicsMaterial);
}
tdoCopyBuffer::tdoCopyBuffer(GMT_tdxHandleToCollideMaterial _hCollideMaterial)
{
m_vInvalidateAllHandlesAtConstruct();
m_eType = E_cbt_Collide;
//create a copy of the material for paste operations
m_hCollideMaterialToPaste = GMT_fn_hCreateCollideMaterial();
if ( _hCollideMaterial != GMT_C_InvalidCollideMaterial )
GMT_fn_vCopyCollideMaterial(m_hCollideMaterialToPaste, _hCollideMaterial);
}
tdoCopyBuffer::tdoCopyBuffer(SND_tdxHandleToSoundMaterial _hSoundMaterial)
{
m_vInvalidateAllHandlesAtConstruct();
m_eType = E_cbt_Sound;
//create a copy of the material for paste operations
m_hSoundMaterialToPaste = _hSoundMaterial;
}
/*=========================================================================
==========================================================================*/
tdoCopyBuffer::~tdoCopyBuffer()
{
//destroy the buffers we created for copy
//mechanics
if ( DNM_fn_bIsMatCharacteristicsValid(m_hMechanicsMaterialToPaste) )
{
DNM_fn_vMatCharacteristicsDestroy(m_hMechanicsMaterialToPaste);
DNM_fn_vInvalidateMatCharacteristics(&m_hMechanicsMaterialToPaste);
}
//collide
if ( m_hCollideMaterialToPaste != GMT_C_InvalidCollideMaterial )
{
GMT_fn_vDestroyCollideMaterial(&m_hCollideMaterialToPaste);
}
//sound
m_hSoundMaterialToPaste = GMT_C_InvalidSoundMaterial;
}
/*=========================================================================
==========================================================================*/
BOOL tdoCopyBuffer::m_bDoPaste(
GMT_tdxHandleToGameMaterial _hTargetGameMaterial
)
{
switch ( m_eType )
{
case E_cbt_Mechanics:
{
//get the mechanics material of the target game material
DNM_tdxHandleToMecMatCharacteristics hTargetMechanicsMaterial;
hTargetMechanicsMaterial = GMT_fn_hGetMechanicsMaterial(_hTargetGameMaterial);
//and copy the contents of the source
DNM_fn_vMatCharacteristicsCopy(hTargetMechanicsMaterial, m_hMechanicsMaterialToPaste);
}
break;
case E_cbt_Collide:
{
//get the collide material of the target game material
GMT_tdxHandleToCollideMaterial hTargetCollideMaterial;
hTargetCollideMaterial = GMT_fn_hGetCollideMaterial(_hTargetGameMaterial);
//and copy the contents of the source
GMT_fn_vCopyCollideMaterial(hTargetCollideMaterial, m_hCollideMaterialToPaste);
}
break;
case E_cbt_Sound:
GMT_fn_vSetSoundMaterial(_hTargetGameMaterial, m_hSoundMaterialToPaste);
break;
default:
ASSERT(FALSE);
return FALSE;
}
return TRUE;
}
/*=========================================================================
==========================================================================*/
/*=========================================================================
implementation of tdoPasteSubMaterialModif class
==========================================================================*/
/*=========================================================================
==========================================================================*/
tdoPasteSubMaterialModif::tdoPasteSubMaterialModif(tdoCopyBuffer *_p_oCopyBuffer)
: CPA_Modif(0, "")
{
m_hTargetGameMaterial = gs_p_oMaterialInterface->m_p_oGetEditedMaterial()->m_hGetEngineMaterial();
m_p_oCopyBufferForDo = _p_oCopyBuffer;
switch ( _p_oCopyBuffer->m_eGetType() )
{
case E_cbt_Mechanics:
{
//create a copy buffer which contains the submaterial info of the target material
DNM_tdxHandleToMecMatCharacteristics hTargetMechanicsMaterial;
hTargetMechanicsMaterial = GMT_fn_hGetMechanicsMaterial(m_hTargetGameMaterial);
m_p_oCopyBufferForUndo = new tdoCopyBuffer(hTargetMechanicsMaterial);
SetName("Mechanics Material Paste");
}
break;
case E_cbt_Collide:
{
//create a copy buffer which contains the submaterial info of the target material
GMT_tdxHandleToCollideMaterial hTargetCollideMaterial;
hTargetCollideMaterial = GMT_fn_hGetCollideMaterial(m_hTargetGameMaterial);
m_p_oCopyBufferForUndo = new tdoCopyBuffer(hTargetCollideMaterial);
SetName("Collide Material Paste");
}
break;
case E_cbt_Sound:
{
//create a copy buffer which contains the submaterial info of the target material
SND_tdxHandleToSoundMaterial hTargetSoundMaterial;
hTargetSoundMaterial = GMT_fn_hGetSoundMaterial(m_hTargetGameMaterial);
m_p_oCopyBufferForUndo = new tdoCopyBuffer(hTargetSoundMaterial);
SetName("Sound Material Paste");
}
break;
default:
ASSERT(FALSE);
break;
}
}
/*=========================================================================
==========================================================================*/
tdoPasteSubMaterialModif::~tdoPasteSubMaterialModif()
{
delete m_p_oCopyBufferForUndo;
//do not delete the Do() buffer if we are not done, because the dialog
//may use it again...
if ( HasBeenDone() )
delete m_p_oCopyBufferForDo;
}
/*=========================================================================
==========================================================================*/
BOOL tdoPasteSubMaterialModif::Do()
{
if ( m_p_oCopyBufferForDo->m_bDoPaste(m_hTargetGameMaterial) )
{
tdoEditorGameMaterial *p_oTargetGameMaterial = (tdoEditorGameMaterial *)
gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(m_hTargetGameMaterial);
//if the edited material is the submaterial's owner game material, update display
switch ( m_p_oCopyBufferForDo->m_eGetType() )
{
case E_cbt_Mechanics:
gs_p_oMaterialInterface->m_p_oGetMecaView()->m_p_oCopyBuffer = NULL;
if ( gs_p_oMaterialInterface->m_p_oGetEditedMaterial() == p_oTargetGameMaterial )
gs_p_oMaterialInterface->m_p_oGetMecaView()->m_fn_vShowMaterial(m_hTargetGameMaterial);
//tell the editor object responsible for the submaterial that it has to be saved
DNM_tdxHandleToMecMatCharacteristics hTargetMechanicsMaterial;
hTargetMechanicsMaterial = GMT_fn_hGetMechanicsMaterial(m_hTargetGameMaterial);
gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hTargetMechanicsMaterial)->fn_vNotifySave();
break;
case E_cbt_Collide:
gs_p_oMaterialInterface->m_p_oGetCollView()->m_p_oCopyBuffer = NULL;
if ( gs_p_oMaterialInterface->m_p_oGetEditedMaterial() == p_oTargetGameMaterial )
gs_p_oMaterialInterface->m_p_oGetCollView()->m_fn_vShowMaterial(m_hTargetGameMaterial);
//tell the editor object responsible for the submaterial that it has to be saved
GMT_tdxHandleToCollideMaterial hTargetCollideMaterial;
hTargetCollideMaterial = GMT_fn_hGetCollideMaterial(m_hTargetGameMaterial);
gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hTargetCollideMaterial)->fn_vNotifySave();
break;
case E_cbt_Sound:
gs_p_oMaterialInterface->m_p_oGetSoundView()->m_p_oCopyBuffer = NULL;
if ( gs_p_oMaterialInterface->m_p_oGetEditedMaterial() == p_oTargetGameMaterial )
gs_p_oMaterialInterface->m_p_oGetSoundView()->m_fn_vShowMaterial(m_hTargetGameMaterial);
//tell the editor object responsible for the submaterial that it has to be saved
//SND_tdxHandleToSoundMaterial hTargetSoundMaterial; //until sound materials need an editor object...
//hTargetSoundMaterial = GMT_fn_hGetSoundMaterial(m_hTargetGameMaterial);
//gs_p_oMaterialInterface->m_p_oGetEditorSoundMaterialForEngine(hTargetsoundMaterial)->fn_vNotifySave();
break;
default:
ASSERT(FALSE);
return FALSE;
}
}
return TRUE;
}
/*=========================================================================
==========================================================================*/
BOOL tdoPasteSubMaterialModif::Undo()
{
if ( m_p_oCopyBufferForUndo->m_bDoPaste(m_hTargetGameMaterial) )
{
tdoEditorGameMaterial *p_oTargetGameMaterial = (tdoEditorGameMaterial *)
gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(m_hTargetGameMaterial);
//if the edited material is the submaterial's owner game material, update display
//note that the paste operation already marked the materials for save, so it is not necessary
//to notify the change again
switch ( m_p_oCopyBufferForDo->m_eGetType() )
{
case E_cbt_Mechanics:
gs_p_oMaterialInterface->m_p_oGetMecaView()->m_p_oCopyBuffer = m_p_oCopyBufferForDo;
if ( gs_p_oMaterialInterface->m_p_oGetEditedMaterial() == p_oTargetGameMaterial )
gs_p_oMaterialInterface->m_p_oGetMecaView()->m_fn_vShowMaterial(m_hTargetGameMaterial);
break;
case E_cbt_Collide:
gs_p_oMaterialInterface->m_p_oGetCollView()->m_p_oCopyBuffer = m_p_oCopyBufferForDo;
if ( gs_p_oMaterialInterface->m_p_oGetEditedMaterial() == p_oTargetGameMaterial )
gs_p_oMaterialInterface->m_p_oGetCollView()->m_fn_vShowMaterial(m_hTargetGameMaterial);
break;
case E_cbt_Sound:
gs_p_oMaterialInterface->m_p_oGetSoundView()->m_p_oCopyBuffer = m_p_oCopyBufferForDo;
if ( gs_p_oMaterialInterface->m_p_oGetEditedMaterial() == p_oTargetGameMaterial )
gs_p_oMaterialInterface->m_p_oGetSoundView()->m_fn_vShowMaterial(m_hTargetGameMaterial);
break;
default:
ASSERT(FALSE);
return FALSE;
}
}
return FALSE;
}

View File

@@ -0,0 +1,65 @@
/*===========================================================================
Class Name: tdoCopyBuffer
Used for: Copy/Paste
Author: Yann Le Tensorer
Date: may 5, 1997
============================================================================*/
#if !defined ( __COPYPASTE_HPP__ )
#define __COPYPASTE_HPP__
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
class CPA_Modif;
typedef enum tdeCopyBufferType_
{
E_cbt_None,
E_cbt_Mechanics,
E_cbt_Collide,
E_cbt_Sound
} tdeCopyBufferType;
//=================================================================================
//=================================================================================
class tdoCopyBuffer
{
public:
tdoCopyBuffer(DNM_tdxHandleToMecMatCharacteristics _hMechanicsMaterial);
tdoCopyBuffer(GMT_tdxHandleToCollideMaterial _hCollideMaterial);
tdoCopyBuffer(SND_tdxHandleToSoundMaterial _hSoundMaterial);
~tdoCopyBuffer();
BOOL m_bDoPaste(GMT_tdxHandleToGameMaterial _hTargetGameMaterial);
tdeCopyBufferType m_eGetType() { return m_eType; }
//ROMTEAM WorldEditor (Cristi Petrescu 22/12/97)
GMT_tdxHandleToCollideMaterial m_hGetCollideMaterial (void) {return m_hCollideMaterialToPaste;};
//ENDROMTEAM WorldEditor (Cristi Petrescu)
private:
void m_vInvalidateAllHandlesAtConstruct();
tdeCopyBufferType m_eType;
DNM_tdxHandleToMecMatCharacteristics m_hMechanicsMaterialToPaste;
GMT_tdxHandleToCollideMaterial m_hCollideMaterialToPaste;
SND_tdxHandleToSoundMaterial m_hSoundMaterialToPaste;
};
//=================================================================================
//=================================================================================
class tdoPasteSubMaterialModif : public CPA_Modif
{
public:
tdoPasteSubMaterialModif(tdoCopyBuffer *_p_oCopyBuffer);
~tdoPasteSubMaterialModif();
BOOL Do();
BOOL Undo();
private:
GMT_tdxHandleToGameMaterial m_hTargetGameMaterial;
tdoCopyBuffer *m_p_oCopyBufferForDo, *m_p_oCopyBufferForUndo;
};
#endif /* __COPYPASTE_HPP__ */

View File

@@ -0,0 +1,927 @@
// diatext.cpp : implementation file
//
#include "stdafx.h"
#include "Acp_Base.h"
#define HieFriend
#include "incgli.h"
#include "inctex.h"
#include "_interf.hpp"
#include "GMatObj.hpp"
#include "VMatObj.hpp"
#include "diatext.hpp"
#include "DiaView.hpp"
#include "TextureDlg.h"
#include "TexObj.hpp"
#include "choosecolor.hpp"
#include "MatList.hpp"
#include "x:\cpa\main\inc\_editid.h"
#include "TUT.h"
#define C_szDurationStringFormat "%6.2f"
extern Material_Interface *gs_p_oMaterialInterface;
static BOOL g_sModalLoop = FALSE;
/////////////////////////////////////////////////////////////////////////////
// DiaMain dialog
IMPLEMENT_DYNCREATE(DiaText, CFormView)
DiaText::DiaText()
: CFormView(DiaText::IDD)
{
m_hEditedTexture = NULL;
m_bDisplaySupplyTexture = FALSE;
m_lAnimatedTextureIndex = -1;
m_nRPixelColor = 0;
m_nGPixelColor = 0;
m_nBPixelColor = 0;
//{{AFX_DATA_INIT(DiaText)
//}}AFX_DATA_INIT
}
void DiaText::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DiaText)
//}}AFX_DATA_MAP
}
DiaText::~DiaText()
{
m_oMemDC.SelectObject(m_p_oPreviousSelectedBitmap);
m_oMemBitmap.DeleteObject();
m_oMemDC.DeleteDC();
}
BEGIN_MESSAGE_MAP(DiaText, CFormView)
//{{AFX_MSG_MAP(DiaText)
ON_WM_CREATE()
ON_WM_DRAWITEM()
ON_BN_CLICKED(IDC_BUTTON_VISUEL, OnButtonVisuel)
ON_BN_CLICKED(IDC_BUTTON_PRIORITY, OnButtonPriority)
ON_BN_CLICKED(IDC_BUTTON_QUALITYLEVEL, OnButtonQualityLevel)
ON_BN_CLICKED(IDC_CHECK_HORIZONTALTILE, OnCheckTile)
ON_BN_CLICKED(IDC_BUTTON_CHROMAKEYCOLOR, OnButtonChromakeyColor)
ON_BN_CLICKED(IDC_CHECK_HORIZONTALFILTERING, OnCheckFilter)
ON_BN_CLICKED(IDC_BUTTON_SUPPLYTEXTURE, OnButtonSupplyTexture)
ON_EN_KILLFOCUS(IDC_EDIT_DURATION, OnKillFocusEditDuration)
ON_WM_RBUTTONDOWN()
ON_WM_LBUTTONDOWN()
ON_BN_CLICKED(IDC_CHECK_VERTICALTILE, OnCheckTile)
ON_BN_CLICKED(IDC_CHECK_VERTICALFILTERING, OnCheckFilter)
ON_BN_CLICKED(IDC_CHECK_DEPTHFILTERING, OnCheckFilter)
ON_BN_CLICKED(IDC_BUTTON_PIXELCOLOR, OnButtonPixelcolor)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DiaText message handlers
//==================================================================================================
//==================================================================================================
int DiaText::OnToolHitTest(CPoint point, TOOLINFO* pTI) const
{
CString csMessage;
switch ( CWnd::OnToolHitTest(point, pTI) )
{
default:
csMessage = "???????????????????????????????????????????????????????????";
break;
//Mircea Dunka 04.11.98
case IDC_BUTTON_PIXELCOLOR:
csMessage = "color picked from scene (click to set chromakey)";
break;
//end Mircea Dunka
case IDC_STATIC:
csMessage = "";
break;
case IDC_EDIT_DURATION:
csMessage = "set the duration in seconds that the current texture will be displayed";
break;
case IDC_BUTTON_VISUEL:
csMessage = "left click to view/edit the texture OR right click to get the color";
break;
case IDC_BUTTON_PRIORITY:
csMessage = "change the priority of this texture to adapt to memory restrictions";
break;
case IDC_BUTTON_QUALITYLEVEL:
csMessage = "change the quality of this texture to adapt to memory restrictions";
break;
case IDC_CHECK_HORIZONTALTILE:
case IDC_CHECK_VERTICALTILE:
csMessage = "enable/disable texture tiling";
break;
case IDC_CHECK_HORIZONTALFILTERING:
case IDC_CHECK_VERTICALFILTERING:
case IDC_CHECK_DEPTHFILTERING:
csMessage = "enable/disable texture bilinear filtering";
break;
case IDC_BUTTON_CHROMAKEYCOLOR:
csMessage = "Chromakey / alpha";
break;
case IDC_BUTTON_SUPPLYTEXTURE:
csMessage = "swap display between the main and supply texture";
break;
}
//output the help info in the status bar
fn_vGiveProgressInfo(csMessage, -1);
//there is no hit for a true tooltip
return -1;
}
//==================================================================================================
// Description : handle function for WM_CREATE
//==================================================================================================
int DiaText::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFormView::OnCreate(lpCreateStruct) == -1)
return -1;
EnableToolTips(TRUE);
m_oMemDC.CreateCompatibleDC( NULL );
m_oMemBitmap.CreateCompatibleBitmap( this->GetDC(), 16, 16);
m_p_oPreviousSelectedBitmap = m_oMemDC.SelectObject(&m_oMemBitmap);
return 0;
}
//==================================================================================================
// Description : handle function for WM_DRAWITEM
//==================================================================================================
BOOL DiaText::Create( LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
DWORD dwRequestedStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,
CCreateContext* pContext )
{
BOOL bResult = CFormView::Create( lpszClassName, lpszWindowName, dwRequestedStyle, rect, pParentWnd, nID, pContext );
//control registration for tutorial and assistants, should be unregistered when view is destroyed
TUT_M_vGetTutDll();
TUT_M_vRegisterControlID(IDC_BUTTON_SUPPLYTEXTURE,"TGM_DiaTextButtonSupplyTexture",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_VISUEL,"TGM_DiaTextButtonVisuel",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_PRIORITY,"TGM_DiaTextButtonPriority",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_QUALITYLEVEL,"TGM_DiaTextButtonQyalityLevel",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_CHECK_HORIZONTALFILTERING,"TGM_DiaTextCheckHorizontalFiltering",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_CHECK_VERTICALFILTERING,"TGM_DiaTextCheckVerticalFiltering",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_CHECK_DEPTHFILTERING,"TGM_DiaTextCheckDepthFiltering",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_CHECK_HORIZONTALTILE,"TGM_DiaTextcheckHorizontalTiling",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_CHECK_VERTICALTILE,"TGM_DiaTextCheckVerticalTiling",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_CHROMAKEYCOLOR,"TGM_DiaTextButtonChromakeyColor",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_EDIT_DURATION,"TGM_DiaTextEditDuration",TUT_e_TextEdit);
//Mircea Dunka 4.11.98
TUT_M_vRegisterControlID(IDC_BUTTON_PIXELCOLOR,"TGM_PixelColor",TUT_e_Button);
//end Mircea Dunka
return bResult;
}
//==================================================================================================
//==================================================================================================
void DiaText::m_fn_vShowMaterial(GMT_tdxHandleToGameMaterial _hMat, long _lAnimatedTextureIndex /*= -1*/)
{
m_lAnimatedTextureIndex = _lAnimatedTextureIndex;
tdoEditorGameMaterial *p_oEditedGameMaterial = gs_p_oMaterialInterface->m_p_oGetEditedMaterial();
BOOL bAGameMAterialIsEdited = p_oEditedGameMaterial ? TRUE : FALSE;
/* if no material is currently selected, disable everything */
if ( !bAGameMAterialIsEdited )
{
m_lAnimatedTextureIndex = -1;
m_hEditedTexture = NULL; //invalidate the handle
//clear the controls
GetDlgItem(IDC_EDIT_DURATION )->SetWindowText("");
((CButton *) GetDlgItem(IDC_CHECK_HORIZONTALTILE ))->SetCheck(FALSE);
((CButton *) GetDlgItem(IDC_CHECK_VERTICALTILE ))->SetCheck(FALSE);
((CButton *) GetDlgItem(IDC_CHECK_HORIZONTALFILTERING))->SetCheck(FALSE);
((CButton *) GetDlgItem(IDC_CHECK_VERTICALFILTERING ))->SetCheck(FALSE);
((CButton *) GetDlgItem(IDC_CHECK_DEPTHFILTERING ))->SetCheck(FALSE);
//change the texture before the button is disabled, else it will not be displayed...
m_fn_vChangeTexture(NULL);
//Mircea Dunka 5.11.1998
//I need this button remain this way all the time!!!
GetDlgItem(IDC_BUTTON_VISUEL )->EnableWindow(FALSE);
m_bButtonVisuelEnabled = FALSE;
GetDlgItem(IDC_BUTTON_PIXELCOLOR )->EnableWindow(FALSE);
//end Mircea Dunka
GetDlgItem(IDC_BUTTON_PRIORITY )->EnableWindow(FALSE);
GetDlgItem(IDC_BUTTON_QUALITYLEVEL )->EnableWindow(FALSE);
GetDlgItem(IDC_CHECK_HORIZONTALTILE )->EnableWindow(FALSE);
GetDlgItem(IDC_CHECK_VERTICALTILE )->EnableWindow(FALSE);
GetDlgItem(IDC_CHECK_HORIZONTALFILTERING)->EnableWindow(FALSE);
GetDlgItem(IDC_CHECK_VERTICALFILTERING )->EnableWindow(FALSE);
GetDlgItem(IDC_CHECK_DEPTHFILTERING )->EnableWindow(FALSE);
GetDlgItem(IDC_BUTTON_CHROMAKEYCOLOR )->EnableWindow(FALSE);
GetDlgItem(IDC_BUTTON_SUPPLYTEXTURE )->EnableWindow(FALSE);
GetDlgItem(IDC_EDIT_DURATION )->EnableWindow(FALSE);
return;
}
//normally, the specified engine game material must belong to the current editor game material...
ASSERT(_hMat == p_oEditedGameMaterial->GetData());
ACP_tdxHandleOfMaterial hEditedVisualMaterial = GMT_fn_hGetVisualMaterial(_hMat);
float fDuration = 0.0f;
//get the texture's handle
if ( m_lAnimatedTextureIndex == -1 )
m_hEditedTexture = NULL;
else //get the animated texture instead
GLI_vGetMaterialAnimatedTexture(hEditedVisualMaterial, m_lAnimatedTextureIndex, &m_hEditedTexture, &fDuration);
//fill the duration control
BOOL bEditDuration = (m_hEditedTexture ? TRUE : FALSE) && (GLI_lGetMaterialNumberOfAnimatedTexture(hEditedVisualMaterial) > 1);
if ( bEditDuration )
{
CString csDuration;
csDuration.Format(C_szDurationStringFormat, fDuration);
csDuration.TrimLeft();
GetDlgItem(IDC_EDIT_DURATION)->SetWindowText(csDuration);
}
else
GetDlgItem(IDC_EDIT_DURATION)->SetWindowText("");
GetDlgItem(IDC_EDIT_DURATION)->EnableWindow(bEditDuration);
BOOL bTheMaterialIsTextured = (m_hEditedTexture ? TRUE : FALSE);
m_bControlsFilledFromMaterial = TRUE;
GLI_tdstTexture *p_stTextureToDisplay = NULL;
GetDlgItem(IDC_BUTTON_SUPPLYTEXTURE)->SetWindowText(m_bDisplaySupplyTexture ? "Supply texture" : "Primary texture");
if ( bTheMaterialIsTextured )
{
p_stTextureToDisplay = (m_bDisplaySupplyTexture ? TEX_p_tdstGetSupplyTexture(m_hEditedTexture) : m_hEditedTexture);
if ( p_stTextureToDisplay == NULL ) //can only happen if we want to display the supplied texture and there is none
bTheMaterialIsTextured = FALSE; //display no texture
unsigned long xMType;
GLI_xGetMaterialType(hEditedVisualMaterial, &xMType);
if (xMType & GLI_C_lIsTextured)
m_fn_vChangeTexture(p_stTextureToDisplay);
else
m_fn_vChangeTexture(NULL);
}
else
m_fn_vChangeTexture(NULL);
if ( bTheMaterialIsTextured )
{
//TODO: priority, bilinear filtering
//fill the controls with the proper values
switch ( TEX_ucGetTextureQualityLevel(p_stTextureToDisplay) )
{
case TEX_C_QLOW:
GetDlgItem(IDC_BUTTON_QUALITYLEVEL)->SetWindowText("Low");
break;
case TEX_C_QNORMAL:
GetDlgItem(IDC_BUTTON_QUALITYLEVEL)->SetWindowText("Normal");
break;
case TEX_C_QHIGH:
GetDlgItem(IDC_BUTTON_QUALITYLEVEL)->SetWindowText("High");
break;
}
long lMipmappingMode = TEX_lGetTextureMipMappingMode(p_stTextureToDisplay);
if ( lMipmappingMode == TEX_C_TRILINEAR )
((CButton *) GetDlgItem(IDC_CHECK_DEPTHFILTERING))->SetCheck(TRUE);
BOOL bFilterU = FALSE, bFilterV = FALSE;
if ( lMipmappingMode == TEX_C_BILINEAR )
{
//TODO: read filtering axis
}
((CButton *) GetDlgItem(IDC_CHECK_HORIZONTALFILTERING))->SetCheck(bFilterU);
((CButton *) GetDlgItem(IDC_CHECK_VERTICALFILTERING ))->SetCheck(bFilterV);
BOOL bTilingX, bTilingY;
TEX_vGetTextureTilingMode(p_stTextureToDisplay, &bTilingX , &bTilingY);
((CButton *) GetDlgItem(IDC_CHECK_HORIZONTALTILE ))->SetCheck(bTilingX);
((CButton *) GetDlgItem(IDC_CHECK_VERTICALTILE ))->SetCheck(bTilingY);
BOOL bActive, bFiltering;
unsigned char ucR, ucG, ucB, ucA;
TEX_vGetTextureChromakey(p_stTextureToDisplay, &bActive, &bFiltering, &ucR, &ucG, &ucB, &ucA);
UpdateData(FALSE); //move the data into the control
}
//enable the button just after the texture is changed
//Mircea Dunka 5.11.1998
//I need this button remain this way all the time!!!
//GetDlgItem(IDC_BUTTON_VISUEL )->EnableWindow(bTheMaterialIsTextured);
GetDlgItem(IDC_BUTTON_VISUEL )->EnableWindow(FALSE);
m_bButtonVisuelEnabled = bTheMaterialIsTextured;
//end Mircea Dunka
//note that these buttons will be updated by OnDrawItem()
GetDlgItem(IDC_BUTTON_VISUEL )->Invalidate();
GetDlgItem(IDC_BUTTON_CHROMAKEYCOLOR )->Invalidate();
GetDlgItem(IDC_BUTTON_PRIORITY )->EnableWindow(bTheMaterialIsTextured);
GetDlgItem(IDC_BUTTON_QUALITYLEVEL )->EnableWindow(bTheMaterialIsTextured);
GetDlgItem(IDC_CHECK_HORIZONTALTILE )->EnableWindow(bTheMaterialIsTextured);
GetDlgItem(IDC_CHECK_VERTICALTILE )->EnableWindow(bTheMaterialIsTextured);
GetDlgItem(IDC_CHECK_HORIZONTALFILTERING)->EnableWindow(bTheMaterialIsTextured);
GetDlgItem(IDC_CHECK_VERTICALFILTERING )->EnableWindow(bTheMaterialIsTextured);
GetDlgItem(IDC_CHECK_DEPTHFILTERING )->EnableWindow(bTheMaterialIsTextured);
GetDlgItem(IDC_BUTTON_CHROMAKEYCOLOR )->EnableWindow(bTheMaterialIsTextured);
GetDlgItem(IDC_BUTTON_SUPPLYTEXTURE )->EnableWindow(bTheMaterialIsTextured || m_bDisplaySupplyTexture);
//Mircea Dunka 16.11.98
GetDlgItem(IDC_BUTTON_PIXELCOLOR )->EnableWindow(bTheMaterialIsTextured);
//end Mircea Dunka
m_bControlsFilledFromMaterial = FALSE;
//Invalidate();
}
//==================================================================================================
// Description : handle function for WM_DRAWITEM
//==================================================================================================
void DiaText::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC *pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
RECT *rect = &lpDrawItemStruct->rcItem;
BOOL bATextureIsEdited = m_hEditedTexture ? TRUE : FALSE;
COLORREF xColor;
switch ( nIDCtl )
{
default:
CFormView::OnDrawItem(nIDCtl, lpDrawItemStruct);
break;
case IDC_BUTTON_VISUEL:
{
BITMAP stBitmap;
m_oMemDC.GetCurrentBitmap()->GetBitmap(&stBitmap);
pDC -> StretchBlt(
rect->left, rect->top, rect->right, rect->bottom,
&m_oMemDC,
0, 0, stBitmap.bmWidth, stBitmap.bmHeight,
SRCCOPY
);
}
break;
case IDC_BUTTON_CHROMAKEYCOLOR:
{
unsigned char ucR, ucG, ucB, ucA;
if ( bATextureIsEdited )
{
BOOL bActive, bFiltering;
GLI_tdstTexture *p_stTextureToDisplay = (m_bDisplaySupplyTexture ? TEX_p_tdstGetSupplyTexture(m_hEditedTexture) : m_hEditedTexture);
if ( p_stTextureToDisplay )
TEX_vGetTextureChromakey(p_stTextureToDisplay, &bActive, &bFiltering, &ucR, &ucG, &ucB, &ucA);
else
ucR = ucG = ucB = ucA = 0;
xColor = RGB(ucR, ucG, ucB);
}
else
xColor = RGB(192,192,192);
pDC->FillSolidRect( rect, xColor);
//draw the alpha color in the button too, in the righthand third of the rectangle
if ( bATextureIsEdited )
{
short wOffset = (rect->right * 2) / 3;
rect->left += wOffset;
xColor = RGB(ucA, ucA, ucA);
pDC->FillSolidRect(rect, xColor);
}
}
break;
//mircea Dunka 4.11.98
case IDC_BUTTON_PIXELCOLOR:
{
xColor = RGB(m_nRPixelColor, m_nGPixelColor, m_nBPixelColor);
pDC->FillSolidRect(rect,xColor);
COLORREF clrNewTextColor;
if(((m_nRPixelColor >= 128) ? 0:255) + ((m_nGPixelColor >= 128) ? 0:255) + ((m_nBPixelColor >= 128) ? 0:255) > 255)
clrNewTextColor = 0x00FFFFFF;
else
clrNewTextColor = 0x000000000;
COLORREF clrOldTextColor = pDC->SetTextColor(clrNewTextColor);
int nOldBkMode = pDC->SetBkMode(TRANSPARENT);
char szBuffer[20];
wsprintf(szBuffer, "R:%d G:%d B:%d", m_nRPixelColor, m_nGPixelColor, m_nBPixelColor);
pDC->DrawText(szBuffer, strlen(szBuffer), rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
pDC->SetBkMode(nOldBkMode);
pDC->SetTextColor(clrOldTextColor);
}
break;
}
}
//==================================================================================================
//==================================================================================================
void DiaText::OnButtonQualityLevel()
{
GLI_tdstTexture *p_stTextureToDisplay = (m_bDisplaySupplyTexture ? TEX_p_tdstGetSupplyTexture(m_hEditedTexture) : m_hEditedTexture);
unsigned char ucQuality = TEX_ucGetTextureQualityLevel(p_stTextureToDisplay);
switch ( ucQuality )
{
case TEX_C_QLOW:
GetDlgItem(IDC_BUTTON_QUALITYLEVEL)->SetWindowText("Normal");
ucQuality = TEX_C_QNORMAL;
break;
case TEX_C_QNORMAL:
GetDlgItem(IDC_BUTTON_QUALITYLEVEL)->SetWindowText("High");
ucQuality = TEX_C_QHIGH;
break;
case TEX_C_QHIGH:
GetDlgItem(IDC_BUTTON_QUALITYLEVEL)->SetWindowText("Low");
ucQuality = TEX_C_QLOW;
break;
}
TEX_vSetTextureQualityLevel(p_stTextureToDisplay, ucQuality);
m_vNotifyChangeToScripts(FALSE, TRUE); //only the texture section is modified
}
//==================================================================================================
//==================================================================================================
void DiaText::OnButtonPriority()
{
static short wPri = 0;
switch ( wPri )
{
case 0:
GetDlgItem(IDC_BUTTON_PRIORITY)->SetWindowText("roglobo");
wPri = 1;
break;
case 1:
GetDlgItem(IDC_BUTTON_PRIORITY)->SetWindowText("gougnapla");
wPri = 2;
break;
case 2:
GetDlgItem(IDC_BUTTON_PRIORITY)->SetWindowText("zorbagnac");
wPri = 0;
break;
}
//m_vNotifyChangeToScripts(FALSE, TRUE); //only the texture section is modified
}
//==================================================================================================
//==================================================================================================
void DiaText::OnCheckTile()
{
GLI_tdstTexture *p_stTextureToDisplay = (m_bDisplaySupplyTexture ? TEX_p_tdstGetSupplyTexture(m_hEditedTexture) : m_hEditedTexture);
TEX_vSetTextureTilingMode(
p_stTextureToDisplay,
((CButton *) GetDlgItem(IDC_CHECK_HORIZONTALTILE))->GetCheck(),
((CButton *) GetDlgItem(IDC_CHECK_VERTICALTILE))->GetCheck()
);
m_vNotifyChangeToScripts(FALSE, TRUE); //only the texture section is modified
}
//==================================================================================================
//==================================================================================================
void DiaText::OnCheckFilter()
{
BOOL bFilterU, bFilterV, bFilterZ;
bFilterU = ((CButton *) GetDlgItem(IDC_CHECK_HORIZONTALFILTERING))->GetCheck();
bFilterV = ((CButton *) GetDlgItem(IDC_CHECK_VERTICALFILTERING))->GetCheck();
bFilterZ = ((CButton *) GetDlgItem(IDC_CHECK_DEPTHFILTERING))->GetCheck();
GLI_tdstTexture *p_stTextureToDisplay = (m_bDisplaySupplyTexture ? TEX_p_tdstGetSupplyTexture(m_hEditedTexture) : m_hEditedTexture);
long lTypeOfMipMapping;
if ( bFilterZ )
lTypeOfMipMapping = TEX_C_TRILINEAR;
else if ( bFilterU || bFilterV )
lTypeOfMipMapping = TEX_C_BILINEAR;
else
lTypeOfMipMapping = TEX_C_NO_MIPMAPPING;
TEX_vSetTextureMipMappingMode(p_stTextureToDisplay, lTypeOfMipMapping);
//TODO: set axis of bilinear filtering in texture according to bFilterU and bFilterV
m_vNotifyChangeToScripts(FALSE, TRUE); //only the texture section is modified
}
//==================================================================================================
//==================================================================================================
void DiaText::OnButtonVisuel()
{
if (g_sModalLoop)
return;
g_sModalLoop = TRUE;
gs_p_oMaterialInterface->m_p_oGetTextureChooserDialog()->DoModal();
g_sModalLoop = FALSE;
int iImage = gs_p_oMaterialInterface->m_p_oGetTextureChooserDialog()->m_fn_iGetSelectedImage();
if (iImage != -1)
{
GLI_tdstTexture *p_stGliText = (GLI_tdstTexture *) gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_lGetBitmapLong(iImage);
M_p_oGetEditManager()->AskFor(new tdoChangeTextureModif(
gs_p_oMaterialInterface->m_p_oGetEditedMaterial()->m_hGetEngineMaterial(),
m_lAnimatedTextureIndex,
p_stGliText,
iImage,
m_bDisplaySupplyTexture
));
/*
GMT_tdxHandleToGameMaterial hGameMaterial = gs_p_oMaterialInterface->m_p_oGetEditedMaterial()->m_hGetEngineMaterial();
ACP_tdxHandleOfMaterial hEditedVisualMaterial = GMT_fn_hGetVisualMaterial(hGameMaterial);
tdoEditorVisualMaterial *p_oVisualMaterial = (tdoEditorVisualMaterial *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hEditedVisualMaterial);
GLI_tdstTexture *p_stTextureToUnlink = NULL;
CPA_BaseObject *p_oOwnerObject = m_bDisplaySupplyTexture ? gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(m_hEditedTexture) : p_oVisualMaterial;
//find the editor texture associated to the previous texture, and remove the cohemngr link if there is one
if ( m_hEditedTexture )
{
tdoEditorTexture *p_oEditorTexture = NULL;
if ( p_stTextureToUnlink = (m_bDisplaySupplyTexture ? TEX_p_tdstGetSupplyTexture(m_hEditedTexture) : m_hEditedTexture) )
p_oEditorTexture = (tdoEditorTexture *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(p_stTextureToUnlink);
if ( p_oEditorTexture )
g_oCoherenceManager.m_fn_vRemoveALink(p_oOwnerObject, p_oEditorTexture);
}
//get the pointer on the new texture
GLI_tdstTexture *p_stGliText = (GLI_tdstTexture *) gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_lGetBitmapLong(iImage);
if ( p_stGliText != NULL && p_stTextureToUnlink != p_stGliText ) //if the texture effectively changed
{
//try to find the editor texture for this file, and associate it to the visual material
tdoEditorTexture *p_oEditorTexture = (tdoEditorTexture *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(p_stGliText);
if ( p_oEditorTexture )
g_oCoherenceManager.m_fn_vAddALink(p_oOwnerObject, p_oEditorTexture);
if ( !m_bDisplaySupplyTexture )
{
GLI_tdstTexture *hChangedTexture;
float fDuration;
GLI_vGetMaterialAnimatedTexture(hEditedVisualMaterial, m_lAnimatedTextureIndex, &hChangedTexture, &fDuration);
//give the new texture to the engine visual material
GLI_vModifyMaterialAnimatedTexture(hEditedVisualMaterial, m_lAnimatedTextureIndex, p_stGliText, fDuration);
//add the flag saying the material is textured
ACP_tdxIndex xCurrentType;
GLI_xGetMaterialType(hEditedVisualMaterial, &xCurrentType);
GLI_xSetMaterialType(hEditedVisualMaterial, xCurrentType | GLI_C_lIsTextured);
}
else //give the supply texture to the main texture
TEX_vSetSupplyTexture(m_hEditedTexture, p_stGliText);
//display the new texture
m_fn_vShowMaterial(hGameMaterial, m_lAnimatedTextureIndex);
//m_fn_vChangeTexture(p_stGliText);
//GetDlgItem(IDC_BUTTON_VISUEL)->Invalidate();
//update the textured flag button
((CButton *) (gs_p_oMaterialInterface->m_p_oGetVisualMaterialView()->GetDlgItem(IDC_CHECK_TEXTURE)))->SetCheck(TRUE);
//make listview update the displayed texture for the edited game material
gs_p_oMaterialInterface->m_p_oGetMaterialListView()->m_fn_vSetItemImage(
gs_p_oMaterialInterface->m_p_oGetMaterialListView()->m_fn_lGetSelectedItem(),
(short) iImage
);
gs_p_oMaterialInterface->m_p_oGetMaterialListView()->m_fn_vRedrawSelectedItem();
//tell the main view to redraw itself because a material changed aspect
M_GetMainDevice3D()->DrawObject();
}
m_vNotifyChangeToScripts(TRUE, TRUE); //to be sure everybody is notified (but is the primary texture notified as well ?
*/
}
}
//==================================================================================================
// Description : change texture in m_oMemDC (for display)
//==================================================================================================
void DiaText::m_fn_vChangeTexture(GLI_tdstTexture *p_stTexture, BOOL _bEnableButton /*= TRUE*/)
{
//restore the old bitmap in the DC before destroying the textured one
m_oMemDC.SelectObject(m_p_oPreviousSelectedBitmap);
m_oMemBitmap.DeleteObject();
int iImage = -1;
tdoEditorGameMaterial * p_oGameMaterial = gs_p_oMaterialInterface->m_p_oGetEditedMaterial();
if ( p_oGameMaterial )
{
ACP_tdxHandleOfMaterial hEditedVisualMaterial = GMT_fn_hGetVisualMaterial(p_oGameMaterial->m_hGetEngineMaterial());
if ( hEditedVisualMaterial != NULL ) //is the handle valid ?
{
// try to get the good bitmap in list
if ( p_stTexture )
iImage = gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_iGetBitmapIndexByLong((long) p_stTexture);
else //if we display the supply texture, show an invalid texture when there is none instead of the rainbow
iImage = m_bDisplaySupplyTexture ? -1 : gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_iGetBitmapIndex(C_szNoBitmapName);
}
}
if ( iImage == -1 )
iImage = gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_iGetBitmapIndex(C_szUnviewableBitmapName);
if ( iImage != -1 )
{
BITMAP stBitmap;
CBitmap *p_oBitmap = CBitmap::FromHandle( gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_hGetBitmap(iImage));
p_oBitmap->GetBitmap(&stBitmap);
m_oMemBitmap.CreateCompatibleBitmap(this->GetDC(), stBitmap.bmWidth, stBitmap.bmHeight);
m_oMemDC.SelectObject(&m_oMemBitmap);
m_oMemDC.DrawState(CPoint(0,0), CSize(stBitmap.bmWidth, stBitmap.bmHeight), p_oBitmap, DST_BITMAP);
}
//Mircea Dunka 5.11.1998
//I need this button to remain disabled all the time!!! (for right click messages).
//GetDlgItem(IDC_BUTTON_VISUEL)->EnableWindow(_bEnableButton && p_stTexture);
GetDlgItem(IDC_BUTTON_VISUEL )->EnableWindow(FALSE);
m_bButtonVisuelEnabled = _bEnableButton && p_stTexture;
//end Mircea Dunka
GetDlgItem(IDC_BUTTON_VISUEL)->Invalidate();
}
//==================================================================================================
//==================================================================================================
void DiaText::m_vNotifyChangeToScripts(BOOL _bVisualSection, BOOL _bTextureSection)
{
ACP_tdxHandleOfMaterial hEditedVisualMaterial = GMT_fn_hGetVisualMaterial(gs_p_oMaterialInterface->m_p_oGetEditedMaterial()->m_hGetEngineMaterial());
//notify the visual material
if ( _bVisualSection )
{
tdoEditorVisualMaterial *p_oVisualMaterial = (tdoEditorVisualMaterial *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hEditedVisualMaterial);
if ( p_oVisualMaterial )
p_oVisualMaterial->fn_vNotifySave();
}
//notify the texture sections as well (main and supply, just to be sure
if ( _bTextureSection )
{
tdoEditorTexture *p_oEditorTexture;
p_oEditorTexture = (tdoEditorTexture *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(m_hEditedTexture);
if ( p_oEditorTexture )
p_oEditorTexture->fn_vNotifySave();
p_oEditorTexture = (tdoEditorTexture *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(TEX_p_tdstGetSupplyTexture(m_hEditedTexture));
if ( p_oEditorTexture )
p_oEditorTexture->fn_vNotifySave();
}
}
//==================================================================================================
//==================================================================================================
void DiaText::OnButtonChromakeyColor()
{
//Mircea Dunka 12.11.98
GEO_tdstColor stTempColor, stCapturedColor;
//end Mircea Dunka
BOOL bActive, bFiltering;
unsigned char ucR, ucG, ucB, ucA;
GLI_tdstTexture *p_stTextureToDisplay = (m_bDisplaySupplyTexture ? TEX_p_tdstGetSupplyTexture(m_hEditedTexture) : m_hEditedTexture);
TEX_vGetTextureChromakey(p_stTextureToDisplay, &bActive, &bFiltering, &ucR, &ucG, &ucB, &ucA);
stTempColor.xR = ((float) ucR) / 255;
stTempColor.xG = ((float) ucG) / 255;
stTempColor.xB = ((float) ucB) / 255;
stTempColor.xA = ((float) ucA) / 255;
//Mircea Dunka 12.11.98
stCapturedColor.xR = ((float) m_nRPixelColor) / 255;
stCapturedColor.xG = ((float) m_nGPixelColor) / 255;
stCapturedColor.xB = ((float) m_nBPixelColor) / 255;
stCapturedColor.xA = 0;
// end Mircea Dunka
if ( fn_bEditColor(GetDlgItem(IDC_BUTTON_CHROMAKEYCOLOR), &stTempColor, &stCapturedColor) )
{
TEX_vSetTextureChromakey(
p_stTextureToDisplay, bActive, bFiltering,
(unsigned char) (stTempColor.xR * 255),
(unsigned char) (stTempColor.xG * 255),
(unsigned char) (stTempColor.xB * 255),
(unsigned char) (stTempColor.xA * 255)
);
GetDlgItem(IDC_BUTTON_CHROMAKEYCOLOR)->Invalidate();
//tell the main view to redraw itself because a material changed aspect
M_GetMainDevice3D()->DrawObject();
//tell the texture section has to be saved
m_vNotifyChangeToScripts(FALSE, TRUE);
}
}
//==================================================================================================
//==================================================================================================
void DiaText::OnButtonSupplyTexture()
{
m_bDisplaySupplyTexture = !m_bDisplaySupplyTexture;
m_fn_vShowMaterial(gs_p_oMaterialInterface->m_p_oGetEditedMaterial()->m_hGetEngineMaterial(), m_lAnimatedTextureIndex);
}
//==================================================================================================
//==================================================================================================
void DiaText::OnKillFocusEditDuration()
{
//read the contents of the edit
CString csDuration;
GetDlgItem(IDC_EDIT_DURATION)->GetWindowText(csDuration);
//convert the string into a floating point number
float fDuration = (float) atof(LPCTSTR(csDuration));
if ( fDuration < 0.0f )
fDuration = 0.0f;
//write back in the edit the string that corresponds to the value we parsed
csDuration.Format(C_szDurationStringFormat, fDuration);
csDuration.TrimLeft();
GetDlgItem(IDC_EDIT_DURATION)->SetWindowText(csDuration);
//change the duration for the texture
GMT_tdxHandleToGameMaterial hGameMaterial = gs_p_oMaterialInterface->m_p_oGetEditedMaterial()->m_hGetEngineMaterial();
ACP_tdxHandleOfMaterial hEditedVisualMaterial = GMT_fn_hGetVisualMaterial(hGameMaterial);
GLI_tdstTexture *hReadTexture;
float fReadDuration;
GLI_vGetMaterialAnimatedTexture(hEditedVisualMaterial, m_lAnimatedTextureIndex, &hReadTexture, &fReadDuration);
GLI_vModifyMaterialAnimatedTexture(hEditedVisualMaterial, m_lAnimatedTextureIndex, hReadTexture, fDuration);
if ( hReadTexture != m_hEditedTexture )
AfxMessageBox(
"TGM INTERNAL ERROR! Tell B. Germain if you see this message\n"
"You can continue to work normally, this has no influence on your data",
MB_OK
);
//now update the edited animation texture node.
m_vNotifyChangeToScripts(FALSE, TRUE);
}
//==================================================================================================
//==================================================================================================
//==================================================================================================
//==================================================================================================
//==================================================================================================
//==================================================================================================
//==================================================================================================
//==================================================================================================
tdoChangeTextureModif::tdoChangeTextureModif
(
GMT_tdxHandleToGameMaterial _MyMatHandle,
long _lChanged,
GLI_tdstTexture *_hNewTexture,
int _iNewImage,
BOOL _bSupplyTexture
)
: CPA_Modif(0, "Texture Change")
{
m_hEditedGameMaterial = _MyMatHandle;
m_p_oEditedGameMaterial = (tdoEditorGameMaterial *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(m_hEditedGameMaterial);
m_hTextureAfterDo = _hNewTexture;
m_iImageAfterDo = _iNewImage;
m_lChangeIndex = _lChanged;
m_bSupplyTexture = _bSupplyTexture;
ACP_tdxHandleOfMaterial hMaterialVisual = GMT_fn_hGetVisualMaterial(m_hEditedGameMaterial);
GLI_xGetMaterialTexture(hMaterialVisual, &m_hTextureBeforeDo);
if ( m_bSupplyTexture )
m_hTextureBeforeDo = TEX_p_tdstGetSupplyTexture(m_hTextureBeforeDo);
m_iImageBeforeDo = gs_p_oMaterialInterface->m_p_oGetMaterialListView()->m_iGetTextureIndexForGameMaterial(m_p_oEditedGameMaterial, FALSE);
}
//==================================================================================================
//==================================================================================================
tdoChangeTextureModif::~tdoChangeTextureModif()
{
}
//==================================================================================================
//==================================================================================================
BOOL tdoChangeTextureModif::Do()
{
return m_bDoIt(m_hTextureAfterDo, m_iImageAfterDo);
}
//==================================================================================================
//==================================================================================================
BOOL tdoChangeTextureModif::Undo()
{
return m_bDoIt(m_hTextureBeforeDo, m_iImageBeforeDo);
}
//==================================================================================================
//==================================================================================================
BOOL tdoChangeTextureModif::m_bDoIt(GLI_tdstTexture *_hReplacingTexture, int _iImageIndex)
{
ACP_tdxHandleOfMaterial hEditedVisualMaterial = GMT_fn_hGetVisualMaterial(m_hEditedGameMaterial);
//change the texture in the material
GLI_tdstTexture *hReplacedTexture;
float fDuration;
GLI_vGetMaterialAnimatedTexture(hEditedVisualMaterial, m_lChangeIndex, &hReplacedTexture, &fDuration);
GLI_vModifyMaterialAnimatedTexture(hEditedVisualMaterial, m_lChangeIndex, _hReplacingTexture, fDuration);
//if this is the first texture in the animation, update the unanimated texture too
if ( m_lChangeIndex == 0 )
GLI_xSetMaterialTexture(hEditedVisualMaterial, _hReplacingTexture);
//tell the engine something changed with the animated textures
GLI_xRefreshAnimatedTexture(hEditedVisualMaterial);
//update coherence manager links
tdoEditorVisualMaterial *p_oVisualMaterial = (tdoEditorVisualMaterial *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hEditedVisualMaterial);
tdoEditorTexture *p_oEditorTextureBefore = (tdoEditorTexture *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hReplacedTexture);
if ( p_oEditorTextureBefore )
g_oCoherenceManager.m_fn_vRemoveALink(p_oVisualMaterial, p_oEditorTextureBefore);
tdoEditorTexture *p_oEditorTextureAfter = (tdoEditorTexture *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(_hReplacingTexture);
if ( p_oEditorTextureAfter )
g_oCoherenceManager.m_fn_vAddALink(p_oVisualMaterial, p_oEditorTextureAfter);
//make the visual material save itself
p_oVisualMaterial->fn_vNotifySave();
//if we changed the first texture in tha animation
if ( m_lChangeIndex == 0 )
{
//find the item for the game material in the material list
int iMaterialIndex = gs_p_oMaterialInterface->m_p_oGetMaterialListView()->m_fn_iFindMaterial(m_p_oEditedGameMaterial);
//change its image
gs_p_oMaterialInterface->m_p_oGetMaterialListView()->m_fn_vSetItemImage(iMaterialIndex, _iImageIndex);
//then redraw it
gs_p_oMaterialInterface->m_p_oGetMaterialListView()->m_fn_vRedrawSelectedItem(iMaterialIndex);
}
//update display if relevant
if ( m_p_oEditedGameMaterial == gs_p_oMaterialInterface->m_p_oGetEditedMaterial() )
{
//first update the combo of the VMT
CComboBox *p_oCombo = (CComboBox *) gs_p_oMaterialInterface->m_p_oGetVisualView()->GetDlgItem(IDC_COMBO_ANIMATEDTEXTURES);
p_oCombo->DeleteString(m_lChangeIndex);
p_oCombo->InsertString(m_lChangeIndex, p_oEditorTextureAfter ? p_oEditorTextureAfter->GetName() : "ERROR!");
p_oCombo->SetItemDataPtr(m_lChangeIndex, p_oEditorTextureAfter);
//then select the modified entry
p_oCombo->SetCurSel(m_lChangeIndex);
//then make the texture view redisplay itself
gs_p_oMaterialInterface->m_p_oGetTexView()->m_fn_vShowMaterial(m_hEditedGameMaterial, m_lChangeIndex);
}
//tell the main view to redraw itself because a material changed aspect
M_GetMainDevice3D()->DrawObject();
return TRUE;
}
//Mircea Dunka 4.11.98
void DiaText::OnRButtonDown(UINT nFlags, CPoint point)
{
CWnd* pWndTexture = GetDlgItem(IDC_BUTTON_VISUEL);
if( ChildWindowFromPoint(point, CWP_ALL) == pWndTexture)
{
CPoint ptTexture = point;
ClientToScreen(&ptTexture);
pWndTexture->ScreenToClient(&ptTexture);
COLORREF color = pWndTexture->GetDC()->GetPixel(ptTexture);
m_nRPixelColor = GetRValue(color);
m_nGPixelColor = GetGValue(color);
m_nBPixelColor = GetBValue(color);
GetDlgItem(IDC_BUTTON_PIXELCOLOR)->InvalidateRect(NULL);
}
CFormView::OnRButtonDown(nFlags, point);
}
void DiaText::OnLButtonDown(UINT nFlags, CPoint point)
{
if( (ChildWindowFromPoint(point, CWP_ALL)==GetDlgItem(IDC_BUTTON_VISUEL)) && m_bButtonVisuelEnabled)
{
OnButtonVisuel();
}
else
CFormView::OnLButtonDown(nFlags, point);
}
void DiaText::OnButtonPixelcolor()
{
BOOL bActive, bFiltering;
unsigned char ucR, ucG, ucB, ucA;
GLI_tdstTexture *p_stTextureToDisplay = (m_bDisplaySupplyTexture ? TEX_p_tdstGetSupplyTexture(m_hEditedTexture) : m_hEditedTexture);
TEX_vGetTextureChromakey(p_stTextureToDisplay, &bActive, &bFiltering, &ucR, &ucG, &ucB, &ucA);
TEX_vSetTextureChromakey(
p_stTextureToDisplay, bActive, bFiltering,
m_nRPixelColor,
m_nGPixelColor,
m_nBPixelColor,
ucA
);
GetDlgItem(IDC_BUTTON_CHROMAKEYCOLOR)->Invalidate();
//tell the main view to redraw itself because a material changed aspect
M_GetMainDevice3D()->DrawObject();
//tell the texture section has to be saved
m_vNotifyChangeToScripts(FALSE, TRUE);
}
///end Mircea Dunka

View File

@@ -0,0 +1,107 @@
#ifndef __DiaText_hpp
#define __DiaText_hpp
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// DiaText.hpp : header file
//
#include "matres.h"
/////////////////////////////////////////////////////////////////////////////
// DiaText dialog
class DiaText : public CFormView
{
// Construction
public:
DiaText(); // standard constructor
DECLARE_DYNCREATE(DiaText)
// Dialog Data
//{{AFX_DATA(DiaText)
enum { IDD = IDD_TEXTURE_DIALOG };
//}}AFX_DATA
public:
~DiaText(); // standard constructor
void m_vNotifyChangeToScripts(BOOL _bVisualSection, BOOL _bTextureSection);
void m_fn_vChangeTexture(GLI_tdstTexture *p_stTexture, BOOL _bEnableButton = TRUE);
void m_fn_vShowMaterial(GMT_tdxHandleToGameMaterial _hMat, long _lAnimatedTextureIndex = -1);
BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
DWORD dwRequestedStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,
CCreateContext* pContext);
private:
CDC m_oMemDC; // memory DC
CBitmap *m_p_oPreviousSelectedBitmap;
CBitmap m_oMemBitmap; // memory Bitmap
GLI_tdstTexture *m_hEditedTexture;
BOOL m_bControlsFilledFromMaterial;
BOOL m_bDisplaySupplyTexture;
long m_lAnimatedTextureIndex;
//Mircea Dunka
BOOL m_bButtonVisuelEnabled;
public:
BYTE m_nRPixelColor;
BYTE m_nGPixelColor;
BYTE m_nBPixelColor;
//end Mircea Dunka
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DiaText)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const;
// Generated message map functions
//{{AFX_MSG(DiaText)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
afx_msg void OnButtonVisuel();
afx_msg void OnButtonPriority();
afx_msg void OnButtonQualityLevel();
afx_msg void OnCheckTile();
afx_msg void OnButtonChromakeyColor();
afx_msg void OnCheckFilter();
afx_msg void OnButtonSupplyTexture();
afx_msg void OnKillFocusEditDuration();
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnButtonPixelcolor();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
class tdoChangeTextureModif : public CPA_Modif
{
public:
tdoChangeTextureModif(GMT_tdxHandleToGameMaterial _MyMatHandle, long _lChanged, GLI_tdstTexture *_hNewTexture, int _iNewImage, BOOL _bSupplyTexture);
~tdoChangeTextureModif();
BOOL Do();
BOOL Undo();
protected:
BOOL m_bDoIt(GLI_tdstTexture *_hReplacingTexture, int _iImageIndex);
private:
GMT_tdxHandleToGameMaterial m_hEditedGameMaterial;
tdoEditorGameMaterial *m_p_oEditedGameMaterial;
GLI_tdstTexture *m_hTextureBeforeDo, *m_hTextureAfterDo;
int m_iImageBeforeDo, m_iImageAfterDo;
long m_lChangeIndex;
BOOL m_bSupplyTexture;
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif

View File

@@ -0,0 +1,151 @@
// DlgPreloadGMT.cpp : implementation file
//
#include "stdafx.h"
#include "..\Res\matres.h"
#include "dlgpreloadgmt.h"
#include "ACP_Base.h"
#include "ITF.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgPreloadGMT dialog
CDlgPreloadGMT::CDlgPreloadGMT(CWnd* pParent /*=NULL*/)
: CDialog(CDlgPreloadGMT::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgPreloadGMT)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_szText[0] = 0;
}
void CDlgPreloadGMT::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgPreloadGMT)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgPreloadGMT, CDialog)
//{{AFX_MSG_MAP(CDlgPreloadGMT)
ON_LBN_DBLCLK(IDC_LIST_GMT, OnDblclkListGmt)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgPreloadGMT message handlers
BOOL CDlgPreloadGMT::OnInitDialog()
{
CString csFileName = M_GetMainApp()->m_csEditorDataPath + "Tools\\Material\\Material.ini";
char sz255GMTFileName[255],
sz8FileToLoadSection[8],
sz3FileNumber[3];
unsigned char FileNumber = 1;
CListBox *pLB = (CListBox*) GetDlgItem (IDC_LIST_GMT);
CDialog::OnInitDialog();
// TODO: Add extra initialization here
pLB -> ResetContent ();
// List all GMT of the Preload section from Material.ini
do
{
strcpy(sz8FileToLoadSection, "File");
strcat(sz8FileToLoadSection, itoa(FileNumber++, sz3FileNumber, 10) );
GetPrivateProfileString("Preload", sz8FileToLoadSection, "", sz255GMTFileName, 255, csFileName);
if(sz255GMTFileName[0])
{
pLB -> AddString(sz255GMTFileName+(strchr(sz255GMTFileName,'\\')-sz255GMTFileName+1) );
}
} while(sz255GMTFileName[0]);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgPreloadGMT::OnOK()
{
CListBox *pLB = (CListBox*) GetDlgItem (IDC_LIST_GMT);
CString csFileName = M_GetMainApp()->m_csEditorDataPath + "Tools\\Material\\Material.ini";
int iIndex = pLB -> GetCurSel ();
if (iIndex != LB_ERR)
{
char sz255GMT[_MAX_FNAME],
sz8FileToLoadSection[8],
sz3FileNumber[3],
sz255GMTFileName[255],
szGMTLine[255][255];
unsigned char ucFileNumber = 1,
ucLineNumber = 0,
ucTmpFileNumber;
char *p_cPoint;
int i=0,
j=0;
// GET the file to remove from the Preload section from Material.ini file
pLB -> GetText (iIndex , m_szText);
// toto.gmt ==> toto\toto.gmt
strcpy(sz255GMT, m_szText);
p_cPoint = strrchr(sz255GMT,'.');
if(p_cPoint) *p_cPoint = 0;
strcat(sz255GMT, "\\");
strcat(sz255GMT,m_szText);
// Search Position of the item into the Preload section
do
{
strcpy(sz8FileToLoadSection, "File");
strcat(sz8FileToLoadSection, itoa(ucFileNumber++, sz3FileNumber, 10) );
GetPrivateProfileString("Preload", sz8FileToLoadSection, "", sz255GMTFileName, 255, csFileName);
} while( strcmp(sz255GMT,sz255GMTFileName) != 0 );
// Get next lines
ucTmpFileNumber = ucFileNumber-1;
do
{
strcpy(sz8FileToLoadSection, "File");
strcat(sz8FileToLoadSection, itoa(ucFileNumber++, sz3FileNumber, 10) );
GetPrivateProfileString("Preload", sz8FileToLoadSection, "", sz255GMTFileName, 255, csFileName);
if(sz255GMTFileName[0])
{
strcpy(szGMTLine[ucLineNumber++], sz255GMTFileName);
}
} while(sz255GMTFileName[0]);
// Rewrite sections
for(i=ucTmpFileNumber;i<ucTmpFileNumber+ucLineNumber;i++)
{
strcpy(sz8FileToLoadSection, "File");
strcat(sz8FileToLoadSection, itoa(i, sz3FileNumber, 10) );
WritePrivateProfileString("Preload", sz8FileToLoadSection, szGMTLine[j++], csFileName);
}
// Remove Last line
strcpy(sz8FileToLoadSection, "File");
strcat(sz8FileToLoadSection, itoa(i, sz3FileNumber, 10) );
WritePrivateProfileString("Preload", sz8FileToLoadSection, NULL, csFileName);
}
CDialog::OnOK();
}
void CDlgPreloadGMT::OnDblclkListGmt()
{
OnOK ();
}

View File

@@ -0,0 +1,491 @@
/*=============================================================================
*
* Filename: GMatObj.cpp
* Version: 1.0
* Date: 06/11/96
* Author: B.G.
*
* Description: implementation of editor material class
*
*===========================================================================*/
#include "stdafx.h"
#include "Acp_base.h"
#include "itf.h"
#include "gmt.h"
#include "incgam.h"
#include "dpt.h"
#include "_interf.hpp"
#include "GMatObj.hpp"
#include "VMatObj.hpp"
#include "MMatObj.hpp"
#include "CMatObj.hpp"
#include "x:\cpa\main\inc\_editid.h"
//ROMTEAM WorldEditor (Cristi Petrescu 22/12/97)
#include "ozo.h"
//ENDROMTEAM WorldEditor (Cristi Petrescu)
extern Material_Interface *gs_p_oMaterialInterface;
//=================================================================================
//constructor. the object is name with the following rules
//1. it is not a clone but will directly handle the engine material
// -> will take the name from the section for the engine material
//2. it is a clone, and a name is specified
// -> an underscore is added to the original's name,
// because someday the base constructor will add a number there
//3. it is a clone, and no name is specified
// -> the default name is given by the base constructor
//=================================================================================
tdoEditorGameMaterial::tdoEditorGameMaterial(
CPA_FileObject *_p_oOwnerFile,
CString _csId,
BOOL _bSectionAlreadyExists,
GMT_tdxHandleToGameMaterial _hTemplateMaterial
)
: CPA_SaveObject(
gs_p_oMaterialInterface, //editor
C_szGameMaterialTypeName, //type
E_ss_Responsible, //responsibility
_p_oOwnerFile, //owner (the file containing the section)
FALSE, //availability
(char*)LPCTSTR(_p_oOwnerFile->GetCompletionPath(gs_p_oMaterialInterface, C_szFileReferencedNameKey)), //data path to complete the referenced section name
m_vCallBackSaveGMT//callback
)
{
//tell the file object that an object exists for its section
g_oCoherenceManager.m_fn_vAddALink(_p_oOwnerFile, this);
GMT_fn_vInvalidate(&m_hGameMaterial); //set with a default value before rename for first list sorting
// construct section name (hack: szSectionName is here as an anti-bug for ...Split...
char szSectionName[SCR_CV_ui_Cfg_MaxLenName];
SCR_fn_v_RdL0_ComputeSectionName(
szSectionName,
(char*)LPCTSTR(_p_oOwnerFile->GetReferencedName(gs_p_oMaterialInterface, C_szFileReferencedNameKey)),
C_SectionGameMaterial,
(char*)LPCTSTR(_csId)
);
// section object
if ( _bSectionAlreadyExists )
fn_vSectionSaved(); //the section is saved, and has no pending notification
else
fn_vSectionDeleted(); //the section does not exist, and has no pending nofitication
SetSectionData(this);
SetReferencedSectionName(szSectionName);
// name
if ( fn_eRename(_csId) != E_mc_None )
SetDefaultValidName() ;
fn_vUpdateSectionName();
if ( fn_bCanBeNotified() && !fn_bSectionExists() )
fn_vNotifySave();
//if the handle is invalid, the engine material is not loaded yet
//SetAvailable(GMT_fn_b_ulIsValid(_hTemplateMaterial)); //done in m_vAssociateEngineMaterial()
//associate the material and create associated editor sub-materials as well
m_vAssociateEngineMaterial(_hTemplateMaterial, _bSectionAlreadyExists);
}
//=================================================================================
//=================================================================================
tdoEditorGameMaterial::~tdoEditorGameMaterial()
{
//remove myself totally from the coherence manager database
if ( !fn_bSectionExists() )
g_oCoherenceManager.m_fn_vRemoveAllLinks(this, C_cLinkedAsChildAndFather);
}
//=================================================================================
//=================================================================================
void tdoEditorGameMaterial::m_vAssociateEngineMaterial(
GMT_tdxHandleToGameMaterial _hGameMaterial,
BOOL _bSectionAlreadyExists
)
{
if ( m_hGameMaterial == _hGameMaterial )
return;
BOOL bIsAssociatedMaterialValid = GMT_fn_b_ulIsValid(_hGameMaterial);
//a section exists for this object, since we use it directly
if ( _bSectionAlreadyExists )
fn_vSectionSaved(); //the section is saved, and has no pending notification
else
fn_vSectionDeleted(); //the section does not exist, and has no pending nofitication
//if the handle is invalid, the engine material is not loaded yet
SetAvailable(bIsAssociatedMaterialValid);
//the editor object directly handles the engine object
fn_vUpdateData(_hGameMaterial);
m_hGameMaterial = _hGameMaterial;
//if the game material is valid, create editor materials for its sub-materials as well
if ( bIsAssociatedMaterialValid )
{
ACP_tdxHandleOfMaterial hMaterialVisual = GMT_fn_hGetVisualMaterial(m_hGameMaterial);
DNM_tdxHandleToMecMatCharacteristics hMaterialMechanics = GMT_fn_hGetMechanicsMaterial(m_hGameMaterial);
GMT_tdxHandleToCollideMaterial hMaterialCollide = GMT_fn_hGetCollideMaterial(m_hGameMaterial);
//now create editor objects for the materials that are in the handled engine game material
CPA_BaseObject *p_oEditorMaterial;
//create an editor visual material
//but verify that each game material references uniquely a visual material
ASSERT(hMaterialVisual);
if ( !(p_oEditorMaterial = gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hMaterialVisual)) )
{
CPA_FileObject *p_oFileObject;
char szVisualMaterialName[SCR_CV_ui_Cfg_MaxLenName];
//get the link table entry for the engine visual material
SCR_tdst_Link_Table *p_stVisualLinkTable = GLI_p_stGetLinkTableOfVisualMaterial();
//char *pszLinkName = GLI_p_cSearchValueInLinkTableOfGeometric((unsigned long) hMaterialVisual);
SCR_tdst_Link_Value *p_stVisualEntry = SCR_fnp_st_Link_SearchValue(p_stVisualLinkTable, (unsigned long) hMaterialVisual);
if ( p_stVisualEntry )
{
char szVisualMaterialFile[SCR_CV_ui_Cfg_MaxLenName];
//get the file and object name from the entry
char *pszLinkName = SCR_M_p_sz_Link_GetKey(p_stVisualEntry);
SCR_fn_v_RdL0_SplitSectionName(pszLinkName, szVisualMaterialFile, NULL, szVisualMaterialName);
//get the file object for this referenced path
p_oFileObject = p_oGetFileObjectForReferencedPath(szVisualMaterialFile, "");
}
else //this is a new game material -> we choose the file for the visual material from the game material's file name
{
char szVisualMaterialFile[SCR_CV_ui_Cfg_MaxLenName];
//get the minimal name of the game material's file
p_oFileObject = (CPA_FileObject *) GetOwner();
strcpy(szVisualMaterialFile, (char*)LPCTSTR(p_oFileObject->GetReferencedName(gs_p_oMaterialInterface, C_szFileMinimalNameKey)));
//change extension from gmt to vmt
strcpy(strrchr(szVisualMaterialFile, '.'), LPCTSTR(tdoEditorVisualMaterial::m_csGetScriptExtension()));
//find the file object with this minimal name
p_oFileObject = p_oGetFileObjectForReferencedPath(szVisualMaterialFile, C_szFileMinimalNameKey);
//the visual material will attempt to have the same name than its owner game material
strcpy(szVisualMaterialName, (char *)LPCTSTR(GetName()));
}
//create a new editor visual material that will be saved in this file
p_oEditorMaterial = new tdoEditorVisualMaterial(
p_oFileObject, //p_oGetFileObjectForReferencedPath(szVisualMaterialFile),
szVisualMaterialName,
_bSectionAlreadyExists,
hMaterialVisual
);
}
//there MUST exist an editor material for each referenced visual material!
ASSERT(p_oEditorMaterial);
//tell the cohemngr that the created game material uses the visual material
if ( p_oEditorMaterial )
g_oCoherenceManager.m_fn_vAddALink(this, p_oEditorMaterial);
//create an editor mechanics material if none exists for this handle
p_oEditorMaterial = NULL;
if
(
DNM_fn_bIsMatCharacteristicsValid(hMaterialMechanics)
&& !(p_oEditorMaterial = gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hMaterialMechanics))
)
{
char *pszKey = DNM_fn_p_cSearchValueInLinkTableOfMecMatCharacteristics((unsigned long) hMaterialMechanics);
SCR_tdst_Link_Value *p_stEntry = SCR_fnp_st_Link_SearchValue(DNM_fn_p_stGetLinkTableOfMecMatCharacteristics(), (unsigned long) hMaterialMechanics);
CString csName, csReferencedFileName;
CPA_FileObject *p_oFileObject;
if ( pszKey )
{
csReferencedFileName = gs_p_oMaterialInterface->m_csGetFilePartOfSectionName(pszKey + SCR_M_ul_Link_GetAdditionalLong(p_stEntry, 1));
csName = gs_p_oMaterialInterface->m_csGetIdPartOfSectionName(pszKey);
}
else
{
csReferencedFileName = CString("ED") + tdoEditorMechanicsMaterial::m_csGetScriptExtension();
csName = GetName();
}
p_oFileObject = p_oGetFileObjectForReferencedPath(csReferencedFileName);
//try to find an editor material based upon the name before creating a new one
p_oEditorMaterial = (tdoEditorMechanicsMaterial *) gs_p_oMaterialInterface->GetBaseObject(
csName,
C_szMechanicsMaterialTypeName,
p_oFileObject
);
if ( p_oEditorMaterial )
// give the engine material to the editor material
((tdoEditorMechanicsMaterial *) p_oEditorMaterial)->m_vAssociateEngineMaterial(hMaterialMechanics, TRUE);
else //we have to create an editor mechanics material to handle this engine mechanics material
p_oEditorMaterial = new tdoEditorMechanicsMaterial(
p_oFileObject, //p_oGetFileObjectForCompletePath(csFullPath),
csName,
_bSectionAlreadyExists,
hMaterialMechanics
);
//there MUST exist an editor material after the creation!
ASSERT(p_oEditorMaterial);
}
//tell the cohemngr that the created game material uses the mechanics material
if ( p_oEditorMaterial )
g_oCoherenceManager.m_fn_vAddALink(this, p_oEditorMaterial);
//create an editor collide material if none exists for this handle
p_oEditorMaterial = NULL;
if
(
hMaterialCollide != GMT_C_InvalidCollideMaterial
&& !(p_oEditorMaterial = gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hMaterialCollide))
)
{
SCR_tdst_Link_Table *p_stLinkTable = GMT_fn_p_stGetZoneLinkTable();
SCR_tdst_Link_Value *p_stEntry = SCR_fnp_st_Link_SearchValue(p_stLinkTable, (unsigned long) hMaterialCollide);
char *pszKey = SCR_M_p_sz_Link_GetKey(p_stEntry);
CString csName, csReferencedFileName;
CPA_FileObject *p_oFileObject;
if ( pszKey )
{
csReferencedFileName = gs_p_oMaterialInterface->m_csGetFilePartOfSectionName(pszKey + SCR_M_ul_Link_GetAdditionalLong(p_stEntry, 1));
csName = gs_p_oMaterialInterface->m_csGetIdPartOfSectionName(pszKey);
}
else
{
csReferencedFileName = CString("ED") + tdoEditorCollideMaterial::m_csGetScriptExtension();
csName = GetName();
}
p_oFileObject = p_oGetFileObjectForReferencedPath(csReferencedFileName);
//try to find an editor material based upon the name before creating a new one
p_oEditorMaterial = (tdoEditorCollideMaterial *) gs_p_oMaterialInterface->GetBaseObject(
csName,
C_szCollideMaterialTypeName,
p_oFileObject
);
if ( p_oEditorMaterial )
// give the engine material to the editor material
((tdoEditorCollideMaterial *) p_oEditorMaterial)->m_vAssociateEngineMaterial(hMaterialCollide, TRUE);
else //we have to create an editor mechanics material to handle this engine mechanics material
p_oEditorMaterial = new tdoEditorCollideMaterial(
p_oFileObject, //p_oGetFileObjectForCompletePath(csFullPath),
csName,
_bSectionAlreadyExists,
hMaterialCollide
);
//there MUST exist an editor material after the creation!
ASSERT(p_oEditorMaterial);
}
//tell the cohemngr that the created game material uses the collide material
if ( p_oEditorMaterial )
g_oCoherenceManager.m_fn_vAddALink(this, p_oEditorMaterial);
}
}
//=================================================================================
//=================================================================================
void tdoEditorGameMaterial::m_vLoadAssociatedEngineMaterial(BOOL _bEndOfLoad /*= TRUE*/)
{
//if the section name is not in the linktable, analyse the section
SCR_tdst_Cxt_Values *p_stAnalyzeResult = SCR_fnp_st_RdL0_AnalyseSection(
(char *) LPCTSTR(GetReferencedSectionName()),
SCR_CDF_uw_Anl_Normal
);
//load the texture in the graphic board vram, if not told otherwise (because we want to group analyzes before the upload)
if ( _bEndOfLoad )
GLI_vEndofGeometricLoad();
GMT_tdxHandleToGameMaterial hGameMaterial = (GMT_tdxHandleToGameMaterial) p_stAnalyzeResult->a_ulValues[0];
//there must not already exist an editor material for the loaded game material!
ASSERT(!gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hGameMaterial));
//create the association
m_vAssociateEngineMaterial(hGameMaterial, TRUE);
}
//================================================================================
//================================================================================
BOOL tdoEditorGameMaterial::m_bIsReferenced()
{
return g_oCoherenceManager.m_fn_iGetFatherCount(this) > 1;
}
//================================================================================
//================================================================================
void tdoEditorGameMaterial::m_vCallBackSaveGMT(
SCR_tdst_File_Description *_p_stFile,
char *_p_szSectionName,
void *_p_vData,
SCR_tde_Ntfy_Action _eAction
)
{
tdoEditorGameMaterial *p_oEditorMaterial = (tdoEditorGameMaterial *) _p_vData;
if ( _eAction == SCR_EA_Ntfy_DeleteSection )
//now the section exists, if this was not the case
p_oEditorMaterial->fn_vSectionDeleted(); // the section no longer exists, and has no pending notification
if ( _eAction != SCR_EA_Ntfy_AddSection && _eAction != SCR_EA_Ntfy_RebuildSection )
return;
if ( _eAction == SCR_EA_Ntfy_AddSection )
{
// go to end of file (we need all file directive to load this section)
SCR_fn_v_SvL1_ToEndSection(_p_stFile);
SCR_M_SvL0_SaveBlankLine (_p_stFile);
}
GMT_tdxHandleToGameMaterial hEngineMaterial = p_oEditorMaterial->m_hGetEngineMaterial();
// construct section name (hack: szSectionName is here as an anti-bug for ...Split...
char szSectionName[SCR_CV_ui_Cfg_MaxLenName],szAction[SCR_CV_ui_Cfg_MaxLenName],szId[SCR_CV_ui_Cfg_MaxLenName];
SCR_fn_v_RdL0_SplitSectionName(_p_szSectionName, szSectionName, szAction, szId);
SCR_fn_v_RdL0_ComputeSectionName(szSectionName, NULL, szAction, szId);
// save begin section for the game material
SCR_M_SvL0_SaveBeginSection(_p_stFile, szSectionName, SCR_CC_C_Cfg_EOL);
// save each ministructure
ACP_tdxHandleOfMaterial hMaterialVisual = GMT_fn_hGetVisualMaterial(hEngineMaterial);
if ( hMaterialVisual )
{
CString csKey;
/*char *pszKey = GLI_p_cSearchValueInLinkTableOfGeometric((unsigned long) hMaterialVisual);
if ( pszKey )
csKey = pszKey;
else*/
csKey = gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hMaterialVisual)->GetReferencedSectionName();
SCR_M_SvL0_SaveEntry(_p_stFile, C_EntryVisualGameMaterialToLoad, SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP( _p_stFile, SCR_EF_SvL0_Normal, 1, (char *)LPCTSTR(csKey));
}
DNM_tdxHandleToMecMatCharacteristics hMaterialMechanics = GMT_fn_hGetMechanicsMaterial(hEngineMaterial);
if ( DNM_fn_bIsMatCharacteristicsValid(hMaterialMechanics) )
{
CString csKey;
/*char *pszKey = DNM_fn_p_cSearchValueInLinkTableOfMecMatCharacteristics((unsigned long) hMaterialMechanics);
if ( pszKey )
csKey = pszKey;
else*/
csKey = gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hMaterialMechanics)->GetReferencedSectionName();
SCR_M_SvL0_SaveEntry(_p_stFile, C_EntryMechanicalMaterialToLoad, SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP( _p_stFile, SCR_EF_SvL0_Normal, 1, (char *)LPCTSTR(csKey));
}
GMT_tdxHandleToCollideMaterial hMaterialCollide = GMT_fn_hGetCollideMaterial(hEngineMaterial);
if ( hMaterialCollide != GMT_C_InvalidCollideMaterial )
{
CString csKey;
/*SCR_tdst_Link_Table *p_stLinkTable = GMT_fn_p_stGetZoneLinkTable();
char *pszKey = SCR_M_p_sz_Link_GetKey(SCR_fnp_st_Link_SearchValue(p_stLinkTable, (unsigned long) hMaterialCollide));
if ( pszKey )
csKey = pszKey;
else*/
csKey = gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hMaterialCollide)->GetReferencedSectionName();
SCR_M_SvL0_SaveEntry(_p_stFile, C_EntryCollideMaterialToLoad, SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP( _p_stFile, SCR_EF_SvL0_Normal, 1, (char *)LPCTSTR(csKey));
}
SND_tdxHandleToSoundMaterial hMaterialSound = GMT_fn_hGetSoundMaterial(hEngineMaterial);
if ( hMaterialSound != GMT_C_InvalidSoundMaterial )
{
SCR_M_SvL0_SaveEntry(_p_stFile, C_EntrySoundMaterial, SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP( _p_stFile, SCR_EF_SvL0_ArrayLong, 2, 1, &hMaterialSound);
}
// End Section
SCR_M_SvL0_SaveEndSection(_p_stFile, SCR_CC_C_Cfg_EOL);
// update Section name
//now the section exists, if this was not the case
p_oEditorMaterial->fn_vSectionSaved(); // the section is saved and has no pending notification
}
//=================================================================================
//=================================================================================
//=================================================================================
// static functions for the class
//=================================================================================
//=================================================================================
//=================================================================================
SCR_tdst_Link_Table *tdoEditorGameMaterial::m_p_stGetAssociatedLinkTable()
{
return GMT_fn_p_stGetLinkTable();
}
BOOL tdoEditorGameMaterial::m_bIsEngineMaterialValid(GMT_tdxHandleToGameMaterial _hGameMaterial)
{
return GMT_fn_b_ulIsValid(_hGameMaterial);
}
/*CString tdoEditorGameMaterial::m_csGetBaseDataPath()
{
return fn_szGetGameMaterialDataPath();
}*/
void tdoEditorGameMaterial::m_vInvalidateEngineMaterial(GMT_tdxHandleToGameMaterial &r_hGameMaterial)
{
GMT_fn_vInvalidate(&r_hGameMaterial);
}
CString tdoEditorGameMaterial::m_csGetMaterialType()
{
return C_szGameMaterialTypeName;
}
CString tdoEditorGameMaterial::m_csGetScriptExtension()
{
return ".gmt";
}
//ROMTEAM WorldEditor (Cristi Petrescu 11/12/97)
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Method : word tdoEditorGameMaterial::m_uwTypeOfZonesUsingMe (void)
// Date : 97.12.11
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Description :
// Tells which zone types are using this material
// The result is a word of bit flags
// Uses the coherence manager to find the objects using the material
// Author : Cristi Petrescu
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Modification :
// Date :
// By :
//////////////////////////////////////////////////////////////////////////////////////////////////////
WORD tdoEditorGameMaterial::m_uwTypeOfZonesUsingMe (void)
{
CList< CPA_BaseObject *, CPA_BaseObject *> oFatherList;
int iNoObjects;
WORD uwResult = 0;
iNoObjects = g_oCoherenceManager . m_fn_iGetFatherList (this, & oFatherList);
if (iNoObjects)
{
POSITION xPos;
CPA_BaseObject* poBaseObject;
//quite useless to do this inside the loop, eh ?
CPA_EditorBase *poZoneEditor = gs_p_oMaterialInterface -> GetMainWorld () -> GetEditorByName ("Zone");
ASSERT (poZoneEditor);
for ( xPos=oFatherList.GetHeadPosition(); xPos; oFatherList.GetNext(xPos) )
{
poBaseObject = oFatherList.GetAt (xPos);
// see Material_ApplyMaterialModif::Material_ApplyMaterialModif for comments
long lEngineType = poZoneEditor -> OnQueryAction (gs_p_oMaterialInterface, C_uiQueryTypeOfZoneByGeometricObject, (long) poBaseObject);
switch (lEngineType)
{
case C_lZDE:
uwResult |= GMT_C_uwZDE;
break;
case C_lZDM:
uwResult |= GMT_C_uwZDM;
break;
case C_lZDR:
uwResult |= GMT_C_uwZDR;
break;
// those last three are unused by the collision materials, but just in case...
case C_lZDD:
uwResult |= GMT_C_uwZDD;
break;
case C_lBoundingVolume:
uwResult |= GMT_C_uwBoundingVolume;
break;
}
}
}
return uwResult;
}
//ENDROMTEAM WorldEditor (Cristi Petrescu)

View File

@@ -0,0 +1,75 @@
/*=============================================================================
*
* Filename: GMatObj.hpp
* Version: 1.0
* Date: 06/11/96
* Author: B.G.
*
* Description: editor material class
*
*===========================================================================*/
#ifndef __GMATOBJ_HPP__
#define __GMATOBJ_HPP__
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
#include <afxtempl.h>
#include <afxcview.h>
#include "Acp_base.h"
#include "itf.h"
#include "gmt.h"
#include "scr.h"
#include "dpt.h"
#include "x:\cpa\main\inc\_editid.h" //TODO: replace with "mai.h" some day
class tdoEditorGameMaterial : public CPA_SaveObject
{
public:
tdoEditorGameMaterial(
CPA_FileObject *_p_oOwnerFile,
CString _csId,
BOOL _bSectionAlreadyExists,
GMT_tdxHandleToGameMaterial _hTemplateMaterial
);
~tdoEditorGameMaterial();
GMT_tdxHandleToGameMaterial m_hGetEngineMaterial() { return m_hGameMaterial; }
static void m_vCallBackSaveGMT( // save the whole game material section
SCR_tdst_File_Description *_p_stFile,
char *_p_szSectionName,
void *_p_vData,
SCR_tde_Ntfy_Action _eAction
);
void m_vLoadAssociatedEngineMaterial(BOOL _bEndOfLoad = TRUE);
void m_vAssociateEngineMaterial(GMT_tdxHandleToGameMaterial _hGameMaterial, BOOL _bSectionAlreadyExists);
BOOL m_bIsReferenced();
static SCR_tdst_Link_Table *m_p_stGetAssociatedLinkTable();
static BOOL m_bIsEngineMaterialValid(GMT_tdxHandleToGameMaterial _hGameMaterial);
//static CString m_csGetBaseDataPath();
static void m_vInvalidateEngineMaterial(GMT_tdxHandleToGameMaterial &r_hGameMaterial);
static CString m_csGetMaterialType();
static CString m_csGetScriptExtension();
//overloads from base class
virtual void *GetData(void) { return m_hGameMaterial; }
virtual long GetDataType(void) { return 0; };
//virtual void fn_vNotify(SCR_tde_Ntfy_Action _eAction);
//CString GetReferencedSectionName(void);
//for internal use only!
virtual tdeMissingCriteria fn_eCheckUnicity(const CString csNewName) { return fn_eCheckUnicityWithOwner(csNewName); }
//ROMTEAM WorldEditor (Cristi Petrescu 11/12/97)
WORD m_uwTypeOfZonesUsingMe (void);
//ENDROMTEAM WorldEditor (Cristi Petrescu)
private:
GMT_tdxHandleToGameMaterial m_hGameMaterial;
};
#endif /* __GMATOBJ_HPP__ */

View File

@@ -0,0 +1,260 @@
//
/*=============================================================================
*
* Filename: MMatObj.cpp
* Version: 1.0
* Date: 06/11/96
* Author: B.G.
*
* Description: implementation of editor material class
*
*===========================================================================*/
#include "stdafx.h"
#include "Acp_base.h"
#include "itf.h"
#include "gmt.h"
#include "IncMEC.h"
#include "gli.h"
#include "x:\cpa\main\inc\_editid.h"
#include "inctex.h"
#include "_interf.hpp"
#include "MMatObj.hpp"
extern Material_Interface *gs_p_oMaterialInterface;
//=================================================================================
//=================================================================================
//=================================================================================
//constructor. the object is name with the following rules
//1. it is not a clone but will directly handle the engine material
// -> will take the name from the section for the engine material
//2. it is a clone, and a name is specified
// -> an underscore is added to the original's name,
// because someday the base constructor will add a number there
//3. it is a clone, and no name is specified
// -> the default name is given by the base constructor
//=================================================================================
tdoEditorMechanicsMaterial::tdoEditorMechanicsMaterial(
CPA_FileObject *_p_oOwnerFile,
CString _csId,
BOOL _bSectionAlreadyExists,
DNM_tdxHandleToMecMatCharacteristics _hTemplateMechanicsMaterial
)
: CPA_SaveObject(
gs_p_oMaterialInterface, //editor
C_szMechanicsMaterialTypeName, //type
E_ss_Responsible, //responsibility
_p_oOwnerFile, //owner (the file containing the section)
FALSE, //available
(char*)LPCTSTR(_p_oOwnerFile->GetCompletionPath(gs_p_oMaterialInterface, C_szFileReferencedNameKey)), //data path to complete the referenced section name
m_vCallBackSaveMMT//callback
)
{
//tell the file object that an object exists for its section
g_oCoherenceManager.m_fn_vAddALink(_p_oOwnerFile, this);
//the editor object directly handles the engine object
m_hMechanicsMaterial = _hTemplateMechanicsMaterial;
SetAvailable(DNM_fn_bIsMatCharacteristicsValid(_hTemplateMechanicsMaterial));
// construct section name (hack: szSectionName is here as an anti-bug for ...Split...
char szSectionName[SCR_CV_ui_Cfg_MaxLenName];
SCR_fn_v_RdL0_ComputeSectionName(
szSectionName,
(char*)LPCTSTR(_p_oOwnerFile->GetReferencedName(gs_p_oMaterialInterface, C_szFileReferencedNameKey)),
C_SectionMecMatCharacteristics,
(char*)LPCTSTR(_csId)
);
// section object
SetSectionData(this);
SetReferencedSectionName(szSectionName);
// name
if ( fn_eRename(_csId) != E_mc_None )
SetDefaultValidName() ;
fn_vUpdateSectionName() ;
if ( _bSectionAlreadyExists )
fn_vSectionSaved(); //the section is saved, and has no pending notification
else
fn_vSectionDeleted(); //the section does not exist, and has no pending nofitication
if ( fn_bCanBeNotified() && !fn_bSectionExists() )
fn_vNotifySave() ;
m_bIsHighlighted = FALSE;
m_stHighlightColor.xR = (GEO_tdxColorValue) 0.7;
m_stHighlightColor.xG = (GEO_tdxColorValue) 0.3;
m_stHighlightColor.xB = (GEO_tdxColorValue) 0.0;
}
//=================================================================================
//=================================================================================
tdoEditorMechanicsMaterial::~tdoEditorMechanicsMaterial()
{
//remove myself totally from the coherence manager database
if ( !fn_bSectionExists() )
g_oCoherenceManager.m_fn_vRemoveAllLinks(this, C_cLinkedAsChild);
}
//=================================================================================
//=================================================================================
void tdoEditorMechanicsMaterial::m_vAssociateEngineMaterial(
DNM_tdxHandleToMecMatCharacteristics _hMechanicsMaterial,
BOOL /*_bSectionAlreadyExists*/
)
{
//make the list update the data sort order
fn_vUpdateData(_hMechanicsMaterial);
//now we can set the value that will be returned by GetData()
m_hMechanicsMaterial = _hMechanicsMaterial;
SetAvailable(DNM_fn_bIsMatCharacteristicsValid(_hMechanicsMaterial));
}
//================================================================================
//================================================================================
BOOL tdoEditorMechanicsMaterial::m_bIsReferenced()
{
return g_oCoherenceManager.m_fn_iGetFatherCount(this) > 1;
}
//=================================================================================
//=================================================================================
void tdoEditorMechanicsMaterial::m_vLoadAssociatedEngineMaterial()
{
if ( !fn_bIsAvailable() )
{
//if the section name is not in the linktable, analyse the section
SCR_tdst_Cxt_Values *p_stAnalyzeResult = SCR_fnp_st_RdL0_AnalyseSection(
(char *) LPCTSTR(GetReferencedSectionName()),
SCR_CDF_uw_Anl_Normal
);
DNM_tdxHandleToMecMatCharacteristics hMechanicsMaterial = (DNM_tdxHandleToMecMatCharacteristics) p_stAnalyzeResult->a_ulValues[0];
//there must not already exist an editor material for the loaded game material!
ASSERT(!gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hMechanicsMaterial));
//create the association
m_vAssociateEngineMaterial(hMechanicsMaterial, TRUE);
}
}
/*=================================================================================
//save a section of the form:
{MechanicalMaterial:<name>
Adhesion(0.0603564)
Absorption(0.0603564)
Friction(0.0603564)
Slide(0.0603564)
Progression(0.0603564)
PenetrationSpeed(0.0603564)
PenetrationMax(0.0603564)
}
//=================================================================================*/
void tdoEditorMechanicsMaterial::m_vCallBackSaveMMT(
SCR_tdst_File_Description *_p_stFile,
char *_p_szSectionName,
void *_p_vData,
SCR_tde_Ntfy_Action _eAction
)
{
tdoEditorMechanicsMaterial *p_oEditorMaterial = (tdoEditorMechanicsMaterial *) _p_vData;
if ( _eAction == SCR_EA_Ntfy_DeleteSection )
//now the section exists, if this was not the case
p_oEditorMaterial->fn_vSectionDeleted(); //the section does not exist, and has no pending nofitication
if ( _eAction != SCR_EA_Ntfy_AddSection && _eAction != SCR_EA_Ntfy_RebuildSection )
return;
if ( _eAction == SCR_EA_Ntfy_AddSection )
{
// go to end of file (we need all file directive to load this section)
SCR_fn_v_SvL1_ToEndSection(_p_stFile);
SCR_M_SvL0_SaveBlankLine (_p_stFile);
}
char szSectionName[SCR_CV_ui_Cfg_MaxLenName],szAction[SCR_CV_ui_Cfg_MaxLenName],szId[SCR_CV_ui_Cfg_MaxLenName];
// construct section name (hack: szSectionName is here as an anti-bug for ...Split...
SCR_fn_v_RdL0_SplitSectionName(_p_szSectionName, szSectionName, szAction, szId);
SCR_fn_v_RdL0_ComputeSectionName(szSectionName, NULL, szAction, szId);
// save begin section for the game material (action == MechanicalMaterial)
SCR_M_SvL0_SaveBeginSection(_p_stFile, szSectionName, SCR_CC_C_Cfg_EOL);
//get the handles we need
DNM_tdxHandleToMecMatCharacteristics hMaterialMechanics = p_oEditorMaterial->m_hGetEngineMaterial();
//get the parameters we want to save
MTH_tdxReal xCoeff;
xCoeff = DNM_fn_xMatCharacteristicsGetSlide (hMaterialMechanics);
SCR_M_SvL0_SaveEntry(_p_stFile, C_EntrySlide, SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile, SCR_EF_SvL0_ArrayFloat, 2, 1, &xCoeff);
xCoeff = DNM_fn_xMatCharacteristicsGetRebound (hMaterialMechanics);
SCR_M_SvL0_SaveEntry(_p_stFile, C_EntryRebound, SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile, SCR_EF_SvL0_ArrayFloat, 2, 1, &xCoeff);
// End Section
SCR_M_SvL0_SaveEndSection(_p_stFile, SCR_CC_C_Cfg_EOL);
//now the section exists, if this was not the case
p_oEditorMaterial->fn_vSectionSaved(); // the section is saved and has no pending notification
}
//=================================================================================
//=================================================================================
BOOL tdoEditorMechanicsMaterial::m_bGetHighlightColor(GEO_tdstColor *_p_stColor /*= NULL*/)
{
if ( m_bIsHighlighted && _p_stColor )
*_p_stColor = m_stHighlightColor;
return m_bIsHighlighted;
}
//=================================================================================
//=================================================================================
void tdoEditorMechanicsMaterial::m_vSetHighlightColor(GEO_tdstColor _stColor)
{
m_stHighlightColor = _stColor;
}
//=================================================================================
//=================================================================================
//=================================================================================
// static functions for the class
//=================================================================================
//=================================================================================
//=================================================================================
SCR_tdst_Link_Table *tdoEditorMechanicsMaterial::m_p_stGetAssociatedLinkTable()
{
return DNM_fn_p_stGetLinkTableOfMecMatCharacteristics();
}
BOOL tdoEditorMechanicsMaterial::m_bIsEngineMaterialValid(DNM_tdxHandleToMecMatCharacteristics _hMechanicsMaterial)
{
return DNM_fn_bIsMatCharacteristicsValid(_hMechanicsMaterial);
}
/*CString tdoEditorMechanicsMaterial::m_csGetBaseDataPath()
{
return fn_szGetMechanicsMaterialDataPath();
}*/
void tdoEditorMechanicsMaterial::m_vInvalidateEngineMaterial(DNM_tdxHandleToMecMatCharacteristics &r_hMechanicsMaterial)
{
DNM_fn_vInvalidateMatCharacteristics(&r_hMechanicsMaterial);
}
CString tdoEditorMechanicsMaterial::m_csGetMaterialType()
{
return C_szMechanicsMaterialTypeName;
}
CString tdoEditorMechanicsMaterial::m_csGetScriptExtension()
{
return ".mmt";
}

View File

@@ -0,0 +1,77 @@
/*=============================================================================
*
* Filename: MMatObj.hpp
* Version: 1.0
* Date: 06/11/96
* Author: B.G.
*
* Description: editor material class
*
*===========================================================================*/
#ifndef __MMATOBJ_HPP__
#define __MMATOBJ_HPP__
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
#include <afxtempl.h>
#include <afxcview.h>
#include "Acp_base.h"
#include "itf.h"
#include "gmt.h"
#include "scr.h"
#include "dpt.h"
#include "x:\cpa\main\inc\_editid.h" //TODO: replace with "mai.h" some day
class tdoEditorMechanicsMaterial : public CPA_SaveObject
{
public:
tdoEditorMechanicsMaterial(
CPA_FileObject *_p_oOwnerFile,
CString _csId,
BOOL _bSectionAlreadyExists,
DNM_tdxHandleToMecMatCharacteristics _hTemplateMechanicsMaterial
);
~tdoEditorMechanicsMaterial();
DNM_tdxHandleToMecMatCharacteristics m_hGetEngineMaterial() { return m_hMechanicsMaterial; }
static void m_vCallBackSaveMMT( // save the mechanics material section
SCR_tdst_File_Description *_p_stFile,
char *_p_szSectionName,
void *_p_vData,
SCR_tde_Ntfy_Action _eAction
);
void m_vAssociateEngineMaterial(DNM_tdxHandleToMecMatCharacteristics _hMechanicsMaterial, BOOL _bSectionAlreadyExists);
BOOL m_bIsReferenced();
void m_vLoadAssociatedEngineMaterial();
BOOL m_bGetHighlightColor(GEO_tdstColor *_p_stColor = NULL);
void m_vSetHighlightColor(GEO_tdstColor _stColor);
void m_vEnableHighlight(BOOL _bEnable = TRUE) { m_bIsHighlighted = _bEnable; }
static SCR_tdst_Link_Table *m_p_stGetAssociatedLinkTable();
static BOOL m_bIsEngineMaterialValid(DNM_tdxHandleToMecMatCharacteristics _hMechanicsMaterial);
//static CString m_csGetBaseDataPath();
static void m_vInvalidateEngineMaterial(DNM_tdxHandleToMecMatCharacteristics &r_hMechanicsMaterial);
static CString m_csGetMaterialType();
static CString m_csGetScriptExtension();
//overloads from base class
virtual void *GetData(void) { return m_hMechanicsMaterial; }
virtual long GetDataType(void) { return 0; };
virtual tdeMissingCriteria fn_eCheckUnicity(const CString csNewName) { return fn_eCheckUnicityWithOwner(csNewName); }
//virtual void fn_vNotify(SCR_tde_Ntfy_Action _eAction);
//CString GetReferencedSectionName(void);
private:
DNM_tdxHandleToMecMatCharacteristics m_hMechanicsMaterial;
BOOL m_bIsHighlighted;
GEO_tdstColor m_stHighlightColor;
};
#endif /* __MMATOBJ_HPP__ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,163 @@
/*=============================================================================
*
* Filename: MatList.hpp
* Version: 1.0
* Date: 06/11/96
* Author: V.L.
*
* Description: interface of MaterialList view
*
*===========================================================================*/
#ifndef __MATLIST_HPP__
#define __MATLIST_HPP__
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
#include <afxtempl.h>
#include <afxcview.h>
#include "Acp_base.h"
#include "itf.h"
#include "gmt.h"
//#include "Sort3Lst.hpp"
//#include "cpamdf.hpp"
class Material_Interface;
class tdoEditorGameMaterial;
class tdoEditorVisualMaterial;
class tdoDeleteEngineMechanicsModif;
class tdoDeleteEngineCollideModif;
class Geometry3D;
/*=============================================================================
* C3ListView : view that display a ThreeSortedList
=============================================================================*/
#define C_szNoBitmapName "edt_data\\tools\\Material\\NoBitmap.bmp"
#define C_szUnviewableBitmapName "edt_data\\tools\\Material\\UnviewableBitmap.bmp"
class CMaterialListView : public C3ListView
{
friend class Material_ApplyMaterialModif;
friend class Material_CreateOrCopyMaterialModif;
friend class Material_DestroyMaterialModif;
DECLARE_DYNCREATE(CMaterialListView)
protected:
Material_Interface *m_p_oInterface;
BOOL m_bDisplayAll;
CBitmap m_oHatchBitmap;
CBrush m_oHatchBrush;
public:
CMaterialListView();
~CMaterialListView();
void m_fn_vSetInterface( Material_Interface *_p_oInterface){ m_p_oInterface = _p_oInterface; }
void m_fn_vChangeSelectedItemImage( int iImage );
void m_fn_vRedrawSelectedItem(int iItem = -1);
void m_vResetMaterialItemTexture(tdoEditorGameMaterial *_p_oGameMaterial);
void m_fn_vSelectMaterial(tdoEditorGameMaterial *_p_oGameMaterial);
int m_fn_iFindMaterial(tdoEditorGameMaterial *_p_oGameMaterial);
int m_iGetTextureIndexForGameMaterial(tdoEditorGameMaterial *_p_oGameMaterial, BOOL _bLoadIfNotFound);
void m_vAnalyzeAllMaterials();
void m_fn_vCreateNewMaterial(tdoEditorGameMaterial *_p_oTemplateMaterial, CString _csName);
void m_fn_vDeleteMaterial(tdoEditorGameMaterial *_p_oMaterialToDelete);
void m_vBitmapListWasRefreshed(void);
void m_vRefreshDisplayedMaterialList(BOOL _bAllMaterials, BOOL _bKillAll = FALSE);
BOOL m_bAllMaterialsDisplayed() { return m_bDisplayAll; }
void m_vSetMaterialDisplayFilter(BOOL _bFilter) { m_bDisplayAll = !_bFilter; }
void m_vRememberSpecialImage(short _wImage) { m_wSpecialImage = _wImage; }
void m_vApplyCurrentMaterialToObjectUnderCursor(HIE_tdstPickInfo *_p_stPickInfo);
//so that the interface can fake a selection
void OnSelectItem( short wCase );
protected:
virtual void _OnCommand(short _wMenuId);
virtual void _InitPopupMenu(CMenu &r_oMenu, short wFirstValue);
virtual void m_fn_vOverriddenDrawItem(short wItem, CDC *pDC, RECT *rect);
short m_wSpecialImage;
// Generated message map functions
//{{AFX_MSG(CMaterialListView)
afx_msg void OnLButtonDown(UINT nFlags, CPoint pt );
afx_msg int OnCreate( LPCREATESTRUCT );
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class Material_ApplyMaterialModif : public CPA_Modif
{
public:
Material_ApplyMaterialModif(HIE_tdstPickInfo &_r_a_stPickInfo);
~Material_ApplyMaterialModif() {};
BOOL Do();
BOOL Undo();
BOOL m_bDoIt(
tdoEditorGameMaterial *m_p_oMaterialBeforeDo,
tdoEditorGameMaterial *m_p_oMaterialAfterDo,
BOOL _bSplitElement
);
protected:
private:
CMaterialListView *m_p_oMaterialListView;
Geometry3D *m_p_oGeometry;
ACP_tdxIndex m_xPickedElement, m_xIndexInElement;
ACP_tdxIndex m_xElementFMD, m_xFaceFMD; //for IT to FMD face displacement
BOOL m_bSwingFace; //for IT to FMD face displacement
tdoEditorGameMaterial *m_p_oMaterialBeforeDo, *m_p_oMaterialAfterDo;
};
class Material_CreateOrCopyMaterialModif : public CPA_Modif
{
public:
Material_CreateOrCopyMaterialModif(
tdoEditorGameMaterial *_p_oTemplateMaterial,
CString _csName
);
~Material_CreateOrCopyMaterialModif();
BOOL Do();
BOOL Undo();
protected:
private:
Material_DestroyMaterialModif *m_p_oDestroyModif;
CMaterialListView *m_p_oMaterialListView;
GMT_tdxHandleToGameMaterial m_hTemplateMaterial;
CString m_csNameToGive;
};
class Material_DestroyMaterialModif : public CPA_Modif
{
public:
Material_DestroyMaterialModif(tdoEditorGameMaterial *_p_oDeletedGameMaterial);
~Material_DestroyMaterialModif();
BOOL Do();
BOOL Undo();
protected:
private:
BOOL m_bMaterialWasInList;
CMaterialListView *m_p_oMaterialListView;
tdoEditorGameMaterial *m_p_oDeletedGameMaterial;
tdoEditorVisualMaterial *m_p_oDeletedVisualMaterial;
//modifs to handle the destruction of the referenced submaterials
tdoDeleteEngineMechanicsModif *m_p_oDeleteEngineMechanicsModif;
tdoDeleteEngineCollideModif *m_p_oDeleteEngineCollideModif;
/*long m_lIndexBeforeDo;
short m_wItemImageIndex;*/
};
#endif /* __MATLIST_HPP__ */

View File

@@ -0,0 +1,10 @@
LIBRARY
EXPORTS
fn_p_szGetCPAVersion
fn_p_stGetDLLIdentity
fn_p_oGetDLL
fn_vInitDll
SECTIONS
.data READ WRITE

View File

@@ -0,0 +1,115 @@
/*=============================================================================
*
* Filename: MatList.cpp
* Version: 1.0
* Date: 06/11/96
* Author: V.L.
*
* Description: implementation of MaterialList view
*
*===========================================================================*/
#include "stdafx.h"
#include "Acp_base.h"
#include "itf.h"
#include "incgam.h"
#include "_interf.hpp"
#include "PatternList.hpp"
#include "TGMDef.hpp"
#include "matres.h"
extern Material_Interface *gs_p_oMaterialInterface;
//=============================================================================
// Description : Message map
//=============================================================================
BEGIN_MESSAGE_MAP(CPatternedListView, C3ListView)
//{{AFX_MSG_MAP(CPatternedListView)
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//=============================================================================
// Description : constructor
//=============================================================================
CPatternedListView::CPatternedListView() : C3ListView()
{
m_fn_vSetBox(C_cDisplayBitmapAndText, C_wListViewBTItemWidth, C_wListViewBTItemHeight);
m_fn_vSetBox(C_cDisplayBitmap, C_wListViewBItemWidth, C_wListViewBItemHeight);
m_fn_vSetBox(C_cDisplayText, C_wListViewTItemWidth, C_wListViewTItemHeight);
//m_fn_vDisableMenuItem(TLVM_lOrder);
m_oHatchBitmap.LoadBitmap(IDB_BITMAP_HATCHED);
m_oHatchBrush.CreatePatternBrush(&m_oHatchBitmap);
m_fn_vSetBitmapList(NULL);
m_wSpecialImage = TSL_cItemNotFound;
}
//=============================================================================
// Description : destructor
//=============================================================================
CPatternedListView::~CPatternedListView()
{
}
//=============================================================================
// Description : Create view
//=============================================================================
int CPatternedListView::OnCreate( LPCREATESTRUCT _p_stCreateStruct )
{
if (C3ListView::OnCreate( _p_stCreateStruct ) == -1)
return -1;
m_cDisplayType = C_cDisplayBitmapAndText;
return 0;
}
//=============================================================================
// Description : on draw item
//=============================================================================
void CPatternedListView::m_fn_vOverriddenDrawItem( short wItem, CDC *pDC, RECT *rect)
{
BOOL bSelected;
//if the item was not loaded by engine, select a gray background
CBrush *p_oOldBrush = NULL;
//CBrush oGrayBrush(HS_BDIAGONAL, RGB(200, 100, 70));
//CBrush oGrayBrush(CBitmap::FromHandle(m_hHatchBitmap))
if ( !m_fn_lGetContent( wItem, m_cCurrentOrder ) ) //no value associated to the image: display with alternate background
p_oOldBrush = pDC->SelectObject(&m_oHatchBrush);
//draw the item normally, with a special text for items with this image (in text only-mode)
m_fn_vDrawItem( wItem, pDC, rect, m_wSpecialImage);
//restore the original background
if ( p_oOldBrush )
pDC->SelectObject(p_oOldBrush);
// reinvert rectangle if item is selected
bSelected = m_fn_bIsItemSelected(wItem, m_cCurrentOrder);
if (bSelected)
pDC->InvertRect( rect );
if (bSelected)
pDC->InvertRect( rect );
}
//=============================================================================
// Description : redraw selected item
// called by CMaterialDescDlg when visuel change
//=============================================================================
/*void CPatternedListView::m_fn_vRedrawSelectedItem(int iItem /*= -1* /)
{
if ( iItem == TSL_cItemNotFound )
iItem = m_fn_lGetSelectedItem(m_cCurrentOrder);
RECT rect;
m_fn_vGetCaseRect((short) iItem, &rect);
rect.top -= GetScrollPosition().y;
rect.bottom -= GetScrollPosition().y;
rect.left -= GetScrollPosition().x;
rect.right -= GetScrollPosition().x;
InvalidateRect( &rect );
}*/

View File

@@ -0,0 +1,67 @@
/*=============================================================================
*
* Filename: MatList.hpp
* Version: 1.0
* Date: 06/11/96
* Author: V.L.
*
* Description: interface of MaterialList view
*
*===========================================================================*/
#ifndef __PATTERNLIST_HPP__
#define __PATTERNLIST_HPP__
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
#include <afxtempl.h>
#include <afxcview.h>
#include "Acp_base.h"
#include "itf.h"
#include "gmt.h"
//#include "Sort3Lst.hpp"
//#include "cpamdf.hpp"
class Material_Interface;
class tdoEditorGameMaterial;
class tdoEditorVisualMaterial;
class tdoDeleteEngineMechanicsModif;
class tdoDeleteEngineCollideModif;
class Geometry3D;
/*=============================================================================
* C3ListView : view that display a ThreeSortedList
=============================================================================*/
#define C_szNoBitmapName "edt_data\\tools\\Material\\NoBitmap.bmp"
#define C_szUnviewableBitmapName "edt_data\\tools\\Material\\UnviewableBitmap.bmp"
class CPatternedListView : public C3ListView
{
protected:
CBitmap m_oHatchBitmap;
CBrush m_oHatchBrush;
public:
CPatternedListView();
~CPatternedListView();
void m_fn_vRedrawSelectedItem(int iItem = -1);
protected:
virtual void m_fn_vOverriddenDrawItem(short wItem, CDC *pDC, RECT *rect);
short m_wSpecialImage;
// Generated message map functions
//{{AFX_MSG(CPatternedListView)
afx_msg int OnCreate( LPCREATESTRUCT );
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif /* __PATTERNLIST_HPP__ */

View File

@@ -0,0 +1,6 @@
// stdafx.cpp : source file that includes just the standard includes
// ACPProject.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

View File

@@ -0,0 +1,18 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#ifndef __STDAAFX_H__
#define __STDAAFX_H__
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows 95 Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#endif //__STDAAFX_H__

View File

@@ -0,0 +1,66 @@
#ifndef __MaterialDefines_HPP__
#define __MaterialDefines_HPP__
#ifdef ACTIVE_EDITOR
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
#define C_szActivationModeNever "Never"
#define C_szActivationModeOnce "Once"
#define C_szActivationModeAlways "Always"
#define C_szFileNameForDefaultMaterial "Common\\Common.gmt"
#define C_szNameOfDefaultMaterial "Default"
#define C_szNoMaterialComboEntry "Nothing"
#define C_wTextureSize 48
#define C_wListViewTItemWidth 105
#define C_wListViewTItemHeight 20
#define C_wListViewBItemWidth (C_wTextureSize + 2)
#define C_wListViewBItemHeight (C_wTextureSize + 2)
#define C_wListViewBTItemWidth C_wListViewTItemWidth
#define C_wListViewBTItemHeight (C_wListViewBItemHeight + C_wListViewTItemHeight)
#define C_wListViewPlusPathWidth 40
#define C_szDefaultLeftPaneWidth "274"
#define C_szDefaultVisualPaneHeight "171"
#define C_szDefaultMechanicsPaneHeight "314"
#define C_szDefaultCollidePaneHeight "311"
#define C_szDefaultSoundPaneHeight "70"
#define C_szDefaultMainPaneHeight "104"
#define C_szDefaultTexturePaneWidth "309"
#define C_szDefaultListPaneWidth "683"
#define C_szDefaultMaterialListHeight "169"
#define C_szDisplayFilterEnabled "Used"
#define C_szDisplayFilterDisabled "All"
#define C_szDefaultDisplayFilter C_szDisplayFilterEnabled
#define C_szDefaultLoadWarningsActivation C_szActivationModeAlways
#define C_szPreferencesProfileSection "Material Editor Preferences"
#define C_szMechanicsHighlightProfileSection "Mechanical Characteristics Highlighting"
#define C_szCollideHighlightProfileSection "Mechanical Characteristics Highlighting"
#define C_szDisplayModeProfileString "Display Mode"
#define C_szDisplayMaterialUnderCursorProfileString "Show Material Under Cursor"
#define C_szLeftPaneWidthProfileString "Left Pane Width"
#define C_szVisualPaneHeightProfileString "Visual Pane Height"
#define C_szMechanicsPaneHeightProfileString "Mechanics Pane Height"
#define C_szCollidePaneHeightProfileString "Collide Pane Height"
#define C_szMainPaneHeightProfileString "Main Pane Height"
#define C_szSoundPaneHeightProfileString "Sound Pane Height"
#define C_szMaterialListHeightProfileString "Material List Height"
#define C_szTexturePaneWidthProfileString "Texture Pane Width"
#define C_szListPaneWidthProfileString "List Pane Width"
#define C_szLoadWarningsActivationProfileString "Load Warnings"
#endif // ACTIVE_EDITOR
#endif // __MaterialDefines_HPP__

View File

@@ -0,0 +1,511 @@
//
/*=============================================================================
*
* Filename: TexObj.cpp
* Version: 1.0
* Date: 06/11/96
* Author: B.G.
*
* Description: implementation of editor texture class
*
*===========================================================================*/
#include "stdafx.h"
#include "Acp_base.h"
#include "itf.h"
#include "inctex.h"
#include "VMatObj.hpp"
#include "x:\cpa\main\inc\_editid.h"
#include "_interf.hpp"
#include "TexObj.hpp"
extern Material_Interface *gs_p_oMaterialInterface;
extern FILE *g_xLogFile;
#define C_EntryTextureToLoad "Texture" //TODO: remove when declared by the GMT module
//=================================================================================
//to make sure we dont create an editor texture when one already exists that uses
//the specified bitmap, try to find it
//=================================================================================
/*
tdoEditorTexture *p_oFindEditorTextureForSimilarEngineTexture(GLI_tdstTexture *_p_stTexture)
{
tdoEditorTexture *p_oEditorTexture;
if ( !_p_stTexture )
return NULL;
//first, check if an editor texture has the same engine texture
p_oEditorTexture = gs_p_oMaterialInterface->m_p_oGetEditorMaterialForEngine(_p_stTexture);
if ( p_oEditorTexture )
return p_oEditorTexture;
//here there is no editor texture with the same engine data. Now lets try to find one which has
//an engine data that
CString csName;
//look in the linktable of texture bitmaps if we find it
SCR_tdst_Link_Value *p_stTextureEntry = SCR_fnp_st_Link_SearchValue(GLI_p_stGetLinkTableOfTexture(), (unsigned long) _p_stTexture)
char *pszKey = SCR_M_p_sz_Link_GetKey(p_stTextureEntry);
}
tdoEditorTexture *p_oFindEditorTextureForSimilarEngineTexture(CString _csName)
{
}
*/
//=================================================================================
//=================================================================================
//=================================================================================
//constructor. the object is name with the following rules
//1. it is not a clone but will directly handle the engine material
// -> will take the name from the section for the engine material
//2. it is a clone, and a name is specified
// -> an underscore is added to the original's name,
// because someday the base constructor will add a number there
//3. it is a clone, and no name is specified
// -> the default name is given by the base constructor
//=================================================================================
tdoEditorTexture::tdoEditorTexture(
CPA_FileObject *_p_oOwnerFile,
CString _csId,
BOOL _bSectionAlreadyExists,
GLI_tdstTexture *_hTemplateTexture
)
: CPA_SaveObject(
gs_p_oMaterialInterface, //editor
C_szTextureTypeName, //type
E_ss_Responsible, //responsibility
_p_oOwnerFile, //owner (the file containing the section)
FALSE, //availability
(char*)LPCTSTR(_p_oOwnerFile->GetCompletionPath(gs_p_oMaterialInterface, C_szFileReferencedNameKey)), //data path to complete the referenced section name
m_vCallBackSaveTexture//callback
)
{
//tell the file object that an object exists for its section
g_oCoherenceManager.m_fn_vAddALink(_p_oOwnerFile, this);
m_hTexture = NULL; //default value for insertion in list
// construct section name (hack: szSectionName is here as an anti-bug for ...Split...
char szSectionName[SCR_CV_ui_Cfg_MaxLenName];
SCR_fn_v_RdL0_ComputeSectionName(
szSectionName,
(char*)LPCTSTR(_p_oOwnerFile->GetReferencedName(gs_p_oMaterialInterface, C_szFileReferencedNameKey)),
C_EntryTextureToLoad,
(char*)LPCTSTR(_csId)
);
// section object
if ( _bSectionAlreadyExists )
fn_vSectionSaved(); //the section is saved, and has no pending notification
else
fn_vSectionDeleted(); //the section does not exist, and has no pending nofitication
SetSectionData(this);
SetReferencedSectionName(szSectionName);
// name
if ( fn_eRename(_csId) != E_mc_None )
SetDefaultValidName() ;
fn_vUpdateSectionName() ;
if ( fn_bCanBeNotified() && !fn_bSectionExists() )
fn_vNotifySave() ;
m_vAssociateEngineMaterial(_hTemplateTexture, _bSectionAlreadyExists);
}
//=================================================================================
//=================================================================================
tdoEditorTexture::~tdoEditorTexture()
{
//remove myself totally from the coherence manager database
if ( !fn_bSectionExists() )
g_oCoherenceManager.m_fn_vRemoveAllLinks(this, C_cLinkedAsChild);
}
//=================================================================================
//=================================================================================
void tdoEditorTexture::m_vAssociateEngineMaterial(
GLI_tdstTexture *_hTemplateTexture,
BOOL _bSectionAlreadyExists
)
{
if ( m_hTexture == _hTemplateTexture )
return;
BOOL bIsAssociatedTextureValid = _hTemplateTexture ? TRUE : FALSE;
//a section exists for this object, since we use it directly
if ( _bSectionAlreadyExists )
fn_vSectionSaved(); //the section is saved, and has no pending notification
else
fn_vSectionDeleted(); //the section does not exist, and has no pending nofitication
//if the handle is invalid, the engine texture is not loaded yet
SetAvailable(bIsAssociatedTextureValid);
//set the engine data
fn_vUpdateData(_hTemplateTexture);
m_hTexture = _hTemplateTexture;
if ( bIsAssociatedTextureValid )
{
//try to remember the texture file name
SCR_tdst_Link_Table *p_stTextureLinkTable = GLI_p_stGetLinkTableOfTexture();
SCR_tdst_Link_Value *p_stEntry = SCR_fnp_st_Link_SearchValue(p_stTextureLinkTable, (unsigned long) _hTemplateTexture);
if ( !p_stEntry )
{
if ( gs_p_oMaterialInterface->m_bLoadWarningsAreEnabled() )
AfxMessageBox(
CString("The name of the texture referenced by the section ") + GetReferencedSectionName() +
" cannot be resolved.\n"
"If you save your changes, this section will no longer reference the texture.\n"
"\nThere are two possible causes to this problem:\n"
"\t1 - The texture bitmap does not exist: check the name in the section, and the existence of the file.\n"
"\t2 - This is a known loading limitation of the engine. In this case, warn B. Germain if you read this.",
MB_OK
);
char szTextureName[100];
GLI_vGetTextureName(m_hTexture, szTextureName);
m_vRememberTextureName(szTextureName);
if ( g_xLogFile )
{
//log the error
CString csLogMessage("Unknown texture in section: ");
csLogMessage += GetReferencedSectionName() + " -> ";
csLogMessage += szTextureName;
fprintf(g_xLogFile, "%s\n", LPCTSTR(csLogMessage));
fflush(g_xLogFile);
}
}
else
m_vRememberTextureName(SCR_M_p_sz_Link_GetKey(p_stEntry) + SCR_M_ul_Link_GetAdditionalLong(p_stEntry, 1));
//now handle the supply texture: first try to find the associated editor texture by data
GLI_tdstTexture *p_stSupplyTexture = TEX_p_tdstGetSupplyTexture(_hTemplateTexture);
tdoEditorTexture *p_oEditorSupplyTexture = NULL;
if
(
p_stSupplyTexture
&& !(p_oEditorSupplyTexture = (tdoEditorTexture *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(p_stSupplyTexture))
)
{
CString csName;
CPA_FileObject *p_oFileObject = NULL;
SCR_tdst_Link_Value *p_stTextureEntry;
//try to find the supply texture name in the linktable
if ( p_stTextureEntry = SCR_fnp_st_Link_SearchValue(GLI_p_stGetLinkTableOfTextureSection(), (unsigned long) p_stSupplyTexture) )
{
char *pszKey = SCR_M_p_sz_Link_GetKey(p_stTextureEntry);
char szTextureFile[SCR_CV_ui_Cfg_MaxLenName], szTextureName[SCR_CV_ui_Cfg_MaxLenName];
//get the short name from the linktable entry
SCR_fn_v_RdL0_SplitSectionName(pszKey, szTextureFile, NULL, szTextureName);
//get the file object for this referenced path
p_oFileObject = p_oGetFileObjectForCompletePath(szTextureFile);
csName = szTextureName;
//try to find an editor texture based upon the name before creating a new one
p_oEditorSupplyTexture = (tdoEditorTexture *) gs_p_oMaterialInterface->GetBaseObject(
csName,
C_szTextureTypeName,
p_oFileObject
);
if ( p_oEditorSupplyTexture )
// give the engine texture to the editor texture
p_oEditorSupplyTexture->m_vAssociateEngineMaterial(p_stSupplyTexture, TRUE);
else if ( p_stSupplyTexture )//we have to create an editor texture to handle this engine texture, if relevant, of course
p_oEditorSupplyTexture = new tdoEditorTexture(
p_oFileObject,
csName,
TRUE,
p_stSupplyTexture
);
ASSERT(p_oEditorSupplyTexture);
g_oCoherenceManager.m_fn_vAddALink(this, p_oEditorSupplyTexture);
}
else //a valid texture handle and no linktable entry ? that is not well!!!
{
if ( gs_p_oMaterialInterface->m_bLoadWarningsAreEnabled() ) //output a warning message if required
AfxMessageBox(
CString("The supply texture section of the main texture section ") + GetReferencedSectionName() +
" cannot be found in the link table, although it was analyzed.\n"
"If you edit a material using this texture and save your changes,\n"
"this section will no longer reference the supply texture.\n",
MB_OK
);
if ( g_xLogFile )
{
//log the error
char szTextureName[100];
GLI_vGetTextureName(p_stSupplyTexture, szTextureName);
CString csLogMessage("Unknown supply texture section: ");
csLogMessage += GetReferencedSectionName() + " -> ";
csLogMessage += szTextureName;
fprintf(g_xLogFile, "%s\n", LPCTSTR(csLogMessage));
fflush(g_xLogFile);
}
}
}
}
}
//=================================================================================
//=================================================================================
void tdoEditorTexture::m_vLoadAssociatedEngineTexture()
{
if ( !fn_bIsAvailable() )
{
//if the section name is not in the linktable, analyse the section
SCR_tdst_Cxt_Values *p_stAnalyzeResult = SCR_fnp_st_RdL0_AnalyseSection(
(char *) LPCTSTR(GetReferencedSectionName()),
SCR_CDF_uw_Anl_Normal
);
GLI_tdstTexture *hTexture = (GLI_tdstTexture *) p_stAnalyzeResult->a_ulValues[0];
//there must not already exist an editor material for the loaded game material!
ASSERT(!gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hTexture));
//create the association
m_vAssociateEngineMaterial(hTexture, TRUE);
}
}
//================================================================================
//================================================================================
BOOL tdoEditorTexture::m_bIsReferenced()
{
return g_oCoherenceManager.m_fn_iGetFatherCount(this) > 1;
}
//=================================================================================
//=================================================================================
void tdoEditorTexture::m_vRememberTextureName(CString _csTextureName)
{
m_csTextureName = _csTextureName;
}
//=================================================================================
//=================================================================================
void tdoEditorTexture::m_vReplaceHandle(GLI_tdstTexture *_hReplacingTexture)
{
if ( m_hTexture != _hReplacingTexture )
{
CPA_List<CPA_BaseObject> oFatherList;
g_oCoherenceManager.m_fn_iGetFatherList(this, &oFatherList);
POSITION xPos = oFatherList.GetHeadPosition();
while ( xPos )
{ //scan all the visual materials that uses our current handle
CPA_BaseObject *p_oFather = oFatherList.GetNext(xPos);
if ( !p_oFather->GetType().CompareNoCase(tdoEditorVisualMaterial::m_csGetMaterialType()) ) //if this father is a visual material
{
tdoEditorVisualMaterial *p_oVisual = (tdoEditorVisualMaterial *) p_oFather;
ACP_tdxHandleOfMaterial hVisual = p_oVisual->m_hGetEngineMaterial();
long lNbTextures = GLI_lGetMaterialNumberOfAnimatedTexture(hVisual);
for ( lNbTextures --; lNbTextures >= 0; lNbTextures -- ) //scan all the textures used by the material
{
float fDuration;
GLI_tdstTexture *p_stTexture;
GLI_vGetMaterialAnimatedTexture(hVisual, lNbTextures, &p_stTexture, &fDuration);
if ( p_stTexture == m_hTexture ) //if this is my current texture handle
{
GLI_vModifyMaterialAnimatedTexture(hVisual, lNbTextures, _hReplacingTexture, fDuration); //change it for the new one
if ( lNbTextures == 0 )
GLI_xSetMaterialTexture(hVisual, _hReplacingTexture);
//we did not need to rebuild cohemngr links for the main texture, since we just changed the handle
//in both places, but this is not true for the supply texture: since we changed the handle, we have to remove
//the link with the initial editor supply texture
p_stTexture = TEX_p_tdstGetSupplyTexture(p_stTexture);
tdoEditorTexture *p_oSupplyTexture = (tdoEditorTexture *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(p_stTexture);
if ( p_oSupplyTexture )
g_oCoherenceManager.m_fn_vRemoveALink(this, p_oSupplyTexture);
}
}
}
}
//make us reference the specified handle
m_vAssociateEngineMaterial(_hReplacingTexture, TRUE);
}
}
//=================================================================================
//=================================================================================
/*virtual*/ void tdoEditorTexture::fn_vNotifySave(void)
{
//because when the notification is done, we dont knwo for sure if the section exists or not
fn_vNotifySection(SCR_EA_Ntfy_AddOrRebuildSection);
}
/*=================================================================================
//save a section of the form:
{Texture:<name>
LoadTexture("bitmap file name")
Tiling(ON/OFF,ON/OFF)
Bilinear(ON/OFF,ON/OFF)
MipMapping(ON/OFF)
Chromakey( ENABLE , FILTERING_ON , 0 , 0 , 0 , 0 )
Quality(NORMAL)
Priority(NORMAL/LOW/HIGH)
}
//=================================================================================*/
void tdoEditorTexture::m_vCallBackSaveTexture(
SCR_tdst_File_Description *_p_stFile,
char *_p_szSectionName,
void *_p_vData,
SCR_tde_Ntfy_Action _eAction
)
{
tdoEditorTexture *p_oEditorTexture = (tdoEditorTexture *) _p_vData;
if ( _eAction == SCR_EA_Ntfy_DeleteSection )
//now the section exists, if this was not the case
p_oEditorTexture->fn_vSectionDeleted(); //the section does not exist, and has no pending nofitication
if ( _eAction != SCR_EA_Ntfy_AddSection && _eAction != SCR_EA_Ntfy_RebuildSection )
return;
if ( _eAction == SCR_EA_Ntfy_AddSection )
{
// go to end of file (we need all file directive to load this section)
SCR_fn_v_SvL1_ToEndSection(_p_stFile);
SCR_M_SvL0_SaveBlankLine (_p_stFile);
}
GLI_tdstTexture *p_stTexture = (GLI_tdstTexture *) p_oEditorTexture->GetData();
if ( p_stTexture )
{
char szSectionName[SCR_CV_ui_Cfg_MaxLenName],szAction[SCR_CV_ui_Cfg_MaxLenName],szId[SCR_CV_ui_Cfg_MaxLenName];
// construct section name (hack: szSectionName is here as an anti-bug for ...Split...
SCR_fn_v_RdL0_SplitSectionName(_p_szSectionName, szSectionName, szAction, szId);
SCR_fn_v_RdL0_ComputeSectionName(szSectionName, NULL, szAction, szId);
// save begin section for the game material (action == MechanicalMaterial)
SCR_M_SvL0_SaveBeginSection(_p_stFile, szSectionName, SCR_CC_C_Cfg_EOL);
//referenced texture bitmap file, this must be the first entry in the section
CString csTextureName = p_oEditorTexture->m_csGetTextureName();
if ( !csTextureName.IsEmpty() ) //in case the texture bitmap did not exist, do not save it.
{
SCR_M_SvL0_SaveEntry(_p_stFile, "LoadTexture", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile, SCR_EF_SvL0_Normal, 1, LPCTSTR(p_oEditorTexture->m_csGetTextureName()));
}
//texture tiling
BOOL bTilingX, bTilingY;
TEX_vGetTextureTilingMode(p_stTexture, &bTilingX, &bTilingY);
SCR_M_SvL0_SaveEntry(_p_stFile, "Tiling", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile, SCR_EF_SvL0_Normal, 2, (bTilingX ? "ON" : "OFF"), (bTilingY ? "ON" : "OFF"));
//texture trilinear mipmapping
long lMipmapping = TEX_lGetTextureMipMappingMode(p_stTexture);
SCR_M_SvL0_SaveEntry(_p_stFile, "Mipmapping", SCR_CC_C_Cfg_NoChar);
if ( lMipmapping == TEX_C_NO_MIPMAPPING )
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile, SCR_EF_SvL0_Normal, 1, "OFF");
else //bilinear or trilinear mipmapping
{
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile, SCR_EF_SvL0_Normal, 1, (lMipmapping == TEX_C_TRILINEAR) ? "TRILINEAR" : "BILINEAR");
//texture bilinear filtering, save only if mipmapping is enabled
BOOL bFilterU = TRUE, bFilterV = TRUE; //TODO: read them when the acces function is available
SCR_M_SvL0_SaveEntry(_p_stFile, "Bilinear", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile, SCR_EF_SvL0_Normal, 2, bFilterU ? "ON" : "OFF", bFilterV ? "ON" : "OFF");
}
//chromakey
BOOL bActive, bFiltering;
unsigned char ucR, ucG, ucB, ucA;
TEX_vGetTextureChromakey(p_stTexture, &bActive, &bFiltering, &ucR, &ucG, &ucB, &ucA);
SCR_M_SvL0_SaveEntry(_p_stFile, "Chromakey", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(
_p_stFile, SCR_EF_SvL0_Scanf, 7, "%s,%s,%d,%d,%d,%d",
(bActive ? "ENABLE" : "DISABLE"),
(bFiltering ? "FILTERING_ON" : "FILTERING_OFF"),
ucR, ucG, ucB, ucA
);
//supply texture
GLI_tdstTexture *p_stSupplyTexture = TEX_p_tdstGetSupplyTexture(p_stTexture);
if ( p_stSupplyTexture )
{
tdoEditorTexture *p_oEditorSupplyTexture = (tdoEditorTexture *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(p_stSupplyTexture);
SCR_M_SvL0_SaveEntry(_p_stFile, "SupplyTexture", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile, SCR_EF_SvL0_Normal, 1, LPCTSTR(p_oEditorSupplyTexture->GetReferencedSectionName()));
}
//quality
unsigned char ucQuality = TEX_ucGetTextureQualityLevel(p_stTexture);
char *pszQualityName;
SCR_M_SvL0_SaveEntry(_p_stFile, "Quality", SCR_CC_C_Cfg_NoChar);
switch ( ucQuality )
{
default:
case TEX_C_QNORMAL:
pszQualityName = "NORMAL";
break;
case TEX_C_QLOW:
pszQualityName = "LOW";
break;
case TEX_C_QHIGH:
pszQualityName = "HIGH";
break;
}
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile, SCR_EF_SvL0_Normal, 1, pszQualityName);
//TODO: priority
unsigned char ucPriority = 1;
char *pszPriorityName;
SCR_M_SvL0_SaveEntry(_p_stFile, "Priority", SCR_CC_C_Cfg_NoChar);
switch ( ucPriority )
{
case 0:
pszPriorityName = "LOW";
break;
case 1:
pszPriorityName = "NORMAL";
break;
case 2:
pszPriorityName = "HIGH";
break;
}
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile, SCR_EF_SvL0_Normal, 1, pszPriorityName);
// End Section
SCR_M_SvL0_SaveEndSection(_p_stFile, SCR_CC_C_Cfg_EOL);
//now the section exists, if this was not the case
p_oEditorTexture->fn_vSectionSaved(); // the section is saved and has no pending notification
}
}
//=================================================================================
//=================================================================================
//=================================================================================
// static functions for the class
//=================================================================================
//=================================================================================
//=================================================================================
SCR_tdst_Link_Table *tdoEditorTexture::m_p_stGetAssociatedLinkTable()
{
return GLI_p_stGetLinkTableOfTextureSection();
}
BOOL tdoEditorTexture::m_bIsEngineMaterialValid(GLI_tdstTexture *_hTexture)
{
return _hTexture ? TRUE : FALSE;
}
void tdoEditorTexture::m_vInvalidateEngineMaterial(GLI_tdstTexture *&r_hTexture)
{
r_hTexture = NULL;
}
CString tdoEditorTexture::m_csGetMaterialType()
{
return C_szTextureTypeName;
}
CString tdoEditorTexture::m_csGetScriptExtension()
{
return ".tex";
}

View File

@@ -0,0 +1,77 @@
/*=============================================================================
*
* Filename: MMatObj.hpp
* Version: 1.0
* Date: 06/11/96
* Author: B.G.
*
* Description: editor material class
*
*===========================================================================*/
#ifndef __TEXOBJ_HPP__
#define __TEXOBJ_HPP__
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
#include <afxtempl.h>
#include <afxcview.h>
#include "Acp_base.h"
#include "itf.h"
#include "gmt.h"
#include "scr.h"
#include "dpt.h"
#include "x:\cpa\main\inc\_editid.h"
class tdoEditorTexture : public CPA_SaveObject
{
public:
tdoEditorTexture(
CPA_FileObject *_p_oOwnerFile,
CString _csId,
BOOL _bSectionAlreadyExists,
GLI_tdstTexture *_hTemplateTexture
);
~tdoEditorTexture();
GLI_tdstTexture *m_hGetEngineTexture() { return m_hTexture; }
static void m_vCallBackSaveTexture( // save the mechanics material section
SCR_tdst_File_Description *_p_stFile,
char *_p_szSectionName,
void *_p_vData,
SCR_tde_Ntfy_Action _eAction
);
void m_vAssociateEngineMaterial(GLI_tdstTexture *_htexture, BOOL _bSectionAlreadyExists);
void m_vLoadAssociatedEngineTexture();
BOOL m_bIsReferenced();
void m_vRememberTextureName(CString _csTextureName);
CString m_csGetTextureName() { return m_csTextureName; }
void m_vReplaceHandle(GLI_tdstTexture *_hReplacingTexture);
//overloads from base class
virtual void *GetData(void) { return m_hTexture; }
virtual long GetDataType(void) { return 0; };
virtual tdeMissingCriteria fn_eCheckUnicity(const CString csNewName) { return fn_eCheckUnicityWithOwner(csNewName); }
virtual void fn_vNotifySave(void);
static CString m_csGetMaterialType();
static CString m_csGetScriptExtension();
static SCR_tdst_Link_Table *m_p_stGetAssociatedLinkTable();
static BOOL m_bIsEngineMaterialValid(GLI_tdstTexture *_hTexture);
static void m_vInvalidateEngineMaterial(GLI_tdstTexture *&r_hTexture);
//virtual void fn_vNotify(SCR_tde_Ntfy_Action _eAction);
//CString GetReferencedSectionName(void);
private:
CString m_csTextureName;
GLI_tdstTexture *m_hTexture;
};
#endif /* __TEXOBJ_HPP__ */

View File

@@ -0,0 +1,602 @@
// TextureDlg.cpp : implementation file
//
#include "stdafx.h"
#include "matres.h"
#include "acp_base.h"
#include "itf.h"
#include "dpt.h"
#include "inctex.h"
#include "_interf.hpp"
#include "matlist.hpp"
#include "VMatObj.hpp"
#include "TexObj.hpp"
#include "TextureDlg.h"
#include "PatternList.hpp"
#include "TGMdef.hpp"
#include "_EditID.h" // V<>rifier que le chemin Main\Inc est bien enregistr<74> dans les settings,
// ou bien <20>crire le chemin en dur : #include "..\Main\Inc\_EditID.h"
#include "TUT.h"
extern Material_Interface *gs_p_oMaterialInterface;
//=================================================================================
//=================================================================================
tdoTextureName::tdoTextureName(CString _csName /*= ""*/)
{
m_csFileName = _csName;
m_bIsReferenced = FALSE;
}
//=================================================================================
//=================================================================================
BOOL tdoTextureName::m_bIsReferencedInLinkTable()
{
//once we know it is true, it always will
//false once, but it may change, so we have to check until it is true
if ( !m_bIsReferenced )
m_bIsReferenced = m_bFindNameInLinkTable();
return m_bIsReferenced;
}
//================================================================================
//================================================================================
BOOL tdoTextureName::m_bFindNameInLinkTable()
{
SCR_tdst_Link_Table *p_stTextureLinkTable;
SCR_tdst_Link_Value *p_stTextureEntry;
unsigned int uiTexturePos;
//start by searching in teh link table where the texture is referenced as is
p_stTextureLinkTable = GLI_p_stGetLinkTableOfTexture();
uiTexturePos = 0;
SCR_M_DyAr_GetNextElement(
SCR_tdst_Link_Value,
uiTexturePos,
p_stTextureEntry,
p_stTextureLinkTable->stLinkArray
);
while ( p_stTextureEntry ) //scan the texture link table
{
// if the entry's short name is our name, then we are referenced in the link table...
char *pszShortTextureName = SCR_M_p_sz_Link_GetKey(p_stTextureEntry) + SCR_M_ul_Link_GetAdditionalLong(p_stTextureEntry, 1);
if ( !m_csFileName.CompareNoCase(pszShortTextureName) )
return TRUE;
uiTexturePos ++;
SCR_M_DyAr_GetNextElement(
SCR_tdst_Link_Value,
uiTexturePos,
p_stTextureEntry,
p_stTextureLinkTable->stLinkArray
);
}
/*
//now look in the link table where the textures are referenced as sections
p_stTextureLinkTable = GLI_p_stGetLinkTableOfTextureSection();
uiTexturePos = 0;
SCR_M_DyAr_GetNextElement(
SCR_tdst_Link_Value,
uiTexturePos,
p_stTextureEntry,
p_stTextureLinkTable->stLinkArray
);
while ( p_stTextureEntry ) //scan the texture link table
{
/ // if the entry's short name is the our name, then we are referenced in the link table...
char *pszShortTextureName = SCR_M_p_sz_Link_GetKey(p_stTextureEntry) + SCR_M_ul_Link_GetAdditionalLong(p_stTextureEntry, 1);
if ( !m_csFileName.CompareNoCase(pszShortTextureName) )
return TRUE; /
uiTexturePos ++;
SCR_M_DyAr_GetNextElement(
SCR_tdst_Link_Value,
uiTexturePos,
p_stTextureEntry,
p_stTextureLinkTable->stLinkArray
);
}
*/
return FALSE;
}
/////////////////////////////////////////////////////////////////////////////
// CTextureDlg dialog
CTextureDlg::CTextureDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTextureDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CTextureDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_fn_vInitTextureList();
m_pFrame = NULL;
m_bIsRefreshingTextureList = FALSE;
}
//=================================================================================
//=================================================================================
CTextureDlg::~CTextureDlg()
{
m_oTextureDirContents.RemoveAll();
}
//=================================================================================
//=================================================================================
void CTextureDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTextureDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
//=================================================================================
//=================================================================================
BEGIN_MESSAGE_MAP(CTextureDlg, CDialog)
//{{AFX_MSG_MAP(CTextureDlg)
ON_BN_CLICKED(IDC_BUTTON_REFRESH, OnButtonRefresh)
ON_WM_DESTROY()
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//=================================================================================
// Description : initialize the TextureList
//=================================================================================
void CTextureDlg::m_fn_vInitTextureList(void)
{
m_bFirstInit = TRUE;
m_p_oTextureListView = new CPatternedListView();
m_p_oTextureListView->m_fn_vSetBitmapList(gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList());
m_p_oTextureListView->m_fn_vSetBox(C_cDisplayBitmapAndText, C_wListViewBTItemWidth + C_wListViewPlusPathWidth, C_wListViewBTItemHeight);
m_p_oTextureListView->m_fn_vSetBox(C_cDisplayBitmap, C_wListViewBItemWidth, C_wListViewBItemHeight);
m_p_oTextureListView->m_fn_vSetBox(C_cDisplayText, C_wListViewTItemWidth + C_wListViewPlusPathWidth, C_wListViewTItemHeight);
m_p_oTextureListView->m_fn_vDisableMenuItem(TLVM_lOrder);
}
//=================================================================================
//=================================================================================
short CTextureDlg::m_wCountTextures(CString _csNamePrefix, BOOL _bForceDirScan /*= FALSE*/, BOOL bEmptyList /*= FALSE*/)
{
// static short wRecurseDepth = 0;
if ( _bForceDirScan )
{
//empty the list only at first entry in the recurse stack...
if (bEmptyList)
{
fn_vGiveProgressInfo("counting loadable textures", -1);
m_oTextureDirContents.RemoveAll();
}
HANDLE hFind;
WIN32_FIND_DATA stFind;
//find files with at least a name and an extension
hFind = FindFirstFile("?*.?*", &stFind);
if ( hFind != INVALID_HANDLE_VALUE )
{
CString csPrefix = ( _csNamePrefix.IsEmpty() ? "" : (_csNamePrefix + "\\") );
do
{
if ( strlen(stFind.cFileName) > 2 ) //do not handle "." and ".."
{
if ( stFind.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) //this is a directory
{
if ( SetCurrentDirectory(stFind.cFileName) )
{
// wRecurseDepth ++;
m_wCountTextures(csPrefix + stFind.cFileName, TRUE, FALSE);
// wRecurseDepth --;
SetCurrentDirectory("..");
}
}
else if ( CString(stFind.cFileName).Right(3).CompareNoCase(".gf") ) // do not handle UBI graphic files with .gf extensions
{
//this is a simple texture file, add it in the list
m_oTextureDirContents.AddTail(*new tdoTextureName(csPrefix + stFind.cFileName));
}
}
} while ( FindNextFile(hFind, &stFind) );
FindClose(hFind);
}
}
return (short) m_oTextureDirContents.GetCount();
}
//=================================================================================
//=================================================================================
void CTextureDlg::m_fn_vRefreshTextureList(BOOL _bOnlyForLoadedMaterials, BOOL _bScanTextureDir)
{
int iImage;
int iItem;
char *d_cFoundBitmap;
long lNumber;
char szCurDir[_MAX_PATH];
long lCurDirLen = _MAX_PATH;
lCurDirLen = GetCurrentDirectory(lCurDirLen, szCurDir);
BOOL bNewBitmapsLoaded = FALSE;
BOOL bOldBitmapsRemoved = FALSE;
// find all directories
char szVersion[255];
char szVersion0[255];
char szVersion1[255];
char szVersion2[255];
FILE *hIni;
char *szCut;
int iNumVersion, iNbVersions = 1;
// common directory : get from path
strcpy(szVersion0, fn_szGetTexturesDataPath());
strcpy(strchr(szVersion0, '\\'), "\0");
// specific directories : get from version.ini
hIni = fopen("version.ini", "rt");
if(hIni == NULL)
hIni = fopen("x:\\cpa\\exe\\main\\version.ini", "rt");
if(hIni)
{
fgets(szVersion, 49, hIni);
while(!isalnum(szVersion[strlen(szVersion) - 1]))
szVersion[strlen(szVersion) - 1] = '\0';
fclose(hIni);
// if necessary get all specific directories
strcpy(szVersion1, szVersion);
iNbVersions = 2;
szCut = strchr(szVersion1, ',');
if (szCut)
{
strcpy(szVersion2, szCut+1 );
strcpy(szCut, "\0");
iNbVersions = 3;
}
}
BOOL bFound = FALSE;
char szPath[255];
if (_bScanTextureDir)
{
m_wNbTextures[0] = m_wNbTextures[1] = m_wNbTextures[2] = 0;
m_oTextureDirContents.RemoveAll();
for (iNumVersion = 0; iNumVersion < iNbVersions; iNumVersion++)
{
// build specific path
switch (iNumVersion)
{
case 0:
strcpy(szPath, szVersion0);
break;
case 1:
strcpy(szPath, szVersion1);
break;
case 2:
strcpy(szPath, szVersion2);
break;
}
strcat(szPath, strchr(fn_szGetTexturesDataPath(), '\\'));
if (SetCurrentDirectory(szPath))
{
bFound = TRUE;
m_wNbTextures[iNumVersion] = m_wCountTextures("", _bScanTextureDir, FALSE);
SetCurrentDirectory(szCurDir);
}
}
if (!bFound)
return;
}
if ((lNumber = gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_lGetCount()) == 0)
d_cFoundBitmap = NULL;
else
{
d_cFoundBitmap = (char *) malloc(lNumber);
if ( d_cFoundBitmap )
memset(d_cFoundBitmap, 0, lNumber);
}
short wCurFile = 0, wNbFiles = m_wCountTextures("", FALSE);
CString csStatusMessage;
csStatusMessage.Format("loading %d textures", wNbFiles);
POSITION xPos = m_oTextureDirContents.GetHeadPosition();
while ( xPos )
{
tdoTextureName &r_oTextureName = m_oTextureDirContents.GetNext(xPos);
char *p_szFoundFileName = (char *)LPCTSTR(r_oTextureName.m_csGetName());
fn_vGiveProgressInfo(csStatusMessage, (100 * wCurFile) / wNbFiles);
BOOL bTextureLoadedByEngine = FALSE;
if (wCurFile < m_wNbTextures[0])
{
strcpy(szPath, szVersion0);
strcat(szPath, strchr(fn_szGetTexturesDataPath(), '\\'));
}
else if (wCurFile < m_wNbTextures[1])
{
strcpy(szPath, szVersion1);
strcat(szPath, strchr(fn_szGetTexturesDataPath(), '\\'));
}
else if (wCurFile < m_wNbTextures[2])
{
strcpy(szPath, szVersion2);
strcat(szPath, strchr(fn_szGetTexturesDataPath(), '\\'));
}
SetCurrentDirectory(szPath);
//if the current file is alowed for load
if ( !_bOnlyForLoadedMaterials || (bTextureLoadedByEngine = r_oTextureName.m_bIsReferencedInLinkTable()) )
{
//first check that we dont have it already
if ( (iImage = gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_iGetBitmapIndex(p_szFoundFileName)) == -1 )
{
iImage = gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_iAdd(p_szFoundFileName);
//dont set with 0, because 0 means no texture is associated to the file. Later, when a
//material with no texture is displayed, an image associated to the fact that there
//is no texture is to be found by the value 0, so get another one
if ( iImage != -1 )
{
gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_vSetBitmapLong(iImage, 0);
int iItem = m_p_oTextureListView->m_fn_iAddItem(p_szFoundFileName, (short) iImage);
//make the view know if the image is referenced by the engine or not
if ( bTextureLoadedByEngine )
m_p_oTextureListView->m_fn_vSetItemContent(iItem, TRUE);
//a new bitmap was added
bNewBitmapsLoaded = TRUE;
}
}
else if ( d_cFoundBitmap )
d_cFoundBitmap[iImage] = 1;
else
d_cFoundBitmap = NULL; // just to put a breakpoint here!
}
SetCurrentDirectory(szCurDir);
wCurFile ++;
}
fn_vGiveProgressInfo(csStatusMessage, 100);
SetCurrentDirectory(szCurDir);
if ( d_cFoundBitmap )
{
for ( iImage = 0; iImage < lNumber; iImage ++ )
{
CString csName = gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_csGetBitmapName(iImage);
//ignore bitmaps loaded for editor purposes
if ( csName != C_szNoBitmapName && csName != C_szUnviewableBitmapName )
if ( !d_cFoundBitmap[iImage] )
{
bOldBitmapsRemoved = TRUE;
//remove from the list the image for which we no longer find a file
gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_vDelete(iImage);
iItem = m_p_oTextureListView->m_fn_lFindImage(0, (short) iImage);
//remove it from the listview too
if ( iItem != -1 )
{
m_p_oTextureListView->m_fn_bDeleteItem(iItem);
}
}
}
free(d_cFoundBitmap);
d_cFoundBitmap = NULL;
}
//these 2 cannot be found because they are editor data, but we use them nonetheless, so
//reload them...
//add bitmaps to display materials with no texture, but do not create small versions, even if the list handles them
if ( gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_iGetBitmapIndex(C_szNoBitmapName) == TSL_cItemNotFound )
{
iImage = gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_iAdd(C_szNoBitmapName, 0, 0, FALSE, TRUE);
gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_vSetBitmapLong(iImage, 0);
//when an item using this image is displayed in text only, the text will be different than for the other images
gs_p_oMaterialInterface->m_p_oGetMaterialListView()->m_vRememberSpecialImage((short) iImage);
}
//and those for which we cannot display their texture
if ( gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_iGetBitmapIndex(C_szUnviewableBitmapName) == TSL_cItemNotFound )
{
iImage = gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_iAdd(C_szUnviewableBitmapName, 0, 0, FALSE, TRUE);
gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_vSetBitmapLong(iImage, 2);
}
//if new bitmaps were added or some were removed, the bitmap indexes may have changed,
//so we must warn the material list to update the indexes for the materials
if ( bNewBitmapsLoaded || bOldBitmapsRemoved )
{
gs_p_oMaterialInterface->m_p_oGetMaterialListView()->m_vBitmapListWasRefreshed();
}
fn_vGiveProgressInfo("", -1);
}
/////////////////////////////////////////////////////////////////////////////
// CTextureDlg message handlers
DWORD __stdcall fn_vRefreshTextureListThread(LPVOID lpThreadParameter)
{
CTextureDlg *p_oDialog = (CTextureDlg *) lpThreadParameter;
p_oDialog->m_bIsRefreshingTextureList = TRUE;
p_oDialog->m_p_oTextureListView->EnableWindow(FALSE);
p_oDialog->m_fn_vRefreshTextureList(FALSE, FALSE);
p_oDialog->m_p_oTextureListView->EnableWindow(TRUE);
p_oDialog->m_bIsRefreshingTextureList = FALSE;
return 0;
}
//=================================================================================
//=================================================================================
void CTextureDlg::OnButtonRefresh()
{
/*if ( !m_bIsRefreshingTextureList ) //do not refresh if the list refresh thread is already active
{
DWORD xThreadId;
CreateThread(
NULL, //security attributes
0, //stack size
fn_vRefreshTextureListThread, //start routine
this, //parameter
0, //creation flags
&xThreadId //variable where the thread id will be stored
);
}*/
m_fn_vRefreshTextureList(FALSE, FALSE);
}
//=================================================================================
//=================================================================================
void CTextureDlg::OnDestroy()
{
if ( !m_bIsRefreshingTextureList ) //do not destriy if the list refresh thread is active
{
RECT rect;
// save the current pos and size of window
GetWindowRect( &rect);
m_bPosWhenClose.x = rect.left;
m_bPosWhenClose.y = rect.top;
m_bSizeWhenClose.cx = rect.right - rect.left;
m_bSizeWhenClose.cy = rect.bottom - rect.top;
// set parent of texture list view to false (else structure is destroyed)
m_p_oTextureListView->ShowWindow(FALSE);
m_p_oTextureListView->SetParent( NULL );
// destroy frame
m_pFrame->DestroyWindow();
m_pFrame = NULL;
//control registration for tutorial and assistants
TUT_M_vGetTutDll();
TUT_M_vUnregisterControl(m_p_oTextureListView->m_hWnd);
TUT_M_vUnregisterControlID(IDOK);
TUT_M_vUnregisterControlID(IDC_BUTTON_REFRESH);
TUT_M_vUnregisterControlID(IDCANCEL);
// destroy dialog
CDialog::OnDestroy();
}
}
//=================================================================================
//=================================================================================
BOOL CTextureDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// rect for creation but frame is resize when dialog appear
RECT rect;
rect.left = 5;
rect.top = 5;
rect.right = 100;
rect.bottom = 100;
// frame creation
m_pFrame = new CFrameWnd();
m_pFrame->Create(NULL, NULL, WS_OVERLAPPED | WS_CLIPSIBLINGS | WS_VISIBLE | WS_CHILD, rect, this);
if (m_bFirstInit)
{
// first overture of dialog, view isn't created
m_p_oTextureListView->Create(NULL, NULL, WS_CHILD, rect, m_pFrame, 0);
m_p_oTextureListView->m_fn_vChangeDisplayType(C_cDisplayBitmapAndText);
m_bFirstInit = FALSE;
}
else
{
// at least the second overture, there's a saved position and view is already created
MoveWindow( m_bPosWhenClose.x, m_bPosWhenClose.y, m_bSizeWhenClose.cx, m_bSizeWhenClose.cy );
m_p_oTextureListView->SetParent( m_pFrame );
}
// show view and activate it in frame
m_p_oTextureListView->ShowWindow(TRUE);
m_pFrame->SetActiveView(m_p_oTextureListView);
// set variable
m_iSelectedImage = -1;
//control registration for tutorial and assistants
TUT_M_vGetTutDll();
TUT_M_vRegisterControl(m_p_oTextureListView->m_hWnd , "TGM_TextureListView" , TUT_e_Window);
TUT_M_vRegisterControlID(IDOK, "TGM_TextureListViewOK", TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_REFRESH, "TGM_TextureListViewRefresh", TUT_e_Button);
TUT_M_vRegisterControlID(IDCANCEL, "TGM_TextureListViewCancel", TUT_e_Button);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
//=================================================================================
//=================================================================================
void CTextureDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
if (m_pFrame)
{
m_pFrame->MoveWindow( 5,5, cx - 10, cy - 35);
m_p_oTextureListView->MoveWindow(1,1, cx - 15, cy - 40);
GetDlgItem( IDOK )->MoveWindow( 0, cy - 24, cx/3, 20);
GetDlgItem( IDC_BUTTON_REFRESH )->MoveWindow( cx/3, cy - 24, cx/3, 20);
GetDlgItem( IDCANCEL )->MoveWindow( 2*cx/3, cy - 24, cx/3, 20);
}
}
//=================================================================================
//=================================================================================
void CTextureDlg::OnOK()
{
if ( !m_bIsRefreshingTextureList ) //do not close if the list refresh thread is active
{
int iImage = m_iSelectedImage = m_p_oTextureListView->m_fn_wGetImage(m_p_oTextureListView->m_fn_lGetSelectedItem());
//get the pointer on the new texture
CString csBitmapName = gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_csGetBitmapName(iImage);
GLI_tdstTexture *p_stGliText = (GLI_tdstTexture *) gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_lGetBitmapLong(iImage);
if ( p_stGliText == NULL ) //the texture is not loaded yet
{
//load the texture (the entry will be added in the linktable)
char szFullName[SCR_CV_ui_Cfg_MaxLenName];
sprintf(szFullName, "%s\\%s", fn_szGetTexturesDataPath(), LPCTSTR(csBitmapName));
/*if( GLI_bGetTextureName(szFullName, szFullName) )
{*/
GLI_xLoadTexture(&p_stGliText, NULL, (char*)LPCTSTR(csBitmapName), 0, 0);
//GLI_xLoadTextureHeader(&p_stGliText,NULL,szFullName,0,0);
SCR_M_v_Link_SetAdditionalLong(
SCR_fnp_st_Link_SetValue(GLI_p_stGetLinkTableOfTexture(), szFullName, (unsigned long)p_stGliText),
1,
strlen(fn_szGetTexturesDataPath()) + 1
);
//load the texture in the graphic board vram
GLI_vEndofGeometricLoad();
/*}*/
//associate the texture data to the bitmap index
gs_p_oMaterialInterface->m_p_oGetMaterialsTextureList()->m_fn_vSetBitmapLong(iImage, (long) p_stGliText);
//find the VMT file object associated to the current GMT file object
CPA_FileObject *p_oFileObject = gs_p_oMaterialInterface->m_p_oGetCurrentFileObject();
//first, get the minimal name of the VMT file
CString csFileObjectName = p_oFileObject->GetReferencedName(gs_p_oMaterialInterface, C_szFileMinimalNameKey);
csFileObjectName = csFileObjectName.Left(csFileObjectName.ReverseFind('.')) + tdoEditorTexture::m_csGetScriptExtension();
//now retrieve the VMT file object
p_oFileObject = p_oGetFileObjectForReferencedPath(csFileObjectName, C_szFileMinimalNameKey);
//the section will be named from the texture it references, without the file extension
CString csName = CString("TEX_") + fn_pszBaseName0(LPCTSTR(csBitmapName));
csName = csName.Left(csName.ReverseFind('.'));
//now create the texture section object
tdoEditorTexture *p_oEditorTexture = new tdoEditorTexture(
p_oFileObject, //owner file
csName, //section name
FALSE, //the section does not exist
p_stGliText //engine data
);
//mark the texture as loaded by the engine now
int iItem = m_p_oTextureListView->m_fn_lFindImage(TSL_cItemNotFound, iImage);
m_p_oTextureListView->m_fn_vSetItemContent(iItem, TRUE);
}
CDialog::OnOK();
}
}

View File

@@ -0,0 +1,90 @@
#if !defined(AFX_TEXTUREDLG_H__50996339_C517_11D0_97FC_00609736738F__INCLUDED_)
#define AFX_TEXTUREDLG_H__50996339_C517_11D0_97FC_00609736738F__INCLUDED_
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
// TextureDlg.h : header file
//
class tdoTextureName
{
public:
tdoTextureName(CString _csName = "");
BOOL m_bIsReferencedInLinkTable();
CString m_csGetName() { return m_csFileName; }
private:
BOOL m_bIsReferenced;
CString m_csFileName;
BOOL m_bFindNameInLinkTable();
};
class CPatternedListView;
/////////////////////////////////////////////////////////////////////////////
// CTextureDlg dialog
class CTextureDlg : public CDialog
{
private:
int m_iSelectedImage; // last selected image
CFrameWnd *m_pFrame; // frame to put view
BOOL m_bFirstInit; // true if first modal opened, else false
CSize m_bSizeWhenClose; // save the size when closing to restore for the next opening
CPoint m_bPosWhenClose; // idem for the screen position
CList<tdoTextureName, tdoTextureName &> m_oTextureDirContents; // list of the file names found in the texture path
short m_wNbTextures[3];
void m_fn_vInitTextureList( void ); // initialise Texture List, called once by constructor
// each time user click on refresh button
BOOL m_fn_bIsAValidTexture(CString csFileName);
short m_wCountTextures(CString _csNamePrefix, BOOL _bForceDirScan = FALSE, BOOL bEmptyList = FALSE);
public:
CPatternedListView *m_p_oTextureListView; // View to show texture list
BOOL m_bIsRefreshingTextureList;
//CBitmapList *m_fn_p_oGetTextureList( void ) { return &m_oTextureList; } // return texture list, used by other Interface view
int m_fn_iGetSelectedImage( void ) { return m_iSelectedImage; } // return last selected texture
void m_fn_vRefreshTextureList( BOOL _bOnlyForLoadedMaterials, BOOL _bScanTextureDir ); // refresh texture list, called by Init texture list and
//below is classWizard generated code
// Construction
CTextureDlg(CWnd* pParent = NULL); // standard constructor
~CTextureDlg(); // standard destructor
// Dialog Data
//{{AFX_DATA(CTextureDlg)
enum { IDD = IDD_DIALOG_TEXTURELIST };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTextureDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTextureDlg)
afx_msg void OnButtonRefresh();
afx_msg void OnDestroy();
virtual BOOL OnInitDialog();
afx_msg void OnSize(UINT nType, int cx, int cy);
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TEXTUREDLG_H__50996339_C517_11D0_97FC_00609736738F__INCLUDED_)

View File

@@ -0,0 +1,438 @@
//
/*=============================================================================
*
* Filename: VMatObj.cpp
* Version: 1.0
* Date: 06/11/96
* Author: B.G.
*
* Description: implementation of editor material class
*
*===========================================================================*/
#include "stdafx.h"
#include "Acp_base.h"
#include "itf.h"
#include "gmt.h"
#include "IncMEC.h"
#include "gli.h"
#include "x:\cpa\main\inc\_editid.h"
#include "inctex.h"
#include "_interf.hpp"
#include "GMatObj.hpp"
#include "VMatObj.hpp"
#include "TexObj.hpp"
extern Material_Interface *gs_p_oMaterialInterface;
extern FILE *g_xLogFile;
//=================================================================================
//=================================================================================
//=================================================================================
tdoEditorVisualMaterial::tdoEditorVisualMaterial(
CPA_FileObject *_p_oOwnerFile,
CString _csId,
BOOL _bSectionAlreadyExists,
ACP_tdxHandleOfMaterial _hTemplateVisualMaterial
)
: CPA_SaveObject(
gs_p_oMaterialInterface, //editor
C_szVisualMaterialTypeName, //type
E_ss_Responsible, //responsibility
_p_oOwnerFile, //owner (there is none)
FALSE, //available
(char*)LPCTSTR(_p_oOwnerFile->GetCompletionPath(gs_p_oMaterialInterface, C_szFileReferencedNameKey)), //data path to complete the referenced section name
m_vCallBackSaveVMT//callback
)
{
//tell the file object that an object exists for its section
g_oCoherenceManager.m_fn_vAddALink(_p_oOwnerFile, this);
ASSERT(_hTemplateVisualMaterial);
//the editor object directly handles the engine object
m_hVisualMaterial = _hTemplateVisualMaterial;
SetAvailable(_hTemplateVisualMaterial ? TRUE : FALSE);
// construct section name (hack: szSectionName is here as an anti-bug for ...Split...
char szSectionName[SCR_CV_ui_Cfg_MaxLenName];
SCR_fn_v_RdL0_ComputeSectionName(
szSectionName,
(char*)LPCTSTR(_p_oOwnerFile->GetReferencedName(gs_p_oMaterialInterface, C_szFileReferencedNameKey)),
GLI_C_SectionVisualMaterial,
(char*)LPCTSTR(_csId)
);
// section object
SetSectionData(this);
SetReferencedSectionName(szSectionName);
// name
if ( fn_eRename(_csId) != E_mc_None )
SetDefaultValidName();
fn_vUpdateSectionName();
if ( _bSectionAlreadyExists )
fn_vSectionSaved(); //the section is saved, and has no pending notification
else
fn_vSectionDeleted(); //the section does not exist, and has no pending nofitication
if ( fn_bCanBeNotified() && !fn_bSectionExists() )
fn_vNotifySave();
if ( fn_bIsAvailable() )
{
//to simplify edition, make all textures as animation components
long lNbTextures = GLI_lGetMaterialNumberOfAnimatedTexture(m_hVisualMaterial);
if ( !lNbTextures )
{
unsigned long ulSaveType;
GLI_xGetMaterialType(m_hVisualMaterial, &ulSaveType);
//read the standard texture handle
GLI_tdstTexture *p_stTexture;
GLI_xGetMaterialTexture(m_hVisualMaterial, &p_stTexture);
//and mark it as an animated texture as well
if ( p_stTexture )
{
GLI_vAddMaterialAnimatedTexture(m_hVisualMaterial, 0, p_stTexture, (float) (100.0 + ((double) rand() / RAND_MAX)));
lNbTextures = 1;
//tell the engine something changed with the animated textures
GLI_xRefreshAnimatedTexture(m_hVisualMaterial);
}
GLI_xSetMaterialType(m_hVisualMaterial, ulSaveType);
}
for ( lNbTextures --; lNbTextures >= 0; lNbTextures -- ) //scan all the textures used by the material
{
float fDuration;
GLI_tdstTexture *p_stTexture;
GLI_vGetMaterialAnimatedTexture(m_hVisualMaterial, lNbTextures, &p_stTexture, &fDuration);
//now lets create the editor texture objects, if necessary
CPA_FileObject *p_oFileObject = NULL; //if we set the file object, this means we want to create a section, else the section alredy exists
tdoEditorTexture *p_oEditorTexture = NULL;
CString csName;
if
(
p_stTexture //if the texture object does not exist already for this engine data
&& !(p_oEditorTexture = (tdoEditorTexture *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(p_stTexture))
)
{
SCR_tdst_Link_Value *p_stTextureEntry;
char sz100BitmapName[100];
//try to find the texture when referenced as a section
if ( p_stTextureEntry = SCR_fnp_st_Link_SearchValue(GLI_p_stGetLinkTableOfTextureSection(), (unsigned long) p_stTexture) )
{
char *pszKey = SCR_M_p_sz_Link_GetKey(p_stTextureEntry);
char szTextureFile[SCR_CV_ui_Cfg_MaxLenName], szTextureName[SCR_CV_ui_Cfg_MaxLenName];
//get the section name from the linktable entry
SCR_fn_v_RdL0_SplitSectionName(pszKey, szTextureFile, NULL, szTextureName);
//get the file object for this referenced path
p_oFileObject = p_oGetFileObjectForCompletePath(szTextureFile);
csName = szTextureName;
//find it by name and owner
p_oEditorTexture = (tdoEditorTexture *) gs_p_oMaterialInterface->GetBaseObject(
csName,
C_szTextureTypeName,
p_oFileObject
);
//since it is in the section link table, the object must exist, since the editor creates editor
//objects for all the sections (loaded or not) at initialization...
ASSERT(p_oEditorTexture);
//the section was analyzed, but at some other point we might have created an editor object
//for the same section with another handle: the valid handle is the current one, so tell
//the texture section object to drop its current handle, and to update its referencing VMTs
//as well, if relevant
p_oEditorTexture->m_vReplaceHandle(p_stTexture);
}
else if ( p_stTextureEntry = SCR_fnp_st_Link_SearchValue(GLI_p_stGetLinkTableOfTexture(), (unsigned long) p_stTexture) )
{ //the material references the bitmap directly
strcpy(sz100BitmapName, SCR_M_p_sz_Link_GetKey(p_stTextureEntry) + SCR_M_ul_Link_GetAdditionalLong(p_stTextureEntry, 1));
}
else //a valid texture handle and no linktable entry ? that is not well!!!
{
//get the name in the texture descriptor
GLI_vGetTextureName(p_stTexture, sz100BitmapName);
//output some warning message
if ( gs_p_oMaterialInterface->m_bLoadWarningsAreEnabled() )
AfxMessageBox(
CString("The texture ") + sz100BitmapName +
"\nappears in more than one section, including " + szSectionName +
"\nYou can continue your work, but you should solve this problem.",
MB_OK
);
if ( g_xLogFile )
{
//and log the error in the log file
CString csLogMessage("multiple bitmap reference: ");
csLogMessage += szSectionName;
csLogMessage += " -> ";
csLogMessage += sz100BitmapName;
fprintf(g_xLogFile, "%s\n", LPCTSTR(csLogMessage));
fflush(g_xLogFile);
}
}
if ( !p_oEditorTexture ) //if the material references a bitmap directly (since no section was found for the texture...)
{
//determine the name of the texture file for the new texture section
CString csFileObjectName = _p_oOwnerFile->GetReferencedName(gs_p_oMaterialInterface, C_szFileReferencedNameKey);
csFileObjectName = csFileObjectName.Left(csFileObjectName.ReverseFind('.')) + tdoEditorTexture::m_csGetScriptExtension();
//get the associated file object
p_oFileObject = p_oGetFileObjectForReferencedPath(csFileObjectName);
//the section will be named from the texture it references, without the file extension
csName = CString("TEX_") + fn_pszBaseName0(sz100BitmapName);
csName = csName.Left(csName.ReverseFind('.'));
//replace characters tha are fobidden in section names
short wSpacePos;
while ( (wSpacePos = csName.FindOneOf(" :^")) != -1 )
csName.SetAt(wSpacePos, '_');
//the section was not analysed: it does not exist
//make sure we did not create at init such a texture section object that is not loaded yet...
p_oEditorTexture = (tdoEditorTexture *) gs_p_oMaterialInterface->GetBaseObject(
csName,
C_szTextureTypeName,
p_oFileObject
);
if ( !p_oEditorTexture ) //we did not find a loaded texture section that references the same bitmap name
{
//try to find an editor texture section that has the correct bitmap name
CPA_BaseObjectList *p_oList = gs_p_oMaterialInterface->GetBaseObjectList(C_szTextureTypeName);
//scan the list of editor textures
Position xPos = p_oList->GetHeadPosition();
while ( xPos )
{
tdoEditorTexture *p_oCurrentTexture = (tdoEditorTexture *) p_oList->GetNext(xPos);
if
(
p_oCurrentTexture->fn_bIsAvailable()
&& !p_oCurrentTexture->m_csGetTextureName().CompareNoCase(sz100BitmapName)
)
{ //we found a loaded editor texture that has the same bitmap, however through a different handle
//since the texture object references this texture bitmap, use it, whatever its name
p_oEditorTexture = p_oCurrentTexture;
break;
}
}
}
if ( p_oEditorTexture )
{
if ( !(p_stTexture = p_oEditorTexture->m_hGetEngineTexture()) ) //the texture section we found is not loaded yet
{
//load it now
p_oEditorTexture->m_vLoadAssociatedEngineTexture();
//and remember its handle
p_stTexture = p_oEditorTexture->m_hGetEngineTexture();
}
//we found a loaded editor texture for an existing section, which has a different handle:
//we now use its handle instead of our current one, since ours does not come from a section...
GLI_vModifyMaterialAnimatedTexture(m_hVisualMaterial, lNbTextures, p_stTexture, fDuration);
if ( lNbTextures == 0 )
GLI_xSetMaterialTexture(m_hVisualMaterial, p_stTexture);
}
//since we reference a section now, we must force saving of the visual material to account for it
fn_vNotifySave();
}
} //a texture object is not yet associated with the referenced texture handle
if ( !p_oEditorTexture ) //if the editor texture already exists
p_oEditorTexture = new tdoEditorTexture(
p_oFileObject,
csName,
FALSE, //the section does not exist
p_stTexture
);
//tell the cohemngr that the created editor texture is used by the visual material
g_oCoherenceManager.m_fn_vAddALink(this, p_oEditorTexture);
} //texture list loop
} //the handle is valid
}
//=================================================================================
//=================================================================================
tdoEditorVisualMaterial::~tdoEditorVisualMaterial()
{
//remove myself totally from the coherence manager database
if ( !fn_bSectionExists() )
g_oCoherenceManager.m_fn_vRemoveAllLinks(this, C_cLinkedAsChild);
}
//================================================================================
//================================================================================
BOOL tdoEditorVisualMaterial::m_bIsReferenced()
{
return g_oCoherenceManager.m_fn_iGetFatherCount(this) > 1;
}
/*=================================================================================
//save a section of the form:
{Material:<name>
Type([Gouraud|Flat])
AmbientColor(0.000000,0.000000,0.886275)
DiffuseColor(1.000000,1.000000,0.960784)
SpecularColor(1.000000,1.000000,0.960784,0.000000)
Texture(<base texture file name (no path)>)
}
//=================================================================================*/
/*static*/ void tdoEditorVisualMaterial::m_vCallBackSaveVMT(
SCR_tdst_File_Description *_p_stFile,
char *_p_szSectionName,
void *_p_vData,
SCR_tde_Ntfy_Action _eAction
)
{
tdoEditorVisualMaterial *p_oEditorMaterial = (tdoEditorVisualMaterial *) _p_vData;
if ( _eAction == SCR_EA_Ntfy_DeleteSection )
//now the section exists, if this was not the case
p_oEditorMaterial->fn_vSectionDeleted(); //the section does not exist, and has no pending nofitication
if ( _eAction != SCR_EA_Ntfy_AddSection && _eAction != SCR_EA_Ntfy_RebuildSection )
return;
if ( _eAction == SCR_EA_Ntfy_AddSection )
{
// go to end of file (we need all file directive to load this section)
SCR_fn_v_SvL1_ToEndSection(_p_stFile);
SCR_M_SvL0_SaveBlankLine (_p_stFile);
}
char szSectionName[SCR_CV_ui_Cfg_MaxLenName],szAction[SCR_CV_ui_Cfg_MaxLenName],szId[SCR_CV_ui_Cfg_MaxLenName];
// construct section name (hack: szSectionName is here as an anti-bug for ...Split...
SCR_fn_v_RdL0_SplitSectionName(_p_szSectionName, szSectionName, szAction, szId);
SCR_fn_v_RdL0_ComputeSectionName(szSectionName, NULL, szAction, szId);
// save begin section for the game material
SCR_M_SvL0_SaveBeginSection(_p_stFile, szSectionName, SCR_CC_C_Cfg_EOL);
//get the handles we need
ACP_tdxHandleOfMaterial hMaterialVisual = p_oEditorMaterial->m_hGetEngineMaterial();
//get the parameters we want to save
unsigned long xMType;
GEO_tdstColor stColor;
long lSpecularExponent;
//type
GLI_xGetMaterialType(hMaterialVisual, &xMType);
char *pszType;
if ( xMType & GLI_C_lIsGouraud )
{
if ( xMType & GLI_C_lIsNotLightAlphaSensitive ) //the material is not alpha sensitive
if ( xMType & GLI_C_lIsNotGrided )
pszType = "Gouraud";
else
pszType = "Transparent";
else
pszType = "GouraudAlpha";
}
else //the material is not gouraud-shaded
pszType = "Flat";
SCR_M_SvL0_SaveEntry(_p_stFile, "Type", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile, SCR_EF_SvL0_Normal, 1, pszType);
//ambient color
GLI_xGetMaterialAmbientCoef(hMaterialVisual, &stColor);
SCR_M_SvL0_SaveEntry(_p_stFile, "AmbientColor", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(
_p_stFile, SCR_EF_SvL0_Scanf, 5, "%f,%f,%f,%f",
(float) stColor.xR, (float) stColor.xG, (float) stColor.xB, (float) stColor.xA
);
//diffuse color
GLI_xGetMaterialDiffuseCoef(hMaterialVisual, &stColor);
SCR_M_SvL0_SaveEntry(_p_stFile, "DiffuseColor", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(
_p_stFile, SCR_EF_SvL0_Scanf, 5, "%f,%f,%f,%f",
(float) stColor.xR, (float) stColor.xG, (float) stColor.xB, (float) stColor.xA
);
//specular color and coeff //TODO: save alpha component of the color too... when the engine loads its
GLI_xGetMaterialSpecularCoef(hMaterialVisual, &lSpecularExponent, &stColor);
SCR_M_SvL0_SaveEntry(_p_stFile, "SpecularColor", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(
_p_stFile, SCR_EF_SvL0_Scanf, 5, "%f,%f,%f,%ld",
(float) stColor.xR, (float) stColor.xG, (float) stColor.xB, lSpecularExponent
);
//even if a texture is referenced, we save the reference only if the material
//has the "textured" attribute...
if ( xMType & GLI_C_lIsTextured )
{
long lNbTextures = GLI_lGetMaterialNumberOfAnimatedTexture(hMaterialVisual);
BOOL bOnlyOne = ((lNbTextures == 1) ? TRUE : FALSE);
for ( lNbTextures --; lNbTextures >= 0; lNbTextures -- ) //scan all the textures used by the material
{
float fDuration;
GLI_tdstTexture *p_stTexture;
GLI_vGetMaterialAnimatedTexture(hMaterialVisual, lNbTextures, &p_stTexture, &fDuration);
//if the visual material references the texture through a section
tdoEditorTexture *p_oEditorTexture = (tdoEditorTexture *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(p_stTexture);
if ( p_oEditorTexture && g_oCoherenceManager.m_fn_ulGetLinkWeight(p_oEditorMaterial, p_oEditorTexture) )
{
if ( bOnlyOne ) //if there is only one texture, save it as unanimated
{
SCR_M_SvL0_SaveEntry(_p_stFile, "AddTexture", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(
_p_stFile, SCR_EF_SvL0_Scanf, 3, "%d,%s",
0, LPCTSTR(p_oEditorTexture->GetReferencedSectionName())
);
}
else //there are more than one: save all textures as components of the animation
{
SCR_M_SvL0_SaveEntry(_p_stFile, "AddTexture", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(
_p_stFile, SCR_EF_SvL0_Scanf, 4, "%d,%s,%f",
0, LPCTSTR(p_oEditorTexture->GetReferencedSectionName()), fDuration
);
}
}
}
//chrome attribute is relevant only if the material is textured
if ( GLI_bIsMaterialChromed(hMaterialVisual) )
{
SCR_M_SvL0_SaveEntry(_p_stFile, "Env1", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile, SCR_EF_SvL0_Normal, 1, "0");
}
//backface attribute too
pszType = ( xMType & GLI_C_lIsTestingBackface ) ? "OFF" : "ON";
SCR_M_SvL0_SaveEntry(_p_stFile, "Backface", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile, SCR_EF_SvL0_Normal, 1, pszType);
}
//scroll
long lSwitch;
float fUSpeed, fVSpeed;
GLI_xGetMaterialTextureScrollingCoef(hMaterialVisual, 0, &lSwitch, &fUSpeed, &fVSpeed);
if ( lSwitch )
{
SCR_M_SvL0_SaveEntry(_p_stFile, "Scroll", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(
_p_stFile, SCR_EF_SvL0_Scanf, 4, "%ld,%f,%f",
0, fUSpeed, fVSpeed
);
}
// End Section
SCR_M_SvL0_SaveEndSection(_p_stFile, SCR_CC_C_Cfg_EOL);
//now the section exists, if this was not the case
p_oEditorMaterial->fn_vSectionSaved(); // the section is saved and has no pending notification
}
//=================================================================================
//=================================================================================
//=================================================================================
// static functions for the class
//=================================================================================
//=================================================================================
//=================================================================================
CString tdoEditorVisualMaterial::m_csGetMaterialType()
{
return C_szVisualMaterialTypeName;
}
CString tdoEditorVisualMaterial::m_csGetScriptExtension()
{
return ".vmt";
}

View File

@@ -0,0 +1,65 @@
/*=============================================================================
*
* Filename: VMatObj.hpp
* Version: 1.0
* Date: 06/11/96
* Author: B.G.
*
* Description: editor material class
*
*===========================================================================*/
#ifndef __VMATOBJ_HPP__
#define __VMATOBJ_HPP__
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
#include <afxtempl.h>
#include <afxcview.h>
#include "Acp_base.h"
#include "itf.h"
#include "gmt.h"
#include "scr.h"
class tdoEditorVisualMaterial : public CPA_SaveObject
{
public:
tdoEditorVisualMaterial(
CPA_FileObject *_p_oOwnerFile,
CString _csId,
BOOL _bSectionAlreadyExists,
ACP_tdxHandleOfMaterial _hTemplateVisualMaterial
);
~tdoEditorVisualMaterial();
ACP_tdxHandleOfMaterial m_hGetEngineMaterial() { return m_hVisualMaterial; }
static void m_vCallBackSaveVMT( // save the visual material section
SCR_tdst_File_Description *_p_stFile,
char *_p_szSectionName,
void *_p_vData,
SCR_tde_Ntfy_Action _eAction
);
BOOL m_bIsReferenced();
static CString m_csGetMaterialType();
static CString m_csGetScriptExtension();
//overloads from base class
virtual void *GetData(void) { return m_hVisualMaterial; }
virtual long GetDataType(void) { return 0; };
virtual tdeMissingCriteria fn_eCheckUnicity(const CString csNewName) { return fn_eCheckUnicityWithOwner(csNewName); }
//virtual void fn_vNotify(SCR_tde_Ntfy_Action _eAction);
//CString GetReferencedSectionName(void);
private:
ACP_tdxHandleOfMaterial m_hVisualMaterial;
};
#endif /* __VMATOBJ_HPP__ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,378 @@
//**************************************
// This is the base class of your DLL interface
// All methods of CPA_ToolDLLBase are
// present in that class.
//**************************************
#ifndef __MaterialINTERF_HPP__
#define __MaterialINTERF_HPP__
#ifdef ACTIVE_EDITOR
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
// if you want only one instance of your DLL
// activate the next line
#define DLL_ONLY_ONE_INSTANCE
#include "Acp_base.h"
#include "itf.h"
class CMaterialListView;
class DiaView;
class DiaMeca;
class DiaSound;
class DiaCol;
class DiaMain;
class DiaText;
class tdoEditorGameMaterial;
class tdoEditorCollideMaterial;
class tdoEditorVisualMaterial;
class tdoEditorMechanicsMaterial;
class CTextureDlg;
typedef enum tdeRefreshListsMode_
{
E_rlm_DoNothing = 0,
E_rlm_DestroyAndRebuild,
E_rlm_UpdateWithoutDestruction
} tdeRefreshListsMode;
#define C_szFileReferencedNameKey "MaterialRef"
#define C_szFileMinimalNameKey "MaterialMin"
//structure used to highlight display
typedef struct stHighlightItem_
{
GMT_tdxHandleToGameMaterial hGameMaterial;
ACP_tdxHandleOfMaterial hHighlightVisualMaterial;
ACP_tdxHandleOfMaterial hOriginalVisualMaterial;
} tdstHighlightItem;
typedef enum eActivationMode_
{
E_am_InvalidMode,
E_am_Never,
E_am_Once,
E_am_Always
} tdeActivationMode;
//ANNECY Shaitan DisableFunctions (16/04/98) {
extern BOOL g_bMasterEditor;
#define C_szCommon "World\\Libraries\\Materials\\Common\\Common.gmt"
//ENDANNECY Shaitan DisableFunctions }
//----------------------------------------------------------
// Tool DLL interface class
//----------------------------------------------------------
class Material_Interface : public CPA_ToolDLLBase
{
private:
CBitmapList m_oTextureList; // List of all bitmaps in Data directory
CSplitFrame *m_p_oLeftSplitFrame; // Main frame of the editor
CSplitFrame *m_p_oBottomSplitFrame;
//BOOL m_bIsActivated; // are the dialogs displayed on the screen ?
//BOOL m_bIsSelected; //is it the current dll ?
CMaterialListView *m_p_oMaterialListView;
DiaView *m_p_oMaterialView;
DiaMeca *m_p_oMaterialMeca; // pointer to mecanics dialog
DiaSound *m_p_oMaterialSound; // pointer to sound dialog
DiaCol *m_p_oMaterialCol; // pointer to collision dialog
DiaMain *m_p_oMaterialMain; // pointer to the main dialog
DiaText *m_p_oTextureDialog; //pointer to texture edition dialog
CTextureDlg *m_p_oTextureDlg; // texture modal dialog box to choose a texture for the current material
CPA_SuperObject *m_p_oWorldRoot;
BOOL m_bDisplayMaterialUnderCursor; // display material name on status bar
void m_vRefreshMaterialSuperObjectLinks(void);
tdeRefreshListsMode m_eRefreshListsMode;
void m_vSavePreferences(void);
BOOL m_bModeIsMaterialSelect;
BOOL m_bModeIsIndexedTriangleSplit;
BOOL m_bEnteredEditorAtLeastOnce;
tdeActivationMode m_eLoadWarningsActivation;
GMT_tdxHandleToGameMaterial m_hQueriedDefaultGameMaterial;
CPA_List<CPA_BaseObject> m_oFileObjectList;
HIE_aDEF_stTabOfPickInfo m_a_stPickInfo;
tdoEditorGameMaterial *m_p_oMaterialUnderCursor;
BOOL m_bCanSaveModifs;
BOOL m_bTexturesLoaded;
CPA_KeyActionConfiguration *m_p_oKeyConfiguration;
CList<tdstHighlightItem *, tdstHighlightItem *> m_oHighlightList;
public:
Material_Interface(void);
~Material_Interface(void);
tdeRefreshListsMode m_eGetRefreshListMode() { return m_eRefreshListsMode; }
CString m_csGetIdPartOfSectionName(CString _csSectionName);
CString m_csGetActionPartOfSectionName(CString _csSectionName);
CString m_csGetFilePartOfSectionName(CString _csSectionName);
CBitmapList *m_p_oGetMaterialsTextureList() { return &m_oTextureList; }
CMaterialListView *m_p_oGetMaterialListView() { return m_p_oMaterialListView; }
DiaView *m_p_oGetVisualView() { return m_p_oMaterialView; }
DiaMeca *m_p_oGetMecaView() { return m_p_oMaterialMeca; }
DiaSound *m_p_oGetSoundView() { return m_p_oMaterialSound; }
DiaCol *m_p_oGetCollView() { return m_p_oMaterialCol; }
DiaMain *m_p_oGetMainView() { return m_p_oMaterialMain; }
DiaText *m_p_oGetTexView() { return m_p_oTextureDialog; }
CPA_SuperObject *m_p_oGetWorldSuperObject(void) { return m_p_oWorldRoot; }
tdoEditorGameMaterial *m_p_oGetEditedMaterial();
CTextureDlg *m_p_oGetTextureChooserDialog(void) { return m_p_oTextureDlg; }
void m_fn_vShowMaterialAll(tdoEditorGameMaterial *_p_oMaterial = NULL);
void m_vSetEditedMaterial(tdoEditorGameMaterial *_p_oMaterial);
BOOL m_bEditPickedMaterial(HIE_tdstPickInfo *_p_stPickInfo);
BOOL m_bLoadWarningsAreEnabled();
CPA_FileObject *m_p_oGetCurrentFileObject();
void m_vFindMaterialUnderCursor(CPoint _oPoint, BOOL _bVerbose = FALSE);
//Mircea Dunka 5.11.1998
void m_vFindColorUnderCursor(CPoint _oPoint, BOOL _bVerbose);
BOOL m_bGetGlidePixel;
//end Mircea Dunka
BOOL m_bSplitIndexedTriangle() { return m_bModeIsIndexedTriangleSplit; }
void m_vLoadHighlightInfo();
void m_vSaveHighlightInfo();
void m_vShowEditor();
void m_vHideEditor();
// ~Material_Interface(void);
//void m_vRefreshMaterialList<tdoEditorGameMaterial>(CString _csExtension);
void m_vRefreshFileObjectList();
void m_vDoRefreshLists(long _lStartInLinkTable = 0, tdeRefreshListsMode _eOverrideMode = E_rlm_DoNothing, BOOL _bLoadTextures = TRUE);
CPA_SaveObject *m_p_oGetEditorObjectForEngine(ACP_tdxHandleOfMaterial _hVisualMaterial);
CPA_SaveObject *m_p_oGetEditorObjectForEngine(DNM_tdxHandleToMecMatCharacteristics _hMechanicsMaterial);
CPA_SaveObject *m_p_oGetEditorObjectForEngine(GMT_tdxHandleToCollideMaterial _hCollideMaterial);
CPA_SaveObject *m_p_oGetEditorObjectForEngine(GMT_tdxHandleToGameMaterial _hGameMaterial);
CPA_SaveObject *m_p_oGetEditorObjectForEngine(GLI_tdstTexture *_hTexture);
/*===========================================================================
Messages
=========================================================================*/
virtual BOOL fn_bAcceptToSave(void);
virtual void fn_vBeforeSaveAll(void);
virtual void fn_vAfterSaveAll(void);
// engine - editor
void fn_vBeforeEngine (void);
void fn_vBeforeEditor (void);
// engine
// BOOL fn_bAcceptToRunEngine (void) { return TRUE; };
// BOOL fn_bAcceptToRunTimerEngine (void) { return TRUE; };
// end appli
// void fn_vJustBeforeClosing (void) { };
// BOOL fn_bAcceptToExit (void) { return TRUE; };
// keys
virtual BOOL _OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags);
virtual BOOL _OnKeyUp (UINT nChar, UINT nRepCnt, UINT nFlags);
// mouse
virtual BOOL _OnMouseMove(UINT nFlags, tdstMousePos *p_stPos, MTH3D_tdstVector *p_stVect);
// BOOL _OnLButtonDblClk (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo) { return FALSE; };
// BOOL _OnRButtonDblClk (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo) { return FALSE; };
virtual BOOL _OnLButtonDown(UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo);
// BOOL _OnRButtonDown (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo) { return FALSE; };
// BOOL _OnLButtonUp (UINT nFlags, tdstMousePos *p_stPos) { return FALSE; };
// BOOL _OnRButtonUp (UINT nFlags, tdstMousePos *p_stPos) { return FALSE; };
// command
// BOOL _OnCommand (UINT IDCmdMsg) { return FALSE; };
// BOOL _OnUpdateCommandUI (UINT uiID, CCmdUI *pCmdUI) { return FALSE; };
// dragdrop
// BOOL _OnDragDropEnd (WPARAM wParam, LPARAM lParam) { return FALSE; };
// BOOL _OnDragDropMove (WPARAM wParam, LPARAM lParam) { return FALSE; };
// BOOL _OnDragDropLooseFocus (WPARAM wParam, LPARAM lParam) { return FALSE; };
// BOOL _OnDragDropGainFocus (WPARAM wParam, LPARAM lParam) { return FALSE; };
// add objects to draw
virtual void fn_vBeforeDrawingWorld(GLD_tdstViewportAttributes *p1, GLI_tdxHandleToLight p2, DEV_ViewPort* p3);
virtual void fn_vAddObjectsToDraw (GLD_tdstViewportAttributes *p1, GLI_tdxHandleToLight p2, DEV_ViewPort* p3);
virtual void fn_vAddObjectsToDraw2 (GLD_tdstViewportAttributes *p1, GLI_tdxHandleToLight p2);
/*===========================================================================
Reachable Objects
=========================================================================*/
virtual BOOL fn_bLoadBaseObject (CPA_BaseObject *p_oObject);
/*===========================================================================
Reinit
=========================================================================*/
void fn_vOnChangeRoot(void)
{
m_p_oWorldRoot = M_GetWorld()->GetRoot();
}
void fn_vOnChangeWorld(void)
{
m_p_oWorldRoot = M_GetWorld()->GetRoot();
}
void fn_vOnChangeDevice(void)
{
m_p_oWorldRoot = M_GetWorld()->GetRoot();
}
/*===========================================================================
for Dialog List
=========================================================================*/
// CPA_ReachableObject * GetDialogSelection (CPA_DialogList *pDialog, CString csTypeName, tdeListDrawMode eDrawMode) { return NULL; };
// void GetListsForDialog (CPA_DialogList *pDialog) { };
// BOOL fn_bOnSelChangeHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_SuperObject *pSelectedObject) { return FALSE; };
// BOOL fn_bOnDblClkHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_SuperObject *pSelectedObject) { return FALSE; };
// BOOL fn_bOnSelChangeListObjects (CPA_DialogList *pDialog, CString csTypeName, CPA_ReachableObject *pSelectedObject, BOOL bUnselect) { return FALSE; };
// BOOL fn_bOnDblClkListObjects (CPA_DialogList *pDialog, CString csTypeName, CPA_ReachableObject *pSelectedObject) { return FALSE; };
// BOOL fn_bCanDragItemInHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_SuperObject *pObjectToDrag) { return FALSE; };
// BOOL fn_bCanDropItemInHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_SuperObject *pObjectToDrop, CPA_SuperObject *pTarget) { return FALSE; };
// BOOL fn_bOnDragDropInHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_SuperObject *pObject, CPA_SuperObject *pTarget) { return FALSE; };
// BOOL fn_bOnSelChangeComboList (CPA_DialogList *pDialog, CString csTypeName) { return FALSE; };
// BOOL fn_bOnButtonTest (CPA_DialogList *pDialog, CString csTypeName, tdeListDrawMode eDraw) { return FALSE; };
// void fn_vInitDefaultParameters (CPA_DialogList *pDialog);
// void fn_vSetANewTest (CPA_DialogList *pDialog, CString csCurrentList) { };
// BOOL fn_bTestFunction (CString csCurrentType, CString csTestName, CPA_ReachableObject *pEdObj) { return TRUE; };
// BOOL fn_bSetCustomTest (CPA_DialogList *pDialog) { return FALSE; }
// BOOL fn_bCustomTestFunction (CString csCurrentType, CString csTestName, CPA_ReachableObject *pEdObj) { return TRUE; }
/*===========================================================================
Dialog Bar - Mircea Dunka 31 Aug. 1998
=========================================================================*/
void fn_vDefineDlgBarBtnIcon (tde_DlgBarCategory wCategory, tds_DlgBarBtn *_pDlgBarBtn);
/*===========================================================================
SubMenus and PopupMenu
=========================================================================*/
BOOL fn_bDefineSubMenu (EDT_SubMenu *_p_oEDTSubMenu) ;
void _OnSubMenuCommand (EDT_SubMenu *_p_oEDTSubMenu,UINT uiMsgID) ;
BOOL fn_bDefinePopupMenu(EDT_PopUpMenu *pPopup, CPA_List<CPA_SuperObject> *pSelection, BOOL bAsCurrentEditor);
void _OnPopUpMenuCommand(UINT m_IDCmdMsg);
/*===========================================================================
Messages from Evt_Editor
=========================================================================*/
// To pre translate all messages
// BOOL fn_bPreTranslateMessage(MSG * /*p_stMsg*/) { return FALSE; };
// Called just after editor has been inserted in list of all editors
void fn_vJustAfterRegistered(void) ;
// Called just before windows main loop processing
void fn_vConstruct(void) ;
// Called to refresh datas of DLL if "fn_vCanBeRefresh" returns TRUE
// void fn_vRefreshDatas(void) {};
// Called when level has changed
void fn_vLevelHasChanged(void);
// Current editor -> No current editor
// void fn_vHasLostFocus(void) {};
// No current editor -> Current editor
// BOOL fn_bHasGainedFocus(void) { return TRUE; };
/*===========================================================================
Messages from Evt_Editor
=========================================================================*/
// Editor Modifs
// void fn_vOnModifDelete (CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus) { }
// void fn_vOnModifParent (CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus) { }
// void fn_vOnModifCopy (CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus) { }
// void fn_vOnModifName (CPA_SuperObject *pEdObj, CString csInitalName, CString csFinalName, tdeTypeModif eType, tdeStatus eStatus) { }
// void fn_vOnSelect (CPA_SuperObject *pEdObj, tdeTypeModif eType, tdeStatus eStatus) { }
// void fn_vOnModifInsert (CPA_SuperObject *pEdObj, CPA_SuperObject *pParent,
// tdstPosition *p_stPosition, tdeTypeModif eType, tdeStatus eStatus) { }
// Moves
// void fn_vOnModifMove (CPA_List<EDT_SavePos> *pListObjects, CPA_List<EDT_SaveGlobalPos> *pListConcerned, tdeTypeModif eType, tdeStatus eStatus) { }
// void fn_vOnBeginMove (CPA_List<CPA_SuperObject> *pListObjects, CPA_List<CPA_SuperObject> *pListConcerned, tdeStatus eStatus) { }
// void fn_vOnMoving (CPA_List<CPA_SuperObject> *pListObjects, CPA_List<CPA_SuperObject> *pListConcerned, tdeStatus eStatus) { }
// Models
// void fn_vOnAddModelToList (CPA_ObjectDLLBase *pOwnerDLL, CString csListName, CString csModelName, tdeTypeModif eType) { }
// permission
// BOOL fn_bAcceptModifDelete (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus) { return TRUE; }
// BOOL fn_bAcceptModifParent (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus) { return TRUE; }
// BOOL fn_bAcceptModifCopy (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus) { return TRUE; }
// BOOL fn_bAcceptModifTranslate (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus) { return TRUE; }
// BOOL fn_bAcceptModifRotate (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus) { return TRUE; }
// BOOL fn_bAcceptModifInsert (CPA_SuperObject *pEdObj, CPA_SuperObject *pParent, tdeStatus eStatus) { return TRUE; }
// BOOL fn_bAcceptModifScale (CPA_SuperObject *pEdObj, tdeStatus eStatus) { return TRUE; }
// BOOL fn_bAcceptModifName (CPA_SuperObject *pEdObj, tdeStatus eStatus) { return TRUE; }
// BOOL fn_bAcceptMultiSelect (void) { return TRUE; }
// to precise selection
// tdeTypeAnswer fn_bAcceptSelect (CPA_SuperObject *pEdObj, ACP_tdxIndex xIndex, HIE_tdstPickInfo *pPicking, tdeStatus eStatus) { return C_Accept; }
/*===========================================================================
Current Editor
=========================================================================*/
virtual tdePermission fn_eAcceptNewEditor (CPA_EditorBase *pNewEditor) { return C_CloseBefore; }
virtual BOOL fn_bCanActivateEditor (CPA_List<CPA_BaseObject> *pParams)
{
return
#ifdef __INACTIVE_INTERFACE__
FALSE
#else
!fn_bIsCurrentEditor();
#endif
;
}
// BOOL fn_bCanCloseEditor (void) { return TRUE; }
virtual void fn_vOnActivateEditor (CPA_List<CPA_BaseObject> *pParams, BOOL bBackActivated=FALSE);
void fn_vOnCloseEditor (void);
// CString GetCurrentEditorName (void) { return GetName(); }
// void fn_vOnChangeCurrentEditor (CPA_DLLBase *pCurrentEditor, CPA_DLLBase *pNewEditor) { }
// void fn_vBackActiveMe (void *pMyData) { };
// void fn_vEraseWalkDataStructure (void *pMyData) { };
/*===========================================================================
General Purpose
=========================================================================*/
virtual long OnQueryAction(CPA_EditorBase * /*p_oSender*/, WPARAM, LPARAM);
// long OnQueryInfos (CPA_EditorBase * /*p_oSender*/, WPARAM, LPARAM) { return 0; };
// long OnQueryOpen (CPA_EditorBase * /*p_oSender*/, WPARAM, LPARAM) { return 0; };
// long OnQueryClose (CPA_EditorBase * /*p_oSender*/, WPARAM, LPARAM) { return 0; };
/*===========================================================================
Coherence
=========================================================================*/
virtual void fn_vOnModifyChild(CPA_BaseObject *pOwner, CPA_BaseObject *pReferencedObject, unsigned long _ulData);
virtual BOOL fn_bOnInvalidateLink(CPA_BaseObject *pOwner, CPA_BaseObject *pReferencedObject, BOOL bDestroyed);
virtual void fn_vOnRestoreLink(CPA_BaseObject *pOwner, CPA_BaseObject *pReferencedObject);
};
extern tdstDLLIdentity g_stMaterialIdentity;
#define M_p_oGetEditManager() (((DEV_MultiDevice3D *) gs_p_oMaterialInterface->GetInterface()->GetMultiDevice())->GetEditManager())
void fn_vGiveProgressInfo(CString csMessage, long lPercentage, short _wHighLight = C_STATUS_NORMAL);
ACP_tdxIndex xGetPickInfoUnderPoint(HIE_aDEF_stTabOfPickInfo *_p_xRetrievedPickInfo, CPoint _oScreenCursor);
CPA_FileObject *p_oGetFileObjectForCompletePath(CString _csPath);
CPA_FileObject *p_oGetFileObjectForReferencedPath(CString _csPath, CString _csKey = C_szFileReferencedNameKey);
const char *fn_pszBaseName0(const char *_pszName);
//TODO: should be useless once textures have proper entries in the link tables
const char *fn_pszBaseName1(const char *_pszName);
#endif // ACTIVE_EDITOR
#endif // __MaterialINTERF_HPP__

View File

@@ -0,0 +1,382 @@
// choosecolor.cpp : implementation file
//
#include "stdafx.h"
#include "Acp_Base.h"
#define HieFriend
#include "matres.h"
#include "inctex.h"
#include "choosecolor.hpp"
#include "_interf.hpp"
#include "x:\cpa\main\inc\_editid.h"
#include "TUT.h"
/////////////////////////////////////////////////////////////////////////////
// CChooseColor dialog
extern Material_Interface *gs_p_oMaterialInterface;
//==================================================================================================
//==================================================================================================
CChooseColor::CChooseColor(CWnd* pParent /*=NULL*/)
: CDialog(CChooseColor::IDD, pParent)
{
//{{AFX_DATA_INIT(CChooseColor)
m_uiRed = 0;
m_uiGreen = 0;
m_uiBlue = 0;
m_uiAlpha = 0;
m_uiCapturedRed = 0;
m_uiCapturedGreen = 0;
m_uiCapturedBlue = 0;
m_uiCapturedAlpha = 0;
//}}AFX_DATA_INIT
m_bAutoFill = FALSE;
}
//==================================================================================================
//==================================================================================================
void CChooseColor::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CChooseColor)
DDX_Control(pDX, IDC_SLIDER_RED, m_oSliderRed);
DDX_Control(pDX, IDC_SLIDER_GREEN, m_oSliderGreen);
DDX_Control(pDX, IDC_SLIDER_BLUE, m_oSliderBlue);
DDX_Control(pDX, IDC_SLIDER_ALPHA, m_oSliderAlpha);
DDX_Text(pDX, IDC_EDIT_RED, m_uiRed);
DDV_MinMaxUInt(pDX, m_uiRed, 0, 255);
DDX_Text(pDX, IDC_EDIT_GREEN, m_uiGreen);
DDV_MinMaxUInt(pDX, m_uiGreen, 0, 255);
DDX_Text(pDX, IDC_EDIT_BLUE, m_uiBlue);
DDV_MinMaxUInt(pDX, m_uiBlue, 0, 255);
DDX_Text(pDX, IDC_EDIT_ALPHA, m_uiAlpha);
DDV_MinMaxUInt(pDX, m_uiAlpha, 0, 255);
//}}AFX_DATA_MAP
if ( !pDX->m_bSaveAndValidate ) //move data from internal values to the slider controls
{
//and update the color display
GetDlgItem(IDC_BUTTON_COLOR)->Invalidate();
}
}
//==================================================================================================
//==================================================================================================
BEGIN_MESSAGE_MAP(CChooseColor, CDialog)
//{{AFX_MSG_MAP(CChooseColor)
ON_WM_DRAWITEM()
ON_WM_HSCROLL()
ON_EN_CHANGE(IDC_EDIT_RED, OnChangeEditRed)
ON_EN_CHANGE(IDC_EDIT_GREEN, OnChangeEditGreen)
ON_EN_CHANGE(IDC_EDIT_BLUE, OnChangeEditBlue)
ON_EN_CHANGE(IDC_EDIT_ALPHA, OnChangeEditAlpha)
ON_WM_DESTROY()
ON_BN_CLICKED(IDC_TEXTURE_COLOR, OnTextureColor)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChooseColor message handlers
//==================================================================================================
//==================================================================================================
void CChooseColor::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC *pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
RECT *rect = &lpDrawItemStruct->rcItem;
COLORREF xColor;
switch ( nIDCtl )
{
default:
CDialog::OnDrawItem(nIDCtl, lpDrawItemStruct);
break;
case IDC_BUTTON_COLOR:
// lefthand 2/3 with the color
xColor = RGB(m_uiRed, m_uiGreen, m_uiBlue);
pDC->FillSolidRect( rect, xColor);
// righthand 1/3 with the alpha coeff
rect->left += (rect->right * 2) / 3;
xColor = RGB(m_uiAlpha, m_uiAlpha, m_uiAlpha);
pDC->FillSolidRect(rect, xColor);
break;
}
}
//==================================================================================================
//==================================================================================================
BOOL CChooseColor::OnInitDialog()
{
CDialog::OnInitDialog();
m_oSliderRed.SetRange(0, 255);
m_oSliderGreen.SetRange(0, 255);
m_oSliderBlue.SetRange(0, 255);
m_oSliderAlpha.SetRange(0, 255);
//move data in the controls to update the sliders, because their range just changed
UpdateData(FALSE);
//set the sliders properly
m_oSliderRed.SetPos(m_uiRed);
m_oSliderGreen.SetPos(m_uiGreen);
m_oSliderBlue.SetPos(m_uiBlue);
m_oSliderAlpha.SetPos(m_uiAlpha);
// update button
GetDlgItem(IDC_TEXTURE_COLOR)->EnableWindow(m_bCapturedColor);
/*m_oColorBitmap.LoadBitmap(IDB_BITMAP_CHOOSECOLOR);
((CButton *) GetDlgItem(IDC_BUTTON_COLOR))->SetBitmap(HBITMAP(m_oColorBitmap));*/
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
//==================================================================================================
//==================================================================================================
void CChooseColor::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if ( !m_bAutoFill )
{
m_bAutoFill = TRUE;
long lPos = ((CSliderCtrl *) pScrollBar)->GetPos();
//set the internal value as needed
if ( pScrollBar == (CScrollBar *) &m_oSliderRed )
m_uiRed = lPos;
else if ( pScrollBar == (CScrollBar *) &m_oSliderGreen )
m_uiGreen = lPos;
else if ( pScrollBar == (CScrollBar *) &m_oSliderBlue )
m_uiBlue = lPos;
else if ( pScrollBar == (CScrollBar *) &m_oSliderAlpha )
m_uiAlpha = lPos;
//update the controls with the new value
UpdateData(FALSE);
m_bAutoFill = FALSE;
}
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
//==================================================================================================
//==================================================================================================
void CChooseColor::OnChangeEditRed()
{
if ( !m_bAutoFill )
{
m_bAutoFill = TRUE;
//retrieve data in internal values
UpdateData(TRUE);
//store them back in the slider controls
m_oSliderRed.SetPos(m_uiRed);
m_bAutoFill = FALSE;
}
}
//==================================================================================================
//==================================================================================================
void CChooseColor::OnChangeEditGreen()
{
if ( !m_bAutoFill )
{
m_bAutoFill = TRUE;
//retrieve data in internal values
UpdateData(TRUE);
//store them back in the slider controls
m_oSliderGreen.SetPos(m_uiGreen);
m_bAutoFill = FALSE;
}
}
//==================================================================================================
//==================================================================================================
void CChooseColor::OnChangeEditBlue()
{
if ( !m_bAutoFill )
{
m_bAutoFill = TRUE;
//retrieve data in internal values
UpdateData(TRUE);
//store them back in the slider controls
m_oSliderBlue.SetPos(m_uiBlue);
m_bAutoFill = FALSE;
}
}
//==================================================================================================
//==================================================================================================
void CChooseColor::OnChangeEditAlpha()
{
if ( !m_bAutoFill )
{
m_bAutoFill = TRUE;
//retrieve data in internal values
UpdateData(TRUE);
//store them back in the slider controls
m_oSliderAlpha.SetPos(m_uiAlpha);
m_bAutoFill = FALSE;
}
}
//==================================================================================================
//==================================================================================================
void CChooseColor::m_vSetColor(GLI_tdstColor *_p_stColor)
{
m_uiRed = (UINT) (_p_stColor->xR * 255);
m_uiGreen = (UINT) (_p_stColor->xG * 255);
m_uiBlue = (UINT) (_p_stColor->xB * 255);
m_uiAlpha = (UINT) (_p_stColor->xA * 255);
}
//Mircea Dunka 12.11.98
//==================================================================================================
//==================================================================================================
void CChooseColor::m_vSetCapturedColor(GLI_tdstColor *_p_stCapturedColor)
{
if (_p_stCapturedColor)
{
m_uiCapturedRed = (UINT) (_p_stCapturedColor->xR * 255);
m_uiCapturedGreen = (UINT) (_p_stCapturedColor->xG * 255);
m_uiCapturedBlue = (UINT) (_p_stCapturedColor->xB * 255);
m_uiCapturedAlpha = (UINT) (_p_stCapturedColor->xA * 255);
m_bCapturedColor = TRUE;
}
else
m_bCapturedColor = FALSE;
}
//==================================================================================================
//==================================================================================================
void CChooseColor::m_vGetColor(GLI_tdstColor *_p_stColor)
{
_p_stColor->xR = ((float) m_uiRed) / 255;
_p_stColor->xG = ((float) m_uiGreen) / 255;
_p_stColor->xB = ((float) m_uiBlue) / 255;
_p_stColor->xA = ((float) m_uiAlpha) / 255;
}
//Mircea Dunka 12.11.98 - captured color added
//==================================================================================================
// Description : Edit a color, return true if color has changed
//==================================================================================================
BOOL fn_bEditColor(CWnd *_pParentWnd, GLI_tdstColor *_p_stColor, GLI_tdstColor * _p_stCapturedColor)
{
CChooseColor oCColor(_pParentWnd);
oCColor.m_vSetColor(_p_stColor);
oCColor.m_vSetCapturedColor(_p_stCapturedColor);
if( oCColor.DoModal() == IDOK )
{
oCColor.m_vGetColor(_p_stColor);
return TRUE;
}
return FALSE;
/*
static COLORREF s_a16CustColors[16] =
{
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
};
COLORREF cr = RGB(p_stColor->xR * 255, p_stColor->xG * 255, p_stColor->xB * 255);
CColorDialog CColor( cr, CC_RGBINIT | CC_FULLOPEN | CC_ENABLEHOOK, _pParentWnd);
CColor.m_cc.lpCustColors = (COLORREF *) &s_a16CustColors;
CColor.m_cc.lpfnHook = CCHookProc;
if ( _wAlpha >= 0 )
s_a16CustColors[15] = RGB(_wAlpha, 0, 0);
if (CColor.DoModal() == IDOK)
{
cr = CColor.GetColor();
p_stColor->xR = (GEO_tdxColorValue) (GetRValue(cr) / 255.0);
p_stColor->xG = (GEO_tdxColorValue) (GetGValue(cr) / 255.0);
p_stColor->xB = (GEO_tdxColorValue) (GetBValue(cr) / 255.0);
if ( _wAlpha >= 0 )
p_stColor->xA = (GEO_tdxColorValue) (GetRValue(s_a16CustColors[15]) / 255.0);
return TRUE;
}
return FALSE;
*/
}
BOOL CChooseColor::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
if ( CDialog::Create(IDD, pParentWnd) )
{
//control registration for tutorial and assistants, should be unregistered when view is destroyed
TUT_M_vGetTutDll();
TUT_M_vRegisterControlID(IDC_SLIDER_RED,"TGM_ChooseColorSliderRed",TUT_e_Slider);
TUT_M_vRegisterControlID(IDC_SLIDER_GREEN,"TGM_ChooseColorSliderGreen",TUT_e_Slider);
TUT_M_vRegisterControlID(IDC_SLIDER_BLUE,"TGM_ChooseColorSliderBlue",TUT_e_Slider);
TUT_M_vRegisterControlID(IDC_SLIDER_ALPHA,"TGM_ChooseColorSliderAlpha",TUT_e_Slider);
TUT_M_vRegisterControlID(IDC_EDIT_RED,"TGM_ChooseColorEditRed",TUT_e_TextEdit);
TUT_M_vRegisterControlID(IDC_EDIT_GREEN,"TGM_ChooseColorEditGreen",TUT_e_TextEdit);
TUT_M_vRegisterControlID(IDC_EDIT_BLUE,"TGM_ChooseColorEditBlue",TUT_e_TextEdit);
TUT_M_vRegisterControlID(IDC_EDIT_ALPHA,"TGM_ChooseColorEditAlpha",TUT_e_TextEdit);
TUT_M_vRegisterControlID(IDOK,"TGM_ChooseColorOK",TUT_e_Button);
TUT_M_vRegisterControlID(IDCANCEL,"TGM_ChooseColorCancel",TUT_e_Button);
return TRUE;
}
else
return FALSE;
}
void CChooseColor::OnDestroy()
{
//control registration for tutorial and assistants, should be unregistered when view is destroyed
TUT_M_vGetTutDll();
TUT_M_vUnregisterControlID(IDC_SLIDER_RED);
TUT_M_vUnregisterControlID(IDC_SLIDER_GREEN);
TUT_M_vUnregisterControlID(IDC_SLIDER_BLUE);
TUT_M_vUnregisterControlID(IDC_SLIDER_ALPHA);
TUT_M_vUnregisterControlID(IDC_EDIT_RED);
TUT_M_vUnregisterControlID(IDC_EDIT_GREEN);
TUT_M_vUnregisterControlID(IDC_EDIT_BLUE);
TUT_M_vUnregisterControlID(IDC_EDIT_ALPHA);
TUT_M_vUnregisterControlID(IDOK);
TUT_M_vUnregisterControlID(IDCANCEL);
CDialog::OnDestroy();
// TODO: Add your message handler code here
}
//Mircea Dunka 11.11.98
void CChooseColor::OnTextureColor()
{
m_uiRed = m_uiCapturedRed;
m_uiGreen = m_uiCapturedGreen;
m_uiBlue = m_uiCapturedBlue;
m_uiAlpha = m_uiCapturedAlpha;
//set the sliders properly
m_oSliderRed.SetPos(m_uiRed);
m_oSliderGreen.SetPos(m_uiGreen);
m_oSliderBlue.SetPos(m_uiBlue);
m_oSliderAlpha.SetPos(m_uiAlpha);
UpdateData(FALSE);
GetDlgItem(IDC_BUTTON_COLOR)->InvalidateRect(NULL);
}
// end Mircea Dunka

View File

@@ -0,0 +1,78 @@
#if !defined(AFX_CHOOSECOLOR_HPP__6377FDF3_30BF_11D1_98AC_00609736738F__INCLUDED_)
#define AFX_CHOOSECOLOR_HPP__6377FDF3_30BF_11D1_98AC_00609736738F__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// choosecolor.hpp : header file
//
/////////////////////////////////////////////////////////////////////////////
// CChooseColor dialog
class CChooseColor : public CDialog
{
// Construction
public:
CChooseColor(CWnd* pParent = NULL); // standard constructor
void m_vSetColor(GLI_tdstColor *_p_stColor);
void m_vSetCapturedColor(GLI_tdstColor *_p_stCapturedColor);
void m_vGetColor(GLI_tdstColor *_p_stColor);
// Dialog Data
//{{AFX_DATA(CChooseColor)
enum { IDD = IDD_DIALOG_CHOOSECOLOR };
CSliderCtrl m_oSliderRed;
CSliderCtrl m_oSliderGreen;
CSliderCtrl m_oSliderBlue;
CSliderCtrl m_oSliderAlpha;
UINT m_uiRed;
UINT m_uiGreen;
UINT m_uiBlue;
UINT m_uiAlpha;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChooseColor)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
CBitmap m_oColorBitmap;
BOOL m_bAutoFill;
UINT m_uiCapturedRed;
UINT m_uiCapturedGreen;
UINT m_uiCapturedBlue;
UINT m_uiCapturedAlpha;
BOOL m_bCapturedColor;
// Generated message map functions
//{{AFX_MSG(CChooseColor)
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
virtual BOOL OnInitDialog();
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnChangeEditRed();
afx_msg void OnChangeEditGreen();
afx_msg void OnChangeEditBlue();
afx_msg void OnChangeEditAlpha();
afx_msg void OnDestroy();
afx_msg void OnTextureColor();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//Mircea Dunka 12.11.98 - added captured color
BOOL fn_bEditColor(CWnd *_pParentWnd, GLI_tdstColor *_p_stColor, GLI_tdstColor *_p_stCapturedColor=NULL);
//end Mircea Dunka
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHOOSECOLOR_HPP__6377FDF3_30BF_11D1_98AC_00609736738F__INCLUDED_)

View File

@@ -0,0 +1,128 @@
#include "stdafx.h"
#include "Acp_Base.h"
#include <string.h>
#define HieFriend
#include "incgam.h"
#include "dpt.h"
#include "gmt.h"
#include "scr.h"
#include "diacol.hpp"
#include "_interf.hpp"
#include "gmatobj.hpp"
#include "CopyPaste.hpp"
#include "MatList.hpp"
#include "x:\cpa\main\inc\_editid.h"
#include "TUT.h"
extern Material_Interface *gs_p_oMaterialInterface;
extern DiaCol *g_oMaterialCol; /* pour les callbacks du chrgement */
#include "ldt.h"
/*****************************************************************
Function name : DiaCol::fn_iLoadZDMNames
Description :
Author : Ovidiu Scripa (oscripa@ubisoft.ro) - ROMTEAM
Creation Date : 15-Oct-98
Modified :
Return type : int
Argument : LDT_tdst_Link *pLink
*****************************************************************/
int DiaCol::fn_iLoadZDMNames( LDT_tdst_Link *pLink )
{
LDT_tdeParseResult result=ParseResult_BeginSection;
g_oMaterialCol->m_currentNameRead = 0;
while( result!=ParseResult_EndSection )
{
result=LDT_GetNextEntry();
switch( result )
{
case ParseResult_Entry: /* an entry */
{
char *szEntry=LDT_szGetEntryName();
g_oMaterialCol->m_p_oMyNameObject[g_oMaterialCol->m_currentNameRead].fn_eRename((CString)szEntry);
g_oMaterialCol->m_currentNameRead ++;
}
}
}
return 0;
}
/*****************************************************************
Function name : DiaCol::fn_iLoadZDRNames
Description :
Author : Ovidiu Scripa (oscripa@ubisoft.ro) - ROMTEAM
Creation Date : 15-Oct-98
Modified :
Return type : int
Argument : LDT_tdst_Link *pLink
*****************************************************************/
int DiaCol::fn_iLoadZDRNames( LDT_tdst_Link *pLink )
{
LDT_tdeParseResult result=ParseResult_BeginSection;
g_oMaterialCol->m_currentNameRead = C_uc_NumberOfNames;
while( result!=ParseResult_EndSection )
{
result=LDT_GetNextEntry();
switch( result )
{
case ParseResult_Entry: /* an entry */
{
char *szEntry=LDT_szGetEntryName();
g_oMaterialCol->m_p_oMyNameObject[g_oMaterialCol->m_currentNameRead].fn_eRename((CString)szEntry);
g_oMaterialCol->m_currentNameRead ++;
}
}
}
return 0;
}
/*****************************************************************
Function name : DiaCol::fn_iLoadZDENames
Description :
Author : Ovidiu Scripa (oscripa@ubisoft.ro) - ROMTEAM
Creation Date : 15-Oct-98
Modified :
Return type : int
Argument : LDT_tdst_Link *pLink
*****************************************************************/
int DiaCol::fn_iLoadZDENames( LDT_tdst_Link *pLink )
{
LDT_tdeParseResult result=ParseResult_BeginSection;
g_oMaterialCol->m_currentNameRead = C_uc_NumberOfNames * 2;
while( result!=ParseResult_EndSection )
{
result=LDT_GetNextEntry();
switch( result )
{
case ParseResult_Entry: /* an entry */
{
char *szEntry=LDT_szGetEntryName();
g_oMaterialCol->m_p_oMyNameObject[g_oMaterialCol->m_currentNameRead].fn_eRename((CString)szEntry);
g_oMaterialCol->m_currentNameRead ++;
}
}
}
return 0;
}

View File

@@ -0,0 +1,74 @@
#include "stdafx.h"
#include "Acp_Base.h"
#define HieFriend
#include "incgam.h"
#include "gmt.h"
#include "dpt.h"
#include "diameca.hpp"
#include "_interf.hpp"
#include "GMatObj.hpp"
#include "MMatObj.hpp"
#include "x:\cpa\main\inc\_editid.h"
#include "CopyPaste.hpp"
#include "MatList.hpp"
#include "TUT.h"
extern Material_Interface *gs_p_oMaterialInterface;
extern DiaMeca *g_oMaterialMeca; // used for loading callbacks
#include "ldt.h"
#define lTagRebound 'obeR'
#define lTagSlide1 'dilS'
/*****************************************************************
Function name : DiaMeca::fn_iLoadMecaDefault
Description :
Author : Ovidiu Scripa (oscripa@ubisoft.ro) - ROMTEAM
Creation Date : 15-Oct-98
Modified :
Return type : int
Argument : LDT_tdst_Link *pLink
*****************************************************************/
int DiaMeca::fn_iLoadMecaDefault( LDT_tdst_Link *pLink )
{
LDT_tdeParseResult result=ParseResult_BeginSection;
while( result!=ParseResult_EndSection )
{
result=LDT_GetNextEntry();
if ( DNM_fn_bIsMatCharacteristicsValid(g_oMaterialMeca->m_hDefaultMechanicsMaterial) )
{
switch( result )
{
case ParseResult_Entry: /* an entry */
{
char *szEntry=LDT_szGetEntryName();
switch (*(long*)szEntry)
{
case lTagRebound : /* */
{
DNM_fn_xMatCharacteristicsSetRebound(g_oMaterialMeca->m_hDefaultMechanicsMaterial, (float)atof(LDT_szGetParam(1)) );
}
break;
case lTagSlide1 : /* */
{
DNM_fn_xMatCharacteristicsSetSlide(g_oMaterialMeca->m_hDefaultMechanicsMaterial, (float)atof(LDT_szGetParam(1)));
}
break;
}
}
}
}
}
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,285 @@
//
// diacol.hpp : header file
//
/////////////////////////////////////////////////////////////////////////////
// DiaCol dialog
#ifndef __diacol_hpp
#define __diacol_hpp
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
#include "matres.h"
#include "itf.h"
#include "GMatObj.hpp"
#include "CMatObj.hpp"
#ifndef __AFXEXT_H__
#include <afxext.h>
#endif
#define C_uc_NumberOfNames 16
class tdoCopyBuffer;
class tdoColNameObject : public CPA_BaseObject
{
friend class DiaCol;
public:
tdoColNameObject();
~tdoColNameObject();
//overloads from base class
virtual void *GetData() { return (void*)&m_uc_bit; }
virtual long GetDataType(void) { return 0; };
private:
unsigned char m_uc_bit; // bit correspondant au nom
};
class DiaCol : public CFormView
{
protected:
DiaCol(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(DiaCol)
// Form Data
public:
//{{AFX_DATA(DiaCol)
enum { IDD = IDD_COLLISION_DIALOG };
//ROMTEAM WorldEditor (Cristi Petrescu 22/12/97)
CButton m_btnRadioTypeOfZone;
//ENDROMTEAM WorldEditor (Cristi Petrescu)
CButton m_CheckLockNames;
CButton m_check9;
CButton m_check8;
CButton m_check7;
CButton m_check6;
CButton m_check5;
CButton m_check4;
CButton m_check3;
CButton m_check16;
CButton m_check2;
CButton m_check15;
CButton m_check14;
CButton m_check13;
CButton m_check12;
CButton m_check11;
CButton m_check10;
CButton m_check1;
CButton m_CheckDisableCollisions;
CString m_name1;
CString m_name11;
CString m_name10;
CString m_name12;
CString m_name13;
CString m_name14;
CString m_name15;
CString m_name16;
CString m_name2;
CString m_name3;
CString m_name4;
CString m_name5;
CString m_name6;
CString m_name7;
CString m_name8;
CString m_name9;
int m_RadioTypeOfZone;
//}}AFX_DATA
// Attributes
private:
//ROMTEAM WorldEditor (Cristi Petrescu 22/12/97)
BOOL m_bReportCollisionIncoherence (WORD wTypeOfZones, WORD wTypeOfCollision);
BOOL m_bReportCollisionIncoherence2 (WORD wNewTypeOfZones, WORD OldTypeOfZones, WORD wTypeOfCollision);
//ENDROMTEAM WorldEditor (Cristi Petrescu)
int m_currentNameRead;
BOOL m_bAutoDispatch;
BOOL m_bEditNamesLocked; /* names cannot be edited */
virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const;
BOOL m_bEditColor(GLI_tdstColor *p_stColor);
//ANNECY Shaitan DisableFunctions (16/04/98) {
BOOL m_bCommonFile;
//ENDANNECY Shaitan DisableFunctions }
public:
tdoCopyBuffer *m_p_oCopyBuffer;
unsigned short m_uwTypeOfZone;
unsigned short m_uwIdentifier;
CComboBox *m_p_oMaterialCombo;
CString m_a_csNameZdm[C_uc_NumberOfNames];
CString m_a_csNameZdr[C_uc_NumberOfNames];
CString m_a_csNameZde[C_uc_NumberOfNames];
CString m_oldname1;
CString m_oldname11;
CString m_oldname10;
CString m_oldname12;
CString m_oldname13;
CString m_oldname14;
CString m_oldname15;
CString m_oldname16;
CString m_oldname2;
CString m_oldname3;
CString m_oldname4;
CString m_oldname5;
CString m_oldname6;
CString m_oldname7;
CString m_oldname8;
CString m_oldname9;
tdoColNameObject m_p_oMyNameObject[C_uc_NumberOfNames * 3+1]; /* reachable objets dont les noms sont les Cstrings m_a_csNameZd(r,e,m)*/
/*GMT_tdxHandleToGameMaterial m_CurrentHandleToGameMaterial;*/
//GMT_tdxHandleToGameMaterial m_hHandleToGameMaterial;
GMT_tdxHandleToCollideMaterial m_hHandleToCollideMaterial;
// Operations
public:
void m_vNotifyChangeToScripts();
void fn_vInitDialog ( void );
void m_fn_vShowMaterial(GMT_tdxHandleToGameMaterial _hMat);
void m_fn_vSetMaterial(void);
void m_fn_vSetToMotor(void);
void m_fn_vEnableWindowFields(BOOL bEnable);
void m_fn_vLockEditNames(BOOL bEnable);
void m_fn_vEnableEditNames(BOOL bEnable);
void m_fn_vSetCheckBoxesValues();
void m_fn_vGetCheckBoxesValues(unsigned short *p_wTypeOfZone,unsigned short *p_wIdentifier);
void m_fn_vUpdateNames();
void m_fn_vShowNames();
void m_fn_vLoadNames();
void m_fn_vInitLoad();
static SCR_tde_Anl_ReturnValue fn_v_LoadZDMNames(
SCR_tdst_File_Description *_p_stFile,
char *_p_szName,
char *_ap_szPars[],
SCR_tde_Anl_Action _eAction);
static SCR_tde_Anl_ReturnValue fn_v_LoadZDRNames(
SCR_tdst_File_Description *_p_stFile,
char *_p_szName,
char *_ap_szPars[],
SCR_tde_Anl_Action _eAction);
static SCR_tde_Anl_ReturnValue fn_v_LoadZDENames(
SCR_tdst_File_Description *_p_stFile,
char *_p_szName,
char *_ap_szPars[],
SCR_tde_Anl_Action _eAction);
BOOL m_fn_bChangeName(int i,CString *_csName,CString *_csOldName,BOOL _bmessage);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DiaCol)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~DiaCol();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
//{{AFX_MSG(DiaCol)
afx_msg void OnCheckDisableCollisions();
afx_msg void OnCheckButtons();
afx_msg void OnRadioZoneTypes();
afx_msg void OnKillfocusEditName1();
afx_msg void OnKillfocusEditName10();
afx_msg void OnKillfocusEditName11();
afx_msg void OnKillfocusEditName12();
afx_msg void OnKillfocusEditName13();
afx_msg void OnKillfocusEditName14();
afx_msg void OnKillfocusEditName15();
afx_msg void OnKillfocusEditName16();
afx_msg void OnKillfocusEditName2();
afx_msg void OnKillfocusEditName3();
afx_msg void OnKillfocusEditName4();
afx_msg void OnKillfocusEditName5();
afx_msg void OnKillfocusEditName6();
afx_msg void OnKillfocusEditName7();
afx_msg void OnKillfocusEditName8();
afx_msg void OnKillfocusEditName9();
afx_msg void OnCheckLockNames();
afx_msg void OnButtonSaveNames();
afx_msg void OnButtonCopyCollideMaterial();
afx_msg void OnButtonRenameCollideMaterial();
afx_msg void OnButtonPasteCollideMaterial();
afx_msg void OnSetfocusEditName1();
afx_msg void OnSetfocusEditName10();
afx_msg void OnSetfocusEditName11();
afx_msg void OnSetfocusEditName12();
afx_msg void OnSetfocusEditName13();
afx_msg void OnSetfocusEditName14();
afx_msg void OnSetfocusEditName15();
afx_msg void OnSetfocusEditName16();
afx_msg void OnSetfocusEditName2();
afx_msg void OnSetfocusEditName3();
afx_msg void OnSetfocusEditName4();
afx_msg void OnSetfocusEditName5();
afx_msg void OnSetfocusEditName6();
afx_msg void OnSetfocusEditName7();
afx_msg void OnSetfocusEditName8();
afx_msg void OnSetfocusEditName9();
afx_msg void OnComboEditChange();
afx_msg void OnComboSelChange();
afx_msg void OnButtonHighlightColor();
afx_msg void OnCheckHighlight();
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
class tdoDeleteEngineCollideModif : public CPA_Modif
{
public:
tdoDeleteEngineCollideModif(
GMT_tdxHandleToGameMaterial _MyMatHandle,
GMT_tdxHandleToCollideMaterial _hCollideMaterial
);
~tdoDeleteEngineCollideModif();
BOOL Do();
BOOL Undo();
protected:
private:
GMT_tdxHandleToGameMaterial m_hEditedGameMaterial;
GMT_tdxHandleToCollideMaterial m_hEditedCollideMaterial;
tdoEditorGameMaterial *m_p_oEditedGameMaterial;
tdoEditorCollideMaterial *m_p_oEditedCollideMaterial;
};
class tdoCreateEngineCollideModif : public CPA_Modif
{
public:
tdoCreateEngineCollideModif(GMT_tdxHandleToGameMaterial _MyMatHandle);
~tdoCreateEngineCollideModif();
BOOL Do();
BOOL Undo();
protected:
private:
GMT_tdxHandleToGameMaterial m_hEditedGameMaterial;
GMT_tdxHandleToCollideMaterial m_hCollideAfterDo;
tdoDeleteEngineCollideModif *m_p_oDestroyModif;
};
#endif

View File

@@ -0,0 +1,76 @@
// dialist.cpp : implementation file
//
#include "stdafx.h"
#include "matres.h"
#include "DiaList.hpp"
#include "MatList.hpp"
#include "x:\cpa\main\inc\_editid.h"
#include "TUT.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// DiaList
IMPLEMENT_DYNCREATE(DiaList, CFormView)
DiaList::DiaList()
: CFormView(DiaList::IDD)
{
CRect rect(0,0,0,0);
CFormView::Create(NULL, "", WS_VISIBLE|WS_CHILD/*AFX_WS_DEFAULT_VIEW*/, rect, this, AFX_IDW_PANE_FIRST, NULL);
m_p_oMaterialListView = new CMaterialListView();
// first overture of dialog, view isn't created
m_p_oMaterialListView->Create(NULL, NULL, WS_CHILD, rect, this, 0);
//control registration for tutorial and assistants, should be unregistered when view is destroyed
TUT_M_vGetTutDll();
TUT_M_vRegisterControl(m_p_oMaterialListView->m_hWnd,"TGM_DiaListMaterialListView",TUT_e_Window);
//m_p_oMaterialListView->m_fn_vChangeDisplayType(C_cDisplayBitmapAndText);
//{{AFX_DATA_INIT(DiaList)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
DiaList::~DiaList()
{
}
void DiaList::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DiaList)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DiaList, CFormView)
//{{AFX_MSG_MAP(DiaList)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DiaList diagnostics
#ifdef _DEBUG
void DiaList::AssertValid() const
{
CFormView::AssertValid();
}
void DiaList::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG

View File

@@ -0,0 +1,67 @@
#if !defined(AFX_DIALIST_HPP__E7269CDD_2F2D_11D1_98A8_00609736738F__INCLUDED_)
#define AFX_DIALIST_HPP__E7269CDD_2F2D_11D1_98A8_00609736738F__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// dialist.hpp : header file
//
/////////////////////////////////////////////////////////////////////////////
// DiaList form view
#ifndef __AFXEXT_H__
#include <afxext.h>
#endif
class CMaterialListView;
class DiaList : public CFormView
{
protected:
DiaList(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(DiaList)
// Form Data
public:
//{{AFX_DATA(DiaList)
enum { IDD = IDD_LIST_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
protected:
// Attributes
public:
CMaterialListView *m_p_oMaterialListView;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DiaList)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~DiaList();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
//{{AFX_MSG(DiaList)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DIALIST_HPP__E7269CDD_2F2D_11D1_98A8_00609736738F__INCLUDED_)

View File

@@ -0,0 +1,470 @@
// diamain.cpp : implementation file
//
#include "stdafx.h"
#include "Acp_Base.h"
#define HieFriend
#include "inctex.h"
#include "_interf.hpp"
#include "diamain.hpp"
#include "matlist.hpp"
#include "GMatObj.hpp"
#include "x:\cpa\main\inc\_editid.h"
#include "TUT.h"
#include "DlgPreloadGMT.h"
extern Material_Interface *gs_p_oMaterialInterface;
#define C_szPurgeMarker "(P)"
/////////////////////////////////////////////////////////////////////////////
// DiaMain dialog
IMPLEMENT_DYNCREATE(DiaMain, CFormView)
DiaMain::DiaMain()
: CFormView(DiaMain::IDD)
{
m_wLastSelectedFileIndex = CB_ERR;
//{{AFX_DATA_INIT(DiaMain)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void DiaMain::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DiaMain)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DiaMain, CFormView)
//{{AFX_MSG_MAP(DiaMain)
ON_BN_CLICKED(IDC_BUTTON_NEW, OnButtonNew)
ON_BN_CLICKED(IDC_BUTTON_COPY, OnButtonCopy)
ON_BN_CLICKED(IDC_BUTTON_DELETE, OnButtonDelete)
ON_BN_CLICKED(IDC_BUTTON_LOADGMT, OnButtonLoadGMT)
ON_BN_CLICKED(IDC_BUTTON_UNLOADGMT, OnButtonUnLoadGMT)
ON_EN_CHANGE(IDC_EDIT_NAME, OnChangeEditName)
ON_CBN_SELCHANGE(IDC_COMBO_FILE, OnComboFileSelChange)
ON_BN_CLICKED(IDC_BUTTON_PURGE, OnButtonPurge)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DiaMain message handlers
//==================================================================================================
//==================================================================================================
int DiaMain::OnToolHitTest(CPoint point, TOOLINFO* pTI) const
{
CString csMessage;
switch ( CWnd::OnToolHitTest(point, pTI) )
{
case IDC_COMBO_FILE:
csMessage = "select the file for wich you can view/edit materials";
break;
case IDC_BUTTON_NEW:
csMessage = "create a new material with the specified name";
break;
case IDC_BUTTON_COPY:
csMessage = "create a copy of the current game material that will use the same characteristics as the original";
break;
case IDC_EDIT_NAME:
csMessage = "view the current game material's name";
break;
case IDC_BUTTON_DELETE:
csMessage = "delete the current game material";
break;
case IDC_BUTTON_PURGE:
csMessage = "cause the deletion of all unused texture sections for the materials belonging to this file";
break;
}
//output the help info in the status bar
fn_vGiveProgressInfo(csMessage, -1);
//there is no hit for a true tooltip
return -1;
}
/*=========================================================================
Function Name: DiaCol::m_fn_vShowMaterial
Purpose: Show the collision paramaters of the current material
Author: Yann Le Tensorer
Date: 23-04-97
This function is called each time a material is selected.
==========================================================================*/
void DiaMain::m_fn_vShowMaterial(GMT_tdxHandleToGameMaterial /*_hMat*/)
{
//ANNECY Shaitan DisableFunctions (16/04/98) {
char *szOwnerName;
char *szFileName;
//ENDANNECY Shaitan DisableFunctions }
tdoEditorGameMaterial *p_oCurrentEditedGameMaterial = gs_p_oMaterialInterface->m_p_oGetEditedMaterial();
BOOL bAGameMaterialIsEdited = p_oCurrentEditedGameMaterial ? TRUE : FALSE;
//ANNECY Shaitan DisableFunctions (16/04/98) {
if (bAGameMaterialIsEdited)
{
szOwnerName = (char *) (LPCSTR) p_oCurrentEditedGameMaterial->GetOwner()->GetName();
szFileName = strchr(szOwnerName, '\\') + 1;
m_bCommonFile = (!stricmp(szFileName, C_szCommon));
}
//ENDANNECY Shaitan DisableFunctions }
if ( bAGameMaterialIsEdited )
{
//ANNECY Shaitan DisableFunctions (16/04/98) {
GetDlgItem(IDC_BUTTON_COPY)->EnableWindow(/*TRUE*/!m_bCommonFile || g_bMasterEditor);
GetDlgItem(IDC_BUTTON_DELETE)->EnableWindow(/*TRUE*/!m_bCommonFile || g_bMasterEditor);
//ENDANNECY Shaitan DisableFunctions }
GetDlgItem(IDC_EDIT_NAME)->SetWindowText(p_oCurrentEditedGameMaterial->GetName());
}
else
{
GetDlgItem(IDC_BUTTON_COPY)->EnableWindow(FALSE);
GetDlgItem(IDC_BUTTON_DELETE)->EnableWindow(FALSE);
GetDlgItem(IDC_EDIT_NAME)->SetWindowText("");
}
GetDlgItem(IDC_EDIT_NAME)->Invalidate();
//GetDlgItem(IDC_COMBO_FILE)->EnableWindow(bAGameMaterialIsEdited);
}
//=================================================================================
//=================================================================================
CPA_FileObject *DiaMain::m_p_oGetCurrentFileObject()
{
return (CPA_FileObject *) (
(m_wLastSelectedFileIndex != CB_ERR)
? ((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->GetItemDataPtr(m_wLastSelectedFileIndex)
: NULL
);
}
//=================================================================================
//=================================================================================
void DiaMain::m_vRemoveFile(CPA_FileObject *_p_oFileObject)
{
CComboBox *p_oCombo = ((CComboBox *) GetDlgItem(IDC_COMBO_FILE));
for (short wIndex = 0; wIndex < p_oCombo->GetCount(); wIndex ++ )
if ( p_oCombo->GetItemDataPtr(wIndex) == _p_oFileObject )
{
p_oCombo->DeleteString(wIndex);
}
m_wLastSelectedFileIndex = (short) p_oCombo->GetCurSel();
}
//=================================================================================
//=================================================================================
void DiaMain::m_vAddFile(CPA_FileObject *_p_oFileObject)
{
CComboBox *p_oCombo = ((CComboBox *) GetDlgItem(IDC_COMBO_FILE));
CString csfileName = _p_oFileObject->GetReferencedName(gs_p_oMaterialInterface, C_szFileMinimalNameKey);
short wIndex = (short) p_oCombo->FindStringExact(CB_ERR, csfileName);
//do not add the file twice
if ( wIndex != CB_ERR && p_oCombo->GetItemDataPtr(wIndex) == _p_oFileObject )
return;
//add the string and a pointer to the object
wIndex = (short) p_oCombo->AddString(csfileName);
p_oCombo->SetItemDataPtr(wIndex, _p_oFileObject);
m_wLastSelectedFileIndex = (short) p_oCombo->GetCurSel();
}
//=================================================================================
//=================================================================================
void DiaMain::OnComboFileSelChange()
{
m_vReflectFileSelectionChange();
}
//=================================================================================
//=================================================================================
void DiaMain::m_vReflectFileSelectionChange()
{
short wNewIndex = (short) (((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->GetCurSel());
if ( wNewIndex != m_wLastSelectedFileIndex )
{
m_wLastSelectedFileIndex = wNewIndex;
//make all the editor undisplay the current material
gs_p_oMaterialInterface->m_p_oGetMaterialListView()->OnSelectItem(TSL_cItemNotFound);
//make the listview display the materials currently used by the engine
gs_p_oMaterialInterface->m_p_oGetMaterialListView()->m_vRefreshDisplayedMaterialList(
gs_p_oMaterialInterface->m_p_oGetMaterialListView()->m_bAllMaterialsDisplayed(),
TRUE //since the owner file changed, remove all currently displayed materials
);
//now lets see if we enable the purge button
m_vUpdatePurgeStatus(wNewIndex);
}
//ANNECY Shaitan DisableFunctions (16/04/98) {
if (wNewIndex != CB_ERR)
{
char szText[256];
((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->GetLBText(wNewIndex, szText);
m_bCommonFile = !stricmp(szText, "Common.gmt");
}
GetDlgItem(IDC_BUTTON_NEW)->EnableWindow((wNewIndex != CB_ERR) && (!m_bCommonFile || g_bMasterEditor));
//ENDANNECY Shaitan DisableFunctions }
}
//=================================================================================
//=================================================================================
void DiaMain::m_vUpdatePurgeStatus(short _wFileIndex /*= CB_ERR*/)
{
if ( _wFileIndex == CB_ERR )
_wFileIndex = (short) (((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->GetCurSel());
BOOL bEnablePurge = TRUE;
CPA_FileObject *p_oSelectedFileObject = (CPA_FileObject *) (((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->GetItemDataPtr(_wFileIndex));
CList<CPA_BaseObject *, CPA_BaseObject *> oChildList;
int nbChilds = g_oCoherenceManager.m_fn_iGetChildList(p_oSelectedFileObject, &oChildList);
POSITION xPos = oChildList.GetHeadPosition();
while ( xPos )
{
CPA_BaseObject *p_oChild = oChildList.GetNext(xPos);
if ( !p_oChild->fn_bIsAvailable() ) //the object is created for the section, but the section was not analysed...
{
bEnablePurge = FALSE;
break;
}
}
GetDlgItem(IDC_BUTTON_PURGE)->EnableWindow(bEnablePurge);
}
//==================================================================================================
// Description : handle function for BN_CLICKED an IDC_BUTTON_NEW
//==================================================================================================
void DiaMain::OnButtonNew()
{
// ask to MatList to create a new material
CString csMaterialName;
GetDlgItem(IDC_EDIT_NAME)->GetWindowText(csMaterialName);
//if it is empty, default to the automatic name
if ( csMaterialName.IsEmpty() )
csMaterialName = C_szGameMaterialTypeName "1";
//then get the prefixed version
csMaterialName = gs_p_oMaterialInterface->GetInterface()->GetPrefixedName(csMaterialName);
// ask to MatList to create a new material
gs_p_oMaterialInterface->m_p_oGetMaterialListView()->m_fn_vCreateNewMaterial(NULL, csMaterialName);
}
//==================================================================================================
//==================================================================================================
void DiaMain::OnButtonCopy()
{
//get the name for the new material
CString csNewMaterialName;
GetDlgItem(IDC_EDIT_NAME)->GetWindowText(csNewMaterialName);
//if it is not empty, get the prefixed version
if ( !csNewMaterialName.IsEmpty() )
csNewMaterialName = gs_p_oMaterialInterface->GetInterface()->GetPrefixedName(csNewMaterialName);
// ask to MatList to create a new material copied from the current one
gs_p_oMaterialInterface->m_p_oGetMaterialListView()->m_fn_vCreateNewMaterial(
gs_p_oMaterialInterface->m_p_oGetEditedMaterial(),
csNewMaterialName
);
}
//==================================================================================================
//==================================================================================================
void DiaMain::OnButtonDelete()
{
gs_p_oMaterialInterface->m_p_oGetMaterialListView()->m_fn_vDeleteMaterial(gs_p_oMaterialInterface->m_p_oGetEditedMaterial());
}
//==================================================================================================
//==================================================================================================
void DiaMain::OnChangeEditName()
{
CString csMaterialName;
GetDlgItem(IDC_EDIT_NAME)->GetWindowText(csMaterialName);
tdoEditorGameMaterial *p_oGameMaterial = NULL;
if ( !csMaterialName.IsEmpty() )
{
csMaterialName = gs_p_oMaterialInterface->GetInterface()->GetPrefixedName(csMaterialName);
//if we did not find a material with the engine, try to find one with the name, in case the script was
//parsed and editor materials were created for unloaded sections -> they have no valid engine material
if ( !csMaterialName.IsEmpty() )
p_oGameMaterial = (tdoEditorGameMaterial *) gs_p_oMaterialInterface->GetMainWorld()->fn_p_oFindObject(
csMaterialName, C_szGameMaterialTypeName, gs_p_oMaterialInterface->m_p_oGetCurrentFileObject()
);
}
//ANNECY Shaitan DisableFunctions (16/04/98) {
//if the name is unique for all materials, enable the creation of a material
GetDlgItem(IDC_BUTTON_NEW)->EnableWindow(!p_oGameMaterial && (!m_bCommonFile || g_bMasterEditor));
//to enable a copy, the name must be unique, and a current material must be selected
GetDlgItem(IDC_BUTTON_COPY)->EnableWindow((!p_oGameMaterial) && gs_p_oMaterialInterface->m_p_oGetEditedMaterial() && (!m_bCommonFile || g_bMasterEditor));
//ENDANNECY Shaitan DisableFunctions }
}
//==================================================================================================
//==================================================================================================
void DiaMain::m_vSelectFileOfMaterial(tdoEditorGameMaterial *_p_oGameMaterial)
{
CComboBox *p_oCombo = ((CComboBox *) GetDlgItem(IDC_COMBO_FILE));
for (short wIndex = 0; wIndex < p_oCombo->GetCount(); wIndex ++ )
if ( p_oCombo->GetItemDataPtr(wIndex) == _p_oGameMaterial->GetOwner() )
{
p_oCombo->SetCurSel(wIndex);
OnComboFileSelChange();
}
}
//==================================================================================================
//==================================================================================================
void DiaMain::OnButtonPurge()
{
//if all game materials of this file have been loaded, the purge will enable the deletion of
//all the sections belonging to unreferenced texture objects
//mark this by adding a (P) in the string
short wIndex = (short) (((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->GetCurSel());
if ( wIndex != CB_ERR )
{
CPA_FileObject *p_oSelectedFileObject = (CPA_FileObject *) (((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->GetItemDataPtr(wIndex));
CString csComboString;
((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->GetLBText(wIndex, csComboString);
if ( csComboString.Find(C_szPurgeMarker) == -1 ) //if the string is not marked for purge
{
//add the mark
csComboString += " " C_szPurgeMarker;
//and replace the string
((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->DeleteString(wIndex);
((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->InsertString(wIndex, csComboString);
((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->SetItemDataPtr(wIndex, p_oSelectedFileObject);
((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->SetCurSel(wIndex);
}
}
}
//==================================================================================================
//==================================================================================================
void DiaMain::m_vGetListOfFilesToPurge(CPA_List<CPA_FileObject> *p_oListToFill)
{
p_oListToFill->RemoveAll();
short wIndex, wMax = ((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->GetCount();
for ( wIndex = 0; wIndex < wMax; wIndex ++ )
{
CString csComboString;
((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->GetLBText(wIndex, csComboString);
if ( csComboString.Find(C_szPurgeMarker) != -1 )
p_oListToFill->AddTail((CPA_FileObject *) ((CComboBox *) GetDlgItem(IDC_COMBO_FILE))->GetItemDataPtr(wIndex));
}
}
//==================================================================================================
//==================================================================================================
BOOL DiaMain::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
if ( CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext) )
{
EnableToolTips(TRUE);
//control registration for tutorial and assistants, should be unregistered when view is destroyed
TUT_M_vGetTutDll();
TUT_M_vRegisterControlID(IDC_COMBO_FILE,"TGM_DiaMainComboFiles",TUT_e_ComboBox);
TUT_M_vRegisterControlID(IDC_BUTTON_PURGE,"TGM_DiaMainButtonPurge",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_EDIT_NAME,"TGM_DiaMainEditName",TUT_e_TextEdit);
TUT_M_vRegisterControlID(IDC_BUTTON_NEW,"TGM_DiaMainbttonNew",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_COPY,"TGM_DiaMainButtonCopy",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_DELETE,"TGM_DiaMainButtonDelete",TUT_e_Button);
return TRUE;
}
else
return FALSE;
}
// Christophe Modifications {
static long gs_lNbPreviousMaterialsInLinkTable = 0;
static long gs_lNbPreviousGeomobjInLinkTable = 0;
// ***** Add a PreLoad GMT in Material.ini *****
void DiaMain::OnButtonLoadGMT()
{
CFileDialog cfFileDial(TRUE,"gmt");
char szBackupPath[255];
GetCurrentDirectory(255,szBackupPath);
if ( cfFileDial.DoModal() == IDOK )
{
char szDrive[_MAX_DRIVE],
szPath[_MAX_DIR],
szName[_MAX_FNAME],
szExt[_MAX_EXT],
sz255GMTFileName[255],
sz255Tmp[255],
sz8SubSectionName[8],
sz3FileNumber[3];
unsigned char FileNumber = 1;
CString csFileName = cfFileDial.GetPathName();
UpdateData(FALSE);
//insert a subdirectory in the name of the image to compute the full name of the small file
_splitpath(LPCTSTR(csFileName), szDrive, szPath, szName, szExt);
strcpy(sz255GMTFileName, szName);
strcat(sz255GMTFileName, "\\");
strcat(sz255GMTFileName, szName);
strcat(sz255GMTFileName, szExt);
CString csMaterialFileName = M_GetMainApp()->m_csEditorDataPath + "Tools\\Material\\Material.ini";
// Search end of subsection to insert the new one
do
{
strcpy(sz8SubSectionName, "File");
strcat(sz8SubSectionName, itoa(FileNumber++, sz3FileNumber, 10) );
GetPrivateProfileString("Preload", sz8SubSectionName, "", sz255Tmp, 255, LPCTSTR(csMaterialFileName));
} while(sz255Tmp[0]);
// Write the new subsection
WritePrivateProfileString("Preload", sz8SubSectionName, sz255GMTFileName, LPCTSTR(csMaterialFileName));
// Restore current directory
SetCurrentDirectory(szBackupPath);
SCR_fnp_st_RdL0_AnalyseSection(sz255GMTFileName, SCR_CDF_uw_Anl_Normal);
//we want to rescan all linktables from the beginning
gs_lNbPreviousMaterialsInLinkTable = 0;
gs_lNbPreviousGeomobjInLinkTable = 0;
//all existent editor materials must be destroyed before the new ones are linked to the engine materials
gs_p_oMaterialInterface->m_vDoRefreshLists(0, E_rlm_UpdateWithoutDestruction, TRUE/*FALSE*/);
//read the highlight information from the ini file.
gs_p_oMaterialInterface->m_vLoadHighlightInfo();
}
}
// ***** Remove a PreLoad GMT in Material.ini *****
void DiaMain::OnButtonUnLoadGMT()
{
CDlgPreloadGMT oDlgPreLoad;
CString csUnloadedGMT;
if (oDlgPreLoad.DoModal() == IDOK)
{
csUnloadedGMT = oDlgPreLoad.m_szGetSelectedText();
}
}
// } End Christophe modifications

View File

@@ -0,0 +1,71 @@
#if !defined(AFX_DIAMAIN_HPP__E87DBD39_F2A9_11D0_9846_00609736738F__INCLUDED_)
#define AFX_DIAMAIN_HPP__E87DBD39_F2A9_11D0_9846_00609736738F__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// diamain.hpp : header file
//
#include "matres.h"
/////////////////////////////////////////////////////////////////////////////
// DiaMain dialog
class DiaMain : public CFormView
{
//ANNECY Shaitan DisableFunctions (16/04/98) {
private:
BOOL m_bCommonFile;
//ENDANNECY Shaitan DisableFunctions }
// Construction
public:
DiaMain(); // standard constructor
DECLARE_DYNCREATE(DiaMain)
void m_fn_vShowMaterial(GMT_tdxHandleToGameMaterial _hMat);
CPA_FileObject *m_p_oGetCurrentFileObject();
void m_vRemoveFile(CPA_FileObject *_p_oFileObject);
void m_vAddFile(CPA_FileObject *_p_oFileObject);
void m_vSelectFileOfMaterial(tdoEditorGameMaterial *_p_oGameMaterial);
void m_vGetListOfFilesToPurge(CPA_List<CPA_FileObject> *p_oListToFill);
void m_vReflectFileSelectionChange();
void m_vUpdatePurgeStatus(short _wFileIndex = CB_ERR);
// Dialog Data
//{{AFX_DATA(DiaMain)
enum { IDD = IDD_MAIN_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DiaMain)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const;
short m_wLastSelectedFileIndex;
// Generated message map functions
//{{AFX_MSG(DiaMain)
afx_msg void OnButtonNew();
afx_msg void OnButtonCopy();
afx_msg void OnButtonDelete();
afx_msg void OnButtonLoadGMT();
afx_msg void OnButtonUnLoadGMT();
afx_msg void OnChangeEditName();
afx_msg void OnComboFileSelChange();
afx_msg void OnButtonPurge();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DIAMAIN_HPP__E87DBD39_F2A9_11D0_9846_00609736738F__INCLUDED_)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,168 @@
/*=========================================================================
File Name: DIAMECA.HPP
Purpose: Implements functions handling the mecanics characteristics
Implements Following Classes:
- DiaMeca
- tdoDeleteEngineMechanicsModif
- tdoCreateEngineMechanicsModif
Author: Yann Le Tensorer
Date: April/May,1997
==========================================================================*/
#ifndef __diameca_hpp
#define __diameca_hpp
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
#include "matres.h"
#include "itf.h"
#include "gmatobj.hpp"
#include "MMatObj.hpp"
#ifndef __AFXEXT_H__
#include <afxext.h>
#endif
class tdoCopyBuffer;
/*===========================================================================
Class Name: DiaMeca
Used for: Main class of mecanics dialog
Author: Yann Le Tensorer
Date: April 1997
============================================================================*/
class DiaMeca : public CFormView
{
protected:
DiaMeca(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(DiaMeca)
// Form Data
public:
//{{AFX_DATA(DiaMeca)
enum { IDD = IDD_MECA_DIALOG };
CSliderCtrl m_oSliderAbsorption;
CButton m_CheckDisableMechanics;
double m_Rebound;
double m_Slide;
//}}AFX_DATA
//GMT_tdxHandleToGameMaterial m_hHandleToGameMaterial;
DNM_tdxHandleToMecMatCharacteristics m_hHandleToMecMatCharacteristics;
DNM_tdxHandleToMecMatCharacteristics m_hDefaultMechanicsMaterial;
CComboBox *m_p_oMaterialCombo;
// Attributes
private:
BOOL m_bAllSelected;
BOOL m_bAutoDispatch;
BOOL m_bEditColor(GLI_tdstColor *p_stColor);
//ANNECY Shaitan DisableFunctions (16/04/98) {
BOOL m_bCommonFile;
//ENDANNECY Shaitan DisableFunctions }
// Operations
public:
virtual ~DiaMeca();
tdoCopyBuffer *m_p_oCopyBuffer;
void m_vNotifyChangeToScripts();
void m_fn_vShowMaterial(GMT_tdxHandleToGameMaterial _hMat);
void m_fn_vSetMaterial(void);
void m_fn_vEnableWindowFields(BOOL bEnable);
// Load/Save functions
void m_fn_vSaveDefault();
static SCR_tde_Anl_ReturnValue fn_v_LoadMecaDefault(
SCR_tdst_File_Description *_p_stFile,
char *_p_szName,
char *_ap_szPars[],
SCR_tde_Anl_Action _eAction);
void m_fn_vInitLoad();
void m_fn_vLoadDefault();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DiaMeca)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const;
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
//{{AFX_MSG(DiaMeca)
afx_msg void OnCheckDisableMechanics();
afx_msg void OnChangeEdits();
afx_msg void OnButtonSetDefault();
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnButtonCopyMechanicsMaterial();
afx_msg void OnButtonRenameMechanicsMaterial();
afx_msg void OnButtonPasteMechanicsMaterial();
afx_msg void OnComboEditChange();
afx_msg void OnComboSelChange();
afx_msg void OnButtonHighlightColor();
afx_msg void OnCheckHighlight();
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/*===========================================================================
Class Name: tdoDeleteEngineMechanicsModif
Used for: deletion of meca mini structure: DO/UNDO
Author: Yann Le Tensorer / Benoit Germain
Date: April 1997
============================================================================*/
class tdoDeleteEngineMechanicsModif : public CPA_Modif
{
public:
tdoDeleteEngineMechanicsModif(
GMT_tdxHandleToGameMaterial _MyMatHandle,
DNM_tdxHandleToMecMatCharacteristics _hMechanicsMaterial
);
~tdoDeleteEngineMechanicsModif();
BOOL Do();
BOOL Undo();
protected:
private:
GMT_tdxHandleToGameMaterial m_hEditedGameMaterial;
DNM_tdxHandleToMecMatCharacteristics m_hEditedMechanicsMaterial;
tdoEditorGameMaterial *m_p_oEditedGameMaterial;
tdoEditorMechanicsMaterial *m_p_oEditedMechanicsMaterial;
};
/*===========================================================================
Class Name: tdoCreateEngineMechanicsModif
Used for: creation of meca mini structure: DO/UNDO
Author: Yann Le Tensorer / Benoit Germain
Date: April 1997
============================================================================*/
class tdoCreateEngineMechanicsModif : public CPA_Modif
{
public:
tdoCreateEngineMechanicsModif(GMT_tdxHandleToGameMaterial _MyMatHandle);
~tdoCreateEngineMechanicsModif();
BOOL Do();
BOOL Undo();
protected:
private:
GMT_tdxHandleToGameMaterial m_hEditedGameMaterial;
DNM_tdxHandleToMecMatCharacteristics m_hMechanicsAfterDo;
tdoDeleteEngineMechanicsModif *m_p_oDestroyModif;
};
#endif

View File

@@ -0,0 +1,376 @@
/*=========================================================================
File Name: DIASOUND.CPP
Purpose: Implements functions handling the sound characteristics
Implements Following Classes:
- DiaSound
Author: Benoit Germain
Date: May,1997
==========================================================================*/
#include <string.h>
#include "stdafx.h"
#include "Acp_Base.h"
#define HieFriend
#include "incgam.h"
#include "DiaSound.hpp"
#include "_interf.hpp"
#include "GMatObj.hpp"
#include "CopyPaste.hpp"
#include "x:\cpa\main\inc\_editid.h"
#include "TUT.h"
extern Material_Interface *gs_p_oMaterialInterface;
/*=========================================================================
Function Name: Diasound::Diasound()
Purpose: Diasound constructor
Author: Benoit Germain
Date: May 13,1997
==========================================================================*/
IMPLEMENT_DYNCREATE(DiaSound, CFormView)
DiaSound::DiaSound()
: CFormView(DiaSound::IDD)
{
//{{AFX_DATA_INIT(DiaSound)
m_ComboString = _T("");
//}}AFX_DATA_INIT
m_bHasBeenInitialized=FALSE;
//m_hHandleToGameMaterial=(GMT_tdxHandleToGameMaterial)GMT_C_ulInvalidHandle;
m_hHandleToSoundMaterial = GMT_C_InvalidSoundMaterial;
m_p_oCopyBuffer = NULL;
}
/*=========================================================================
Function Name: Diasound::~Diasound()
Purpose: Diasound destructor
Author: Benoit Germain
Date: May 13,1997
==========================================================================*/
DiaSound::~DiaSound()
{
if ( m_p_oCopyBuffer )
delete m_p_oCopyBuffer;
}
/*=========================================================================
Function Name: Diasound::DoDataExchange
Purpose:
Author: Benoit Germain
Date: May 13,1997
==========================================================================*/
void DiaSound::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DiaSound)
DDX_Control(pDX, IDC_CHECK_DISABLE_SOUND, m_CheckDisableSound);
DDX_CBString(pDX, IDC_COMBO_TYPE, m_ComboString);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DiaSound, CFormView)
//{{AFX_MSG_MAP(DiaSound)
ON_BN_CLICKED(IDC_BUTTON_COPYSOUND, OnButtonCopySoundMaterial)
ON_BN_CLICKED(IDC_BUTTON_PASTESOUND, OnButtonPasteSoundMaterial)
ON_BN_CLICKED(IDC_CHECK_DISABLE_SOUND, OnCheckDisableSound)
ON_CBN_SELCHANGE(IDC_COMBO_TYPE, OnSelChangeComboType)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//==================================================================================================
//==================================================================================================
int DiaSound::OnToolHitTest(CPoint point, TOOLINFO * pTI) const
{
CString csMessage;
switch ( CWnd::OnToolHitTest(point, pTI) )
{
case IDC_CHECK_DISABLE_SOUND:
csMessage = "enable/disable sound characteristics for the current game material";
break;
case IDC_COMBO_TYPE:
csMessage = "select the type of sound characteristics for the current game material";
break;
case IDC_BUTTON_COPYSOUND:
csMessage = "copy the sound characteristics of the current game material for further pasting";
break;
case IDC_BUTTON_PASTESOUND:
csMessage = "paste the contents of the last copied sound characteristics into the current game material";
break;
}
//output the help info in the status bar
fn_vGiveProgressInfo(csMessage, -1);
//there is no hit for a true tooltip
return -1;
}
//==================================================================================================
//==================================================================================================
unsigned long DiaSound::m_fn_ulFindHandleFromName(CString _csName)
{
for ( int i = 0; i < m_wNumberOfReachableNames; i ++ )
{
if ( m_csReachableName[i] == _csName )
{
return m_ulReachableHandle[i];
}
}
return (unsigned long) -1;
}
//==================================================================================================
//==================================================================================================
CString DiaSound::m_fn_csFindNameFromHandle(unsigned long _ulHandle)
{
for ( int i = 0; i < m_wNumberOfReachableNames; i ++ )
{
if ( m_ulReachableHandle[i] == _ulHandle )
{
return m_csReachableName[i];
}
}
return "Not Assigned";
}
/*=========================================================================
Function Name: Diasound::m_fn_bGetReachablesNames()
Purpose: Gets the name and handle of the reachable objects of type "SndInfo_Material"
provided by the sound DLL
Author: Yann Le Tensorer
Date: May 13,1997
==========================================================================*/
BOOL DiaSound::m_fn_bGetReachablesNames()
{
CPA_List<CPA_BaseObject> oList;
m_wNumberOfReachableNames = gs_p_oMaterialInterface->GetMainWorld()->fn_lFindObjects(&oList, "", C_szSoundInfoMaterialTypeName);
if (!m_wNumberOfReachableNames)
{
AfxMessageBox("\"SndEventM\" Reachable objects not found");
return FALSE;
}
POSITION xSortedElementPos;
CPA_BaseObject *p_oObject;
int i=0;
for ( p_oObject = oList.GetHeadElement(xSortedElementPos); xSortedElementPos; p_oObject = oList.GetNextElement(xSortedElementPos) )
{
m_csReachableName[i] = p_oObject->GetName();
((CComboBox*) GetDlgItem (IDC_COMBO_TYPE))->AddString(m_csReachableName[i]);
m_ulReachableHandle[i] = (unsigned long) gs_p_oMaterialInterface->GetMainWorld()->fn_p_oFindObject(m_csReachableName[i],C_szSoundInfoMaterialTypeName)->GetData();
if (i==0) m_ulDefaultSoundHandle=m_ulReachableHandle[i];
i++;
}
return TRUE;
}
/*=========================================================================
Function Name: DiaSound::m_fn_vEnableWindowFields(true/false)
Purpose: Called to enable or disable all fields of dialog (except check)
Parameters: True: Rend les champs actifs, False, les rend inactifs
Author: Yann Le Tensorer
Date: 16-04-97
==========================================================================*/
void DiaSound::m_fn_vEnableWindowFields(BOOL bEnable)
{
if ( bEnable )
{
//there is a target submaterial, hance paste is enabled
GetDlgItem(IDC_BUTTON_PASTESOUND)->EnableWindow(m_p_oCopyBuffer ? TRUE : FALSE);
//but instanciate is disabled
//GetDlgItem(IDC_BUTTON_INSTANCIATESOUND)->EnableWindow(FALSE);
}
else
{
//make the combo display an empty name
((CComboBox *) GetDlgItem(IDC_COMBO_TYPE))->SetCurSel(CB_ERR);
//there is no submaterial, so disable pasting
GetDlgItem(IDC_BUTTON_PASTESOUND)->EnableWindow(FALSE);
//instanciate only if the target game material has no submaterial
//GetDlgItem(IDC_BUTTON_INSTANCIATESOUND)->EnableWindow(m_p_oCopyBuffer ? TRUE : FALSE);
}
GetDlgItem(IDC_COMBO_TYPE)->EnableWindow( bEnable );
GetDlgItem(IDC_STATIC_TYPE)->EnableWindow( bEnable );
GetDlgItem(IDC_BUTTON_COPYSOUND)->EnableWindow( bEnable );
}
/*=========================================================================
==========================================================================*/
void DiaSound::m_fn_vShowMaterial(GMT_tdxHandleToGameMaterial _hMat)
{
if (m_bHasBeenInitialized == FALSE)
{
m_fn_bGetReachablesNames();
m_bHasBeenInitialized = TRUE;
}
tdoEditorGameMaterial *p_oEditedGameMaterial = gs_p_oMaterialInterface->m_p_oGetEditedMaterial();
BOOL bAGameMAterialIsEdited = p_oEditedGameMaterial ? TRUE : FALSE;
/* if no material is currently selected, disable everything */
if ( !bAGameMAterialIsEdited || !GMT_fn_b_ulIsValid(_hMat) )
{
m_hHandleToSoundMaterial = GMT_C_InvalidSoundMaterial;
m_CheckDisableSound.SetCheck(FALSE);
GetDlgItem(IDC_CHECK_DISABLE_SOUND)->EnableWindow(GMT_fn_b_ulIsValid(_hMat));
m_fn_vEnableWindowFields(FALSE);
return;
}
GetDlgItem(IDC_CHECK_DISABLE_SOUND)->EnableWindow(TRUE);
//normally, the specified engine game material must belong to the current editor game material...
ASSERT(_hMat == p_oEditedGameMaterial->GetData());
// get the handle to sound material
m_hHandleToSoundMaterial = GMT_fn_hGetSoundMaterial(_hMat);
if ( m_hHandleToSoundMaterial == GMT_C_InvalidSoundMaterial)
{
m_ComboString=m_fn_csFindNameFromHandle(m_hHandleToSoundMaterial);
UpdateData(FALSE);
m_CheckDisableSound.SetCheck(FALSE);
m_fn_vEnableWindowFields(FALSE);
}
else
{
m_ComboString = m_fn_csFindNameFromHandle(m_hHandleToSoundMaterial);
UpdateData(FALSE);
m_CheckDisableSound.SetCheck(TRUE);
m_fn_vEnableWindowFields(TRUE);
}
}
/////////////////////////////////////////////////////////////////////////////
// DiaSound diagnostics
#ifdef _DEBUG
void DiaSound::AssertValid() const
{
CFormView::AssertValid();
}
void DiaSound::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG
/*=====================================================================================
Function: DiaSound::Created
Purpose: Overloaded function create of DiaSound dialog
Author: Yann Le Tensorer
Date: April, 1997
====================================================================================*/
BOOL DiaSound::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
if (CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext))
{
EnableToolTips(TRUE);
UpdateData(FALSE);
m_fn_vEnableWindowFields(FALSE);
GetDlgItem(IDC_CHECK_DISABLE_SOUND)->EnableWindow(FALSE);
//control registration for tutorial and assistants, should be unregistered when view is destroyed
TUT_M_vGetTutDll();
TUT_M_vRegisterControlID(IDC_CHECK_DISABLE_SOUND,"TGM_DiaSoundCheckDisableSound",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_COMBO_TYPE,"TGM_DiaSoundCombosoundTypes",TUT_e_ComboBox);
TUT_M_vRegisterControlID(IDC_BUTTON_COPYSOUND,"TGM_DiaSoundButtonCopy",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_PASTESOUND,"TGM_DiaSoundButtonPaste",TUT_e_Button);
return TRUE;
}
else
return FALSE;
}
/////////////////////////////////////////////////////////////////////////////
// DiaSound message handlers
void DiaSound::OnButtonCopySoundMaterial()
{
if ( m_p_oCopyBuffer )
delete m_p_oCopyBuffer;
m_p_oCopyBuffer = new tdoCopyBuffer(m_hHandleToSoundMaterial);
GetDlgItem(IDC_BUTTON_PASTESOUND)->EnableWindow(TRUE);
//it is stupid to instanciate on the same material, so disable it
//GetDlgItem(IDC_BUTTON_INSTANCIATESOUND)->EnableWindow(FALSE);
}
//==================================================================================================
//==================================================================================================
void DiaSound::OnButtonPasteSoundMaterial()
{
if ( m_p_oCopyBuffer )
M_p_oGetEditManager()->AskFor(new tdoPasteSubMaterialModif(m_p_oCopyBuffer));
}
//==================================================================================================
//==================================================================================================
void DiaSound::OnCheckDisableSound()
{
if ( !gs_p_oMaterialInterface->m_p_oGetEditedMaterial() )
{
m_CheckDisableSound.SetCheck(FALSE);
m_fn_vEnableWindowFields(FALSE);
return;
}
BOOL bEnabled = m_CheckDisableSound.GetCheck();
if ( bEnabled )
m_hHandleToSoundMaterial = m_ulDefaultSoundHandle;
else
m_hHandleToSoundMaterial = GMT_C_InvalidSoundMaterial;
//controls are to be enabled while they are updated so that the change is visible
//->enable before update
if ( bEnabled )
m_fn_vEnableWindowFields(TRUE);
//perform the update
m_ComboString = m_fn_csFindNameFromHandle(m_hHandleToSoundMaterial);
UpdateData(FALSE);
//-> or disable after update
if ( !bEnabled )
m_fn_vEnableWindowFields(FALSE);
//modify the edited data accordingly
GMT_fn_vSetSoundMaterial(
gs_p_oMaterialInterface->m_p_oGetEditedMaterial()->m_hGetEngineMaterial(),
m_hHandleToSoundMaterial
);
//and notify the changes to the scripts
gs_p_oMaterialInterface->m_p_oGetEditedMaterial()->fn_vNotifySave();
}
//==================================================================================================
//==================================================================================================
void DiaSound::OnSelChangeComboType()
{
UpdateData(TRUE);
m_hHandleToSoundMaterial = m_fn_ulFindHandleFromName(m_ComboString);
GMT_fn_vSetSoundMaterial(
gs_p_oMaterialInterface->m_p_oGetEditedMaterial()->m_hGetEngineMaterial(),
m_hHandleToSoundMaterial
);
gs_p_oMaterialInterface->m_p_oGetEditedMaterial()->fn_vNotifySave();
}

View File

@@ -0,0 +1,111 @@
/*=========================================================================
File Name: DIASOUND.HPP
Purpose: Implements functions handling the sound characteristics
Implements Following Classes:
- DiaSound
Author: Yann Le Tensorer
Date: May,1997
==========================================================================*/
// DiaSound dialog
#ifndef __DiaSound_hpp
#define __DiaSound_hpp
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
#include "matres.h"
#include "itf.h"
#include "gmatobj.hpp"
#ifndef __AFXEXT_H__
#include <afxext.h>
#endif
class tdoCopyBuffer;
class DiaSound : public CFormView
{
protected:
DiaSound(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(DiaSound)
// Form Data
public:
//{{AFX_DATA(DiaSound)
enum { IDD = IDD_SOUND_DIALOG };
CButton m_CheckDisableSound;
CString m_ComboString;
//}}AFX_DATA
// Attributes
public:
tdoCopyBuffer *m_p_oCopyBuffer;
CString m_csReachableName[255];
unsigned long m_ulReachableHandle[255];
int m_wNumberOfReachableNames;
SND_tdxHandleToSoundMaterial m_hHandleToSoundMaterial;
unsigned long m_ulSound;
BOOL m_bHasBeenInitialized;
//GMT_tdxHandleToGameMaterial m_hHandleToGameMaterial;
unsigned long m_ulDefaultSoundHandle;
// Operations
public:
void fn_vInitDialog ( void );
void m_fn_vShowMaterial(GMT_tdxHandleToGameMaterial _hMat);
BOOL m_fn_bGetReachablesNames();
void m_fn_vEnableWindowFields(BOOL bEnable);
// Copy/Paste functions
void m_fn_vCopy(); // Copy the parameters into the copy buffer
void m_fn_vPaste(); // Paste the parameters from the copy buffer
unsigned long m_fn_ulFindHandleFromName(CString _csName);
CString m_fn_csFindNameFromHandle(unsigned long _ulHandle);
private:
virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DiaSound)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~DiaSound();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
//{{AFX_MSG(DiaSound)
afx_msg void OnButtonCopySoundMaterial();
afx_msg void OnButtonInstanciatesound();
afx_msg void OnButtonPasteSoundMaterial();
afx_msg void OnCheckDisableSound();
afx_msg void OnSelChangeComboType();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,251 @@
// DiaView.hpp : header file
//
/////////////////////////////////////////////////////////////////////////////
// DiaView dialog
#ifndef __DiaView_hpp
#define __DiaView_hpp
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
class tdoEditorTexture;
class DiaView : public CFormView
{
protected:
DiaView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(DiaView)
// Form Data
public:
//{{AFX_DATA(DiaView)
enum { IDD = IDD_VIEW_DIALOG };
//}}AFX_DATA
// Operations
public:
virtual ~DiaView();
void m_vNotifyChangeToScripts();
//void fn_vInitDialog ( void );
void m_fn_vShowMaterial(GMT_tdxHandleToGameMaterial _hMat, int _iTextureIndex = -1);
BOOL Create( LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
DWORD dwRequestedStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,
CCreateContext* pContext );
void m_fn_vUpdateAlphaButton (GMT_tdxHandleToGameMaterial _hMat, BOOL bActivate);
void m_fn_vUpdateChromeButton (GMT_tdxHandleToGameMaterial _hMat, BOOL bActivate);
void m_fn_vUpdateGouraudButton (GMT_tdxHandleToGameMaterial _hMat, BOOL bActivate);
void m_fn_vUpdateTextureButton (GMT_tdxHandleToGameMaterial _hMat, BOOL bActivate);
void m_fn_vUpdateBackfaceButton (GMT_tdxHandleToGameMaterial _hMat, BOOL bActivate);
void m_fn_vUpdateTransparentButton (GMT_tdxHandleToGameMaterial _hMat, BOOL bActivate);
void m_fn_vUpdateAutoScroll (GMT_tdxHandleToGameMaterial _hMat, long lSwitch, float fUSpeed, float fVSpeed);
private:
ACP_tdxHandleOfMaterial m_hEditedVisualMaterial;
BOOL m_bControlsFilledFromMaterial;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DiaView)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const;
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
//{{AFX_MSG(DiaView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnCheckTexture();
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
afx_msg void OnButtonDiffuse();
afx_msg void OnButtonSpecular();
afx_msg void OnButtonAmbient();
afx_msg void OnCheckGouraud();
afx_msg void OnChangeEditSpecExp();
afx_msg void OnCheckChrome();
afx_msg void OnCheckTrans();
afx_msg void OnCheckAlphaSensitive();
afx_msg void OnButtonAddAnimatedTexture();
afx_msg void OnSelchangeComboAnimatedTextures();
afx_msg void OnButtonRemoveAnimatedTexture();
afx_msg void OnButtonMoveUpTexture();
afx_msg void OnButtonMoveDownTexture();
afx_msg void OnCheckAutoScroll();
afx_msg void OnKillFocusEditHorizontalScroll();
afx_msg void OnKillFocusEditVerticalScroll();
afx_msg void OnCheckBackface();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
class tdoInsertAnimatedTextureModif;
class tdoRemoveAnimatedTextureModif : public CPA_Modif
{
public:
tdoRemoveAnimatedTextureModif(GMT_tdxHandleToGameMaterial _MyMatHandle, long _lRemovePoint);
~tdoRemoveAnimatedTextureModif();
BOOL Do();
BOOL Undo();
protected:
private:
tdoInsertAnimatedTextureModif *m_p_oInsertAnimatedTextureModif;
GMT_tdxHandleToGameMaterial m_hEditedGameMaterial;
tdoEditorGameMaterial *m_p_oEditedGameMaterial;
//information remembered about the removed texture
long m_lRemovePoint;
GLI_tdstTexture *m_hTexture;
tdoEditorTexture *m_p_oEditorTexture;
float m_fDuration;
};
/////////////////////////////////////////////////////////////////////////////
class tdoInsertAnimatedTextureModif : public CPA_Modif
{
public:
tdoInsertAnimatedTextureModif(GMT_tdxHandleToGameMaterial _MyMatHandle, long _lInsertPoint, GLI_tdstTexture *_hTexture, float _fDuration);
~tdoInsertAnimatedTextureModif();
BOOL Do();
BOOL Undo();
protected:
private:
tdoRemoveAnimatedTextureModif *m_p_oRemoveAnimatedTextureModif;
GMT_tdxHandleToGameMaterial m_hEditedGameMaterial;
tdoEditorGameMaterial *m_p_oEditedGameMaterial;
//information about the inserted texture
GLI_tdstTexture *m_hTexture;
tdoEditorTexture *m_p_oEditorTexture;
float m_fDuration;
long m_lInsertPoint;
};
/////////////////////////////////////////////////////////////////////////////
class tdoMoveAnimatedTextureModif : public CPA_Modif
{
public:
tdoMoveAnimatedTextureModif(GMT_tdxHandleToGameMaterial _MyMatHandle, long _lMoved, long _lDirection);
~tdoMoveAnimatedTextureModif();
BOOL Do();
BOOL Undo();
protected:
private:
GMT_tdxHandleToGameMaterial m_hEditedGameMaterial;
tdoEditorGameMaterial *m_p_oEditedGameMaterial;
long m_lMovedPoint, m_lDirection;
};
/////////////////////////////////////////////////////////////////////////////
class tdoChangeMaterialColorModif : public CPA_Modif
{
public:
typedef enum eColorType_
{
E_ct_Ambient,
E_ct_Diffuse,
E_ct_Specular
} tdeColorType;
tdoChangeMaterialColorModif(GMT_tdxHandleToGameMaterial _MyMatHandle, tdeColorType _eType);
~tdoChangeMaterialColorModif();
BOOL Do();
BOOL Undo();
BOOL m_bDoIt(GLI_tdstColor _xNewColor);
protected:
private:
GMT_tdxHandleToGameMaterial m_hEditedGameMaterial;
tdoEditorGameMaterial *m_p_oEditedGameMaterial;
tdeColorType m_eType;
GLI_tdstColor m_xColorBeforeDo, m_xColorAfterDo;
long m_lSpecExp;
BOOL m_bGoForIt;
};
/////////////////////////////////////////////////////////////////////////////
class tdoChangeMaterialStateModif : public CPA_Modif
{
public:
typedef enum eStateType_
{
E_st_Alpha,
E_st_Transparent,
E_st_Textured,
E_st_Gouraud,
E_st_Chrome,
E_st_Backface,
E_st_None
}
tdeStateType;
tdoChangeMaterialStateModif(GMT_tdxHandleToGameMaterial _MyMatHandle, tdeStateType _eType);
~tdoChangeMaterialStateModif();
BOOL Do();
BOOL Undo();
BOOL fn_bChangeState (BOOL bActivate);
protected:
private:
GMT_tdxHandleToGameMaterial m_hEditedGameMaterial;
tdoEditorGameMaterial *m_p_oEditedGameMaterial;
tdeStateType m_eType;
unsigned long m_xMaterialType;
BOOL m_bActivated;
BOOL m_bTransparent;
BOOL m_bFirstTime;
};
/////////////////////////////////////////////////////////////////////////////
class tdoChangeAutoScrollModif : public CPA_Modif
{
public:
typedef enum eAutoScroll_
{
E_as_Switch,
E_as_USpeed,
E_as_VSpeed
}
tdeAutoScroll;
tdoChangeAutoScrollModif(GMT_tdxHandleToGameMaterial _MyMatHandle, tdeAutoScroll eType, long lSwitch, float fUSpeed, float fVSpeed);
~tdoChangeAutoScrollModif();
BOOL Do();
BOOL Undo();
BOOL fn_bChangeState (BOOL bActivate);
protected:
private:
GMT_tdxHandleToGameMaterial m_hEditedGameMaterial;
tdoEditorGameMaterial *m_p_oEditedGameMaterial;
tdeAutoScroll m_eType;
float m_fOldUSpeed, m_fNewUSpeed;
float m_fOldVSpeed, m_fNewVSpeed;
long m_lOldSwitch, m_lNewSwitch;
BOOL m_bFirstTime;
};
#endif

View File

@@ -0,0 +1,49 @@
#if !defined(AFX_DLGPRELOADGMT_H__A8AF4507_8F69_11D2_BAD8_00E02921BF6D__INCLUDED_)
#define AFX_DLGPRELOADGMT_H__A8AF4507_8F69_11D2_BAD8_00E02921BF6D__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// dlgpreloadgmt.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgPreloadGMT dialog
class CDlgPreloadGMT : public CDialog
{
// Construction
public:
CDlgPreloadGMT(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgPreloadGMT)
enum { IDD = IDD_DIALOG_LISTPRELOADGMT };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
char *m_szGetSelectedText () { return m_szText; }
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgPreloadGMT)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
char m_szText[_MAX_FNAME]; // Generated message map functions
//{{AFX_MSG(CDlgPreloadGMT)
virtual BOOL OnInitDialog();
virtual void OnOK();
afx_msg void OnDblclkListGmt();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGPRELOADGMT_H__A8AF4507_8F69_11D2_BAD8_00E02921BF6D__INCLUDED_)

View File

@@ -0,0 +1,117 @@
//
//
// Common functions for Object DLL capabilities
// C. Beaudet
//
#include "stdafx.h"
#include "afxdllx.h"
#include "ACP_Base.h"
#include "itf.h"
#include "inctex.h"
#include "_interf.hpp"
#include "x:\cpa\main\inc\_editid.h"
//------------------------------------------------------------------------
// Global vars
static char *gs_p_szCPAVersion = C_szCPAVersion;
static AFX_EXTENSION_MODULE NEAR extensionDLL = { NULL, NULL };
#ifdef DLL_ONLY_ONE_INSTANCE
Material_Interface *gs_p_oMaterialInterface = NULL;
#endif
static CList<CPA_DLLBase*,CPA_DLLBase*> g_oListOfInstances; //private internal
//------------------------------------------------------------------------
// functions that are present in all DLL :
//------------------------------------------------------------------------
//========================================================================
// Get current CPA version
//========================================================================
extern "C" char __declspec(dllexport) *fn_p_szGetCPAVersion(void)
{
return gs_p_szCPAVersion;
}
//========================================================================
// Get type of this DLL
//========================================================================
extern "C" tdstDLLIdentity __declspec(dllexport) *fn_p_stGetDLLIdentity(void)
{
g_stMaterialIdentity . eType = TOOL_DLL;
g_stMaterialIdentity . csName = C_szDLLMaterialName;
g_stMaterialIdentity . hModule = NULL;
g_stMaterialIdentity . p_oListOfInstances = &g_oListOfInstances;
return &g_stMaterialIdentity;
}
//========================================================================
// DLL int function
//========================================================================
extern "C" void __declspec(dllexport) fn_vInitDll(void)
{
new CDynLinkLibrary(extensionDLL);
}
//========================================================================
// DLL entry point
//========================================================================
extern "C" int __stdcall DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
if (!AfxInitExtensionModule(extensionDLL, hInstance))
return 0;
}
return 1;
}
//========================================================================
// Get the DLL
//========================================================================
extern "C" CPA_DLLBase __declspec(dllexport) *fn_p_oGetDLL(long lKey)
{
#ifdef DLL_ONLY_ONE_INSTANCE
switch(lKey)
{
case 0: // the game world
if (gs_p_oMaterialInterface == NULL)
{
//when the material editor is loaded, the tree of loaded texture names must not be reinitialized
//GLI_vReinitTreeOfTextureNameSwitch(FALSE);
gs_p_oMaterialInterface = new Material_Interface();
ASSERT(gs_p_oMaterialInterface != NULL);
}
return gs_p_oMaterialInterface;
break;
default:
return NULL;
}
#else //DLL_ONLY_ONE_INSTANCE
switch(lKey)
{
case 0: // the game world
return new Material_Interface();
break;
default:
return NULL;
}
#endif //DLL_ONLY_ONE_INSTANCE
}
//------------------------------------------------------------------------
// functions that are present in this type of DLL only :
//------------------------------------------------------------------------
#undef DLL_ONLY_ONE_INSTANCE

View File

@@ -0,0 +1,237 @@
#if !defined(D_tdoMaterialClass)
#error "define the class before including this file"
#endif
//================================================================================
//================================================================================
void vKillMaterialList(D_tdoMaterialClass *_p_oDummyArgToEnableOverLoading, CComboBox *_p_oReferencingCombo)
{
_p_oDummyArgToEnableOverLoading = _p_oDummyArgToEnableOverLoading;
CPA_List<CPA_BaseObject> oEditorObjectList;
gs_p_oMaterialInterface->GetMainWorld()->fn_lFindObjects(
&oEditorObjectList,
"", D_tdoMaterialClass::m_csGetMaterialType(),
NO_CRITERIA /* owner */
);
/* and destroy them all */
while ( !oEditorObjectList.IsEmpty() )
{
D_tdoMaterialClass *p_oMaterial = (D_tdoMaterialClass *) oEditorObjectList.RemoveHead();
/* and delete the object, it will handle cohemngr links removal itself */
delete p_oMaterial;
}
//reset the referencing combobox
if ( _p_oReferencingCombo )
{
_p_oReferencingCombo->ResetContent();
_p_oReferencingCombo->AddString(C_szNoMaterialComboEntry);
_p_oReferencingCombo->SetItemDataPtr(0, NULL);
}
}
//================================================================================
//================================================================================
#if defined(D_tdxEngineMaterialHandle)
void vRefreshMaterialList(
long _lStartInLinkTable,
D_tdoMaterialClass *_p_oDummyArgToEnableOverLoading,
BOOL _bSectionsAnalysedWithFullNames,
CComboBox *_p_oReferencingCombo
)
{
_p_oDummyArgToEnableOverLoading = _p_oDummyArgToEnableOverLoading;
/* scan all loaded engine materials and associate editor materials to them... */
SCR_tdst_Link_Value *p_stMaterialEntry;
SCR_tdst_Link_Table *p_stMaterialLinkTable = D_tdoMaterialClass::m_p_stGetAssociatedLinkTable();
CString csStatusMessage;
csStatusMessage.Format("linking %d editor and engine materials", p_stMaterialLinkTable->stLinkArray.uiNumValues);
/* start the scan */
unsigned int uiMaterialPos = _lStartInLinkTable;
SCR_M_DyAr_GetNextElement(
SCR_tdst_Link_Value,
uiMaterialPos,
p_stMaterialEntry,
p_stMaterialLinkTable->stLinkArray
);
/* while there are entries in the list */
while ( p_stMaterialEntry )
{
fn_vGiveProgressInfo(
csStatusMessage,
(uiMaterialPos * 100) / p_stMaterialLinkTable->stLinkArray.uiNumValues
);
D_tdxEngineMaterialHandle hEngineMaterial = (D_tdxEngineMaterialHandle) SCR_M_ul_Link_GetValue(p_stMaterialEntry);
//see if an editor material exists for this engine material (which means it was referenced somewhere)
D_tdoMaterialClass *p_oInsertedMaterial = (D_tdoMaterialClass *) gs_p_oMaterialInterface->m_p_oGetEditorObjectForEngine(hEngineMaterial);
if
(
SCR_M_e_Link_GetState(p_stMaterialEntry) == SCR_ELS_Link_Initialized
&& !p_oInsertedMaterial //the engine material was not referenced
)
{ /* we did not find an editor material for the engine material */
/* if we did not find a material with the engine, try to find one with the name, in case the script was */
/* parsed and editor materials were created for unloaded sections -> they have no valid engine material */
/* search OwnerFile */
CPA_FileObject *p_oOwnerFile;
CString csKey(SCR_M_p_sz_Link_GetKey(p_stMaterialEntry));
CString csName(gs_p_oMaterialInterface->m_csGetFilePartOfSectionName(csKey));
//create editor materials only if the file in which the engine material exists is of the good extension
if ( !D_tdoMaterialClass::m_csGetScriptExtension().CompareNoCase(strrchr(LPCTSTR(csName), '.')) )
{
/* extract the id from the key */
csKey = gs_p_oMaterialInterface->m_csGetIdPartOfSectionName(csKey);
//this wont work if csName is a full name, so get the file from the full name instead.
//that way we are sure to get a preexisting fileobject when there is one
p_oOwnerFile = p_oGetFileObjectForReferencedPath(csName, C_szFileReferencedNameKey);
if ( !p_oOwnerFile )
p_oOwnerFile = p_oGetFileObjectForReferencedPath(csName, "");
if ( p_oOwnerFile )
p_oInsertedMaterial = (D_tdoMaterialClass *) gs_p_oMaterialInterface->GetBaseObject(
csKey,
D_tdoMaterialClass::m_csGetMaterialType(),
p_oOwnerFile
);
if ( p_oInsertedMaterial )
{
/* give the engine material to the editor material */
p_oInsertedMaterial->m_vAssociateEngineMaterial(hEngineMaterial, TRUE);
}
else
{
ASSERT(D_tdoMaterialClass::m_bIsEngineMaterialValid(hEngineMaterial));
/* Create a new editor material to handle this engine material */
//CString csPath(D_tdoMaterialClass::m_csGetBaseDataPath());
if ( csName.Find('/') != -1 )
AfxMessageBox(
"Find where\n" + csKey + "\nis referenced and change all '/' characters to '\\'s",
MB_OK | MB_ICONSTOP
);
if ( p_oOwnerFile )
p_oInsertedMaterial = new D_tdoMaterialClass(
p_oOwnerFile,
csKey,
TRUE,
hEngineMaterial
);
}
}
}
if ( _p_oReferencingCombo && p_oInsertedMaterial )
{
CString csName = p_oInsertedMaterial->GetName();
short wIndex = _p_oReferencingCombo->FindStringExact(-1, csName);
if ( wIndex == CB_ERR ) //if the material is not already in the combo
{ //add it
wIndex = _p_oReferencingCombo->AddString(csName);
_p_oReferencingCombo->SetItemDataPtr(wIndex, p_oInsertedMaterial);
}
}
uiMaterialPos ++;
SCR_M_DyAr_GetNextElement(
SCR_tdst_Link_Value,
uiMaterialPos,
p_stMaterialEntry,
p_stMaterialLinkTable->stLinkArray
);
}
/* if all editor materials were destroyed, we have to parse the file again */
/* to build editor materials for the remaining sections for all gmt files! */
if ( gs_p_oMaterialInterface->m_eGetRefreshListMode() == E_rlm_DestroyAndRebuild )
{
CPA_BaseObjectList *p_oFileList = gs_p_oMaterialInterface->GetMainWorld()->fn_p_oGetOriginalObjectList(C_szFileTypeName);
Position xPos = p_oFileList->GetHeadPosition();
while ( xPos )
{
CPA_FileObject *p_oFileObject = (CPA_FileObject *) p_oFileList->GetNext(xPos);
CString csName;
//if the sections were analyzed with the full name, the file in which the scripts found them
//is known with its long name as well, else it is known with its referenced name
if ( _bSectionsAnalysedWithFullNames )
csName = p_oFileObject->GetCompleteName();
else
csName = p_oFileObject->GetReferencedName(gs_p_oMaterialInterface, C_szFileReferencedNameKey);
const char *pszName = LPCTSTR(csName);
const char *pszNameExtension = strrchr((char*)pszName, '.');
if
(
((pszNameExtension == NULL) ? FALSE : TRUE)
&& (!(D_tdoMaterialClass::m_csGetScriptExtension().CompareNoCase(pszNameExtension)))
&& (SCR_fn_c_RdL0_IsSectionExists((char *) pszName)) //the file must exist...
)
{
/* now lets load the other sections in the script files that are not used by the engine */
SCR_fn_v_RdL0_OpenFile((char*)pszName); //force file parsing, just in case
SCR_tdst_File_Open *p_stFile = SCR_fnp_st_RdL0_GetOpenFile((char*)pszName);
csStatusMessage.Format("creating %d unreferenced materials of %s", p_stFile->stSectionsDes.uiNumValues, pszName);
//start the scan
uiMaterialPos = 0;
SCR_tdst_Anl_SectionDes *p_stSectionDesc;
SCR_M_DyAr_GetNextElement(
SCR_tdst_Anl_SectionDes,
uiMaterialPos,
p_stSectionDesc,
p_stFile->stSectionsDes
);
while ( p_stSectionDesc )
{
fn_vGiveProgressInfo(csStatusMessage, (uiMaterialPos * 100) / p_stFile->stSectionsDes.uiNumValues);
D_tdoMaterialClass *p_oInsertedMaterial = NULL;
if ( !p_stSectionDesc->p_stOpenSection ) /* handle only sections that are not yet analyzed */
{
//find if an object with the same identification already exists (because we never know...)
p_oInsertedMaterial = (D_tdoMaterialClass *) gs_p_oMaterialInterface->GetBaseObject(
CString(p_stSectionDesc->stBuffers.p_szBufferNameExt), //to make sure the correct overload is specified
D_tdoMaterialClass::m_csGetMaterialType(),
p_oFileObject
);
//if we found one, the material that created it was not aware that the section existed,
//so correct it now
if ( p_oInsertedMaterial )
p_oInsertedMaterial->SetExistingSection(TRUE);
else //if we did not find such an editor object, create it
{
D_tdxEngineMaterialHandle hInvalidMaterial;
D_tdoMaterialClass::m_vInvalidateEngineMaterial(hInvalidMaterial);
p_oInsertedMaterial = new D_tdoMaterialClass(
p_oFileObject,
p_stSectionDesc->stBuffers.p_szBufferNameExt,
TRUE,
hInvalidMaterial
);
if ( _p_oReferencingCombo )
{
CString csName = p_oInsertedMaterial->GetName();
short wIndex = _p_oReferencingCombo->FindStringExact(-1, csName);
if ( wIndex == CB_ERR ) //if the material is not already in the combo
{ //add it
wIndex = _p_oReferencingCombo->AddString(csName);
_p_oReferencingCombo->SetItemDataPtr(wIndex, p_oInsertedMaterial);
}
}
}
}
uiMaterialPos ++;
SCR_M_DyAr_GetNextElement(
SCR_tdst_Anl_SectionDes,
uiMaterialPos,
p_stSectionDesc,
p_stFile->stSectionsDes
);
} /* section loop */
fn_vGiveProgressInfo(csStatusMessage, 100);
} /* gmt file test */
} /* gmt file loop */
} /* destroy and rebuild test */
fn_vGiveProgressInfo("", -1);
}
#endif
#undef D_tdoMaterialClass
#undef D_tdxEngineMaterialHandle

View File

@@ -0,0 +1,630 @@
# Microsoft Developer Studio Project File - Name="TGM" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=TGM - Win32 Debug Glide with Editors
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "Tgm.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Tgm.mak" CFG="TGM - Win32 Debug Glide with Editors"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "TGM - Win32 Debug with Editors" (based on\
"Win32 (x86) Dynamic-Link Library")
!MESSAGE "TGM - Win32 Debug Glide with Editors" (based on\
"Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""$/CPA/TempGrp/TGM", YWBAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "TGM - Win32 Debug with Editors"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug with Editors"
# PROP BASE Intermediate_Dir "Debug with Editors"
# PROP BASE Target_Dir ""
# PROP Use_MFC 2
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "x:\CPA\EXE\Main\Edt_Data\Tools"
# PROP Intermediate_Dir "Tmp\TGMP5Evd"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "X:\CPA\Public" /D "SCR_DM_OptCFiles" /D "CPA_WANTS_IMPORT" /D "ACTIVE_EDITOR" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "CPA_VISUAL" /D "CPA_DEBUG" /D "_WINDLL" /D "_AFXDLL" /D "USE_ALTIMAPS" /FR /YX /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x40c /d "_DEBUG"
# ADD RSC /l 0x40c /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo /o"tmp\TGMP5Evd\Tgm.bsc"
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 X:\CPA\Exe\GAM\GAMP5Evd.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"X:\CPA\EXE\GAM\EDT_Data\Tools/TGMP5Evd.dll" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "TGM - Win32 Debug Glide with Editors"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug Glide with Editors"
# PROP BASE Intermediate_Dir "Debug Glide with Editors"
# PROP BASE Target_Dir ""
# PROP Use_MFC 2
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "x:\CPA\EXE\Main\Edt_Data\Tools"
# PROP Intermediate_Dir "Tmp\TGMDFEvd"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /Z7 /Od /I "X:\CPA\Public" /I "x:\cpa\main\inc" /I "res" /I "t:\dksdk\sdk\inc" /I "t:\3dfx\glide\src\sst1\include" /D "SCR_DM_OptCFiles" /D "CPA_WANTS_IMPORT" /D "ACTIVE_EDITOR" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "CPA_VISUAL" /D "CPA_DEBUG" /D "_WINDLL" /D "_AFXDLL" /D "USE_ALTIMAPS" /Fr /YX /FD /c
# SUBTRACT CPP /WX
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x40c /d "_DEBUG"
# ADD RSC /l 0x40c /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo /o"tmp\TGMDFEvd\Tgm.bsc"
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"X:\CPA\EXE\Main\EDT_Data\Tools/TGMDFEvd.dll"
# SUBTRACT LINK32 /profile
!ENDIF
# Begin Target
# Name "TGM - Win32 Debug with Editors"
# Name "TGM - Win32 Debug Glide with Editors"
# Begin Group "Source Files"
# PROP Default_Filter "c;cpp;def"
# Begin Source File
SOURCE=.\Src\_interf.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\choosecolor.cpp
# ADD CPP /I "..\Res"
# End Source File
# Begin Source File
SOURCE=.\Src\CMatObj.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\CopyPaste.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\diacol.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\dialist.cpp
# ADD CPP /I "..\Res"
# End Source File
# Begin Source File
SOURCE=.\Src\diamain.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\diameca.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\diasound.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\DiaText.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\diaview.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\DlgPreloadGMT.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\dllcom.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\GMatObj.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\Material.def
# End Source File
# Begin Source File
SOURCE=.\Src\MatList.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\MMatObj.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\PatternList.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\StdAfx.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\templates.cxx
!IF "$(CFG)" == "TGM - Win32 Debug with Editors"
!ELSEIF "$(CFG)" == "TGM - Win32 Debug Glide with Editors"
# PROP Exclude_From_Build 1
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\Src\TexObj.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\TextureDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\VMatObj.cpp
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "rc;bmp;clw;aps"
# Begin Source File
SOURCE=.\Res\bitmap_h.bmp
# End Source File
# Begin Source File
SOURCE=.\Res\colorchooser.bmp
# End Source File
# Begin Source File
SOURCE=.\Res\en_chantier.bmp
# End Source File
# Begin Source File
SOURCE=.\Res\icodown.ico
# End Source File
# Begin Source File
SOURCE=.\Res\icoup.ico
# End Source File
# Begin Source File
SOURCE=.\Res\matres.h
# End Source File
# Begin Source File
SOURCE=.\Res\TGM.aps
# End Source File
# Begin Source File
SOURCE=.\Res\TGM.clw
# End Source File
# Begin Source File
SOURCE=.\Res\TGM.rc
# End Source File
# Begin Source File
SOURCE=.\Res\tgm_dlgb.ico
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp"
# Begin Source File
SOURCE=.\Src\_interf.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\choosecolor.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\CMatObj.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\CopyPaste.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\diacol.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\dialist.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\diamain.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\diameca.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\diasound.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\DiaText.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\diaview.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\dlgpreloadgmt.h
# End Source File
# Begin Source File
SOURCE=.\Src\GMatObj.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\MatList.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\MMatObj.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\PatternList.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\TexObj.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\TextureDlg.h
# End Source File
# Begin Source File
SOURCE=.\Src\TGMdef.hpp
# End Source File
# Begin Source File
SOURCE=.\Src\VMatObj.hpp
# End Source File
# End Group
# Begin Group "Other Files"
# PROP Default_Filter "bmp;txt;cmd;ini"
# Begin Source File
SOURCE=..\..\exe\main\edt_data\Tools\Material\Material.ini
# End Source File
# Begin Source File
SOURCE=..\..\Exe\Main\EDT_DATA\tools\Material\NoBitmap.bmp
# End Source File
# Begin Source File
SOURCE=.\Misc\ShadowCopy.cmd
# End Source File
# Begin Source File
SOURCE=..\..\Exe\Main\EDT_DATA\tools\Material\UnviewableBitmap.bmp
# End Source File
# Begin Source File
SOURCE=.\Misc\version.txt
# End Source File
# End Group
# Begin Group "libs debug"
# PROP Default_Filter "*.lib"
# Begin Source File
SOURCE=..\..\Exe\Main\MaiDFEvd.lib
# End Source File
# Begin Source File
SOURCE=..\..\Exe\Main\Edt_Data\Objects\OGDDFEvd.lib
# End Source File
# End Group
# Begin Group "Help Files"
# PROP Default_Filter "shg;bmp;rtf;hlp;cnt;gid"
# Begin Source File
SOURCE=.\Help\3dview.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\alleditpanesforbuttons.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\alphabuttonfalse.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\alphabuttontrue.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\animatedtexturearrows.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\animatedtexturelist.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\animatedtextureminus.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\animatedtextureplus.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\autoscrollbuttonfalse.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\autoscrollbuttontrue.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\COLLIDE.SHG
# End Source File
# Begin Source File
SOURCE=.\Help\collideeditpane.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\colorbuttons.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\colorchooserdialog.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\disablededitpanes.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\disabledtexturepane.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\enablededitpanes.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\enabledtexturepane.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\fullscreen.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\FullScreen.shg
# End Source File
# Begin Source File
SOURCE=.\Help\locknameslocked.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\locknamesunlocked.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\MAIN.SHG
# End Source File
# Begin Source File
SOURCE=.\Help\mainbuttonclone.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\mainbuttondelete.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\mainbuttonnew.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\maineditpane.bmp
# End Source File
# Begin Source File
SOURCE=..\..\exe\main\edt_data\Tools\Material\MatHelp.CNT
# End Source File
# Begin Source File
SOURCE=..\..\exe\main\edt_data\Tools\Material\MatHelp.GID
# End Source File
# Begin Source File
SOURCE=..\..\exe\main\edt_data\Tools\Material\MATHELP.HLP
# End Source File
# Begin Source File
SOURCE=.\Help\MatHelp.hpj
# End Source File
# Begin Source File
SOURCE=.\Help\MatHelp.rtf
# End Source File
# Begin Source File
SOURCE=.\Help\matlistview_displayall_bitmapandtext.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\matlistview_displayall_bitmaponly.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\matlistview_displayall_textonly.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\MECA.SHG
# End Source File
# Begin Source File
SOURCE=.\Help\mechanicseditpane.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\MLV_BT.SHG
# End Source File
# Begin Source File
SOURCE=.\Help\popupmenu_in_3dview.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\popupmenu_in_materiallistview.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\pulldownmenu.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\purgebuttonenabled.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\qualitybuttonhigh.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\qualitybuttonlow.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\qualitybuttonnormal.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\quarter_fullscreen.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\quartercolorchooserdialog.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\small_matlistview_displayall_bitmapandtext.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\smoothingbuttonflat.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\smoothingbuttongouraud.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\sound.shg
# End Source File
# Begin Source File
SOURCE=.\Help\soundeditpane.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\specexpedit.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\TEXTURE.SHG
# End Source File
# Begin Source File
SOURCE=.\Help\texturebutton_nomaterial.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\texturebutton_nontexturedmaterial.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\texturebutton_texturedmaterial.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\texturedbuttonfalse.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\texturedbuttontrue.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\texturedialog.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\transparentbuttonfalse.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\transparentbuttontrue.bmp
# End Source File
# Begin Source File
SOURCE=.\Help\VISUAL.SHG
# End Source File
# Begin Source File
SOURCE=.\Help\visualeditpane.bmp
# End Source File
# End Group
# Begin Source File
SOURCE=.\Tgm.mak
# End Source File
# End Target
# End Project

View File

@@ -0,0 +1,961 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="TGM"
ProjectGUID="{1185311A-62A0-4DAE-80BD-DF781F82F527}"
SccProjectName="&quot;$/CPA/TempGrp/TGM&quot;, YWBAAAAA"
SccAuxPath=""
SccLocalPath="."
SccProvider="MSSCCI:NXN alienbrain"
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug Glide with Editors|Win32"
OutputDirectory="x:\CPA\EXE\Main\Edt_Data\Tools"
IntermediateDirectory=".\Tmp\TGMDFEvd"
ConfigurationType="2"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="X:\CPA\Public,x:\cpa\main\inc,res,t:\dksdk\sdk\inc,t:\3dfx\glide\src\sst1\include"
PreprocessorDefinitions="SCR_DM_OptCFiles;ACTIVE_EDITOR;WIN32;_DEBUG;_WINDOWS;CPA_VISUAL;CPA_DEBUG;USE_ALTIMAPS;CPA_WANTS_IMPORT"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Tmp\TGMDFEvd/Tgm.pch"
AssemblerListingLocation=".\Tmp\TGMDFEvd/"
ObjectFile=".\Tmp\TGMDFEvd/"
ProgramDataBaseFileName=".\Tmp\TGMDFEvd/"
BrowseInformation="1"
BrowseInformationFile=".\Tmp\TGMDFEvd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="1"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="MaiDFEvd.lib"
OutputFile="X:\CPA\EXE\Main\EDT_Data\Tools/TGMDFEvd.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="X:\cpa\libd;X:\cpa\exe\main"
IgnoreDefaultLibraryNames=""
ModuleDefinitionFile=".\Src\Material.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="x:\CPA\EXE\Main\Edt_Data\Tools/TGMDFEvd.pdb"
SubSystem="2"
ImportLibrary="x:\CPA\EXE\Main\Edt_Data\Tools/TGMDFEvd.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName="x:\CPA\EXE\Main\Edt_Data\Tools/Tgm.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1036"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug with Editors|Win32"
OutputDirectory="x:\CPA\EXE\Main\Edt_Data\Tools"
IntermediateDirectory=".\Tmp\TGMP5Evd"
ConfigurationType="2"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="X:\cpa\main\Inc;X:\cpa\tempgrp\TGM\Res;X:\CPA\Public"
PreprocessorDefinitions="SCR_DM_OptCFiles;CPA_WANTS_IMPORT;ACTIVE_EDITOR;WIN32;_DEBUG;_WINDOWS;CPA_VISUAL;CPA_DEBUG;USE_ALTIMAPS"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Tmp\TGMP5Evd/Tgm.pch"
AssemblerListingLocation=".\Tmp\TGMP5Evd/"
ObjectFile=".\Tmp\TGMP5Evd/"
ProgramDataBaseFileName=".\Tmp\TGMP5Evd/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="GAMP5Evd.lib maidfevd.lib ogddfevd.lib mecp5evd.lib"
OutputFile="X:\CPA\EXE\GAM\EDT_Data\Tools/TGMP5Evd.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="X:\cpa\exe\main\edt_data\objects;X:\cpa\exe\main;X:\cpa\libd"
ModuleDefinitionFile=".\Src\Material.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="x:\CPA\EXE\Main\Edt_Data\Tools/TGMP5Evd.pdb"
SubSystem="2"
ImportLibrary="x:\CPA\EXE\Main\Edt_Data\Tools/TGMP5Evd.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName="x:\CPA\EXE\Main\Edt_Data\Tools/Tgm.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1036"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="c;cpp;def">
<File
RelativePath="Src\_interf.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\choosecolor.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\Res"
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\Res"
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\CMatObj.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\CopyPaste.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\diacol.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\dialist.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\Res"
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\Res"
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\diamain.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\diameca.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\diasound.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\DiaText.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\diaview.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\DlgPreloadGMT.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\dllcom.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\GMatObj.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\Material.def">
</File>
<File
RelativePath="Src\MatList.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\MMatObj.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\PatternList.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\StdAfx.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\templates.cxx">
<FileConfiguration
Name="Debug Glide with Editors|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\TexObj.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\TextureDlg.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Src\VMatObj.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;bmp;clw;aps">
<File
RelativePath="Res\bitmap_h.bmp">
</File>
<File
RelativePath="Res\colorchooser.bmp">
</File>
<File
RelativePath="Res\en_chantier.bmp">
</File>
<File
RelativePath="Res\icodown.ico">
</File>
<File
RelativePath="Res\icoup.ico">
</File>
<File
RelativePath="Res\matres.h">
</File>
<File
RelativePath="Res\TGM.aps">
</File>
<File
RelativePath="Res\TGM.clw">
</File>
<File
RelativePath="Res\TGM.rc">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="Res"/>
</FileConfiguration>
<FileConfiguration
Name="Debug with Editors|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="Res"/>
</FileConfiguration>
</File>
<File
RelativePath="Res\tgm_dlgb.ico">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp">
<File
RelativePath="Src\_interf.hpp">
</File>
<File
RelativePath="Src\choosecolor.hpp">
</File>
<File
RelativePath="Src\CMatObj.hpp">
</File>
<File
RelativePath="Src\CopyPaste.hpp">
</File>
<File
RelativePath="Src\diacol.hpp">
</File>
<File
RelativePath="Src\dialist.hpp">
</File>
<File
RelativePath="Src\diamain.hpp">
</File>
<File
RelativePath="Src\diameca.hpp">
</File>
<File
RelativePath="Src\diasound.hpp">
</File>
<File
RelativePath="Src\DiaText.hpp">
</File>
<File
RelativePath="Src\diaview.hpp">
</File>
<File
RelativePath="Src\dlgpreloadgmt.h">
</File>
<File
RelativePath="Src\GMatObj.hpp">
</File>
<File
RelativePath="Src\MatList.hpp">
</File>
<File
RelativePath="Src\MMatObj.hpp">
</File>
<File
RelativePath="Src\PatternList.hpp">
</File>
<File
RelativePath="Src\TexObj.hpp">
</File>
<File
RelativePath="Src\TextureDlg.h">
</File>
<File
RelativePath="Src\TGMdef.hpp">
</File>
<File
RelativePath="Src\VMatObj.hpp">
</File>
</Filter>
<Filter
Name="Other Files"
Filter="bmp;txt;cmd;ini">
<File
RelativePath="..\..\exe\main\edt_data\Tools\Material\Material.ini">
</File>
<File
RelativePath="..\..\Exe\Main\EDT_DATA\tools\Material\NoBitmap.bmp">
</File>
<File
RelativePath="Misc\ShadowCopy.cmd">
</File>
<File
RelativePath="..\..\Exe\Main\EDT_DATA\tools\Material\UnviewableBitmap.bmp">
</File>
<File
RelativePath="Misc\version.txt">
</File>
</Filter>
<Filter
Name="Help Files"
Filter="shg;bmp;rtf;hlp;cnt;gid">
<File
RelativePath="Help\3dview.bmp">
</File>
<File
RelativePath="Help\alleditpanesforbuttons.bmp">
</File>
<File
RelativePath="Help\alphabuttonfalse.bmp">
</File>
<File
RelativePath="Help\alphabuttontrue.bmp">
</File>
<File
RelativePath="Help\animatedtexturearrows.bmp">
</File>
<File
RelativePath="Help\animatedtexturelist.bmp">
</File>
<File
RelativePath="Help\animatedtextureminus.bmp">
</File>
<File
RelativePath="Help\animatedtextureplus.bmp">
</File>
<File
RelativePath="Help\autoscrollbuttonfalse.bmp">
</File>
<File
RelativePath="Help\autoscrollbuttontrue.bmp">
</File>
<File
RelativePath="Help\COLLIDE.SHG">
</File>
<File
RelativePath="Help\collideeditpane.bmp">
</File>
<File
RelativePath="Help\colorbuttons.bmp">
</File>
<File
RelativePath="Help\colorchooserdialog.bmp">
</File>
<File
RelativePath="Help\disablededitpanes.bmp">
</File>
<File
RelativePath="Help\disabledtexturepane.bmp">
</File>
<File
RelativePath="Help\enablededitpanes.bmp">
</File>
<File
RelativePath="Help\enabledtexturepane.bmp">
</File>
<File
RelativePath="Help\fullscreen.bmp">
</File>
<File
RelativePath="Help\FullScreen.shg">
</File>
<File
RelativePath="Help\locknameslocked.bmp">
</File>
<File
RelativePath="Help\locknamesunlocked.bmp">
</File>
<File
RelativePath="Help\MAIN.SHG">
</File>
<File
RelativePath="Help\mainbuttonclone.bmp">
</File>
<File
RelativePath="Help\mainbuttondelete.bmp">
</File>
<File
RelativePath="Help\mainbuttonnew.bmp">
</File>
<File
RelativePath="Help\maineditpane.bmp">
</File>
<File
RelativePath="..\..\exe\main\edt_data\Tools\Material\MatHelp.CNT">
</File>
<File
RelativePath="..\..\exe\main\edt_data\Tools\Material\MatHelp.GID">
</File>
<File
RelativePath="..\..\exe\main\edt_data\Tools\Material\MATHELP.HLP">
</File>
<File
RelativePath="Help\MatHelp.hpj">
</File>
<File
RelativePath="Help\MatHelp.rtf">
</File>
<File
RelativePath="Help\matlistview_displayall_bitmapandtext.bmp">
</File>
<File
RelativePath="Help\matlistview_displayall_bitmaponly.bmp">
</File>
<File
RelativePath="Help\matlistview_displayall_textonly.bmp">
</File>
<File
RelativePath="Help\MECA.SHG">
</File>
<File
RelativePath="Help\mechanicseditpane.bmp">
</File>
<File
RelativePath="Help\MLV_BT.SHG">
</File>
<File
RelativePath="Help\popupmenu_in_3dview.bmp">
</File>
<File
RelativePath="Help\popupmenu_in_materiallistview.bmp">
</File>
<File
RelativePath="Help\pulldownmenu.bmp">
</File>
<File
RelativePath="Help\purgebuttonenabled.bmp">
</File>
<File
RelativePath="Help\qualitybuttonhigh.bmp">
</File>
<File
RelativePath="Help\qualitybuttonlow.bmp">
</File>
<File
RelativePath="Help\qualitybuttonnormal.bmp">
</File>
<File
RelativePath="Help\quarter_fullscreen.bmp">
</File>
<File
RelativePath="Help\quartercolorchooserdialog.bmp">
</File>
<File
RelativePath="Help\small_matlistview_displayall_bitmapandtext.bmp">
</File>
<File
RelativePath="Help\smoothingbuttonflat.bmp">
</File>
<File
RelativePath="Help\smoothingbuttongouraud.bmp">
</File>
<File
RelativePath="Help\sound.shg">
</File>
<File
RelativePath="Help\soundeditpane.bmp">
</File>
<File
RelativePath="Help\specexpedit.bmp">
</File>
<File
RelativePath="Help\TEXTURE.SHG">
</File>
<File
RelativePath="Help\texturebutton_nomaterial.bmp">
</File>
<File
RelativePath="Help\texturebutton_nontexturedmaterial.bmp">
</File>
<File
RelativePath="Help\texturebutton_texturedmaterial.bmp">
</File>
<File
RelativePath="Help\texturedbuttonfalse.bmp">
</File>
<File
RelativePath="Help\texturedbuttontrue.bmp">
</File>
<File
RelativePath="Help\texturedialog.bmp">
</File>
<File
RelativePath="Help\transparentbuttonfalse.bmp">
</File>
<File
RelativePath="Help\transparentbuttontrue.bmp">
</File>
<File
RelativePath="Help\VISUAL.SHG">
</File>
<File
RelativePath="Help\visualeditpane.bmp">
</File>
</Filter>
<File
RelativePath="Tgm.mak">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

Binary file not shown.

View File

@@ -0,0 +1,5 @@
SCC = This is a source code control file
[Tgm.vcproj]
SCC_Aux_Path = "P4SCC#srvperforce-ma:1666##raymandata##Editor"
SCC_Project_Name = Perforce Project