• Уважаемые гости и новички, приветствуем Вас на нашем форуме
    Здесь вы можете найти ответы практически на все свои вопросы о серии игр «Готика» (в том числе различных модах на нее), «Ведьмак», «Ризен», «Древние свитки», «Эра дракона» и о многих других играх. Можете также узнать свежие новости о разработке новых проектов, восхититься творчеством наших форумчан, либо самим показать, что вы умеете. Ну и наконец, можете обсудить общие увлечения или просто весело пообщаться с посетителями «Таверны».

    Чтобы получить возможность писать на форуме, оставьте сообщение в этой теме.
    Удачи!
  • Друзья, доброго времени суток! Спешите принять участие в конкурсе "Таинственные миры" 2024!
    Ждем именно вас!

    Ссылка на конкурсную тему - тык
Wrapper GDX to Daedalus

Wrapper GDX to Daedalus 0.1

Эта маленькая жемчужина результат нашей плодотворной встречи с Degenerated'ом на съезде модостроителей 2015, я много провозился пока прикручивал возможность совместного функционирования Дедала с GD3D11 или GDX(потому что кто знает когда выйдет D3D12). Для этой цели он экспортирует функции его библиотеки *.dll(делая их квази публичными), также я написал небольшую программу которая сразу по завершению работы создает код на языке Дедал, используя эти функции из самых свежих версий файлов.
Все что вам остается это только инициализировать рендер в скриптах своего проекта, функцией: GDX_Init() в INIT_Global() (на самом деле не обязательно, но это может значительно замедлить его выполнение).

Вы можете разместить данный сценарий сразу после файлов пакета Икарус/Ikarus(вместе с Floats) и пересобрать скрипты, ничего другого для его работы не требуется.
Многие из представленных здесь функций еще не реализованы в актуальной версии рендера, но вы всегда можете загрузить более свежую версию библиотеки *.dll, если у вас есть желание по-экспериментировать.

Описание функций:
Daedalus:
/*#######################################################################################
# This code has been automatically generated to allow                                    #
# access to functions exported by the GDX-Renderer (GD3D11).                         
# Message Lehona (http://forum.worldofplayers.de/forum/members/73689-Lehona)         
# if you encounter any problems directly related this code and not its usage.         
# For questions regarding the usage of the exported functions, visit                 
# http://forum.worldofplayers.de/forum/threads/1425048-Wrapper-GDX-to-Daedalus?p=24180277
#                                                                                     
# When a user does not have the GDX-Renderer installed, nothing will happen.         
# This script may include functions that are not yet in the current release.         
# Using those functions will most likely result in a crash.                             
# Note that floats have to be emulated via the Ikarus float scripts.                 
#######################################################################################*/

/* func void GDX_AddPointLocator(var int position, var float size)
* Draws a red cross at the given location in the current frame
* - Position: Pointer to the vector to draw the cross at
* - Size: Size of the cross. (About 25 is the size of a human head)
*/


/* func void GDX_SetFogColor(var int color)
* Sets the fog-color to use when not in fog-zone
*/


/* func void GDX_SetFogDensity(var float density)
* Sets the global fog-density when not in fog-zone
* - Density: Very small values are needed, like 0.00004f for example.
*/


/* func void GDX_SetFogHeight(var float height)
* Sets the height of the fog
*/


/* func void GDX_SetFogHeightFalloff(var float falloff)
* Sets the falloff of the fog. A very small value means no falloff at all.
*/


/* func void GDX_SetSunColor(var int color)
* Sets the sun color. Alpha-Channel is ignored.
*/


/* func void GDX_SetSunStrength(var float strength)
* Sets the strength of the sun. Values above 1.0f are supported.
*/


/* func void GDX_SetShadowStrength(var float strength)
* Sets base-strength of the dynamic shadows. 0 means no dynamic shadows are not visible at all.
*/


/* func void GDX_SetShadowAOStrength(var float strength)
* Sets strength of the original vertex lighting on the worldmesh for pixels which are in shadow.
* Keep in mind that these pixels will also be darkened by the ShadowStrength-Parameter
*/


/* func void GDX_SetWorldAOStrength(var float strength)
* Sets strength of the original vertex lighting on the worldmesh for pixels which are NOT in shadow
*/


/* func void GDX_OpenMessageBox(var string message, var string caption, var int type, var func callback)
* Opens a messagebox using the UI-Framework
* - Message: Text to display in the body of the message-box
* - Caption: Header of the message-box
* - Type: 0 = OK, 1 = YES/NO
* - Callback: Script-Function ID to use as a callback.
* - This function needs one int-parameter, which will hold the cause of the call:
* -    D2D_MB_OK = 0,
* -    D2D_MB_YES = 1,
* -    D2D_MB_NO = 2
*
*/





/*******************************************************************************
* Es folgen Interna. Anschauen auf eigene Gefahr!
*******************************************************************************/
const int GDX_Library = 0;
func void GDX_Init() {
    if (!GDX_Library) {
        GDX_Library = LoadLibrary("ddraw.dll");
    };
};

func void GDX_AddPointLocator(var int position, var int size) {
    if (!GDX_Library) {
        return;
    };
    const int procAddress = 0;
    if (!procAddress) {
        procAddress = GetProcAddress(GDX_Library, "GDX_AddPointLocator");
    };

    var int arg0; arg0 = position;
    var int arg1; arg1 = size;

    const int call = 0;
    if (CALL_Begin(call)) {
        CALL_PtrParam(_@(arg1));
        CALL_PtrParam(_@(arg0));
        CALL__cdecl(procAddress);
        call = CALL_End();
    };
};



