Skip to content

Conversation

@caiiiycuk
Copy link
Contributor

@caiiiycuk caiiiycuk commented Dec 2, 2024

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

изображение

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не понятно, может ли JS писать в буфер в этом случае. Для PC версии выглядит странным и избыточно.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Внутри делается duk_pop(ctx); что приводит к тому что итоговый указатель на строку может уже не существовать. Скорее всего надо копировать.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вроде бы нет, используется duk_push_string, он копирует строку

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirm

int XStream::open(const char* _name, unsigned f)
{

const char* name = sys_fileOpenQuant(_name, f);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

potential undefined behavior

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

может быть, лучше наверное std::string возвращать

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

папка /src/vss должна быть в /lib

Copy link
Contributor

@stalkerg stalkerg Feb 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кроме того .clang-format должен быть консистентным с глобальным. Или просто быть убран.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

у нас вроде как нет .clang-format

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include <ctype.h>
#include "iniparser.h"

extern const char* sys_fileOpenQuant(const char* file, unsigned flags);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо избегать использовать позднего связывания и extern.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Структура проекта не позволяет сделать подругому. vss находится в основном проекте, соответсвенно нет возможности явно сослаться на него.

id = xtInitApplication();

if (!sys_readyQuant()) {
xtDoneApplication();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это штатный выход или нет? Не кажется что тут может быть штатный выход.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

такой же выход как и ниже, цикл игры пропщен. надо с asan запустить, мне кажется что все норм тут.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

убрать


void xtClearMessageQueue(void)
{
sys_tickQuant();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему оно тут а не основном цикле? xtClearMessageQueue вызывается так же во время разных анимаций в меню и эскейве.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

возможно основной цикл вызывается не достаточно часто, в андроиде используется для изменения перключения видео в магазине

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

перенести в основной цикл, пока не поймём

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот файл разве не должен быть в data? А тут может быть example?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

разве не должен быть этот файл в некой папке example?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да

.prop("rudder", rudder)
.prop("tractionIncrement", traction_increment)
.prop("tractionDecrement", traction_decrement)
.prop("tractionMax", 255)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется тут мы должны некую переменную передавать либо иметь константу уже в самом vss.

Copy link
Contributor Author

@caiiiycuk caiiiycuk Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

подставить константу

"${PROJECT_SOURCE_DIR}/lib/xtool"
"${PROJECT_SOURCE_DIR}/lib/xgraph"
"${PROJECT_SOURCE_DIR}/lib/xsound"
"${PROJECT_SOURCE_DIR}/src/vss/duktape-2.7.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот движок должен подключаться как зависимость и не быть частью проекта.

${WINDOWS_RES}
actint/layout.h)

SET(vss_SRCS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо отдельно сделать CMakeFile для vss и собирать отдельную .a библиотеку.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не верный отступ пробелами тут

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лишний пробел

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем мы отправляем указатель в js и как мы с ним там работаем?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

можно удалить, никак не используется

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем нужуен этот квант? Тем более это просто redraw функция а не квант.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Используется для определния активного экрана. Используется в андроид версии для вывода Credits андроид версии перед основными кредитами

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужен для оверлея

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется не безопасно блокировать перерисовку из JS для элементов UI, какой был кейс?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Прячет не рабочие кнопки вроде, сетевой игры, fullscreen, etc...

Copy link
Contributor Author

@caiiiycuk caiiiycuk Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поправка, это вроде не используется в андроид коде

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем это?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Прячет не рабочие кнопки вроде, сетевой игры, fullscreen, etc...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

похожий вопросс.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Прячет не рабочие кнопки вроде, сетевой игры, fullscreen, etc...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duktape не должен быть в репозитории.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем constexpr тут?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

честно говоря не знаю. )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем это тут?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Есть mod который выранвниает землю перед машиной.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это зачем?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Есть mod который выранвниает землю перед машиной.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

аналогично.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для отображения увеличенной копии интерфейса, типа этого

изображение

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

разве в js мы нет уже готовой функции для этого?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

мы где то разве используем base64?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Так мы и создаем эту функцию в js) Вроде не используется, но думаю 100% понадобится

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

пока убираем

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

потенциальная проблемма

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants