Skip to content

Commit

Permalink
CodeBlocks now functioning properly
Browse files Browse the repository at this point in the history
Still need to update COMPILE_README.txt to update the new changes for
compiling using CodeBlocks
  • Loading branch information
Kamal-Sadek committed May 8, 2016
1 parent 9a34387 commit 127d712
Show file tree
Hide file tree
Showing 8 changed files with 851 additions and 36 deletions.
32 changes: 16 additions & 16 deletions src/basemode/activate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ void activate(Creature *cr)
cr->activity.type=ACTIVITY_STEALCARS;
else if(!(cr->flag & CREATUREFLAG_WHEELCHAIR))
cr->activity.type=ACTIVITY_WHEELCHAIR;
break;
break;
case '5': {
if(cr->get_skill(SKILL_SCIENCE)!=0) {
activityst oact=cr->activity;
Expand Down Expand Up @@ -1626,19 +1626,19 @@ vector<string>& split_string(const string &s, char delim, vector<string> &elems)
for(char c:s) {
if(c==' ')
{
elems.push_back(oss.str());
elems.push_back(oss.str());
oss.str(string());
}
else if(c=='\n')
{
elems.push_back(oss.str());
elems.push_back("");
elems.push_back(oss.str());
elems.push_back("");
oss.str(string());
}
else oss<<c;
}
elems.push_back(oss.str());

return elems;
}

Expand Down Expand Up @@ -1682,7 +1682,7 @@ void select_augmentation(Creature *cr) //TODO: Finish and general cleanup
mvaddstr(y,49,temppool[p]->get_attribute(ATTRIBUTE_HEART,true));
mvaddstr(y,62,temppool[p]->age);
printhealthstat(*temppool[p],y,31,TRUE);
}
}

set_color(COLOR_WHITE,COLOR_BLACK,0);
move(22,0);
Expand Down Expand Up @@ -1712,7 +1712,7 @@ void select_augmentation(Creature *cr) //TODO: Finish and general cleanup
if(c=='x'||c==ESC||c==SPACEBAR||c==ENTER) return;

break;



case 1: //PAGE 1, selecting an augmentation
Expand All @@ -1736,7 +1736,7 @@ void select_augmentation(Creature *cr) //TODO: Finish and general cleanup
}

