# HG changeset patch # User Matti Hamalainen # Date 1432237950 -10800 # Node ID f339a3903bc97edf730aa4af5b4713c935df2816 Initial import. diff -r 000000000000 -r f339a3903bc9 LICENSE.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LICENSE.txt Thu May 21 22:52:30 2015 +0300 @@ -0,0 +1,50 @@ +DMLIB - Demo engine / development and utility framework +Programmed and designed by Matti Hämäläinen (ccr/TNSP) +(C) Copyright 2002-2015 Tecnic Software productions (TNSP) + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +----------------------------------------------------------------------- + +stb_image - public domain JPEG/PNG reader by various authors +http://nothings.org/stb_image.c + +----------------------------------------------------------------------- + +The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library +designed to make it easy to write multi-media software, such as games and +emulators. + +The Simple DirectMedia Layer library source code is available from: +http://www.libsdl.org/ + +This library is distributed under the terms of the GNU LGPL license: +http://www.gnu.org/copyleft/lesser.html + +----------------------------------------------------------------------- diff -r 000000000000 -r f339a3903bc9 Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile Thu May 21 22:52:30 2015 +0300 @@ -0,0 +1,27 @@ +# +# Generic build target +# +DMLIB = ./dmlib/ +MAKE ?= make + +export DMLIB + +unix: + $(MAKE) -f $(DMLIB)Makefile EXEEXT=.bin + +mingw-win32: + $(MAKE) -f $(DMLIB)Makefile.cross-mingw \ + OBJPATH=./obj/win32/ \ + MINGW_PREFIX=i686-w64-mingw32- \ + MINGW_PATH=/usr/i686-w64-mingw32 + +mingw-win64: + $(MAKE) -f $(DMLIB)Makefile.cross-mingw \ + OBJPATH=./obj/win64/ \ + MINGW_PREFIX=x86_64-w64-mingw32- \ + MINGW_PATH=/usr/x86_64-w64-mingw32 + +clean: + -$(MAKE) -f $(DMLIB)Makefile clean EXEEXT=.bin + -$(MAKE) -f $(DMLIB)Makefile.cross-mingw clean + \ No newline at end of file diff -r 000000000000 -r f339a3903bc9 README.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.txt Thu May 21 22:52:30 2015 +0300 @@ -0,0 +1,9 @@ +anciat productionz - bussi +a modern platform demo @ simulaatio 6 +2015 + +gfx & code by ccr +musics by fgcl + + +maybe works on linux 64, win 64? diff -r 000000000000 -r f339a3903bc9 assets/graffat.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/assets/graffat.svg Thu May 21 22:52:30 2015 +0300 @@ -0,0 +1,790 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r f339a3903bc9 config.mak --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.mak Thu May 21 22:52:30 2015 +0300 @@ -0,0 +1,88 @@ +# Additional binaries (aka the demo) +DEMO_BIN=demo +DEMO_OBJS=demo.o dmsimple.o + +TOOL_BINPATH=bin/ +TESTS_BINPATH=$(TOOL_BINPATH) + +DM_CFLAGS += -fopenmp +DM_LDFLAGS += -lgomp + +#DM_DEBUG=yes + +# Build engine tests and tools? (Please notice that what +# actually gets built it also affected by other options) +DM_BUILD_TESTS=no +DM_BUILD_TOOLS=no + +# Timeline support? (required for editor and complex demos) +DM_USE_TIMELINE=no + +# Build Qt based demo editor? +DM_BUILD_EDITOR=no + +# Build with runtime asserts? +DM_USE_ASSERTS=yes + +# Use plain C routines? +DM_USE_C=yes + +# Use MMX/SSE SIMD assembler routines? +DM_USE_SIMD=yes + +DM_USE_TREMOR=no + +DM_USE_PACKFS=yes +DM_USE_STDIO=yes +DM_USE_MEMIO=no + +DM_GFX_BM_TEXT=yes +DM_GFX_TTF_TEXT=no +DM_GFX_LINES=no +DM_GFX_BLITS=yes +DM_GFX_MISC=yes + +DM_GFX_8BIT=yes +DM_GFX_32BIT=yes + + +### +### General build options for miniJSS +### +JSS=yes + +# Build a special "light"/minimized version by removing all +# error messages and few other things. (disabled by DM_DEBUG=yes) +JSS_LIGHT=yes + +# Build with extra debugging code? (disabled by JSS_LIGHT=yes) +JSS_DEBUG=yes + + +### Support loading of XM-format module files +JSS_SUP_XM=yes +#JSS_SUP_JSSMOD=yes + +# Enable support for different pattern storage modes +# in the JSSMOD _loader_. Saving in xm2jss is not affected. +#JSSMOD_FLAGS = -DJM_SUP_PATMODE_ALL + +# If SUP_PATMODE_ALL is not defined, then you can enable modes individually +# by uncommenting lines below. Refer to 'xm2jss --help' for mode information. +#JSSMOD_FLAGS += -DJM_SUP_PATMODE_1 +#JSSMOD_FLAGS += -DJM_SUP_PATMODE_2 +#JSSMOD_FLAGS += -DJM_SUP_PATMODE_3 +JSSMOD_FLAGS += -DJM_SUP_PATMODE_4 +#JSSMOD_FLAGS += -DJM_SUP_PATMODE_5 + +# Enable ext. instrument, instrument header and sampledata loading: +# (if you disable these, you better know what you are doing.) +JSSMOD_FLAGS += -DJM_SUP_EXT_INSTR +JSSMOD_FLAGS += -DJM_SUP_INSTR +JSSMOD_FLAGS += -DJM_SUP_SAMPLES + + +### +### Locking/thread support +### +JSS_SUP_THREADS=yes diff -r 000000000000 -r f339a3903bc9 data/SetupData.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/SetupData.txt Thu May 21 22:52:30 2015 +0300 @@ -0,0 +1,31 @@ +# Tässä määritellään videomoodikonfiguraatiovalikon elementit. +# Taustakuvat on aina SetupImage.png, jonka PITÄÄ olla kokoa 640x480 +# Haluttu fontti on SetupFont.dmf, jonka voi luoda fontconv-ohjelmalla +# esim. Truetype TTF-fonttitiedostosta (kaikki TTF-fontit eivät kyllä +# konvertoidu kauniisti.) + +# Koot ja koordinaatit määritetään desimaalilukuina, esim. +# X (vaaka)-koordinaatti 0.5 on ruudun puoliväli. Koossa 0.5 +# tarkoittaa luonnollisesti puolta (50%) koko ruudusta. + +# Resoluutiovalikon sijainti +menuPos 0.1 0.35 + +# Resoluutiovalikon koko +menuDim 0.8 0.4 + +menuBarOffs 0 -0.002 + +menuBarDimAdj 0 0.01 + +# Fullscreen/windowed -tekstin sijainti +text1Pos 0.04 0.9 + +# "Enter to start" tekstin sijainti +text2Pos 0.25 0.85 + +# Keskitetäänkö valikon tekstit (0 = ei, 1 = kyllä) +menuCenter 1 + +# Tiivistetäänkö fontti: +textCondensed 1 diff -r 000000000000 -r f339a3903bc9 data/SetupFont.dmf Binary file data/SetupFont.dmf has changed diff -r 000000000000 -r f339a3903bc9 data/SetupImage.png Binary file data/SetupImage.png has changed diff -r 000000000000 -r f339a3903bc9 data/SetupMenuBar.png Binary file data/SetupMenuBar.png has changed diff -r 000000000000 -r f339a3903bc9 data/ap.png Binary file data/ap.png has changed diff -r 000000000000 -r f339a3903bc9 data/aurinko.png Binary file data/aurinko.png has changed diff -r 000000000000 -r f339a3903bc9 data/auto.png Binary file data/auto.png has changed diff -r 000000000000 -r f339a3903bc9 data/bussi_logo.png Binary file data/bussi_logo.png has changed diff -r 000000000000 -r f339a3903bc9 data/dosa.png Binary file data/dosa.png has changed diff -r 000000000000 -r f339a3903bc9 data/pas2.xm Binary file data/pas2.xm has changed diff -r 000000000000 -r f339a3903bc9 data/presents.png Binary file data/presents.png has changed diff -r 000000000000 -r f339a3903bc9 data/puu_pv_1.png Binary file data/puu_pv_1.png has changed diff -r 000000000000 -r f339a3903bc9 data/puu_pv_2.png Binary file data/puu_pv_2.png has changed diff -r 000000000000 -r f339a3903bc9 data/rengas.png Binary file data/rengas.png has changed diff -r 000000000000 -r f339a3903bc9 data/tausta_pv.png Binary file data/tausta_pv.png has changed diff -r 000000000000 -r f339a3903bc9 demo.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/demo.c Thu May 21 22:52:30 2015 +0300 @@ -0,0 +1,628 @@ +#include "dmengine.h" +#include "dmtext.h" +#include "dmfft.h" +#include "dmvecmat.h" +#include + +static int demoInit(DMEngineData *engine); +static void demoShutdown(DMEngineData *engine); +static int demoRender(DMEngineData *engine); + + +int demoPreInit(DMEngineData *engine) +{ + dmInitProg("bussi", + "Bussi by AnCiat ProDz", + "0", "ENGINE INITTIALISSSIZING!!!!!", NULL); + + engine->optPackFilename = "bussi.dat"; + engine->optDataPath = NULL; + engine->optResFlags = DRF_USE_PACK | DRF_PRELOAD_RES | DRF_USE_STDIO; + + engine->optAudioSetup = DM_ASETUP_JSS; + + engine->optVidSetup = DM_VSETUP_ASPECT; + engine->optVidWidth = 640; + engine->optVidHeight = 480; + engine->optVidDepth = 32; + engine->optVFlags = SDL_SWSURFACE; + + engine->demoInit = demoInit; + engine->demoRender = demoRender; + engine->demoShutdown = demoShutdown; + + return DMERR_OK; +} + + +#define FFT_SIZE 128 +DMFFTContext fft; + + +static int demoInit(DMEngineData *engine) +{ + int i; + JSSModule *mod = NULL; + + dmInitializeFFT(&fft, FFT_SIZE); + + engineGetResModule(engine, mod, "pas2.xm"); + + if ((i = jssConvertModuleForPlaying(mod)) != DMERR_OK) + { + dmErrorMsg("Could not convert module for playing, %d: %s\n", + i, dmErrorStr(i)); + return DMERR_INIT_FAIL; + } + + jvmSetCallback(engine->jssDev, jmpExec, engine->jssPlr); + jmpSetModule(engine->jssPlr, mod); + jmpPlayOrder(engine->jssPlr, 0); + jvmSetGlobalVol(engine->jssDev, 55); + + // Jne + srand(15); + + return DMERR_OK; +} + + +static void demoShutdown(DMEngineData *engine) +{ + (void) engine; + dmEndFFT(&fft); +} + + +static inline float dmCX(DMEngineData *engine, const float x) +{ + return (x * engine->screen->w); +} + + +static inline float dmCY(DMEngineData *engine, const float y) +{ + return (y * engine->screen->h); +} + + +static inline float dmQX(DMEngineData *engine, SDL_Surface *img, const float x) +{ + return engine->optVidNative ? (img->w * x) : (img->w * engine->screen->w * x) / 640.0f; +} + + +static inline float dmQY(DMEngineData *engine, SDL_Surface *img, const float y) +{ + return engine->optVidNative ? (img->h * y) : (img->h * engine->screen->h * y) / 480.0f; +} + + +typedef struct +{ + char *filename; + float xc, yc; + SDL_Surface *img; +} DMTextItem; + + +static DMTextItem textItems[] = +{ + { "text01.png", 0.05, 0.10, NULL }, + { "text02.png", 0.10, 0.30, NULL }, + { "text03.png", 0.60, 0.30, NULL }, + { "text04.png", 0.20, 0.60, NULL }, + { "text05.png", 0.30, 0.70, NULL }, +}; + +static const int ntextItems = sizeof(textItems) / sizeof(textItems[0]); + + +static DMTextItem textItems2[] = +{ + { "text11.png", 0.05, 0.10, NULL }, + { "text02.png", 0.30, 0.25, NULL }, + { "text12.png", 0.10, 0.40, NULL }, + { "text13.png", 0.20, 0.60, NULL }, + { "text14.png", 0.30, 0.70, NULL }, +}; + +static const int ntextItems2 = sizeof(textItems2) / sizeof(textItems2[0]); + + +static DMTextItem textItems3[] = +{ + { "teki.png" , 0.25, 0.20, NULL }, + { "mitvit.png" , 0.05, 0.40, NULL }, + { "ja.png" , 0.05, 0.65, NULL }, + { "kemisti.png", 0.15, 0.65, NULL }, +}; + +static const int ntextItems3 = sizeof(textItems3) / sizeof(textItems3[0]); + + + + +#define DM_RADIAL_BLUR(YC, XC) \ + DMVector p1 = { xc, yc, 0, 0 }, p2 = { cx, cy, 0, 0 }, v; \ + dm_vector_sub_r(&v, &p2, &p1); \ + dm_vector_scale(&v, scale); \ + dm_vector_add(&v, &p1); \ + if (v.y YC || v.x XC) continue; \ + DMColor *dp = pix + xc, \ + *q = ((DMColor *)img->pixels) + ((int)(v.y) * pitch) + (int)v.x; \ + dp->r = (q->r + dp->r) / 2; \ + dp->g = (q->g + dp->g) / 2; \ + dp->b = (q->b + dp->b) / 2; + + + +void dmRadialBlur(SDL_Surface *img, const int cx, const int cy, const DMFloat scale) +{ + const int pitch = img->pitch / sizeof(DMColor); + int xc, yc; + +#pragma omp parallel private(yc, xc) shared(img) + { +#pragma omp sections nowait + { +#pragma omp section + for (yc = cy; yc >= 0; yc--) + { + DMColor *pix = ((DMColor *)img->pixels) + yc * pitch; + for (xc = cx + 1; xc < img->w; xc++) + { + DM_RADIAL_BLUR(< 0, >= img->w) + } + } + +#pragma omp section + for (yc = cy; yc >= 0; yc--) + { + DMColor *pix = ((DMColor *)img->pixels) + yc * pitch; + for (xc = cx; xc > 0; xc--) + { + DM_RADIAL_BLUR(< 0, < 0) + } + } + +#pragma omp section + for (yc = cy + 1; yc < img->h; yc++) + { + DMColor *pix = ((DMColor *)img->pixels) + yc * pitch; + for (xc = cx; xc > 0; xc--) + { + DM_RADIAL_BLUR(>= img->h, < 0) + } + } + +#pragma omp section + for (yc = cy + 1; yc < img->h; yc++) + { + DMColor *pix = ((DMColor *)img->pixels) + yc * pitch; + for (xc = cx + 1; xc < img->w; xc++) + { + DM_RADIAL_BLUR(>= img->h, >= img->w) + } + } + } + } +} + + +static int hitlerText(DMEngineData *engine, const int dt, float fftPow, DMTextItem *items, const int nitems, BOOL *nollattu) +{ + int i, vis; + if (!(*nollattu)) + { + for (i = 0; i < nitems; i++) + engineGetResImage(engine, items[i].img, items[i].filename); + + *nollattu = TRUE; + } + + float q = fftPow * 0.05f; + vis = dt / 1000; + for (i = 0; i < nitems; i++) + { + DMTextItem *item = &items[i]; + if (i < vis) + { + dmScaledBlitSurface32to32TransparentGA( + item->img, + dmCX(engine, item->xc - q), + dmCY(engine, item->yc - q), + + dmQX(engine, item->img, 1.0f + q * 2.0f), + dmQY(engine, item->img, 1.0f + q * 2.0f), + + engine->screen, + + 100 + 80 * fftPow); + } + } + + return DMERR_OK; +} + + +static int demoRender(DMEngineData *engine) +{ + float t = engineGetTimeDT(engine); + static DMScaledBlitFunc cblit = NULL; + + // Do FFT + DMFFTType fftPow = 0; + BOOL fftOK = FALSE; + static DMFFTType fftAmp[FFT_SIZE / 2]; + static DMFFTType fftData[FFT_SIZE]; + + dmMutexLock(engine->audioStreamMutex); + if (engine->audioStreamBuf != 0 && engine->audioStreamLen > FFT_SIZE) + { + int i; + Sint16 *buf = (Sint16 *) engine->audioStreamBuf; + for (i = 0; i < FFT_SIZE; i++) + { + fftData[i] = *buf; + buf += 2; + } + fftOK = TRUE; + } + dmMutexUnlock(engine->audioStreamMutex); + + if (fftOK) + { + dmRealFFT(&fft, fftData); + dmConvertFFTtoPowerAndSum(&fft, fftData, fftAmp, 1.0, &fftPow, 0.00004f); + } + + +#if 1 + // Demokoodi + if (t < 5) + { + // Alkufeidi sisään + int dt = engineGetTime(engine, 0); + static DMLerpContext fadeLerp; + static SDL_Surface *tausta = NULL; + static BOOL nollattu = FALSE; + if (!nollattu) + { + engineGetResImage(engine, tausta, "tausta.jpg"); + cblit = dmGetScaledBlitFunc(tausta->format, engine->screen->format, DMD_NONE); + + dmLerpInit(&fadeLerp, 0, 255, 5000); + nollattu = TRUE; + } + + dmClearSurface(engine->screen, dmMapRGB(engine->screen, 0,0,0)); + + dmScaledBlitSurface32to32TransparentGA(tausta, + 0, + 0, + + dmQX(engine, tausta, 1.0f), + dmQX(engine, tausta, 1.0f), + + engine->screen, + dmLerpSCurveClamp(&fadeLerp, dt + 150500 * fftPow)); + } +#endif +#if 0 + else + if (t < 25) + { + static BOOL nollattu = FALSE; + static SDL_Surface *tausta = NULL; + if (!nollattu) + { + engineGetResImage(engine, tausta, "tausta.jpg"); + } + + cblit(tausta, + 0, + 0, + + dmQX(engine, tausta, 1.0f), + dmQX(engine, tausta, 1.0f), + + engine->screen); + } + + if (t <= 7) + { + int dt = engineGetTime(engine, 2); + static DMLerpContext fadeLerp; + static SDL_Surface *logo1 = NULL, *logo2 = NULL; + static BOOL nollattu = FALSE; + if (!nollattu) + { + engineGetResImage(engine, logo1, "iso.png"); + engineGetResImage(engine, logo2, "forevisar.png"); + + dmLerpInit(&fadeLerp, 0, 255, 2500); + nollattu = TRUE; + } + + int fade; + if (dt < 2500) + { + fade = dmLerpSCurveClamp(&fadeLerp, dt + fftPow * 1000); + } + else + if (dt > 4500) + { + fade = 255 - dmLerpSCurveClamp(&fadeLerp, dt - 4500 + fftPow * 1000); + } + else + { + fade = 255; + } + + float d = fftPow * 0.1f; + + dmScaledBlitSurface32to32TransparentGA(logo1, + dmCX(engine, 0.1f), + dmCY(engine, 0.22f), + + dmQX(engine, logo1, 1.0f), + dmQY(engine, logo1, 1.0f), + + engine->screen, + fade); + + dmScaledBlitSurface32to32TransparentGA(logo2, + dmCX(engine, 0.2f - d), + dmCY(engine, 0.72f - d), + + dmQX(engine, logo2, 1.0f + d * 2.0f), + dmQY(engine, logo2, 1.0f + d * 2.0f), + + engine->screen, + fade); + } + else + if (t <= 15) + { + int dt = engineGetTime(engine, 7); + static DMLerpContext fadeLerp; + static SDL_Surface *logo1 = NULL, *logo2 = NULL; + static BOOL nollattu = FALSE; + if (!nollattu) + { + engineGetResImage(engine, logo1, "hitler_on_kiva.png"); + engineGetResImage(engine, logo2, "hitler.png"); + + dmLerpInit(&fadeLerp, 0, 255, 2500); + nollattu = TRUE; + } + + int fade; + if (dt < 2500) + { + fade = dmLerpSCurveClamp(&fadeLerp, dt + fftPow * 1000); + } + else + if (dt > 4500) + { + fade = 255 - dmLerpSCurveClamp(&fadeLerp, dt - 4500 + fftPow * 1000); + } + else + { + fade = 255; + } + + dmScaledBlitSurface32to32TransparentGA(logo1, + dmCX(engine, 0.1f), + dmCY(engine, 0.22f), + + dmQX(engine, logo1, 1.0f), + dmQY(engine, logo1, 1.0f), + + engine->screen, + fade); + + float q = fftPow * 0.2; + dmScaledBlitSurface32to32TransparentGA(logo2, + dmCX(engine, 0.15f), + dmCY(engine, 0.47f - q), + + dmQX(engine, logo2, 1.0f + q), + dmQY(engine, logo2, 1.0f + q), + + engine->screen, + fade); + } + + if (t <= 15) + { + int dt = engineGetTime(engine, 0); + static DMLerpContext posLerp, posLerp2; + static SDL_Surface *mainos = NULL; + static BOOL nollattu = FALSE; + if (!nollattu) + { + engineGetResImage(engine, mainos, "radio.png"); + + dmLerpInit(&posLerp, 1, -1, 15000); + dmLerpInit(&posLerp2, 0.3, 0.7, 15000); + nollattu = TRUE; + } + + dmScaledBlitSurface32to32TransparentGA(mainos, + dmCX(engine, dmLerpSCurveClamp(&posLerp2, dt)), + dmCY(engine, dmLerpSCurveClamp(&posLerp, dt)), + + dmQX(engine, mainos, 1.0f), + dmQY(engine, mainos, 1.0f), + + engine->screen, + 50); + } + else + if (t <= 25) + { + int dt = engineGetTime(engine, 15); + static DMLerpContext posLerp, posLerp2; + static DMScaledBlitFunc qblit = NULL; + static SDL_Surface *mainos = NULL, *mainos2 = NULL, *hitler = NULL, *sydan = NULL; + static BOOL nollattu = FALSE; + if (!nollattu) + { + engineGetResImage(engine, mainos, "lasi.jpg"); + engineGetResImage(engine, mainos2, "nigrolin.jpg"); + engineGetResImage(engine, hitler, "hitler2.png"); + engineGetResImage(engine, sydan, "sydan.png"); + + qblit = dmGetScaledBlitFunc(hitler->format, engine->screen->format, DMD_TRANSPARENT); + + dmLerpInit(&posLerp, 1, -1, 20000); + dmLerpInit(&posLerp2, -0.5, -0.2, 20000); + + nollattu = TRUE; + } + + dmScaledBlitSurface32to32TransparentGA(mainos, + dmCX(engine, dmLerpSCurveClamp(&posLerp2, dt)), + dmCY(engine, dmLerpSCurveClamp(&posLerp, dt + fftPow * 250)), + + dmQX(engine, mainos, 1.0f), + dmQY(engine, mainos, 1.0f), + + engine->screen, + 50); + + dmScaledBlitSurface32to32TransparentGA(mainos2, + dmCX(engine, dmLerpSCurveClamp(&posLerp, dt)), + dmCY(engine, dmLerpSCurveClamp(&posLerp2, dt + fftPow * 250)), + + dmQX(engine, mainos2, 1.0f), + dmQY(engine, mainos2, 1.0f), + + engine->screen, + 50); + + float d = fftPow * 0.1f; + + qblit(hitler, + dmCX(engine, 0.4 - d), + dmCY(engine, 0.3 - d), + + dmQX(engine, hitler, 1.0f + d * 2.0f), + dmQY(engine, hitler, 1.0f + d * 2.0f), + + engine->screen); + + + + if (t > 17) + { + static BOOL xnollattu = FALSE; + + if (t > 19) + { + float z = sin(t * 2.0f + fftPow) * 0.1f; + qblit(sydan, + dmCX(engine, 0.7) + dmQX(engine, sydan, 0.5f - z), + dmCY(engine, 0.55) + dmQX(engine, sydan, 0.5f - z), + + dmQX(engine, sydan, 1.0f + z * 2.0f), + dmQY(engine, sydan, 1.0f + z * 2.0f), + + engine->screen); + } + + hitlerText(engine, engineGetTime(engine, 17), fftPow, textItems, ntextItems, &xnollattu); + } + } + else + if (t <= 60) + { + int dt = engineGetTime(engine, 25); + static SDL_Surface *tekstur, *poni1, *poni2; + static BOOL nollattu = FALSE; + static DMScaledBlitFunc qblit = NULL; + if (!nollattu) + { + engineGetResImage(engine, tekstur, "disco.jpg"); + engineGetResImage(engine, poni1, "poni1.png"); + engineGetResImage(engine, poni2, "poni2.png"); + + qblit = dmGetScaledBlitFunc(poni1->format, engine->screen->format, DMD_TRANSPARENT); + + nollattu = TRUE; + } + + float m = t*2.0f; + float q = sin(m) * 0.3f, + q2 = sin(m + 0.2) * 0.4f, + z = sin(m) * 0.3f + 2.0f, + z2 = sin(m + 0.1f) * 0.3f + 2.0f; + + dmScaledBlitSurface32to32TransparentGA(tekstur, + dmCX(engine, sin(q) * 0.1f - 0.2f), + dmCY(engine, cos(q) * 0.1f - 0.2f), + + dmQX(engine, tekstur, z), + dmQY(engine, tekstur, z), + + engine->screen, + 130); + + dmScaledBlitSurface32to32TransparentGA(tekstur, + dmCX(engine, sin(q2) * 0.1f - 0.2f), + dmCY(engine, cos(q2) * 0.1f - 0.2f), + + dmQX(engine, tekstur, z2), + dmQY(engine, tekstur, z2), + + engine->screen, + 130); + + + qblit(poni1, + dmCX(engine, 0.2f), + dmCY(engine, 0.07f), + + dmQX(engine, poni1, 1.0f), + dmQY(engine, poni1, 1.0f), + + engine->screen); + + + dmScaledBlitSurface32to32TransparentGA(poni2, + dmCX(engine, 0.2f), + dmCY(engine, 0.07f), + + dmQX(engine, poni2, 1.0f), + dmQY(engine, poni2, 1.0f), + + engine->screen, + 50 + fftPow * 400); + + dmRadialBlur(engine->screen, + dmCX(engine, 0.5f + sin(m) * 0.1f), + dmCY(engine, 0.5f + cos(m) * 0.1f), + 0.035f); + + if (t >= 30 && t <= 37) + { + static BOOL xnollattu = FALSE; + hitlerText(engine, engineGetTime(engine, 30), fftPow + 0.2, textItems2, ntextItems2, &xnollattu); + } + else + if (t >= 38 && t <= 47) + { + static BOOL xnollattu = FALSE; + hitlerText(engine, engineGetTime(engine, 38), fftPow + 0.2, textItems3, ntextItems3, &xnollattu); + } + else + if (t > 50) + return 1; + } + +#endif + + return DMERR_OK; +} diff -r 000000000000 -r f339a3903bc9 file_id.diz --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/file_id.diz Thu May 21 22:52:30 2015 +0300 @@ -0,0 +1,5 @@ + anciat productionz + B U S S I + @ simulaatio 6 @ + win64/linux/src + bussilla pääsee