diff --git a/base/MaterialEditorDefs.med b/base/MaterialEditorDefs.med new file mode 100644 index 0000000..fab8ad2 --- /dev/null +++ b/base/MaterialEditorDefs.med @@ -0,0 +1,121 @@ + + +materialprops +{ + TYPE_GROUP, "", "General", "General Parameters" + TYPE_STRING, "description", "Description", "The description of the material.", 1 + TYPE_BOOL, "translucent", "Translucent", "Makes the surface translucent." + TYPE_BOOL, "forceOpaque", "Force Opaque", "Forces a surface to be opaque" + TYPE_BOOL, "twoSided", "Two Sided", "The material is two sided." + TYPE_BOOL, "backSided", "Back Sided", "The material is drawn on the backside of a polygon." + TYPE_STRING, "deform", "Deform", "Performs different types of deformations to the material. Possible values are sprite, tube, flare , expand , move , eyeBall", 0 + TYPE_STRING, "sort", "Sort", "Defines the sort order of a surface with this material.", 0 + TYPE_BOOL, "mirror", "Mirror", "This surface is a mirror." + + TYPE_GROUP, "", "Surface Parameters", "Surface Parameters" + TYPE_BOOL, "solid", "Solid", "Is this surface solid." + TYPE_BOOL, "water", "Water", "Is this surface water." + TYPE_BOOL, "playerclip", "Player Clip", "Will the player clip against this surface." + TYPE_BOOL, "monsterclip", "Monster Clip", "Will monsters clip against this surface." + TYPE_BOOL, "moveableclip", "Moveable Clip", "Will moveable objects clip against this surface." + TYPE_BOOL, "blood", "Blood", "Is this surface blood. (DOES NOT WORK)" + TYPE_BOOL, "nonsolid", "Non-Solid", "Is this surface non-solid." + TYPE_BOOL, "nullNormal", "Null Normal", "Renderbump will draw 0x80 0x80 0x80. This allows artists to force an area to reflect no light at all." + TYPE_BOOL, "areaportal", "Area Portal", "Divides two areas." + TYPE_BOOL, "qer_nocarve", "Editor No Carve", "Forces the editor to not cut brushes with this surface." + TYPE_BOOL, "discrete", "Discrete", "Surfaces should not be automatically merged together or clipped to the world because they represent discrete objects like gui shaders, mirrors, or autosprites." + TYPE_BOOL, "noFragment", "No Fragement", "The surface will not be diced up during the build process." + TYPE_BOOL, "slick", "Slick", "Low player friction." + TYPE_BOOL, "collision", "Collision", "Explicitly define a surface for collision testing." + TYPE_BOOL, "noimpact", "No Impact", "Don't make impact explosions or marks." + TYPE_BOOL, "nodamage", "No Damage", "No falling damage when hitting." + TYPE_BOOL, "ladder", "Ladder", "The surface is climbable." + TYPE_BOOL, "nosteps", "No Steps", "No footsteps on the surface. (DOES NOT WORK)" + + TYPE_GROUP, "", "Light", "Light Parameters" + TYPE_STRING, "lightFalloffImage", "Light Falloff Image", "Specifies the image to use for the third axis of projected light volume.", 0 + TYPE_STRING, "spectrum", "Spectrum", "The spectrum of light this material will display under or if the material is a light then this is the spectrum the light gives off.", 0 + TYPE_BOOL, "ambientLight", "Ambient Light", "The material is an ambient light." + TYPE_BOOL, "noShadows", "No Shadows", "Does the surface cast a shadow." + TYPE_BOOL, "noSelfShadow", "No Self Shadows", "???" + TYPE_BOOL, "forceShadows", "Force Shadows", "Allows nodraw surfaces to cast shadows." + TYPE_BOOL, "fogLight", "Fog Light", "The material is a fog light." + TYPE_BOOL, "noPortalFog", "No Portal Fog", "Disables the ability for fog lights to close a portal." + TYPE_BOOL, "blendLight", "Blend Light", "blendLight allows a light projection with an arbitrary blend to be applied to everything inside it, allowing simple fogs that increase in a given direction without caring about the viewer position." + TYPE_BOOL, "noFog", "No Fog", "Explicitly state that a surface does not accept fog." + + TYPE_GROUP, "", "Decal Information", "Decal Parameters" + TYPE_STRING, "decalInfo", "Decal Info", "Stay Time, Fade Time, Start RGBA, End RGBA.", 0 + TYPE_BOOL, "noOverlays", "No Overlays", "Overlay and decal suppression." + TYPE_BOOL, "forceOverlays", "Force Overlays", "Monster blood overlay forcing for alpha tested or translucent surfaces." + TYPE_BOOL, "DECAL_MACRO", "DECAL_MACRO", "DECAL_MACRO for backwards compatibility with the preprocessor macros." + + TYPE_GROUP, "", "Miscellaneous", "Miscellaneous Parameters" + TYPE_BOOL, "polygonOffset", "Polygon Offset", "Renders the surface with a depth offset of 1." + TYPE_STRING, "renderbump", "Renderbump", "Command used to specify how a bumpmap is built from a high and low poly model.", 0 + TYPE_BOOL, "unsmoothedTangents", "Unsmoothed Tagents", "Renderbump optimization for animating characters." + TYPE_STRING, "guisurf", "Gui Surface", "Makes the surface a gui (Specify either a gui file or a render entity).", 0 + TYPE_STRING, "qer_editorimage", "Editor Image", "This image to use in the editor.", 0 +} + +stageprops +{ + TYPE_GROUP, "", "General", "General stage properties." + TYPE_STRING, "if", "If", "Conitional to determine if the stage should be rendered.", 0 + TYPE_STRING, "map", "Map", "The texture path for this stage.", 0 + TYPE_STRING, "blend", "Blend", "Blend type for this stage.", 0 + TYPE_STRING, "remoteRenderMap", "Remote Rendermap", "This stage is a remote view.", 0 + TYPE_STRING, "mirrorRenderMap", "Mirror Rendermap", "This stage is a mirror.", 0 + + TYPE_STRING, "videomap", "Video Map", "Path of the video to render during this stage.", 0 + TYPE_STRING, "soundmap", "Sound Map", "Path of the looping sound to emit.", 0 + TYPE_STRING, "cubeMap", "Cube Map", "Specify the cubemap image for the stage and that _px, _nx, _py, etc, are directly sent to GL.", 0 + TYPE_STRING, "cameraCubeMap", "Camera Cube Map", "_forward, _back, etc, rotated and flipped as needed before sending to GL.", 0 + TYPE_STRING, "texGen", "Tex Gen", "Sets the texture coordinate type to use during rendering.", 0 + + TYPE_GROUP, "", "Flags", "Stage Flags." + TYPE_BOOL, "ignoreAlphaTest", "Ignore Alpha Test", "Tells the stage to ignore any alpha testing that has been defined in previous stages." + TYPE_BOOL, "nearest", "Nearest", "Specifies that scaling the image larger or smaller will return the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured." + TYPE_BOOL, "linear", "Linear", "Specifies that scaling the image larger or smaller will return the weighted average of the four texture elements that are closest to the center of the pixel being textured." + TYPE_BOOL, "clamp", "Clamp", "Prevents texture wrapping by clamping the texture coordinate from 0 to 1." + TYPE_BOOL, "zeroclamp", "Zero Clamp", "Same as clamp but zeros the border without alpha allowing clamped projection textures even after picmip resampling." + TYPE_BOOL, "alphazeroclamp", "Alpha Zero Clamp", "Same as clamp but zeros the border with alpha allowing clamped projection textures even after picmip resampling" + TYPE_BOOL, "uncompressed", "Uncompressed", "Specified the stage should not be compressed." + TYPE_BOOL, "highquality", "High Quality", "Specifies that each color component is 8 bits." + TYPE_BOOL, "nopicmip", "No Pic Mip", "Specifies the image should not be downsized for mipmapping." + TYPE_BOOL, "vertexColor", "Vertex Color", "???" + TYPE_BOOL, "inverseVertexColor", "Inverse Vertex Color", "???" + + TYPE_GROUP, "", "Modifiers", "Stage Modification Parameters." + TYPE_STRING, "scroll", "Scroll", "Scrolls the texture by the specified expression amounts.", 0 + TYPE_STRING, "translate", "Translate", "Same as scroll.", 0 + TYPE_STRING, "scale", "Scale", "Scales without centering.", 0 + TYPE_STRING, "centerScale", "Center Scale", "Scales and centers the texture.", 0 + TYPE_STRING, "shear", "Shear", "Shear the texture.", 0 + TYPE_STRING, "rotate", "Rotate", "Rotates the texture.", 0 + + TYPE_GROUP, "", "Color", "Color Parameters." + TYPE_BOOL, "maskRed", "Mask Red", "Removes the red component." + TYPE_BOOL, "maskGreen", "Mask Green", "Removes the green component." + TYPE_BOOL, "maskBlue", "Mask Blue", "Removes the blue component." + TYPE_BOOL, "maskAlpha", "Mask Alpha", "Removes the alpha channel." + TYPE_BOOL, "maskColor", "Mask Color", "Writes only the alpha channel." + TYPE_BOOL, "maskDepth", "Mask Depth", "Turns off depth buffer writing." + TYPE_BOOL, "colored", "Colored", "Specifies the 4 color components as the first 4 shader parameters." + TYPE_STRING, "alphatest", "Alpha Test", "The expression is value from 0 to 1 that determines which fragments should be discarded. 0 will discard no fragments while 1 will discard all.", 0 + TYPE_STRING, "color", "Color", "Specify the 4 color components for the stage.", 0 + TYPE_STRING, "red", "Red", "Specify the red component for the stage.", 0 + TYPE_STRING, "green", "Green", "Specify the green component for the stage.", 0 + TYPE_STRING, "blue", "Blue", "Specify the blue component for the stage.", 0 + TYPE_STRING, "alpha", "Alpha", "Specify the alpha component for the stage.", 0 + TYPE_STRING, "rgb", "RGB", "Specify the RGB components for the stage.", 0 + TYPE_STRING, "rgba", "RGBA", "Specify the RGB and A components for the stage.", 0 +} + +specialmapstageprops +{ + TYPE_GROUP, "", "General", "General stage properties." + TYPE_STRING, "map", "Map", "The map path.", 0 +} + + diff --git a/base/maps/testmaps/test_box.map b/base/maps/testmaps/test_box.map new file mode 100644 index 0000000..8fbb0ca --- /dev/null +++ b/base/maps/testmaps/test_box.map @@ -0,0 +1,132 @@ +Version 2 +// entity 0 +{ +"classname" "worldspawn" +// primitive 0 +{ + brushDef3 + { + ( 0 0 -1 256 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/roadhouse/heatingduct_01" 0 0 0 + ( 0 0 1 -272 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( -1 0.0000001344 0 -192.0000152588 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( -0.0000001344 -1 0 -128.0000152588 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 1 -0.0000001343 0 -191.9999389648 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 0.0000001343 1 0 -256 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + } +} +// primitive 1 +{ + brushDef3 + { + ( 0 0 -1 -16 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 0 0 1 0 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 0 ) ) "textures/roadhouse/wood1" 0 0 0 + ( -1 0.0000001344 0 -192.0000152588 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( -0.0000001344 -1 0 -128.0000152588 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 1 -0.0000001343 0 -191.9999389648 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 0.0000001343 1 0 -256 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + } +} +// primitive 2 +{ + brushDef3 + { + ( 0 0 -1 0 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 0 0 1 -256 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( -1 0.0000001344 0 -192.0000305176 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( -0.0000001344 -1 0 256 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/roadhouse/brick1" 0 0 0 + ( 1 -0.0000001343 0 -191.9999237061 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 0.0000001343 1 0 -272 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + } +} +// primitive 3 +{ + brushDef3 + { + ( 0 0 -1 0 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 0 0 1 -256 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( -1 0.0000001344 0 -191.9999694824 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( -0.0000001344 -1 0 -144 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 1 -0.0000001343 0 -191.9999847412 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 0.0000001344 1 0 128 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/roadhouse/brick1" 0 0 0 + } +} +// primitive 4 +{ + brushDef3 + { + ( 0 0 -1 0 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 0 0 1 -256 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 0 -1 0 -128 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 1 0 0 -208 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 0 1 0 -256 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( -1 0 0 192 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/roadhouse/brick1" 0 0 0 + } +} +// primitive 5 +{ + brushDef3 + { + ( 0 0 -1 0 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 0 0 1 -256 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 0 -1 0 -128 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( 1 0 0 192 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/roadhouse/brick1" 0 0 0 + ( 0 1 0 -256 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + ( -1 0 0 -208 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/common/caulk" 0 0 0 + } +} +} +// entity 1 +{ +"classname" "info_player_start" +"name" "info_player_start_1" +"origin" "128 64 8" +"angle" "180" +} +// entity 2 +{ +"classname" "light" +"name" "light_2" +"origin" "-128 192 128" +"noshadows" "0" +"nospecular" "0" +"nodiffuse" "0" +"falloff" "0" +"_color" "0.78 0.78 0.84" +"light_radius" "225 225 225" +} +// entity 3 +{ +"classname" "light" +"name" "light_3" +"origin" "128 192 128" +"noshadows" "0" +"nospecular" "0" +"nodiffuse" "0" +"falloff" "0" +"_color" "0.78 0.78 0.84" +"light_radius" "225 225 225" +} +// entity 4 +{ +"classname" "light" +"name" "light_4" +"origin" "-128 -64 128" +"noshadows" "0" +"nospecular" "0" +"nodiffuse" "0" +"falloff" "0" +"_color" "0.78 0.78 0.84" +"light_radius" "225 225 225" +} +// entity 5 +{ +"classname" "light" +"name" "light_5" +"origin" "128 -64 128" +"noshadows" "0" +"nospecular" "0" +"nodiffuse" "0" +"falloff" "0" +"_color" "0.78 0.78 0.84" +"light_radius" "225 225 225" +} diff --git a/neo/framework/Licensee.h b/neo/framework/Licensee.h index ef176df..67e6255 100644 --- a/neo/framework/Licensee.h +++ b/neo/framework/Licensee.h @@ -108,8 +108,8 @@ If you have questions concerning this license or the applicable additional terms #define RENDERDEMO_VERSION 100 // editor info -#define EDITOR_DEFAULT_PROJECT "prey.qe4" -#define EDITOR_REGISTRY_KEY "PreyRadiant" +#define TOOLS_REGISTRY_PATH "Software\\id Software\\Human Head\\Tools\\" +#define EDITOR_REGISTRY_KEY "PreyEditor" #define EDITOR_WINDOWTEXT "PREDITOR" // win32 info @@ -117,7 +117,7 @@ If you have questions concerning this license or the applicable additional terms // Linux info #ifndef LINUX_DEFAULT_PATH // allow overriding it from the build system with -DLINUX_DEFAULT_PATH="/bla/foo/whatever" - #define LINUX_DEFAULT_PATH "/usr/local/games/prey" + #define LINUX_DEFAULT_PATH "/usr/local/games/prey06" #endif // CD Key file info diff --git a/neo/sys/win32/rc/prey_tools.rc b/neo/sys/win32/rc/prey_tools.rc index 562020b..d85840c 100644 --- a/neo/sys/win32/rc/prey_tools.rc +++ b/neo/sys/win32/rc/prey_tools.rc @@ -203,50 +203,50 @@ BEGIN LISTBOX IDC_ABOUT_GLEXTENSIONS,10,100,392,242,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP END -IDD_SURFACE DIALOGEX 400, 100, 174, 255 +IDD_SURFACE DIALOGEX 400, 100, 190, 275 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION EXSTYLE WS_EX_CONTROLPARENT CAPTION "Surface Inspector" FONT 9, "Segoe UI", 0, 0, 0x1 BEGIN - EDITTEXT IDC_HSHIFT,121,22,45,12,ES_AUTOHSCROLL - CONTROL "",IDC_SPIN_HSHIFT,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,155,23,11,14 - EDITTEXT IDC_VSHIFT,121,38,45,12,ES_AUTOHSCROLL - CONTROL "",IDC_SPIN_VSHIFT,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,155,39,11,14 - EDITTEXT IDC_ROTATE,121,58,45,12,ES_AUTOHSCROLL - CONTROL "",IDC_SPIN_ROTATE,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,155,61,11,14 - EDITTEXT IDC_HSCALE,121,87,43,12,ES_AUTOHSCROLL | ES_WANTRETURN - EDITTEXT IDC_VSCALE,121,103,44,12,ES_AUTOHSCROLL | ES_WANTRETURN - EDITTEXT IDC_EDIT_WIDTH,53,141,30,12,ES_AUTOHSCROLL | ES_WANTRETURN - CONTROL "",IDC_SPIN_WIDTH,"msctls_updown32",UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,77,139,11,18 - EDITTEXT IDC_EDIT_HEIGHT,91,141,30,12,ES_AUTOHSCROLL | ES_WANTRETURN - CONTROL "",IDC_SPIN_HEIGHT,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,113,138,11,18 - EDITTEXT IDC_TEXTURE,33,6,133,12,ES_AUTOHSCROLL - PUSHBUTTON "CAP",IDC_BTN_PATCHDETAILS,11,158,34,12 - PUSHBUTTON "OK",IDOK,101,240,34,12 - PUSHBUTTON "Cancel",IDCANCEL,101,240,34,12 - RTEXT "Shift vertically",IDC_STATIC,51,40,65,8 - RTEXT "Scale horizontally",IDC_STATIC,51,89,65,8 - RTEXT "Scale vertically",IDC_STATIC,51,105,65,8 - RTEXT "Rotate",IDC_STATIC,95,60,22,8 - RTEXT "Material",IDC_STATIC,3,8,28,8 - RTEXT "Shift horizontally",IDC_STATIC,51,24,65,8 - GROUPBOX "Texturing",IDC_STATIC,3,125,168,51 - PUSHBUTTON "Natural",IDC_BTN_PATCHNATURAL,50,158,34,12 - PUSHBUTTON "Fit",IDC_BTN_FACEFIT,11,141,34,12 - LTEXT "Width",IDC_STATIC,54,132,20,8 - LTEXT "Height",IDC_STATIC,91,132,22,8 - EDITTEXT IDC_EDIT_HORZ,138,195,21,12,ES_AUTOHSCROLL - CONTROL "Subdivide Patch",IDC_CHECK_SUBDIVIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,181,66,11 - CONTROL "",IDC_SLIDER_HORZ,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,36,193,99,17 - LTEXT "Horizontal",IDC_STATIC,3,196,34,10 - EDITTEXT IDC_EDIT_VERT,137,217,21,12,ES_AUTOHSCROLL - CONTROL "",IDC_SLIDER_VERT,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,35,215,99,17 - LTEXT "Vertical",IDC_STATIC,3,218,34,10 - PUSHBUTTON "Flip X",IDC_BTN_FLIPX,89,158,34,12 - PUSHBUTTON "Flip Y",IDC_BTN_FLIPY,128,158,34,12 - CONTROL "Absolute",IDC_CHECK_ABSOLUTE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,86,41,10 - GROUPBOX "",IDC_STATIC,2,76,168,44 + EDITTEXT IDC_HSHIFT,112,22,50,14,ES_AUTOHSCROLL + CONTROL "",IDC_SPIN_HSHIFT,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,163,22,12,14 + EDITTEXT IDC_VSHIFT,112,40,50,14,ES_AUTOHSCROLL + CONTROL "",IDC_SPIN_VSHIFT,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,163,40,12,14 + EDITTEXT IDC_ROTATE,112,58,50,14,ES_AUTOHSCROLL + CONTROL "",IDC_SPIN_ROTATE,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,163,58,12,14 + EDITTEXT IDC_HSCALE,125,87,50,14,ES_AUTOHSCROLL | ES_WANTRETURN + EDITTEXT IDC_VSCALE,125,103,50,14,ES_AUTOHSCROLL | ES_WANTRETURN + EDITTEXT IDC_EDIT_WIDTH,55,141,35,14,ES_AUTOHSCROLL | ES_WANTRETURN + CONTROL "",IDC_SPIN_WIDTH,"msctls_updown32",UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,90,139,12,18 + EDITTEXT IDC_EDIT_HEIGHT,105,142,35,14,ES_AUTOHSCROLL | ES_WANTRETURN + CONTROL "",IDC_SPIN_HEIGHT,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,140,139,12,18 + EDITTEXT IDC_TEXTURE,35,6,140,14,ES_AUTOHSCROLL + PUSHBUTTON "CAP",IDC_BTN_PATCHDETAILS,11,163,40,14 + PUSHBUTTON "OK",IDOK,144,254,40,14 + PUSHBUTTON "Cancel",IDCANCEL,100,254,40,14 + RTEXT "Shift vertically",IDC_STATIC,39,42,70,10 + RTEXT "Scale horizontally",IDC_STATIC,64,89,58,10 + RTEXT "Scale vertically",IDC_STATIC,72,105,50,10 + RTEXT "Rotate",IDC_STATIC,80,60,25,10 + RTEXT "Material",IDC_STATIC,5,8,26,10 + RTEXT "Shift horizontally",IDC_STATIC,39,24,70,10 + GROUPBOX "Texturing",IDC_STATIC,5,125,180,62 + PUSHBUTTON "Natural",IDC_BTN_PATCHNATURAL,53,163,40,14 + PUSHBUTTON "Fit",IDC_BTN_FACEFIT,11,141,40,14 + LTEXT "Width",IDC_STATIC,64,131,21,8 + LTEXT "Height",IDC_STATIC,113,131,22,8 + EDITTEXT IDC_EDIT_HORZ,140,206,35,14,ES_AUTOHSCROLL + CONTROL "Subdivide Patch",IDC_CHECK_SUBDIVIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,192,70,12 + CONTROL "",IDC_SLIDER_HORZ,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,40,204,100,18 + LTEXT "Horizontal",IDC_STATIC,5,207,35,12 + EDITTEXT IDC_EDIT_VERT,140,228,35,14,ES_AUTOHSCROLL + CONTROL "",IDC_SLIDER_VERT,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,40,226,100,18 + LTEXT "Vertical",IDC_STATIC,5,229,35,12 + PUSHBUTTON "Flip X",IDC_BTN_FLIPX,94,163,40,14 + PUSHBUTTON "Flip Y",IDC_BTN_FLIPY,137,163,40,14 + CONTROL "Absolute",IDC_CHECK_ABSOLUTE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,86,45,12 + GROUPBOX "",IDC_STATIC,5,76,180,45 END IDD_DLG_PREFS DIALOGEX 0, 0, 400, 223 @@ -271,7 +271,7 @@ BEGIN LTEXT "minutes",IDC_STATIC,127,134,27,9 CONTROL "Use new map format",IDC_CHECK_NEWMAPFORMAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,151,78,12 GROUPBOX "Camera Speed",IDC_STATIC,245,16,140,50 - CONTROL "Camera Speed",IDC_SLIDER_CAMSPEED,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,255,36,120,20 + CONTROL "Camera Speed",IDC_SLIDER_CAMSPEED,"msctls_trackbar32",WS_TABSTOP,255,36,120,20 LTEXT "slow",IDC_STATIC,256,51,16,8 LTEXT "fast",IDC_STATIC,362,52,14,8 LTEXT "Rotation inc:",IDC_STATIC,191,117,40,12 @@ -369,15 +369,15 @@ BEGIN EDITTEXT 10282,7,7,172,81,ES_MULTILINE | WS_DISABLED | WS_VSCROLL END -IDD_DIALOG_TEXTURELIST DIALOGEX 0, 0, 314, 318 +IDD_DIALOG_TEXTURELIST DIALOGEX 0, 0, 330, 330 STYLE DS_SETFONT | DS_CONTROL | WS_CHILD -FONT 8, "MS Shell Dlg", 0, 0, 0x0 +FONT 9, "Segoe UI", 0, 0, 0x0 BEGIN - DEFPUSHBUTTON "&Load",IDC_LOAD,7,7,35,12,WS_DISABLED - CONTROL "Tree1",IDC_TREE_TEXTURES,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_NOTOOLTIPS | WS_BORDER | WS_TABSTOP,7,24,300,137 - DEFPUSHBUTTON "&Reload",IDC_REFRESH,45,7,35,12 - CONTROL "",IDC_PREVIEW,"Static",SS_BLACKFRAME | SS_NOTIFY | SS_SUNKEN,7,166,300,145 - CONTROL "Hide root entries",IDC_CHECK_HIDEROOT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,163,7,67,10 + DEFPUSHBUTTON "&Load",IDC_LOAD,10,10,40,15,WS_DISABLED + CONTROL "Tree1",IDC_TREE_TEXTURES,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_NOTOOLTIPS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,10,30,136,292 + DEFPUSHBUTTON "&Reload",IDC_REFRESH,55,10,40,15 + CONTROL "",IDC_PREVIEW,"Static",SS_BLACKFRAME | SS_NOTIFY | SS_SUNKEN,149,29,168,294 + CONTROL "Hide root entries",IDC_CHECK_HIDEROOT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,10,70,12 END IDD_DIALOG_NEWPATCH DIALOG 0, 0, 129, 58 @@ -1834,16 +1834,6 @@ IDB_TOOLS_OPEN BITMAP "res\\dbg_open.bmp" IDB_TOOLS_BACK BITMAP "res\\dbg_back.bmp" -IDB_VIEWDEFAULT BITMAP "res\\bitmap2.bmp" - -IDB_VIEWQE4 BITMAP "res\\viewdefa.bmp" - -IDB_VIEW4WAY BITMAP "res\\viewoppo.bmp" - -IDB_VIEWDEFAULT_Z BITMAP "res\\bmp00001.bmp" - -IDR_TOOLBAR_SCALELOCK BITMAP "res\\toolbar2.bmp" - IDR_TOOLBAR BITMAP "res\\toolbar3.bmp" IDB_IENDCAP BITMAP "res\\iendcap.bmp" @@ -1874,10 +1864,6 @@ IDB_ME_TREEBITMAP BITMAP "res\\matedtree.bmp" IDR_ME_FILETOOLBAR BITMAP "res\\MEFileToolbar.bmp" -AFX_IDB_MINIFRAME_MENU BITMAP "res\\minifwnd.bmp" - -AFX_IDB_CHECKLISTBOX_95 BITMAP "res\\95check.bmp" - ///////////////////////////////////////////////////////////////////////////// // @@ -2155,13 +2141,6 @@ IDI_MAINFRAME_RADIANT ICON "res\\Radiant.ico" // Toolbar // -IDR_TOOLBAR_SCALELOCK TOOLBAR 16, 15 -BEGIN - BUTTON ID_SCALELOCKX - BUTTON ID_SCALELOCKY - BUTTON ID_SCALELOCKZ -END - IDR_TOOLBAR TOOLBAR 16, 17 BEGIN BUTTON ID_FILE_OPEN @@ -3278,38 +3257,6 @@ IDC_FPOINT CURSOR "res\\fpoint.cur" IDC_SPLITTER CURSOR "res\\spliter.cur" -AFX_IDC_CONTEXTHELP CURSOR "res\\help.cur" - -AFX_IDC_MOUSE_PAN_N CURSOR "res\\im_pann.cur" - -AFX_IDC_MOUSE_PAN_S CURSOR "res\\im_pans.cur" - -AFX_IDC_MOUSE_PAN_E CURSOR "res\\im_pane.cur" - -AFX_IDC_MOUSE_PAN_W CURSOR "res\\im_panw.cur" - -AFX_IDC_MOUSE_PAN_NE CURSOR "res\\im_panne.cur" - -AFX_IDC_MOUSE_PAN_NW CURSOR "res\\im_pannw.cur" - -AFX_IDC_MOUSE_PAN_SE CURSOR "res\\im_panse.cur" - -AFX_IDC_MOUSE_PAN_SW CURSOR "res\\im_pansw.cur" - -AFX_IDC_MOUSE_PAN_HORZ CURSOR "res\\im_panh.cur" - -AFX_IDC_MOUSE_PAN_VERT CURSOR "res\\im_panv.cur" - -AFX_IDC_MOUSE_PAN_HV CURSOR "res\\im_panhv.cur" - -AFX_IDC_MOUSE_ORG_HORZ CURSOR "res\\im_orgh.cur" - -AFX_IDC_MOUSE_ORG_VERT CURSOR "res\\im_orgv.cur" - -AFX_IDC_MOUSE_ORG_HV CURSOR "res\\im_orghv.cur" - -AFX_IDC_MAGNIFY CURSOR "res\\magnify.cur" - ///////////////////////////////////////////////////////////////////////////// // @@ -3391,6 +3338,11 @@ BEGIN 0 END +IDD_DIALOG_TEXTURELIST AFX_DIALOG_LAYOUT +BEGIN + 0 +END + ///////////////////////////////////////////////////////////////////////////// // diff --git a/neo/sys/win32/rc/res/BITMAP2.BMP b/neo/sys/win32/rc/res/BITMAP2.BMP deleted file mode 100644 index 7982fa2..0000000 Binary files a/neo/sys/win32/rc/res/BITMAP2.BMP and /dev/null differ diff --git a/neo/sys/win32/rc/res/BMP00001.BMP b/neo/sys/win32/rc/res/BMP00001.BMP deleted file mode 100644 index bc656df..0000000 Binary files a/neo/sys/win32/rc/res/BMP00001.BMP and /dev/null differ diff --git a/neo/sys/win32/rc/res/TOOLBAR2.BMP b/neo/sys/win32/rc/res/TOOLBAR2.BMP deleted file mode 100644 index dfa5dd1..0000000 Binary files a/neo/sys/win32/rc/res/TOOLBAR2.BMP and /dev/null differ diff --git a/neo/sys/win32/rc/res/VIEWDEFA.BMP b/neo/sys/win32/rc/res/VIEWDEFA.BMP deleted file mode 100644 index 30233a8..0000000 Binary files a/neo/sys/win32/rc/res/VIEWDEFA.BMP and /dev/null differ diff --git a/neo/sys/win32/rc/res/VIEWOPPO.BMP b/neo/sys/win32/rc/res/VIEWOPPO.BMP deleted file mode 100644 index afa4270..0000000 Binary files a/neo/sys/win32/rc/res/VIEWOPPO.BMP and /dev/null differ diff --git a/neo/sys/win32/rc/res/bmp00005.bmp b/neo/sys/win32/rc/res/bmp00005.bmp deleted file mode 100644 index 6e8e840..0000000 Binary files a/neo/sys/win32/rc/res/bmp00005.bmp and /dev/null differ diff --git a/neo/sys/win32/rc/resource.h b/neo/sys/win32/rc/resource.h index d9ce8b4..13f32e7 100644 --- a/neo/sys/win32/rc/resource.h +++ b/neo/sys/win32/rc/resource.h @@ -15,6 +15,7 @@ #define IDD_DIALOG_AF_CONSTRAINT_SLIDER 110 #define IDD_DIALOG_AF_CONSTRAINT_SPRING 111 #define IDI_ICON2 112 +#define IDP_OLE_INIT_FAILED 113 #define IDC_DIALOG_AF_TAB_MODE 200 #define IDC_DIALOG_AF_START 201 #define IDC_COMBO_AF 202 @@ -664,7 +665,6 @@ #define IDR_MAINFRAME 10052 #define IDR_RADIANTYPE 10053 #define IDR_SHADERTYPE 10055 -#define IDR_TOOLBAR_SCALELOCK 10057 #define IDR_TOOLBAR 10058 #define IDR_MENU_DROP 10059 #define IDR_POPUP_TEXTURE 10062 @@ -678,12 +678,8 @@ #define IDB_ENDCAP 10070 #define IDB_BEVEL 10071 #define IDB_IBEVEL 10072 -#define IDB_VIEWQE4 10073 -#define IDB_VIEW4WAY 10074 -#define IDB_VIEWDEFAULT 10075 #define IDB_VIEWDEFAULT2 10076 #define IDB_VIEWDEFAULT3 10077 -#define IDB_VIEWDEFAULT_Z 10078 #define IDB_BITMAP_GROUPS 10079 #define IDB_BITMAP_MATERIAL 10080 #define IDB_BITMAP_HSB 10081 @@ -730,7 +726,6 @@ #define IDC_BTN_PREVIEW 10256 #define IDC_BTN_ADDTARGET 10257 #define IDC_BTN_SET 10258 -#define IDC_BTN_OLDCOLOR 10259 #define IDC_BUTTON_MODEL 10260 #define IDC_SPIN_AUTOSAVE 10261 #define IDC_BTN_DEL 10262 diff --git a/neo/tools/comafx/DialogColorPicker.cpp b/neo/tools/comafx/DialogColorPicker.cpp index fcab913..4cb9a01 100644 --- a/neo/tools/comafx/DialogColorPicker.cpp +++ b/neo/tools/comafx/DialogColorPicker.cpp @@ -33,122 +33,6 @@ If you have questions concerning this license or the applicable additional terms #include "../../sys/win32/rc/resource.h" #include "DialogColorPicker.h" -#ifdef ID_DEBUG_MEMORY -#undef new -#undef DEBUG_NEW -#define DEBUG_NEW new -#endif - -// Old color picker - -class CMyColorDialog : public CColorDialog -{ - DECLARE_DYNCREATE(CMyColorDialog); - // Construction -public: - CMyColorDialog( COLORREF clrInit = 0, DWORD dwFlags = 0, CWnd *pParentWnd = NULL ); - virtual INT_PTR DoModal(); - -protected: - enum { NCUSTCOLORS = 16 }; - static COLORREF c_CustColors[NCUSTCOLORS]; - static COLORREF c_LastCustColors[NCUSTCOLORS]; - static bool c_NeedToInitCustColors; - static void InitCustColors(); - static void SaveCustColors(); - - // Dialog Data - //{{AFX_DATA(CMyColorDialog) - //}}AFX_DATA - -protected: - // ClassWizard generate virtual function overrides - //{{AFX_VIRTUAL(CMyColorDialog) - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - - // Generated message map functions - //{{AFX_MSG(CMyColorDialog) - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -IMPLEMENT_DYNCREATE( CMyColorDialog, CColorDialog ) - -bool CMyColorDialog::c_NeedToInitCustColors = true; -COLORREF CMyColorDialog::c_CustColors[]; -COLORREF CMyColorDialog::c_LastCustColors[]; - -#define SECTION _T("Custom Colors") - -void CMyColorDialog::InitCustColors() { - for ( int i = 0; i < NCUSTCOLORS; i++) { - CString entry; - entry.Format( "tool_color%d", i); - idCVar *cvar = cvarSystem->Find( entry ); - if ( cvar ) { - c_LastCustColors[i] = c_CustColors[i] = cvar->GetInteger(); - } else { - c_LastCustColors[i] = c_CustColors[i] = RGB( 255, 255, 255 ); - } - } - c_NeedToInitCustColors= false; -} - -void CMyColorDialog::SaveCustColors() { - for (int i = 0; i < NCUSTCOLORS; i++) { - if ( c_LastCustColors[i] != c_CustColors[i] ) { - CString entry; - entry.Format( "tool_color%d", i ); - if ( c_CustColors[i] == RGB( 255, 255, 255 ) ) { - cvarSystem->SetCVarString( entry, "" ); - } else { - cvarSystem->SetCVarString( entry, va( "%d", c_CustColors[i] ), CVAR_TOOL ); - } - c_LastCustColors[i] = c_CustColors[i]; - } - } -} - -CMyColorDialog::CMyColorDialog( COLORREF clrInit, DWORD dwFlags, - CWnd* pParentWnd) : CColorDialog(clrInit,dwFlags,pParentWnd) -{ - //{{AFX_DATA_INIT(CMyColorDialog) - //}}AFX_DATA_INIT - if (c_NeedToInitCustColors) { - InitCustColors(); - } - m_cc.lpCustColors = c_CustColors; -} - -INT_PTR CMyColorDialog::DoModal() { - int code = CColorDialog::DoModal(); - SaveCustColors(); - return code; -} - -void CMyColorDialog::DoDataExchange(CDataExchange* pDX) { - // overridden (calls this base class) - CColorDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CMyColorDialog) - //}}AFX_DATA_MAP -} - -BEGIN_MESSAGE_MAP(CMyColorDialog, CColorDialog) -//{{AFX_MSG_MAP(CMyColorDialog) -//}}AFX_MSG_MAP -END_MESSAGE_MAP() - -COLORREF DoOldColor(COLORREF cr) { - CMyColorDialog dlg(cr, CC_FULLOPEN | CC_RGBINIT | CC_ANYCOLOR); - if (dlg.DoModal() == IDOK) { - return dlg.GetColor(); - } - return cr; -} - -// New color picker - // Original ColorPicker/DIB source by Rajiv Ramachandran // included with Permission from the author @@ -504,7 +388,6 @@ BEGIN_MESSAGE_MAP(CDialogColorPicker, CDialog) ON_EN_CHANGE(IDC_EDIT_SAT, OnChangeEditSat) ON_EN_CHANGE(IDC_EDIT_VAL, OnChangeEditVal) ON_EN_CHANGE(IDC_EDIT_OVERBRIGHT, OnChangeEditOverbright) - ON_BN_CLICKED(IDC_BTN_OLDCOLOR, OnBtnColor) ON_WM_TIMER() //}}AFX_MSG_MAP END_MESSAGE_MAP() @@ -1287,16 +1170,7 @@ void CDialogColorPicker::OnTimer(UINT_PTR nIDEvent) { } } -void CDialogColorPicker::OnBtnColor() { - COLORREF cr = DoOldColor(GetColor()); - color.r = GetRValue(cr); - color.g = GetGValue(cr); - color.b = GetBValue(cr); - hsvColor = color.toHSV(); - DrawAll(); -} - -bool DoNewColor( int* i1, int* i2, int* i3, float *overBright, void (*Update)( float, float, float, float ) ) { +bool DoColor( int* i1, int* i2, int* i3, float *overBright, void (*Update)( float, float, float, float ) ) { COLORREF cr = (*i1) + ((*i2) <<8) + ((*i3) <<16); CDialogColorPicker dlg( cr ); //CMyColorDialog dlg(cr, CC_FULLOPEN | CC_RGBINIT | CC_ANYCOLOR); diff --git a/neo/tools/comafx/DialogColorPicker.h b/neo/tools/comafx/DialogColorPicker.h index c18173b..37ba889 100644 --- a/neo/tools/comafx/DialogColorPicker.h +++ b/neo/tools/comafx/DialogColorPicker.h @@ -113,7 +113,6 @@ class CDialogColorPicker : public CDialog afx_msg void OnChangeEditVal(); afx_msg void OnChangeEditOverbright(); afx_msg void OnTimer(UINT_PTR nIDEvent); - afx_msg void OnBtnColor(); //}}AFX_MSG DECLARE_MESSAGE_MAP() @@ -188,6 +187,6 @@ class CDialogColorPicker : public CDialog float overBright; }; -bool DoNewColor( int* i1, int* i2, int* i3, float *overBright, void (*Update)( float, float, float, float ) = NULL ); +bool DoColor( int* i1, int* i2, int* i3, float *overBright, void (*Update)( float, float, float, float ) = NULL ); #endif /* !__DIALOGCOLORPICKER__ */ diff --git a/neo/tools/radiant/GLWidget.cpp b/neo/tools/common/GLWidget.cpp similarity index 99% rename from neo/tools/radiant/GLWidget.cpp rename to neo/tools/common/GLWidget.cpp index 01e4818..2c74206 100644 --- a/neo/tools/radiant/GLWidget.cpp +++ b/neo/tools/common/GLWidget.cpp @@ -29,9 +29,9 @@ If you have questions concerning this license or the applicable additional terms #include "precompiled.h" #pragma hdrstop -#include "qe3.h" -#include "Radiant.h" -#include "GLWidget.h" +#include "../radiant/QE3.H" +#include "../radiant/Radiant.h" +#include "../common/GLWidget.h" #ifdef _DEBUG #define new DEBUG_NEW diff --git a/neo/tools/radiant/GLWidget.h b/neo/tools/common/GLWidget.h similarity index 100% rename from neo/tools/radiant/GLWidget.h rename to neo/tools/common/GLWidget.h diff --git a/neo/tools/common/OpenFileDialog.cpp b/neo/tools/common/OpenFileDialog.cpp deleted file mode 100644 index 6c87bb1..0000000 --- a/neo/tools/common/OpenFileDialog.cpp +++ /dev/null @@ -1,505 +0,0 @@ -/* -=========================================================================== - -Doom 3 GPL Source Code -Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. - -This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code"). - -Doom 3 Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 Source Code. If not, see . - -In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#include "precompiled.h" -#pragma hdrstop - -#include "../../sys/win32/win_local.h" -#include "../../sys/win32/rc/resource.h" -#include "OpenFileDialog.h" - -char rvOpenFileDialog::mLookin[ MAX_OSPATH ]; - -/* -================ -rvOpenFileDialog::rvOpenFileDialog - -constructor -================ -*/ -rvOpenFileDialog::rvOpenFileDialog( void ) -{ - mWnd = NULL; - mInstance = NULL; - mBackBitmap = NULL; - mImageList = NULL; - mFlags = 0; -} - -/* -================ -rvOpenFileDialog::~rvOpenFileDialog - -destructor -================ -*/ -rvOpenFileDialog::~rvOpenFileDialog ( void ) -{ - if ( mImageList ) - { - ImageList_Destroy ( mImageList ); - } - - if ( mBackBitmap ) - { - DeleteObject ( mBackBitmap ); - } -} - -/* -================ -rvOpenFileDialog::DoModal - -Opens the dialog and returns true if a filename was found -================ -*/ -bool rvOpenFileDialog::DoModal ( HWND parent ) -{ - mInstance = win32.hInstance; - - INITCOMMONCONTROLSEX ex; - ex.dwICC = ICC_USEREX_CLASSES | ICC_LISTVIEW_CLASSES; - ex.dwSize = sizeof(INITCOMMONCONTROLSEX); - - InitCommonControlsEx ( &ex ); - - return DialogBoxParam ( mInstance, MAKEINTRESOURCE(IDD_TOOLS_OPEN), parent, DlgProc, (LPARAM)this ) ? true : false; -} - -/* -================ -rvOpenFileDialog::UpdateLookIn - -Updates the lookin combo box with the current lookin state -================ -*/ -void rvOpenFileDialog::UpdateLookIn ( void ) -{ - COMBOBOXEXITEM item; - idStr file; - idStr path; - - // Reset the combo box - SendMessage ( mWndLookin, CB_RESETCONTENT, 0, 0 ); - - // Setup the common item structure components - ZeroMemory ( &item, sizeof(item) ); - item.mask = CBEIF_TEXT | CBEIF_INDENT | CBEIF_IMAGE | CBEIF_SELECTEDIMAGE; - - // Add the top left folder - item.pszText = (LPSTR)BASE_GAMEDIR; - SendMessage ( mWndLookin, CBEM_INSERTITEM, 0, (LPARAM)&item ); - - // Break the lookin path up into its individual components and add them - // to the combo box - path = mLookin; - - while ( path.Length ( ) ) - { - int slash = path.Find ( "/" ); - - // Parse out the next subfolder - if ( slash != -1 ) - { - file = path.Left ( slash ); - path = path.Right ( path.Length ( ) - slash - 1 ); - } - else - { - file = path; - path.Empty ( ); - } - - // Add the sub folder - item.pszText = (LPSTR)file.c_str(); - item.iIndent++; - item.iItem = item.iIndent; - SendMessage ( mWndLookin, CBEM_INSERTITEM, 0, (LPARAM)&item ); - } - - // Set the selection to the last one since thats the deepest folder - SendMessage ( mWndLookin, CB_SETCURSEL, item.iIndent, 0 ); -} - -/* -================ -rvOpenFileDialog::UpdateFileList - -Updates the file list with the files that match the filter in the current -look in directory -================ -*/ -void rvOpenFileDialog::UpdateFileList ( void ) -{ - const char *basepath = mLookin; - idFileList *files; - HWND list = GetDlgItem ( mWnd, IDC_TOOLS_FILELIST ); - int i; - int filter; - - ListView_DeleteAllItems ( list ); - - // Add all the folders first - files = fileSystem->ListFiles ( basepath, "/", true ); - for ( i = 0; i < files->GetNumFiles(); i ++ ) - { - if ( files->GetFile( i )[0] == '.' ) - { - continue; - } - - LVITEM item; - item.mask = LVIF_TEXT; - item.iItem = ListView_GetItemCount ( list ); - item.pszText = (LPSTR)files->GetFile( i ); - item.iSubItem = 0; - ListView_InsertItem ( list, &item ); - } - fileSystem->FreeFileList( files ); - - // Add all the files in the current lookin directory that match the - // current filters. - for ( filter = 0; filter < mFilters.Num(); filter ++ ) - { - files = fileSystem->ListFiles( basepath, mFilters[filter], true ); - for ( i = 0; i < files->GetNumFiles(); i ++ ) - { - if ( files->GetFile( i )[0] == '.' ) - { - continue; - } - - LVITEM item; - item.mask = LVIF_TEXT|LVIF_IMAGE; - item.iImage = 2; - item.iItem = ListView_GetItemCount( list ); - item.pszText = (LPSTR)files->GetFile( i ); - item.iSubItem = 0; - ListView_InsertItem ( list, &item ); - } - fileSystem->FreeFileList( files ); - } -} - -/* -================ -rvOpenFileDialog::HandleCommandOK - -Handles the pressing of the OK button but either opening a selected folder -or closing the dialog with the resulting filename -================ -*/ -void rvOpenFileDialog::HandleCommandOK ( void ) -{ - char temp[256]; - LVITEM item; - - // If nothing is selected then there is nothing to open - int sel = ListView_GetNextItem ( mWndFileList, -1, LVNI_SELECTED ); - if ( sel == -1 ) - { - GetWindowText ( GetDlgItem ( mWnd, IDC_TOOLS_FILENAME ), temp, sizeof(temp)-1 ); - if ( !temp[0] ) - { - return; - } - - item.iImage = 2; - } - else - { - // Get the currently selected item - item.mask = LVIF_IMAGE|LVIF_TEXT; - item.iImage = sel; - item.iSubItem = 0; - item.pszText = temp; - item.cchTextMax = 256; - item.iItem = sel; - ListView_GetItem ( mWndFileList, &item ); - } - - // If the item is a folder then just open that folder - if ( item.iImage == 0 ) - { - if ( strlen( mLookin ) ) - { - idStr::snPrintf( mLookin, sizeof( mLookin ), "%s/%s", mLookin, temp ); - } else { - idStr::Copynz( mLookin, temp, sizeof( mLookin ) ); - } - UpdateLookIn ( ); - UpdateFileList ( ); - } - // If the item is a file then build the filename and end the dialog - else if ( item.iImage == 2 ) - { - mFilename = mLookin; - if ( mFilename.Length ( ) ) - { - mFilename.Append ( "/" ); - } - mFilename.Append ( temp ); - - // Make sure the file exists - if ( mFlags & OFD_MUSTEXIST ) - { - idFile* file; - file = fileSystem->OpenFileRead ( mFilename ); - if ( !file ) - { - MessageBox ( mWnd, va("%s\nFile not found.\nPlease verify the correct file name was given", mFilename.c_str() ), "Open", MB_ICONERROR|MB_OK ); - return; - } - fileSystem->CloseFile ( file ); - } - - EndDialog ( mWnd, 1 ); - } - - return; -} - -/* -================ -rvOpenFileDialog::HandleInitDialog - -Handles the init dialog message -================ -*/ -void rvOpenFileDialog::HandleInitDialog ( void ) -{ - // Cache the more used window handles - mWndFileList = GetDlgItem ( mWnd, IDC_TOOLS_FILELIST ); - mWndLookin = GetDlgItem ( mWnd, IDC_TOOLS_LOOKIN ); - - // Load the custom resources used by the controls - mImageList = ImageList_LoadBitmap ( mInstance, MAKEINTRESOURCE(IDB_TOOLS_OPEN),16,1,RGB(255,255,255) ); - mBackBitmap = (HBITMAP)LoadImage ( mInstance, MAKEINTRESOURCE(IDB_TOOLS_BACK), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR|LR_LOADMAP3DCOLORS ); - - // Attach the image list to the file list and lookin controls - ListView_SetImageList ( mWndFileList, mImageList, LVSIL_SMALL ); - SendMessage( mWndLookin,CBEM_SETIMAGELIST,0,(LPARAM) mImageList ); - - // Back button is a bitmap button - SendMessage( GetDlgItem ( mWnd, IDC_TOOLS_BACK ), BM_SETIMAGE, IMAGE_BITMAP, (LONG_PTR) mBackBitmap ); - - // Allow custom titles - SetWindowText ( mWnd, mTitle ); - - // Custom ok button title - if ( mOKTitle.Length ( ) ) - { - SetWindowText ( GetDlgItem ( mWnd, IDOK ), mOKTitle ); - } - - // See if there is a filename in the lookin - idStr temp; - idStr filename = mLookin; - filename.ExtractFileExtension ( temp ); - if ( temp.Length ( ) ) - { - filename.ExtractFileName ( temp ); - SetWindowText ( GetDlgItem ( mWnd, IDC_TOOLS_FILENAME ), temp ); - filename.StripFilename ( ); - idStr::snPrintf( mLookin, sizeof( mLookin ), "%s", filename.c_str() ); - } - - // Update our controls - UpdateLookIn ( ); - UpdateFileList ( ); -} - -/* -================ -rvOpenFileDialog::HandleLookInChange - -Handles a selection change within the lookin control -================ -*/ -void rvOpenFileDialog::HandleLookInChange ( void ) -{ - char temp[256]; - int sel; - int i; - idStr lookin; - - temp[0] = 0; - - sel = SendMessage ( mWndLookin, CB_GETCURSEL, 0, 0 ); - - // If something other than base is selected then walk up the list - // and build the new lookin path - if ( sel >= 1 ) - { - SendMessage ( mWndLookin, CB_GETLBTEXT, 1, (LPARAM)temp ); - idStr::snPrintf( mLookin, sizeof( mLookin ), "%s", temp ); - for ( i = 2; i <= sel; i ++ ) - { - SendMessage ( mWndLookin, CB_GETLBTEXT, i, (LPARAM)temp ); - idStr::snPrintf( mLookin, sizeof( mLookin ), "%s/%s", mLookin, temp ); - } - } - else - { - mLookin[0] = 0; - } - - // Update the controls with the new lookin path - UpdateLookIn ( ); - UpdateFileList ( ); -} - -/* -================ -rvOpenFileDialog::SetFilter - -Set the extensions available in the dialog -================ -*/ -void rvOpenFileDialog::SetFilter ( const char* s ) -{ - idStr filters = s; - idStr filter; - - while ( filters.Length ( ) ) - { - int semi = filters.Find ( ';' ); - if ( semi != -1 ) - { - filter = filters.Left ( semi ); - filters = filters.Right ( filters.Length ( ) - (semi + 1)); - filters.Strip(' '); - } - else - { - filter = filters; - filters.Empty ( ); - } - - mFilters.Append ( filter.c_str() + (filter[0] == '*' ? 1 : 0) ); - } -} - -/* -================ -rvOpenFileDialog::DlgProc - -Dialog Procedure for the open file dialog -================ -*/ -INT_PTR rvOpenFileDialog::DlgProc ( HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam ) -{ - rvOpenFileDialog* dlg = (rvOpenFileDialog*) GetWindowLongPtr ( wnd, GWLP_USERDATA ); - - switch ( msg ) - { - case WM_INITDIALOG: - dlg = (rvOpenFileDialog*) lparam; - SetWindowLongPtr ( wnd, GWLP_USERDATA, lparam ); - dlg->mWnd = wnd; - dlg->HandleInitDialog ( ); - return TRUE; - - case WM_NOTIFY: - { - NMHDR* nm = (NMHDR*) lparam; - switch ( nm->idFrom ) - { - case IDC_TOOLS_FILELIST: - switch ( nm->code ) - { - case LVN_ITEMCHANGED: - { - NMLISTVIEW* nmlv = (NMLISTVIEW*)nm; - if ( nmlv->uNewState & LVIS_SELECTED ) - { - // Get the currently selected item - LVITEM item; - char temp[256]; - item.mask = LVIF_IMAGE|LVIF_TEXT; - item.iSubItem = 0; - item.pszText = temp; - item.cchTextMax = sizeof(temp)-1; - item.iItem = nmlv->iItem; - ListView_GetItem ( dlg->mWndFileList, &item ); - - if ( item.iImage == 2 ) - { - SetWindowText ( GetDlgItem ( wnd, IDC_TOOLS_FILENAME ), temp ); - } - } - break; - } - - case NM_DBLCLK: - dlg->HandleCommandOK ( ); - break; - } - break; - } - break; - } - - case WM_COMMAND: - switch ( LOWORD ( wparam ) ) - { - case IDOK: - { - dlg->HandleCommandOK ( ); - break; - } - - case IDCANCEL: - EndDialog ( wnd, 0 ); - break; - - case IDC_TOOLS_BACK: - { - int sel = SendMessage ( GetDlgItem ( wnd, IDC_TOOLS_LOOKIN ), CB_GETCURSEL, 0, 0 ); - if ( sel > 0 ) - { - sel--; - SendMessage ( GetDlgItem ( wnd, IDC_TOOLS_LOOKIN ), CB_SETCURSEL, sel, 0 ); - dlg->HandleLookInChange ( ); - } - - break; - } - - case IDC_TOOLS_LOOKIN: - if ( HIWORD ( wparam ) == CBN_SELCHANGE ) - { - dlg->HandleLookInChange ( ); - } - break; - } - break; - } - - return FALSE; -} diff --git a/neo/tools/common/OpenFileDialog.h b/neo/tools/common/OpenFileDialog.h deleted file mode 100644 index 111cfff..0000000 --- a/neo/tools/common/OpenFileDialog.h +++ /dev/null @@ -1,117 +0,0 @@ -/* -=========================================================================== - -Doom 3 GPL Source Code -Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. - -This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code"). - -Doom 3 Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 Source Code. If not, see . - -In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ -#ifndef OPENFILEDIALOG_H_ -#define OPENFILEDIALOG_H_ - -#define OFD_MUSTEXIST 0x00000001 - -class rvOpenFileDialog -{ -public: - - rvOpenFileDialog ( void ); - ~rvOpenFileDialog ( void ); - - bool DoModal ( HWND parent ); - const char* GetFilename ( void ); - - void SetFilter ( const char* filter ); - void SetTitle ( const char* title ); - void SetOKTitle ( const char* title ); - void SetInitialPath ( const char* path ); - void SetFlags ( int flags ); - - const char* GetInitialPath ( void ); - -protected: - - void UpdateFileList ( void ); - void UpdateLookIn ( void ); - - HWND mWnd; - HWND mWndFileList; - HWND mWndLookin; - - HINSTANCE mInstance; - - HIMAGELIST mImageList; - HBITMAP mBackBitmap; - - static char mLookin[ MAX_OSPATH ]; - idStr mFilename; - idStr mTitle; - idStr mOKTitle; - idStrList mFilters; - - int mFlags; - -private: - - void HandleCommandOK ( void ); - void HandleLookInChange ( void ); - void HandleInitDialog ( void ); - - static INT_PTR CALLBACK DlgProc ( HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam ); -}; - -ID_INLINE const char* rvOpenFileDialog::GetFilename ( void ) -{ - return mFilename.c_str ( ); -} - -ID_INLINE void rvOpenFileDialog::SetTitle ( const char* title ) -{ - mTitle = title; -} - -ID_INLINE void rvOpenFileDialog::SetOKTitle ( const char* title ) -{ - mOKTitle = title; -} - -ID_INLINE void rvOpenFileDialog::SetInitialPath ( const char* path ) -{ - if ( !idStr::Cmpn( mLookin, path, strlen( path ) ) ) - { - return; - } - - idStr::Copynz( mLookin, path, sizeof( mLookin ) ); -} - -ID_INLINE void rvOpenFileDialog::SetFlags ( int flags ) -{ - mFlags = flags; -} - -ID_INLINE const char* rvOpenFileDialog::GetInitialPath ( void ) -{ - return mLookin; -} - -#endif // OPENFILEDIALOG_H_ diff --git a/neo/tools/common/RollupPanel.cpp b/neo/tools/common/RollupPanel.cpp deleted file mode 100644 index 4189451..0000000 --- a/neo/tools/common/RollupPanel.cpp +++ /dev/null @@ -1,1214 +0,0 @@ -/* -=========================================================================== - -Doom 3 GPL Source Code -Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. - -This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code"). - -Doom 3 Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 Source Code. If not, see . - -In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#include "precompiled.h" -#pragma hdrstop - -#include "../../sys/win32/win_local.h" -#include "RollupPanel.h" - -// Based on original code by Johann Nadalutti - -#define RP_PGBUTTONHEIGHT 18 -#define RP_SCROLLBARWIDTH 6 -#define RP_GRPBOXINDENT 6 -#define RP_SCROLLBARCOLOR RGB(150,180,180) -#define RP_ROLLCURSOR MAKEINTRESOURCE(32649) // see IDC_HAND (WINVER >= 0x0500) - -//Popup Menu Ids -#define RP_IDM_EXPANDALL 0x100 -#define RP_IDM_COLLAPSEALL 0x101 -#define RP_IDM_STARTITEMS 0x102 - -idList rvRollupPanel::mDialogs; -HHOOK rvRollupPanel::mDialogHook = NULL; - -#define DEFERPOS - -/* -================ -rvRollupPanel::rvRollupPanel - -constructor -================ -*/ -rvRollupPanel::rvRollupPanel ( void ) -{ - mStartYPos = 0; - mItemHeight = 0; - mWindow = NULL; -} - -/* -================ -rvRollupPanel::~rvRollupPanel - -destructor -================ -*/ -rvRollupPanel::~rvRollupPanel ( void ) -{ - // destroy the items - for ( ; mItems.Num(); ) - { - _RemoveItem ( 0 ); - } -} - -/* -================ -rvRollupPanel::Create - -Create the rollup panel window -================ -*/ -bool rvRollupPanel::Create ( DWORD dwStyle, const RECT& rect, HWND parent, unsigned int id ) -{ - WNDCLASSEX wndClass; - memset ( &wndClass, 0, sizeof(wndClass) ); - wndClass.cbSize = sizeof(WNDCLASSEX); - wndClass.lpszClassName = "ROLLUP_PANEL"; - wndClass.lpfnWndProc = WindowProc; - wndClass.hbrBackground = (HBRUSH)GetSysColorBrush ( COLOR_3DFACE ); - wndClass.hCursor = LoadCursor((HINSTANCE) NULL, IDC_ARROW); - wndClass.lpszMenuName = NULL; - wndClass.hInstance = win32.hInstance; - wndClass.style = CS_VREDRAW | CS_HREDRAW; - RegisterClassEx ( &wndClass ); - - mWindow = CreateWindowEx ( WS_EX_TOOLWINDOW, - "ROLLUP_PANEL", - "", - dwStyle|WS_CLIPSIBLINGS, - rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, - parent, - NULL, - win32.hInstance, - this ); - - if ( !mWindow ) - { - return false; - } - - return true; -} - -/* -================ -rvRollupPanel::InsertItem - -Insert and item into the rollup panel. Return -1 if an error occured -================ -*/ -int rvRollupPanel::InsertItem ( const char* caption, HWND dialog, bool autoDestroy, int index ) -{ - assert ( caption ); - assert ( dialog ); - - // -1 means add to the end - if ( index > 0 && index >= mItems.Num() ) - { - index = -1; - } - - // Get client rect - RECT r; - GetClientRect(mWindow,&r); - - // Create the GroupBox control - HWND groupbox = CreateWindow ( "BUTTON", "", WS_CHILD|BS_GROUPBOX, - r.left, r.top, r.right-r.left, r.bottom-r.top, - mWindow, 0, win32.hInstance, NULL ); - - // Create the expand button - HWND button = CreateWindow ( "BUTTON", caption, WS_CHILD|BS_AUTOCHECKBOX|BS_PUSHLIKE|BS_FLAT, - r.left, r.top, r.right-r.left, r.bottom-r.top, - mWindow, 0, win32.hInstance, NULL ); - - // Change the button's font - SendMessage ( button, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0 ); - - // Add item to the item list - RPITEM* item = new RPITEM; - item->mExpanded = false; - item->mEnable = true; - item->mDialog = dialog; - item->mButton = button; - item->mGroupBox = groupbox; - item->mOldDlgProc = (WNDPROC) GetWindowLongPtr ( dialog, DWLP_DLGPROC ); - item->mOldButtonProc = (WNDPROC) GetWindowLongPtr ( button, GWLP_WNDPROC ); - item->mAutoDestroy = autoDestroy; - strcpy ( item->mCaption, caption ); - - if ( index < 0 ) - { - index = mItems.Append ( item ); - } - else - { - mItems.Insert ( item, index ); - } - - // Store data with the dialog window in its user data - SetWindowLongPtr ( dialog, GWLP_USERDATA, (LONG_PTR)item ); - - // Attach item to button through user data - SetWindowLongPtr( button, GWLP_USERDATA, (LONG_PTR)item ); - SetWindowLongPtr( button, GWL_ID, index ); - - // Subclass dialog - SetWindowLongPtr( dialog, DWLP_DLGPROC, (LONG_PTR)DialogProc ); - - // SubClass button - SetWindowLongPtr( button, GWLP_WNDPROC, (LONG_PTR)ButtonProc ); - - // Update - mItemHeight += RP_PGBUTTONHEIGHT+(RP_GRPBOXINDENT/2); - RecallLayout ( ); - - // One hook for all panel dialogs - if ( !mDialogHook ) - { - mDialogHook = SetWindowsHookEx( WH_GETMESSAGE, GetMsgProc, NULL, GetCurrentThreadId() ); - } - - mDialogs.Append ( dialog ); - - return index; -} - -/* -================ -rvRollupPanel::RemoveItem - -Remove the item at the given index from the rollup panel -================ -*/ -void rvRollupPanel::RemoveItem ( int index ) -{ - // safety check - if ( index >= mItems.Num() || index < 0 ) - { - return; - } - - // remove the item - _RemoveItem( index ); - - // update the layout - RecallLayout ( ); -} - -/* -================ -rvRollupPanel::RemoveAllItems - -Remove all items from the control -================ -*/ -void rvRollupPanel::RemoveAllItems() -{ - for ( ; mItems.Num(); ) - { - _RemoveItem ( 0 ); - } - - // update layout - RecallLayout ( ); -} - -/* -================ -rvRollupPanel::_RemoveItem - -called by RemoveItem and RemoveAllItems methods to acutally remove the item -================ -*/ -void rvRollupPanel::_RemoveItem ( int index ) -{ - RPITEM* item = mItems[index]; - - // get the item rect - RECT ir; - GetWindowRect ( item->mDialog, &ir ); - - // update item height - mItemHeight -= RP_PGBUTTONHEIGHT+(RP_GRPBOXINDENT/2); - if ( item->mExpanded ) - { - mItemHeight -= (ir.bottom-ir.top); - } - - // destroy windows - if ( item->mButton ) - { - DestroyWindow ( item->mButton ); - } - if ( item->mGroupBox ) - { - DestroyWindow ( item->mGroupBox ); - } - if ( item->mDialog && item->mAutoDestroy ) - { - DestroyWindow ( item->mDialog ); - mDialogs.Remove ( item->mDialog ); - } - - if ( mDialogs.Num () <= 0 ) - { - UnhookWindowsHookEx( mDialogHook ); - mDialogHook = NULL; - } - - // finish up - mItems.RemoveIndex ( index ); - delete item; -} - -/* -================ -rvRollupPanel::ExpandItem - -expand or collapse the item at the given index -================ -*/ -void rvRollupPanel::ExpandItem( int index, bool expand ) -{ - // safety check - if ( index >= mItems.Num() || index < 0 ) - { - return; - } - - _ExpandItem ( mItems[index], expand ); - - RecallLayout ( ); - - // scroll to this page (automatic page visibility) - if ( expand ) - { - ScrollToItem ( index, false ); - } -} - -/* -================ -rvRollupPanel::ExpandItem - -expand or collapse the item at the given index -================ -*/ -void rvRollupPanel::ExpandAllItems( bool expand ) -{ - int i; - - // expand all items - for ( i=0; i < mItems.Num(); i ++ ) - { - _ExpandItem ( mItems[i], expand ); - } - - RecallLayout(); -} - -/* -================ -rvRollupPanel::ExpandItem - -expand or collapse the item at the given index -================ -*/ -void rvRollupPanel::_ExpandItem ( RPITEM* item, bool expand ) -{ - // check if we need to change state - if ( item->mExpanded == expand || !item->mEnable ) - { - return; - } - - RECT ir; - GetWindowRect ( item->mDialog, &ir ); - - // Expand-collapse - item->mExpanded = expand; - - if ( expand ) - { - mItemHeight += (ir.bottom - ir.top); - } - else - { - mItemHeight -= (ir.bottom - ir.top); - } -} - -/* -================ -rvRollupPanel::EnableItem - -enable/disable the item at the given index -================ -*/ -void rvRollupPanel::EnableItem ( int index, bool enable ) -{ - // safety check - if ( index >= mItems.Num() || index < 0 ) - { - return; - } - - _EnableItem ( mItems[index], enable ); - RecallLayout ( ); -} - -/* -================ -rvRollupPanel::EnableAllItems - -enable/disable all items in the panel -================ -*/ -void rvRollupPanel::EnableAllItems ( bool enable ) -{ - int i; - - for ( i=0; i < mItems.Num(); i++ ) - { - _EnableItem ( mItems[i], enable ); - } - - RecallLayout ( ); -} - -/* -================ -rvRollupPanel::_EnableItem - -Called by EnableItem and EnableAllItems to do the work of enabling/disablgin -the window -================ -*/ -void rvRollupPanel::_EnableItem ( RPITEM* item, bool enable ) -{ - // check if we need to change state - if ( item->mEnable == enable ) - { - return; - } - - RECT ir; - GetWindowRect ( item->mDialog, &ir ); - - item->mEnable = enable; - - if ( item->mExpanded ) - { - mItemHeight -= (ir.bottom-ir.top); - item->mExpanded = false; - } -} - -/* -================ -rvRollupPanel::ScrollToItem - -Scroll a page at the top of the Rollup Panel if top = true or just ensure -item visibility into view if top = false -================ -*/ -void rvRollupPanel::ScrollToItem ( int index, bool top ) -{ - // safety check - if ( index >= mItems.Num() || index < 0 ) - { - return; - } - - RPITEM* item = mItems[index]; - - // get rects - RECT r; - RECT ir; - GetWindowRect ( mWindow, &r ); - GetWindowRect ( item->mDialog, &ir ); - - // check page visibility - if ( top || ((ir.bottom > r.bottom) || (ir.top < r.top))) - { - // compute new mStartYPos - GetWindowRect( item->mButton, &ir ); - mStartYPos -= (ir.top-r.top); - - RecallLayout(); - } -} - -/* -================ -rvRollupPanel::MoveItemAt - -newIndex can be equal to -1 (move at end) -return -1 if an error occurs -================ -*/ -int rvRollupPanel::MoveItemAt ( int index, int newIndex ) -{ - if ( index == newIndex || index >= mItems.Num() || index < 0 ) - { - return -1; - } - - // remove page from its old position - RPITEM* item = mItems[index]; - mItems.RemoveIndex ( index ); - - // insert at its new position - if ( newIndex < 0 ) - { - index = mItems.Append( item ); - } - else - { - mItems.Insert ( item, newIndex ); - index = newIndex; - } - - RecallLayout ( ); - - return index; -} - -/* -================ -rvRollupPanel::RecallLayout - -Update the layout of the control based on current states -================ -*/ -void rvRollupPanel::RecallLayout ( void ) -{ - int bottomPagePos; - RECT r; - int posy; - int i; - - // check StartPosY - GetClientRect ( mWindow, &r ); - bottomPagePos = mStartYPos + mItemHeight; - - if ( bottomPagePos < r.bottom-r.top ) - { - mStartYPos = (r.bottom-r.top) - mItemHeight; - } - if ( mStartYPos > 0 ) - { - mStartYPos = 0; - } - - // update layout -#ifdef DEFERPOS - HDWP hdwp; - hdwp = BeginDeferWindowPos ( mItems.Num() * 3 ); -#endif - posy = mStartYPos; - - for ( i=0; i < mItems.Num(); i++ ) - { - RPITEM* item = mItems[i]; - - // enable / disable button - SendMessage ( item->mButton, BM_SETCHECK, (item->mEnable&item->mExpanded)?BST_CHECKED:BST_UNCHECKED, 0 ); - EnableWindow ( item->mButton, item->mEnable ); - - // Expanded - if ( item->mExpanded && item->mEnable ) - { - RECT ir; - GetWindowRect ( item->mDialog, &ir ); - - // update GroupBox position and size -#ifdef DEFERPOS - DeferWindowPos ( hdwp, -#else - SetWindowPos ( -#endif - item->mGroupBox, 0, 2, posy, - (r.right-r.left)-3-RP_SCROLLBARWIDTH, - (ir.bottom-ir.top)+RP_PGBUTTONHEIGHT+RP_GRPBOXINDENT-4, - SWP_NOZORDER|SWP_SHOWWINDOW); - - //Update Dialog position and size -#ifdef DEFERPOS - DeferWindowPos ( hdwp, -#else - SetWindowPos ( -#endif - item->mDialog, 0, RP_GRPBOXINDENT, posy+RP_PGBUTTONHEIGHT, - (r.right-r.left)-RP_SCROLLBARWIDTH-(RP_GRPBOXINDENT*2), - ir.bottom-ir.top, SWP_NOZORDER|SWP_SHOWWINDOW); - - //Update Button's position and size -#ifdef DEFERPOS - DeferWindowPos ( hdwp, -#else - SetWindowPos ( -#endif - item->mButton, 0, RP_GRPBOXINDENT, posy, - (r.right-r.left)-RP_SCROLLBARWIDTH-(RP_GRPBOXINDENT*2), - RP_PGBUTTONHEIGHT, SWP_NOZORDER|SWP_SHOWWINDOW); - - posy += (ir.bottom-ir.top) + RP_PGBUTTONHEIGHT; - } - // collapsed - else - { - // update GroupBox position and size -#ifdef DEFERPOS - DeferWindowPos ( hdwp, -#else - SetWindowPos ( -#endif - item->mGroupBox, 0, 2, posy, - (r.right-r.left)-3-RP_SCROLLBARWIDTH, 16, SWP_NOZORDER|SWP_SHOWWINDOW); - - // update Dialog position and size -#ifdef DEFERPOS - DeferWindowPos ( hdwp, -#else - SetWindowPos ( -#endif - item->mDialog, 0, RP_GRPBOXINDENT, 0, 0, 0,SWP_NOZORDER|SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE); - - // update Button's position and size -#ifdef DEFERPOS - DeferWindowPos ( hdwp, -#else - SetWindowPos ( -#endif - item->mButton, 0, RP_GRPBOXINDENT, posy, - (r.right-r.left)-RP_SCROLLBARWIDTH-(RP_GRPBOXINDENT*2), - RP_PGBUTTONHEIGHT, SWP_NOZORDER|SWP_SHOWWINDOW); - - posy += RP_PGBUTTONHEIGHT; - } - - posy += (RP_GRPBOXINDENT/2); - - } - -#ifdef DEFERPOS - EndDeferWindowPos ( hdwp ); -#endif - - // update Scroll Bar - RECT br; - SetRect ( &br, r.right-RP_SCROLLBARWIDTH,r.top,r.right,r.bottom); - InvalidateRect( mWindow, &br, FALSE ); - UpdateWindow ( mWindow ); -} - -/* -================ -rvRollupPanel::GetItemIndex - -Return -1 if no matching item was found, otherwise the index of the item -================ -*/ -int rvRollupPanel::GetItemIndex ( HWND wnd ) -{ - int i; - - //Search matching button's hwnd - for ( i=0; i < mItems.Num(); i++ ) - { - if ( wnd == mItems[i]->mButton ) - { - return i; - } - } - - return -1; -} - -int rvRollupPanel::GetItemIndex ( const char* caption ) -{ - int i; - - //Search matching button's hwnd - for ( i=0; i < mItems.Num(); i++ ) - { - if ( !idStr::Icmp ( caption, mItems[i]->mCaption ) ) - { - return i; - } - } - - return -1; -} - -/* -================ -rvRollupPanel::GetItem - -Return NULL if the index is invalid -================ -*/ -RPITEM* rvRollupPanel::GetItem ( int index ) -{ - // safety check - if ( index >= mItems.Num() || index < 0 ) - { - return NULL; - } - - return mItems[index]; -} - -/* -================ -rvRollupPanel::DialogProc - -Dialog procedure for items -================ -*/ -LRESULT CALLBACK rvRollupPanel::DialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - RPITEM* item = (RPITEM*)GetWindowLongPtr ( hWnd, GWLP_USERDATA ); - rvRollupPanel* _this = (rvRollupPanel*)GetWindowLongPtr( GetParent ( hWnd ), GWLP_USERDATA ); - - RECT r; - GetClientRect ( _this->mWindow, &r ); - - if ( _this->mItemHeight > r.bottom-r.top ) - { - switch (uMsg) - { - case WM_LBUTTONDOWN: - case WM_MBUTTONDOWN: - { - POINT pos; - GetCursorPos ( &pos ); - _this->mOldMouseYPos = pos.y; - ::SetCapture(hWnd); - return 0; - } - - case WM_LBUTTONUP: - case WM_MBUTTONUP: - { - if ( ::GetCapture() == hWnd ) - { - ::ReleaseCapture(); - return 0; - } - break; - } - - case WM_MOUSEMOVE: - if ( (::GetCapture() == hWnd) && (wParam==MK_LBUTTON || wParam==MK_MBUTTON)) - { - POINT pos; - GetCursorPos(&pos); - _this->mStartYPos += (pos.y-_this->mOldMouseYPos); - _this->RecallLayout(); - _this->mOldMouseYPos = pos.y; - InvalidateRect ( _this->mWindow, NULL, TRUE ); - return 0; - } - - break; - - case WM_SETCURSOR: - if ( (HWND)wParam == hWnd) - { - SetCursor ( LoadCursor (NULL, RP_ROLLCURSOR) ); - return TRUE; - } - break; - } - } - - return ::CallWindowProc ( item->mOldDlgProc, hWnd, uMsg, wParam, lParam ); -} - -/* -================ -rvRollupPanel::DialogProc - -Button procedure for items -================ -*/ -LRESULT CALLBACK rvRollupPanel::ButtonProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - if ( uMsg == WM_SETFOCUS ) - { - return FALSE; - } - - RPITEM* item = (RPITEM*)GetWindowLongPtr(hWnd, GWLP_USERDATA); - return ::CallWindowProc( item->mOldButtonProc, hWnd, uMsg, wParam, lParam ); -} - -/* -================ -rvRollupPanel::WindowProc - -Window procedure for rollup panel -================ -*/ -LRESULT CALLBACK rvRollupPanel::WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - rvRollupPanel* panel; - panel = (rvRollupPanel*)GetWindowLongPtr (hWnd, GWLP_USERDATA); - - switch ( uMsg ) - { - case WM_CREATE: - { - LPCREATESTRUCT cs; - - // Attach the class to the window first - cs = (LPCREATESTRUCT) lParam; - panel = (rvRollupPanel*) cs->lpCreateParams; - SetWindowLongPtr ( hWnd, GWLP_USERDATA, (LONG_PTR)panel ); - break; - } - - case WM_COMMAND: - panel->HandleCommand ( wParam, lParam ); - break; - - case WM_PAINT: - return panel->HandlePaint ( wParam, lParam ); - - case WM_SIZE: - return panel->HandleSize ( wParam, lParam ); - - case WM_LBUTTONDOWN: - panel->HandleLButtonDown ( wParam, lParam ); - break; - - case WM_LBUTTONUP: - panel->HandleLButtonUp ( wParam, lParam ); - break; - - case WM_MOUSEMOVE: - panel->HandleMouseMove ( wParam, lParam ); - break; - - case WM_MOUSEWHEEL: - panel->HandleMouseWheel ( wParam, lParam ); - break; - - case WM_MOUSEACTIVATE: - panel->HandleMouseActivate ( wParam, lParam ); - break; - - case WM_CONTEXTMENU: - return panel->HandleContextMenu ( wParam, lParam ); - } - - return DefWindowProc ( hWnd, uMsg, wParam, lParam ); -} - -/* -================ -rvRollupPanel::HandleCommand - -Handle the WM_COMMAND message -================ -*/ -int rvRollupPanel::HandleCommand ( WPARAM wParam, LPARAM lParam ) -{ - // popup menu command to expand or collapse pages - if ( LOWORD(wParam) == RP_IDM_EXPANDALL ) - { - ExpandAllItems ( true ); - } - else if ( LOWORD(wParam) == RP_IDM_COLLAPSEALL ) - { - ExpandAllItems ( false ); - } - - // popupMenu command to expand page - else if ( LOWORD(wParam) >= RP_IDM_STARTITEMS && - LOWORD(wParam) < RP_IDM_STARTITEMS + GetItemCount ( ) ) - { - int index = LOWORD(wParam)-RP_IDM_STARTITEMS; - ExpandItem ( index, !IsItemExpanded(index) ); - } - - // button command - else if ( HIWORD(wParam) == BN_CLICKED ) - { - int index = GetItemIndex ((HWND)lParam); - if ( index != -1 ) - { - ExpandItem ( index, !IsItemExpanded ( index ) ); - return 0; - } - } - - return 0; -} - -/* -================ -rvRollupPanel::HandlePaint - -Handle the WM_PAINT message -================ -*/ -int rvRollupPanel::HandlePaint( WPARAM wParam, LPARAM lParam ) -{ - HDC dc; - PAINTSTRUCT ps; - RECT r; - RECT br; - int sbPos; - int sbSize; - int clientHeight; - - dc = BeginPaint ( mWindow, &ps ); - - // scrollbar - GetClientRect ( mWindow, &r ); - SetRect ( &br, r.right-RP_SCROLLBARWIDTH, r.top, r.right, r.bottom ); - DrawEdge ( dc, &br, EDGE_RAISED, BF_RECT ); - - sbPos = 0; - sbSize = 0; - clientHeight = (r.bottom-r.top) - 4; - - if ( mItemHeight > (r.bottom-r.top) ) - { - sbSize = clientHeight - (((mItemHeight-(r.bottom-r.top)) * clientHeight ) / mItemHeight ); - sbPos = -(mStartYPos * clientHeight) / mItemHeight; - } - else - { - sbSize = clientHeight; - } - - br.left +=2; - br.right -=1; - br.top = sbPos+2; - br.bottom = br.top+sbSize; - - HBRUSH brush; - brush = CreateSolidBrush ( RP_SCROLLBARCOLOR ); - FillRect ( dc, &br, brush ); - DeleteObject ( brush ); - - SetRect ( &r, br.left,2,br.right,br.top ); - FillRect ( dc, &r, (HBRUSH)GetStockObject ( BLACK_BRUSH ) ); - - SetRect ( &r, br.left,br.bottom,br.right,2+clientHeight ); - FillRect ( dc, &r, (HBRUSH)GetStockObject ( BLACK_BRUSH ) ); - - return 0; -} - -/* -================ -rvRollupPanel::HandleSize - -Handle the WM_SIZE message -================ -*/ -int rvRollupPanel::HandleSize ( WPARAM wParam, LPARAM lParam ) -{ - DefWindowProc ( mWindow, WM_SIZE, wParam, lParam ); - RecallLayout(); - return 0; -} - -/* -================ -rvRollupPanel::HandleLButtonDown - -Handle the WM_LBUTTONDOWN message -================ -*/ -int rvRollupPanel::HandleLButtonDown ( WPARAM wParam, LPARAM lParam ) -{ - RECT r; - RECT br; - POINT point; - - GetClientRect ( mWindow, &r ); - if ( mItemHeight <= r.bottom - r.top ) - { - return 0; - } - - point.x = LOWORD(lParam); - point.y = HIWORD(lParam); - - SetRect ( &br, r.right - RP_SCROLLBARWIDTH, r.top, r.right, r.bottom ); - - if ( (wParam & MK_LBUTTON) && PtInRect ( &br, point ) ) - { - SetCapture( mWindow ); - - int clientHeight = (r.bottom-r.top) - 4; - - int sbSize = clientHeight - (((mItemHeight - (r.bottom-r.top)) * clientHeight) / mItemHeight ); - int sbPos = -(mStartYPos * clientHeight) / mItemHeight; - - // click inside scrollbar cursor - if ( (point.y < (sbPos + sbSize)) && (point.y > sbPos )) - { - mSBOffset = sbPos - point.y + 1; - } - // click outside scrollbar cursor (2 cases => above or below cursor) - else - { - int distup = point.y - sbPos; - int distdown = (sbPos + sbSize) - point.y; - - if ( distup < distdown ) - { - //above - mSBOffset = 0; - } - else - { - //below - mSBOffset = -sbSize; - } - } - - // calc new m_nStartYPos from mouse pos - int targetPos = point.y + mSBOffset; - mStartYPos =- (targetPos * mItemHeight) / clientHeight; - - // update - RecallLayout(); - } - - return 0; -} - -/* -================ -rvRollupPanel::HandleLButtonUp - -Handle the WM_LBUTTONUP message -================ -*/ -int rvRollupPanel::HandleLButtonUp ( WPARAM wParam, LPARAM lParam ) -{ - if ( GetCapture() == mWindow ) - { - ReleaseCapture(); - } - - return 0; -} - -/* -================ -rvRollupPanel::HandleMouseMove - -Handle the WM_MOUSEMOVE message -================ -*/ -int rvRollupPanel::HandleMouseMove ( WPARAM wParam, LPARAM lParam ) -{ - RECT r; - RECT br; - POINT point; - - GetClientRect ( mWindow, &r ); - if ( mItemHeight <= r.bottom - r.top ) - { - return 0; - } - - point.x = LOWORD(lParam); - point.y = HIWORD(lParam); - - SetRect ( &br, r.right - RP_SCROLLBARWIDTH, r.top, r.right, r.bottom ); - - if ( (wParam & MK_LBUTTON) && (GetCapture() == mWindow )) - { - // calc new m_nStartYPos from mouse pos - int clientHeight = (r.bottom-r.top) - 4; - int targetPos = point.y + mSBOffset; - - mStartYPos =- (targetPos * mItemHeight) / clientHeight; - - RecallLayout ( ); - - InvalidateRect ( mWindow, NULL, FALSE ); -// UpdateWindow ( mWindow ); - } - - return 0; -} - -/* -================ -rvRollupPanel::HandleMouseWheel - -Handle the WM_MOUSEWHEEL message -================ -*/ -int rvRollupPanel::HandleMouseWheel ( WPARAM wParam, LPARAM lParam ) -{ - // calc new m_nStartYPos - mStartYPos += (HIWORD(wParam) / 4); - - RecallLayout(); - - return 0; -} - -/* -================ -rvRollupPanel::HandleMouseActivate - -Handle the WM_MOUSEACTIVATE message -================ -*/ -int rvRollupPanel::HandleMouseActivate ( WPARAM wParam, LPARAM lParam ) -{ - SetFocus ( mWindow ); - return 0; -} - -/* -================ -rvRollupPanel::HandleContextMenu - -Handle the WM_CONTEXTMENU message -================ -*/ -int rvRollupPanel::HandleContextMenu ( WPARAM wParam, LPARAM lParam ) -{ - HMENU menu; - int i; - POINT point; - - menu = CreatePopupMenu ( ); - if ( !menu ) - { - return 0; - } - - point.x = LOWORD(lParam); - point.y = HIWORD(lParam); - - AppendMenu ( menu, MF_STRING, RP_IDM_EXPANDALL, "Expand all" ); - AppendMenu ( menu, MF_STRING, RP_IDM_COLLAPSEALL, "Collapse all" ); - AppendMenu ( menu, MF_SEPARATOR, 0, "" ); - - //Add all pages with checked style for expanded ones - for ( i=0; i < mItems.Num(); i++ ) - { - char itemName[1024]; - GetWindowText ( mItems[i]->mButton, itemName, 1023 ); - AppendMenu ( menu, MF_STRING, RP_IDM_STARTITEMS + i, itemName ); - - if ( mItems[i]->mExpanded ) - { - CheckMenuItem ( menu, RP_IDM_STARTITEMS + i, MF_CHECKED); - } - - TrackPopupMenu ( menu, TPM_LEFTALIGN|TPM_LEFTBUTTON, point.x, point.y, 0, mWindow, NULL ); - } - - return 0; -} - -/* -================ -rvRollupPanel::GetMsgProc - -Ensures normal dialog functions work in the alpha select dialog -================ -*/ -LRESULT FAR PASCAL rvRollupPanel::GetMsgProc ( int nCode, WPARAM wParam, LPARAM lParam ) -{ - LPMSG lpMsg = (LPMSG) lParam; - - if ( nCode >= 0 && PM_REMOVE == wParam ) - { - // Don't translate non-input events. - if ( (lpMsg->message >= WM_KEYFIRST && lpMsg->message <= WM_KEYLAST) ) - { - int i; - for ( i = 0; i < mDialogs.Num(); i ++ ) - { - if ( IsDialogMessage( mDialogs[i], lpMsg) ) - { - // The value returned from this hookproc is ignored, - // and it cannot be used to tell Windows the message has been handled. - // To avoid further processing, convert the message to WM_NULL - // before returning. - lpMsg->message = WM_NULL; - lpMsg->lParam = 0; - lpMsg->wParam = 0; - break; - } - } - } - } - - return CallNextHookEx ( mDialogHook, nCode, wParam, lParam); -} - -/* -================ -rvRollupPanel::AutoSize - -Automatically set the width of the control based on the dialogs it contains -================ -*/ -void rvRollupPanel::AutoSize ( void ) -{ - int i; - int width = 0; - for ( i = 0; i < mItems.Num(); i ++ ) - { - RECT r; - int w; - GetWindowRect ( mItems[i]->mDialog, &r ); - w = (r.right-r.left)+RP_SCROLLBARWIDTH+(RP_GRPBOXINDENT*2); - if ( w > width ) - { - width = w; - } - } - - RECT cr; - GetWindowRect ( mWindow, &cr ); - SetWindowPos ( mWindow, NULL, 0, 0, width, cr.bottom-cr.top, SWP_NOMOVE|SWP_NOZORDER ); -} diff --git a/neo/tools/common/RollupPanel.h b/neo/tools/common/RollupPanel.h deleted file mode 100644 index 1a754ab..0000000 --- a/neo/tools/common/RollupPanel.h +++ /dev/null @@ -1,146 +0,0 @@ -/* -=========================================================================== - -Doom 3 GPL Source Code -Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. - -This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code"). - -Doom 3 Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 Source Code. If not, see . - -In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#ifndef ROLLUPPANEL_H_ -#define ROLLUPPANEL_H_ - -#define RPITEM_MAX_NAME 64 - -struct RPITEM -{ - HWND mDialog; - HWND mButton; - HWND mGroupBox; - bool mExpanded; - bool mEnable; - bool mAutoDestroy; - WNDPROC mOldDlgProc; - WNDPROC mOldButtonProc; - char mCaption[RPITEM_MAX_NAME]; -}; - -class rvRollupPanel -{ -public: - - rvRollupPanel ( void ); - virtual ~rvRollupPanel ( void ); - - bool Create ( DWORD dwStyle, const RECT& rect, HWND parent, unsigned int id ); - - int InsertItem ( const char* caption, HWND dialog, bool autoDestroy, int index = -1); - - void RemoveItem ( int index ); - void RemoveAllItems ( void ); - - void ExpandItem ( int index, bool expand = true ); - void ExpandAllItems ( bool expand = true ); - - void EnableItem ( int index, bool enabled = true ); - void EnableAllItems ( bool enable = true ); - - int GetItemCount ( void ); - - RPITEM* GetItem ( int index ); - - int GetItemIndex ( const char* caption ); - int GetItemIndex ( HWND hwnd ); - - void ScrollToItem ( int index, bool top = true ); - int MoveItemAt ( int index, int newIndex ); - bool IsItemExpanded ( int index ); - bool IsItemEnabled ( int index ); - - HWND GetWindow ( void ); - - void AutoSize ( void ); - -protected: - - void RecallLayout ( void ); - void _RemoveItem ( int index ); - void _ExpandItem ( RPITEM* item, bool expand ); - void _EnableItem ( RPITEM* item, bool enable ); - - int HandleCommand ( WPARAM wParam, LPARAM lParam ); - int HandlePaint ( WPARAM wParam, LPARAM lParam ); - int HandleSize ( WPARAM wParam, LPARAM lParam ); - int HandleLButtonDown ( WPARAM wParam, LPARAM lParam ); - int HandleLButtonUp ( WPARAM wParam, LPARAM lParam ); - int HandleMouseMove ( WPARAM wParam, LPARAM lParam ); - int HandleMouseWheel ( WPARAM wParam, LPARAM lParam ); - int HandleMouseActivate ( WPARAM wParam, LPARAM lParam ); - int HandleContextMenu ( WPARAM wParam, LPARAM lParam ); - - // Datas - idList mItems; - int mStartYPos; - int mItemHeight; - int mOldMouseYPos; - int mSBOffset; - HWND mWindow; - - // Window proc - static LRESULT CALLBACK WindowProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); - static LRESULT CALLBACK DialogProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); - static LRESULT CALLBACK ButtonProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); - - static LRESULT FAR PASCAL GetMsgProc ( int nCode, WPARAM wParam, LPARAM lParam ); - static idList mDialogs; - static HHOOK mDialogHook; -}; - -ID_INLINE int rvRollupPanel::GetItemCount ( void ) -{ - return mItems.Num(); -} - -ID_INLINE bool rvRollupPanel::IsItemExpanded ( int index ) -{ - if ( index >= mItems.Num() || index < 0 ) - { - return false; - } - return mItems[index]->mExpanded; -} - -ID_INLINE bool rvRollupPanel::IsItemEnabled( int index ) -{ - if ( index >= mItems.Num() || index < 0 ) - { - return false; - } - return mItems[index]->mEnable; -} - -ID_INLINE HWND rvRollupPanel::GetWindow ( void ) -{ - return mWindow; -} - -#endif // ROLLUPPANEL_H_ diff --git a/neo/tools/common/SpinButton.cpp b/neo/tools/common/SpinButton.cpp deleted file mode 100644 index ef700b8..0000000 --- a/neo/tools/common/SpinButton.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* -=========================================================================== - -Doom 3 GPL Source Code -Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. - -This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code"). - -Doom 3 Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 Source Code. If not, see . - -In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#include "precompiled.h" -#pragma hdrstop - -#include "SpinButton.h" - -void SpinButton_SetIncrement ( HWND hWnd, float inc ) -{ - SetWindowLongPtr ( hWnd, GWLP_USERDATA, (long)(inc * 100.0f) ); -} - -void SpinButton_SetRange ( HWND hWnd, float minRange, float maxRange ) -{ - SendMessage ( hWnd, UDM_SETRANGE32, (LONG)(minRange*100.0f), (LONG)(maxRange*100.0f) ); -} - -void SpinButton_HandleNotify ( NMHDR* hdr ) -{ - // Return if incorrect data in edit box - NM_UPDOWN* udhdr= (NM_UPDOWN*)hdr; - - // Change with 0.1 on each click - char strValue[64]; - float value; - GetWindowText ( (HWND)SendMessage ( hdr->hwndFrom, UDM_GETBUDDY, 0, 0 ), strValue, 63 ); - - float inc = (float)GetWindowLongPtr ( hdr->hwndFrom, GWLP_USERDATA ); - if ( inc == 0 ) - { - inc = 100.0f; - SetWindowLongPtr ( hdr->hwndFrom, GWLP_USERDATA, 100 ); - } - inc /= 100.0f; - - if ( GetAsyncKeyState ( VK_SHIFT ) & 0x8000 ) - { - inc *= 10.0f; - } - - value = atof(strValue); - value += (udhdr->iDelta)*(inc); - - // Avoid round-off errors - value = floor(value*1e3+0.5)/1e3; - - LONG minRange; - LONG maxRange; - SendMessage ( hdr->hwndFrom, UDM_GETRANGE32, (LONG_PTR)&minRange, (LONG_PTR)&maxRange ); - if ( minRange != 0 || maxRange != 0 ) - { - float minRangef = (float)(long)minRange / 100.0f; - float maxRangef = (float)maxRange / 100.0f; - if ( value > maxRangef ) - { - value = maxRangef; - } - if ( value < minRangef ) - { - value = minRangef; - } - } - - SetWindowText ( (HWND)SendMessage ( hdr->hwndFrom, UDM_GETBUDDY, 0, 0 ), va("%g",value) ); -} diff --git a/neo/tools/common/SpinButton.h b/neo/tools/common/SpinButton.h deleted file mode 100644 index 8f174b5..0000000 --- a/neo/tools/common/SpinButton.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -=========================================================================== - -Doom 3 GPL Source Code -Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. - -This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code"). - -Doom 3 Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 Source Code. If not, see . - -In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#ifndef SPINBUTTON_H_ -#define SPINBUTTON_H_ - -void SpinButton_SetIncrement ( HWND hWnd, float inc ); -void SpinButton_HandleNotify ( NMHDR* hdr ); -void SpinButton_SetRange ( HWND hWnd, float min, float max ); - -#endif // SPINBUTOTN_H_ diff --git a/neo/tools/debugger/DebuggerWindow.cpp b/neo/tools/debugger/DebuggerWindow.cpp index ee47bb8..8b33f08 100644 --- a/neo/tools/debugger/DebuggerWindow.cpp +++ b/neo/tools/debugger/DebuggerWindow.cpp @@ -32,7 +32,6 @@ If you have questions concerning this license or the applicable additional terms #include "../../sys/win32/rc/resource.h" #include "DebuggerApp.h" -#include "../Common/OpenFileDialog.h" #include "../Common/AboutBoxDlg.h" #include "DebuggerQuickWatchDlg.h" #include "DebuggerFindDlg.h" @@ -1391,16 +1390,25 @@ int rvDebuggerWindow::HandleCommand ( WPARAM wparam, LPARAM lparam ) case ID_DBG_FILE_OPEN: { - rvOpenFileDialog dlg; - dlg.SetTitle ( "Open Script" ); - dlg.SetFilter ( "*.script; *.gui; *.state" ); - dlg.SetFlags ( OFD_MUSTEXIST ); - if ( dlg.DoModal ( mWnd ) ) - { - if ( !OpenScript ( dlg.GetFilename ( ) ) ) - { - MessageBox ( mWnd, va("Failed to open script '%s'",dlg.GetFilename ( )), "Quake 4 Script Debugger", MB_OK ); - } + OPENFILENAME ofn; + char szFile[MAX_PATH] = ""; + + // Initialize OPENFILENAME + ZeroMemory(&ofn, sizeof(OPENFILENAME)); + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = win32.hWnd; + ofn.lpstrFile = szFile; + ofn.nMaxFile = sizeof(szFile); + ofn.lpstrFilter = "Game Script\0*.script\0All Files\0*.*\0"; + ofn.nFilterIndex = 1; + ofn.lpstrFileTitle = NULL; + ofn.nMaxFileTitle = 0; + ofn.lpstrInitialDir = NULL; + ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + + // Display the Open dialog box. + if ( GetOpenFileName( &ofn ) == TRUE ) { + OpenScript ( ofn.lpstrFile ); } break; } diff --git a/neo/tools/materialeditor/MaterialPreviewView.h b/neo/tools/materialeditor/MaterialPreviewView.h index d567b78..c3d73de 100644 --- a/neo/tools/materialeditor/MaterialPreviewView.h +++ b/neo/tools/materialeditor/MaterialPreviewView.h @@ -28,7 +28,7 @@ If you have questions concerning this license or the applicable additional terms #pragma once #include "MaterialView.h" -#include "../radiant/GLWidget.h" +#include "../common/GLWidget.h" class idGLDrawableView : public idGLDrawable { diff --git a/neo/tools/particle/DialogParticleEditor.cpp b/neo/tools/particle/DialogParticleEditor.cpp index eb49bdb..a338ae4 100644 --- a/neo/tools/particle/DialogParticleEditor.cpp +++ b/neo/tools/particle/DialogParticleEditor.cpp @@ -34,7 +34,7 @@ If you have questions concerning this license or the applicable additional terms #include "../comafx/DialogName.h" #include "../comafx/VectorCtl.h" #include "../comafx/DialogColorPicker.h" -#include "../radiant/GLWidget.h" +#include "../common/GLWidget.h" #include "../radiant/PreviewDlg.h" #include "DialogParticleEditor.h" @@ -459,7 +459,7 @@ void CDialogParticleEditor::OnBnClickedButtonBrowsecolor() { g = ps->color.y * 255.0f; b = ps->color.z * 255.0f; ob = 1.0f; - if ( DoNewColor( &r, &g, &b, &ob ) ) { + if ( DoColor( &r, &g, &b, &ob ) ) { color.Format( "%f %f %f %f", (float)r / 255.0f, (float)g / 255.0f, (float)b / 255.0f, 1.0f ); DlgVarsToCurStage(); CurStageToDlgVars(); @@ -484,7 +484,7 @@ void CDialogParticleEditor::OnBnClickedButtonBrowseEntitycolor() { g = clr.y * 255.0f; b = clr.z * 255.0f; ob = 1.0f; - if ( DoNewColor( &r, &g, &b, &ob ) ) { + if ( DoColor( &r, &g, &b, &ob ) ) { for ( int i = 0; i < count; i++ ) { dict = gameEdit->EntityGetSpawnArgs( list[i] ); const char *name = dict->GetString( "name" ); @@ -519,7 +519,7 @@ void CDialogParticleEditor::OnBnClickedButtonBrowsefadecolor() { g = ps->fadeColor.y * 255.0f; b = ps->fadeColor.z * 255.0f; ob = 1.0f; - if ( DoNewColor( &r, &g, &b, &ob ) ) { + if ( DoColor( &r, &g, &b, &ob ) ) { fadeColor.Format( "%f %f %f %f", (float)r / 255.0f, (float)g / 255.0f, (float)b / 255.0f, 1.0f ); DlgVarsToCurStage(); CurStageToDlgVars(); diff --git a/neo/tools/radiant/autocaulk.cpp b/neo/tools/radiant/AutoCaulk.cpp similarity index 100% rename from neo/tools/radiant/autocaulk.cpp rename to neo/tools/radiant/AutoCaulk.cpp diff --git a/neo/tools/radiant/autocaulk.h b/neo/tools/radiant/AutoCaulk.h similarity index 100% rename from neo/tools/radiant/autocaulk.h rename to neo/tools/radiant/AutoCaulk.h diff --git a/neo/tools/radiant/cmdlib.cpp b/neo/tools/radiant/CMDLib.cpp similarity index 100% rename from neo/tools/radiant/cmdlib.cpp rename to neo/tools/radiant/CMDLib.cpp diff --git a/neo/tools/radiant/cmdlib.h b/neo/tools/radiant/CMDLib.h similarity index 100% rename from neo/tools/radiant/cmdlib.h rename to neo/tools/radiant/CMDLib.h diff --git a/neo/tools/radiant/CSG.CPP b/neo/tools/radiant/CSG.cpp similarity index 100% rename from neo/tools/radiant/CSG.CPP rename to neo/tools/radiant/CSG.cpp diff --git a/neo/tools/radiant/DialogTextures.h b/neo/tools/radiant/DialogTextures.h index b98fbbf..5a39b2a 100644 --- a/neo/tools/radiant/DialogTextures.h +++ b/neo/tools/radiant/DialogTextures.h @@ -32,7 +32,7 @@ If you have questions concerning this license or the applicable additional terms // #include -#include "GLWidget.h" +#include "../common/GLWidget.h" ///////////////////////////////////////////////////////////////////////////// // CDialogTextures dialog diff --git a/neo/tools/radiant/DRAG.CPP b/neo/tools/radiant/Drag.cpp similarity index 100% rename from neo/tools/radiant/DRAG.CPP rename to neo/tools/radiant/Drag.cpp diff --git a/neo/tools/radiant/ECLASS.CPP b/neo/tools/radiant/EClass.cpp similarity index 100% rename from neo/tools/radiant/ECLASS.CPP rename to neo/tools/radiant/EClass.cpp diff --git a/neo/tools/radiant/EditViewDlg.cpp b/neo/tools/radiant/EditViewDlg.cpp index a953d6a..36bad18 100644 --- a/neo/tools/radiant/EditViewDlg.cpp +++ b/neo/tools/radiant/EditViewDlg.cpp @@ -33,281 +33,279 @@ If you have questions concerning this license or the applicable additional terms #include "Radiant.h" #include "EditViewDlg.h" +#ifdef _DEBUG +#define new DEBUG_NEW +#endif -// CEditViewDlg dialog +IMPLEMENT_DYNAMIC( CEditViewDlg, CDialogEx ) -IMPLEMENT_DYNAMIC(CEditViewDlg, CDialog) -CEditViewDlg::CEditViewDlg(CWnd* pParent /*=NULL*/) - : CDialog(CEditViewDlg::IDD, pParent) -{ - findDlg = NULL; +CEditViewDlg::CEditViewDlg( CWnd *pParent ) + : CDialogEx( CEditViewDlg::IDD, pParent ), + findDlg( nullptr ) { } CEditViewDlg::~CEditViewDlg() { } -void CEditViewDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); - DDX_Control(pDX, IDC_EDIT_INFO, editInfo); +void CEditViewDlg::DoDataExchange( CDataExchange *pDX ) { + CDialog::DoDataExchange( pDX ); + DDX_Control( pDX, IDC_EDIT_INFO, editInfo ); } +static UINT FindDialogMessage = ::RegisterWindowMessage( FINDMSGSTRING ); -static UINT FindDialogMessage = ::RegisterWindowMessage(FINDMSGSTRING); - -BEGIN_MESSAGE_MAP(CEditViewDlg, CDialog) - ON_WM_SIZE() - ON_BN_CLICKED(IDC_BUTTON_OPEN, OnBnClickedButtonOpen) - ON_BN_CLICKED(IDC_BUTTON_SAVE, OnBnClickedButtonSave) - ON_WM_DESTROY() - ON_WM_TIMER() - ON_BN_CLICKED(IDC_BUTTON_GOTO, OnBnClickedButtonGoto) - ON_REGISTERED_MESSAGE(FindDialogMessage, OnFindDialogMessage) +BEGIN_MESSAGE_MAP( CEditViewDlg, CDialogEx ) + ON_WM_SIZE() + ON_BN_CLICKED( IDC_BUTTON_OPEN, &CEditViewDlg::OnBnClickedButtonOpen ) + ON_BN_CLICKED( IDC_BUTTON_SAVE, &CEditViewDlg::OnBnClickedButtonSave ) + ON_WM_DESTROY() + ON_WM_TIMER() + ON_BN_CLICKED( IDC_BUTTON_GOTO, &CEditViewDlg::OnBnClickedButtonGoto ) + ON_REGISTERED_MESSAGE( FindDialogMessage, &CEditViewDlg::OnFindDialogMessage ) END_MESSAGE_MAP() // CEditViewDlg message handlers -void CEditViewDlg::OnSize(UINT nType, int cx, int cy) { - CDialog::OnSize(nType, cx, cy); - - if (GetSafeHwnd() == NULL) { - return; - } - - float scaling_factor = Win_GetWindowScalingFactor(GetSafeHwnd()); - int s2 = int(2 * scaling_factor); - int s8 = int(8 * scaling_factor); - int s4 = int(4 * scaling_factor); - int s6 = int(6 * scaling_factor); - int s12 = int(12 * scaling_factor); - int s16 = int(16 * scaling_factor); - - CRect rect, crect; - GetClientRect(rect); - CWnd *wnd = GetDlgItem(IDC_BUTTON_OPEN); - if (wnd == NULL || (wnd && wnd->GetSafeHwnd() == NULL)) { - return; - } - wnd->GetWindowRect(crect); - wnd->SetWindowPos(NULL, 4, 4, crect.Width(), crect.Height(), SWP_SHOWWINDOW); - wnd = GetDlgItem(IDC_BUTTON_SAVE); - int left = 8 + crect.Width(); - wnd->SetWindowPos(NULL, left, 4, crect.Width(), crect.Height(), SWP_SHOWWINDOW); - wnd = GetDlgItem(IDOK); - wnd->SetWindowPos(NULL, rect.Width() - crect.Width() - 4, 4, crect.Width(), crect.Height(), SWP_SHOWWINDOW); - editInfo.SetWindowPos(NULL, 4, 8 + crect.Height(), rect.Width() - 8, rect.Height() - crect.Height() * 2 - 16, SWP_SHOWWINDOW); - wnd = GetDlgItem(IDC_BUTTON_GOTO); - wnd->SetWindowPos(NULL, 4, rect.Height() - 4 - crect.Height(), crect.Width(), crect.Height(), SWP_SHOWWINDOW); - wnd = GetDlgItem(IDC_EDIT_GOTO); - wnd->SetWindowPos(NULL, 8 + crect.Width(), rect.Height() - 3 - crect.Height(), crect.Width() + 8, crect.Height() - 3, SWP_SHOWWINDOW); - wnd = GetDlgItem(IDC_STATIC_LINE); - wnd->SetWindowPos(NULL, 30 + crect.Width() * 2, rect.Height() - crect.Height(), crect.Width() * 2, crect.Height(), SWP_SHOWWINDOW); - wnd = GetDlgItem(IDC_EDIT_LINE); - wnd->SetWindowPos(NULL, 40 + crect.Width() * 3, rect.Height() - crect.Height(), crect.Width() + 8, crect.Height(), SWP_SHOWWINDOW); +void CEditViewDlg::OnSize( UINT nType, int cx, int cy ) { + CDialogEx::OnSize( nType, cx, cy ); + + if ( GetSafeHwnd() == NULL ) { + return; + } + + float scaling_factor = Win_GetWindowScalingFactor( GetSafeHwnd() ); + int s2 = int( 2 * scaling_factor ); + int s8 = int( 8 * scaling_factor ); + int s4 = int( 4 * scaling_factor ); + int s6 = int( 6 * scaling_factor ); + int s12 = int( 12 * scaling_factor ); + int s16 = int( 16 * scaling_factor ); + + CRect rect, crect; + GetClientRect( rect ); + CWnd *wnd = GetDlgItem( IDC_BUTTON_OPEN ); + if ( wnd == NULL || ( wnd && wnd->GetSafeHwnd() == NULL ) ) { + return; + } + wnd->GetWindowRect( crect ); + wnd->SetWindowPos( NULL, 4, 4, crect.Width(), crect.Height(), SWP_SHOWWINDOW ); + wnd = GetDlgItem( IDC_BUTTON_SAVE ); + int left = 8 + crect.Width(); + wnd->SetWindowPos( NULL, left, 4, crect.Width(), crect.Height(), SWP_SHOWWINDOW ); + wnd = GetDlgItem( IDOK ); + wnd->SetWindowPos( NULL, rect.Width() - crect.Width() - 4, 4, crect.Width(), crect.Height(), SWP_SHOWWINDOW ); + editInfo.SetWindowPos( NULL, 4, 8 + crect.Height(), rect.Width() - 8, rect.Height() - crect.Height() * 2 - 16, SWP_SHOWWINDOW ); + wnd = GetDlgItem( IDC_BUTTON_GOTO ); + wnd->SetWindowPos( NULL, 4, rect.Height() - 4 - crect.Height(), crect.Width(), crect.Height(), SWP_SHOWWINDOW ); + wnd = GetDlgItem( IDC_EDIT_GOTO ); + wnd->SetWindowPos( NULL, 8 + crect.Width(), rect.Height() - 3 - crect.Height(), crect.Width() + 8, crect.Height() - 3, SWP_SHOWWINDOW ); + wnd = GetDlgItem( IDC_STATIC_LINE ); + wnd->SetWindowPos( NULL, 30 + crect.Width() * 2, rect.Height() - crect.Height(), crect.Width() * 2, crect.Height(), SWP_SHOWWINDOW ); + wnd = GetDlgItem( IDC_EDIT_LINE ); + wnd->SetWindowPos( NULL, 40 + crect.Width() * 3, rect.Height() - crect.Height(), crect.Width() + 8, crect.Height(), SWP_SHOWWINDOW ); } void CEditViewDlg::ShowFindDlg() { - if (findDlg) { - return; - } - findDlg = new CFindReplaceDialog(); - findDlg->Create(TRUE, findStr, NULL, FR_DOWN, this); - + if ( findDlg ) { + return; + } + findDlg = new CFindReplaceDialog(); + findDlg->Create( TRUE, findStr, NULL, FR_DOWN, this ); } void CEditViewDlg::OnBnClickedButtonOpen() { - CPreviewDlg *dlg = NULL; - dlg = ((mode == MATERIALS) ? CEntityDlg::ShowMaterialChooser() : CEntityDlg::ShowGuiChooser()); - if (dlg) { - if (mode == MATERIALS) { - const idMaterial *mat = declManager->FindMaterial(dlg->mediaName); - SetMaterialInfo(mat->GetName(), mat->GetFileName(), mat->GetLineNum()); - } else { - SetGuiInfo(dlg->mediaName); - } - } + CPreviewDlg *dlg = nullptr; + dlg = ( ( mode == MATERIALS ) ? CEntityDlg::ShowMaterialChooser() : CEntityDlg::ShowGuiChooser() ); + if ( dlg ) { + if ( mode == MATERIALS ) { + const idMaterial* mat = declManager->FindMaterial( dlg->mediaName ); + SetMaterialInfo( mat->GetName(), mat->GetFileName(), mat->GetLineNum() ); + } else { + SetGuiInfo( dlg->mediaName ); + } + } } void CEditViewDlg::OnBnClickedButtonSave() { - if (fileName.Length()) { - CString text; - editInfo.GetWindowText(text); - fileSystem->WriteFile(fileName, text.GetBuffer(0), text.GetLength(), "fs_devpath"); - if (mode == MATERIALS) { - declManager->Reload( false ); - } else { - uiManager->Reload(false); - } - } + if ( fileName.Length() ) { + CString text; + editInfo.GetWindowText( text ); + fileSystem->WriteFile( fileName, text.GetBuffer( 0 ), text.GetLength(), "fs_devpath" ); + if ( mode == MATERIALS ) { + declManager->Reload( false ); + } else { + uiManager->Reload( false ); + } + } } void CEditViewDlg::UpdateEditPreview() { - if (GetSafeHwnd() && editInfo.GetSafeHwnd()) { - editInfo.SetWindowText(editText); - editInfo.LineScroll(line); - int cindex = editInfo.LineIndex(line); - int len = editInfo.LineLength(line); - editInfo.SetSel(cindex, cindex); - mediaPreview.SetMode((mode == MATERIALS) ? CMediaPreviewDlg::MATERIALS : CMediaPreviewDlg::GUIS); - mediaPreview.SetMedia((mode == MATERIALS) ? matName : fileName); - SetWindowText(va("Editing %s in file <%s>", (mode == MATERIALS) ? matName.c_str() : fileName.c_str(), fileName.c_str())); - editInfo.SetFocus(); - } + if ( GetSafeHwnd() && editInfo.GetSafeHwnd() ) { + editInfo.SetWindowText( editText ); + editInfo.LineScroll( line ); + int cindex = editInfo.LineIndex( line ); + int len = editInfo.LineLength( line ); + editInfo.SetSel( cindex, cindex ); + mediaPreview.SetMode( ( mode == MATERIALS ) ? CMediaPreviewDlg::MATERIALS : CMediaPreviewDlg::GUIS ); + mediaPreview.SetMedia( ( mode == MATERIALS ) ? matName : fileName ); + SetWindowText( va( "Editing %s in file <%s>", ( mode == MATERIALS ) ? matName.c_str() : fileName.c_str(), fileName.c_str() ) ); + editInfo.SetFocus(); + } } BOOL CEditViewDlg::OnInitDialog() { - CDialog::OnInitDialog(); + CDialogEx::OnInitDialog(); - mediaPreview.Create(IDD_DIALOG_EDITPREVIEW, this); - mediaPreview.ShowWindow(SW_SHOW); + mediaPreview.Create( IDD_DIALOG_EDITPREVIEW, this ); + mediaPreview.ShowWindow( SW_SHOW ); - CRect rct; - LONG lSize = sizeof(rct); - if (LoadRegistryInfo("Radiant::EditViewWindow", &rct, &lSize)) { - SetWindowPos(NULL, rct.left, rct.top, rct.Width(), rct.Height(), SWP_SHOWWINDOW); - } + CRect rct; + LONG lSize = sizeof( rct ); + if ( LoadRegistryInfo( "radiant_editviewwindow", &rct, &lSize ) ) { + SetWindowPos( nullptr, rct.left, rct.top, rct.Width(), rct.Height(), SWP_SHOWWINDOW ); + } - editInfo.SetTabStops(); - editInfo.SetLimitText(1024 * 1024); + editInfo.SetTabStops(); + editInfo.SetLimitText( 1024 * 1024 ); - UpdateEditPreview(); + UpdateEditPreview(); - SetTimer(1, 250, NULL); + SetTimer( 1, 250, nullptr ); - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE } void CEditViewDlg::OnDestroy() { - if (GetSafeHwnd()) { - CRect rct; - GetWindowRect(rct); - SaveRegistryInfo("Radiant::EditViewWindow", &rct, sizeof(rct)); - } + if ( GetSafeHwnd() ) { + CRect rct; + GetWindowRect( rct ); + SaveRegistryInfo( "radiant_editviewwindow", &rct, sizeof( rct ) ); + } - CDialog::OnDestroy(); + CDialogEx::OnDestroy(); } -void CEditViewDlg::SetMaterialInfo(const char *name, const char *file, int _line) { - idStr str; - void *buf; - fileName = ""; - matName = ""; - line = 0; - str = fileSystem->OSPathToRelativePath( file ); - int size = fileSystem->ReadFile( str, &buf ); - if (size > 0) { - fileName = str; - matName = name; - line = _line - 1; - if (line < 0) { - line = 0; - } - editText = (char*)buf; - fileSystem->FreeFile(buf); - } - UpdateEditPreview(); +void CEditViewDlg::SetMaterialInfo( const char *name, const char *file, int _line ) { + idStr str; + void* buf; + fileName = ""; + matName = ""; + line = 0; + str = fileSystem->OSPathToRelativePath( file ); + int size = fileSystem->ReadFile( str, &buf ); + if ( size > 0 ) { + fileName = str; + matName = name; + line = _line - 1; + if ( line < 0 ) { + line = 0; + } + editText = static_cast( buf ); + fileSystem->FreeFile( buf ); + } + UpdateEditPreview(); } -void CEditViewDlg::SetGuiInfo(const char *name) { - fileName = ""; - line = 0; - void *buf; - int size = fileSystem->ReadFile(name, &buf, NULL); - if (size > 0) { - fileName = name; - editText = (char*)buf; - fileSystem->FreeFile(buf); - } - UpdateEditPreview(); +void CEditViewDlg::SetGuiInfo( const char* name ) { + + fileName = ""; + line = 0; + void *buf; + int size = fileSystem->ReadFile( name, &buf, nullptr ); + if ( size > 0 ) { + fileName = name; + editText = static_cast( buf ); + fileSystem->FreeFile( buf ); + } + UpdateEditPreview(); } -void CEditViewDlg::OnTimer(UINT_PTR nIDEvent) { - CDialog::OnTimer(nIDEvent); - CWnd *wnd = GetDlgItem(IDC_EDIT_LINE); - if (wnd) { - int start, end; - editInfo.GetSel(start, end); - wnd->SetWindowText(va("%i",editInfo.LineFromChar(start))); - } - +void CEditViewDlg::OnTimer( UINT_PTR nIDEvent ) { + CDialogEx::OnTimer( nIDEvent ); + CWnd *wnd = GetDlgItem( IDC_EDIT_LINE ); + if ( wnd ) { + int start, end; + editInfo.GetSel( start, end ); + wnd->SetWindowText( va( "%i", editInfo.LineFromChar( start ) ) ); + } } void CEditViewDlg::OnBnClickedButtonGoto() { - CWnd *wnd = GetDlgItem(IDC_EDIT_GOTO); - if (wnd) { - CString str; - wnd->GetWindowText(str); - if (str.GetLength()) { - int l = atoi(str); - editInfo.SetSel(0, 0); - editInfo.LineScroll(l); - int cindex = editInfo.LineIndex(l); - int len = editInfo.LineLength(l); - editInfo.SetSel(cindex, cindex); - editInfo.RedrawWindow(); - editInfo.SetFocus(); - } - } + CWnd *wnd = GetDlgItem( IDC_EDIT_GOTO ); + if ( wnd ) { + CString str; + wnd->GetWindowText( str ); + if ( str.GetLength() ) { + int l = atoi( str ); + editInfo.SetSel( 0, 0 ); + editInfo.LineScroll( l ); + int cindex = editInfo.LineIndex( l ); + int len = editInfo.LineLength( l ); + editInfo.SetSel( cindex, cindex ); + editInfo.RedrawWindow(); + editInfo.SetFocus(); + } + } } -BOOL CEditViewDlg::PreTranslateMessage(MSG* pMsg) { - - if (pMsg->message == WM_KEYDOWN && (pMsg->wParam == 's' || pMsg->wParam == 'S') && GetAsyncKeyState(VK_CONTROL) & 0x8000) { - OnBnClickedButtonSave(); - return TRUE; - } - - if (pMsg->message == WM_KEYDOWN && (pMsg->wParam == 'o' || pMsg->wParam == 'O') && GetAsyncKeyState(VK_CONTROL) & 0x8000) { - OnBnClickedButtonOpen(); - return TRUE; - } - - if (pMsg->message == WM_KEYDOWN && (pMsg->wParam == 'f' || pMsg->wParam == 'F') && GetAsyncKeyState(VK_CONTROL) & 0x8000) { - ShowFindDlg(); - return TRUE; - } - - if (pMsg->hwnd == editInfo.GetSafeHwnd() && (pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_TAB)) { - // get the char index of the caret position - int nPos = LOWORD(editInfo.CharFromPos(editInfo.GetCaretPos())); - // select zero chars - editInfo.SetSel(nPos, nPos); - // then replace that selection with a TAB - editInfo.ReplaceSel("\t", TRUE); - return TRUE; - } - - return CDialog::PreTranslateMessage(pMsg); +BOOL CEditViewDlg::PreTranslateMessage( MSG *pMsg ) { + if ( pMsg->message == WM_KEYDOWN && ( pMsg->wParam == 's' || pMsg->wParam == 'S' ) && GetAsyncKeyState( VK_CONTROL ) & 0x8000 ) { + OnBnClickedButtonSave(); + return TRUE; + } + + if ( pMsg->message == WM_KEYDOWN && ( pMsg->wParam == 'o' || pMsg->wParam == 'O' ) && GetAsyncKeyState( VK_CONTROL ) & 0x8000 ) { + OnBnClickedButtonOpen(); + return TRUE; + } + + if ( pMsg->message == WM_KEYDOWN && ( pMsg->wParam == 'f' || pMsg->wParam == 'F' ) && GetAsyncKeyState( VK_CONTROL ) & 0x8000 ) { + ShowFindDlg(); + return TRUE; + } + + if ( pMsg->hwnd == editInfo.GetSafeHwnd() && ( pMsg->message == WM_KEYDOWN ) && ( pMsg->wParam == VK_TAB ) ) { + // get the char index of the caret position + int nPos = LOWORD( editInfo.CharFromPos( editInfo.GetCaretPos() ) ); + // select zero chars + editInfo.SetSel( nPos, nPos ); + // then replace that selection with a TAB + editInfo.ReplaceSel( "\t", TRUE ); + return TRUE; + } + + return CDialogEx::PreTranslateMessage( pMsg ); } -LRESULT CEditViewDlg::OnFindDialogMessage(WPARAM wParam, LPARAM lParam) { - if (findDlg == NULL) { - return 0; - } - - if (findDlg->IsTerminating()) { - findDlg = NULL; - return 0; - } - - // If the FR_FINDNEXT flag is set, - // call the application-defined search routine - // to search for the requested string. - if(findDlg->FindNext()) { - //read data from dialog - findStr = findDlg->GetFindString().GetBuffer(0); - CString str; - editInfo.GetWindowText(str); - editText = str; - int start, end; - editInfo.GetSel(start, end); - start = editText.Find(findStr, false, end); - if (start >= 0) { - editInfo.SetSel(start, start + findStr.Length()); - editInfo.Invalidate(); - editInfo.RedrawWindow(); - } - } - return 0; -} +LRESULT CEditViewDlg::OnFindDialogMessage( WPARAM wParam, LPARAM lParam ) { + if ( findDlg == nullptr ) { + return 0; + } + + if ( findDlg->IsTerminating() ) { + findDlg = nullptr; + return 0; + } + + // If the FR_FINDNEXT flag is set, + // call the application-defined search routine + // to search for the requested string. + if ( findDlg->FindNext() ) { + // read data from dialog + findStr = findDlg->GetFindString().GetBuffer( 0 ); + CString str; + editInfo.GetWindowText( str ); + editText = str; + int start, end; + editInfo.GetSel( start, end ); + start = editText.Find( findStr, false, end ); + if ( start >= 0 ) { + editInfo.SetSel( start, start + findStr.Length() ); + editInfo.Invalidate(); + editInfo.RedrawWindow(); + } + } + return 0; +} \ No newline at end of file diff --git a/neo/tools/radiant/EditViewDlg.h b/neo/tools/radiant/EditViewDlg.h index e66f541..5a03c43 100644 --- a/neo/tools/radiant/EditViewDlg.h +++ b/neo/tools/radiant/EditViewDlg.h @@ -31,52 +31,51 @@ If you have questions concerning this license or the applicable additional terms // CEditViewDlg dialog -class CEditViewDlg : public CDialog -{ - DECLARE_DYNAMIC(CEditViewDlg) +class CEditViewDlg : public CDialogEx { + + DECLARE_DYNAMIC( CEditViewDlg ) public: - enum {MATERIALS, GUIS}; - CEditViewDlg(CWnd* pParent = NULL); // standard constructor - virtual ~CEditViewDlg(); + enum { MATERIALS, GUIS }; + CEditViewDlg( CWnd *pParent = nullptr ); // standard constructor + virtual ~CEditViewDlg(); - void SetMode(int _mode) { - mode = _mode; - } + void SetMode( int _mode ) { + mode = _mode; + } - void SetMaterialInfo(const char *name, const char *file, int line); - void SetGuiInfo(const char *name); - void UpdateEditPreview(); + void SetMaterialInfo( const char *name, const char *file, int line ); + void SetGuiInfo( const char *name ); + void UpdateEditPreview(); - void OpenMedia(const char *name); -// Dialog Data - enum { IDD = IDD_DIALOG_EDITVIEW }; + // Dialog Data + enum { IDD = IDD_DIALOG_EDITVIEW }; protected: - CFindReplaceDialog *findDlg; - CMediaPreviewDlg mediaPreview; - int mode; - idStr fileName; - idStr matName; - idStr editText; - idStr findStr; - int line; - CEdit editInfo; + CFindReplaceDialog *findDlg; + CMediaPreviewDlg mediaPreview; + int mode; + idStr fileName; + idStr matName; + idStr editText; + idStr findStr; + int line; + CEdit editInfo; - void ShowFindDlg(); + void ShowFindDlg(); - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual void DoDataExchange( CDataExchange *pDX ) override; // DDX/DDV support - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnSize(UINT nType, int cx, int cy); - afx_msg void OnBnClickedButtonOpen(); - afx_msg void OnBnClickedButtonSave(); - virtual BOOL OnInitDialog(); - afx_msg void OnDestroy(); - afx_msg void OnTimer(UINT_PTR nIDEvent); - afx_msg void OnBnClickedButtonGoto(); - virtual BOOL PreTranslateMessage(MSG* pMsg); - afx_msg LRESULT OnFindDialogMessage(WPARAM wParam, LPARAM lParam); + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnSize( UINT nType, int cx, int cy ); + afx_msg void OnBnClickedButtonOpen(); + afx_msg void OnBnClickedButtonSave(); + virtual BOOL OnInitDialog() override; + afx_msg void OnDestroy(); + afx_msg void OnTimer( UINT_PTR nIDEvent ); + afx_msg void OnBnClickedButtonGoto(); + virtual BOOL PreTranslateMessage( MSG *pMsg ) override; + afx_msg LRESULT OnFindDialogMessage( WPARAM wParam, LPARAM lParam ); }; diff --git a/neo/tools/radiant/EntityDlg.cpp b/neo/tools/radiant/EntityDlg.cpp index ad49fd9..0468edd 100644 --- a/neo/tools/radiant/EntityDlg.cpp +++ b/neo/tools/radiant/EntityDlg.cpp @@ -31,7 +31,7 @@ If you have questions concerning this license or the applicable additional terms #include "qe3.h" #include "Radiant.h" -#include "GLWidget.h" +#include "../common/GLWidget.h" #include "PropertyList.h" #include "entitydlg.h" #include "PreviewDlg.h" diff --git a/neo/tools/radiant/FindTextureDlg.cpp b/neo/tools/radiant/FindTextureDlg.cpp index d232fe8..a7fe4a3 100644 --- a/neo/tools/radiant/FindTextureDlg.cpp +++ b/neo/tools/radiant/FindTextureDlg.cpp @@ -35,148 +35,111 @@ If you have questions concerning this license or the applicable additional terms #ifdef _DEBUG #define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; #endif -///////////////////////////////////////////////////////////////////////////// // CFindTextureDlg dialog CFindTextureDlg g_TexFindDlg; -CFindTextureDlg& g_dlgFind = g_TexFindDlg; +CFindTextureDlg &g_dlgFind = g_TexFindDlg; static bool g_bFindActive = true; -void CFindTextureDlg::updateTextures(const char *p) -{ - if (isOpen()) - { - if (g_bFindActive) - { - setFindStr(p); - } - else - { - setReplaceStr(p); - } - } +void CFindTextureDlg::updateTextures( const char *p ) { + if ( isOpen() ) { + if ( g_bFindActive ) { + setFindStr( p ); + } else { + setReplaceStr( p ); + } + } } -CFindTextureDlg::CFindTextureDlg(CWnd* pParent /*=NULL*/) - : CDialog(CFindTextureDlg::IDD, pParent) -{ - //{{AFX_DATA_INIT(CFindTextureDlg) - m_bSelectedOnly = FALSE; - m_strFind = _T(""); - m_strReplace = _T(""); - m_bForce = FALSE; - m_bLive = TRUE; - //}}AFX_DATA_INIT +CFindTextureDlg::CFindTextureDlg( CWnd *pParent ) + : CDialogEx( CFindTextureDlg::IDD, pParent ), + m_bSelectedOnly( FALSE ), + m_strFind( _T("") ), + m_strReplace( _T("") ), + m_bForce( FALSE ), + m_bLive( TRUE ) { } - -void CFindTextureDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CFindTextureDlg) - DDX_Check(pDX, IDC_CHECK_SELECTED, m_bSelectedOnly); - DDX_Text(pDX, IDC_EDIT_FIND, m_strFind); - DDX_Text(pDX, IDC_EDIT_REPLACE, m_strReplace); - DDX_Check(pDX, IDC_CHECK_FORCE, m_bForce); - DDX_Check(pDX, IDC_CHECK_LIVE, m_bLive); - //}}AFX_DATA_MAP +void CFindTextureDlg::DoDataExchange( CDataExchange *pDX ) { + CDialogEx::DoDataExchange( pDX ); + DDX_Check( pDX, IDC_CHECK_SELECTED, m_bSelectedOnly ); + DDX_Text( pDX, IDC_EDIT_FIND, m_strFind ); + DDX_Text( pDX, IDC_EDIT_REPLACE, m_strReplace ); + DDX_Check( pDX, IDC_CHECK_FORCE, m_bForce ); + DDX_Check( pDX, IDC_CHECK_LIVE, m_bLive ); } - -BEGIN_MESSAGE_MAP(CFindTextureDlg, CDialog) - //{{AFX_MSG_MAP(CFindTextureDlg) - ON_BN_CLICKED(IDC_BTN_APPLY, OnBtnApply) - ON_EN_SETFOCUS(IDC_EDIT_FIND, OnSetfocusEditFind) - ON_EN_SETFOCUS(IDC_EDIT_REPLACE, OnSetfocusEditReplace) - //}}AFX_MSG_MAP +BEGIN_MESSAGE_MAP( CFindTextureDlg, CDialogEx ) + ON_BN_CLICKED( IDOK, OnOK ) + ON_BN_CLICKED( IDCANCEL, OnCancel ) + ON_BN_CLICKED( IDC_BTN_APPLY, &CFindTextureDlg::OnBtnApply ) + ON_EN_SETFOCUS( IDC_EDIT_FIND, &CFindTextureDlg::OnSetfocusEditFind ) + ON_EN_SETFOCUS( IDC_EDIT_REPLACE, &CFindTextureDlg::OnSetfocusEditReplace ) END_MESSAGE_MAP() -void CFindTextureDlg::OnBtnApply() -{ - UpdateData(TRUE); - CRect rct; - GetWindowRect(rct); - SaveRegistryInfo("Radiant::TextureFindWindow", &rct, sizeof(rct)); - FindReplaceTextures( m_strFind, m_strReplace, ( m_bSelectedOnly != FALSE ), ( m_bForce != FALSE ) ); +void CFindTextureDlg::OnBtnApply() { + UpdateData( TRUE ); + CRect rct; + GetWindowRect( rct ); + SaveRegistryInfo( "radiant_texturefindwindow", &rct, sizeof( rct ) ); + FindReplaceTextures( m_strFind, m_strReplace, m_bSelectedOnly != FALSE, m_bForce != FALSE ); } -void CFindTextureDlg::OnOK() -{ - UpdateData(TRUE); - CRect rct; - GetWindowRect(rct); - SaveRegistryInfo("Radiant::TextureFindWindow", &rct, sizeof(rct)); - FindReplaceTextures( m_strFind, m_strReplace, ( m_bSelectedOnly != FALSE ), ( m_bForce != FALSE ) ); - CDialog::OnOK(); +void CFindTextureDlg::OnOK() { + UpdateData( TRUE ); + CRect rct; + GetWindowRect( rct ); + SaveRegistryInfo( "radiant_texturefindwindow", &rct, sizeof( rct ) ); + FindReplaceTextures( m_strFind, m_strReplace, m_bSelectedOnly != FALSE, m_bForce != FALSE ); + CDialogEx::OnOK(); } -void CFindTextureDlg::show() -{ - if (g_dlgFind.GetSafeHwnd() == NULL || IsWindow(g_dlgFind.GetSafeHwnd()) == FALSE) - { - g_dlgFind.Create(IDD_DIALOG_FINDREPLACE); - g_dlgFind.ShowWindow(SW_SHOW); - } - else - { - g_dlgFind.ShowWindow(SW_SHOW); - } - CRect rct; - LONG lSize = sizeof(rct); - if (LoadRegistryInfo("Radiant::TextureFindWindow", &rct, &lSize)) - g_dlgFind.SetWindowPos(NULL, rct.left, rct.top, 0,0, SWP_NOSIZE | SWP_SHOWWINDOW); +void CFindTextureDlg::show() { + if ( !g_dlgFind.GetSafeHwnd() || !IsWindow( g_dlgFind.GetSafeHwnd() ) ) { + g_dlgFind.Create( IDD_DIALOG_FINDREPLACE ); + g_dlgFind.ShowWindow( SW_SHOW ); + } else { + g_dlgFind.ShowWindow( SW_SHOW ); + } + CRect rct; + LONG lSize = sizeof( rct ); + if ( LoadRegistryInfo( "radiant_texturefindwindow", &rct, &lSize ) ) + g_dlgFind.SetWindowPos( nullptr, rct.left, rct.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW ); } - -bool CFindTextureDlg::isOpen() -{ - return (g_dlgFind.GetSafeHwnd() == NULL || ::IsWindowVisible(g_dlgFind.GetSafeHwnd()) == FALSE) ? false : true; +bool CFindTextureDlg::isOpen() { + return g_dlgFind.GetSafeHwnd() && ::IsWindowVisible( g_dlgFind.GetSafeHwnd() ); } -void CFindTextureDlg::setFindStr(const char * p) -{ - g_dlgFind.UpdateData(TRUE); - if (g_dlgFind.m_bLive) - { - g_dlgFind.m_strFind = p; - g_dlgFind.UpdateData(FALSE); - } +void CFindTextureDlg::setFindStr( const char *p ) { + g_dlgFind.UpdateData( TRUE ); + if ( g_dlgFind.m_bLive ) { + g_dlgFind.m_strFind = p; + g_dlgFind.UpdateData( FALSE ); + } } -void CFindTextureDlg::setReplaceStr(const char * p) -{ - g_dlgFind.UpdateData(TRUE); - if (g_dlgFind.m_bLive) - { - g_dlgFind.m_strReplace = p; - g_dlgFind.UpdateData(FALSE); - } +void CFindTextureDlg::setReplaceStr( const char *p ) { + g_dlgFind.UpdateData( TRUE ); + if ( g_dlgFind.m_bLive ) { + g_dlgFind.m_strReplace = p; + g_dlgFind.UpdateData( FALSE ); + } } - -void CFindTextureDlg::OnCancel() -{ - CRect rct; - GetWindowRect(rct); - SaveRegistryInfo("Radiant::TextureFindWindow", &rct, sizeof(rct)); - CDialog::OnCancel(); +void CFindTextureDlg::OnCancel() { + CRect rct; + GetWindowRect( rct ); + SaveRegistryInfo( "radiant_texturefindwindow", &rct, sizeof( rct ) ); + CDialogEx::OnCancel(); } -BOOL CFindTextureDlg::DestroyWindow() -{ - return CDialog::DestroyWindow(); +void CFindTextureDlg::OnSetfocusEditFind() { + g_bFindActive = true; } -void CFindTextureDlg::OnSetfocusEditFind() -{ - g_bFindActive = true; -} - -void CFindTextureDlg::OnSetfocusEditReplace() -{ - g_bFindActive = false; -} +void CFindTextureDlg::OnSetfocusEditReplace() { + g_bFindActive = false; +} \ No newline at end of file diff --git a/neo/tools/radiant/FindTextureDlg.h b/neo/tools/radiant/FindTextureDlg.h index ecd8f37..b4b19fa 100644 --- a/neo/tools/radiant/FindTextureDlg.h +++ b/neo/tools/radiant/FindTextureDlg.h @@ -25,65 +25,43 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#if !defined(AFX_FINDTEXTUREDLG_H__34B75D32_9F3A_11D1_B570_00AA00A410FC__INCLUDED_) -#define AFX_FINDTEXTUREDLG_H__34B75D32_9F3A_11D1_B570_00AA00A410FC__INCLUDED_ -#if _MSC_VER >= 1000 #pragma once -#endif // _MSC_VER >= 1000 -// FindTextureDlg.h : header file -// ///////////////////////////////////////////////////////////////////////////// // CFindTextureDlg dialog -class CFindTextureDlg : public CDialog -{ -// Construction -public: - static void setReplaceStr(const char* p); - static void setFindStr(const char* p); - static bool isOpen(); - static void show(); - static void updateTextures(const char* p); - CFindTextureDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CFindTextureDlg) - enum { IDD = IDD_DIALOG_FINDREPLACE }; - BOOL m_bSelectedOnly; - CString m_strFind; - CString m_strReplace; - BOOL m_bForce; - BOOL m_bLive; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CFindTextureDlg) - public: - virtual BOOL DestroyWindow(); - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: +void HideInfoDialog(); +void ShowInfoDialog( const char *pText ); - // Generated message map functions - //{{AFX_MSG(CFindTextureDlg) - afx_msg void OnBtnApply(); - virtual void OnOK(); - virtual void OnCancel(); - afx_msg void OnSetfocusEditFind(); - afx_msg void OnSetfocusEditReplace(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; +class CFindTextureDlg : public CDialogEx { +public: + CFindTextureDlg( CWnd *pParent = nullptr ); // standard constructor -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + enum { IDD = IDD_DIALOG_FINDREPLACE }; -#endif // !defined(AFX_FINDTEXTUREDLG_H__34B75D32_9F3A_11D1_B570_00AA00A410FC__INCLUDED_) + static void updateTextures( const char *p ); + static void show(); + static bool isOpen(); + static void setFindStr( const char *p ); + static void setReplaceStr( const char *p ); + +protected: + virtual void DoDataExchange( CDataExchange *pDX ) override; // DDX/DDV support + + DECLARE_MESSAGE_MAP() + +private: + BOOL m_bSelectedOnly; + CString m_strFind; + CString m_strReplace; + BOOL m_bForce; + BOOL m_bLive; + + afx_msg void OnBtnApply(); + afx_msg void OnOK(); + afx_msg void OnCancel(); + afx_msg void OnSetfocusEditFind(); + afx_msg void OnSetfocusEditReplace(); +}; \ No newline at end of file diff --git a/neo/tools/radiant/InspectorDialog.cpp b/neo/tools/radiant/InspectorDialog.cpp index e229b93..fd2611f 100644 --- a/neo/tools/radiant/InspectorDialog.cpp +++ b/neo/tools/radiant/InspectorDialog.cpp @@ -31,7 +31,7 @@ If you have questions concerning this license or the applicable additional terms #include "qe3.h" #include "Radiant.h" -#include "GLWidget.h" +#include "../common/GLWidget.h" #include "ConsoleDlg.h" #include "InspectorDialog.h" #include "TabsDlg.h" diff --git a/neo/tools/radiant/LightDlg.cpp b/neo/tools/radiant/LightDlg.cpp index 3847293..6d3d05d 100644 --- a/neo/tools/radiant/LightDlg.cpp +++ b/neo/tools/radiant/LightDlg.cpp @@ -869,7 +869,7 @@ void CLightDlg::OnBtnColor() { r = color[0]; g = color[1]; b = color[2]; - if ( DoNewColor( &r, &g, &b, &ob, UpdateLightDialog ) ) { + if ( DoColor( &r, &g, &b, &ob, UpdateLightDialog ) ) { color[0] = ob * r; color[1] = ob * g; color[2] = ob * b; diff --git a/neo/tools/radiant/LightDlg.h b/neo/tools/radiant/LightDlg.h index 18f45f5..9a03c6c 100644 --- a/neo/tools/radiant/LightDlg.h +++ b/neo/tools/radiant/LightDlg.h @@ -32,7 +32,7 @@ If you have questions concerning this license or the applicable additional terms #pragma once #endif // _MSC_VER > 1000 -#include "GLWidget.h" +#include "../common/GLWidget.h" class CLightInfo { public: diff --git a/neo/tools/radiant/MainFrm.cpp b/neo/tools/radiant/MainFrm.cpp index 9e3adf5..ce7e846 100644 --- a/neo/tools/radiant/MainFrm.cpp +++ b/neo/tools/radiant/MainFrm.cpp @@ -1464,7 +1464,7 @@ void CMainFrame::OnFileNew() { ======================================================================================================================= */ void CMainFrame::OnFileOpen() { - if (ConfirmModified()) { + if ( ConfirmModified() ) { OpenDialog(); } } diff --git a/neo/tools/radiant/MediaPreviewDlg.cpp b/neo/tools/radiant/MediaPreviewDlg.cpp index 301f91d..b725b21 100644 --- a/neo/tools/radiant/MediaPreviewDlg.cpp +++ b/neo/tools/radiant/MediaPreviewDlg.cpp @@ -33,153 +33,145 @@ If you have questions concerning this license or the applicable additional terms #include "Radiant.h" #include "mediapreviewdlg.h" +#ifdef _DEBUG +#define new DEBUG_NEW +#endif // CMediaPreviewDlg dialog -IMPLEMENT_DYNAMIC(CMediaPreviewDlg, CDialog) -CMediaPreviewDlg::CMediaPreviewDlg(CWnd* pParent /*=NULL*/) - : CDialog(CMediaPreviewDlg::IDD, pParent) -{ - mode = MATERIALS; - media = ""; +IMPLEMENT_DYNAMIC( CMediaPreviewDlg, CDialogEx ) + +CMediaPreviewDlg::CMediaPreviewDlg( CWnd *pParent ) + : CDialogEx( CMediaPreviewDlg::IDD, pParent ), + mode( MATERIALS ), + media( "" ) { } -void CMediaPreviewDlg::SetMedia(const char *_media) { - media = _media; - Refresh(); +void CMediaPreviewDlg::SetMedia( const char *_media ) { + media = _media; + Refresh(); } void CMediaPreviewDlg::Refresh() { - if (mode == GUIS) { - const idMaterial *mat = declManager->FindMaterial("guisurfs/guipreview"); - mat->SetGui( media ); - drawMaterial.setMedia("guisurfs/guipreview"); - drawMaterial.setScale( 4.4f ); - } else { - drawMaterial.setMedia(media); - drawMaterial.setScale( 1.0f ); - } - wndPreview.setDrawable(&drawMaterial); - wndPreview.Invalidate(); - wndPreview.RedrawWindow(); - RedrawWindow(); + if ( mode == GUIS ) { + const idMaterial* mat = declManager->FindMaterial( "guisurfs/guipreview" ); + mat->SetGui( media ); + drawMaterial.setMedia( "guisurfs/guipreview" ); + } else { + drawMaterial.setMedia( media ); + } + drawMaterial.setScale( 20.0f ); + wndPreview.setDrawable( &drawMaterial ); + wndPreview.Invalidate(); + wndPreview.RedrawWindow(); + RedrawWindow(); } -CMediaPreviewDlg::~CMediaPreviewDlg() -{ +CMediaPreviewDlg::~CMediaPreviewDlg() { } -void CMediaPreviewDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - DDX_Control(pDX, IDC_PREVIEW, wndPreview); +void CMediaPreviewDlg::DoDataExchange( CDataExchange *pDX ) { + CDialogEx::DoDataExchange( pDX ); + DDX_Control( pDX, IDC_PREVIEW, wndPreview ); } - -BEGIN_MESSAGE_MAP(CMediaPreviewDlg, CDialog) - ON_WM_SIZE() - ON_WM_DESTROY() - ON_WM_LBUTTONDOWN() - ON_WM_LBUTTONUP() - ON_WM_MOUSEMOVE() +BEGIN_MESSAGE_MAP( CMediaPreviewDlg, CDialogEx) + ON_WM_SIZE() + ON_WM_DESTROY() + ON_WM_LBUTTONDOWN() + ON_WM_LBUTTONUP() + ON_WM_MOUSEMOVE() END_MESSAGE_MAP() - // CMediaPreviewDlg message handlers -BOOL CMediaPreviewDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); +BOOL CMediaPreviewDlg::OnInitDialog() { + CDialogEx::OnInitDialog(); - wndPreview.setDrawable(&testDrawable); - CRect rct; - LONG lSize = sizeof(rct); - if (LoadRegistryInfo("Radiant::EditPreviewWindow", &rct, &lSize)) { - SetWindowPos(NULL, rct.left, rct.top, rct.Width(), rct.Height(), SWP_SHOWWINDOW); - } + wndPreview.setDrawable( &testDrawable ); + CRect rct; + LONG lSize = sizeof( rct ); + if ( LoadRegistryInfo( "Radiant::EditPreviewWindow", &rct, &lSize ) ) { + SetWindowPos( nullptr, rct.left, rct.top, rct.Width(), rct.Height(), SWP_SHOWWINDOW ); + } - GetClientRect(rct); - int h = (mode == GUIS) ? (rct.Width() - 8) / 1.333333f : rct.Height() - 8; - wndPreview.SetWindowPos(NULL, 4, 4, rct.Width() - 8, h, SWP_SHOWWINDOW); + GetClientRect( rct ); + int h = ( mode == GUIS ) ? ( rct.Width() - 8 ) / 1.333333f : rct.Height() - 8; + wndPreview.SetWindowPos( nullptr, 4, 4, rct.Width() - 8, h, SWP_SHOWWINDOW ); - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE } -void CMediaPreviewDlg::OnSize(UINT nType, int cx, int cy) -{ - float scaling_factor = Win_GetWindowScalingFactor(GetSafeHwnd()); - int s8 = int(8 * scaling_factor); - int s4 = int(4 * scaling_factor); - - CDialog::OnSize(nType, cx, cy); - if (wndPreview.GetSafeHwnd() == NULL) { - return; - } - CRect rect; - GetClientRect(rect); - //int h = (mode == GUIS) ? (rect.Width() - 8) / 1.333333f : rect.Height() - 8; - int h = rect.Height() - s8; - wndPreview.SetWindowPos(NULL, s4, s4, rect.Width() - s8, h, SWP_SHOWWINDOW); -} +void CMediaPreviewDlg::OnSize( UINT nType, int cx, int cy ) { -void CMediaPreviewDlg::OnDestroy() -{ - if (GetSafeHwnd()) { - CRect rct; - GetWindowRect(rct); - SaveRegistryInfo("Radiant::EditPreviewWindow", &rct, sizeof(rct)); - } + float scaling_factor = Win_GetWindowScalingFactor( GetSafeHwnd() ); + int s8 = int( 8 * scaling_factor ); + int s4 = int( 4 * scaling_factor ); - CDialog::OnDestroy(); + CDialogEx::OnSize( nType, cx, cy ); + if ( wndPreview.GetSafeHwnd() == nullptr ) { + return; + } + CRect rect; + GetClientRect( rect ); + int h = rect.Height() - s8; + wndPreview.SetWindowPos( nullptr, s4, s4, rect.Width() - s8, h, SWP_SHOWWINDOW ); } -void CMediaPreviewDlg::OnLButtonDown(UINT nFlags, CPoint point) -{ - if (mode == GUIS) { - idUserInterface *gui = uiManager->FindGui( media ); - if (gui) { - sysEvent_t ev; - memset( &ev, 0, sizeof( ev ) ); - ev.evType = SE_KEY; - ev.evValue = K_MOUSE1; - ev.evValue2 = 1; - gui->HandleEvent(&ev,0); - } - } - CDialog::OnLButtonDown(nFlags, point); +void CMediaPreviewDlg::OnDestroy() { + if ( GetSafeHwnd() ) { + CRect rct; + GetWindowRect( rct ); + SaveRegistryInfo( "radiant_editpreviewwindow", &rct, sizeof( rct ) ); + } + + CDialogEx::OnDestroy(); } -void CMediaPreviewDlg::OnLButtonUp(UINT nFlags, CPoint point) -{ - if (mode == GUIS) { - idUserInterface *gui = uiManager->FindGui( media ); - if (gui) { - sysEvent_t ev; - memset( &ev, 0, sizeof( ev ) ); - ev.evType = SE_KEY; - ev.evValue = K_MOUSE1; - ev.evValue2 = 0; - gui->HandleEvent(&ev,0); - } - } - CDialog::OnLButtonUp(nFlags, point); +void CMediaPreviewDlg::OnLButtonDown( UINT nFlags, CPoint point ) { + if ( mode == GUIS ) { + idUserInterface* gui = uiManager->FindGui( media ); + if ( gui ) { + sysEvent_t ev; + memset( &ev, 0, sizeof( ev ) ); + ev.evType = SE_KEY; + ev.evValue = K_MOUSE1; + ev.evValue2 = 1; + gui->HandleEvent( &ev, 0 ); + } + } + CDialogEx::OnLButtonDown( nFlags, point ); } -void CMediaPreviewDlg::OnMouseMove(UINT nFlags, CPoint point) -{ - if (mode == GUIS) { - idUserInterface *gui = uiManager->FindGui( media ); - if (gui) { - CRect rct; - wndPreview.GetClientRect(rct); - sysEvent_t ev; - memset( &ev, 0, sizeof( ev ) ); - ev.evType = SE_MOUSE; - ev.evValue = (point.x / rct.Width()) * 640.0f; - ev.evValue2 = (point.y / rct.Height()) * 480.0f; - gui->HandleEvent(&ev, 0); - } - } - CDialog::OnMouseMove(nFlags, point); +void CMediaPreviewDlg::OnLButtonUp( UINT nFlags, CPoint point ) { + if ( mode == GUIS ) { + idUserInterface *gui = uiManager->FindGui( media ); + if ( gui ) { + sysEvent_t ev; + memset( &ev, 0, sizeof( ev ) ); + ev.evType = SE_KEY; + ev.evValue = K_MOUSE1; + ev.evValue2 = 0; + gui->HandleEvent( &ev, 0 ); + } + } + CDialogEx::OnLButtonUp( nFlags, point ); } + +void CMediaPreviewDlg::OnMouseMove( UINT nFlags, CPoint point ) { + if ( mode == GUIS ) { + idUserInterface *gui = uiManager->FindGui( media ); + if ( gui ) { + CRect rct; + wndPreview.GetClientRect( rct ); + sysEvent_t ev; + memset( &ev, 0, sizeof( ev ) ); + ev.evType = SE_MOUSE; + ev.evValue = ( point.x / rct.Width() ) * 640.0f; + ev.evValue2 = ( point.y / rct.Height() ) * 480.0f; + gui->HandleEvent( &ev, 0 ); + } + } + CDialogEx::OnMouseMove( nFlags, point ); +} \ No newline at end of file diff --git a/neo/tools/radiant/MediaPreviewDlg.h b/neo/tools/radiant/MediaPreviewDlg.h index 768afae..d76d4e9 100644 --- a/neo/tools/radiant/MediaPreviewDlg.h +++ b/neo/tools/radiant/MediaPreviewDlg.h @@ -27,43 +27,43 @@ If you have questions concerning this license or the applicable additional terms */ #pragma once - // CMediaPreviewDlg dialog -class CMediaPreviewDlg : public CDialog -{ - DECLARE_DYNAMIC(CMediaPreviewDlg) +class CMediaPreviewDlg : public CDialogEx { + + DECLARE_DYNAMIC( CMediaPreviewDlg ) public: - enum { MATERIALS, GUIS }; - CMediaPreviewDlg(CWnd* pParent = NULL); // standard constructor - virtual ~CMediaPreviewDlg(); + enum { MATERIALS, GUIS }; + CMediaPreviewDlg( CWnd *pParent = nullptr ); // standard constructor + virtual ~CMediaPreviewDlg(); - void SetMode(int _mode) { - mode = _mode; - } + void SetMode( int _mode ) { + mode = _mode; + } - void SetMedia(const char *_media); - void Refresh(); + void SetMedia( const char *_media ); + void Refresh(); -// Dialog Data - enum { IDD = IDD_DIALOG_EDITPREVIEW }; + // Dialog Data + enum { IDD = IDD_DIALOG_EDITPREVIEW }; protected: - idGLDrawable testDrawable; - idGLDrawableMaterial drawMaterial; - idGLWidget wndPreview; - int mode; - idStr media; + idGLDrawable testDrawable; + idGLDrawableMaterial drawMaterial; + idGLWidget wndPreview; + int mode; + idStr media; + + virtual void DoDataExchange( CDataExchange *pDX ) override; // DDX/DDV support - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + DECLARE_MESSAGE_MAP() - DECLARE_MESSAGE_MAP() public: - virtual BOOL OnInitDialog(); - afx_msg void OnSize(UINT nType, int cx, int cy); - afx_msg void OnDestroy(); - afx_msg void OnLButtonDown(UINT nFlags, CPoint point); - afx_msg void OnLButtonUp(UINT nFlags, CPoint point); - afx_msg void OnMouseMove(UINT nFlags, CPoint point); -}; + virtual BOOL OnInitDialog() override; + afx_msg void OnSize( UINT nType, int cx, int cy ); + afx_msg void OnDestroy(); + afx_msg void OnLButtonDown( UINT nFlags, CPoint point ); + afx_msg void OnLButtonUp( UINT nFlags, CPoint point ); + afx_msg void OnMouseMove( UINT nFlags, CPoint point ); +}; \ No newline at end of file diff --git a/neo/tools/radiant/PMESH.CPP b/neo/tools/radiant/PMesh.cpp similarity index 100% rename from neo/tools/radiant/PMESH.CPP rename to neo/tools/radiant/PMesh.cpp diff --git a/neo/tools/radiant/PMESH.H b/neo/tools/radiant/PMesh.h similarity index 100% rename from neo/tools/radiant/PMESH.H rename to neo/tools/radiant/PMesh.h diff --git a/neo/tools/radiant/PARSE.CPP b/neo/tools/radiant/Parse.cpp similarity index 100% rename from neo/tools/radiant/PARSE.CPP rename to neo/tools/radiant/Parse.cpp diff --git a/neo/tools/radiant/PARSE.H b/neo/tools/radiant/Parse.h similarity index 100% rename from neo/tools/radiant/PARSE.H rename to neo/tools/radiant/Parse.h diff --git a/neo/tools/radiant/QE3.CPP b/neo/tools/radiant/QE3.cpp similarity index 100% rename from neo/tools/radiant/QE3.CPP rename to neo/tools/radiant/QE3.cpp diff --git a/neo/tools/radiant/QEDEFS.H b/neo/tools/radiant/QeDefs.h similarity index 100% rename from neo/tools/radiant/QEDEFS.H rename to neo/tools/radiant/QeDefs.h diff --git a/neo/tools/radiant/QERTYPES.H b/neo/tools/radiant/QerTypes.h similarity index 100% rename from neo/tools/radiant/QERTYPES.H rename to neo/tools/radiant/QerTypes.h diff --git a/neo/tools/radiant/SELECT.CPP b/neo/tools/radiant/Select.cpp similarity index 100% rename from neo/tools/radiant/SELECT.CPP rename to neo/tools/radiant/Select.cpp diff --git a/neo/tools/radiant/SELECT.H b/neo/tools/radiant/Select.h similarity index 100% rename from neo/tools/radiant/SELECT.H rename to neo/tools/radiant/Select.h diff --git a/neo/tools/radiant/splines.cpp b/neo/tools/radiant/Splines.cpp similarity index 100% rename from neo/tools/radiant/splines.cpp rename to neo/tools/radiant/Splines.cpp diff --git a/neo/tools/radiant/splines.h b/neo/tools/radiant/Splines.h similarity index 100% rename from neo/tools/radiant/splines.h rename to neo/tools/radiant/Splines.h diff --git a/neo/tools/radiant/VERTSEL.CPP b/neo/tools/radiant/VertSel.cpp similarity index 100% rename from neo/tools/radiant/VERTSEL.CPP rename to neo/tools/radiant/VertSel.cpp diff --git a/neo/tools/radiant/WIN_QE3.CPP b/neo/tools/radiant/WIN_QE3.CPP index b9f994f..c93fcc0 100644 --- a/neo/tools/radiant/WIN_QE3.CPP +++ b/neo/tools/radiant/WIN_QE3.CPP @@ -202,7 +202,7 @@ bool ConfirmModified(void) { } static OPENFILENAME ofn; /* common dialog box structure */ -static char szFile[260]; /* filename string */ +static char szFile[MAX_PATH]; /* filename string */ static char szFileTitle[260]; /* file title string */ static char szFilter[260] = "Map file (*.map, *.reg)\0*.map;*.reg\0"; /* filter string */ @@ -215,6 +215,7 @@ void OpenDialog(void) { szFile[0] = '\0'; /* Set the members of the OPENFILENAME structure. */ + ZeroMemory(&ofn, sizeof(OPENFILENAME)); ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = g_pParentWnd->GetSafeHwnd(); ofn.lpstrFilter = szFilter; @@ -223,11 +224,11 @@ void OpenDialog(void) { ofn.nMaxFile = sizeof(szFile); ofn.lpstrFileTitle = szFileTitle; ofn.nMaxFileTitle = sizeof(szFileTitle); - ofn.lpstrInitialDir = ""; //FIXME + ofn.lpstrInitialDir = NULL; ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; /* Display the Open dialog box. */ - if (!GetOpenFileName(&ofn)) { + if ( !GetOpenFileName( &ofn ) ) { return; // canceled } @@ -253,6 +254,7 @@ void SaveAsDialog(bool bRegion) { szFile[0] = '\0'; /* Set the members of the OPENFILENAME structure. */ + ZeroMemory(&ofn, sizeof(OPENFILENAME)); ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = g_pParentWnd->GetSafeHwnd(); ofn.lpstrFilter = szFilter; diff --git a/neo/tools/radiant/Z.CPP b/neo/tools/radiant/Z.cpp similarity index 100% rename from neo/tools/radiant/Z.CPP rename to neo/tools/radiant/Z.cpp diff --git a/neo/tools/radiant/Z.H b/neo/tools/radiant/Z.h similarity index 100% rename from neo/tools/radiant/Z.H rename to neo/tools/radiant/Z.h