if(aug_c>='a'&&aug_c<='e'&&c>='a'&&c<='e')
{
{
aug_type.clear();
if(victim->get_augmentation(aug_c-'a').type==-1) //False if already augmented on that bodypart.
{
Expand All @@ -1745,7 +1745,7 @@ void select_augmentation(Creature *cr) //TODO: Finish and general cleanup
if(augmenttype[x]->get_type()==aug_c-'a'&&
(augmenttype[x]->get_max_age()==-1||victim->age<=augmenttype[x]->get_max_age())&&
(augmenttype[x]->get_min_age()==-1||victim->age>=augmenttype[x]->get_min_age())&&
augmenttype[x]->get_cost() <= ledger.get_funds())
augmenttype[x]->get_cost() <= ledger.get_funds())
//TODO: Make it so that if you don't have money, it just grays it out, not just not show it
aug_type.push_back(augmenttype[x]);
}
Expand All @@ -1771,7 +1771,7 @@ void select_augmentation(Creature *cr) //TODO: Finish and general cleanup

c = getkey();
if(c>='a'&&c<='e') aug_c=c;
else if(c==ESC)return;
else if(c==ESC)return;
else if(c=='x'||c==SPACEBAR||c==ENTER) {cur_step=0;aug_type.clear();aug_c=0;}
break;

Expand All @@ -1794,9 +1794,9 @@ void select_augmentation(Creature *cr) //TODO: Finish and general cleanup
mvaddstr(4, 0, "Effect: ");
set_color(COLOR_WHITE,COLOR_BLACK,0);
string selected_attribute = attribute_enum_to_string(selected_aug->get_attribute());
addstr((char)(toupper(selected_attribute.at(0))) +
addstr((char)(toupper(selected_attribute.at(0))) +
selected_attribute.substr(1) +
(selected_aug->get_effect() >= 0 ? " +" : " ") +
(selected_aug->get_effect() >= 0 ? " +" : " ") +
tostring(selected_aug->get_effect()));

set_color(COLOR_WHITE,COLOR_BLACK,1);
Expand Down Expand Up @@ -1841,7 +1841,7 @@ void select_augmentation(Creature *cr) //TODO: Finish and general cleanup
mvaddstr(23,1,"Are you sure? (y/n)");

c = getkey();
if(c=='y')
if(c=='y')
{
set_color(COLOR_WHITE,COLOR_BLACK,0);
mvaddstr(23,1,"Press any key to return");
Expand Down Expand Up @@ -1886,8 +1886,8 @@ void select_augmentation(Creature *cr) //TODO: Finish and general cleanup

case AUGMENTATION_SKIN:
if(LCSrandom(2))
wound=&victim->wound[BODYPART_HEAD];
else
wound=&victim->wound[BODYPART_HEAD];
else
wound=&victim->wound[BODYPART_BODY];
victim->blood-=50;
break;
Expand Down Expand Up @@ -1960,7 +1960,7 @@ void select_augmentation(Creature *cr) //TODO: Finish and general cleanup
return;
}

else if(c==ESC)return;
else if(c==ESC)return;
else if(c=='x'||c==SPACEBAR||c==ENTER||c=='n') {cur_step=1;selected_aug=nullptr;}
break;
}
Expand Down
6 changes: 5 additions & 1 deletion src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#ifndef COMMON_H_INCLUDED
#define COMMON_H_INCLUDED

#ifdef __linux__
#define NCURSES
#endif

// uncomment this next line if you want to disable SDL (which is for music/sound)
//#define DONT_INCLUDE_SDL

Expand Down Expand Up @@ -146,7 +150,7 @@
#ifdef GO_PORTABLE
#include <time.h>

#ifdef Linux // And BSD and SVr4
#ifdef __linux__ // And BSD and SVr4
/*
This #undef addstr...It exists only to make the overloaded addstr
work in linux (because otherwise it clashes with ncurses).
Expand Down
2 changes: 1 addition & 1 deletion src/compat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int stricmp(const char *str1,const char *str2)
}
#endif

#ifdef Linux // BSD and SVr4 too
#ifdef __linux__ // BSD and SVr4 too

int init_alarm=0; // Flag to indicate if alarmHandler() has been registered.
struct itimerval timer_off,timer_on;
Expand Down
4 changes: 2 additions & 2 deletions src/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

#include "common.h" /* include this prior to checking if WIN32 is defined */

#ifdef Linux
#ifdef __linux__
// <http://msdn.microsoft.com/en-us/library/aa383751(VS.85).aspx>
// <http://msdn.microsoft.com/en-us/library/s3f49ktz.aspx>

Expand Down Expand Up @@ -117,7 +117,7 @@ typedef PVOID HANDLE;
int stricmp(const char *str1, const char *str2);
#endif

#ifdef Linux // BSD and SVr4 too
#ifdef __linux__ // BSD and SVr4 too

extern int init_alarm;
extern struct itimerval timer_off;
Expand Down
4 changes: 4 additions & 0 deletions src/pdcurses/curses.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef __WIN32__

#ifndef PDC_DLL_BUILD
# define PDC_DLL_BUILD
#endif
Expand Down Expand Up @@ -1382,3 +1384,5 @@ int sb_refresh(void);
#endif

#endif /* __PDCURSES__ */

#endif
4 changes: 0 additions & 4 deletions src/sdl/SDL_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@
* \endcode
*/

#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
#define main SDL_main
#endif

/**
* The prototype for the application's main() function
*/
Expand Down
19 changes: 7 additions & 12 deletions workspaces/game.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<FileVersion major="1" minor="6" />
<Project>
<Option title="Liberal Crime Squad" />
<Option makefile_is_custom="1" />
<Option execution_dir="/home/brian/Desktop/Stuff/Games/Liberal-Crime-Squad/" />
<Option pch_mode="2" />
<Option compiler="gcc" />
Expand All @@ -25,6 +24,7 @@
<Compiler>
<Add option="-pedantic" />
<Add option="-Wall" />
<Add option="-std=c++11" />
<Add option="-g" />
<Add option="-Og" />
</Compiler>
Expand Down Expand Up @@ -68,8 +68,6 @@
</Build>
<Compiler>
<Add option="-std=c++11" />
<Add option="-mfpmath=sse" />
<Add option="-mtune=generic" />
<Add directory="../src" />
<Add directory="../src/pdcurses" />
<Add directory="../src/sdl" />
Expand All @@ -80,17 +78,10 @@
<Add directory="../src/sdl" />
</ResourceCompiler>
<Linker>
<Add option="-Wall" />
<Add option="-std=c++98" />
<Add option="-pedantic" />
<Add option="-mfpmath=sse" />
<Add option="-march=pentium3" />
<Add option="-mtune=generic" />
<Add option="-lmingw32" />
<Add option="-lSDL2main" />
<Add option="-lSDL2" />
<Add option="-lSDL2main" />
<Add option="-lSDL2_mixer" />
<Add library="../src/pdcurses/pdcurses.lib" />
<Add option="-lncurses" />
<Add directory="../src" />
<Add directory="../src/pdcurses" />
<Add directory="../src/sdl" />
Expand Down Expand Up @@ -120,6 +111,10 @@
<Unit filename="../src/compat.h" />
<Unit filename="../src/configfile.cpp" />
<Unit filename="../src/configfile.h" />
<Unit filename="../src/creature/augmentation.cpp" />
<Unit filename="../src/creature/augmentation.h" />
<Unit filename="../src/creature/augmenttype.cpp" />
<Unit filename="../src/creature/augmenttype.h" />
<Unit filename="../src/creature/creature.cpp" />
<Unit filename="../src/creature/creature.h" />
<Unit filename="../src/creature/creaturenames.cpp" />
Expand Down
Loading

0 comments on commit 127d712

Please sign in to comment.