diff --git a/backup.lst b/backup.lst index 7e96a309..a7ad03f5 100644 --- a/backup.lst +++ b/backup.lst @@ -14,7 +14,6 @@ todo.log public\ baserc\ -viewer\ physic\ render\ vprogs\ @@ -31,8 +30,8 @@ launch\qcc\ launch\xwad\ launch\xash\ launch\bsplib\ +launch\dpvenc\ launch\sprite\ launch\studio\ -launch\viewer\ launch\imagelib\ launch\extragen\ diff --git a/common/common.dsp b/common/common.dsp index ad71de26..31b11d95 100644 --- a/common/common.dsp +++ b/common/common.dsp @@ -157,6 +157,10 @@ SOURCE=.\bsplib\csg.c # End Source File # Begin Source File +SOURCE=.\dpvencoder.c +# End Source File +# Begin Source File + SOURCE=.\bsplib\faces.c # End Source File # Begin Source File diff --git a/common/dpvencoder.c b/common/dpvencoder.c new file mode 100644 index 00000000..19c77be8 --- /dev/null +++ b/common/dpvencoder.c @@ -0,0 +1,22 @@ +//======================================================================= +// Copyright XashXT Group 2008 © +// dpvencoder.c - DP video encoder +//======================================================================= + +#include "platform.h" +#include "utils.h" + +byte *dpvpool; + +bool CompileDPVideo( byte *mempool, const char *name, byte parms ) +{ + if( mempool ) dpvpool = mempool; + else + { + Msg( "DPV Encoder: can't allocate memory pool.\nAbort compilation\n" ); + return false; + } + + // FIXME: implement + return false; +} \ No newline at end of file diff --git a/common/platform.c b/common/platform.c index 9bad3f87..791ae83d 100644 --- a/common/platform.c +++ b/common/platform.c @@ -54,6 +54,7 @@ so do it manually void InitCommon( int argc, char **argv ) { string source, gamedir; + int imageflags = 0; launch_t CreateVprogs; basepool = Mem_AllocPool( "Common Pool" ); @@ -91,8 +92,10 @@ void InitCommon( int argc, char **argv ) case HOST_SPRITE: case HOST_STUDIO: case HOST_WADLIB: + imageflags |= IL_KEEP_8BIT; + case HOST_DPVENC: // initialize ImageLibrary - Image_Init( NULL, IL_KEEP_8BIT ); + Image_Init( NULL, imageflags ); case HOST_RIPPER: // blamk image for missed resources error_bmp = FS_LoadInternal( "blank.bmp", &error_bmp_size ); @@ -138,6 +141,10 @@ void CommonMain( void ) CompileMod = CompileWad3Archive; AddMask( "*.qc" ); break; + case HOST_DPVENC: + CompileMod = CompileDPVideo; + AddMask( "*.qc" ); + break; case HOST_RIPPER: CompileMod = ConvertResource; Conv_RunSearch(); diff --git a/common/utils.h b/common/utils.h index 0c74d79d..5cce4f12 100644 --- a/common/utils.h +++ b/common/utils.h @@ -38,6 +38,7 @@ float ColorNormalize( const vec3_t in, vec3_t out ); bool CompileStudioModel( byte *mempool, const char *name, byte parms ); bool CompileSpriteModel( byte *mempool, const char *name, byte parms ); bool CompileWad3Archive( byte *mempool, const char *name, byte parms ); +bool CompileDPVideo( byte *mempool, const char *name, byte parms ); bool PrepareBSPModel( const char *dir, const char *name ); bool CompileBSPModel( void ); diff --git a/debug.bat b/debug.bat index 1d9b983e..b834fd8b 100644 --- a/debug.bat +++ b/debug.bat @@ -26,9 +26,6 @@ if errorlevel 1 set BUILD_ERROR=1 %MSDEV% render/render.dsp %CONFIG%"render - Win32 Debug" %build_target% if errorlevel 1 set BUILD_ERROR=1 -%MSDEV% viewer/viewer.dsp %CONFIG%"viewer - Win32 Debug" %build_target% -if errorlevel 1 set BUILD_ERROR=1 - %MSDEV% vprogs/vprogs.dsp %CONFIG%"vprogs - Win32 Debug" %build_target% if errorlevel 1 set BUILD_ERROR=1 diff --git a/launch/viewer/viewer.c b/launch/dpvenc/dpvenc.c similarity index 90% rename from launch/viewer/viewer.c rename to launch/dpvenc/dpvenc.c index f26ee2dd..45c2ec4d 100644 --- a/launch/viewer/viewer.c +++ b/launch/dpvenc/dpvenc.c @@ -4,4 +4,4 @@ #include "../rundll.h" -Run32( viewer ); \ No newline at end of file +Run32( dpvenc ); \ No newline at end of file diff --git a/launch/viewer/viewer.rc b/launch/dpvenc/dpvenc.rc similarity index 61% rename from launch/viewer/viewer.rc rename to launch/dpvenc/dpvenc.rc index 2e6cfcc7..51ccecb0 100644 --- a/launch/viewer/viewer.rc +++ b/launch/dpvenc/dpvenc.rc @@ -14,14 +14,14 @@ #define VER_FILESUBTYPE VFT2_UNKNOWN #define VER_COMPANYNAME_STR "XashXT Group" -#define VER_LEGALCOPYRIGHT_STR "XashXT 2007" -#define VER_PRODUCTNAME_STR "Resource Viewer" +#define VER_LEGALCOPYRIGHT_STR "XashXT 2008" +#define VER_PRODUCTNAME_STR "DP video encoder (DarkPlaces video)" #define VER_ANSICP -#define VER_FILEDESCRIPTION_STR "Resource Viewer" -#define VER_ORIGINALFILENAME_STR "viewer.exe" -#define VER_INTERNALNAME_STR "viewer" +#define VER_FILEDESCRIPTION_STR "DPVencoder" +#define VER_ORIGINALFILENAME_STR "dpvenc.exe" +#define VER_INTERNALNAME_STR "dpvenc" #include diff --git a/launch/viewer/makefile.nmake b/launch/dpvenc/makefile.nmake similarity index 74% rename from launch/viewer/makefile.nmake rename to launch/dpvenc/makefile.nmake index 25ce4005..651822c0 100644 --- a/launch/viewer/makefile.nmake +++ b/launch/dpvenc/makefile.nmake @@ -7,14 +7,14 @@ !include -MAINTARGET = viewer +MAINTARGET = dpvenc OBJS = $(MAINTARGET).obj RES = $(MAINTARGET).rc default: $(MAINTARGET).exe -$(MAINTARGET).exe: $(MAINTARGET).obj viewer.res - $(link) $(OBJS) viewer.res /out:"viewer.exe" /subsystem:windows /opt:nowin98 /nodefaultlib:"libc.lib" +$(MAINTARGET).exe: $(MAINTARGET).obj dpvenc.res + $(link) $(OBJS) dpvenc.res /out:"dpvenc.exe" /subsystem:windows /opt:nowin98 /nodefaultlib:"libc.lib" @del $(MAINTARGET).obj $(MAINTARGET).lib $(MAINTARGET).exp $(MAINTARGET).res > nul @copy $(MAINTARGET).exe D:\Xash3D\sdk_main\tools\$(MAINTARGET).exe @del $(MAINTARGET).exe @@ -24,5 +24,5 @@ clean: .cpp.obj: $(CC) $(CFLAGS) /c $< -viewer.res : viewer.rc - $(RC) $(RCFLAGS) /r viewer.rc \ No newline at end of file +dpvenc.res : dpvenc.rc + $(RC) $(RCFLAGS) /r dpvenc.rc \ No newline at end of file diff --git a/launch/dpvenc/tool.ico b/launch/dpvenc/tool.ico new file mode 100644 index 00000000..340b4973 Binary files /dev/null and b/launch/dpvenc/tool.ico differ diff --git a/launch/system.c b/launch/system.c index e0ac6f98..c7b50ced 100644 --- a/launch/system.c +++ b/launch/system.c @@ -22,7 +22,6 @@ int event_head, event_tail; dll_info_t common_dll = { "common.dll", NULL, "CreateAPI", NULL, NULL, true, sizeof(launch_exp_t) }; dll_info_t engine_dll = { "engine.dll", NULL, "CreateAPI", NULL, NULL, true, sizeof(launch_exp_t) }; -dll_info_t viewer_dll = { "viewer.dll", NULL, "CreateAPI", NULL, NULL, true, sizeof(launch_exp_t) }; dll_info_t baserc_dll = { "baserc.dll", NULL, "CreateAPI", NULL, NULL, false, sizeof(baserc_exp_t)}; static const char *show_credits = "\n\n\n\n\tCopyright XashXT Group %s ©\n\t\ @@ -264,18 +263,17 @@ Parse program name to launch and determine work style NOTE: at this day we have ten instances -1. "normal" - normal or dedicated game launch -2. "viewer" - resource editor -3. "bsplib" - three BSP compilers in one -4. "imglib" - convert old formats (mip, pcx, lmp) to 32-bit tga +0. "offline" - invalid instance +1. "credits" - show engine credits +2. "dedicated" - dedicated server +3. "normal" - normal or dedicated game launch +4. "bsplib" - four BSP compilers in one 5. "qcclib" - quake c complier -6. "roqlib" - roq video file maker -7. "sprite" - sprite creator (requires qc. script) -8. "studio" - Half-Life style models creator (requires qc. script) -9. "credits" - display credits of engine developers -10. "host_setup" - write current path into registry (silently) - -This list will be expnaded in future +6. "sprite" - sprite creator (requires qc. script) +7. "studio" - Half-Life style models creator (requires qc. script) +8. "roqlib" - wad-file maker +9. "ripper" - RESOURCE extraCTOR genERIC +10."dpvenc" - dp video encoder ================== */ void Sys_LookupInstance( void ) @@ -304,7 +302,7 @@ void Sys_LookupInstance( void ) Sys.app_name = HOST_CREDITS; // easter egg Sys.linked_dll = NULL; // no need to loading library Sys.log_active = Sys.developer = 0; // clear all dbg states - com_strcpy(Sys.caption, "About"); + com_strcpy( Sys.caption, "About" ); Sys.con_showcredits = true; } else if(!com_strcmp(Sys.progname, "normal")) @@ -323,7 +321,7 @@ void Sys_LookupInstance( void ) Sys.con_showalways = false; } Sys.linked_dll = &engine_dll; // pointer to engine.dll info - com_sprintf(Sys.log_path, "engine.log", com_timestamp(TIME_NO_SECONDS)); // logs folder + com_sprintf( Sys.log_path, "engine.log", com_timestamp( TIME_NO_SECONDS )); // logs folder com_strcpy(Sys.caption, va("Xash3D ver.%g", XASH_VERSION )); } else if(!com_strcmp(Sys.progname, "bsplib")) @@ -370,15 +368,15 @@ void Sys_LookupInstance( void ) com_sprintf(Sys.log_path, "%s/decompile.log", sys_rootdir ); // default com_strcpy(Sys.caption, va("Quake Recource Extractor ver.%g", XASH_VERSION )); } - else if(!com_strcmp(Sys.progname, "viewer")) + else if(!com_strcmp(Sys.progname, "dpvenc")) { - Sys.app_name = HOST_VIEWER; + Sys.app_name = HOST_DPVENC; Sys.con_readonly = true; // don't show console as default if( Sys.developer < D_NOTE ) Sys.con_showalways = false; - Sys.linked_dll = &viewer_dll; // pointer to viewer.dll info - com_sprintf(Sys.log_path, "%s/editor.log", sys_rootdir ); // logs folder - com_strcpy(Sys.caption, va("Xash3D Resource Viewer ver.%g", XASH_VERSION )); + Sys.linked_dll = &common_dll; // pointer to dpvenc.dll info + com_sprintf(Sys.log_path, "%s/movie.log", sys_rootdir ); // logs folder + com_strcpy(Sys.caption, "DarkPlaces Video Encoder" ); } // share instance over all system GI.instance = Sys.app_name; @@ -402,7 +400,7 @@ void Sys_CreateInstance( void ) { case HOST_NORMAL: case HOST_DEDICATED: - case HOST_VIEWER: + case HOST_DPVENC: case HOST_BSPLIB: case HOST_QCCLIB: case HOST_SPRITE: @@ -445,9 +443,7 @@ void Sys_CreateInstance( void ) // if stuffcmds wasn't run, then init.rc is probably missing, use default if(!Sys.stuffcmdsrun) Cbuf_ExecuteText( EXEC_NOW, "stuffcmds\n" ); break; - case HOST_VIEWER: - Con_ShowConsole( false ); - // intentional falltrough + case HOST_DPVENC: case HOST_BSPLIB: case HOST_QCCLIB: case HOST_SPRITE: diff --git a/launch/viewer/tool.ico b/launch/viewer/tool.ico deleted file mode 100644 index 2ebb0b8c..00000000 Binary files a/launch/viewer/tool.ico and /dev/null differ diff --git a/launchers.bat b/launchers.bat index f07f5064..7b71b3e6 100644 --- a/launchers.bat +++ b/launchers.bat @@ -21,7 +21,7 @@ cd studio makefile.nmake cd .. -cd viewer +cd dpvenc makefile.nmake cd .. diff --git a/public/launch_api.h b/public/launch_api.h index f4f2eb1f..df735c57 100644 --- a/public/launch_api.h +++ b/public/launch_api.h @@ -73,7 +73,7 @@ typedef enum HOST_STUDIO, // "studio" "studiomdl" HOST_WADLIB, // "wadlib" "xwad" HOST_RIPPER, // "ripper" "extragen" - HOST_VIEWER, // "viewer" "viewer" + HOST_DPVENC, // "dpvenc" "dpvenc" HOST_COUNTS, // terminator } instance_t; diff --git a/release.bat b/release.bat index 0139a6e4..6fd15649 100644 --- a/release.bat +++ b/release.bat @@ -26,9 +26,6 @@ if errorlevel 1 set BUILD_ERROR=1 %MSDEV% render/render.dsp %CONFIG%"render - Win32 Release" %build_target% if errorlevel 1 set BUILD_ERROR=1 -%MSDEV% viewer/viewer.dsp %CONFIG%"viewer - Win32 Release" %build_target% -if errorlevel 1 set BUILD_ERROR=1 - %MSDEV% vprogs/vprogs.dsp %CONFIG%"vprogs - Win32 Release" %build_target% if errorlevel 1 set BUILD_ERROR=1 diff --git a/render/r_model.c b/render/r_model.c index 0dd0670e..5bc16623 100644 --- a/render/r_model.c +++ b/render/r_model.c @@ -927,6 +927,9 @@ static void R_SetupSubmodels( void ) submodel_t *bm; rmodel_t *model; + // clear all previous bmodels + Mem_Set( r_inlinemodels, 0, sizeof( r_inlinemodels )); + for( i = 0; i < m_pLoadModel->numSubmodels; i++ ) { bm = &m_pLoadModel->submodels[i]; diff --git a/viewer/guiforms.c b/viewer/guiforms.c deleted file mode 100644 index c8122a54..00000000 --- a/viewer/guiforms.c +++ /dev/null @@ -1,964 +0,0 @@ -//======================================================================= -// Copyright XashXT Group 2007 © -// guiforms.c - create windows -//======================================================================= - -#include "viewer.h" - -#define IDI_ICON1 101 - -#define MAIN_WND_WIDTH 640 -#define MAIN_WND_HEIGHT 480 -#define OPTS_WND_WIDTH 420 -#define OPTS_WND_HEIGHT 380 -#define C_PAGES 3 - -#define VIEWER_CONSOLE "Xash Viewer Console" -#define VIEWER_SETTINGS "Xash Viewer Settings" - - -static MSG msg; -static window_t g_MainWindow; -static window_t g_IdleWindow; - -typedef struct tag_dlghdr -{ - HWND hwndTab; // tab control - HWND hwndDisplay; // current child dialog box - RECT rcDisplay; // display rectangle for the tab control - DLGTEMPLATE *apRes[C_PAGES]; -}DLGHDR; - -GUI_Form s_gui; -wnd_options_t w_opts; //window options -static bool viewer_init = false; -static char textbuffer[MAX_MSGLEN]; -dll_info_t richedit_dll = { "riched32.dll", NULL, NULL, NULL, NULL, false, 0 }; - - -/* -============================================================================= - -GUI Set Font - -============================================================================= -*/ - -void GUI_AddToolTip( HWND hwnd, const char *text ) -{ - TOOLINFO ti; - - Mem_Set (&ti, 0, sizeof (TOOLINFO)); - ti.cbSize = sizeof (TOOLINFO); - ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS; - ti.uId = (UINT)hwnd; - ti.lpszText = (LPTSTR) text; - SendMessage (s_gui.hTips, TTM_ADDTOOL, 0, (LPARAM) &ti); -} - -static void GUI_AddButton( HWND parent, const char *name, int x, int y, int id ) -{ - HWND btn; - btn = CreateWindow( "button", name, WS_CHILD | WS_VISIBLE, x, y, 78, 26, - parent, (HMENU)id, s_gui.gHinst, NULL); - GUI_ApplyFont( btn ); - GUI_AddToolTip( btn, "test" ); -} - -void GUI_DisplayTooltips( HWND hwnd, DWORD dParam ) -{ - switch( dParam ) - { - case IDB_CHOOSEFONT: - Msg("display help\n"); - //MessageBox(hwnd, "Choose default font for viewer", "Help", MB_OK|MB_ICONINFORMATION); - break; - } -} - - -// DoLockDlgRes - loads and locks a dialog box template resource. -// Returns the address of the locked resource. -// lpszResName - name of the resource - -DLGTEMPLATE *WINAPI DoLockDlgRes(LPCSTR lpszResName) -{ - HGLOBAL hglb; - HRSRC hrsrc = FindResource(GetModuleHandle("viewer"), lpszResName, RT_DIALOG); - - if(!hrsrc) Sys_Error("not found res\n"); - - hglb = LoadResource(GetModuleHandle("viewer"), hrsrc); - return (DLGTEMPLATE *)LockResource(hglb); -} - -// OnChildDialogInit - Positions the child dialog box to fall -// within the display area of the tab control. - -void WINAPI OnChildDialogInit(HWND hwndDlg) -{ - HWND hwndParent = GetParent(hwndDlg); - DLGHDR *pHdr = (DLGHDR *) GetWindowLong( hwndParent, GWL_USERDATA); - SetWindowPos(hwndDlg, HWND_TOP, pHdr->rcDisplay.left, pHdr->rcDisplay.top, 0, 0, SWP_NOSIZE); - ShowWindow(hwndDlg, SW_SHOWNORMAL); - GUI_AddToolTip(GetDlgItem(hwndDlg, IDB_CHOOSEFONT), "Choose font" ); -} - -void GUI_UpdateOptions( WPARAM wParam ); - -static LRESULT CALLBACK ChildDialogProc(HWND hwnd, UINT uMessage, WPARAM wParam, LPARAM lParam) -{ - HELPINFO *hi; - - switch( uMessage ) - { - case WM_INITDIALOG: - OnChildDialogInit( hwnd ); - break; - //return true; - case WM_COMMAND: - GUI_UpdateOptions(wParam); - break; - case WM_HELP: - hi = (HELPINFO *)lParam; - GUI_DisplayTooltips( hwnd, hi->iCtrlId ); - break; - } - return DefWindowProc (hwnd, uMessage, wParam, lParam); -} - - -// OnSelChanged - processes the TCN_SELCHANGE notification. -// hwndDlg - handle to the parent dialog box. -void WINAPI OnSelChanged(HWND hwndDlg) -{ - DLGHDR *pHdr = (DLGHDR *) GetWindowLong( hwndDlg, GWL_USERDATA); - int iSel = TabCtrl_GetCurSel(pHdr->hwndTab); - - // Destroy the current child dialog box, if any. - if (pHdr->hwndDisplay != NULL) DestroyWindow(pHdr->hwndDisplay); - - // Create the new child dialog box. - pHdr->hwndDisplay = CreateDialogIndirect(s_gui.gHinst, pHdr->apRes[iSel], hwndDlg, ChildDialogProc); -} - -void WINAPI OnTabbedDialogInit( HWND hwndDlg ) -{ - DLGHDR *pHdr = (DLGHDR *)LocalAlloc(LPTR, sizeof(DLGHDR)); - DWORD dwDlgBase = GetDialogBaseUnits(); - int cxMargin = LOWORD(dwDlgBase) / 4; - int cyMargin = HIWORD(dwDlgBase) / 8; - TCITEM tie; - RECT rcTab; - int i; - - // Save a pointer to the DLGHDR structure. - SetWindowLong(hwndDlg, GWL_USERDATA, (LONG) pHdr); - - // Create the tab control. - pHdr->hwndTab = CreateWindow( WC_TABCONTROL, "", WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE, - 0, 0, OPTS_WND_WIDTH, OPTS_WND_HEIGHT, hwndDlg, NULL, s_gui.gHinst, NULL ); - if (pHdr->hwndTab == NULL) - { - // handle error - GUI_Error("can't create hwnd dialog\n" ); - return; - } - - GUI_ApplyFont( pHdr->hwndTab ); - - // Add a tab for each of the three child dialog boxes. - tie.mask = TCIF_TEXT | TCIF_IMAGE; - tie.iImage = -1; - tie.pszText = "General"; - TabCtrl_InsertItem(pHdr->hwndTab, 0, &tie); - tie.pszText = "Compilers"; - TabCtrl_InsertItem(pHdr->hwndTab, 1, &tie); - tie.pszText = "QuakeC"; - TabCtrl_InsertItem(pHdr->hwndTab, 2, &tie); - - // Lock the resources for the three child dialog boxes. - pHdr->apRes[0] = DoLockDlgRes(MAKEINTRESOURCE(DLG_FIRST)); - pHdr->apRes[1] = DoLockDlgRes(MAKEINTRESOURCE(DLG_SECOND)); - pHdr->apRes[2] = DoLockDlgRes(MAKEINTRESOURCE(DLG_THIRD)); - - // Determine the bounding rectangle for all child dialog boxes. - SetRectEmpty(&rcTab); - - for (i = 0; i < C_PAGES; i++) - { - if (pHdr->apRes[i]->cx > rcTab.right) - rcTab.right = pHdr->apRes[i]->cx; - if (pHdr->apRes[i]->cy > rcTab.bottom) - rcTab.bottom = pHdr->apRes[i]->cy; - } - - rcTab.right = rcTab.right * LOWORD(dwDlgBase) / 4; - rcTab.bottom = rcTab.bottom * HIWORD(dwDlgBase) / 8; - - // Calculate how large to make the tab control, so - // the display area can accommodate all the child dialog boxes. - TabCtrl_AdjustRect(pHdr->hwndTab, TRUE, &rcTab); - OffsetRect(&rcTab, cxMargin - rcTab.left, cyMargin - rcTab.top); - - // Calculate the display rectangle. - CopyRect(&pHdr->rcDisplay, &rcTab); - TabCtrl_AdjustRect(pHdr->hwndTab, FALSE, &pHdr->rcDisplay); - - // Set the size and position of the tab control, buttons, - // and dialog box. - SetWindowPos(pHdr->hwndTab, NULL, rcTab.left, rcTab.top, OPTS_WND_WIDTH + 10, OPTS_WND_HEIGHT, SWP_NOZORDER); - - // Size the dialog box. - SetWindowPos(hwndDlg, NULL, 0, 0, OPTS_WND_WIDTH + 10, OPTS_WND_HEIGHT, SWP_NOMOVE | SWP_NOZORDER); - - s_gui.hTips = CreateWindowEx (0, TOOLTIPS_CLASS, "", WS_POPUP | WS_EX_TOPMOST, 0, 0, 0, 0, pHdr->hwndTab, NULL, s_gui.gHinst, NULL); - - - // Simulate selection of the first item. - OnSelChanged( hwndDlg ); -} - -/* -============================================================================= - -GUI Table Options - -============================================================================= -*/ -void GUI_ResizeTab(HWND hwnd) -{ - TC_ITEM ti; - - int index = TabCtrl_GetCurSel (hwnd); - - if( index >= 0 ) - { - ti.mask = TCIF_PARAM; - TabCtrl_GetItem (hwnd, index, &ti); - if (s_gui.hOptions) - { - RECT rc, rc2; - HDWP hdwp; - - GetWindowRect (hwnd, &rc); - ScreenToClient (s_gui.hTabs, (LPPOINT) &rc.left); - ScreenToClient (s_gui.hTabs, (LPPOINT) &rc.right); - - TabCtrl_GetItemRect (hwnd, index, &rc2); - rc.top += (rc2.bottom - rc2.top) - 6; - - hdwp = BeginDeferWindowPos (2); - DeferWindowPos (hdwp, s_gui.hTabs, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER); - DeferWindowPos (hdwp, s_gui.hTabs, HWND_TOP, rc.left + 3, rc.top - 8, rc.right - rc.left, rc.bottom - rc.top, SWP_SHOWWINDOW); - EndDeferWindowPos (hdwp); - } - } -} - -static void GUI_AddTab( const char *name ) -{ - TC_ITEM ti; - - ti.mask = TCIF_TEXT | TCIF_PARAM; - ti.pszText = (LPSTR)name; - - TabCtrl_InsertItem (s_gui.hTabs, TabCtrl_GetItemCount(s_gui.hTabs), &ti); - GUI_ResizeTab(s_gui.hTabs); -} - -bool GUI_CloseOptions( void ) -{ - ShowWindow( s_gui.hOptions, SW_HIDE ); - - //return to main window - EnableWindow( s_gui.hWnd, true ); - SetFocus( s_gui.hWnd ); - - return false; -} - -bool GUI_ApplyOptions( void ) -{ - //TODO: - //1. copy parameters from temporary struct to global - //2. apply some changes immediately if needed - //3. save settings into "bin/viewer.rc" - - - return GUI_CloseOptions(); -} - -void GUI_UpdateOptions( WPARAM wParam ) -{ - CHOOSEFONT cf; - static LOGFONT lf; // logical font structure - static DWORD rgbCurrent; // current text color - - ZeroMemory(&cf, sizeof(cf)); - cf.lStructSize = sizeof (cf); - cf.hwndOwner = s_gui.hWnd; - cf.lpLogFont = &lf; - cf.rgbColors = rgbCurrent; - cf.Flags = CF_SCREENFONTS | CF_EFFECTS; - - switch(LOWORD(wParam)) - { - case IDOK: - GUI_ApplyOptions(); - break; - case IDCANCEL: - GUI_CloseOptions(); - break; - case IDB_CHOOSEFONT: - if(ChooseFont(&cf)) - { - Msg("apply font %s\n", cf.lpLogFont->lfFaceName); - com.strcpy(w_opts.fontname, cf.lpLogFont->lfFaceName); - //Msg("apply font %d\n", cf.lpLogFont->lfHeight -MulDiv(cf.iPointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72)); - } - break; - } -} - -static LRESULT CALLBACK OptWndProc (HWND hwnd, UINT uMessage, WPARAM wParam, LPARAM lParam) -{ - HDC hdc; - PAINTSTRUCT ps; - - switch( uMessage ) - { - case WM_CREATE: - OnTabbedDialogInit( hwnd ); - break; - case WM_PAINT: - hdc = BeginPaint(hwnd, (LPPAINTSTRUCT)&ps); - EndPaint(hwnd,(LPPAINTSTRUCT)&ps); - return TRUE; - break; - case WM_COMMAND: - GUI_UpdateOptions(wParam); - break; - case WM_NOTIFY: - switch (((LPNMHDR)lParam)->code) - { - case TCN_SELCHANGE: - OnSelChanged( hwnd ); - break; - } - break; - return true; - case WM_SIZE: - break; - case WM_CLOSE: - return GUI_CloseOptions(); - break; - } - return DefWindowProc (hwnd, uMessage, wParam, lParam); -} - -void GUI_CreateOptionsWindow( void ) -{ - WNDCLASS wc; - RECT rect; - - int w_pos, h_pos; - //int WNDSTYLE = WS_POPUP | WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX; - int WNDSTYLE = WS_POPUP | WS_CAPTION; - int TABSTYLE = WS_CHILD | WS_VISIBLE | WS_TABSTOP | TCS_TOOLTIPS; - int bpos_x, bpos_y; - - Mem_Set( &wc, 0, sizeof( wc )); - - wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; - wc.lpfnWndProc = OptWndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = s_gui.gHinst; - wc.hIcon = LoadIcon( s_gui.gHinst, NULL ); - wc.hCursor = LoadCursor (NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH) COLOR_3DSHADOW; - wc.lpszMenuName = NULL; - wc.lpszClassName = VIEWER_SETTINGS; - - if (!RegisterClass (&wc)) GUI_Error("Can't create options window\n"); - - //move window into center of screen - rect.left = 0; - rect.right = OPTS_WND_WIDTH; - rect.top = 0; - rect.bottom = OPTS_WND_HEIGHT; - - AdjustWindowRect( &rect, WNDSTYLE, FALSE ); - - w_pos = ( s_gui.scr_width - OPTS_WND_WIDTH ) / 2; - h_pos = ( s_gui.scr_height - OPTS_WND_HEIGHT ) / 2; - - s_gui.hOptions = CreateWindowEx( WS_EX_CLIENTEDGE | WS_EX_CONTEXTHELP, VIEWER_SETTINGS, "Settings", WNDSTYLE, - w_pos, h_pos, rect.right - rect.left, rect.bottom - rect.top, s_gui.hWnd, NULL, s_gui.gHinst, NULL); - - GetClientRect(s_gui.hOptions, &rect); - - bpos_x = rect.right - rect.left - 78 - 5; - bpos_y = rect.bottom - rect.top - 26 - 5; - - GUI_AddButton( s_gui.hOptions, "&Cancel", bpos_x, bpos_y, IDCANCEL ); - bpos_x -= 78 + 5;//move next button - GUI_AddButton( s_gui.hOptions, "&OK", bpos_x, bpos_y, IDOK ); -} - -/* -============================================================================= - -GUI Acellerators - -============================================================================= -*/ - - -void GUI_ResetWndOptions( void ) -{ - char dev_level[4]; - - //get info about developer mode - if(FS_GetParmFromCmdLine("-dev", dev_level )) - dev_mode = atoi(dev_level); - - // reset options - w_opts.id = IDVIEWERHEADER; - w_opts.csize = sizeof(wnd_options_t); - w_opts.show_console = true; - w_opts.con_scale = 6L; - w_opts.exp_scale = 5L; - - w_opts.font_size = 7; - com.strcpy(w_opts.fontname, "Courier"); - w_opts.font_type = CFM_BOLD | CFM_FACE | CFM_COLOR; - w_opts.font_color = RGB(0, 0, 0); - - w_opts.width = s_gui.width; - w_opts.height = s_gui.height; -} - -void GUI_LoadWndOptions( wnd_options_t *settings ) -{ - Mem_Copy( &w_opts, settings, sizeof( w_opts )); - - s_gui.width = w_opts.width; - s_gui.height = w_opts.height; -} - -bool GUI_LoadPlatfrom( int argc, char **argv ) -{ - FS_ClearSearchPath(); - FS_AddGameHierarchy( "bin" ); - - return true; -} - -HWND GUI_CreateConsole( bool readonly ) -{ - HWND newwnd; - DWORD dwStyle = WS_CHILD | WS_HSCROLL | - WS_VSCROLL | ES_LEFT | ES_WANTRETURN | ES_MULTILINE | ES_AUTOVSCROLL; - - if (readonly) dwStyle |= ES_READONLY; - Sys_LoadLibrary( &richedit_dll ); - - newwnd = CreateWindowEx(WS_EX_CLIENTEDGE, richedit_dll.link ? RICHEDIT_CLASS : "EDIT", "", - dwStyle, 0, 0, 0, 0, s_gui.hWnd, NULL, s_gui.gHinst, NULL); - - if (!newwnd) - { - //fall back to the earlier version - newwnd = CreateWindowEx(WS_EX_CLIENTEDGE, richedit_dll.link ? RICHEDIT_CLASS10A : "EDIT", "", - dwStyle, 0, 0, 0, 0, s_gui.hWnd, NULL, s_gui.gHinst, NULL); - - } - if (!newwnd) - { - // we don't have RICHEDIT installed properly - Sys_FreeLibrary( &richedit_dll ); - - newwnd = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", dwStyle, 0, 0, 0, 0, - s_gui.hWnd, NULL, s_gui.gHinst, NULL); - } - - GUI_SetFont( newwnd ); - if (richedit_dll.link) SendMessage(newwnd, EM_EXLIMITTEXT, 0, 1<<20); - - return newwnd; -} - - -void GUI_CreateViewerWindow( void ) -{ - s_gui.hWnd = CreateWindowEx( WS_EX_CLIENTEDGE, CLASSNAME, "Xash Resource Viewer", WS_OVERLAPPEDWINDOW, - s_gui.top, s_gui.bottom, s_gui.width, s_gui.height, NULL, NULL, s_gui.gHinst, NULL); - - s_gui.hConsole = GUI_CreateConsole( true ); -} - - -/* -============================================================================= - -GUI Console System - -============================================================================= -*/ -void GUI_PrintIntoBuffer(const char *pMsg) -{ - com.strcat(textbuffer, pMsg ); -} - -void GUI_ExecuteBuffer(void) -{ - viewer_init = true; - GUI_Print(textbuffer); -} - -/* -==================== -GUI_Print - -stdout into viewer internal console -==================== -*/ -void GUI_Print(const char *pMsg) -{ - CHARFORMAT cf; - char buffer[MAX_MSGLEN*2]; - char *b = buffer; - const char *msg; - int bufLen; - int i = 0; - int color = RGB(0, 0, 0); - static unsigned long s_totalChars; - - if(!viewer_init) - { - GUI_PrintIntoBuffer( pMsg ); - return; - } - - // if the message is REALLY long, use just the last portion of it - if ( strlen( pMsg ) > MAX_MSGLEN - 1 ) - msg = pMsg + strlen( pMsg ) - MAX_MSGLEN + 1; - else msg = pMsg; - - // copy into an intermediate buffer - while ( msg[i] && ( ( b - buffer ) < sizeof( buffer ) - 1 ) ) - { - if ( msg[i] == '\n' && msg[i+1] == '\r' ) - { - b[0] = '\r'; - b[1] = '\n'; - b += 2; - i++; - } - else if ( msg[i] == '\r' ) - { - b[0] = '\r'; - b[1] = '\n'; - b += 2; - } - else if ( msg[i] == '\n' ) - { - b[0] = '\r'; - b[1] = '\n'; - b += 2; - } - else if ( IsColorString( &msg[i] )) - { - int code = 0; - i++; - code = atoi( &msg[i] ); - if(code == 5) color = RGB(255, 0, 0); - } - else - { - *b= msg[i]; - b++; - } - i++; - } - *b = 0; - bufLen = b - buffer; - s_totalChars += bufLen; - - //Edit_SetSel(s_gui.hConsole, 0, s_totalChars); - Mem_Set(&cf, 0, sizeof(cf)); - cf.cbSize = sizeof(cf); - cf.dwMask = CFM_COLOR; - cf.crTextColor = color; - - // replace selection instead of appending if we're overflowing - if ( s_totalChars > 0x7fff ) - { - SendMessage( s_gui.hConsole, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf); - //SendMessage( s_gui.hConsole, EM_SETSEL, 0, -1 ); - s_totalChars = bufLen; - //Edit_SetSel(s_gui.hConsole, bufLen, s_totalChars); - } - - // put this text into the windows console - SendMessage( s_gui.hConsole, EM_LINESCROLL, 0, 0xffff ); - SendMessage( s_gui.hConsole, EM_SCROLLCARET, 0, 0 ); - SendMessage( s_gui.hConsole, EM_REPLACESEL, 0, (LPARAM) buffer ); -} - -void GUI_Error( const char *pMsg, ... ) -{ - va_list argptr; - char text[MAX_MSGLEN]; - - va_start (argptr, pMsg); - vsprintf (text, pMsg, argptr); - va_end (argptr); - - GUI_DisableMenus(); - com.print( text );//echo into system console - - //3. waiting for user input - - //com.exit(); -} - -void GUI_CreateMenus( void ) -{ - int TREESTYLE = WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL | TVS_HASBUTTONS | TVS_LINESATROOT | TVS_HASLINES; - - //create root menu - s_gui.menu = CreateMenu(); - - //create volumes - s_gui.file = CreateMenu(); AppendMenu(s_gui.menu, MF_POPUP, (UINT)s_gui.file, "&File"); - s_gui.edit = CreateMenu(); AppendMenu(s_gui.menu, MF_POPUP, (UINT)s_gui.edit, "&Edit"); - s_gui.cmds = CreateMenu(); AppendMenu(s_gui.menu, MF_POPUP, (UINT)s_gui.cmds, "&Tools"); - s_gui.help = CreateMenu(); AppendMenu(s_gui.menu, MF_POPUP, (UINT)s_gui.help, "&Help"); - - //build menu "file" - GUI_AddMenuItem(s_gui.file, "&New... Ctrl + N", IDM_CREATE, VK_N ); - GUI_AddMenuItem(s_gui.file, "&Open... Ctrl + O", IDM_OPEN, VK_O ); - GUI_AddMenuItem(s_gui.file, "&Close", IDM_CLOSE, 0 ); - GUI_AddMenuItem(s_gui.file, "", 0, 0 );//separator - GUI_AddMenuItem(s_gui.file, "&Save... Ctrl + S", IDM_SAVE, VK_S ); - GUI_AddMenuItem(s_gui.file, "Save &As...", IDM_SAVEAS, 0 ); - GUI_AddMenuItem(s_gui.file, "", 0, 0 );//separator - GUI_AddMenuItem(s_gui.file, "E&xit", IDM_QUIT, 0 ); - - //build menu "edit" - GUI_AddMenuItem(s_gui.edit, "&Undo Ctrl + Z", IDM_UNDO, VK_Z ); - GUI_AddMenuItem(s_gui.edit, "&Redo Ctrl + Y", IDM_REDO, VK_Y ); - GUI_AddMenuItem(s_gui.edit, "", 0, 0 );//separator - GUI_AddMenuItem(s_gui.edit, "Cu&t Ctrl + X", IDM_CUT, VK_X ); - GUI_AddMenuItem(s_gui.edit, "&Copy Ctrl + C", IDM_COPY, VK_C ); - GUI_AddMenuItem(s_gui.edit, "&Paste Ctrl + V", IDM_PASTE, VK_V ); - GUI_AddMenuItem(s_gui.edit, "&Delete Del", IDM_DELETE, VK_DELETE ); - GUI_AddMenuItem(s_gui.edit, "", 0, 0 );//separator - GUI_AddMenuItem(s_gui.edit, "&Find Ctrl + F", IDM_FIND, VK_F ); - GUI_AddMenuItem(s_gui.edit, "R&eplace Ctrl + H", IDM_REPLACE, VK_H ); - GUI_AddMenuItem(s_gui.edit, "&Go to... Ctrl + G", IDM_GOTO, VK_G ); - - //build menu "tools" - GUI_AddMenuItem(s_gui.cmds, "&Compile... F7", IDM_COMPILE, VK_F7 ); - GUI_AddMenuItem(s_gui.cmds, "D&ump Info... F3", IDM_GETINFO, VK_F3 ); - GUI_AddMenuItem(s_gui.cmds, "", 0, 0 );//separator - GUI_AddMenuItem(s_gui.cmds, "&Settings... F10", IDM_SETTINGS, VK_F10 ); - - AppendMenu(s_gui.cmds, MF_CHECKED, IDM_SHOWCONSOLE, "Show console"); - RegisterHotKey(s_gui.hWnd, IDH_HIDECONSOLE, 0, VK_ESCAPE ); - - //fill menu "help" - AppendMenu(s_gui.help, 0, IDM_ABOUT, "&About"); - - SetMenu(s_gui.hWnd, s_gui.menu); - - s_gui.hTree = CreateWindowEx (WS_EX_CLIENTEDGE, WC_TREEVIEW, "", TREESTYLE, - 0, 0, 127, 380, s_gui.hWnd, (HMENU)IDM_FIRSTCHILD, s_gui.gHinst, NULL); - - GUI_CreateAccelTable(); - ShowWindow(s_gui.hTree, SW_SHOWDEFAULT); -} - -void GUI_DisableMenus( void ) -{ - EnableMenuItem(s_gui.file, IDM_CREATE, MF_GRAYED); - EnableMenuItem(s_gui.file, IDM_OPEN, MF_GRAYED); - EnableMenuItem(s_gui.file, IDM_CLOSE, MF_GRAYED); - EnableMenuItem(s_gui.file, IDM_SAVE, MF_GRAYED); - EnableMenuItem(s_gui.file, IDM_SAVEAS, MF_GRAYED); - - EnableMenuItem(s_gui.edit, IDM_UNDO, MF_GRAYED); - EnableMenuItem(s_gui.edit, IDM_REDO, MF_GRAYED); - EnableMenuItem(s_gui.edit, IDM_CUT, MF_GRAYED); - EnableMenuItem(s_gui.edit, IDM_COPY, MF_GRAYED); - EnableMenuItem(s_gui.edit, IDM_PASTE, MF_GRAYED); - EnableMenuItem(s_gui.edit, IDM_DELETE, MF_GRAYED); - EnableMenuItem(s_gui.edit, IDM_FIND, MF_GRAYED); - EnableMenuItem(s_gui.edit, IDM_REPLACE, MF_GRAYED); - EnableMenuItem(s_gui.edit, IDM_GOTO, MF_GRAYED); - - EnableMenuItem(s_gui.cmds, IDM_COMPILE, MF_GRAYED); - EnableMenuItem(s_gui.cmds, IDM_GETINFO, MF_GRAYED); - - EnableMenuItem(s_gui.cmds, IDM_SETTINGS, MF_GRAYED); -} - -void GUI_ShowConsole( void ) -{ - w_opts.show_console = true; - ShowWindow( s_gui.hConsole, SW_SHOWNORMAL ); - SendMessage( s_gui.hConsole, EM_LINESCROLL, 0, 0xffff ); - CheckMenuItem(s_gui.cmds, IDM_SHOWCONSOLE, MF_CHECKED); - SendMessage( s_gui.hWnd, WM_SIZE, 1, 0 ); -} - -void GUI_HideConsole( void ) -{ - w_opts.show_console = false; - ShowWindow(s_gui.hConsole, SW_HIDE); - CheckMenuItem(s_gui.cmds, IDM_SHOWCONSOLE, MF_UNCHECKED); - SendMessage( s_gui.hWnd, WM_SIZE, 1, 0 );//update windows -} - -void GUI_UpdateDefault( WPARAM wParam ) -{ - switch(LOWORD(wParam)) - { - case IDM_DELETE: - Msg("delete accel\n"); - break; - case IDM_COMPILE: - break; - case IDM_GETINFO: - break; - case IDM_SETTINGS: - ShowWindow( s_gui.hOptions, SW_SHOWNORMAL ); - SetFocus( s_gui.hOptions ); - EnableWindow( s_gui.hWnd, false ); - break; - case IDM_SHOWCONSOLE: - if(w_opts.show_console) GUI_HideConsole(); - else GUI_ShowConsole(); - break; - case IDM_ABOUT: - if(!w_opts.show_console) GUI_ShowConsole(); - Msg("Xash Resource Viewer. ver. %g\n", GI->version ); - Msg("Copyright XashXT Group 2007 ©.\n"); - break; - } -} - -void GUI_UpdateMenu( WPARAM wParam ) -{ - switch(LOWORD(wParam)) - { - case IDM_CREATE: - Msg("Create new file\n"); - break; - case IDM_OPEN: - Msg("open file\n"); - break; - case IDM_CLOSE: - break; - case IDM_SAVE: - break; - case IDM_SAVEAS: - break; - case IDM_QUIT: - PostQuitMessage (0); - break; - default: - GUI_UpdateDefault( wParam ); - break; - } -} - -void GUI_HotKeys( WPARAM wParam ) -{ - switch(LOWORD(wParam)) - { - case IDH_HIDECONSOLE: - if(w_opts.show_console) - GUI_HideConsole(); - break; - default: - MsgDev( D_WARN, "GUI_HotKeys: call unused hotkey %d\n", LOWORD(wParam)); - break; - } -} - -static LRESULT CALLBACK WndProc (HWND hwnd, UINT uMessage, WPARAM wParam, LPARAM lParam) -{ - HDC hdc; - PAINTSTRUCT ps; - - switch (uMessage) - { - case WM_CREATE: - break; - case WM_PAINT: - hdc = BeginPaint(hwnd, (LPPAINTSTRUCT)&ps); - EndPaint(hwnd,(LPPAINTSTRUCT)&ps); - return TRUE; - break; - case WM_HOTKEY: - GUI_HotKeys( wParam ); - break; - case WM_CHILDACTIVATE: - Msg("process child\n"); - break; - case WM_SIZE: - if(s_gui.hWnd) - { - int con_w, con_h, con_y; - int exp_w, exp_h, coffs; - RECT rect; - GetWindowRect(s_gui.hWnd, &rect); - w_opts.width = rect.right - rect.left; - w_opts.height = rect.bottom - rect.top; - GetClientRect(s_gui.hWnd, &rect); - - con_h = (rect.bottom - rect.top) / w_opts.con_scale; // console scale factor - con_y = rect.bottom - rect.top - con_h; // console hight - con_w = rect.right - rect.left; - - if(s_gui.hConsole && IsWindowVisible(s_gui.hConsole)) coffs = con_h; - else coffs = 0; - - exp_w = (rect.right - rect.left) / w_opts.exp_scale; // explorer scale factor - exp_h = rect.bottom - rect.top - coffs; // explorer height - - //make me sure what handle is valid - if(s_gui.hConsole) SetWindowPos(s_gui.hConsole, NULL, 0, con_y, con_w, con_h, 0); - if(s_gui.hTree) SetWindowPos(s_gui.hTree, NULL, 0, 0, exp_w, exp_h, 0); - } - break; - case WM_COMMAND: - GUI_UpdateMenu(wParam); - break; - case WM_CLOSE: - if (hwnd == s_gui.hWnd) PostQuitMessage (0); - else ShowWindow (hwnd, SW_HIDE); - return 0; - break; - } - - return DefWindowProc (hwnd, uMessage, wParam, lParam); -} - -void InitViewer ( int argc, char **argv ) -{ - HDC hDC; - WNDCLASS wc; - RECT rect; - int WNDSTYLE = WS_OVERLAPPEDWINDOW; - int iErrors = 0; - - Mem_Set( &wc, 0, sizeof( wc )); - s_gui.gHinst = (HINSTANCE)GetModuleHandle( NULL ); - - wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; - wc.lpfnWndProc = WndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = s_gui.gHinst; - wc.hIcon = LoadIcon (s_gui.gHinst, MAKEINTRESOURCE(IDI_ICON1)); - wc.hCursor = LoadCursor (NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH) COLOR_WINDOW; - wc.lpszMenuName = NULL; - wc.lpszClassName = CLASSNAME; - - if (!wc.hIcon) wc.hIcon = LoadIcon (NULL, IDI_WINLOGO); - if (!RegisterClass (&wc)) Sys_Error("Can't create viewer window\n"); - - // move window into center of screen - rect.left = 0; - rect.right = MAIN_WND_WIDTH; - rect.top = 0; - rect.bottom = MAIN_WND_HEIGHT; - - AdjustWindowRect( &rect, WNDSTYLE, FALSE ); - - hDC = GetDC( GetDesktopWindow() ); - s_gui.scr_width = GetDeviceCaps( hDC, HORZRES ); - s_gui.scr_height = GetDeviceCaps( hDC, VERTRES ); - ReleaseDC( GetDesktopWindow(), hDC ); - - s_gui.width = rect.right - rect.left; - s_gui.height = rect.bottom - rect.top; - s_gui.top = ( s_gui.scr_width - MAIN_WND_WIDTH ) / 2; - s_gui.bottom = ( s_gui.scr_height - MAIN_WND_HEIGHT ) / 2; - - GUI_ResetWndOptions(); // load default settings - InitCommonControls (); - - if(GUI_LoadPlatfrom( argc, argv )) //load config - { - wnd_options_t *config_dat; - int config_size; - - config_dat = (wnd_options_t *)FS_LoadFile( "viewer.rc", &config_size ); - - if(config_dat) //verify our config before read - { - if(config_dat->id != IDVIEWERHEADER) - { - MsgDev( D_ERROR, "InitViewer: viewer.rc have mismath header!\n"); - iErrors++; - } - if(config_dat->csize != config_size) - { - MsgDev( D_ERROR, "InitViewer: viewer.rc have mismath size!\n"); - iErrors++; - } - //copy settings into main structure - if(!iErrors) GUI_LoadWndOptions( config_dat ); - } - } - else iErrors++; - - GUI_CreateViewerWindow(); - GUI_CreateMenus(); - GUI_CreateOptionsWindow(); - - //apply chnages - if(w_opts.show_console) GUI_ShowConsole(); - else GUI_HideConsole(); - - if(iErrors) GUI_DisableMenus(); // apply error - GUI_ExecuteBuffer(); //show all messages - - // end of all initializations - ShowWindow(s_gui.hWnd, SW_SHOWDEFAULT); - MsgDev(D_INFO, "------- Xash Recource Viewer ver. %g initialized -------\n", GI->version ); -} - -void ViewerMain ( void ) -{ - // wait for the user to quit - while(msg.message != WM_QUIT) - { - if(GetMessage (&msg, 0, 0, 0)) - { - if (!LookupAccelTable( msg )) - { - TranslateMessage (&msg); - DispatchMessage (&msg); - } - } - } - - // save our settings - FS_WriteFile("viewer.rc", &w_opts, w_opts.csize ); -} - -void FreeViewer ( void ) -{ - // free richedit32 - Sys_FreeLibrary( &richedit_dll ); - GUI_RemoveAccelTable(); - UnregisterClass (CLASSNAME, s_gui.gHinst); -} \ No newline at end of file diff --git a/viewer/guiutils.c b/viewer/guiutils.c deleted file mode 100644 index 8d405b06..00000000 --- a/viewer/guiutils.c +++ /dev/null @@ -1,153 +0,0 @@ -//======================================================================= -// Copyright XashXT Group 2007 © -// guiutils.c - resource viewer -//======================================================================= - -#include "viewer.h" - -int dev_mode = 0; -/* -============================================================================= - -GUI Set Font (change and apply new font settings) - -============================================================================= -*/ - -/* -==================== -GUI_SetFont - -Must call once at start application -==================== -*/ -void GUI_SetFont( HWND hwnd ) -{ - CHARFORMAT cf; - Mem_Set(&cf, 0, sizeof(cf)); - cf.cbSize = sizeof(cf); - cf.dwMask = w_opts.font_type; - com.strcpy(cf.szFaceName, w_opts.fontname); - cf.yHeight = w_opts.font_size; - cf.crTextColor = w_opts.font_color; - - //go to "Courier", 14pt as default - SendMessage(hwnd, EM_SETCHARFORMAT, SCF_ALL, (WPARAM)&cf); -} - -/* -==================== -GUI_ApplyFont - -Apply new font for specified window -==================== -*/ -void GUI_ApplyFont( HWND hwnd ) -{ - SendMessage (hwnd, WM_SETFONT, (WPARAM) (HFONT) GetStockObject (ANSI_VAR_FONT), MAKELPARAM(TRUE, 0)); -} - -/* -============================================================================= - -GUI Register Accelerators (Hot keys) - -============================================================================= -*/ -static HACCEL g_hAccel = 0; -static ACCEL g_AccelTable[64] = { 0 }; -static int g_numAccel = 0; -#define MAX_HOTKEYS 0x40 - -/* -==================== -GUI_AddAccelerator - -Add another hotkeys combination -Must be before call GUI_CreateAccelTable() -==================== -*/ -void GUI_AddAccelerator(int key, int flags, int cmd) -{ - if (g_numAccel < MAX_HOTKEYS) - { - g_AccelTable[g_numAccel].fVirt = flags; - g_AccelTable[g_numAccel].key = key; - g_AccelTable[g_numAccel].cmd = cmd; - g_numAccel++; - } - else MsgDev( D_ERROR, "GUI_AddAccelerator: can't register hotkey! Hokey limit exceed\n"); -} - -/* -==================== -GUI_CreateAccelTable - -Create a table with hotkeys -==================== -*/ -void GUI_CreateAccelTable( void ) -{ - //create accel table - g_hAccel = CreateAcceleratorTable (g_AccelTable, g_numAccel); - if(!g_hAccel) MsgDev( D_ERROR, "GUI_CreateAccelTable: can't create accel table\n"); -} - -/* -==================== -LookupAccelTable - -Called from main program loop -==================== -*/ -bool LookupAccelTable( MSG msg ) -{ - //nothing to lookup? - if(!g_hAccel) return false; - - return TranslateAccelerator(s_gui.hWnd, g_hAccel, &msg); -} - -/* -==================== -GUI_RemoveAccelTable - -Called before quit from application -==================== -*/ -void GUI_RemoveAccelTable( void ) -{ - if (g_hAccel) DestroyAcceleratorTable (g_hAccel); - g_numAccel = 0; - g_hAccel = 0; -} - -/* -============================================================================= - -GUI Create Menu's - -============================================================================= -*/ -void GUI_AddMenuItem( HMENU menu, const char *name, uint itemId, uint hotkey ) -{ - if(strlen(name)) AppendMenu(menu, 0, itemId, name ); - else - { - AppendMenu(menu, MF_SEPARATOR, 0, 0); - return; - } - - if(hotkey) - { - int style = FVIRTKEY; - int length = strlen(name) - 1; - - //parse modifiers - if (com.stristr (name, "ctrl")) style |= FCONTROL; - if (com.stristr (name, "shift")) style |= FSHIFT; - if (com.stristr (name, "alt")) style |= FALT; - - GUI_AddAccelerator(hotkey, style, itemId); - } -} \ No newline at end of file diff --git a/viewer/kbd_layout.h b/viewer/kbd_layout.h deleted file mode 100644 index f89d297b..00000000 --- a/viewer/kbd_layout.h +++ /dev/null @@ -1,39 +0,0 @@ -//======================================================================= -// Copyright XashXT Group 2007 © -// kbd_layout.h - ASCII defualt charset -//======================================================================= -#ifndef KBD_LAYOUT_H -#define KBD_LAYOUT_H - -enum -{ - VK_A = 65, - VK_B, - VK_C, - VK_D, - VK_E, - VK_F, - VK_G, - VK_H, - VK_I, - VK_J, - VK_K, - VK_L, - VK_M, - VK_N, - VK_O, - VK_P, - VK_Q, - VK_R, - VK_S, - VK_T, - VK_U, - VK_V, - VK_W, - VK_X, - VK_Y, - VK_Z, -}; - - -#endif//KBD_LAYOUT_H \ No newline at end of file diff --git a/viewer/mxtk.h b/viewer/mxtk.h deleted file mode 100644 index 5b33c6b9..00000000 --- a/viewer/mxtk.h +++ /dev/null @@ -1,125 +0,0 @@ -//======================================================================= -// Copyright XashXT Group 2007 © -// mxtk.h - small interface creator -//======================================================================= -#ifndef GUIUTILS_H -#define GUIUTILS_H - -#include -#include -#include "resource.h" -#include "kbd_layout.h" -#include "options.h" - -typedef struct -{ - HINSTANCE gHinst; //app hinstance - HWND hWnd; - HWND hConsole; - HWND hTree; - HWND hOptions; - HWND hTabs; - HWND hTips; - HMODULE richedit; - - HMENU menu; //root menu - HMENU file; - HMENU edit; - HMENU cmds; - HMENU help; - - int width, height; - int top, bottom; - - int scr_width; - int scr_height; -}GUI_Form; - -typedef struct menuitem_s -{ - uint itemId; //menu item identifier - char name[32]; //display this name - uint iStyle; //default, separator, checked - uint iHotKey; - uint iModifier; //shift, ctrl //TODO: determine automatically -}menuitem_t; - -#define ITEM_DEF 0 -#define ITEM_SEP 1 -#define ITEM_CHK 2 - -typedef struct mcolumn_s -{ - menuitem_t *item; - int numitems; - -}mcolumn_t; - -void GUI_CreateEditorWindow( void ); - -//font operations -void GUI_SetFont( HWND hwnd ); -void GUI_ApplyFont( HWND hwnd ); - -//accelerators -void GUI_AddAccelerator(int key, int flags, int cmd); -void GUI_CreateAccelTable( void ); -bool LookupAccelTable( MSG msg ); -void GUI_RemoveAccelTable( void ); - -//menu builder -void GUI_AddMenuItem( HMENU menu, const char *name, uint itemId, uint hotkey ); -void GUI_AddMenuString( menuitem_t item ); -void TEST_MenuList( void ); - -enum -{ - IDC_OPTIONS = 1901, -}; - -enum -{ - //menu "file" - IDM_CREATE = 32, - IDM_OPEN, - IDM_CLOSE, - IDM_SAVE, - IDM_SAVEAS, - IDM_QUIT, - - //menu "edit" - IDM_UNDO, - IDM_REDO, - IDM_CUT, - IDM_COPY, - IDM_PASTE, - IDM_DELETE, - IDM_FIND, - IDM_REPLACE, - IDM_GOTO, - - //menu "commands" - IDM_COMPILE, - IDM_GETINFO, - IDM_SETTINGS, - IDM_SHOWCONSOLE, - - //menu "about" - IDM_ABOUT, - - IDH_HIDECONSOLE, - - //custom menu's - IDM_FIRSTCHILD, -}; - -void GUI_Error( const char *pMsg, ... ); -void GUI_Print(const char *pMsg); -void GUI_DisableMenus( void ); - -extern mcolumn_t MenuInfo; -extern GUI_Form s_gui; -extern wnd_options_t w_opts; //window options - - -#endif//GUIUTILS_H \ No newline at end of file diff --git a/viewer/options.h b/viewer/options.h deleted file mode 100644 index 2a826ab1..00000000 --- a/viewer/options.h +++ /dev/null @@ -1,29 +0,0 @@ -//======================================================================= -// Copyright XashXT Group 2007 © -// options.h - editor saved options -//======================================================================= -#ifndef OPTIONS_H -#define OPTIONS_H - -#define IDVIEWERHEADER (('V'<<24)+('R'<<16)+('D'<<8)+'I') // little-endian "IDRV" - -typedef struct wnd_options_s -{ - int id; //must be "IDRV" - size_t csize; - float con_scale; - float exp_scale; - bool show_console; - - // system font variables - int font_size;//console font size - char fontname[32]; //default as "Courier" - int font_type; - int font_color; - - int width; - int height; - -} wnd_options_t; - -#endif//OPTIONS_H \ No newline at end of file diff --git a/viewer/resource.h b/viewer/resource.h deleted file mode 100644 index 29ad53bf..00000000 --- a/viewer/resource.h +++ /dev/null @@ -1,44 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by editor.rc -// -#define DLG_FIRST 101 -#define DLG_SECOND 102 -#define DLG_THIRD 103 -#define BTN_TEST 1000 -#define IDC_TREE1 1002 -#define IDC_BUTTON1 1003 -#define IDB_CHOOSEFONT 1004 -#define IDB_CHOOSECOLOR 1005 -#define IDC_BEHAVIOR 1010 -#define IDC_BEHAVIOR2 1011 -#define IDC_SLIDER1 1012 -#define IDC_MAXUNDO 1013 -#define IDC_RADIO1 1015 -#define IDC_RADIO2 1016 -#define IDC_MDL_IGNOREWARN 1016 -#define IDC_RADIO3 1017 -#define IDC_MDL_PHYSBOXGEN 1017 -#define IDC_CHECK1 1018 -#define IDC_MDL_EXTTEX 1018 -#define IDC_QCC_KEYWORDS 1018 -#define IDC_SPR_CREATE32 1019 -#define IDC_QCC_OFFSETPARM 1019 -#define IDC_BSP_IGNOREWARN3 1020 -#define IDC_QCC_AUTOPROTO 1020 -#define IDC_QCC_DUMPASM 1021 -#define IDC_QCC_CASEINSENS 1022 -#define IDC_QCC_LAXTYPE 1023 -#define IDC_QCC_HASHONLY 1024 -#define IDC_QCC_FASTARAYS 1025 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 105 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1021 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/viewer/resource.hm b/viewer/resource.hm deleted file mode 100644 index 839cc3b4..00000000 --- a/viewer/resource.hm +++ /dev/null @@ -1,5 +0,0 @@ -// Microsoft Developer Studio generated Help ID include file. -// Used by editor.rc -// -#define HIDB_CHOOSECOLOR 0x806503ed // DLG_FIRST [English (U.S.)] -#define HIDC_MAXUNDO 0x806503f5 // DLG_FIRST [English (U.S.)] diff --git a/viewer/viewer.aps b/viewer/viewer.aps deleted file mode 100644 index bbf7f283..00000000 Binary files a/viewer/viewer.aps and /dev/null differ diff --git a/viewer/viewer.c b/viewer/viewer.c deleted file mode 100644 index 213f9034..00000000 --- a/viewer/viewer.c +++ /dev/null @@ -1,31 +0,0 @@ -//======================================================================= -// Copyright XashXT Group 2007 © -// editor.c - game editor dll -//======================================================================= - -#include "viewer.h" -#include "engine_api.h" - -stdlib_api_t com; - -/* -================== -DllMain - -================== -*/ -launch_exp_t DLLEXPORT *CreateAPI( stdlib_api_t *input, void *unused ) -{ - static launch_exp_t Viewer; - - com = *input; - - Viewer.api_size = sizeof(launch_exp_t); - - Viewer.Init = InitViewer; - Viewer.Main = ViewerMain; - Viewer.Free = FreeViewer; - Viewer.CPrint = GUI_Print; - - return &Viewer; -} \ No newline at end of file diff --git a/viewer/viewer.dsp b/viewer/viewer.dsp deleted file mode 100644 index d32ce9b7..00000000 --- a/viewer/viewer.dsp +++ /dev/null @@ -1,151 +0,0 @@ -# Microsoft Developer Studio Project File - Name="viewer" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=viewer - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "viewer.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "viewer.mak" CFG="viewer - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "viewer - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "viewer - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "viewer - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\temp\viewer\!release" -# PROP Intermediate_Dir "..\temp\viewer\!release" -# PROP Ignore_Export_Lib 1 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EDITOR_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /Ob1 /I "../public" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x419 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 msvcrt.lib user32.lib gdi32.lib comctl32.lib comdlg32.lib /nologo /dll /pdb:none /machine:I386 /nodefaultlib:"libc.lib" -# Begin Custom Build -TargetDir=\Xash3D\src_main\temp\viewer\!release -InputPath=\Xash3D\src_main\temp\viewer\!release\viewer.dll -SOURCE="$(InputPath)" - -"D:\Xash3D\bin\viewer.dll" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(TargetDir)\viewer.dll "D:\Xash3D\bin\viewer.dll" - -# End Custom Build - -!ELSEIF "$(CFG)" == "viewer - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\temp\viewer\!debug" -# PROP Intermediate_Dir "..\temp\viewer\!debug" -# PROP Ignore_Export_Lib 1 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EDITOR_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "../public" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x419 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 msvcrt.lib user32.lib gdi32.lib comctl32.lib comdlg32.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /pdbtype:sept -# Begin Custom Build -TargetDir=\Xash3D\src_main\temp\viewer\!debug -InputPath=\Xash3D\src_main\temp\viewer\!debug\viewer.dll -SOURCE="$(InputPath)" - -"D:\Xash3D\bin\viewer.dll" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(TargetDir)\viewer.dll "D:\Xash3D\bin\viewer.dll" - -# End Custom Build - -!ENDIF - -# Begin Target - -# Name "viewer - Win32 Release" -# Name "viewer - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\guiforms.c -# End Source File -# Begin Source File - -SOURCE=.\guiutils.c -# End Source File -# Begin Source File - -SOURCE=.\viewer.c -# End Source File -# Begin Source File - -SOURCE=.\viewer.rc -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\mxtk.h -# End Source File -# Begin Source File - -SOURCE=.\options.h -# End Source File -# Begin Source File - -SOURCE=.\viewer.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/viewer/viewer.h b/viewer/viewer.h deleted file mode 100644 index 5e253154..00000000 --- a/viewer/viewer.h +++ /dev/null @@ -1,76 +0,0 @@ -//======================================================================= -// Copyright XashXT Group 2007 © -// viewer.h - recource viewer -//======================================================================= -#ifndef GENERICVIEW_H -#define GENERICVIEW_H - -#include -#include -#include -#include -#include -#include -#include "launch_api.h" - -#include "mxtk.h" -#include "options.h" - -#define CLASSNAME "SystemViewer" - -//===================================== -// main editor funcs -//===================================== -void InitViewer ( int argc, char **argv ); -void ViewerMain ( void ); -void FreeViewer ( void ); - -extern int com_argc; -extern int dev_mode; -extern char **com_argv; - -/* -=========================================== -System Events -=========================================== -*/ -extern stdlib_api_t com; -#define Sys_Error com.error - -typedef enum { - Action, - Size, - Timer, - Idle, - Show, - Hide, - MouseUp, - MouseDown, - MouseMove, - MouseDrag, - KeyUp, - KeyDown, - MouseWheel, -}eventlist_t; - -typedef struct event_s -{ - int event; - HWND *widget; - int action; - int width, height; - int x, y, buttons; - int key; - int modifiers; - int flags; - int zdelta; -}event_t; - -typedef struct window_s -{ - int ( *handleEvent ) ( event_t *event ); - HWND Handle; - -} window_t; - -#endif//GENERICVIEW_H \ No newline at end of file diff --git a/viewer/viewer.rc b/viewer/viewer.rc deleted file mode 100644 index 45fcd5a4..00000000 --- a/viewer/viewer.rc +++ /dev/null @@ -1,246 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -// Generated Help ID header file -#define APSTUDIO_HIDDEN_SYMBOLS -#include "resource.hm" -#undef APSTUDIO_HIDDEN_SYMBOLS - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Russian resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) -#ifdef _WIN32 -LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT -#pragma code_page(1251) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // Russian resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -DLG_FIRST DIALOGEX 0, 0, 270, 165 -STYLE DS_MODALFRAME | WS_CHILD -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "Change...",IDB_CHOOSEFONT,15,29,50,14 - GROUPBOX "Main",IDC_STATIC,7,7,68,153 - GROUPBOX "Toolbars",IDC_STATIC,74,7,79,153 - LTEXT "Console behavior",IDC_STATIC,81,17,59,8 - CONTROL "",IDC_BEHAVIOR,"ComboBoxEx32",CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP,84,29,53,31 - GROUPBOX "Display",IDC_STATIC,151,7,112,153 - DEFPUSHBUTTON "Change...",IDB_CHOOSECOLOR,160,28,50,14,0,0, - HIDB_CHOOSECOLOR - LTEXT "Background color",IDC_STATIC,160,17,90,9 - LTEXT "Viewer font",IDC_STATIC,14,18,52,8 - CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | - WS_TABSTOP,155,124,103,16,WS_EX_CLIENTEDGE | - WS_EX_STATICEDGE - LTEXT "Max FPS for 3D window",IDC_STATIC,160,112,94,7 - CTEXT "20 40 60",IDC_STATIC, - 156,144,102,12,SS_NOTIFY | SS_SUNKEN - LTEXT "Max undo levels",IDC_STATIC,14,48,56,7 - COMBOBOX IDC_MAXUNDO,15,60,49,39,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP,0,HIDC_MAXUNDO - LTEXT "Tree behavior",IDC_STATIC,82,48,59,8 - CONTROL "",IDC_BEHAVIOR2,"ComboBoxEx32",CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP,84,60,53,31 - LTEXT "Keep relations between treeview and console as:", - IDC_STATIC,83,77,65,26 - CONTROL " 5:6",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,84,108, - 32,10 - CONTROL " 5:5",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,84,123, - 32,10 - CONTROL " 6:8",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,84,137, - 32,10 -END - -DLG_SECOND DIALOG DISCARDABLE 0, 0, 270, 165 -STYLE DS_MODALFRAME | WS_CHILD -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "Studio",IDC_STATIC,7,7,256,48 - CONTROL "Ignore warnings",IDC_MDL_IGNOREWARN,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,13,18,66,10 - CONTROL "Generate physbox",IDC_MDL_PHYSBOXGEN,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,13,31,72,10 - CONTROL "Use external textures only ( Xash MDL format )", - IDC_MDL_EXTTEX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,92, - 18,162,10 - GROUPBOX "Spritegen",IDC_STATIC,7,49,256,34 - CONTROL "Create 32-bit sprites( Xash SPR format )", - IDC_SPR_CREATE32,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 13,61,140,10 - GROUPBOX "Bsplib",IDC_STATIC,7,78,256,82 - CONTROL "Ignore warnings",IDC_BSP_IGNOREWARN3,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,13,89,66,10 -END - -DLG_THIRD DIALOGEX 0, 0, 270, 165 -STYLE DS_MODALFRAME | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - CTEXT "Powered by FTE QCLIB",IDC_STATIC,11,16,248,10, - SS_CENTERIMAGE,WS_EX_STATICEDGE - GROUPBOX "Main",IDC_STATIC,7,7,256,153 - CONTROL "Keywords coexist",IDC_QCC_KEYWORDS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,17,31,70,13 - CONTROL "Define offset params",IDC_QCC_OFFSETPARM,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,17,44,80,13 - CONTROL "Automatic prototyping",IDC_QCC_AUTOPROTO,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,17,57,81,13 - CONTROL "Dump assembler",IDC_QCC_DUMPASM,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,17,70,70,13 - CONTROL "Case insensativity (use with caution)", - IDC_QCC_CASEINSENS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 17,83,128,13 - CONTROL "Lax type checks",IDC_QCC_LAXTYPE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,17,96,66,13 - CONTROL "Hash only constants",IDC_QCC_HASHONLY,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,17,109,78,13 - CONTROL "Fast arrays",IDC_QCC_FASTARAYS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,17,122,70,13 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - DLG_FIRST, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 263 - TOPMARGIN, 7 - BOTTOMMARGIN, 150 - END - - DLG_SECOND, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 263 - TOPMARGIN, 7 - BOTTOMMARGIN, 150 - END - - DLG_THIRD, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 263 - TOPMARGIN, 7 - BOTTOMMARGIN, 150 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog Info -// - -DLG_FIRST DLGINIT -BEGIN - IDC_BEHAVIOR, 0x1234, 12, 0 -0x6853, 0x776f, 0x6120, 0x776c, 0x7961, 0x0073, - IDC_BEHAVIOR, 0x1234, 6, 0 -0x6f50, 0x7570, 0x0070, - IDC_BEHAVIOR, 0x1234, 12, 0 -0x6948, 0x6564, 0x6120, 0x776c, 0x7961, 0x0073, - IDC_MAXUNDO, 0x403, 3, 0 -0x3031, "\000" - IDC_MAXUNDO, 0x403, 3, 0 -0x3032, "\000" - IDC_MAXUNDO, 0x403, 3, 0 -0x3033, "\000" - IDC_MAXUNDO, 0x403, 3, 0 -0x3034, "\000" - IDC_MAXUNDO, 0x403, 3, 0 -0x3035, "\000" - IDC_MAXUNDO, 0x403, 3, 0 -0x3036, "\000" - IDC_MAXUNDO, 0x403, 3, 0 -0x3037, "\000" - IDC_MAXUNDO, 0x403, 3, 0 -0x3038, "\000" - IDC_MAXUNDO, 0x403, 3, 0 -0x3039, "\000" - IDC_BEHAVIOR2, 0x1234, 12, 0 -0x6853, 0x776f, 0x6120, 0x776c, 0x7961, 0x0073, - IDC_BEHAVIOR2, 0x1234, 12, 0 -0x6948, 0x6564, 0x6120, 0x776c, 0x7961, 0x0073, - IDC_BEHAVIOR2, 0x1234, 15, 0 -0x6948, 0x6564, 0x6920, 0x2066, 0x6e75, 0x7375, 0x6465, "\000" - 0 -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/xash.dsw b/xash.dsw index 04cfd49b..71c10fd6 100644 --- a/xash.dsw +++ b/xash.dsw @@ -75,18 +75,6 @@ Package=<4> ############################################################################### -Project: "viewer"=".\viewer\viewer.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - Project: "vprogs"=".\vprogs\vprogs.dsp" - Package Owner=<4> Package=<5>