Skip to content
Permalink
Browse files

Intial commit of LazyCat's work

  • Loading branch information...
philippeop committed Mar 11, 2013
1 parent 6fa5064 commit 8229a0a31a72a4b553fba0b5d91a6b1967aef5d5
Showing with 12,716 additions and 12,493 deletions.
  1. +27 −9 bionics.cpp
  2. +45 −48 catacurse.cpp
  3. +2 −2 crafting.h
  4. +8,968 −8,885 game.cpp
  5. +10 −4 inventory_ui.cpp
  6. +3,550 −3,452 iuse.cpp
  7. +5 −1 lightmap.cpp
  8. +97 −89 map.cpp
  9. +8 −3 player.cpp
  10. +4 −0 posix_time.cpp
@@ -199,8 +199,14 @@ void player::activate_bionic(int b, game *g)
break;

case bio_lighter:
g->draw();
mvprintw(0, 0, "Torch in which direction?");
//CAT:
// g->draw();
// mvprintw(0, 0, "Torch in which direction?");

//g->w_terrain->FG= 1;
mvwprintw(g->w_terrain, 0, 0, "Torch where?");
wrefresh(g->w_terrain);

input = get_input();
get_direction(dirx, diry, input);
if (dirx == -2) {
@@ -252,8 +258,14 @@ void player::activate_bionic(int b, game *g)
break;

case bio_emp:
g->draw();
mvprintw(0, 0, "Fire EMP in which direction?");
//CAT:
// g->draw();
// mvprintw(0, 0, "Fire EMP in which direction?");

//g->w_terrain->FG= 1;
mvwprintw(g->w_terrain, 0, 0, "Fire where?");
wrefresh(g->w_terrain);

input = get_input();
get_direction(dirx, diry, input);
if (dirx == -2) {
@@ -338,8 +350,14 @@ void player::activate_bionic(int b, game *g)
break;

case bio_lockpick:
g->draw();
mvprintw(0, 0, "Unlock in which direction?");
//CAT:
// g->draw();
// mvprintw(0, 0, "Unlock in which direction?");

//g->w_terrain->FG= 1;
mvwprintw(g->w_terrain, 0, 0, "Unlock where?");
wrefresh(g->w_terrain);

input = get_input();
get_direction(dirx, diry, input);
if (dirx == -2) {
@@ -370,9 +388,9 @@ bool player::install_bionics(game *g, it_bionic* type)
WINDOW* w = newwin(25, 80, 0, 0);

int pl_skill = int_cur +
skillLevel("electronics") * 4 +
skillLevel("firstaid") * 3 +
skillLevel("mechanics") * 2;
skillLevel("electronics").level() * 4 +
skillLevel("firstaid").level() * 3 +
skillLevel("mechanics").level() * 2;

int skint = int(pl_skill / 4);
int skdec = int((pl_skill * 10) / 4) % 10;
@@ -238,6 +238,11 @@ void DrawWindow(WINDOW *win)
};//for (i=0;i<_windows[w].width;i++)
};// for (j=0;j<_windows[w].height;j++)
win->draw=false; //We drew the window, mark it as so

//CAT:
InvalidateRect(WindowHandle,NULL,true);
UpdateWindow(WindowHandle);

};

//Check for any window messages (keypress, paint, mousemove, etc)
@@ -267,7 +272,7 @@ std::ifstream fin;
fin.open("data\\FONTDATA");
if (!fin.is_open()){
MessageBox(WindowHandle, "Failed to open FONTDATA, loading defaults.",
NULL, NULL);
NULL, 0);
fontheight=16;
fontwidth=8;
} else {
@@ -278,7 +283,7 @@ fin.open("data\\FONTDATA");
fin >> fontheight;
if ((fontwidth <= 4) || (fontheight <=4)){
MessageBox(WindowHandle, "Invalid font size specified!",
NULL, NULL);
NULL, 0);
fontheight=16;
fontwidth=8;
}
@@ -287,8 +292,10 @@ fin.open("data\\FONTDATA");
halfheight=fontheight / 2;
WindowWidth= (55 + (OPTIONS[OPT_VIEWPORT_X] * 2 + 1)) * fontwidth;
WindowHeight= (OPTIONS[OPT_VIEWPORT_Y] * 2 + 1) *fontheight;
WindowX=(GetSystemMetrics(SM_CXSCREEN) / 2)-WindowWidth/2; //center this
WindowY=(GetSystemMetrics(SM_CYSCREEN) / 2)-WindowHeight/2; //sucker
//CAT:
WindowX= 10; //(GetSystemMetrics(SM_CXSCREEN) / 2)-WindowWidth/2; //center this
WindowY= 400; //(GetSystemMetrics(SM_CYSCREEN) / 2)-WindowHeight/2; //sucker

