Difference between revisions of "Sword25/TODO"

Jump to navigation Jump to search
4,569 bytes added ,  21:41, 25 October 2010
→‎TODOs: Add code that used to be in sword25/kernel/scummvmwindow.cpp
(→‎TODOs: Add code that used to be in sword25/kernel/scummvmwindow.cpp)
Line 22: Line 22:
** A major reason for slowness is that when finding a matching file list for a given file-spec, it currently scans the entire contents of the zip file index. When we correct the Zip file implementation to properly handle folders, this will speed things up, since since it will be able to traverse down to a specific folder, and only have to scan the files of that folder.
** A major reason for slowness is that when finding a matching file list for a given file-spec, it currently scans the entire contents of the zip file index. When we correct the Zip file implementation to properly handle folders, this will speed things up, since since it will be able to traverse down to a specific folder, and only have to scan the files of that folder.
* Fix issues due to using libpng: The engine uses libpng. This will cause problems when building with dynamic plugins, as then either the sword25 engine then would have to be linked directly against libpng (which may not be possible everywhere), or the main ScummVM executable. But in the latter case, we get issues on systems that do not allow backlinking (such as Windows). The way we overcame this for other similar cases is to add a thin wrapper API around the library and put that into the shared code base (in this case, something like graphics/png.* might be appropriate).
* Fix issues due to using libpng: The engine uses libpng. This will cause problems when building with dynamic plugins, as then either the sword25 engine then would have to be linked directly against libpng (which may not be possible everywhere), or the main ScummVM executable. But in the latter case, we get issues on systems that do not allow backlinking (such as Windows). The way we overcame this for other similar cases is to add a thin wrapper API around the library and put that into the shared code base (in this case, something like graphics/png.* might be appropriate).
* The following commented out code used to be in kernel/scummvmwindow.cpp; I am keeping it here in case there is still something in there that needs to be handled (which I can't tell right now).
<source lang="cpp">
// FIXME: Special keys detected here need to be moved into the Input Engine
// Die WindowProc aller Fenster der Klasse
LRESULT CALLBACK BS_ScummVMWindow::WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch(uMsg)
    {
    case WM_PAINT:
        ValidateRect(hwnd, NULL);
        break;
    case WM_DESTROY:
        // Das Fenster wird zerstört
        PostQuitMessage(0);
        break;
    case WM_CLOSE:
        {
            BS_Window * WindowPtr = BS_Kernel::GetInstance()->GetWindow();
            if (WindowPtr) {
                WindowPtr->SetCloseWanted(true);
            }
            break;
        }
    case WM_KEYDOWN:
        {
            // Tastendrücke, die für das Inputmodul interessant sind, werden diesem gemeldet.
            BS_InputEngine * InputPtr = BS_Kernel::GetInstance()->GetInput();
            if (InputPtr)
            {
                switch (wParam)
                {
                case VK_RETURN:
                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_ENTER);
                    break;
                case VK_LEFT:
                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_LEFT);
                    break;
                case VK_RIGHT:
                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_RIGHT);
                    break;
                case VK_HOME:
                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_HOME);
                    break;
                case VK_END:
                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_END);
                    break;
                case VK_BACK:
                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_BACKSPACE);
                    break;
                case VK_TAB:
                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_TAB);
                    break;
                case VK_INSERT:
                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_INSERT);
                    break;
                case VK_DELETE:
                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_DELETE);
                    break;
                }
            }
            break;
        }
    case WM_KEYUP:
    case WM_SYSKEYUP:
        // Alle Tastendrücke werden ignoriert, damit Windows per DefWindowProc() nicht darauf
        // reagieren kann und damit unerwartete Seiteneffekte auslöst.
        // Zum Beispiel würden ALT und F10 Tastendrücke das "Menü" aktivieren und somit den Message-Loop zum Stillstand bringen.
        break;
    case WM_SYSCOMMAND:
        // Verhindern, dass der Bildschirmschoner aktiviert wird, während das Spiel läuft
        if (wParam != SC_SCREENSAVE) return DefWindowProc(hwnd,uMsg,wParam,lParam);
        break;
    case WM_CHAR:
        {
            byte theChar = static_cast<byte>(wParam & 0xff);
            // Alle Zeichen, die keine Steuerzeichen sind, werden als Buchstaben dem Input-Service mitgeteilt.
            if (theChar >= 32)
            {
                BS_InputEngine * InputPtr = BS_Kernel::GetInstance()->GetInput();
                if (InputPtr) InputPtr->ReportCharacter(theChar);
            }
        }
        break;
    case WM_SETCURSOR:
        {
            // Der Systemcursor wird in der Client-Area des Fensters nicht angezeigt, jedoch in der nicht Client-Area, damit der Benutzer das Fenster wie gewohnt
            // schließen und verschieben kann.
            // Koordinaten des Cursors in der Client-Area berechnen.
            POINT pt;
            GetCursorPos(&pt);
            ScreenToClient(hwnd, &pt);
            // Feststellen, ob sich der Cursor in der Client-Area befindet.
            // Get client rect
            RECT rc;
            GetClientRect(hwnd, &rc);
            // See if cursor is in client area
            if(PtInRect(&rc, pt))
                // In der Client-Area keinen Cursor anzeigen.
                SetCursor(NULL);
            else
                // Ausserhalb der Client-Area den Cursor anzeigen.
                SetCursor(LoadCursor(NULL, IDC_ARROW));
            return TRUE;
        }
        break;
    default:
        // Um alle anderen Vorkommnisse kümmert sich Windows
        return DefWindowProc(hwnd,uMsg,wParam,lParam);
    }
    return 0;
}
</source>


== Lua TODO ==
== Lua TODO ==
1,079

edits

Navigation menu