Example #1
0
    /*
     * Loads an image.
     *
     * @param filename The name of the file to load.
     * @param memory1 The index of a memory block where to store loaded data.
     * @param memory2 The index of a memory block where to store loaded data.
     * @param palette Where to store the palette, if any.
     * @return The size of the loaded image.
     */
    internal static ushort Sprites_LoadImage(string filename, Screen screenID, byte[] palette)
    {
#if Sprites_0
        byte   index;
        byte[] header = default;

        index = CFile.File_Open(filename, FileMode.FILE_MODE_READ);
        if (index == (byte)FileMode.FILE_INVALID)
        {
            return(0);
        }

        CFile.File_Read(index, header, 4);
        CFile.File_Close(index);
#endif
        return((ushort)(Sprites_LoadCPSFile(filename, screenID, palette) / 8000));
    }