本文整理汇总了C++中MAKE_ID函数的典型用法代码示例。如果您正苦于以下问题:C++ MAKE_ID函数的具体用法?C++ MAKE_ID怎么用?C++ MAKE_ID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MAKE_ID函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: png_write
VOID png_write(struct RecorderData *data, APTR fh, APTR argb, ULONG modulo, ULONG width, ULONG height, ULONG dupcount)
{
struct png_header ihdr;
ULONG length, length2;
UBYTE *buffer;
buffer = data->writebuffer;
ihdr.width = width;
ihdr.height = height;
ihdr.depth = 8;
ihdr.colortype = 2; /* RGB */
ihdr.compression = 0;
ihdr.filter = 0;
ihdr.interlaced = 0;
length = write_chunk(buffer, sizeof(ihdr), LE_SWAPLONG_C(MAKE_ID('I','H','D','R')), &ihdr);
length2 = png_encode(&buffer[length], data->writebuffersize - length - 8, argb, modulo, width, height);
if (length2)
{
static const struct png_iend iend = { { 0, LE_SWAPLONG_C(MAKE_ID('I','E','N','D')) }, 0xae426082 };
ULONG i;
length += length2;
qcopy((APTR)&iend, &buffer[length], sizeof(iend));
for (i = 0; i < dupcount; i++)
{
dowrite(fh, buffer, length);
}
}
}
示例2: MIDIStreamer
HMISong::HMISong (FileReader &reader, EMidiDevice type)
: MIDIStreamer(type), MusHeader(0), Tracks(0)
{
#ifdef _WIN32
if (ExitEvent == NULL)
{
return;
}
#endif
int len = reader.GetLength();
if (len < 0x100)
{ // Way too small to be HMI.
return;
}
MusHeader = new BYTE[len];
SongLen = len;
NumTracks = 0;
if (reader.Read(MusHeader, len) != len)
return;
// Do some validation of the MIDI file
if (memcmp(MusHeader, HMI_SONG_MAGIC, sizeof(HMI_SONG_MAGIC)) == 0)
{
SetupForHMI(len);
}
else if (((DWORD *)MusHeader)[0] == MAKE_ID('H','M','I','M') &&
((DWORD *)MusHeader)[1] == MAKE_ID('I','D','I','P'))
{
SetupForHMP(len);
}
}
示例3: FPNGTexture
FTexture *PNGTexture_TryCreate(FileReader & data, int lumpnum)
{
union
{
uint32_t dw;
uint16_t w[2];
uint8_t b[4];
} first4bytes;
uint32_t width, height;
uint8_t bitdepth, colortype, compression, filter, interlace;
// This is most likely a PNG, but make sure. (Note that if the
// first 4 bytes match, but later bytes don't, we assume it's
// a corrupt PNG.)
data.Seek(0, SEEK_SET);
if (data.Read (first4bytes.b, 4) != 4) return NULL;
if (first4bytes.dw != MAKE_ID(137,'P','N','G')) return NULL;
if (data.Read (first4bytes.b, 4) != 4) return NULL;
if (first4bytes.dw != MAKE_ID(13,10,26,10)) return NULL;
if (data.Read (first4bytes.b, 4) != 4) return NULL;
if (first4bytes.dw != MAKE_ID(0,0,0,13)) return NULL;
if (data.Read (first4bytes.b, 4) != 4) return NULL;
if (first4bytes.dw != MAKE_ID('I','H','D','R')) return NULL;
// The PNG looks valid so far. Check the IHDR to make sure it's a
// type of PNG we support.
data.Read(&width, 4);
data.Read(&height, 4);
data >> bitdepth >> colortype >> compression >> filter >> interlace;
if (compression != 0 || filter != 0 || interlace > 1)
{
return NULL;
}
if (!((1 << colortype) & 0x5D))
{
return NULL;
}
if (!((1 << bitdepth) & 0x116))
{
return NULL;
}
// Just for completeness, make sure the PNG has something more than an IHDR.
data.Seek (4, SEEK_CUR);
data.Read (first4bytes.b, 4);
if (first4bytes.dw == 0)
{
data.Read (first4bytes.b, 4);
if (first4bytes.dw == MAKE_ID('I','E','N','D'))
{
return NULL;
}
}
return new FPNGTexture (data, lumpnum, FString(), BigLong((int)width), BigLong((int)height),
bitdepth, colortype, interlace);
}
示例4: FreeNonDehackedStrings
void FStringTable::LoadStrings (bool enuOnly)
{
int lastlump, lump;
int i, j;
FreeNonDehackedStrings ();
lastlump = 0;
while ((lump = Wads.FindLump ("LANGUAGE", &lastlump)) != -1)
{
j = 0;
if (!enuOnly)
{
LoadLanguage (lump, MAKE_ID('*',0,0,0), true, ++j);
for (i = 0; i < 4; ++i)
{
LoadLanguage (lump, LanguageIDs[i], true, ++j);
LoadLanguage (lump, LanguageIDs[i] & MAKE_ID(0xff,0xff,0,0), true, ++j);
LoadLanguage (lump, LanguageIDs[i], false, ++j);
}
}
// Fill in any missing strings with the default language
LoadLanguage (lump, MAKE_ID('*','*',0,0), true, ++j);
}
}
示例5: switch
long FoliageEffectFolFileEditGUI::HandleSCChange(NativeControl Handle, NativeGUIWin NW, int CtrlID)
{
NotifyTag Changes[2];
Changes[1] = 0;
switch (CtrlID)
{
case IDC_CHECKENABLED:
{
Changes[0] = MAKE_ID(Active->GetNotifyClass(), Active->GetNotifySubclass(), 0xff, WCS_NOTIFYCOMP_OBJECT_ENABLEDCHANGED);
GlobalApp->AppEx->GenerateNotify(Changes, Active->GetRAHostRoot());
break;
} // IDC_CHECKENABLED
case IDC_CHECKPREVIEWENABLED:
{
Changes[0] = MAKE_ID(Active->GetNotifyClass(), Active->GetNotifySubclass(), 0xff, WCS_NOTIFYCOMP_OBJECT_VALUECHANGED);
GlobalApp->AppEx->GenerateNotify(Changes, Active->GetRAHostRoot());
break;
} // IDC_CHECKPREVIEWENABLED
case IDC_CHECKDISSOLVEENABLED:
case IDC_CHECKRENDEROCCLUDED:
{
Changes[0] = MAKE_ID(Active->Ecotp.GetNotifyClass(), Active->Ecotp.GetNotifySubclass(), 0xff, WCS_NOTIFYCOMP_OBJECT_VALUECHANGED);
GlobalApp->AppEx->GenerateNotify(Changes, Active->Ecotp.GetRAHostRoot());
break;
} // IDC_CHECKDISSOLVEENABLED
default:
break;
} // switch CtrlID
return(0);
} // FoliageEffectFolFileEditGUI::HandleSCChange
示例6: CElemList
/*(@!*****************************************************************************************
* Nom : CElemCycle
* Role : definition du traitement sur un cycle
* --------------------------------------------------------------------------------------------
* Contraintes : sans objet
* Donnees en entree : sans objet
* Donnees en sortie : sans objet
* --------------------------------------------------------------------------------------------
* Pseudo code : sans objet
*
*****************************************************************************************@!)*/
CElemCycle::CElemCycle() : CElemList(NBR_CYCLE_STEP_MAX)
{
m_iType = MAKE_ID(0xFF,0xFF,eTYPE_CYCLE,0xFF);
SetLabel(_T("CElemCycle"));
//InitializeCriticalSection(&m_hCriticalSection);
CElemCycle::m_CurrentStep.SetType(MAKE_ID(0xFF,0xFF,eTYPE_CYCLE_STEP,eID_STREAM_CURRENT_STEP));
}
示例7: switch
long TerraffectorEditGUI::HandleSCChange(NativeControl Handle, NativeGUIWin NW, int CtrlID)
{
NotifyTag Changes[2];
Changes[1] = 0;
switch (CtrlID)
{
case IDC_CHECKENABLED:
{
Changes[0] = MAKE_ID(Active->GetNotifyClass(), Active->GetNotifySubclass(), 0xff, WCS_NOTIFYCOMP_OBJECT_ENABLEDCHANGED);
GlobalApp->AppEx->GenerateNotify(Changes, Active->GetRAHostRoot());
break;
} //
//case IDC_CHECKOVERLAP:
case IDC_CHECKSPLINE:
{
Changes[0] = MAKE_ID(Active->GetNotifyClass(), Active->GetNotifySubclass(), 0xff, WCS_NOTIFYCOMP_OBJECT_VALUECHANGED);
GlobalApp->AppEx->GenerateNotify(Changes, Active->GetRAHostRoot());
break;
} //
//case IDC_CHECKFLOATING:
// {
// EffectsHost->TerraffectorBase.SetFloating(EffectsHost->TerraffectorBase.Floating, ProjHost); // this sends the valuechanged message
// break;
// } //
default:
break;
} // switch CtrlID
return(0);
} // TerraffectorEditGUI::HandleSCChange
示例8: GetNativeInt
int XMISong::FindXMIDforms(const BYTE *chunk, int len, TrackInfo *songs) const
{
int count = 0;
for (int p = 0; p <= len - 12; )
{
int chunktype = GetNativeInt(chunk + p);
int chunklen = GetBigInt(chunk + p + 4);
if (chunktype == MAKE_ID('F','O','R','M'))
{
if (GetNativeInt(chunk + p + 8) == MAKE_ID('X','M','I','D'))
{
if (songs != NULL)
{
FoundXMID(chunk + p + 12, chunklen - 4, songs + count);
}
count++;
}
}
else if (chunktype == MAKE_ID('C','A','T',' '))
{
// Recurse to handle CAT chunks.
count += FindXMIDforms(chunk + p + 12, chunklen - 4, songs + count);
}
// IFF chunks are padded to even byte boundaries to avoid
// unaligned reads on 68k processors.
p += 8 + chunklen + (chunklen & 1);
// Avoid crashes from corrupt chunks which indicate a negative size.
if (chunklen < 0) p = len;
}
return count;
}
示例9: GUIFenetre
CoordsCalculatorGUI::CoordsCalculatorGUI(EffectsLib *EffectsSource, CoordSys *ActiveSource)
: GUIFenetre('CSCU', this, "Coordinate System Calculator") // Yes, I know...
{
static NotifyTag AllEvents[] = {
#ifdef WCS_BUILD_VNS
MAKE_ID(WCS_EFFECTSSUBCLASS_COORDSYS, 0xff, 0xff, 0xff),
#endif // WCS_BUILD_VNS
0};
static NotifyTag AllProjPrefsEvents[] = {MAKE_ID(WCS_PROJECTCLASS_PREFS, WCS_SUBCLASS_PROJPREFS_UNITS, 0xff, 0xff),
0};
ConstructError = 0;
EffectsHost = EffectsSource;
Source = ActiveSource;
Dest = NULL;
SetWinManFlags(WCS_FENETRE_WINMAN_NODOCK | WCS_FENETRE_WINMAN_NOPOPUP);
SourceElev.SetMetricType(WCS_ANIMDOUBLE_METRIC_HEIGHT);
DestElev.SetMetricType(WCS_ANIMDOUBLE_METRIC_HEIGHT);
ReverseElev.SetMetricType(WCS_ANIMDOUBLE_METRIC_HEIGHT);
if (EffectsSource)
{
GlobalApp->AppEx->RegisterClient(this, AllEvents);
GlobalApp->MainProj->RegisterClient(this, AllProjPrefsEvents);
} // if
else
ConstructError = 1;
} // CoordsCalculatorGUI::CoordsCalculatorGUI
示例10: MAKE_ID
void DEMEditGUI::HandleNotifyEvent(void)
{
NotifyTag *Changes, Interested[7];
int Done = 0;
DiagnosticData *Diagnostics;
if (! NativeWin)
return;
Changes = Activity->ChangeNotify->ChangeList;
Interested[0] = MAKE_ID(WCS_RAHOST_OBJTYPE_DEM, 0xff, 0xff, WCS_NOTIFYCOMP_OBJECT_COUNTCHANGED);
Interested[1] = NULL;
if (GlobalApp->AppEx->MatchNotifyClass(Interested, Changes, 0))
{
} // if DEM count changed
Interested[0] = MAKE_ID(WCS_PROJECTCLASS_PREFS, WCS_SUBCLASS_PROJPREFS_UNITS, 0xff, 0xff);
Interested[1] = NULL;
if (GlobalApp->AppEx->MatchNotifyClass(Interested, Changes, 0))
{
} // if units changed
if (Active)
{
Interested[0] = MAKE_ID(WCS_EFFECTSSUBCLASS_COORDSYS, 0xff, 0xff, 0xff);
Interested[1] = NULL;
if (GlobalApp->AppEx->MatchNotifyClass(Interested, Changes, 0))
{
ConfigureCoords();
Done = 1;
} // if
Interested[0] = MAKE_ID(Active->GetNotifyClass(), 0xff, 0xff, WCS_NOTIFYCOMP_OBJECT_VALUECHANGED);
Interested[1] = NULL;
if (GlobalApp->AppEx->MatchNotifyClass(Interested, Changes, 0))
{
DisableWidgets();
Done = 1;
} // if
Interested[0] = MAKE_ID(WCS_NOTIFYCLASS_DIAGNOSTICDATA, WCS_SUBCLASS_DIAGNOSTIC_DATA, 0xff, 0xff);
Interested[1] = NULL;
if (GlobalApp->AppEx->MatchNotifyClass(Interested, Changes, 0))
{
if (Diagnostics = (DiagnosticData *)Activity->ChangeNotify->NotifyData)
{
if (Diagnostics->ValueValid[WCS_DIAGNOSTIC_LATITUDE] && Diagnostics->ValueValid[WCS_DIAGNOSTIC_LONGITUDE])
SelectPoints(Diagnostics->Value[WCS_DIAGNOSTIC_LATITUDE], Diagnostics->Value[WCS_DIAGNOSTIC_LONGITUDE]);
} // if
Done = 1;
} // if
} // if
if (! Done)
ConfigureWidgets();
} // DEMEditGUI::HandleNotifyEvent()
示例11: while
//==========================================================================
//
// RenameNerve
//
// Renames map headers and map name pictures in nerve.wad so as to load it
// alongside Doom II and offer both episodes without causing conflicts.
// MD5 checksum for NERVE.WAD: 967d5ae23daf45196212ae1b605da3b0
//
//==========================================================================
void FWadCollection::RenameNerve ()
{
if (gameinfo.gametype != GAME_Doom)
return;
bool found = false;
BYTE cksum[16];
static const BYTE nerve[16] = { 0x96, 0x7d, 0x5a, 0xe2, 0x3d, 0xaf, 0x45, 0x19,
0x62, 0x12, 0xae, 0x1b, 0x60, 0x5d, 0xa3, 0xb0
};
size_t nervesize = 3819855; // NERVE.WAD's file size
int w = IWAD_FILENUM;
while (++w < GetNumWads())
{
FileReader *fr = GetFileReader(w);
if (fr == NULL)
{
continue;
}
if (fr->GetLength() != (long)nervesize)
{
// Skip MD5 computation when there is a
// cheaper way to know this is not the file
continue;
}
fr->Seek(0, SEEK_SET);
MD5Context md5;
md5.Update(fr, fr->GetLength());
md5.Final(cksum);
if (memcmp(nerve, cksum, 16) == 0)
{
found = true;
break;
}
}
if (!found)
return;
for (int i = GetFirstLump(w); i <= GetLastLump(w); i++)
{
// Only rename the maps from NERVE.WAD
assert(LumpInfo[i].wadnum == w);
if (LumpInfo[i].lump->dwName == MAKE_ID('C', 'W', 'I', 'L'))
{
LumpInfo[i].lump->Name[0] = 'N';
}
else if (LumpInfo[i].lump->dwName == MAKE_ID('M', 'A', 'P', '0'))
{
LumpInfo[i].lump->Name[6] = LumpInfo[i].lump->Name[4];
LumpInfo[i].lump->Name[5] = '0';
LumpInfo[i].lump->Name[4] = 'L';
LumpInfo[i].lump->dwName = MAKE_ID('L', 'E', 'V', 'E');
}
}
}
示例12: GUIFenetre
ProjectPrefsGUI::ProjectPrefsGUI(Project *Moi, InterCommon *ISource)
: GUIFenetre('PREF', this, "Preferences") // Yes, I know...
{
static NotifyTag AllICEvents[] = {MAKE_ID(WCS_INTERCLASS_VECTOR, WCS_INTERVEC_SUBCLASS_VALUE, WCS_INTERVEC_ITEM_PROJREFCOORD, 0xff),
MAKE_ID(WCS_INTERCLASS_VECTOR, WCS_INTERVEC_SUBCLASS_VALUE, WCS_INTERVEC_ITEM_PROJREFCOORDFLOAT, 0xff),
MAKE_ID(WCS_INTERCLASS_MISC, WCS_INTERMISC_SUBCLASS_MISC, WCS_INTERMISC_ITEM_PROJFRAMERATE, 0xff),
0};
static NotifyTag ProjEvents[] = {MAKE_ID(WCS_PROJECTCLASS_PATHS, 0xff, 0xff, 0xff),
MAKE_ID(WCS_PROJECTCLASS_PREFS, WCS_SUBCLASS_PROJPREFS_UNITS, 0xff, 0xff),
0};
double RangeDefaults[3];
ConstructError = 0;
HostProj = Moi;
InterStash = ISource;
MoveInProgress = 0;
SwapInProgress = 0;
#ifdef _WIN32
Curse = NULL;
#endif // _WIN32
strcpy(Dirname, HostProj->dirname);
DLCopy = HostProj->DirList_Copy(HostProj->DL);
RangeDefaults[0] = 90.0;
RangeDefaults[1] = -90.0;
RangeDefaults[2] = 1.0;
RefLatADT.SetDefaults(NULL, 0, HostProj->Interactive->GetProjRefCoords(WCS_INTERVEC_COMP_Y));
RefLatADT.SetRangeDefaults(RangeDefaults);
RefLatADT.SetMetricType(WCS_ANIMDOUBLE_METRIC_LATITUDE);
RefLatADT.SetFlags(WCS_ANIMCRITTER_FLAG_NONODES | WCS_ANIMCRITTER_FLAG_SUPPRESSNOTIFY | WCS_ANIMCRITTER_FLAG_SUPPRESSACTIVATE);
RangeDefaults[0] = 360.0;
RangeDefaults[1] = -360.0;
RangeDefaults[2] = 1.0;
RefLonADT.SetDefaults(NULL, 0, HostProj->Interactive->GetProjRefCoords(WCS_INTERVEC_COMP_X));
RefLonADT.SetRangeDefaults(RangeDefaults);
RefLonADT.SetMetricType(WCS_ANIMDOUBLE_METRIC_LONGITUDE);
RefLonADT.SetFlags(WCS_ANIMCRITTER_FLAG_NONODES | WCS_ANIMCRITTER_FLAG_SUPPRESSNOTIFY | WCS_ANIMCRITTER_FLAG_SUPPRESSACTIVATE);
RangeDefaults[0] = 1000000.0;
RangeDefaults[1] = -1000000.0;
RangeDefaults[2] = 1.0;
RefElevADT.SetDefaults(NULL, 0, HostProj->Interactive->GetProjRefCoords(WCS_INTERVEC_COMP_Z));
RefElevADT.SetRangeDefaults(RangeDefaults);
RefElevADT.SetMetricType(WCS_ANIMDOUBLE_METRIC_HEIGHT);
RefElevADT.SetFlags(WCS_ANIMCRITTER_FLAG_NONODES | WCS_ANIMCRITTER_FLAG_SUPPRESSNOTIFY | WCS_ANIMCRITTER_FLAG_SUPPRESSACTIVATE);
InterStash->RegisterClient(this, AllICEvents);
HostProj->RegisterClient(this, ProjEvents);
SetWinManFlags(WCS_FENETRE_WINMAN_NODOCK | WCS_FENETRE_WINMAN_NOPOPUP);
} // ProjectPrefsGUI::ProjectPrefsGUI
示例13: gl_DrawSavePic
//==========================================================================
//
// Draws the savegame picture with its original palette
//
//==========================================================================
void gl_DrawSavePic(DCanvas * canvas, const char * Filename, int x, int y, int dx, int dy)
{
static const char * cmp_filename=NULL;
static BYTE * cmp_buffer=NULL;
static union
{
DWORD palette[256];
BYTE pngpal[256][3];
};
DWORD len,id;
canvas->Lock();
// I hope this is sufficient!
if (cmp_filename!=Filename || canvas->GetBuffer()!=cmp_buffer)
{
cmp_filename = Filename;
cmp_buffer = canvas->GetBuffer();
// Read the palette from the savegame.
FILE * file = fopen (Filename, "rb");
if (file)
{
FileReader fr(file);
fr.Seek (33, SEEK_SET);
fr >> len >> id;
while (id != MAKE_ID('I','D','A','T') && id != MAKE_ID('I','E','N','D'))
{
len = BigLong((unsigned int)len);
if (id == MAKE_ID('P','L','T','E'))
{
int PaletteSize = MIN<int> (len / 3, 256);
fr.Read (pngpal, PaletteSize * 3);
if (PaletteSize * 3 != (int)len)
{
fr.Seek (len - PaletteSize * 3, SEEK_CUR);
}
for (int i = PaletteSize - 1; i >= 0; --i)
{
palette[i] = MAKERGB(pngpal[i][0], pngpal[i][1], pngpal[i][2]);
}
}
else
{
fr.Seek (len, SEEK_CUR);
}
fr >> len >> len; // Skip CRC
id = MAKE_ID('I','E','N','D');
fr >> id;
}
fclose(file);
}
else memcpy(palette, GPalette.BaseColors, sizeof(palette));
示例14: MAKE_ID
void ProjectPrefsGUI::DoCancel(void)
{
NotifyTag Changes[3];
Changes[0] = MAKE_ID(WCS_PROJECTCLASS_PATHS, WCS_PATHS_DIRLIST, 0, 0);
Changes[1] = MAKE_ID(WCS_PROJECTCLASS_PATHS, WCS_PATHS_DEFAULTDIR, 0, 0);
Changes[2] = 0;
swmem(&DLCopy, &HostProj->DL, sizeof (struct DirList *));
strcpy(HostProj->dirname, Dirname);
HostProj->GenerateNotify(Changes);
} // ProjectPrefsGUI::DoCancel()
示例15: add_serial_mouse
/*
* Go through serial mouse data and add hd entries.
*/
void add_serial_mouse(hd_data_t *hd_data)
{
hd_t *hd;
char buf[4];
ser_device_t *sm;
for(sm = hd_data->ser_mouse; sm; sm = sm->next) {
if(sm->is_mouse) {
hd = add_hd_entry(hd_data, __LINE__, 0);
hd->base_class.id = bc_mouse;
hd->sub_class.id = sc_mou_ser;
hd->bus.id = bus_serial;
hd->unix_dev_name = new_str(sm->dev_name);
hd->attached_to = sm->hd_idx;
if(*sm->pnp_id) {
strncpy(buf, sm->pnp_id, 3);
buf[3] = 0;
hd->vendor.id = name2eisa_id(buf);
if(!hd->vendor.id) { /* in case it's a really strange one... */
hd->vendor.name = new_str(buf);
}
hd->device.id = MAKE_ID(TAG_EISA, strtol(sm->pnp_id + 3, NULL, 16));
hd->serial = new_str(sm->serial);
if(sm->user_name) hd->device.name = new_str(sm->user_name);
if(sm->vend) {
free_mem(hd->vendor.name);
hd->vendor.name = new_str(sm->vend);
}
if(sm->dev_id && strlen(sm->dev_id) >= 7) {
char buf[5], *s;
unsigned u1, u2;
u1 = name2eisa_id(sm->dev_id);
if(u1) {
strncpy(buf, sm->dev_id + 3, 4);
buf[4] = 0;
u2 = strtol(sm->dev_id + 3, &s, 16);
if(!*s) {
hd->compat_vendor.id = u1;
hd->compat_device.id = MAKE_ID(TAG_EISA, u2);
}
}
}
}
else {
hd->vendor.id = MAKE_ID(TAG_SPECIAL, 0x0200);
hd->device.id = MAKE_ID(TAG_SPECIAL, 0x0003);
}
}
}
}