Skip to content

Commit

Permalink
Changed the zoom method on splash logo (to closest pixel).
Browse files Browse the repository at this point in the history
Changed intro screen to a config option.
Prepping init file for launch.
  • Loading branch information
jonask84 committed Dec 15, 2009
1 parent 9b62f29 commit efe1831
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 45 deletions.
4 changes: 4 additions & 0 deletions Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ void parseConfigLine( string line ){
if( line.find("SHOW_OSD") != -1){
string result = parseStrFromLine( "SHOW_OSD", line );
config.show_osd = (result == "YES");
}
if( line.find("INTRO") != -1){
string result = parseStrFromLine( "INTRO", line );
config.show_intro = !(result == "OFF");
}
}

Expand Down
3 changes: 2 additions & 1 deletion common.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using namespace DFHack;
#include "Block.h"
#include <stdio.h>

//#define RELEASE
#define RELEASE

#define null 0

Expand Down Expand Up @@ -139,6 +139,7 @@ enum dirRelative{
//class WorldSegment;



//main.cpp
void correctBlockForSegmetOffset(int32_t& x, int32_t& y, int32_t& z);

Expand Down
1 change: 1 addition & 0 deletions commonTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ typedef struct {
int screenWidth;
int screenHeight;
bool Fullscreen;
bool show_intro;

Crd3D segmentSize;

Expand Down
19 changes: 13 additions & 6 deletions init.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Please note, these keywords are case sensitive for now.


Sets the width and height of the application in pixels.
[WIDTH:1100]
[WIDTH:1000]
[HEIGHT:800]


Expand All @@ -15,14 +15,16 @@ with your drivers, or the program will still load in window mode.

These two options set how large the cube laoaded from Dwarf Fortress is.
Each entry expects the number of tiles to load.
[SEGMENTSIZE_XY:80]
[SEGMENTSIZE_XY:90]
[SEGMENTSIZE_Z:8]

Change this off to skip the intro.
[INTRO:ON]

Lifts the segment up to the top off the screen, equivalent to a given
number of z levels.
Use this with a large segment size to get blocks covering the entire screen.
[LIFTSEGMENT:0]
[LIFTSEGMENT:18]


This value, in milliseconds, is how long Stonesense waits between
Expand All @@ -37,17 +39,22 @@ Amount to change the auto reload time with each press of Numpad+/-


Sets Stonesense in debug mode. Adds additional information to displays.
[DEBUGMODE:YES]
[DEBUGMODE:NO]


Amount of time, in milliseconds, before the animation swaps to the next frame.
This currently *also* requires a map reload to display the frame.
[ANIMATION_RATE:50]
[ANIMATION_RATE:150]


Shows all creatures, for debuging. Living, dead, kidnapped, caged, EVERY single one.
[ALLCREATURES:NO]


Follow the center of the DF window, rather than scale to the edges.
[TRACK_CENTER:YES]
[TRACK_CENTER:YES]

Follow DF window is on when Stonesense launches.
[FOLLOW_DF_SCREEN:YES]


72 changes: 34 additions & 38 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ int main(void)
config.segmentSize.z = DEFAULT_SEGMENTSIZE_Z;
config.show_creature_names = true;
config.show_osd = true;
config.show_intro = true;
config.track_center = false;
config.animation_step = 300;
config.follow_DFscreen = false;
Expand All @@ -156,46 +157,41 @@ int main(void)
set_alpha_blender();

loadGraphicsFromDisk();
#ifdef RELEASE
//centred splash image
{
BITMAP* SplashImage = load_bitmap_withWarning("splash.png");
masked_blit(SplashImage, screen, 0, 0,
(screen->w - SplashImage->w)/2,
(screen->h - SplashImage->h)/2,
SplashImage->w, SplashImage->h);
destroy_bitmap(SplashImage);
}

textprintf_centre(screen, font, config.screenWidth/2, 50, makecol(255,255,0), "Welcome to Stonesense!");
textprintf_centre(screen, font, config.screenWidth/2, 60, 0xffffff, "Stonesense is an isometric viewer for Dwarf Fortress.");

textprintf_centre(screen, font, config.screenWidth/2, 80, 0xffffff, "Programming, Jonas Ask and Kris Parker");
textprintf_centre(screen, font, config.screenWidth/2, 90, 0xffffff, "Lead graphics designer, Dale Holdampf");

textprintf_centre(screen, font, config.screenWidth/2, config.screenHeight-130, 0xffffff, "Contributors:");
textprintf_centre(screen, font, config.screenWidth/2, config.screenHeight-120, 0xffffff, "7¢ Nickel, Belal, DeKaFu, Dante, Deon, dyze, Errol, fifth angel,");
textprintf_centre(screen, font, config.screenWidth/2, config.screenHeight-110, 0xffffff, "frumpton, IDreamOfGiniCoeff, Impaler, Japa, jarathor, ");
textprintf_centre(screen, font, config.screenWidth/2, config.screenHeight-100, 0xffffff, "Jiri Petru, Lord Nightmare, McMe, Mike Mayday, Nexii ");
textprintf_centre(screen, font, config.screenWidth/2, config.screenHeight-90, 0xffffff, "Malthus, peterix, Seuss, Talvara, winner, and Xandrin.");

textprintf_centre(screen, font, config.screenWidth/2, config.screenHeight-70, 0xffffff, "With special thanks to peterix for making dfHack");

//"The program is in a very early alpha, we're only showcasing it to get ideas and feedback, so use it at your own risk."
textprintf_centre(screen, font, config.screenWidth/2, config.screenHeight-40, 0xffffff, "Press F9 to continue");

#endif

#ifdef RELEASE
while(!key[KEY_F9]) readkey();
#endif
if( config.show_intro ){
//centred splash image
{
BITMAP* SplashImage = load_bitmap_withWarning("splash.png");
masked_blit(SplashImage, screen, 0, 0,
(screen->w - SplashImage->w)/2,
(screen->h - SplashImage->h)/2,
SplashImage->w, SplashImage->h);
destroy_bitmap(SplashImage);
}

textprintf_centre(screen, font, config.screenWidth/2, 50, makecol(255,255,0), "Welcome to Stonesense!");
textprintf_centre(screen, font, config.screenWidth/2, 60, 0xffffff, "Stonesense is an isometric viewer for Dwarf Fortress.");

textprintf_centre(screen, font, config.screenWidth/2, 80, 0xffffff, "Programming, Jonas Ask and Kris Parker");
textprintf_centre(screen, font, config.screenWidth/2, 90, 0xffffff, "Lead graphics designer, Dale Holdampf");

textprintf_centre(screen, font, config.screenWidth/2, config.screenHeight-130, 0xffffff, "Contributors:");
textprintf_centre(screen, font, config.screenWidth/2, config.screenHeight-120, 0xffffff, "7¢ Nickel, Belal, DeKaFu, Dante, Deon, dyze, Errol, fifth angel,");
textprintf_centre(screen, font, config.screenWidth/2, config.screenHeight-110, 0xffffff, "frumpton, IDreamOfGiniCoeff, Impaler, Japa, jarathor, ");
textprintf_centre(screen, font, config.screenWidth/2, config.screenHeight-100, 0xffffff, "Jiri Petru, Lord Nightmare, McMe, Mike Mayday, Nexii ");
textprintf_centre(screen, font, config.screenWidth/2, config.screenHeight-90, 0xffffff, "Malthus, peterix, Seuss, Talvara, winner, and Xandrin.");

textprintf_centre(screen, font, config.screenWidth/2, config.screenHeight-70, 0xffffff, "With special thanks to peterix for making dfHack");

//"The program is in a very early alpha, we're only showcasing it to get ideas and feedback, so use it at your own risk."
textprintf_centre(screen, font, config.screenWidth/2, config.screenHeight-40, 0xffffff, "Press F9 to continue");

//pause till key is pressed
while(!key[KEY_F9]) readkey();
clear( screen );
}

//upper left corners
DisplayedSegmentX = DisplayedSegmentY = DisplayedSegmentZ = 0;
//Middle of fort
//DisplayedSegmentX = 131; DisplayedSegmentY = 100;DisplayedSegmentZ = 17;
//Two trees and a shrub
//DisplayedSegmentX = 114; DisplayedSegmentY = 124;DisplayedSegmentZ = 15;

//ramps
//DisplayedSegmentX = 238; DisplayedSegmentY = 220;DisplayedSegmentZ = 23;
Expand All @@ -206,7 +202,7 @@ int main(void)
//ford. desert map
//sDisplayedSegmentX = 78; DisplayedSegmentY = 123;DisplayedSegmentZ = 15;

DisplayedSegmentX = 155; DisplayedSegmentY = 177;DisplayedSegmentZ = 18;
DisplayedSegmentX = 125; DisplayedSegmentY = 125;DisplayedSegmentZ = 18;

//DisplayedSegmentX = 242; DisplayedSegmentY = 345;DisplayedSegmentZ = 15;

Expand Down
Binary file modified splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit efe1831

Please sign in to comment.