Skip to content

Commit

Permalink
Merge develop into next for external beta 3 (BB 10.0.09)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoffmannrim committed Sep 25, 2012
2 parents f50e425 + cdd3161 commit dc07e4a
Show file tree
Hide file tree
Showing 141 changed files with 696 additions and 7,166 deletions.
16 changes: 2 additions & 14 deletions Accelerometer/bar-descriptor.xml
Expand Up @@ -41,7 +41,7 @@
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->

<initialWindow>
<aspectRatio>landscape</aspectRatio>
<aspectRatio>portrait</aspectRatio>
<autoOrients>false</autoOrients>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
Expand Down Expand Up @@ -80,19 +80,7 @@
<!-- <splashscreen></splashscreen> -->

<!-- Request permission to execute native code. Required for native applications. -->
<action system="true">run_native</action>

<!-- The permissions requested by your application. -->
<!-- <action>access_shared</action> -->
<!-- <action>record_audio</action> -->
<!-- <action>read_geolocation</action> -->
<!-- <action>use_camera</action> -->
<!-- <action>access_internet</action> -->
<!-- <action>play_audio</action> -->
<!-- <action>post_notification</action> -->
<!-- <action>set_audio_volume</action> -->
<!-- <action>read_device_identifying_information</action> -->
<!-- <action>access_led_control</action> -->
<permission system="true">run_native</permission>

<!-- Ensure that shared libraries in the package are found at run-time. -->
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
Expand Down
5 changes: 2 additions & 3 deletions Accelerometer/dialogutil.c
Expand Up @@ -60,6 +60,8 @@ setup_screen()
return EXIT_FAILURE;
}

if (screen_create_window_group(screen_win, get_window_group_id()) != 0) goto fail;

int usage = SCREEN_USAGE_NATIVE;
if (screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_USAGE, &usage) != 0) goto fail;

Expand Down Expand Up @@ -97,8 +99,6 @@ setup_screen()

if (screen_create_window_buffers(screen_win, 1) != 0) goto fail;

if (screen_create_window_group(screen_win, get_window_group_id()) != 0) goto fail;

screen_buffer_t buff;
if (screen_get_window_property_pv(screen_win, SCREEN_PROPERTY_RENDER_BUFFERS, (void*)&buff) != 0) goto fail;

Expand Down Expand Up @@ -135,7 +135,6 @@ create_dialog()

dialog_create_alert(&main_dialog);
dialog_set_alert_message_text(main_dialog, "\n");
dialog_set_size(main_dialog, DIALOG_SIZE_FULL);
dialog_set_group_id(main_dialog, get_window_group_id());
dialog_set_cancel_required(main_dialog, true);
dialog_show(main_dialog);
Expand Down
4 changes: 2 additions & 2 deletions Accelerometer/manifest.properties
Expand Up @@ -49,10 +49,10 @@ libs: bps screen m

sources: main.c dialogutil.c dialogutil.h

resources: LICENSE NOTICE
resources: LICENSE NOTICE sample-splashscreen-landscape.png sample-splashscreen-portrait.png

readmes: readme.txt

orientation: landscape
orientation: portrait

#actions:
4 changes: 1 addition & 3 deletions Accelerometer/readme.txt
Expand Up @@ -17,9 +17,7 @@ Sample Description:
Requirements:

- BlackBerry® 10 Native SDK
- One of the following:
- BlackBerry® 10 device
- BlackBerry® 10 simulator
- BlackBerry® 10 device

========================================================================
Importing a project into the Native SDK:
Expand Down
16 changes: 2 additions & 14 deletions AudioControl/bar-descriptor.xml
Expand Up @@ -41,7 +41,7 @@
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->

<initialWindow>
<aspectRatio>landscape</aspectRatio>
<aspectRatio>portrait</aspectRatio>
<autoOrients>false</autoOrients>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
Expand Down Expand Up @@ -80,19 +80,7 @@
<!-- <splashscreen></splashscreen> -->

<!-- Request permission to execute native code. Required for native applications. -->
<action system="true">run_native</action>

<!-- The permissions requested by your application. -->
<!-- <action>access_shared</action> -->
<!-- <action>record_audio</action> -->
<!-- <action>read_geolocation</action> -->
<!-- <action>use_camera</action> -->
<!-- <action>access_internet</action> -->
<!-- <action>play_audio</action> -->
<!-- <action>post_notification</action> -->
<!-- <action>set_audio_volume</action> -->
<!-- <action>read_device_identifying_information</action> -->
<!-- <action>access_led_control</action> -->
<permission system="true">run_native</permission>

<!-- Ensure that shared libraries in the package are found at run-time. -->
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
Expand Down
5 changes: 2 additions & 3 deletions AudioControl/dialogutil.c
Expand Up @@ -60,6 +60,8 @@ setup_screen()
return EXIT_FAILURE;
}

if (screen_create_window_group(screen_win, get_window_group_id()) != 0) goto fail;

int usage = SCREEN_USAGE_NATIVE;
if (screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_USAGE, &usage) != 0) goto fail;

Expand Down Expand Up @@ -97,8 +99,6 @@ setup_screen()

if (screen_create_window_buffers(screen_win, 1) != 0) goto fail;

if (screen_create_window_group(screen_win, get_window_group_id()) != 0) goto fail;

screen_buffer_t buff;
if (screen_get_window_property_pv(screen_win, SCREEN_PROPERTY_RENDER_BUFFERS, (void*)&buff) != 0) goto fail;

Expand Down Expand Up @@ -135,7 +135,6 @@ create_dialog()