func void GDX_SetFogColor(var int color) {
    if (!GDX_Library) {
        return;
    };
    const int procAddress = 0;
    if (!procAddress) {
        procAddress = GetProcAddress(GDX_Library, "GDX_SetFogColor");
    };

    var int arg0; arg0 = color;

    const int call = 0;
    if (CALL_Begin(call)) {
        CALL_PtrParam(_@(arg0));
        CALL__cdecl(procAddress);
        call = CALL_End();
    };
};



func void GDX_SetFogDensity(var int density) {
    if (!GDX_Library) {
        return;
    };
    const int procAddress = 0;
    if (!procAddress) {
        procAddress = GetProcAddress(GDX_Library, "GDX_SetFogDensity");
    };

    var int arg0; arg0 = density;

    const int call = 0;
    if (CALL_Begin(call)) {
        CALL_PtrParam(_@(arg0));
        CALL__cdecl(procAddress);
        call = CALL_End();
    };
};



func void GDX_SetFogHeight(var int height) {
    if (!GDX_Library) {
        return;
    };
    const int procAddress = 0;
    if (!procAddress) {
        procAddress = GetProcAddress(GDX_Library, "GDX_SetFogHeight");
    };

    var int arg0; arg0 = height;

    const int call = 0;
    if (CALL_Begin(call)) {
        CALL_PtrParam(_@(arg0));
        CALL__cdecl(procAddress);
        call = CALL_End();
    };
};



func void GDX_SetFogHeightFalloff(var int falloff) {
    if (!GDX_Library) {
        return;
    };
    const int procAddress = 0;
    if (!procAddress) {
        procAddress = GetProcAddress(GDX_Library, "GDX_SetFogHeightFalloff");
    };

    var int arg0; arg0 = falloff;

    const int call = 0;
    if (CALL_Begin(call)) {
        CALL_PtrParam(_@(arg0));
        CALL__cdecl(procAddress);
        call = CALL_End();
    };
};



func void GDX_SetSunColor(var int color) {
    if (!GDX_Library) {
        return;
    };
    const int procAddress = 0;
    if (!procAddress) {
        procAddress = GetProcAddress(GDX_Library, "GDX_SetSunColor");
    };

    var int arg0; arg0 = color;

    const int call = 0;
    if (CALL_Begin(call)) {
        CALL_PtrParam(_@(arg0));
        CALL__cdecl(procAddress);
        call = CALL_End();
    };
};



func void GDX_SetSunStrength(var int strength) {
    if (!GDX_Library) {
        return;
    };
    const int procAddress = 0;
    if (!procAddress) {
        procAddress = GetProcAddress(GDX_Library, "GDX_SetSunStrength");
    };

    var int arg0; arg0 = strength;

    const int call = 0;
    if (CALL_Begin(call)) {
        CALL_PtrParam(_@(arg0));
        CALL__cdecl(procAddress);
        call = CALL_End();
    };
};



func void GDX_SetShadowStrength(var int strength) {
    if (!GDX_Library) {
        return;
    };
    const int procAddress = 0;
    if (!procAddress) {
        procAddress = GetProcAddress(GDX_Library, "GDX_SetShadowStrength");
    };

    var int arg0; arg0 = strength;

    const int call = 0;
    if (CALL_Begin(call)) {
        CALL_PtrParam(_@(arg0));
        CALL__cdecl(procAddress);
        call = CALL_End();
    };
};



func void GDX_SetShadowAOStrength(var int strength) {
    if (!GDX_Library) {
        return;
    };
    const int procAddress = 0;
    if (!procAddress) {
        procAddress = GetProcAddress(GDX_Library, "GDX_SetShadowAOStrength");
    };

    var int arg0; arg0 = strength;

    const int call = 0;
    if (CALL_Begin(call)) {
        CALL_PtrParam(_@(arg0));
        CALL__cdecl(procAddress);
        call = CALL_End();
    };
};



func void GDX_SetWorldAOStrength(var int strength) {
    if (!GDX_Library) {
        return;
    };
    const int procAddress = 0;
    if (!procAddress) {
        procAddress = GetProcAddress(GDX_Library, "GDX_SetWorldAOStrength");
    };

    var int arg0; arg0 = strength;

    const int call = 0;
    if (CALL_Begin(call)) {
        CALL_PtrParam(_@(arg0));
        CALL__cdecl(procAddress);
        call = CALL_End();
    };
};



func void GDX_OpenMessageBox(var string message, var string caption, var int type, var func callback) {
    if (!GDX_Library) {
        return;
    };
    const int procAddress = 0;
    if (!procAddress) {
        procAddress = GetProcAddress(GDX_Library, "GDX_OpenMessageBox");
    };

    var int arg0; arg0 = _@s(message);
    var int arg1; arg1 = _@s(caption);
    var int arg2; arg2 = type;
    var int arg3; arg3 = MEM_GetFuncID(callback);

    const int call = 0;
    if (CALL_Begin(call)) {
        CALL_PtrParam(_@(arg3));
        CALL_PtrParam(_@(arg2));
        CALL_PtrParam(_@(arg1));
        CALL_PtrParam(_@(arg0));
        CALL__cdecl(procAddress);
        call = CALL_End();
    };
};
Автор
MaGoth
Скачивания
547
Просмотры
2.056
Первый выпуск
Обновление
Оценка
0,00 звёзд 0 оценок

Другие ресурсы пользователя MaGoth

Сверху Снизу