Skip to content
Snippets Groups Projects
Commit d3ff153d authored by deuce's avatar deuce
Browse files

Use data from vidmodes.h rather than included table...

.cols and .rows, not .charwidth and .charheight (Sheesh!)
parent c6af8f9a
No related branches found
No related tags found
No related merge requests found
......@@ -37,11 +37,9 @@
#include "ciolib.h"
#include "keys.h"
#include "vparams.h"
#include "vidmodes.h"
#include "win32cio.h"
#define VID_MODES 7
const int cio_tabs[10]={9,17,25,33,41,49,57,65,73,80};
struct keyvals {
......@@ -213,7 +211,7 @@ int win32_getchcode(WORD code, DWORD state)
if(state & (RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED))
return(keyval[i].CTRL);
if(state & (SHIFT_PRESSED))
return(keyval[i].Shift;
return(keyval[i].Shift);
return(keyval[i].Key);
}
}
......@@ -366,16 +364,16 @@ void win32_textmode(int mode)
COORD sz;
SMALL_RECT rc;
for(i=0;i<VID_MODES;i++) {
for(i=0;i<NUMMODES;i++) {
if(vparams[i].mode==mode)
modeidx=i;
}
sz.X=vparams[modeidx].charwidth;
sz.Y=vparams[modeidx].charheight;
sz.X=vparams[modeidx].cols;
sz.Y=vparams[modeidx].rows;
rc.Left=0;
rc.Right=vparams[modeidx].charwidth-1;
rc.Right=vparams[modeidx].cols-1;
rc.Top=0;
rc.Bottom=vparams[modeidx].charheight-1;
rc.Bottom=vparams[modeidx].rows-1;
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE),sz);
SetConsoleWindowInfo(GetStdHandle(STD_OUTPUT_HANDLE),TRUE,&rc);
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE),sz);
......@@ -418,8 +416,8 @@ void win32_gettextinfo(struct text_info* info)
info->curx=xpos;
info->cury=ypos;
info->attribute=currattr;
info->screenheight=vparams[modeidx].charheight;
info->screenwidth=vparams[modeidx].charwidth;
info->screenheight=vparams[modeidx].rows;
info->screenwidth=vparams[modeidx].cols;
}
void win32_gotoxy(int x, int y)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment