Skip to content

Commit

Permalink
Initial import.
Browse files Browse the repository at this point in the history
  • Loading branch information
waddlesplash committed Oct 31, 2013
0 parents commit be29173
Show file tree
Hide file tree
Showing 172 changed files with 4,662 additions and 0 deletions.
12 changes: 12 additions & 0 deletions LICENSE
@@ -0,0 +1,12 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ncurses.a
20 changes: 20 additions & 0 deletions README
@@ -0,0 +1,20 @@
BeMines 1.0 Beta 2

It's about time we had more than a near-exact clone of the classic Windows game, Minesweeper. If you have questions, requests, or bugs, please e-mail me at darkwyrm@gmail.com.

DarkWyrm

Controls

Left click: Reveal a box. Clicking on a mine will lose the game.

Right click: Change a box to either unmarked, flagged as a mine, or a question mark.

Middle click: Sonar ping which reveals all mines in a 3x3 square without the danger of setting them off. It comes with a 20 second cost added to your time. Left clicking while holding down the Alt key will also will do this.

Click with both buttons: If the tile is a number and the appropriate number of mines around it have been flagged, it will clear all the other squares around the number. Of course, if you've made a mistake, you'll probably set off a mine. Left clicking while holding down the Shift key will also do this.


About this version

This fixes a bunch of bugs, including resizing and redraw issues.
98 changes: 98 additions & 0 deletions src/AboutWindow.cpp
@@ -0,0 +1,98 @@
#include <Application.h>
#include <AppFileInfo.h>
#include <Roster.h>
#include <String.h>
#include <stdio.h>
#include <Screen.h>
#include <TranslationUtils.h>
#include "AboutWindow.h"

// In case I want to localize this later
#define TRANSLATE(x) x

AboutWindow::AboutWindow(void)
: BWindow(BRect(100,100,500,400),"Recibe", B_NO_BORDER_WINDOW_LOOK,
B_MODAL_APP_WINDOW_FEEL,
B_NOT_ZOOMABLE | B_NOT_RESIZABLE)
{
BScreen screen;
BRect screenrect(screen.Frame());

AboutView *aboutview=new AboutView(Bounds());
AddChild(aboutview);

MoveTo( (screenrect.Width()-Frame().Width())/2, (screenrect.Height()-Frame().Height())/2 );
}

AboutView::AboutView(BRect frame)
: BView (frame, "AboutView", B_FOLLOW_ALL, B_WILL_DRAW)
{
SetViewColor(126,126,190);

fLogo=BTranslationUtils::GetBitmap('JPEG',"AboutBeMines.jpg");

app_info ai;
version_info vi;
be_app->GetAppInfo(&ai);
BFile file(&ai.ref,B_READ_ONLY);
BAppFileInfo appinfo(&file);
appinfo.GetVersionInfo(&vi,B_APP_VERSION_KIND);

BString variety;
switch(vi.variety)
{
case 0:
variety=TRANSLATE("d");
break;
case 1:
variety=TRANSLATE("a");
break;
case 2:
variety=TRANSLATE("b");
break;
case 3:
variety=TRANSLATE("g");
break;
case 4:
variety=TRANSLATE("rc");
break;
default:
variety=TRANSLATE("Final");
break;
}

if(variety!="Final")
sprintf(version,"%s %lu.%lu %s%lu",TRANSLATE("v"),vi.major,
vi.middle,variety.String(),vi.internal);
else
sprintf(version,"%s %lu.%lu",TRANSLATE("v"),vi.major,vi.middle);

font_height height;
be_plain_font->GetHeight(&height);

versionpos.y=height.ascent+height.descent+height.leading+15;
versionpos.x=fLogo->Bounds().right - 5 - StringWidth(version);

SetDrawingMode(B_OP_OVER);
}

AboutView::~AboutView(void)
{
delete fLogo;
}

void AboutView::MouseDown(BPoint pt)
{
Window()->PostMessage(B_QUIT_REQUESTED);
}

void AboutView::AttachedToWindow(void)
{
Window()->ResizeTo(fLogo->Bounds().Width(),fLogo->Bounds().Height());
}

