Skip to content

Commit aebebff

Browse files
committed
Misc. cleanups, remove unused things
1 parent 15097cd commit aebebff

File tree

46 files changed

+133
-764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+133
-764
lines changed

build-android/principia/src/main/java/com/bithack/principia/shared/AutosaveDialog.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ public class AutosaveDialog
1616

1717
public AutosaveDialog()
1818
{
19-
/*
20-
Log.v("Principia", String.format("Board: %s\nBrand:%s\nDevice:%s\nDisplay:%s\nModel:%s",
21-
android.os.Build.BOARD,
22-
android.os.Build.BRAND,
23-
android.os.Build.DEVICE,
24-
android.os.Build.DISPLAY,
25-
android.os.Build.MODEL
26-
));
27-
*/
2819
_dialog = new AlertDialog.Builder(PrincipiaActivity.mSingleton)
2920
.setMessage("Autosave file detected. Open or remove?")
3021
.setPositiveButton("Open", new OnClickListener(){

build-android/principia/src/main/java/com/bithack/principia/shared/CommunityDialog.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@ public CommunityDialog()
2424
.setMessage("Do you want to return to the community site or to the main menu?")
2525
.setPositiveButton("Community", new OnClickListener(){
2626
public void onClick(DialogInterface dialog, int which){
27-
//SDLActivity.wv_dialog.show();
28-
/*
29-
PackageManager pm = SDLActivity.mSingleton.getPackageManager();
30-
Intent queryIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://bithack.com"));
31-
ActivityInfo af = queryIntent.resolveActivityInfo(pm, 0);
32-
Intent launchIntent = new Intent(Intent.ACTION_MAIN);
33-
launchIntent.setClassName(af.packageName, af.name);
34-
SDLActivity.mSingleton.startActivity(launchIntent);
35-
*/
3627
SDLActivity.wv.loadUrl(PrincipiaBackend.getCurrentCommunityUrl());
3728
SDLActivity.wv_dialog.show();
3829
}}

build-android/principia/src/main/java/com/bithack/principia/shared/PublishDialog.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ public void onClick(View v) {
5858
return;
5959
}
6060

61-
if (descr.length() <= 15) {
62-
SDLActivity.message("You must enter a description of at least 15 characters for your level!", 0);
63-
return;
64-
}
65-
6661
PrincipiaBackend.setLevelName(name);
6762
PrincipiaBackend.setLevelDescription(descr);
6863
PrincipiaBackend.setLevelAllowDerivatives(cb_allow_derivatives.isChecked());
-4.02 KB
Binary file not shown.

data-shared/textures/ui/btn_field.png

-20.2 KB
Binary file not shown.
-6.11 KB
Binary file not shown.

data-shared/textures/ui/slider_bg.png

-966 Bytes
Binary file not shown.
-7.14 KB
Binary file not shown.

data-shared/textures/ui/test.png

-425 Bytes
Binary file not shown.

src/src/game-gui.cc

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
#include "widget_manager.hh"
3131
#include "font.hh"
3232
#include "text.hh"
33+
#if defined(TMS_BACKEND_LINUX) && defined(DEBUG)
34+
#define CREATE_SANDBOX_TEXTURES
3335
#include "savepng.h"
36+
#endif
3437

3538
#ifndef UINT32_MAX
3639
#define UINT32_MAX (4294967295U)
@@ -250,7 +253,7 @@ game::delete_entity(entity *e)
250253
if (e == adventure::player) {
251254
adventure::player = 0;
252255
}
253-
/**
256+
/**
254257
* For these special cases, we need to figure out
255258
* which part of the objects we're dealing with.
256259
* After that, we disconnect them from eachother and
@@ -828,7 +831,7 @@ game::menu_handle_event(tms::event *ev)
828831
this->recent[0] = (int)pending_ent[pid]->g_id;
829832
}
830833

831-
/* readd the entity to the scene, since the update method
834+
/* readd the entity to the scene, since the update method
832835
* has changed */
833836
this->remove_entity(pending_ent[pid]);
834837
this->add_entity(pending_ent[pid]);
@@ -918,7 +921,7 @@ game::menu_handle_event(tms::event *ev)
918921
}
919922
tdown_p[pid].y = sp.y;
920923
} else {
921-
/* not added yet, determine whether we are sliding the menu or
924+
/* not added yet, determine whether we are sliding the menu or
922925
* moving out an object */
923926
if (std::abs(tdown_p[pid].x - sp.x) > _tms.xppcm*.4f) {
924927
tvec3 pos;
@@ -1091,17 +1094,7 @@ game::widget_clicked(principia_wdg *w, uint8_t button_id, int pid)
10911094
ui::message("No description available for this level.");
10921095
}
10931096
} else {
1094-
if (W->is_puzzle()) {
1095-
ui::open_help_dialog(
1096-
"Level help",
1097-
W->level.descr,
1098-
false);
1099-
} else {
1100-
ui::open_help_dialog(
1101-
"Level description",
1102-
W->level.descr,
1103-
false);
1104-
}
1097+
ui::open_help_dialog("Level description", W->level.descr, false);
11051098
}
11061099
}
11071100
return true;
@@ -2567,14 +2560,14 @@ game::init_sandbox_menu()
25672560
}
25682561
}
25692562

