当前位置: 首页>>代码示例>>C++>>正文


C++ MyString::Empty方法代码示例

本文整理汇总了C++中MyString::Empty方法的典型用法代码示例。如果您正苦于以下问题:C++ MyString::Empty方法的具体用法?C++ MyString::Empty怎么用?C++ MyString::Empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MyString的用法示例。


在下文中一共展示了MyString::Empty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mac_get_resource_path

void mac_get_resource_path(const char *_path,MyString& _resPath)
{
    CFURLRef resourceURL;
    _resPath.Empty();
    
    // Look for the resource in the main bundle by name and type.
    
#ifdef ACTIVEGSPLUGIN
    CFBundleRef bundle =  CFBundleGetBundleWithIdentifier(__CFStringMakeConstantString("com.freetoolsassociation.activegs"));
#else
    CFBundleRef bundle = CFBundleGetMainBundle();

#endif
    CFStringRef ce =   CFStringCreateWithCString(
                                                 NULL,
                                                 _path,
                                                 kCFStringEncodingASCII);
    resourceURL = CFBundleCopyResourceURL(
    bundle,
    ce,
    NULL,
    NULL
    );
    
    if(!resourceURL)
    {
        printf("Failed to locate a file in the loaded bundle! (%s)",_path);
        return;
    }
    
    char fileurl[1024]; 
    
    if(!CFURLGetFileSystemRepresentation(
                                         resourceURL,
                                         true,
                                         (UInt8*)
                                         fileurl,
                                         1024))
        
    {
        printf("Failed to turn a bundle resource URL into a filesystem path representation!");
        return;
    }
    

    
    _resPath = fileurl;
        
    
}
开发者ID:aufflick,项目名称:activegs-ios,代码行数:50,代码来源:CEmulatorCtrlMac.cpp

示例2: x_async_refresh

void x_async_refresh(CGContextRef myContext,CGRect myBoundingBox)
{
	
#ifdef ENABLEQD
	CEmulatorMac* pEmu = (CEmulatorMac*)CEmulator::theEmulator;
	if (!pEmu) return ;
#endif
    
#ifndef DRIVER_IOS
	x_vbl_count++;
#endif
	
	addFrameRate(0);

	CHANGE_BORDER(1,0xFF);
	
	// OG
	if (macUsingCoreGraphics)
	{
		if(r_sim65816.is_emulator_offscreen_available() && g_kimage_offscreen.dev_handle)
		{
	
            /*
			void addConsoleWindow(Kimage* _dst);
			addConsoleWindow(&g_kimage_offscreen);
	*/
            
			CGContextSaveGState(myContext);
			
#ifndef DRIVER_IOS
		//	CGContextTranslateCTM(myContext,0.0, X_A2_WINDOW_HEIGHT);
        	CGContextTranslateCTM(myContext,0.0, myBoundingBox.size.height);    
			CGContextScaleCTM(myContext,1.0,-1.0);
#endif
			
			
			CGImageRef myImage = CGBitmapContextCreateImage((CGContextRef)g_kimage_offscreen.dev_handle);
            
            
            
			CGContextDrawImage(myContext, myBoundingBox, myImage);// 6
	
#ifndef VIDEO_SINGLEVLINE
			if (r_sim65816.get_video_fx() == VIDEOFX_CRT)
			{
                

				CGContextSetRGBFillColor(myContext,0,0,0,0.5);
				for(int h=0;h<g_kimage_offscreen.height;h+=2)
				{
					CGRect r = CGRectMake(0,h,g_kimage_offscreen.width_act,1);
					CGContextFillRect(myContext,r);
				}
                
			}            
           
#endif
            
			CGImageRelease(myImage);
		
			CGContextRestoreGState(myContext);
#ifndef DRIVER_IOS
			if (!messageLine.IsEmpty())
			{
				CGContextSaveGState(myContext);
				CGContextSetTextMatrix(myContext,CGAffineTransformIdentity);
				CGContextTranslateCTM(myContext,0.0, X_A2_WINDOW_HEIGHT);
				CGContextScaleCTM(myContext,1.0,-1.0);

				CGContextSelectFont(myContext, "Courier", 14.0, kCGEncodingMacRoman);
				CGContextSetTextDrawingMode(myContext, kCGTextFill);
				CGContextSetRGBFillColor (myContext, 1,1, 1, 1);
				CGContextSetShouldAntialias(myContext, true);
#define SHADOW 4.0
                

                CGFloat           myColorValues[] = {0.5, 0.5, 0.5, 1.0};
                
               
                CGColorSpaceRef  myColorSpace = CGColorSpaceCreateDeviceRGB ();// 9
                 CGColorRef  myColor = CGColorCreate (myColorSpace, myColorValues);
				CGContextSetShadowWithColor(myContext, CGSizeMake(SHADOW, -SHADOW), 4,
                                            myColor
                                            //CGColorCreateGenericGray(0.5,1.0)
                    
                                            );
				CGContextShowTextAtPoint(myContext, 20.0, X_A2_WINDOW_HEIGHT-20.0, messageLine.c_str(), messageLine.GetLength());
			
				CGContextRestoreGState(myContext);
				messageLineVBL--;
				if (messageLineVBL<0)
					messageLine.Empty();
				else 
					x_refresh_video();

			}
#endif
			
		}
		else
//.........这里部分代码省略.........
开发者ID:aufflick,项目名称:activegs-ios,代码行数:101,代码来源:macdriver_activegs.cpp


注:本文中的MyString::Empty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。