mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 20:31:30 +00:00
Merge branch 'next' into public_next
This commit is contained in:
commit
0cf42d8bb8
4 changed files with 104 additions and 98 deletions
33
appveyor.yml
33
appveyor.yml
|
@ -58,26 +58,29 @@ after_build:
|
|||
- cmd: git rev-parse --short %APPVEYOR_REPO_COMMIT%>%TMP%/gitshort.txt
|
||||
- cmd: set /P GITSHORT=<%TMP%/gitshort.txt
|
||||
- set BUILD_ARCHIVE=%APPVEYOR_REPO_BRANCH%-%GITSHORT%-%CONFIGURATION%.7z
|
||||
- set BUILDSARCHIVE=%APPVEYOR_REPO_BRANCH%-%CONFIGURATION%.7z
|
||||
- cmd: 7z a %BUILD_ARCHIVE% bin\Mingw\Release -xr!.gitignore
|
||||
- appveyor PushArtifact %BUILD_ARCHIVE%
|
||||
- cmd: copy %BUILD_ARCHIVE% %BUILDSARCHIVE%
|
||||
- appveyor PushArtifact %BUILDSARCHIVE%
|
||||
|
||||
test: off
|
||||
|
||||
deploy:
|
||||
- provider: FTP
|
||||
protocol: ftps
|
||||
host:
|
||||
secure: NsLJEPIBvmwCOj8Tg8RoRQ==
|
||||
username:
|
||||
secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA=
|
||||
password:
|
||||
secure: Hbn6Uy3lT0YZ88yFJ3aW4w==
|
||||
folder: appveyor
|
||||
application:
|
||||
active_mode: false
|
||||
on:
|
||||
branch: master
|
||||
appveyor_repo_tag: true
|
||||
#deploy:
|
||||
# - provider: FTP
|
||||
# protocol: ftps
|
||||
# host:
|
||||
# secure: NsLJEPIBvmwCOj8Tg8RoRQ==
|
||||
# username:
|
||||
# secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA=
|
||||
# password:
|
||||
# secure: Hbn6Uy3lT0YZ88yFJ3aW4w==
|
||||
# folder: appveyor
|
||||
# application:
|
||||
# active_mode: false
|
||||
# on:
|
||||
# branch: master
|
||||
# appveyor_repo_tag: true
|
||||
|
||||
|
||||
on_finish:
|
||||
|
|
13
src/r_data.c
13
src/r_data.c
|
@ -944,23 +944,24 @@ static void R_InitExtraColormaps(void)
|
|||
for (cfile = clump = 0; cfile < numwadfiles; cfile++, clump = 0)
|
||||
{
|
||||
startnum = W_CheckNumForNamePwad("C_START", cfile, clump);
|
||||
if (startnum == LUMPERROR)
|
||||
if (startnum == INT16_MAX)
|
||||
continue;
|
||||
|
||||
endnum = W_CheckNumForNamePwad("C_END", cfile, clump);
|
||||
|
||||
if (endnum == LUMPERROR)
|
||||
if (endnum == INT16_MAX)
|
||||
I_Error("R_InitExtraColormaps: C_START without C_END\n");
|
||||
|
||||
if (WADFILENUM(startnum) != WADFILENUM(endnum))
|
||||
I_Error("R_InitExtraColormaps: C_START and C_END in different wad files!\n");
|
||||
// This shouldn't be possible when you use the Pwad function, silly
|
||||
//if (WADFILENUM(startnum) != WADFILENUM(endnum))
|
||||
//I_Error("R_InitExtraColormaps: C_START and C_END in different wad files!\n");
|
||||
|
||||
if (numcolormaplumps >= maxcolormaplumps)
|
||||
maxcolormaplumps *= 2;
|
||||
colormaplumps = Z_Realloc(colormaplumps,
|
||||
sizeof (*colormaplumps) * maxcolormaplumps, PU_STATIC, NULL);
|
||||
colormaplumps[numcolormaplumps].wadfile = WADFILENUM(startnum);
|
||||
colormaplumps[numcolormaplumps].firstlump = LUMPNUM(startnum+1);
|
||||
colormaplumps[numcolormaplumps].wadfile = cfile;
|
||||
colormaplumps[numcolormaplumps].firstlump = startnum+1;
|
||||
colormaplumps[numcolormaplumps].numlumps = endnum - (startnum + 1);
|
||||
numcolormaplumps++;
|
||||
}
|
||||
|
|
|
@ -590,70 +590,78 @@ static BOOL I_ReadyConsole(HANDLE ci)
|
|||
|
||||
static boolean entering_con_command = false;
|
||||
|
||||
static void Impl_HandleKeyboardConsoleEvent(KEY_EVENT_RECORD evt, HANDLE co)
|
||||
{
|
||||
event_t event;
|
||||
CONSOLE_SCREEN_BUFFER_INFO CSBI;
|
||||
DWORD t;
|
||||
|
||||
memset(&event,0x00,sizeof (event));
|
||||
|
||||
if (evt.bKeyDown)
|
||||
{
|
||||
event.type = ev_console;
|
||||
entering_con_command = true;
|
||||
switch (evt.wVirtualKeyCode)
|
||||
{
|
||||
case VK_ESCAPE:
|
||||
case VK_TAB:
|
||||
event.data1 = KEY_NULL;
|
||||
break;
|
||||
case VK_SHIFT:
|
||||
event.data1 = KEY_LSHIFT;
|
||||
break;
|
||||
case VK_RETURN:
|
||||
entering_con_command = false;
|
||||
// Fall through.
|
||||
default:
|
||||
event.data1 = MapVirtualKey(evt.wVirtualKeyCode,2); // convert in to char
|
||||
}
|
||||
if (co != INVALID_HANDLE_VALUE && GetFileType(co) == FILE_TYPE_CHAR && GetConsoleMode(co, &t))
|
||||
{
|
||||
if (event.data1 && event.data1 != KEY_LSHIFT && event.data1 != KEY_RSHIFT)
|
||||
{
|
||||
#ifdef _UNICODE
|
||||
WriteConsole(co, &evt.uChar.UnicodeChar, 1, &t, NULL);
|
||||
#else
|
||||
WriteConsole(co, &evt.uChar.AsciiChar, 1 , &t, NULL);
|
||||
#endif
|
||||
}
|
||||
if (evt.wVirtualKeyCode == VK_BACK
|
||||
&& GetConsoleScreenBufferInfo(co,&CSBI))
|
||||
{
|
||||
WriteConsoleOutputCharacterA(co, " ",1, CSBI.dwCursorPosition, &t);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
event.type = ev_keyup;
|
||||
switch (evt.wVirtualKeyCode)
|
||||
{
|
||||
case VK_SHIFT:
|
||||
event.data1 = KEY_LSHIFT;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (event.data1) D_PostEvent(&event);
|
||||
}
|
||||
|
||||
void I_GetConsoleEvents(void)
|
||||
{
|
||||
event_t ev = {0,0,0,0};
|
||||
HANDLE ci = GetStdHandle(STD_INPUT_HANDLE);
|
||||
HANDLE co = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
CONSOLE_SCREEN_BUFFER_INFO CSBI;
|
||||
INPUT_RECORD input;
|
||||
DWORD t;
|
||||
|
||||
while (I_ReadyConsole(ci) && ReadConsoleInput(ci, &input, 1, &t) && t)
|
||||
{
|
||||
memset(&ev,0x00,sizeof (ev));
|
||||
switch (input.EventType)
|
||||
{
|
||||
case KEY_EVENT:
|
||||
if (input.Event.KeyEvent.bKeyDown)
|
||||
{
|
||||
ev.type = ev_console;
|
||||
entering_con_command = true;
|
||||
switch (input.Event.KeyEvent.wVirtualKeyCode)
|
||||
{
|
||||
case VK_ESCAPE:
|
||||
case VK_TAB:
|
||||
ev.data1 = KEY_NULL;
|
||||
break;
|
||||
case VK_SHIFT:
|
||||
ev.data1 = KEY_LSHIFT;
|
||||
break;
|
||||
case VK_RETURN:
|
||||
entering_con_command = false;
|
||||
// Fall through.
|
||||
default:
|
||||
ev.data1 = MapVirtualKey(input.Event.KeyEvent.wVirtualKeyCode,2); // convert in to char
|
||||
}
|
||||
if (co != INVALID_HANDLE_VALUE && GetFileType(co) == FILE_TYPE_CHAR && GetConsoleMode(co, &t))
|
||||
{
|
||||
if (ev.data1 && ev.data1 != KEY_LSHIFT && ev.data1 != KEY_RSHIFT)
|
||||
{
|
||||
#ifdef _UNICODE
|
||||
WriteConsole(co, &input.Event.KeyEvent.uChar.UnicodeChar, 1, &t, NULL);
|
||||
#else
|
||||
WriteConsole(co, &input.Event.KeyEvent.uChar.AsciiChar, 1 , &t, NULL);
|
||||
#endif
|
||||
}
|
||||
if (input.Event.KeyEvent.wVirtualKeyCode == VK_BACK
|
||||
&& GetConsoleScreenBufferInfo(co,&CSBI))
|
||||
{
|
||||
WriteConsoleOutputCharacterA(co, " ",1, CSBI.dwCursorPosition, &t);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ev.type = ev_keyup;
|
||||
switch (input.Event.KeyEvent.wVirtualKeyCode)
|
||||
{
|
||||
case VK_SHIFT:
|
||||
ev.data1 = KEY_LSHIFT;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ev.data1) D_PostEvent(&ev);
|
||||
Impl_HandleKeyboardConsoleEvent(input.Event.KeyEvent, co);
|
||||
break;
|
||||
case MOUSE_EVENT:
|
||||
case WINDOW_BUFFER_SIZE_EVENT:
|
||||
|
|
|
@ -181,15 +181,13 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen)
|
|||
wasfullscreen = SDL_TRUE;
|
||||
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||
}
|
||||
else if (wasfullscreen)
|
||||
{
|
||||
wasfullscreen = SDL_FALSE;
|
||||
SDL_SetWindowFullscreen(window, 0);
|
||||
SDL_SetWindowSize(window, width, height);
|
||||
SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED_DISPLAY(1), SDL_WINDOWPOS_CENTERED_DISPLAY(1));
|
||||
}
|
||||
else
|
||||
else // windowed mode
|
||||
{
|
||||
if (wasfullscreen)
|
||||
{
|
||||
wasfullscreen = SDL_FALSE;
|
||||
SDL_SetWindowFullscreen(window, 0);
|
||||
}
|
||||
// Reposition window only in windowed mode
|
||||
SDL_SetWindowSize(window, width, height);
|
||||
SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED_DISPLAY(1), SDL_WINDOWPOS_CENTERED_DISPLAY(1));
|
||||
|
@ -899,7 +897,7 @@ static inline boolean I_SkipFrame(void)
|
|||
{
|
||||
static boolean skip = false;
|
||||
|
||||
if (render_soft != rendermode)
|
||||
if (rendermode != render_soft)
|
||||
return false;
|
||||
|
||||
skip = !skip;
|
||||
|
@ -931,7 +929,7 @@ void I_FinishUpdate(void)
|
|||
if (cv_ticrate.value)
|
||||
SCR_DisplayTicRate();
|
||||
|
||||
if (render_soft == rendermode && screens[0])
|
||||
if (rendermode == render_soft && screens[0])
|
||||
{
|
||||
SDL_Rect rect;
|
||||
|
||||
|
@ -958,7 +956,7 @@ void I_FinishUpdate(void)
|
|||
}
|
||||
|
||||
#ifdef HWRENDER
|
||||
else
|
||||
else if (rendermode == render_opengl)
|
||||
{
|
||||
OglSdlFinishUpdate(cv_vidwait.value);
|
||||
}
|
||||
|
@ -1188,9 +1186,9 @@ INT32 VID_SetMode(INT32 modeNum)
|
|||
}
|
||||
Impl_SetWindowName("SRB2 "VERSIONSTRING);
|
||||
|
||||
SDLSetMode(windowedModes[modeNum][0], windowedModes[modeNum][1], USE_FULLSCREEN);
|
||||
SDLSetMode(vid.width, vid.height, USE_FULLSCREEN);
|
||||
|
||||
if (render_soft == rendermode)
|
||||
if (rendermode == render_soft)
|
||||
{
|
||||
if (bufSurface)
|
||||
{
|
||||
|
@ -1209,30 +1207,20 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
|
|||
int flags = 0;
|
||||
|
||||
if (rendermode == render_none) // dedicated
|
||||
{
|
||||
return SDL_TRUE; // Monster Iestyn -- not sure if it really matters what we return here tbh
|
||||
}
|
||||
|
||||
if (window != NULL)
|
||||
{
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
if (fullscreen)
|
||||
{
|
||||
flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||
}
|
||||
|
||||
if (borderlesswindow)
|
||||
{
|
||||
flags |= SDL_WINDOW_BORDERLESS;
|
||||
}
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
flags |= SDL_WINDOW_OPENGL;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Create a window
|
||||
|
@ -1261,7 +1249,13 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
|
|||
#endif
|
||||
if (rendermode == render_soft)
|
||||
{
|
||||
renderer = SDL_CreateRenderer(window, -1, (usesdl2soft ? SDL_RENDERER_SOFTWARE : 0) | (cv_vidwait.value && !usesdl2soft ? SDL_RENDERER_PRESENTVSYNC : 0));
|
||||
flags = 0; // Use this to set SDL_RENDERER_* flags now
|
||||
if (usesdl2soft)
|
||||
flags |= SDL_RENDERER_SOFTWARE;
|
||||
else if (cv_vidwait.value)
|
||||
flags |= SDL_RENDERER_PRESENTVSYNC;
|
||||
|
||||
renderer = SDL_CreateRenderer(window, -1, flags);
|
||||
if (renderer == NULL)
|
||||
{
|
||||
CONS_Printf(M_GetText("Couldn't create rendering context: %s\n"), SDL_GetError());
|
||||
|
@ -1483,7 +1477,7 @@ void I_ShutdownGraphics(void)
|
|||
rendermode = render_none;
|
||||
if (icoSurface) SDL_FreeSurface(icoSurface);
|
||||
icoSurface = NULL;
|
||||
if (render_soft == oldrendermode)
|
||||
if (oldrendermode == render_soft)
|
||||
{
|
||||
if (vidSurface) SDL_FreeSurface(vidSurface);
|
||||
vidSurface = NULL;
|
||||
|
|
Loading…
Reference in a new issue