-
+164
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
>>>http://www.viva64.com/ru/a/0023/
#ifdef DEBUG_MODE
#define WriteLog printf
#else
inline int StubElepsisFunctionForLog(...) { return 0; }
static class StubClassForLog {
public:
inline void operator =(size_t) {}
private:
inline StubClassForLog &operator =(const StubClassForLog &)
{ return *this; }
} StubForLogObject;
#define WriteLog \
StubForLogObject = sizeof StubElepsisFunctionForLog
#endif
WriteLog("Coordinate = (%d, %d)\n", x, y);
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
ССЗБ?
P.S #define WriteLog(...)
or
#define WriteLog __noop
dc9e6c73ef5541f1,
05 Сентября 2011
-
+175
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
if (l1->Initilalize("4D353141",true))
StatusBarBottom->Panels->Items[2]->Text="Плата XXX загружена";
else StatusBarBottom->Panels->Items[2]->Text="Не обнаружена плата L791, ном. 4D353141";
if (l1->Initilalize("4D353129",true))
StatusBarBottom->Panels->Items[2]->Text="Платы XXX загружены";
else StatusBarBottom->Panels->Items[2]->Text="Не обнаружена плата XXX, ном. 4D353129";
if (l1->Initilalize("4D353129",true) && l1->Initilalize("4D353129",true) )
StatusBarBottom->Panels->Items[2]->Text="Загружены две платы XXX";
Копипаста - враг программиста. Чувак инициализировал одну плату 4 раза!!!
phys-tech,
05 Сентября 2011
-
+169
- 1
- 2
- 3
- 4
- 5
inline float _read_zbuf(int x, int y){
float v;
glReadPixels(x,screen.height-y+1,1,1,GL_DEPTH_COMPONENT,GL_FLOAT,&v);
return v;
}
>Для определения жизни под мышкой решил использовать изменение значений в буфере глубины, но glGetPixels уронил мне фпс на 300, и это один вызов финальной проверки, а что будет когда объекты проверятся начнут подумать страшно.
Неужели все так плохо ???
http://www.gamedev.ru/code/forum/?id=151921
CPPGovno,
03 Сентября 2011
-
+170
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
assert( top( o-------o
|L \
| L \
| o-------o
| ! !
! ! !
o | !
L | !
L| !
o-------o ) == ( o-------o
| !
! !
o-------o ) );
CPPGovno,
02 Сентября 2011
-
+164
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
ULONG LCard791::SetChn(int _gain,int _channel)
{
ULONG ret;
if(isDiff)
ret=_channel&15;
else
{
ret=_channel&31;
ret|=1<<5;
}
int gain;
switch(_gain)
{
case 1:
gain=0;
break;
case 2:
gain=1;
break;
case 4:
gain=2;
break;
case 8:
gain=3;
break;
case 16:
gain=4;
break;
case 32:
gain=5;
break;
case 64:
gain=6;
break;
case 128:
gain=7;
break;
default:
gain=0;
}
ret|=gain<<6;
return(ret);
}
Есть у нас один мужик, которые такие шедевры творит. Хакер сновидений, РАГ - мы с тобой!
phys-tech,
02 Сентября 2011
-
+147
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
template<typename _Tp>
pair<_Tp*, ptrdiff_t>
get_temporary_buffer(ptrdiff_t __len)
{
const ptrdiff_t __max =
__gnu_cxx::__numeric_traits<ptrdiff_t>::__max / sizeof(_Tp);
if (__len > __max)
__len = __max;
while (__len > 0)
{
_Tp* __tmp = static_cast<_Tp*>(::operator new(__len * sizeof(_Tp),
std::nothrow));
if (__tmp != 0)
return std::pair<_Tp*, ptrdiff_t>(__tmp, __len);
__len /= 2; // !?!?!?!?!?!?!?!?
}
return std::pair<_Tp*, ptrdiff_t>(static_cast<_Tp*>(0), 0);
}
template<typename _Tp>
inline void
return_temporary_buffer(_Tp* __p)
{ ::operator delete(__p, std::nothrow); }
CPPGovno,
02 Сентября 2011
-
+153
- 1
- 2
- 3
bool (A::*F[2])(int);
//...
return (this->*F[n])(i);
CPPGovno,
02 Сентября 2011
-
+147
CPPGovno,
02 Сентября 2011
-
+147
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
struct VS_INPUT_STRUCT //вхідні дані
{
float4 position: POSITION;
float3 normal: NORMAL;
};
struct VS_OUTPUT_STRUCT //вихідні дані
{
float4 position: POSITION;
float3 light: TEXCOORD0;
float3 normal: TEXCOORD1;
};
CPPGovno,
01 Сентября 2011
-
+172
- 1
- 2
char readByffer[102]={0};
std::string dataStrong = readByffer;
CPPGovno,
01 Сентября 2011