Conversation
| int pitch; | ||
| SDL_LockTexture(sdlTexture, NULL, &pixels, &pitch); | ||
| blitRgba((uint32_t*)pixels, get_default_render_buffer(), get_2d_rgba_render_buffer(), get_2d_render_buffer()); | ||
| sys_frameQuant(pixels, xgrScreenSizeX, xgrScreenSizeY, 4); |
There was a problem hiding this comment.
Не понятно, может ли JS писать в буфер в этом случае. Для PC версии выглядит странным и избыточно.
There was a problem hiding this comment.
sys_frameQuant - оповещает js что фрейм изменился. В буфер js писать не может, но укзатель используется для чтения буфера.
Указатель может быть использован в функции getRgbaData что бы получить RGBA массив. Используется в андроид версии для отображения мелких экранов (меню, карты) в увеличенном виде.
| dictionary * iniparser_load(const char * ininame) | ||
| dictionary * iniparser_load(const char * _ininame) | ||
| { | ||
| const char* ininame = sys_fileOpenQuant(_ininame, /*XS::IN*/ 1); |
There was a problem hiding this comment.
Внутри делается duk_pop(ctx); что приводит к тому что итоговый указатель на строку может уже не существовать. Скорее всего надо копировать.
There was a problem hiding this comment.
вроде бы нет, используется duk_push_string, он копирует строку
| int XStream::open(const char* _name, unsigned f) | ||
| { | ||
|
|
||
| const char* name = sys_fileOpenQuant(_name, f); |
There was a problem hiding this comment.
potential undefined behavior
There was a problem hiding this comment.
может быть, лучше наверное std::string возвращать
There was a problem hiding this comment.
папка /src/vss должна быть в /lib
There was a problem hiding this comment.
Кроме того .clang-format должен быть консистентным с глобальным. Или просто быть убран.
There was a problem hiding this comment.
у нас вроде как нет .clang-format
| #include <ctype.h> | ||
| #include "iniparser.h" | ||
|
|
||
| extern const char* sys_fileOpenQuant(const char* file, unsigned flags); |
There was a problem hiding this comment.
Надо избегать использовать позднего связывания и extern.
There was a problem hiding this comment.
Структура проекта не позволяет сделать подругому. vss находится в основном проекте, соответсвенно нет возможности явно сослаться на него.
| id = xtInitApplication(); | ||
|
|
||
| if (!sys_readyQuant()) { | ||
| xtDoneApplication(); |
There was a problem hiding this comment.
Это штатный выход или нет? Не кажется что тут может быть штатный выход.
There was a problem hiding this comment.
такой же выход как и ниже, цикл игры пропщен. надо с asan запустить, мне кажется что все норм тут.
|
|
||
| void xtClearMessageQueue(void) | ||
| { | ||
| sys_tickQuant(); |
There was a problem hiding this comment.
Почему оно тут а не основном цикле? xtClearMessageQueue вызывается так же во время разных анимаций в меню и эскейве.
There was a problem hiding this comment.
возможно основной цикл вызывается не достаточно часто, в андроиде используется для изменения перключения видео в магазине
There was a problem hiding this comment.
перенести в основной цикл, пока не поймём
There was a problem hiding this comment.
Этот файл разве не должен быть в data? А тут может быть example?
There was a problem hiding this comment.
разве не должен быть этот файл в некой папке example?
| .prop("rudder", rudder) | ||
| .prop("tractionIncrement", traction_increment) | ||
| .prop("tractionDecrement", traction_decrement) | ||
| .prop("tractionMax", 255) |
There was a problem hiding this comment.
Кажется тут мы должны некую переменную передавать либо иметь константу уже в самом vss.
| "${PROJECT_SOURCE_DIR}/lib/xtool" | ||
| "${PROJECT_SOURCE_DIR}/lib/xgraph" | ||
| "${PROJECT_SOURCE_DIR}/lib/xsound" | ||
| "${PROJECT_SOURCE_DIR}/src/vss/duktape-2.7.0" |
There was a problem hiding this comment.
Этот движок должен подключаться как зависимость и не быть частью проекта.
| ${WINDOWS_RES} | ||
| actint/layout.h) | ||
|
|
||
| SET(vss_SRCS |
There was a problem hiding this comment.
Надо отдельно сделать CMakeFile для vss и собирать отдельную .a библиотеку.
src/actint/actint.cpp
Outdated
There was a problem hiding this comment.
не верный отступ пробелами тут
src/actint/actint.cpp
Outdated
src/actint/actint.cpp
Outdated
There was a problem hiding this comment.
зачем мы отправляем указатель в js и как мы с ним там работаем?
There was a problem hiding this comment.
можно удалить, никак не используется
src/iscreen/iscreen.cpp
Outdated
There was a problem hiding this comment.
Зачем нужуен этот квант? Тем более это просто redraw функция а не квант.
There was a problem hiding this comment.
Используется для определния активного экрана. Используется в андроид версии для вывода Credits андроид версии перед основными кредитами
src/iscreen/iscreen.cpp
Outdated
There was a problem hiding this comment.
Кажется не безопасно блокировать перерисовку из JS для элементов UI, какой был кейс?
There was a problem hiding this comment.
Прячет не рабочие кнопки вроде, сетевой игры, fullscreen, etc...
There was a problem hiding this comment.
Поправка, это вроде не используется в андроид коде
src/iscreen/iscreen.cpp
Outdated
There was a problem hiding this comment.
Прячет не рабочие кнопки вроде, сетевой игры, fullscreen, etc...
src/iscreen/iscreen.cpp
Outdated
There was a problem hiding this comment.
Прячет не рабочие кнопки вроде, сетевой игры, fullscreen, etc...
There was a problem hiding this comment.
duktape не должен быть в репозитории.
src/vss/quant-names.h
Outdated
There was a problem hiding this comment.
честно говоря не знаю. )
src/vss/sys-bridge.cpp
Outdated
There was a problem hiding this comment.
Есть mod который выранвниает землю перед машиной.
src/vss/sys-bridge.cpp
Outdated
There was a problem hiding this comment.
Есть mod который выранвниает землю перед машиной.
src/vss/sys-bridge.cpp
Outdated
src/vss/sys-bridge.cpp
Outdated
There was a problem hiding this comment.
разве в js мы нет уже готовой функции для этого?
There was a problem hiding this comment.
мы где то разве используем base64?
There was a problem hiding this comment.
Так мы и создаем эту функцию в js) Вроде не используется, но думаю 100% понадобится

Probably github don't ignore line spacing by default, please use this option to see actual diff: