Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/i_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#ifdef __GNUG__
#pragma interface
#endif
#include <stddef.h>

boolean I_StartDisplay(void);
void I_EndDisplay(void);
Expand Down
2 changes: 2 additions & 0 deletions include/i_system_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#define KEYD_START 9
#define KEYD_SELECT 10

using std::byte;

extern "C"
{

Expand Down
49 changes: 49 additions & 0 deletions source/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,55 @@ void G_ForcedLoadGame(void)
_g->gameaction = ga_loadgame;
}

#ifndef _MSC_VER
// Supports base 2 to 36
char* itoa(int value, char* buffer, int base) {
if (base < 2 || base > 36) {
buffer[0] = '\0'; // invalid base
return buffer;
}

int i = 0;
int isNegative = 0;

if (value == 0) {
buffer[i++] = '0';
buffer[i] = '\0';
return buffer;
}

if (value < 0 && base == 10) {
isNegative = 1;
value = -value;
}

while (value != 0) {
int rem = value % base;
buffer[i++] = (rem > 9) ? (rem - 10) + 'a' : rem + '0';
value = value / base;
}

if (isNegative) {
buffer[i++] = '-';
}

buffer[i] = '\0';

// Inline reverse
int start = 0;
int end = i - 1;
while (start < end) {
char temp = buffer[start];
buffer[start] = buffer[end];
buffer[end] = temp;
start++;
end--;
}

return buffer;
}
#endif


//
// Update the strings displayed in the load-save menu.
Expand Down
3 changes: 2 additions & 1 deletion source/i_system_e32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ void I_CreateWindow_e32()

window = new DoomWindow();

#ifndef __APPLE__
window->setAttribute(Qt::WA_PaintOnScreen);

#endif


window->resize(vid_width * 8, vid_height * 4);
Expand Down
1 change: 1 addition & 0 deletions source/lprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "doomtype.h"
#include "lprintf.h"
#include "i_main.h"
#include <string.h>

/* cphipps - enlarged message buffer and made non-static
* We still have to be careful here, this function can be called after exit
Expand Down
13 changes: 13 additions & 0 deletions source/r_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,19 @@ const texture_t* R_GetTexture(int texture)
return t;
}

#ifndef _MSC_VER
#include <ctype.h>

char* strupr(char* str) {
char* p = str;
while (*p) {
*p = toupper((unsigned char)*p);
p++;
}
return str;
}
#endif

static int R_GetTextureNumForName(const char* tex_name)
{
const int *maptex1, *maptex2;
Expand Down