• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ _QERFuncTable_1类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中_QERFuncTable_1的典型用法代码示例。如果您正苦于以下问题:C++ _QERFuncTable_1类的具体用法?C++ _QERFuncTable_1怎么用?C++ _QERFuncTable_1使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: if

extern "C" void QERPlug_Dispatch(const char* p, vec3_t vMin, vec3_t vMax, bool bSingleBrush)
{
	if(!strcmp(p, "Create/Update WAD keypair"))
		UpdateWadKeyPair();
	else if(!strcmp(p, "About..."))
		g_FuncTable.m_pfnMessageBox((GtkWidget*)NULL, PLUGIN_ABOUT, "About", eMB_OK);
}
开发者ID:ChunHungLiu,项目名称:GtkRadiant,代码行数:7,代码来源:plugin.cpp


示例2: if

extern "C" void WINAPI QERPlug_Dispatch( LPCSTR p, vec3_t vMin, vec3_t vMax, bool bSingleBrush ){
	LoadLists();

	if ( !g_bBSPInitDone ) {
		g_BSPTable.m_nSize = sizeof( _QERAppBSPFrontendTable );
		if ( g_FuncTable.m_pfnRequestInterface( QERAppBSPFrontendTable_GUID, static_cast<LPVOID>( &g_BSPTable ) ) ) {
			g_bBSPInitDone = TRUE;
		}
		else
		{
			Sys_ERROR( "_QERAppBSPFrontendTable interface request failed\n" );
			return;
		}
	}

	if ( !strcmp( p, "About..." ) ) {
		DoMessageBox( PLUGIN_ABOUT, "About", IDOK );
	}
	else if ( !strcmp( p, "Colour Changer..." ) ) {
		DoCTFColourChanger();
	}
	else if ( !strcmp( p, "Swap Light Colours" ) ) {
		DoSwapLights();
	}
	else if ( !strcmp( p, "Change Angles 180" ) ) {
		DoChangeAngles();
	}
	else if ( !strcmp( p, "Swap Spawn Points" ) ) {
		DoSwapSpawns();
	}
}
开发者ID:0bsidian,项目名称:GtkRadiant,代码行数:31,代码来源:ctfToolz-GTK.cpp


示例3:

extern "C" void QERPlug_Dispatch (const char *p, vec3_t vMin, vec3_t vMax, bool bSingleBrush)
{
	if (!strcmp(p, CMD_ABOUT)) {
		g_FuncTable.m_pfnMessageBox(NULL, PLUGIN_ABOUT, "About", MB_OK, NULL);
	} else {
		Sys_Printf("Message: %s\n", p);
	}
}
开发者ID:AEonZR,项目名称:GtkRadiant,代码行数:8,代码来源:plugin.cpp


示例4: Textool_Cancel

void Textool_Cancel(){
	if ( !g_bPatch ) {
		// tell Radiant to update (will also send update windows messages )
		g_SelectedFaceTable.m_pfnSetFaceInfo( 0, &g_CancelFaceData );
	}
	else
	{
		*g_pPatch = g_CancelPatch;
		g_pPatch->bDirty = true;
		g_FuncTable.m_pfnSysUpdateWindows( W_CAMERA );
	}
	// do not call destroy, decref it
	g_pToolWnd->DecRef();
	g_pToolWnd = NULL;
}
开发者ID:Crowbar-Sledgehammer,项目名称:GtkRadiant,代码行数:15,代码来源:TexTool.cpp


示例5: Textool_Validate

void Textool_Validate(){
	// validate current situation into the main view
	g_pManager->Commit();
	// for a brush face we have an aditionnal step
	if ( !g_bPatch ) {
		// tell Radiant to update (will also send update windows messages )
		g_SelectedFaceTable.m_pfnSetFaceInfo( 0, &g_SelectedFaceData );
	}
	else
	{
		// ask to rebuild the patch display data
		g_pPatch->bDirty = true;
		// send a repaint to the camera window as well
		g_FuncTable.m_pfnSysUpdateWindows( W_CAMERA );
	}
	// we'll need to update after that as well:
	g_bTexViewReady = false;
	// send a repaint message
	g_pToolWnd->Redraw();
}
开发者ID:Crowbar-Sledgehammer,项目名称:GtkRadiant,代码行数:20,代码来源:TexTool.cpp


示例6: if