2570-
/**
2571-
* Should only be called when we are generating new sandbox menu textures
2563+
/**
2564+
* Should only be called when we are generating new sandbox menu textures
25722565
* to be bundled in the release version.
25732566
**/
25742567
void
25752568
game::create_sandbox_menu()
25762569
{
2577-
#if defined TMS_BACKEND_LINUX && defined DEBUG
2570+
#ifdef CREATE_SANDBOX_TEXTURES
25782571
glDisable(GL_BLEND);
25792572

25802573
tms_assertf(glGetError() == 0, "VAFAN s 1");
@@ -3539,10 +3532,10 @@ game::render_sandbox_menu()
35393532
if (o.e->flag_active(ENTITY_IS_BETA)) {
35403533
/* render beta label */
35413534
tms_ddraw_set_color(this->get_surface()->ddraw, 1.f*menu_tint, 1.f*menu_tint, 0.2f*menu_tint, 1.f);
3542-
tms_ddraw_sprite(this->get_surface()->ddraw,
3535+
tms_ddraw_sprite(this->get_surface()->ddraw,
35433536
betasprite,
35443537
x1 + a_x +btn_outer_x/2.f,
3545-
cy+pp - betasprite->height/2.f,
3538+
cy+pp - betasprite->height/2.f,
35463539
//roundf(p.x), roundf(p.y-30),
35473540
betasprite->width*.8, betasprite->height*.8);
35483541
tms_ddraw_set_color(this->get_surface()->ddraw, 1.f*menu_tint, 1.f*menu_tint, 1.0f*menu_tint, 1.f);
@@ -3563,7 +3556,7 @@ game::render_sandbox_menu()
35633556
tms_ddraw_sprite(this->get_surface()->ddraw,
35643557
o.name,
35653558
x1 + a_x +btn_outer_x/2.f,
3566-
cy+pp - _tms.yppcm/2.5f,
3559+
cy+pp - _tms.yppcm/2.5f,
35673560
//roundf(p.x), roundf(p.y-30),
35683561
o.name->width*.8, o.name->height*.8);
35693562
//s_size,//o.name->width*scale,
@@ -3854,7 +3847,7 @@ game::render_inventory(void)
38543847
} else {
38553848
tms_ddraw_set_color(this->get_surface()->ddraw, .4f, .4f, .4f, 0.3f);
38563849
}
3857-
tms_ddraw_square(this->get_surface()->ddraw, iw*2.f, y,
3850+
tms_ddraw_square(this->get_surface()->ddraw, iw*2.f, y,
38583851
iw*3.f, ih*1.5f);
38593852

38603853
this->render_num(x, y, iw, ih, adventure::player->get_num_resources(n), 0, 0.f, false);
@@ -3867,13 +3860,13 @@ game::render_inventory(void)
38673860

38683861
if (base_y > _tms.window_height) {
38693862
tms_ddraw_set_color(this->get_surface()->ddraw, .7f+cp, .7f+cp, .7f+cp, .35f+(cp*.2f));
3870-
tms_ddraw_circle(this->get_surface()->ddraw, iw*3.f, _tms.window_height+ih,
3863+
tms_ddraw_circle(this->get_surface()->ddraw, iw*3.f, _tms.window_height+ih,
38713864
iw*4.f, ih*1.3f);
38723865
}
38733866

38743867
if (this->inventory_highest_y < -(ih*1.75f)) {
38753868
tms_ddraw_set_color(this->get_surface()->ddraw, .7f+cp, .7f+cp, .7f+cp, .35f+(cp*.2f));
3876-
tms_ddraw_circle(this->get_surface()->ddraw, iw*3.f, -ih,
3869+
tms_ddraw_circle(this->get_surface()->ddraw, iw*3.f, -ih,
38773870
iw*4.f, ih*1.3f);
38783871
}
38793872
}

0 commit comments

Comments
 (0)