WinCreate(); //Create the actual window, register it, etc
CheckMessages(); //Let the message queue handle setting up the window
WindowDC = GetDC(WindowHandle);
@@ -314,7 +321,7 @@ fin.open("data\\FONTDATA");

} else {
MessageBox(WindowHandle, "Failed to load default font, using FixedSys.",
NULL, NULL);
NULL, 0);
font = CreateFont(fontheight, fontwidth, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE,
ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
PROOF_QUALITY, FF_MODERN, "FixedSys"); //Create our font
@@ -449,37 +456,14 @@ int refresh(void)
//but jday helped to figure most of it out
int getch(void)
{
refresh();
InvalidateRect(WindowHandle,NULL,true);
lastchar=ERR;//ERR=-1
if (inputdelay < 0)
{
do
{
//CAT:
refresh();

lastchar=ERR;
do{
CheckMessages();
if (lastchar!=ERR) break;
MsgWaitForMultipleObjects(0, NULL, FALSE, 50, QS_ALLEVENTS);//low cpu wait!
}
while (lastchar==ERR);
}
else if (inputdelay > 0)
{
unsigned long starttime=GetTickCount();
unsigned long endtime;
do
{
CheckMessages(); //MsgWaitForMultipleObjects won't work very good here
endtime=GetTickCount(); //it responds to mouse movement, and WM_PAINT, not good
if (lastchar!=ERR) break;
Sleep(2);
}
while (endtime<(starttime+inputdelay));
}
else
{
CheckMessages();
};
Sleep(25);
}while (lastchar==ERR);

return lastchar;
};

@@ -560,15 +544,22 @@ int werase(WINDOW *win)
for (j=0; j<win->height; j++)
{
for (i=0; i<win->width; i++) {
win->line[j].chars[i]=0;
win->line[j].FG[i]=0;
win->line[j].BG[i]=0;
}

//CAT:
// if(win->line[j].touched=true) {

win->line[j].chars[i]=0;
win->line[j].FG[i]=0;
win->line[j].BG[i]=0;
}
// }
win->line[j].touched=true;
}
win->draw=true;
wmove(win,0,0);
wrefresh(win);

// win->draw=true;
// wmove(win,0,0);
// wrefresh(win);

return 1;
};

@@ -661,15 +652,21 @@ int start_color(void)
colorpairs=new pairs[50];
windowsPalette=new RGBQUAD[16]; //Colors in the struct are BGR!! not RGB!!
windowsPalette[0]= BGR(0,0,0); // Black
windowsPalette[1]= BGR(0, 0, 255); // Red
windowsPalette[2]= BGR(0,100,0); // Green
windowsPalette[3]= BGR(23,51,92); // Brown???
windowsPalette[4]= BGR(150, 0, 0); // Blue
windowsPalette[1]= BGR(0, 0, 200); // Red

//CAT
windowsPalette[2]= BGR(0,150,0); // Green
windowsPalette[3]= BGR(50,90,170); // Brown???
windowsPalette[4]= BGR(200, 0, 0); // Blue

windowsPalette[5]= BGR(98, 58, 139); // Purple
windowsPalette[6]= BGR(180, 150, 0); // Cyan
windowsPalette[7]= BGR(196, 196, 196);// Gray
windowsPalette[8]= BGR(77, 77, 77);// Dark Gray
windowsPalette[9]= BGR(150, 150, 255); // Light Red/Salmon?

//CAT:
windowsPalette[8]= BGR(90, 90, 90);// Dark Gray
windowsPalette[9]= BGR(100, 100, 255); // Light Red/Salmon?

windowsPalette[10]= BGR(0, 255, 0); // Bright Green
windowsPalette[11]= BGR(0, 255, 255); // Yellow
windowsPalette[12]= BGR(255, 100, 100); // Light Blue
@@ -41,8 +41,8 @@ struct recipe {
int time;
bool reversible; // can the item be disassembled?

std::vector<component> tools[20];
std::vector<component> components[20];
std::vector<component> tools[5];
std::vector<component> components[10];

recipe() {
id = 0;

0 comments on commit 8229a0a

Please sign in to comment.
You can’t perform that action at this time.