extern "C" void QERPlug_Dispatch(const char* p, vec3_t vMin, vec3_t vMax, bool bSingleBrush)
{
  #if 0
  // if it's the first call, perhaps we need some additional init steps
  if (!g_bQglInitDone)
  {
    g_QglTable.m_nSize = sizeof(_QERQglTable);
    if ( g_FuncTable.m_pfnRequestInterface( QERQglTable_GUID, static_cast<LPVOID>(&g_QglTable) ) )
    {
      g_bQglInitDone = true;
    }
    else
    {
      Sys_Printf("TexTool plugin: _QERQglTable interface request failed\n");
      return;
    }
  }

  if (!g_bSelectedFaceInitDone)
  {
    g_SelectedFaceTable.m_nSize = sizeof(_QERSelectedFaceTable);
    if (g_FuncTable.m_pfnRequestInterface (QERSelectedFaceTable_GUID,
					   static_cast<LPVOID>(&g_SelectedFaceTable)))
    {
      g_bSelectedFaceInitDone = true;
    }
    else
    {
      Sys_Printf("TexTool plugin: _QERSelectedFaceTable interface request failed\n");
      return;
    }
  }

  if (!g_bSurfaceTableInitDone)
  {
    g_SurfaceTable.m_nSize = sizeof(_QERAppSurfaceTable);
    if ( g_FuncTable.m_pfnRequestInterface( QERAppSurfaceTable_GUID, static_cast<LPVOID>(&g_SurfaceTable) ) )
    {
      g_bSurfaceTableInitDone = true;
    }
    else
    {
      Sys_Printf("TexTool plugin: _QERAppSurfaceTable interface request failed\n");
      return;
    }
  }

  if (!g_bUITable)
  {
    g_UITable.m_nSize = sizeof(_QERUITable);
    if ( g_FuncTable.m_pfnRequestInterface( QERUI_GUID, static_cast<LPVOID>(&g_UITable) ) )
    {
      g_bUITable = true;
    }
    else
    {
      Sys_Printf("TexTool plugin: _QERUITable interface request failed\n");
      return;
    }
  }
  #endif

  if (!strcmp(p, "About..."))
  {
    DoMessageBox (PLUGIN_ABOUT, "About ...", MB_OK );
  }
  else if (!strcmp(p, "Go..."))
  {
    if (!g_pToolWnd)
    {
      g_pToolWnd = g_UITable.m_pfnCreateGLWindow();
      g_pToolWnd->setSizeParm(300,300);
      g_pToolWnd->setName("TexTool");
      // g_Listener is a static class, we need to bump the refCount to avoid premature release problems
      g_Listen.IncRef();
      // setListener will incRef on the listener too
      g_pToolWnd->setListener(&g_Listen);
      if (!g_pToolWnd->Show())
      {
        DoMessageBox ("Error creating texture tools window!", "TexTool plugin", MB_ICONERROR | MB_OK);
        return;
      }
    }
    
    g_bTexViewReady = false;
    g_bClosing = false;
  }
  else if (!strcmp(p, "Help..."))
  {
    if (!g_bHelp)
      DoMessageBox ("Select a brush face (ctrl+shift+left mouse) or a patch, and hit Go...\n"
		    "See tutorials for more", "TexTool plugin", MB_OK );
    else
      DoMessageBox ("Are you kidding me ?", "TexTool plugin", MB_OK );
    g_bHelp = true;
  }
}
开发者ID:AEonZR,项目名称:GtkRadiant,代码行数:97,代码来源:TexTool.cpp


示例7: UpdateWadKeyPair

void UpdateWadKeyPair( void )
{
  int i,nb;

  char wads[2048]; // change to CString usage ?
  wads[0] = 0;
  char *p1,*p2;
  entity_t *pEntity;
  epair_t *pEpair;
  GSList *wadlist = NULL;
  face_t  *f;
  brush_t *b;
  char cleanwadname[QER_MAX_NAMELEN];
  const char *actualwad;


  pEntity = (entity_t *)g_FuncTable.m_pfnGetEntityHandle(0); // get the worldspawn ent

  Sys_Printf("Searching for in-use wad files...\n");
  for(pEpair = pEntity->epairs; pEpair != NULL; pEpair = pEpair->next)
  {
    if (stricmp(pEpair->key,"wad") == 0)
    {
      strcpy(wads,pEpair->value);
      ConvertDOSToUnixName(wads,wads);

      // ok, we got the list of ; delimited wads, now split it into a GSList that contains
      // just the wad names themselves.

      p1 = wads;

      do
      {
        p2 = strchr(p1,';');
        if (p2)
          *p2 = 0; // swap the ; with a null terminator

        if (strchr(p1,'/') || strchr(p1,'\\'))
        {
          ExtractFileName(p1,cleanwadname);
          wadlist = AddToWadList (wadlist, NULL, cleanwadname);
        }
        else
        {
          wadlist = AddToWadList (wadlist, NULL, p1);
        }
        if (p2)
          p1 = p2+1; // point back to the remainder of the string
        else
          p1 = NULL; // make it so we exit the loop.

      } while (p1);

      // ok, now we have a list of wads in GSList.
      // now we need to add any new wadfiles (with their paths) to this list
      // so scan all brushes and see what wads are in use
      // FIXME: scan brushes only in the region ?

      break; // we don't need to process any more key/pairs.
    }
  }

  nb = g_FuncTable.m_pfnAllocateActiveBrushHandles();
  for( i = 0; i < nb; i++ )
	{
    b = (brush_t *)g_FuncTable.m_pfnGetActiveBrushHandle(i);
    if (b->patchBrush) // patches in halflife ?
    {
      wadlist = AddToWadList(wadlist, b->pPatch->pShader->getName(),NULL);
    } else
    {
      for (f=b->brush_faces ; f ; f=f->next)
      {
        wadlist = AddToWadList(wadlist, f->pShader->getName(),NULL);
      }
    }
  }
  g_FuncTable.m_pfnReleaseActiveBrushHandles();

  nb = g_FuncTable.m_pfnAllocateSelectedBrushHandles();
  for( i = 0; i < nb; i++ )
	{
    b = (brush_t *)g_FuncTable.m_pfnGetSelectedBrushHandle(i);
    if (b->patchBrush) // patches in halflife ?
    {
      wadlist = AddToWadList(wadlist, b->pPatch->pShader->getName(),NULL);
    } else
    {
      for (f=b->brush_faces ; f ; f=f->next)
      {
        wadlist = AddToWadList(wadlist, f->pShader->getName(),NULL);
      }
    }
  }
  g_FuncTable.m_pfnReleaseSelectedBrushHandles();

  // Now we have a complete list of wadnames (without paths) so we just have to turn this
  // back to a ; delimited list.

  wads[0] = 0;
//.........这里部分代码省略.........
开发者ID:ChunHungLiu,项目名称:GtkRadiant,代码行数:101,代码来源:plugin.cpp


示例8: if

extern "C" void QERPlug_Dispatch( const char* p, vec3_t vMin, vec3_t vMax, bool bSingleBrush ){
	Sys_Printf( MSG_PREFIX "Command \"%s\"\n",p );

	if ( !strcmp( p,Q3R_CMD_ABOUT ) ) {
		DoAboutDlg( GTK_WIDGET( g_pMainWidget ) );
	}
	else if ( !strcmp( p,Q3R_CMD_LOAD ) ) {
		CheckInterfaces();

		if ( interfaces_started ) {
			if ( DoLoadPortalFileDialog( GTK_WIDGET( g_pMainWidget ) ) == IDOK ) {
				portals.Load();
				g_FuncTable.m_pfnSysUpdateWindows( UPDATE_ALL );
			}
			else
			{
				Sys_Printf( MSG_PREFIX "Portal file load aborted.\n", portals.fn );
			}
		}
	}
	else if ( !strcmp( p,Q3R_CMD_RELEASE ) ) {
		portals.Purge();

		if ( interfaces_started ) {
			g_FuncTable.m_pfnSysUpdateWindows( UPDATE_ALL );
		}

		Sys_Printf( MSG_PREFIX "Portals unloaded.\n" );
	}
	else if ( !strcmp( p,Q3R_CMD_SHOW_2D ) ) {
		portals.show_2d = !portals.show_2d;

		if ( interfaces_started ) {
			g_FuncTable.m_pfnSysUpdateWindows( UPDATE_ALL );
		}
		SaveConfig();

		if ( portals.show_2d ) {
			Sys_Printf( MSG_PREFIX "Portals will be rendered in 2D view.\n" );
		}
		else{
			Sys_Printf( MSG_PREFIX "Portals will NOT be rendered in 2D view.\n" );
		}
	}
	else if ( !strcmp( p,Q3R_CMD_SHOW_3D ) ) {
		portals.show_3d = !portals.show_3d;
		SaveConfig();

		if ( interfaces_started ) {
			g_FuncTable.m_pfnSysUpdateWindows( UPDATE_ALL );
		}

		if ( portals.show_3d ) {
			Sys_Printf( MSG_PREFIX "Portals will be rendered in 3D view.\n" );
		}
		else{
			Sys_Printf( MSG_PREFIX "Portals will NOT be rendered in 3D view.\n" );
		}
	}
	else if ( !strcmp( p,Q3R_CMD_OPTIONS ) ) {
		DoConfigDialog( GTK_WIDGET( g_pMainWidget ) );
		SaveConfig();

		if ( interfaces_started ) {
			g_FuncTable.m_pfnSysUpdateWindows( UPDATE_ALL );
		}
	}
}
开发者ID:thewolfteam,项目名称:GtkRadiant,代码行数:68,代码来源:prtview.cpp


示例9: LoadImage

void LoadImage (const char *filename, unsigned char **pic, int *width, int *height)
{
    png_byte** row_pointers;
    unsigned char *fbuffer = NULL;
    png_bytep p_fbuffer;

    int nLen = g_FileSystemTable.m_pfnLoadFile( (char *)filename, (void **)&fbuffer, 0 );
    if (nLen == -1)
        return;

    p_fbuffer = fbuffer;

    // the reading glue
    // http://www.libpng.org/pub/png/libpng-manual.html

    png_structp png_ptr = png_create_read_struct
                          (PNG_LIBPNG_VER_STRING, png_voidp_NULL,
                           user_error_fn, user_warning_fn);
    if (!png_ptr)
    {
        g_FuncTable.m_pfnSysPrintf ("libpng error: png_create_read_struct\n");
        return;
    }

    png_infop info_ptr = png_create_info_struct(png_ptr);
    if (!info_ptr) {
        png_destroy_read_struct(&png_ptr,
                                png_infopp_NULL, png_infopp_NULL);
        g_FuncTable.m_pfnSysPrintf ("libpng error: png_create_info_struct (info_ptr)\n");
        return;
    }

    png_infop end_info = png_create_info_struct(png_ptr);
    if (!end_info) {
        png_destroy_read_struct(&png_ptr, &info_ptr,
                                png_infopp_NULL);
        g_FuncTable.m_pfnSysPrintf ("libpng error: png_create_info_struct (end_info)\n");
        return;
    }

    // configure the read function
    png_set_read_fn(png_ptr, (voidp)&p_fbuffer, (png_rw_ptr)&user_read_data);

    if (setjmp(png_ptr->jmpbuf)) {
        png_destroy_read_struct(&png_ptr, &info_ptr,
                                &end_info);
        if (*pic)
        {
            g_free(*pic);
            free(row_pointers);
        }
        return;
    }

    png_read_info(png_ptr, info_ptr);

    int bit_depth = png_get_bit_depth(png_ptr, info_ptr);
    int color_type = png_get_color_type(png_ptr, info_ptr);

    // we want to treat all images the same way
    //   The following code transforms grayscale images of less than 8 to 8 bits,
    //   changes paletted images to RGB, and adds a full alpha channel if there is
    //   transparency information in a tRNS chunk.
    if (color_type == PNG_COLOR_TYPE_PALETTE)
        png_set_palette_to_rgb(png_ptr);

    if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
        png_set_gray_1_2_4_to_8(png_ptr);

    if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
        png_set_tRNS_to_alpha(png_ptr);

    if ( ! ( color_type & PNG_COLOR_MASK_ALPHA ) ) {
        // Set the background color to draw transparent and alpha images over.
        png_color_16 my_background, *image_background;

        if (png_get_bKGD(png_ptr, info_ptr, &image_background))
            png_set_background(png_ptr, image_background,
                               PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
        else
            png_set_background(png_ptr, &my_background,
                               PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0);

        // Add alpha byte after each RGB triplet
        png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
    }

    // read the sucker in one chunk
    png_read_update_info(png_ptr, info_ptr);

    color_type = png_get_color_type(png_ptr, info_ptr);
    bit_depth = png_get_bit_depth(png_ptr, info_ptr);

    *width = png_get_image_width(png_ptr, info_ptr);
    *height = png_get_image_height(png_ptr, info_ptr);

    // allocate the pixel buffer, and the row pointers
    int size = (*width)*(*height)*4;
    // still have to use that g_malloc heresy
    *pic = (unsigned char *)g_malloc(size);
//.........这里部分代码省略.........
开发者ID:AEonZR,项目名称:GtkRadiant,代码行数:101,代码来源:plugin.cpp


示例10: user_error_fn

void user_error_fn(png_structp png_ptr, png_const_charp error_msg)
{
    g_FuncTable.m_pfnSysPrintf ("libpng error: %s\n", error_msg);
    longjmp(png_ptr->jmpbuf, 0);
}
开发者ID:AEonZR,项目名称:GtkRadiant,代码行数:5,代码来源:plugin.cpp


示例11: user_warning_fn

void user_warning_fn(png_structp png_ptr, png_const_charp warning_msg)
{
    g_FuncTable.m_pfnSysPrintf ("libpng warning: %s\n", warning_msg);
}
开发者ID:AEonZR,项目名称:GtkRadiant,代码行数:4,代码来源:plugin.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ _RecordsetPtr类代码示例发布时间:2022-05-31
下一篇:
C++ _List类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap