CoSiNUs brOTHerS inTRO build 2015-04-20

  • DU hast recht wakillon. Danke für den Hinweis. Ich habe im Post#1 den Link zu deinen Chip Musik Playern hinzugefügt! :thumbup:

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Yep, leider sind die Sterne über dem Bild, obwohl zuerst die Sterne gezeichnet werden und anschließend das Bild. Keine Ahnung, warum das so ist. ?(

    Ich habe den Hintergrund dunkler gemacht, damit die Sterne besser zur Geltung kommen -> diesmal wirklich letzes Update. :saint:

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Super Cool!!!!

    Also von mir aus kannst du noch einige updates machen. Ich sehe mir solche dinger immmer gerne an.

    Was in keinem Old School Demo fehlen darf, sind Scrollbars.
    Was auch noch Cool ist: ein Scroller mit grossen Zeichen, welche sich in Laufrichtung wie ein Rad drehen.
    Und natürlich noch irgendwas im Vektor Style, das sich bewegt.

  • Leider steht nicht mehr viel Rechenzeit zur Verfügung, um noch weitere Effekte einzubauen.

    Der Aufruf der Anim Funktion nimmt ca. 25 ms in Anspruch. Das sind ca. 40 FPS und momentan läuft das Intro mit ca. 30 FPS und ca. 90% Auslastung auf einem Core (gemessen auf meinem Schlepptop Intel i5-4300U @ 2,6 GHz). Könnte man die Last auf die Cores verteilen (Multithreading), so könnte man auch weitere Effekte einbauen.

    Leider ist dem nicht so.

    Scrollbars hatte ich vor einiger Zeit implementiert:

    [autoit]

    ;coded by UEZ 2012 build 2012-08-09
    #AutoIt3Wrapper_Compile_Both=n
    #AutoIt3Wrapper_UseX64=y
    #AutoIt3Wrapper_Run_Au3Stripper=y
    #Au3Stripper_Parameters=/so
    #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3"
    #AutoIt3Wrapper_UseUpx=y
    #AutoIt3Wrapper_UPX_Parameters=--best --lzma

    [/autoit][autoit][/autoit][autoit]

    #include <Array.au3>
    #include <WindowsConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GDIPlus.au3>
    Opt('GUIOnEventMode', 1)
    Opt("MustDeclareVars", 1)

    [/autoit][autoit][/autoit][autoit]

    Global Const $hGDI32 = DllOpen("gdi32.dll")
    _GDIPlus_Startup()
    Global Const $iW = 640, $iH = 480
    Global $sGUIText = "Rotating Raster Bars (C64 Style) by UEZ 2012 / FPS: "
    Global Const $hGUI = GUICreate($sGUIText, 640, 480)
    GUISetState()

    [/autoit][autoit][/autoit][autoit]

    #region init GDI+
    Global Const $hBitmap = _WinAPI_CreateDIB($iW, $iH)
    Global Const $hDC = _WinAPI_GetDC($hGUI)
    Global Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC)
    Global Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hBitmap)
    Global Const $hGraphic = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer)
    Global Const $hBrush = _GDIPlus_BrushCreateSolid(0x40000000)
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, 2)
    #endregion
    Global Const $fPI = ACos(-1)
    Global Const $f2PI = 2 * ACos(-1)
    Global Const $fRad = ACos(-1) / 180
    Global Const $fYPos = $iH / 2
    Global Const $fSpeed = 0.3
    Global Const $fRadius = 150
    Global Const $fZSize = 20
    Global Const $iSize = 100, $iS2 = $iSize / 2
    Global $aBitmaps[3][4], $e, $r, $j, $k, $l , $z = 0, $iFPS = 0
    Global $iUb = UBound($aBitmaps) - 1

    [/autoit][autoit][/autoit][autoit]

    For $e = 0 To $iUb
    $r = Random(3, 12, 1)
    $aBitmaps[$e][0] = CreateBar($r, $iW, $iSize, "0xFF" & Hex(Random(0x0, 0xFFFFFF, 1), 6))
    $aBitmaps[$e][1] = $fYPos
    $aBitmaps[$e][2] = Sin($e * $fRad) * 360 / ($iUb + 1)
    Next

    [/autoit][autoit][/autoit][autoit]

    GUISetOnEvent($GUI_EVENT_CLOSE , "_Exit")
    AdlibRegister("FPS", 1000)

    [/autoit][autoit][/autoit][autoit]

    While Sleep(10)
    _GDIPlus_GraphicsFillRect($hGraphic, 0, 0, $iW, $iH)
    For $j = 0 To $iUb
    $k = Sin($fRad * $z + $aBitmaps[$j][2]) * $fRadius
    $aBitmaps[$j][3] = Cos(270 + $fRad * $z + $aBitmaps[$j][2])
    $aBitmaps[$j][1] = $fYPos + $k - $iS2
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $aBitmaps[$j][0], 0, $aBitmaps[$j][1], $iW, $iSize + $aBitmaps[$j][3] * $fZSize)
    $z += $fSpeed
    Next
    _ArraySort($aBitmaps, 0, 0, 0, 3)
    DllCall($hGDI32, "bool", "BitBlt", "handle", $hDC, "int", 0, "int", 0, "int", $iW, "int", $iH, "handle", $hDC_backbuffer, "int", 0, "int", 0, "dword", $SRCCOPY) ;_WinAPI_BitBlt()
    $iFPS += 1
    WEnd

    [/autoit][autoit][/autoit][autoit]

    Func CreateBar($iStep, $iW, $iH, $iColor, $iBoost = 3)
    Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH)
    Local Const $hCtx = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    Local Const $hBrush = _GDIPlus_BrushCreateSolid(0x00000000)
    Local $i, $y = 0
    For $x = 0 To $iH / 2 Step $iStep
    _GDIPlus_BrushSetSolidColor($hBrush, CalcColor($iColor, $iBoost * $x))
    _GDIPlus_GraphicsFillRect($hCtx, 0, $y, $iW, $iStep, $hBrush)
    $y += $iStep
    Next
    For $x = $iH / 2 - $iStep To 0 Step -$iStep
    _GDIPlus_BrushSetSolidColor($hBrush, CalcColor($iColor, $iBoost * $x))
    _GDIPlus_GraphicsFillRect($hCtx, 0, $y, $iW, $iStep, $hBrush)
    $y += $iStep
    Next
    _GDIPlus_GraphicsDispose($hCtx)
    _GDIPlus_BrushDispose($hBrush)
    Return $hBitmap
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func CalcColor($iColor, $iStep)
    Local Const $iA = Hex(BitAND(0xFF, BitShift($iColor, 24)), 2)
    Local Const $iR = Hex(Min(BitAND(0xFF, BitShift($iColor, 16)) + Int($iStep), 0xFF), 2)
    Local Const $iG = Hex(Min(BitAND(0xFF, BitShift($iColor, 8)) + Int($iStep), 0xFF), 2)
    Local Const $iB = Hex(Min(BitAND(0xFF, $iColor) + Int($iStep), 0xFF), 2)
    Return "0x" & $iA & $iR & $iG & $iB
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func FPS()
    WinSetTitle("", "", $sGUIText & $iFPS)
    $iFPS = 0
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func Min($a, $b)
    If $a < $b Then Return $a
    Return $b
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func _Exit()
    AdlibUnRegister("FPS")
    DllClose($hGDI32)
    Local $c
    For $c = 0 To UBound($aBitmaps) - 1
    _GDIPlus_BitmapDispose($aBitmaps[$c][0])
    Next
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($hGraphic)
    _WinAPI_SelectObject($hDC, $DC_obj)
    _WinAPI_DeleteObject($hBitmap)
    _WinAPI_ReleaseDC($hGUI, $hDC)
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
    Exit
    EndFunc

    [/autoit]

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