void AboutView::Draw(BRect update)
{
DrawBitmap(fLogo, BPoint(0,0));
// DrawString(version,versionpos);
}
50 changes: 50 additions & 0 deletions src/AboutWindow.h
@@ -0,0 +1,50 @@
#ifndef ABOUTWINDOW_H
#define ABOUTWINDOW_H

#include <Window.h>
#include <View.h>
#include <Bitmap.h>
#include <Button.h>
#include <Messenger.h>
#include <Font.h>
#include <StatusBar.h>

enum
{
ABOUT_STARTUP=0,
ABOUT_OK,
ABOUT_OK2=2
};

enum
{
M_RESET_STATUS='mrst',
M_SET_STATUS='msst',
M_UPDATE_STATUS='mups'
};

class AboutView : public BView
{
public:
AboutView(BRect frame);
~AboutView(void);
void AttachedToWindow(void);
void Draw(BRect update);
void MouseDown(BPoint pt);

BBitmap *fLogo;

char version[64];
BPoint versionpos;

uint8 fAboutFlags;
int32 fEntryCount;
};

class AboutWindow : public BWindow
{
public:
AboutWindow(void);
};

#endif
27 changes: 27 additions & 0 deletions src/App.cpp
@@ -0,0 +1,27 @@
#include "App.h"
#include "GameStyle.h"
#include "Globals.h"
#include "MainWindow.h"

App::App(void)
: BApplication("application/x-vnd.dw-BeMines")
{
gGameStyle = new GameStyle(NULL);

MainWindow *win = new MainWindow(BRect(100,100,500,400));
win->Show();
}


int
main(int argc, char **argv)
{
if (argc == 2 && strcmp(argv[1],"-cheat") == 0)
gCheatMode = true;

App app;

app.Run();

return 0;
}
12 changes: 12 additions & 0 deletions src/App.h
@@ -0,0 +1,12 @@
#ifndef APP_H
#define APP_H

#include <Application.h>

class App : public BApplication
{
public:
App(void);
};

#endif
39 changes: 39 additions & 0 deletions src/BeMines.pld
@@ -0,0 +1,39 @@
NAME=BeMines
TARGETNAME=BeMines
GROUP=Source Files
EXPANDGROUP=yes
SOURCEFILE=AboutWindow.cpp
SOURCEFILE=App.cpp
SOURCEFILE=CounterView.cpp
SOURCEFILE=CustomWindow.cpp
SOURCEFILE=FieldView.cpp
SOURCEFILE=GameStyle.cpp
SOURCEFILE=Globals.cpp
SOURCEFILE=MainWindow.cpp
SOURCEFILE=Minefield.cpp
SOURCEFILE=NewScoreWindow.cpp
SOURCEFILE=ScoreWindow.cpp
SOURCEFILE=TimerView.cpp
SOURCEFILE=BeMines.rsrc
GROUP=Third Party
EXPANDGROUP=yes
SOURCEFILE=BitmapButton.cpp
SOURCEFILE=DWindow.cpp
LOCALINCLUDE=/boot/home/Desktop/BeMines
LOCALINCLUDE=.
SYSTEMINCLUDE=/boot/develop/headers/be
SYSTEMINCLUDE=/boot/develop/headers/cpp
SYSTEMINCLUDE=/boot/develop/headers/posix
SYSTEMINCLUDE=/boot/home/config/include
LIBRARY=/boot/develop/lib/x86/libroot.so
LIBRARY=/boot/develop/lib/x86/libbe.so
LIBRARY=/boot/develop/lib/x86/libtranslation.so
LIBRARY=/boot/beos/etc/develop/zeta-r1-gcc2-x86/lib/x86/libmedia.so
RUNARGS=-cheat
CCDEBUG=no
CCPROFILE=no
CCOPSIZE=no
CCOPLEVEL=3
CCTARGETTYPE=0
CCEXTRA=
LDEXTRA=
Binary file added src/BeMines.rsrc
Binary file not shown.

0 comments on commit be29173

Please sign in to comment.