Exemplo n.º 1
0
void SSAmplifier::Load(FILE* ar)
{
	char				*p,tbuf[256];
	int					wType=0;
	p = parList->GetNextInputLine(ar,"AMP",tbuf);
	if (p[3] == ' ') {
		// Old Style Input
		double sc=0,of=0;
		sscanf(p, "AMP %lf %lf",&sc,&of);
		PrintfExp(&scaleExp, "%lg", sc);
		PrintfExp(&offsetExp, "%lg", of);
		// parList->itsOwner->SetModifiedFlag();  // dirty = true;
	}
	else {
		char	tStr[256];
		if (strncmp(p,"AMPP ",5) == 0) {
  		sscanf(p, "AMPP %s",tStr);
  		InitExp(&panExp,tStr);
  		LoadExp(ar,"AMPS",&scaleExp);
 		}
		else {
  		sscanf(p, "AMPS %s",tStr);
  		InitExp(&scaleExp,tStr);
    }
 		LoadExp(ar,"AMPO",&offsetExp);
 	}
}
Exemplo n.º 2
0
SSGAssign::SSGAssign(ModList * mList, short h, short v) : SSModule(MT_GAssign, mList, h, v)
{
	InitExp(&gNbrExp,"0");
	InitExp(&valExp,"sig");
	strcpy(desc,"var");
	DescribeLink(0, "Default Signal", "sig",	0x0000,0x0000,0xffff);
	DescribeLink(1, "Alt Signal #1", "sig1",	0x1111,0x1111,0xeeee);
	DescribeLink(2, "Alt Signal #2", "sig2",	0x2222,0x2222,0xdddd);
	DescribeLink(3, "Alt Signal #3", "sig3",	0x3333,0x3333,0xcccc);
}
Exemplo n.º 3
0
SSAmplifier::SSAmplifier(ModList * mList, short h, short v) : SSModule(MT_Amplifier, mList, h, v)
{
	InitExp(&scaleExp, "1.0");
	InitExp(&offsetExp,"0.0");
	InitExp(&panExp,"0.0");
//	scale = 1.0;
//	offset = 0.0;
	DescribeLink(SIG_Sig, "Signal to Amplify", "sig",0,0,0xFFFF);
	DescribeLink(SIG_Ctl, "Control Signal", "ctl",0xFFFF,0x8888,0x8888);
	DescribeLink(SIG_Ctl1, "Control Signal 1", "ctl1",0xFFFF,0x8888,0);
	DescribeLink(SIG_Ctl2, "Control Signal 2", "ctl2",0xFFFF,0x8888,0);
	DescribeLink(SIG_Ctl3, "Control Signal 3", "ctl3",0xFFFF,0x8888,0);
}
Exemplo n.º 4
0
SSDelay::SSDelay(ModList * mList, short h, short v) : SSModule(MT_Delay, mList, h, v)
{
	InitExp(&delayExp,"0.1");
	InitExp(&a0Exp,"1.0");
	InitExp(&a1Exp,"0.5");
	allocDelaySamples = 0;
	dBuf = NULL;
	delayCounter = 0;
	delayIncrement = 0;
	flags = DF_Recursive;
	DescribeLink(SIG_Sig, "Signal to Delay", "sig",0,0,0xFFFF);
	DescribeLink(SIG_Ctl, "Control Signal", "ctl",0xFFFF,0x8888,0x8888);
	DescribeLink(SIG_Ctl1, "Control Signal 1", "ctl1",0xFFFF,0x8888,0);
	DescribeLink(SIG_Ctl2, "Control Signal 2", "ctl2",0xFFFF,0x8888,0);
	DescribeLink(SIG_Ctl3, "Control Signal 3", "ctl3",0xFFFF,0x8888,0);
}
Exemplo n.º 5
0
void CPlayerCharacter::SetInfo()
{
	printf_s("플레이할 캐릭터 별명을 입력하세요\n");
	std::string str_alias;
	getline(std::cin, str_alias);
	SetName(str_alias);

	//divide languages after project is done
	//printf_s("다음 중 플레이할 언어 입력하세요 \n"); 
	//printf_s("1) C  2) JAVA  3) Python \n");
	/*later about language
	1. input by number
	2. put language information by string just like now
	###more importantly### 
	3. divide problem set by number 
	4. create monsters by this input number*/
	//std::string str_language;
	//getline(std::cin, str_language);
	//SetLang(str_language);
	InitPosition();
	InitLevel();
	InitExp();
	InitHP();
	InitProblemCounter();
}
Exemplo n.º 6
0
int
BitmapIO_GIF::Decoder(WORD linewidth, BYTE *buf, BYTE *stack, BYTE *suffix, USHORT *prefix)
   {
   BYTE *sp = NULL, *bufptr=NULL;
   WORD code=0, fc=0, oc=0, bufcnt=0;
   WORD c=0, size=0;
   int ret=0;

   /* Initialize for decoding a new image...
    */
   if ((size = GIFGetByte()) < 0)
      return(size);
   if (size < 2 || 9 < size) {
#ifdef DBG_GIF
		DebugPrint(_T("<BAD DECODE SIZE:%d>\n"), size);
#endif // DBG_GIF
       return(BAD_CODE_SIZE);
	   }
   InitExp(size);

   /* Initialize in case they forgot to put in a clear code.
    * (This shouldn't happen, but we'll try and decode it anyway...)
    */
   oc = fc = 0;


   /* Set up the stack pointer and decode buffer pointer
    */
   sp = stack;
#ifdef DBG_DIG
   DebugPrint(_T("Initial stack:%p sp:%p\n"),stack, sp);
#endif //DBG_GIF
   bufptr = buf;
   bufcnt = linewidth;

   /* This is the main loop.  For each code we get we pass through the
    * linked list of prefix codes, pushing the corresponding "character" for
    * each code onto the stack.  When the list reaches a single "character"
    * we push that on the stack too, and then start unstacking each
    * character for output in the correct order.  Special handling is
    * included for the clear code, and the whole thing ends when we get
    * an ending code.
    */
   while ((c = GetNextCode()) != ending)
      {

      /* If we had a file error, return without completing the decode
       */
      if (c < 0)
         {
         return(c);
         }

      /* If the code is a clear code, reinitialize all necessary items.
       */
      if (c == clear)
         {
         curr_size = size + 1;
         slot = newcodes;
         top_slot = 1 << curr_size;

         /* Continue reading codes until we get a non-clear code
          * (Another unlikely, but possible case...)
          */
         while ((c = GetNextCode()) == clear)
            ;

         /* If we get an ending code immediately after a clear code
          * (Yet another unlikely case), then break out of the loop.
          */
         if (c == ending)
            break;

         /* Finally, if the code is beyond the range of already set codes,
          * (This one had better NOT happen...  I have no idea what will
          * result from this, but I doubt it will look good...) then set it
          * to color zero.
          */
         if (c >= slot)
            c = 0;

         oc = fc = c;

         /* And let us not forget to put the char into the buffer... And
          * if, on the off chance, we were exactly one pixel from the end
          * of the line, we have to send the buffer to the gif_out_line()
          * routine...
          */
         *bufptr++ = (BYTE)c;
         if (--bufcnt == 0)
            {
			if((ret = GIFOutLine(buf, linewidth)) < 0)
			    return(ret);
            bufptr = buf;
            bufcnt = linewidth;
            }
         }
      else
         {

         /* In this case, it's not a clear code or an ending code, so
          * it must be a code code...  So we can now decode the code into
          * a stack of character codes. (Clear as mud, right?)
          */
         code = c;

         /* Here we go again with one of those off chances...  If, on the
          * off chance, the code we got is beyond the range of those already
          * set up (Another thing which had better NOT happen...) we trick
          * the decoder into thinking it actually got the last code read.
          * (Hmmn... I'm not sure why this works...  But it does...)
          */
         if (code >= slot)
            {
            if (code > slot)
               ++bad_code_count;
            code = oc;

			if((sp - stack) <= MAX_CODES)
				*sp++ = (BYTE)fc;
            }

         /* Here we scan back along the linked list of prefixes, pushing
          * helpless characters (ie. suffixes) onto the stack as we do so.
          */
         while (code >= newcodes)
            {
			if((sp - stack) > MAX_CODES)
				break;
			*sp++ = suffix[code];
            code = prefix[code];
            }

         /* Push the last character on the stack, and set up the new
          * prefix and suffix, and if the required slot number is greater
          * than that allowed by the current bit size, increase the bit
          * size.  (NOTE - If we are all full, we *don't* save the new
          * suffix and prefix...  I'm not certain if this is correct...
          * it might be more proper to overwrite the last code...
          */
         if((sp - stack) <= MAX_CODES)
			*sp++ = (BYTE)code;
         if (slot < top_slot)
            {
            fc = code;
            suffix[slot] = (BYTE)code;
            prefix[slot++] = oc;
            oc = c;
            }
         if (slot >= top_slot)
            if (curr_size < 12)
               {
               top_slot <<= 1;
               ++curr_size;
               } 

         /* Now that we've pushed the decoded string (in reverse order)
          * onto the stack, lets pop it off and put it into our decode
          * buffer...  And when the decode buffer is full, write another
          * line...
          */
         while (sp > stack)
            {
            *bufptr++ = *(--sp);
            if (--bufcnt == 0)
				{
				if ((ret = GIFOutLine(buf, linewidth)) < 0)
                    return(ret);
				bufptr = buf;
                bufcnt = linewidth;
                }
            }
         }
      }
   if (bufcnt != linewidth)
       ret = GIFOutLine(buf, (linewidth - bufcnt));
   return(ret);
   }