Mercurial > hg > demos > krapula
comparison krapula.c @ 44:c32b6fc0951b
Update to newer dmlib API.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 21 Oct 2014 14:53:04 +0300 |
parents | 9cbb03e85597 |
children | 62d3cf935706 |
comparison
equal
deleted
inserted
replaced
43:e0c74862387d | 44:c32b6fc0951b |
---|---|
336 | 336 |
337 engine->optPackFilename = "orvellys.dat"; | 337 engine->optPackFilename = "orvellys.dat"; |
338 engine->optDataPath = NULL; | 338 engine->optDataPath = NULL; |
339 engine->optResFlags = DRF_USE_PACK | DRF_PRELOAD_RES; | 339 engine->optResFlags = DRF_USE_PACK | DRF_PRELOAD_RES; |
340 | 340 |
341 engine->optAudioSetup = DM_ASETUP_JSS; | |
342 engine->optAfmt.freq = 44100; | |
343 engine->optAfmt.format = AUDIO_S16SYS; | |
344 engine->optAfmt.channels = 2; | |
345 | |
341 engine->optVidSetup = DM_VSETUP_ASPECT; | 346 engine->optVidSetup = DM_VSETUP_ASPECT; |
342 engine->optVidWidth = 640; | 347 engine->optVidWidth = 640; |
343 engine->optVidHeight = 480; | 348 engine->optVidHeight = 480; |
344 engine->optVidDepth = 32; | 349 engine->optVidDepth = 32; |
345 engine->optVFlags = SDL_SWSURFACE; | 350 engine->optVFlags = SDL_SWSURFACE; |
383 dmError("Could not convert module for playing, %d: %s\n", | 388 dmError("Could not convert module for playing, %d: %s\n", |
384 i, dmErrorStr(i)); | 389 i, dmErrorStr(i)); |
385 return DMERR_INIT_FAIL; | 390 return DMERR_INIT_FAIL; |
386 } | 391 } |
387 | 392 |
388 jvmSetCallback(engine->dev, jmpExec, engine->plr); | 393 jvmSetCallback(engine->jssDev, jmpExec, engine->jssPlr); |
389 jmpSetModule(engine->plr, mod); | 394 jmpSetModule(engine->jssPlr, mod); |
390 jmpPlayOrder(engine->plr, 0); | 395 jmpPlayOrder(engine->jssPlr, 0); |
391 jvmSetGlobalVol(engine->dev, 55); | 396 jvmSetGlobalVol(engine->jssDev, 55); |
392 | 397 |
393 return DMERR_OK; | 398 return DMERR_OK; |
394 } | 399 } |
395 | 400 |
396 | 401 |
656 engineGetResImage(engine, feidi, "feidi.png"); | 661 engineGetResImage(engine, feidi, "feidi.png"); |
657 dmLerpInit(&fadeLerp, 255, 0, 250); | 662 dmLerpInit(&fadeLerp, 255, 0, 250); |
658 nollattu = TRUE; | 663 nollattu = TRUE; |
659 } | 664 } |
660 | 665 |
661 JSS_LOCK(engine->plr); | 666 JSS_LOCK(engine->jssPlr); |
662 for (hit = FALSE, ch = 0; ch < 6; ch++) | 667 for (hit = FALSE, ch = 0; ch < 6; ch++) |
663 if (engine->plr->channels[ch].nextInstrument == 0) | 668 if (engine->jssPlr->channels[ch].nextInstrument == 0) |
664 { | 669 { |
665 hit = TRUE; | 670 hit = TRUE; |
666 break; | 671 break; |
667 } | 672 } |
668 JSS_UNLOCK(engine->plr); | 673 JSS_UNLOCK(engine->jssPlr); |
669 | 674 |
670 if (hit && !fadeActive) | 675 if (hit && !fadeActive) |
671 { | 676 { |
672 fadeActive = TRUE; | 677 fadeActive = TRUE; |
673 fadeStartTime = engineGetTime(engine, 0); | 678 fadeStartTime = engineGetTime(engine, 0); |