Previous 199869 Revisions Next

r34438 Saturday 17th January, 2015 at 14:59:43 UTC by Couriersud
Changed osd_font to struct osd_font and removed unnecessary osdepend.h
includes.
[src/emu]clifront.c clifront.h ioport.c machine.c machine.h mame.c mame.h render.h rendfont.c rendfont.h rendutil.h video.c webengine.c
[src/emu/ui]miscmenu.c
[src/lib/util]corefile.h options.h
[src/mess/includes]msx.h
[src/osd]osdcore.c osdepend.h
[src/osd/modules/lib]osdobj_common.c osdobj_common.h
[src/osd/sdl]draw13.c osdsdl.h sdlmain.c
[src/osd/windows]winmain.c winmain.h

trunk/src/emu/clifront.c
r242949r242950
2424
2525#include "drivenum.h"
2626
27#include "osdepend.h"
28
2729#include <new>
2830#include <ctype.h>
2931
trunk/src/emu/clifront.h
r242949r242950
1515
1616#include "emu.h"
1717#include "cliopts.h"
18#include "osdepend.h"
1918
19// don't include osd_interface in header files
20class osd_interface;
2021
2122//**************************************************************************
2223//  TYPE DEFINITIONS
trunk/src/emu/ioport.c
r242949r242950
9999#include "uiinput.h"
100100#include "debug/debugcon.h"
101101
102#include "osdepend.h"
103
102104#include <ctype.h>
103105#include <time.h>
104106
trunk/src/emu/machine.c
r242949r242950
106106//  RUNNING MACHINE
107107//**************************************************************************
108108
109osd_interface &running_machine::osd() const
110{
111    return m_manager.osd();
112}
113
109114//-------------------------------------------------
110115//  running_machine - constructor
111116//-------------------------------------------------
trunk/src/emu/machine.h
r242949r242950
1919
2020#include <time.h>
2121
22// forward declaration instead of osdepend.h
23class osd_interface;
2224
23
2425//**************************************************************************
2526//  CONSTANTS
2627//**************************************************************************
r242949r242950
157158   const machine_config &config() const { return m_config; }
158159   device_t &root_device() const { return m_config.root_device(); }
159160   const game_driver &system() const { return m_system; }
160   osd_interface &osd() const { return m_manager.osd(); }
161   osd_interface &osd() const;
161162   machine_manager &manager() const { return m_manager; }
162163   resource_pool &respool() { return m_respool; }
163164   device_scheduler &scheduler() { return m_scheduler; }
trunk/src/emu/mame.c
r242949r242950
9292
9393machine_manager* machine_manager::m_manager = NULL;
9494
95osd_interface &machine_manager::osd() const
96{
97    return m_osd;
98}
99
100
95101machine_manager* machine_manager::instance(emu_options &options,osd_interface &osd)
96102{
97103   if(!m_manager)
trunk/src/emu/mame.h
r242949r242950
2222
2323#include "webengine.h"
2424
25class osd_interface;
2526
2627//**************************************************************************
2728//    CONSTANTS
r242949r242950
8889   static machine_manager *instance();
8990   ~machine_manager();
9091
91   osd_interface &osd() const { return m_osd; }
92   osd_interface &osd() const;
9293   emu_options &options() const { return m_options; }
9394   web_engine *web() { return &m_web; }
9495   lua_engine *lua() { return &m_lua; }
trunk/src/emu/render.h
r242949r242950
4646#ifndef __RENDER_H__
4747#define __RENDER_H__
4848
49#include "osdepend.h"
49//#include "osdepend.h"
5050
5151#include <math.h>
5252
trunk/src/emu/rendfont.c
r242949r242950
1414#include "emuopts.h"
1515#include <zlib.h>
1616
17#include "osdepend.h"
1718#include "uismall.fh"
1819
1920
trunk/src/emu/rendfont.h
r242949r242950
1313
1414#include "render.h"
1515
16// forward instead of include
17class osd_font;
1618
1719//**************************************************************************
1820//  TYPE DEFINITIONS
r242949r242950
9193   dynamic_array<glyph> m_glyphs[256];     // array of glyph subtables
9294   dynamic_array<char> m_rawdata;          // pointer to the raw data for the font
9395   UINT64              m_rawsize;          // size of the raw font data
94   osd_font            m_osdfont;          // handle to the OSD font
96   osd_font            *m_osdfont;          // handle to the OSD font
9597
9698   // constants
9799   static const int CACHED_CHAR_SIZE       = 12;
trunk/src/emu/rendutil.h
r242949r242950
1212#ifndef __RENDUTIL_H__
1313#define __RENDUTIL_H__
1414
15#include "osdepend.h"
1615#include "render.h"
1716
1817#include <math.h>
trunk/src/emu/ui/miscmenu.c
r242949r242950
2323#include "ui/miscmenu.h"
2424#include "ui/filemngr.h"
2525
26#include "osdepend.h"
2627
2728/*-------------------------------------------------
2829    ui_slider_ui_handler - pushes the slider
trunk/src/emu/video.c
r242949r242950
2020
2121#include "snap.lh"
2222
23#include "osdepend.h"
2324
24
2525//**************************************************************************
2626//  DEBUGGING
2727//**************************************************************************
trunk/src/emu/webengine.c
r242949r242950
1616#include "webengine.h"
1717#include "lua.hpp"
1818
19#include "osdepend.h"
1920
20
2121//**************************************************************************
2222//  WEB ENGINE
2323//**************************************************************************
trunk/src/lib/util/corefile.h
r242949r242950
1414#define __COREFILE_H__
1515
1616#include <stdarg.h>
17#include "osdcore.h"
1817#include "astring.h"
1918#include "coretmpl.h"
2019
trunk/src/lib/util/options.h
r242949r242950
1111#ifndef __OPTIONS_H__
1212#define __OPTIONS_H__
1313
14#include "osdcore.h"
1514#include "corefile.h"
1615#include "tagmap.h"
1716
trunk/src/mess/includes/msx.h
r242949r242950
2424#include "formats/basicdsk.h"
2525#include "formats/fmsx_cas.h"
2626#include "formats/msx_dsk.h"
27//#include "osdepend.h"
2827#include "hashfile.h"
2928#include "machine/wd_fdc.h"
3029#include "imagedev/floppy.h"
trunk/src/osd/modules/lib/osdobj_common.c
r242949r242950
346346//  font with the given name
347347//-------------------------------------------------
348348
349osd_font osd_common_t::font_open(const char *name, int &height)
349osd_font *osd_common_t::font_open(const char *name, int &height)
350350{
351351   return NULL;
352352}
r242949r242950
357357//  a given OSD font
358358//-------------------------------------------------
359359
360void osd_common_t::font_close(osd_font font)
360void osd_common_t::font_close(osd_font *font)
361361{
362362}
363363
r242949r242950
370370//  pixel of a black & white font
371371//-------------------------------------------------
372372
373bool osd_common_t::font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
373bool osd_common_t::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
374374{
375375   return false;
376376}
trunk/src/osd/modules/lib/osdobj_common.h
r242949r242950
153153   virtual void customize_input_type_list(simple_list<input_type_entry> &typelist);
154154
155155   // font overridables
156   virtual osd_font font_open(const char *name, int &height);
157   virtual void font_close(osd_font font);
158   virtual bool font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
156   virtual osd_font *font_open(const char *name, int &height);
157   virtual void font_close(osd_font *font);
158   virtual bool font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
159159
160160   // video overridables
161161   virtual void *get_slider_list();
trunk/src/osd/osdcore.c
r242949r242950
5353
5454output_delegate osd_set_output_channel(output_channel channel, output_delegate callback)
5555{
56   assert(channel < OSD_OUTPUT_CHANNEL_COUNT);
57   assert(!callback.isnull());
56   if (!(channel < OSD_OUTPUT_CHANNEL_COUNT) || callback.isnull())
57    {
58       throw std::exception();
59    }
5860
5961   /* return the originals if requested */
6062   output_delegate prevcb = output_cb[channel];
trunk/src/osd/osdepend.h
r242949r242950
2727//============================================================
2828
2929// FIXME: We can do better than this
30typedef void *osd_font;
30class osd_font;
3131
3232// ======================> osd_interface
3333
r242949r242950
5353   virtual void customize_input_type_list(simple_list<input_type_entry> &typelist) = 0;
5454
5555   // font overridables
56   virtual osd_font font_open(const char *name, int &height) = 0;
57   virtual void font_close(osd_font font) = 0;
58   virtual bool font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) = 0;
56   virtual osd_font *font_open(const char *name, int &height) = 0;
57   virtual void font_close(osd_font *font) = 0;
58   virtual bool font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) = 0;
5959
6060   // video overridables
6161   virtual void *get_slider_list() = 0; // FIXME: returns slider_state *
trunk/src/osd/sdl/draw13.c
r242949r242950
134134    const HashT hash() const { return m_hash; }
135135    const UINT32 flags() const { return m_flags; }
136136    const bool is_pixels_owned() const { // do we own / allocated it ?
137        return m_sdl_access == SDL_TEXTUREACCESS_STATIC
138                && m_copyinfo->func != NULL ;
137        return false && ((m_sdl_access == SDL_TEXTUREACCESS_STATIC)
138                && (m_copyinfo->func != NULL)) ;
139139    }
140140
141141private:
142    Uint32              m_sdl_access;
142143    SDL_Renderer *      m_renderer;
143144    render_texinfo      m_texinfo;            // copy of the texture info
144145    HashT               m_hash;               // hash value for the texture (must be >= pointer size)
r242949r242950
149150
150151    int                 m_format;             // texture format
151152    SDL_BlendMode       m_sdl_blendmode;
152    Uint32              m_sdl_access;
153153
154154    texture_info *      m_next;               // next texture in the list
155155};
r242949r242950
490490   }
491491}
492492
493// FIXME: machine only used to access options.
493494int drawsdl2_init(running_machine &machine, sdl_draw_info *callbacks)
494495{
495496   const char *stemp;
r242949r242950
10071008
10081009texture_info::~texture_info()
10091010{
1011    if ( is_pixels_owned() && (m_pixels != NULL) )
1012        free(m_pixels);
10101013    SDL_DestroyTexture(m_texture_id);
1011    if ( is_pixels_owned() && m_pixels != NULL )
1012        free(m_pixels);
10131014}
10141015
10151016//============================================================
trunk/src/osd/sdl/osdsdl.h
r242949r242950
115115//  TYPE DEFINITIONS
116116//============================================================
117117
118typedef void *osd_font;
119
120//============================================================
121//  TYPE DEFINITIONS
122//============================================================
123
124118class sdl_options : public osd_options
125119{
126120public:
r242949r242950
193187   virtual void customize_input_type_list(simple_list<input_type_entry> &typelist);
194188
195189   // font overridables
196   virtual osd_font font_open(const char *name, int &height);
197   virtual void font_close(osd_font font);
198   virtual bool font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
190   virtual osd_font *font_open(const char *name, int &height);
191   virtual void font_close(osd_font *font);
192   virtual bool font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
199193
200194   virtual void video_register();
201195   virtual void sound_register();
trunk/src/osd/sdl/sdlmain.c
r242949r242950
717717//  font with the given name
718718//-------------------------------------------------
719719
720osd_font sdl_osd_interface::font_open(const char *_name, int &height)
720class osd_font
721721{
722public:
723    CTFontRef m_font;
724};
725
726osd_font *sdl_osd_interface::font_open(const char *_name, int &height)
727{
722728   CFStringRef font_name = NULL;
723729   CTFontRef ct_font = NULL;
724730   CTFontDescriptorRef font_descriptor;
r242949r242950
770776   line_height += CTFontGetLeading(ct_font);
771777   height = ceilf(line_height * EXTRA_HEIGHT);
772778
773   return (osd_font)ct_font;
779   osd_font *ret = global_alloc(osd_font);
780   ret->m_font = ct_font;
781   return ret;
774782}
775783
776784//-------------------------------------------------
r242949r242950
778786//  a given OSD font
779787//-------------------------------------------------
780788
781void sdl_osd_interface::font_close(osd_font font)
789void sdl_osd_interface::font_close(osd_font *font)
782790{
783   CTFontRef ct_font = (CTFontRef)font;
791   CTFontRef ct_font = font->m_font;
784792
785793   if( ct_font != NULL )
786794   {
787795      CFRelease( ct_font );
788796   }
797   global_free(font);
789798}
790799
791800//-------------------------------------------------
r242949r242950
796805//  pixel of a black & white font
797806//-------------------------------------------------
798807
799bool sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
808bool sdl_osd_interface::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
800809{
801810   UniChar uni_char;
802811   CGGlyph glyph;
803   CTFontRef ct_font = (CTFontRef)font;
812   CTFontRef ct_font = font->m_font;
804813   const CFIndex count = 1;
805814   CGRect bounding_rect, success_rect;
806815   CGContextRef context_ref;
r242949r242950
10091018//  font with the given name
10101019//-------------------------------------------------
10111020
1012osd_font sdl_osd_interface::font_open(const char *_name, int &height)
1021class osd_font
10131022{
1023public:
1024    TTF_Font *m_font;
1025};
1026
1027osd_font *sdl_osd_interface::font_open(const char *_name, int &height)
1028{
10141029   TTF_Font *font = (TTF_Font *)NULL;
10151030   bool bakedstyles = false;
10161031   int style = 0;
r242949r242950
10811096
10821097   height = TTF_FontLineSkip(font);
10831098
1084   return (osd_font)font;
1099   osd_font *ret = global_alloc(osd_font);
1100   ret->m_font = font;
1101   return ret;
10851102}
10861103
10871104//-------------------------------------------------
r242949r242950
10891106//  a given OSD font
10901107//-------------------------------------------------
10911108
1092void sdl_osd_interface::font_close(osd_font font)
1109void sdl_osd_interface::font_close(osd_font *font)
10931110{
1094   TTF_Font *ttffont;
1095
1096   ttffont = (TTF_Font *)font;
1097
1098   TTF_CloseFont(ttffont);
1111   TTF_CloseFont(font->m_font);
1112   global_free(font);
10991113}
11001114
11011115//-------------------------------------------------
r242949r242950
11061120//  pixel of a black & white font
11071121//-------------------------------------------------
11081122
1109bool sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
1123bool sdl_osd_interface::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
11101124{
11111125   TTF_Font *ttffont;
11121126   SDL_Surface *drawsurf;
11131127   SDL_Color fcol = { 0xff, 0xff, 0xff };
11141128   UINT16 ustr[16];
11151129
1116   ttffont = (TTF_Font *)font;
1130   ttffont = font->m_font;
11171131
11181132   memset(ustr,0,sizeof(ustr));
11191133   ustr[0] = (UINT16)chnum;
trunk/src/osd/windows/winmain.c
r242949r242950
719719//  font with the given name
720720//-------------------------------------------------
721721
722osd_font windows_osd_interface::font_open(const char *_name, int &height)
722osd_font *windows_osd_interface::font_open(const char *_name, int &height)
723723{
724724   // accept qualifiers from the name
725725   astring name(_name);
r242949r242950
751751
752752   // create the font
753753   height = logfont.lfHeight;
754   osd_font font = reinterpret_cast<osd_font>(CreateFontIndirect(&logfont));
754   osd_font *font = reinterpret_cast<osd_font *>(CreateFontIndirect(&logfont));
755755   if (font == NULL)
756756      return NULL;
757757
r242949r242950
783783//  a given OSD font
784784//-------------------------------------------------
785785
786void windows_osd_interface::font_close(osd_font font)
786void windows_osd_interface::font_close(osd_font *font)
787787{
788788   // delete the font ojbect
789789   if (font != NULL)
r242949r242950
799799//  pixel of a black & white font
800800//-------------------------------------------------
801801
802bool windows_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
802bool windows_osd_interface::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
803803{
804804   // create a dummy DC to work with
805805   HDC dummyDC = CreateCompatibleDC(NULL);
trunk/src/osd/windows/winmain.h
r242949r242950
253253   virtual void customize_input_type_list(simple_list<input_type_entry> &typelist);
254254
255255   // font overridables
256   virtual osd_font font_open(const char *name, int &height);
257   virtual void font_close(osd_font font);
258   virtual bool font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
256   virtual osd_font *font_open(const char *name, int &height);
257   virtual void font_close(osd_font *font);
258   virtual bool font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
259259
260260   virtual void video_register();
261261   virtual void sound_register();


Previous 199869 Revisions Next


© 1997-2024 The MAME Team