Skip to content

Commit

Permalink
fix ReleaseWithDebInfo build
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemS2 committed Nov 14, 2024
1 parent 0757220 commit 8be5dc3
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 51 deletions.
70 changes: 35 additions & 35 deletions Q3E/src/main/jni/doom3bfg/doomclassic/doom/f_finale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,55 +719,55 @@ F_DrawPatchCol( int x, patch_t* patch, int col ) {
//
// F_BunnyScroll
//
void F_BunnyScroll (void)
void F_BunnyScroll(void)
{
int scrolled;
int x;
patch_t* p1;
patch_t* p2;
char name[10];
int stage;

p1 = (patch_t*)W_CacheLumpName ("PFUB2", PU_LEVEL_SHARED);
p2 = (patch_t*)W_CacheLumpName ("PFUB1", PU_LEVEL_SHARED);
int scrolled;
int x;
patch_t* p1;
patch_t* p2;
char name[14]; // Увеличен размер массива
int stage;

V_MarkRect (0, 0, SCREENWIDTH, SCREENHEIGHT);

scrolled = 320 - (::g->finalecount-230)/2;
p1 = (patch_t*)W_CacheLumpName("PFUB2", PU_LEVEL_SHARED);
p2 = (patch_t*)W_CacheLumpName("PFUB1", PU_LEVEL_SHARED);

V_MarkRect(0, 0, SCREENWIDTH, SCREENHEIGHT);

scrolled = 320 - (::g->finalecount - 230) / 2;
if (scrolled > 320)
scrolled = 320;
scrolled = 320;
if (scrolled < 0)
scrolled = 0;
for ( x=0 ; x<ORIGINAL_WIDTH ; x++)
scrolled = 0;

for (x = 0; x < ORIGINAL_WIDTH; x++)
{
if (x+scrolled < 320)
F_DrawPatchCol (x, p1, x+scrolled);
else
F_DrawPatchCol (x, p2, x+scrolled - 320);
if (x + scrolled < 320)
F_DrawPatchCol(x, p1, x + scrolled);
else
F_DrawPatchCol(x, p2, x + scrolled - 320);
}

if (::g->finalecount < 1130)
return;
return;
if (::g->finalecount < 1180)
{
V_DrawPatch ((ORIGINAL_WIDTH-13*8)/2,
(ORIGINAL_HEIGHT-8*8)/2,0, (patch_t*)W_CacheLumpName ("END0",PU_CACHE_SHARED));
::g->laststage = 0;
return;
V_DrawPatch((ORIGINAL_WIDTH - 13 * 8) / 2,
(ORIGINAL_HEIGHT - 8 * 8) / 2, 0, (patch_t*)W_CacheLumpName("END0", PU_CACHE_SHARED));
::g->laststage = 0;
return;
}
stage = (::g->finalecount-1180) / 5;

stage = (::g->finalecount - 1180) / 5;
if (stage > 6)
stage = 6;
stage = 6;
if (stage > ::g->laststage)
{
S_StartSound (NULL, sfx_pistol);
::g->laststage = stage;
S_StartSound(NULL, sfx_pistol);
::g->laststage = stage;
}
sprintf (name,"END%i",stage);
V_DrawPatch ((ORIGINAL_WIDTH-13*8)/2, (ORIGINAL_HEIGHT-8*8)/2,0, (patch_t*)W_CacheLumpName (name,PU_CACHE_SHARED));

snprintf(name, sizeof(name), "END%i", stage); // Используйте snprintf
V_DrawPatch((ORIGINAL_WIDTH - 13 * 8) / 2, (ORIGINAL_HEIGHT - 8 * 8) / 2, 0, (patch_t*)W_CacheLumpName(name, PU_CACHE_SHARED));
}


Expand Down
43 changes: 28 additions & 15 deletions Q3E/src/main/jni/doom3bfg/doomclassic/doom/hu_stuff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,21 +316,34 @@ char ForeignTranslation(unsigned char ch)

void HU_Init(void)
{

int i;
int j;
char buffer[9];

shiftxform = english_shiftxform;

// load the heads-up font
j = HU_FONTSTART;
for (i=0;i<HU_FONTSIZE;i++)
{
sprintf(buffer, "STCFN%.3d", j++);
::g->hu_font[i] = (patch_t *) W_CacheLumpName(buffer, PU_STATIC_SHARED);
}

int i;
int j;
char buffer[17]; // Увеличен размер массива до 17

shiftxform = english_shiftxform;

// load the heads-up font
j = HU_FONTSTART;
for (i = 0; i < HU_FONTSIZE; i++)
{
if (j < 10000) // Проверка, чтобы избежать переполнения
{
snprintf(buffer, sizeof(buffer), "STCFN%04d", j++); // Используйте %04d для дополнения нулями
if (g != NULL) // Проверка на NULL
{
g->hu_font[i] = (patch_t *) W_CacheLumpName(buffer, PU_STATIC_SHARED);
}
else
{
// Обработка ошибки: g не инициализирован
}
}
else
{
// Обработка ошибки: j превышает допустимое значение
break; // Выход из цикла, если j слишком велик
}
}
}

void HU_Stop(void)
Expand Down
2 changes: 1 addition & 1 deletion cmake_linux_build_doom3bfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


# Setup build type: Release | Debug
BUILD_TYPE=Release
BUILD_TYPE=ReleaseWithDebInfo
TARGET_PATH="`pwd`/Q3E/src/main/jni/doom3bfg/neo";

WORK_DIR=build
Expand Down

0 comments on commit 8be5dc3

Please sign in to comment.