玄冬Wong
aigo · 共 616 篇文章
[置顶] 此博客永久停止更新,我的独立博客:dawnarc.com
告知:此博客永久停止更新,以后的文章只会更新到我的独立博客: https://dawnarc.com (2016-05-26夜晚·记) =============================================== 介绍两个静态页面博客框架:hexo和hugo Hexo 源码: https://github.com/hexojs/hexo 官网: https://hexo.io/ 介绍:使用hexo搭建github博客 http://yidao620c.github.io/2016/03/06/hexo.html Hugo 源码: https://github.com/spf…
[C++]比memcpy快50%的FastMemcpy
云风老大用汇编实现的一个高效memcpy,号称比传统memcpy快50% FastMemcpy https://github.com/skywind3000/FastMemcpy/blob/master/FastMemcpy.h#L580 不过VS2015编译器中已经做了类似的优化。
2016-05-26 13:03 · C/C++ · Optimization · 评论(0)
[UE4] C++实现Delegate Event实例(例子、example、sample)
相关文章: 如何用蓝图实现Delegate Event: http://aigo.iteye.com/blog/2269663 原文作者:@玄冬Wong 转载请注明出处: http://aigo.iteye.com/blog/2301010 虽然官方doc上说Event的Binding方式跟Multi-Cast用法完全一样,Multi-Cast论坛上也有很多例子,但是实际是不一样。。而且论坛上找不到相关例子。后来看了下runtime/core的源码,Event的binging方式如下(附上完整步骤): 1,先定义自定义Event,此例中我们定义在GameMode中,名字叫 MyInitEve…
2016-05-26 10:33 · UnrealEngine · 评论(0)
VS2015 update2 eng iso(英文版镜像文件官方下载地址)
Download Microsoft Visual Studio 2015 Update 2 [Web Installer] Download Microsoft Visual Studio 2015 Professional 14.0.25123.0 with Update 2 [Web Installer] Download Microsoft Visual Studio 2015 Professional 14.0.25123.0 with Update 2 [ISO] Download Microsoft Visual Studio 2015 Enterprise 14.0.2512…
2016-05-24 22:49 · VisualStudio · 评论(0)
[UE4]Fog Of War(战争迷雾)教程
[TUTORIAL] Fog Of War https://forums.unrealengine.com/showthread.php?55650-TUTORIAL-Fog-Of-War
2016-05-24 21:08 · UnrealEngine · 评论(0)
protobuf C++生成代码中使用自己定义类型参数时的set问题
如果proto结构体的变量是基础变量,比如int、string等等,那么set的时候直接调用set_xxx即可。 如果变量是自定义类型,那么C++的生成代码中,就没有set_xxx函数名,取而代之的是三个函数名: set_allocated_xxx() release_xxx() mutable_xxx() 使用set_allocated_xxx()来设置变量的时候,变量不能是普通栈内存数据,必须是手动new出来的指针,至于何时delete,就不需要调用者关心了,protobuf内部会自动delete掉通过set_allocated_设置的内存; release_xxx()是用来取消之前由s…
2016-05-23 22:11 · OpenSource · 评论(0)
[UE4]FSocket client客户端如何检测与server服务端断开链接
目前FScoket无法做到感知服务端关闭tcp链接,要做到只能通过两种其他方式: 1,使用BSD socket(建议使用non-blocking mode,因为这样方便终止接收线程); 2,客户端发送心跳包给服务端,如果没有得到回应则认为关闭。 下面方法仅适用于客户端自己关闭连接,如果是服务端关闭是没法感知的 if (Socket->GetConnectionState() != SCS_Connected) { // Socket disconnected } else { if (Socket->HasPendingData(Size)) { Socket->Recv(Data, Max…
2016-05-23 11:32 · UnrealEngine · 评论(0)
各个编程语言都无法表达出非2的幂的float型变量的问题
原文: http://stackoverflow.com/questions/588004/is-floating-point-math-broken 表现: 0.1+0.2==0.3->false 0.1+0.2->0.30000000000000004 Any ideas why this happens? 回答1: Binary floating point math is like this. In most programming languages, it is based on the IEEE 754 standard . JavaScript uses 64-bit flo…
2016-05-21 21:53 · Math · 评论(0)
比memcpy更快的内存拷贝:用赋值代替循环拷贝
原文是出自百度空间,百度空间早已关闭,所以原文出处无法查询了 相关衍生: 怎样写出一个更快的 memset/memcpy ? https://www.zhihu.com/question/35172305 以下内容转自: http://www.cnblogs.com/GoodGoodWorkDayDayUp/archive/2010/10/15/1852251.html 然间看到一个叫xmemcpy的工具,用做内存拷贝。号称在拷贝120字节以内时,比glibc提供的memcpy快10倍,并且有实验数据。 这让人感觉很诧异。一直以来都觉得memcpy是很高效的。相比于strcpy等函数的逐字节…
2016-05-21 12:40 · C/C++ · Optimization · 评论(0)
C++ 实现把非静态成员函数作为回调函数(非static)
C++ Thunk方式: https://blog.twofei.com/616/ 自定义代理类方式: 原文: http://qimo601.iteye.com/blog/1727645 CallbackProxy.h #ifndef __CALLBACK_PROXY_H__ #define __CALLBACK_PROXY_H__ //Tobject:调用对象的类型,Tparam回调函数参数的类型 template<typename Tobject, typename Tparam> class CCallbackProxy { typedef void (Tobject::*CbFun)…
2016-05-20 12:33 · C/C++ · 评论(0)
[C++]MFC使用CFile读写Unicode字符集文件(文件头缺失导致乱码)
原文: http://blog.csdn.net/augusdi/article/details/8961008 写入Unicode文本时,要在文件头部加入Unicode文本标志0XFEFF。 #include <stdio.h> #ifndef _UNICODE #define _UNICODE //使用UNICODE编码 #endif #include <Afx.h> //为了使用CString类 const int UNICODE_TXT_FLG = 0xFEFF; //UNICODE文本标示 int main() { FILE* WriteF; CString Wstr = _T("…
2016-05-19 21:19 · C/C++ · 评论(0)
Dlang IDEs
https://wiki.dlang.org/IDEs IDEs Integrated development environments with D support. Name Platforms Comments Version Last known activity Coedit Windows, Linux Projects, DUB json projects, runnable modules, unit test module, library manager, full DCD integration, symbol list, todo comments, custom t…
2016-05-19 14:47 · Dlang · 评论(0)
[UE4]Actor初始化时相关的父类函数
AActor::PreInitalizeComponents - Called before components of the actor are initialized AActor::PostInitalizeComponents - Called after every Component is initialized AActor::PostInitProperties - Called after Blueprint Properties are initialized 原文: https://answers.unrealengine.com/questions/156055/p…
2016-05-14 17:16 · UnrealEngine · 评论(0)
C++ fopen、CFile如何以UTF-8编码格式读写文件
How to write UTF-8 file with fprintf in C++ http://stackoverflow.com/questions/10028750/how-to-write-utf-8-file-with-fprintf-in-c ou shouldn't need to set your locale or set any special modes on the file if you just want to use fprintf. You simply have to use UTF-8 encoded strings. #include <cstdio…
2016-05-13 22:17 · C/C++ · 评论(0)
[UE4]UMG设置组件自适应居中或靠边
比如你的UI中有些组件需要居中显示,有些需要始终在右上角并且与上边框和右边框保持固定的距离等等,对于这种需要动态适应屏幕分辨率的UI组件,有两种设置方式: 1,直接编辑组件的属性Anchors 2,代码控制 ULoginWidget* LoginUI = NULL; //创建UI的逻辑省略 if (UImage* backImg = Cast<UImage>(LoginUI->GetWidgetFromName("ImgBackground"))) { //获取屏幕大小和中心点 const FVector2D ViewportSize = FVector2D(GEngine->GameVie…
2016-05-11 13:22 · UnrealEngine · 评论(0)