diff options
Diffstat (limited to 'src/osd')
| -rw-r--r-- | src/osd/osdepend.c | 18 | ||||
| -rw-r--r-- | src/osd/osdepend.h | 6 | ||||
| -rw-r--r-- | src/osd/osdmini/minifile.c | 2 | ||||
| -rw-r--r-- | src/osd/osdmini/osdmini.h | 10 | ||||
| -rw-r--r-- | src/osd/sdl/osdsdl.h | 6 | ||||
| -rw-r--r-- | src/osd/windows/winmain.c | 28 | ||||
| -rw-r--r-- | src/osd/windows/winmain.h | 12 |
7 files changed, 41 insertions, 41 deletions
diff --git a/src/osd/osdepend.c b/src/osd/osdepend.c index 8b3cf6d359a..33a352b599e 100644 --- a/src/osd/osdepend.c +++ b/src/osd/osdepend.c @@ -69,28 +69,28 @@ void osd_interface::init(running_machine &machine) // This function is responsible for initializing the OSD-specific // video and input functionality, and registering that functionality // with the MAME core. - // + // // In terms of video, this function is expected to create one or more // render_targets that will be used by the MAME core to provide graphics // data to the system. Although it is possible to do this later, the // assumption in the MAME core is that the user interface will be // visible starting at init() time, so you will have some work to // do to avoid these assumptions. - // + // // In terms of input, this function is expected to enumerate all input // devices available and describe them to the MAME core by adding // input devices and their attached items (buttons/axes) via the input // system. - // + // // Beyond these core responsibilities, init() should also initialize // any other OSD systems that require information about the current // running_machine. - // + // // This callback is also the last opportunity to adjust the options // before they are consumed by the rest of the core. - // + // // Future work/changes: - // + // // Audio initialization may eventually move into here as well, // instead of relying on independent callbacks from each system. // @@ -141,7 +141,7 @@ void osd_interface::wait_for_debugger(device_t &device, bool firststop) // // When implementing an OSD-driver debugger, this method should be // overridden to wait for input, process it, and return. It will be - // called repeatedly until a command is issued that resumes + // called repeatedly until a command is issued that resumes // execution. // } @@ -169,7 +169,7 @@ void osd_interface::update_audio_stream(const INT16 *buffer, int samples_this_fr void osd_interface::set_mastervolume(int attenuation) { // - // Attenuation is the attenuation in dB (a negative number). + // Attenuation is the attenuation in dB (a negative number). // To convert from dB to a linear volume scale do the following: // volume = MAX_VOLUME; // while (attenuation++ < 0) @@ -222,7 +222,7 @@ void osd_interface::font_close(osd_font font) //------------------------------------------------- // font_get_bitmap - allocate and populate a // BITMAP_FORMAT_ARGB32 bitmap containing the -// pixel values MAKE_ARGB(0xff,0xff,0xff,0xff) +// pixel values MAKE_ARGB(0xff,0xff,0xff,0xff) // or MAKE_ARGB(0x00,0xff,0xff,0xff) for each // pixel of a black & white font //------------------------------------------------- diff --git a/src/osd/osdepend.h b/src/osd/osdepend.h index b227844b571..878c02b0ffb 100644 --- a/src/osd/osdepend.h +++ b/src/osd/osdepend.h @@ -66,7 +66,7 @@ public: // construction/destruction osd_interface(); virtual ~osd_interface(); - + // getters running_machine &machine() const { assert(m_machine != NULL); return *m_machine; } @@ -77,14 +77,14 @@ public: // debugger overridables virtual void init_debugger(); virtual void wait_for_debugger(device_t &device, bool firststop); - + // audio overridables virtual void update_audio_stream(const INT16 *buffer, int samples_this_frame); virtual void set_mastervolume(int attenuation); // input overridables virtual void customize_input_type_list(input_type_desc *typelist); - + // font overridables virtual osd_font font_open(const char *name, int &height); virtual void font_close(osd_font font); diff --git a/src/osd/osdmini/minifile.c b/src/osd/osdmini/minifile.c index 53836f0807d..19dcd92eea0 100644 --- a/src/osd/osdmini/minifile.c +++ b/src/osd/osdmini/minifile.c @@ -183,7 +183,7 @@ osd_directory_entry *osd_stat(const char *path) result->name = (char *)(result + 1); result->type = ENTTYPE_NONE; result->size = 0; - + FILE *f = fopen(path, "rb"); if (f != NULL) { diff --git a/src/osd/osdmini/osdmini.h b/src/osd/osdmini/osdmini.h index aee9cd2ac64..d436f747607 100644 --- a/src/osd/osdmini/osdmini.h +++ b/src/osd/osdmini/osdmini.h @@ -53,22 +53,22 @@ public: // construction/destruction mini_osd_interface(); virtual ~mini_osd_interface(); - + // general overridables virtual void init(running_machine &machine); virtual void update(bool skip_redraw); // debugger overridables -// virtual void init_debugger(); -// virtual void wait_for_debugger(device_t &device, bool firststop); - +// virtual void init_debugger(); +// virtual void wait_for_debugger(device_t &device, bool firststop); + // audio overridables virtual void update_audio_stream(const INT16 *buffer, int samples_this_frame); virtual void set_mastervolume(int attenuation); // input overridables virtual void customize_input_type_list(input_type_desc *typelist); - + private: static void osd_exit(running_machine &machine); }; diff --git a/src/osd/sdl/osdsdl.h b/src/osd/sdl/osdsdl.h index 47535d88f76..fbf9d11859b 100644 --- a/src/osd/sdl/osdsdl.h +++ b/src/osd/sdl/osdsdl.h @@ -128,7 +128,7 @@ public: // construction/destruction sdl_osd_interface(); virtual ~sdl_osd_interface(); - + // general overridables virtual void init(running_machine &machine); virtual void update(bool skip_redraw); @@ -136,14 +136,14 @@ public: // debugger overridables virtual void init_debugger(); virtual void wait_for_debugger(device_t &device, bool firststop); - + // audio overridables virtual void update_audio_stream(const INT16 *buffer, int samples_this_frame); virtual void set_mastervolume(int attenuation); // input overridables virtual void customize_input_type_list(input_type_desc *typelist); - + private: static void osd_exit(running_machine &machine); }; diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c index 440243b8895..d0adc0344ab 100644 --- a/src/osd/windows/winmain.c +++ b/src/osd/windows/winmain.c @@ -693,13 +693,13 @@ osd_font windows_osd_interface::font_open(const char *_name, int &height) _tcsncpy(logfont.lfFaceName, face, sizeof(logfont.lfFaceName) / sizeof(TCHAR)); logfont.lfFaceName[sizeof(logfont.lfFaceName) / sizeof(TCHAR) - 1] = 0; osd_free(face); - + // create the font height = logfont.lfHeight; osd_font font = reinterpret_cast<osd_font>(CreateFontIndirect(&logfont)); if (font == NULL) return NULL; - + // select it into a temp DC and get the real font name HDC dummyDC = CreateCompatibleDC(NULL); HGDIOBJ oldfont = SelectObject(dummyDC, reinterpret_cast<HGDIOBJ>(font)); @@ -707,13 +707,13 @@ osd_font windows_osd_interface::font_open(const char *_name, int &height) GetTextFace(dummyDC, ARRAY_LENGTH(realname), realname); SelectObject(dummyDC, oldfont); DeleteDC(dummyDC); - + // if it doesn't match our request, fail char *utf = utf8_from_tstring(realname); int result = mame_stricmp(utf, name); osd_free(utf); - // if we didn't match, nuke our font and fall back + // if we didn't match, nuke our font and fall back if (result != 0) { DeleteObject(reinterpret_cast<HFONT>(font)); @@ -739,7 +739,7 @@ void windows_osd_interface::font_close(osd_font font) //------------------------------------------------- // font_get_bitmap - allocate and populate a // BITMAP_FORMAT_ARGB32 bitmap containing the -// pixel values MAKE_ARGB(0xff,0xff,0xff,0xff) +// pixel values MAKE_ARGB(0xff,0xff,0xff,0xff) // or MAKE_ARGB(0x00,0xff,0xff,0xff) for each // pixel of a black & white font //------------------------------------------------- @@ -749,7 +749,7 @@ bitmap_t *windows_osd_interface::font_get_bitmap(osd_font font, unicode_char chn // create a dummy DC to work with HDC dummyDC = CreateCompatibleDC(NULL); HGDIOBJ oldfont = SelectObject(dummyDC, reinterpret_cast<HGDIOBJ>(font)); - + // get the text metrics TEXTMETRIC metrics = { 0 }; GetTextMetrics(dummyDC, &metrics); @@ -763,11 +763,11 @@ bitmap_t *windows_osd_interface::font_get_bitmap(osd_font font, unicode_char chn GetCharWidth32(dummyDC, chnum, chnum, reinterpret_cast<LPINT>(&abc.abcB)); } width = abc.abcA + abc.abcB + abc.abcC; - + // determine desired bitmap size int bmwidth = (50 + abc.abcA + abc.abcB + abc.abcC + 50 + 31) & ~31; int bmheight = 50 + metrics.tmHeight + 50; - + // describe the bitmap we want BYTE bitmapinfodata[sizeof(BITMAPINFOHEADER) + 2 * sizeof(RGBQUAD)] = { 0 }; BITMAPINFO &info = *reinterpret_cast<BITMAPINFO *>(bitmapinfodata); @@ -784,7 +784,7 @@ bitmap_t *windows_osd_interface::font_get_bitmap(osd_font font, unicode_char chn info.bmiHeader.biClrImportant = 0; info.bmiColors[0].rgbBlue = info.bmiColors[0].rgbGreen = info.bmiColors[0].rgbRed = 0x00; info.bmiColors[1].rgbBlue = info.bmiColors[1].rgbGreen = info.bmiColors[1].rgbRed = 0xff; - + // create a DIB to render to BYTE *bits; HBITMAP dib = CreateDIBSection(dummyDC, &info, DIB_RGB_COLORS, reinterpret_cast<VOID **>(&bits), NULL, 0); @@ -793,7 +793,7 @@ bitmap_t *windows_osd_interface::font_get_bitmap(osd_font font, unicode_char chn // clear the bitmap int rowbytes = bmwidth / 8; memset(bits, 0, rowbytes * bmheight); - + // now draw the character WCHAR tempchar = chnum; SetTextColor(dummyDC, RGB(0xff,0xff,0xff)); @@ -804,7 +804,7 @@ bitmap_t *windows_osd_interface::font_get_bitmap(osd_font font, unicode_char chn rectangle actbounds; actbounds.min_y = 50; actbounds.max_y = 50 + metrics.tmHeight - 1; - + // determine the actual left of the character for (actbounds.min_x = 0; actbounds.min_x < rowbytes; actbounds.min_x++) { @@ -825,7 +825,7 @@ bitmap_t *windows_osd_interface::font_get_bitmap(osd_font font, unicode_char chn break; } } - + // determine the actual right of the character for (actbounds.max_x = rowbytes - 1; actbounds.max_x >= 0; actbounds.max_x--) { @@ -846,7 +846,7 @@ bitmap_t *windows_osd_interface::font_get_bitmap(osd_font font, unicode_char chn break; } } - + // allocate a new bitmap bitmap_t *bitmap = NULL; if (actbounds.max_x >= actbounds.min_x && actbounds.max_y >= actbounds.min_y) @@ -864,7 +864,7 @@ bitmap_t *windows_osd_interface::font_get_bitmap(osd_font font, unicode_char chn dstrow[x] = ((srcrow[effx / 8] << (effx % 8)) & 0x80) ? MAKE_ARGB(0xff,0xff,0xff,0xff) : MAKE_ARGB(0x00,0xff,0xff,0xff); } } - + // set the final offset values xoffs = actbounds.min_x - (50 + abc.abcA); yoffs = actbounds.max_y - (50 + metrics.tmAscent); diff --git a/src/osd/windows/winmain.h b/src/osd/windows/winmain.h index c3b3eb4b975..a3695c99ba0 100644 --- a/src/osd/windows/winmain.h +++ b/src/osd/windows/winmain.h @@ -140,30 +140,30 @@ public: // construction/destruction windows_osd_interface(); virtual ~windows_osd_interface(); - + // general overridables virtual void init(running_machine &machine); virtual void update(bool skip_redraw); // debugger overridables -// virtual void init_debugger(); +// virtual void init_debugger(); virtual void wait_for_debugger(device_t &device, bool firststop); - + // audio overridables virtual void update_audio_stream(const INT16 *buffer, int samples_this_frame); virtual void set_mastervolume(int attenuation); // input overridables virtual void customize_input_type_list(input_type_desc *typelist); - + // font overridables virtual osd_font font_open(const char *name, int &height); virtual void font_close(osd_font font); virtual bitmap_t *font_get_bitmap(osd_font font, unicode_char chnum, INT32 &width, INT32 &xoffs, INT32 &yoffs); - + private: static void osd_exit(running_machine &machine); - + static const int DEFAULT_FONT_HEIGHT = 200; }; |
