Skip to content

Commit

Permalink
some derp changes, mostly to make things compile
Browse files Browse the repository at this point in the history
  • Loading branch information
peterix committed Aug 6, 2011
1 parent 4f8e62e commit d841ba0
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ include_directories (
${CMAKE_SOURCE_DIR}/dfhack/depends/md5/
${CMAKE_SOURCE_DIR}/dfhack/depends/tinyxml/
${CMAKE_SOURCE_DIR}/dfhack/
${CMAKE_SOURCE_DIR}/allegro/lib/
${CMAKE_SOURCE_DIR}
)
else(WIN32)
Expand Down Expand Up @@ -59,14 +58,14 @@ IF(UNIX)
${PROJECT_LIBS})
# windows
ELSE(UNIX)
SET(PROJECT_LIBS kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib allegro.lib allegro_primitives.lib allegro_font.lib allegro_ttf.lib allegro_image.lib allegro_dialog.lib libpng.lib zdll.lib winmm.lib psapi.lib opengl32.lib glu32.lib $(NOINHERIT))
SET(PROJECT_LIBS kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib allegro-5.0.3-monolith-md.lib winmm.lib psapi.lib opengl32.lib glu32.lib $(NOINHERIT))
include_directories (
${include_directories}
${stonesense_SOURCE_DIR}/allegro
${stonesense_SOURCE_DIR}/allegro5/include
)
LINK_DIRECTORIES(
${LINK_DIRECTORIES}
${stonesense_SOURCE_DIR}/allegro/lib
${stonesense_SOURCE_DIR}/allegro5/lib
)
ENDIF(UNIX)
DFHACK_PLUGIN(stonesense ${PROJECT_SRCS} LINK_LIBRARIES ${PROJECT_LIBS})
14 changes: 0 additions & 14 deletions ContentLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,20 +477,6 @@ char getAnimFrames(const char* framestring)
}
return aframes;
}
template <typename T>
int lookupIndexedType(const char* indexName, vector<T>& typeVector)
{
if (indexName == NULL || indexName[0] == 0)
{
return INVALID_INDEX;
}
uint32_t vsize = (uint32_t)typeVector.size();
for(uint32_t i=0; i < vsize; i++){
if (typeVector[i].id == indexName)
return i;
}
return INVALID_INDEX;
}

int lookupMaterialIndex(int matType, const char* strValue)
{
Expand Down
15 changes: 14 additions & 1 deletion ContentLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,20 @@ extern int loadConfigImgFile(const char* filename, TiXmlElement* referrer);
int lookupMaterialType(const char* strValue);
int lookupMaterialIndex(int matType, const char* strValue);
template <typename T>
int lookupIndexedType(const char* indexName, vector<T>& typeVector);
int lookupIndexedType(const char* indexName, std::vector<T>& typeVector)
{
if (indexName == NULL || indexName[0] == 0)
{
return INVALID_INDEX;
}
uint32_t vsize = (uint32_t)typeVector.size();
for(uint32_t i=0; i < vsize; i++)
{
if (typeVector[i].id == indexName)
return i;
}
return INVALID_INDEX;
}
const char *lookupMaterialTypeName(int matType);
const char *lookupMaterialName(int matType,int matIndex);
uint8_t lookupMaterialFore(int matType,int matIndex);
Expand Down
6 changes: 3 additions & 3 deletions GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1035,12 +1035,12 @@ int loadImgFile(const char* filename)
return (int)IMGFilelist.size() - 1;
}
}
/*
int loadImgFile(ALLEGRO_PATH* filepath)
{
char *filename = strcpy(filename,al_path_cstr(filepath, ALLEGRO_NATIVE_PATH_SEP));
return loadImgFile(filename);
return loadImgFile(al_path_cstr(filepath, ALLEGRO_NATIVE_PATH_SEP));
}

*/
void saveScreenshot(){
al_clear_to_color(al_map_rgb(config.backr,config.backg,config.backb));
paintboard();
Expand Down
2 changes: 1 addition & 1 deletion GUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ALLEGRO_BITMAP* getImgFile(int index);
void flushImgFiles();
//returns index into getImgFile. Will only create new bitmaps when needed
int loadImgFile(const char* filename);
int loadImgFile(ALLEGRO_PATH* filepath);
//int loadImgFile(ALLEGRO_PATH* filepath);
void DrawSpriteFromSheet( int spriteNum,ALLEGRO_BITMAP* spriteSheet, ALLEGRO_COLOR color, int x, int y, Block * b = 0);
ALLEGRO_BITMAP * CreateSpriteFromSheet( int spriteNum, ALLEGRO_BITMAP* spriteSheet);
ALLEGRO_BITMAP* load_bitmap_withWarning(const char* path);
Expand Down
3 changes: 2 additions & 1 deletion MapLoading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ void ReadCellToSegment(DFHack::Core& DF, WorldSegment& segment, int CellX, int C
//option for including hidden blocks
isHidden &= !config.show_hidden_blocks;
bool shouldBeIncluded = (!isOpenTerrain(t) || b->water.index || !designations[lx][ly].bits.skyview) && !isHidden;
/*
//include hidden blocks as shaded black
if(config.shade_hidden_blocks && isHidden && (isBlockOnVisibleEdgeOfSegment(&segment, b) || areNeighborsVisible(designations, lx, ly)))
{
Expand All @@ -416,7 +417,7 @@ void ReadCellToSegment(DFHack::Core& DF, WorldSegment& segment, int CellX, int C
b->building.sprites.push_back( sprite );
shouldBeIncluded= true;
}

*/
if( shouldBeIncluded )
{
//this only needs to be done for included blocks
Expand Down
1 change: 1 addition & 0 deletions dfhack/include/dfhack/Process.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ namespace DFHack
{
std::string name;
mutable void * vptr;
static int zlo;
public:
ClassNameCheck() : vptr(0) {};
ClassNameCheck(std::string _name) : name(_name), vptr(0) {};
Expand Down

0 comments on commit d841ba0

Please sign in to comment.