dialog_create_alert(&main_dialog);
dialog_set_alert_message_text(main_dialog, "\n");
dialog_set_size(main_dialog, DIALOG_SIZE_FULL);
dialog_set_group_id(main_dialog, get_window_group_id());
dialog_set_cancel_required(main_dialog, true);
dialog_show(main_dialog);
Expand Down
4 changes: 2 additions & 2 deletions AudioControl/manifest.properties
Expand Up @@ -49,10 +49,10 @@ libs: bps screen

sources: main.c dialogutil.c dialogutil.h

resources: LICENSE NOTICE
resources: LICENSE NOTICE sample-splashscreen-landscape.png sample-splashscreen-portrait.png

readmes: readme.txt

orientation: landscape
orientation: portrait

#actions:
6 changes: 3 additions & 3 deletions BelligerentBlocks/bar-descriptor.xml
Expand Up @@ -49,12 +49,12 @@


<icon><image>icon.png</image></icon>
<splashscreen>splash.png</splashscreen>
<splashScreens>splash.png</splashScreens>

<action system="true">run_native</action>
<permission system="true">run_native</permission>

<!-- Permission needed for Scoreloop -->
<action>play_audio</action>
<permission>play_audio</permission>

<env var="LD_LIBRARY_PATH" value="app/native/lib"/>

Expand Down
15 changes: 11 additions & 4 deletions BelligerentBlocks/src/GameLogic.cpp
Expand Up @@ -75,18 +75,25 @@ GameLogic::GameLogic(Platform &platform)
m_platform.getSize(m_sceneWidth, m_sceneHeight);

int dpi = m_platform.getDPI();

m_font = bbutil_load_font("/usr/fonts/font_repository/adobe/MyriadPro-Bold.otf", 15, dpi);
int point_size = (int)(15.0f / ((float)dpi / 170.0f ));

/* As bbutil renders text using device-specifc dpi, we need to compute
* a point size for the font, so that the text string fits into the bubble.
* Note that Playbook is used as a reference point in this equation as we
* know that at dpi of 170, font with point size ofi 15 fits into the
* bubble texture.
*/
m_font = bbutil_load_font("/usr/fonts/font_repository/monotype/arial.ttf", point_size, dpi);
if (!m_font) {
fprintf(stderr, "Unable to load font\n");
}

m_scoreFont = bbutil_load_font("/usr/fonts/font_repository/adobe/MyriadPro-Bold.otf", 30, dpi);
m_scoreFont = bbutil_load_font("/usr/fonts/font_repository/monotype/arial.ttf", point_size, dpi);
if (!m_scoreFont) {
fprintf(stderr, "Unable to load font\n");
}

m_leaderboardFont = bbutil_load_font("/usr/fonts/font_repository/adobe/MyriadPro-Bold.otf", 10, dpi);
m_leaderboardFont = bbutil_load_font("/usr/fonts/font_repository/monotype/arial.ttf", point_size, dpi);
if (!m_scoreFont) {
fprintf(stderr, "Unable to load font\n");
}
Expand Down
17 changes: 10 additions & 7 deletions BelligerentBlocks/src/Platform.cpp
Expand Up @@ -316,8 +316,10 @@ void Platform::submitScore(int score) {
return;
}

ASSERT(!m_score);
SC_Error_t rc = SC_Score_New(&m_score);
ASSERT(NULL == m_score);
ASSERT(NULL != m_scoreloopClient);

SC_Error_t rc = SC_Client_CreateScore(m_scoreloopClient, &m_score);
if (rc != SC_OK) {
fprintf(stderr, "Error creating score: %d\n", rc);
return;
Expand Down Expand Up @@ -361,14 +363,16 @@ void Platform::submitScoreComplete(SC_Error_t result) {
}

void Platform::fetchLeaderboard() {
const SC_Range_t scores = {0, NUM_LEADERBOARD_SCORES};

if (m_leaderboardOperationInProgress) {
// It is a GameLogic error to call fetchLeaderboard more than once
// before fetchLeaderboardComplete is executed.
ASSERT(!"fetchLeaderboard called while leaderboard operation in progress");
return;
}

SC_Error_t rc = SC_ScoresController_LoadRange(m_scoresController, 0, NUM_LEADERBOARD_SCORES);
SC_Error_t rc = SC_ScoresController_LoadRange(m_scoresController, scores);
if (rc != SC_OK) {
fprintf(stderr, "Error loading leaderboard score range: %d\n", rc);
return;
Expand All @@ -390,10 +394,10 @@ void Platform::fetchLeaderboardComplete(SC_Error_t result) {
return;
}

const unsigned int numScores = SC_ScoreList_GetScoresCount(scoreList);
const unsigned int numScores = SC_ScoreList_GetCount(scoreList);

for (unsigned int i = 0; i < numScores; i++) {
SC_Score_h score = SC_ScoreList_GetScore(scoreList, i);
SC_Score_h score = SC_ScoreList_GetAt(scoreList, i);
SC_User_h user = SC_Score_GetUser(score);

std::string login = "Unknown";
Expand Down Expand Up @@ -423,7 +427,7 @@ void Platform::fetchUser() {
return;
}

SC_Error_t result = SC_UserController_RequestUser(m_userController);
SC_Error_t result = SC_UserController_LoadUser(m_userController);
if (result != SC_OK) {
fprintf(stderr, "Error requesting scoreloop user: %d\n", result);
}
Expand Down Expand Up @@ -508,7 +512,6 @@ void Platform::displayPrompt(const std::string& prompt) {
}
dialog_instance_t displayNamePrompt;
dialog_create_prompt(&displayNamePrompt);
dialog_set_size(displayNamePrompt, DIALOG_SIZE_SMALL);

dialog_set_prompt_message_text(displayNamePrompt, prompt.c_str());
dialog_add_button(displayNamePrompt, DIALOG_OK_LABEL, true, NULL, true);
Expand Down

0 comments on commit dc07e4a

Please sign in to comment.