Dinocrat Stegosaur
2000AD Annual
Slymuck
Lego Space Land
Scalextric Mini Cooper
Emu hand puppet
2000AD Annual
Slymuck
Lego Space Land
Scalextric Mini Cooper
Emu hand puppet
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: Lord Nipper on Tue 29/11/2005 03:38:18You're not Welsh, are you?
a riding sheep
Quote from: esper on Sun 27/11/2005 06:43:33
Steve's looks like he played alot of Commodore 64...
Quote from: shitarâ,,¢ on Thu 24/11/2005 02:48:16Well, that too.
Sounds like you feel that style was more glorious.
function WriteRawInt(File *output, int intToWrite)
{
Ã, output.WriteRawChar(intToWrite & 255);
Ã, output.WriteRawChar((intToWrite>>8) & 255);
Ã, output.WriteRawChar((intToWrite>>16) & 255);
Ã, output.WriteRawChar((intToWrite>>24) & 255);
}
File *input = File.Open("Sampleset.WusikSND", eFileRead);
if (input != null)
{
Ã, bool foundChnk = false;
Ã, int chnkStage = 0;
Ã, while (!foundChnk && !input.EOF)
Ã, {
Ã, Ã, if (fourByteBoundaryOk)
Ã, Ã, {
Ã, Ã, Ã, int candidate = input.ReadRawInt();
Ã, Ã, Ã, Ã, if (candidate == 1802397795) // 0x6b6e6863 in decimal
Ã, Ã, Ã, Ã, {
Ã, Ã, Ã, Ã, Ã, foundChnk = true;
Ã, Ã, Ã, Ã, }
Ã, Ã, }
Ã, Ã, else
Ã, Ã, {
Ã, Ã, Ã, // put the values into a string
Ã, Ã, Ã, string chnk = "chnk";
Ã, Ã, Ã, int candidate = input.ReadRawChar();
Ã, Ã, Ã, if (candidate == StrGetCharAt(chnk, chnkStage))
Ã, Ã, Ã, {
Ã, Ã, Ã, Ã, // note - this only works for finding strings with no repeating patterns
Ã, Ã, Ã, Ã, chnkStage++;
Ã, Ã, Ã, Ã, if (chnkStage == 4) chnkFound = true;
Ã, Ã, Ã, }
Ã, Ã, Ã, else
Ã, Ã, Ã, if (candidate == StrGetCharAt(chnk, 0))
Ã, Ã, Ã, {
Ã, Ã, Ã, Ã, // reset
Ã, Ã, Ã, Ã, chnkStage = 1;
Ã, Ã, Ã, }
Ã, Ã, Ã, else
Ã, Ã, Ã, {
Ã, Ã, Ã, Ã, chnkStage = 0;
Ã, Ã, Ã, }
Ã, Ã, }
Ã, }
Ã, if (foundChnk)
Ã, {
Ã, Ã, int size = input.ReadRawInt();
Ã, Ã, int velocityLow = input.ReadRawInt();
Ã, Ã, int velocityHigh = input.ReadRawInt();
Ã, Ã, // etc
Ã, Ã, Display("size = %d, velocityLow = %d, velocityHigh = %d", size, velocityLow, velocityHigh);
Ã, }
Ã, else
Ã, {
Ã, Ã, Display("Didn't find chnk. Perhaps I got chnk's decimal value wrong.");
Ã, }
Ã, input.Close();
}
else
{
Ã, Display("Couldn't open file. Bad user! Bad!");
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.550 seconds with 17 queries.