Previous 15994 Revisions Next

r10285 Friday 4th February, 2011 at 10:47:20 UTC by Miodrag Milanović
Updated OSD part so newui is back in place, note that option is now called "menu", also available in WINUI as "Show Menu" in same place as before.
[src/mess/osd/winui]winui.mak
[src/osd/windows]input.c winalloc.c window.c window.h windows.mak winmain.c winmain.h winmenu.c*
[src/osd/winui]mameui.rc menu.c properties.c propertiesms.c resourcems.h

src/osd/windows/windows.mak
r10284r10285
289289   $(WINOBJ)/sound.o \
290290   $(WINOBJ)/video.o \
291291   $(WINOBJ)/window.o \
292   $(WINOBJ)/winmenu.o \
292293   $(WINOBJ)/winmain.o
293294
294295ifeq ($(DIRECT3D),9)
src/osd/windows/winmenu.c
r0r10285
1//============================================================
2//
3//  winmenu.c - Win32 OSD core dummy menu implementation
4//
5//============================================================
6//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
40//============================================================
41
42// standard windows headers
43#define WIN32_LEAN_AND_MEAN
44#include <windows.h>
45
46#include "window.h"
47
48//============================================================
49//  winwindow_video_window_proc_ui
50//  (window thread)
51//============================================================
52
53LRESULT CALLBACK winwindow_video_window_proc_ui(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam)
54{
55   return winwindow_video_window_proc(wnd, message, wparam, lparam);
56}
57
58//============================================================
59//  win_create_menu
60//============================================================
61
62int win_create_menu(running_machine *machine, HMENU *menus)
63{
64   return 0;
65}
No newline at end of file
src/osd/windows/input.c
r10284r10285
14861486
14871487static BOOL CALLBACK dinput_joystick_enum(LPCDIDEVICEINSTANCE instance, LPVOID ref)
14881488{
1489   DWORD cooperative_level = (HAS_WINDOW_MENU ? DISCL_BACKGROUND : DISCL_FOREGROUND) | DISCL_EXCLUSIVE;
1489   DWORD cooperative_level = DISCL_FOREGROUND | DISCL_EXCLUSIVE;
14901490   int axisnum, axiscount, povnum, butnum;
14911491   running_machine *machine = (running_machine *)ref;
14921492   device_info *devinfo;
14931493   HRESULT result;
14941494
1495   if (win_window_list != NULL && win_has_menu(win_window_list)) {
1496      cooperative_level = DISCL_BACKGROUND | DISCL_EXCLUSIVE;
1497   }
14951498   // allocate and link in a new device
14961499   devinfo = dinput_device_create(machine, &joystick_list, instance, &c_dfDIJoystick, NULL, cooperative_level);
14971500   if (devinfo == NULL)
src/osd/windows/winmain.c
r10284r10285
312312   { "prescale",                 "1",        0,                 "scale screen rendering by this amount in software" },
313313   { "waitvsync",                "0",        OPTION_BOOLEAN,    "enable waiting for the start of VBLANK before flipping screens; reduces tearing effects" },
314314   { "syncrefresh",              "0",        OPTION_BOOLEAN,    "enable using the start of VBLANK for throttling instead of the game time" },
315   { "menu",                      "0",        OPTION_BOOLEAN,    "enable menu bar if available by UI implementation" },
315316
316317   // DirectDraw-specific options
317318   { NULL,                       NULL,       OPTION_HEADER,     "DIRECTDRAW-SPECIFIC OPTIONS" },
src/osd/windows/window.c
r10284r10285
830830      // initialize the description of the window class
831831      wc.lpszClassName   = TEXT("MAME");
832832      wc.hInstance      = GetModuleHandle(NULL);
833#ifdef MENU_BAR
834      LRESULT CALLBACK winwindow_video_window_proc_ui(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam);
835833      wc.lpfnWndProc      = winwindow_video_window_proc_ui;
836#else
837      wc.lpfnWndProc      = winwindow_video_window_proc;
838#endif
839834      wc.hCursor         = LoadCursor(NULL, IDC_ARROW);
840835      wc.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
841836
r10284r10285
11261121   monitorbounds = window->monitor->info.rcMonitor;
11271122
11281123   // create the window menu if needed
1129#if HAS_WINDOW_MENU
1130   if (win_create_menu(window->machine, &menu))
1131      return 1;
1132#endif
1124   if (options_get_bool(mame_options(), "menu")) {
1125      if (win_create_menu(window->machine, &menu))
1126         return 1;
1127   }
11331128
11341129   // create the window, but don't show it yet
11351130   window->hwnd = win_create_window_ex_utf8(
r10284r10285
12211216
12221217      // non-client paint: punt if full screen
12231218      case WM_NCPAINT:
1224         if (!window->fullscreen || HAS_WINDOW_MENU)
1219         if (!window->fullscreen || win_has_menu(window))
12251220            return DefWindowProc(wnd, message, wparam, lparam);
12261221         break;
12271222
src/osd/windows/winmain.h
r10284r10285
6969#define WINOPTION_PRESCALE            "prescale"
7070#define WINOPTION_WAITVSYNC            "waitvsync"
7171#define WINOPTION_SYNCREFRESH         "syncrefresh"
72#define WINOPTION_MENU               "menu"
7273
7374// DirectDraw-specific options
7475#define WINOPTION_HWSTRETCH            "hwstretch"
src/osd/windows/winalloc.c
r10284r10285
582582   InitializeCriticalSection(&memory_lock);
583583
584584   // determine if we enabled by default
585#if defined(WINUI)
586   use_malloc_tracking = FALSE;
587#else
588   use_malloc_tracking = TRUE;
589#endif
585   if (win_is_gui_application()) {
586      use_malloc_tracking = FALSE;
587   } else {
588      use_malloc_tracking = TRUE;
589   }
590590
591591   // now allow overrides by the environment
592592   envstring = _tgetenv(_T("OSDDEBUGMALLOC"));
src/osd/windows/window.h
r10284r10285
5050//  PARAMETERS
5151//============================================================
5252
53#ifndef MENU_BAR
54#define HAS_WINDOW_MENU         FALSE
55#else
56#define HAS_WINDOW_MENU         TRUE
57#endif
5853
59
60
6154//============================================================
6255//  CONSTANTS
6356//============================================================
r10284r10285
153146win_monitor_info *winwindow_video_window_monitor(win_window_info *window, const RECT *proposed);
154147
155148LRESULT CALLBACK winwindow_video_window_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam);
149extern LRESULT CALLBACK winwindow_video_window_proc_ui(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam);
150
156151void winwindow_toggle_full_screen(void);
157152
158153void winwindow_process_events_periodic(running_machine *machine);
src/osd/winui/menu.c
r10284r10285
20132013   HMENU menu_bar = NULL;
20142014   HMODULE module;
20152015
2016//   if (options_get_bool(mame_options(), "newui"))
2017//   {
2018      module = win_resource_module();
2019      menu_bar = LoadMenu(module, MAKEINTRESOURCE(IDR_RUNTIME_MENU));
2020      if (!menu_bar)
2021         goto error;
2016   module = win_resource_module();
2017   menu_bar = LoadMenu(module, MAKEINTRESOURCE(IDR_RUNTIME_MENU));
2018   if (!menu_bar)
2019      goto error;
20222020
2023      if (win_setup_menus(machine, module, menu_bar))
2024         goto error;
2025//   }
2021   if (win_setup_menus(machine, module, menu_bar))
2022      goto error;
20262023
20272024   *menus = menu_bar;
20282025   return 0;
src/osd/winui/propertiesms.c
r10284r10285
495495   // MESS specific stuff
496496   datamap_add(properties_datamap, IDC_DIR_LIST,            DM_STRING,   NULL);
497497   datamap_add(properties_datamap, IDC_RAM_COMBOBOX,         DM_INT,      OPTION_RAMSIZE);
498//   datamap_add(properties_datamap, IDC_USE_NEW_UI,            DM_BOOL,   "newui");
499498
500499   // set up callbacks
501500   datamap_set_callback(properties_datamap, IDC_DIR_LIST,      DCT_READ_CONTROL,      DirListReadControl);
src/osd/winui/resourcems.h
r10284r10285
1212#define IDC_FILTER_COMPUTER             2004
1313#define IDC_FILTER_CONSOLE              2005
1414#define IDC_FILTER_MODIFIED             2006
15#define IDC_USE_NEW_UI                  2007
15#define IDC_SHOW_MENU                   2007
1616#define IDC_RAM_COMBOBOX            2008
1717#define IDC_RAM_CAPTION               2009
1818#define IDC_SOFTLIST               2010
src/osd/winui/mameui.rc
r10284r10285
10271027    PUSHBUTTON      "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
10281028    PUSHBUTTON      "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,
10291029                    0,0,HIDC_USE_DEFAULT
1030    CONTROL         "Show Menu",IDC_SHOW_MENU,"Button",
1031                    BS_AUTOCHECKBOX | WS_TABSTOP,119,134,86,10,0
1032               
10301033END
10311034
10321035IDD_PROP_VECTOR DIALOGEX 0, 0, 220, 240
src/osd/winui/properties.c
r10284r10285
129129#include "mui_audit.h"
130130#include "mui_opts.h"
131131#include "resource.h"
132#include "resourcems.h"
132133#include "dijoystick.h"     /* For DIJoystick avalibility. */
133134#include "mui_util.h"
134135#include "directdraw.h"
r10284r10285
24582459
24592460   // input device options
24602461   datamap_add(properties_datamap, IDC_DUAL_LIGHTGUN,         DM_BOOL,   WINOPTION_DUAL_LIGHTGUN);
2462   
2463   // show menu
2464   datamap_add(properties_datamap, IDC_SHOW_MENU,            DM_BOOL,   WINOPTION_MENU);
24612465
2466
24622467   // set up callbacks
24632468   datamap_set_callback(properties_datamap, IDC_ROTATE,      DCT_READ_CONTROL,      RotateReadControl);
24642469   datamap_set_callback(properties_datamap, IDC_ROTATE,      DCT_POPULATE_CONTROL,   RotatePopulateControl);
src/mess/osd/winui/winui.mak
r10284r10285
88
99# build the executable names
1010RCFLAGS += -DMESS
11DEFS += -DMENU_BAR=1
1211
1312EMU_EXE = $(PREFIX)$(NAME)$(SUFFIX)$(SUFFIX64)$(SUFFIXDEBUG)$(EXE)
1413BUILD += $(EMU_EXE)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team