Remove Usage of RGB8 + Fix Menu BG Color
This commit is contained in:
parent
1d8ac2e6e1
commit
6243f8d855
4 changed files with 135 additions and 107 deletions
|
@ -1174,9 +1174,9 @@ void playerAttack(){
|
|||
void switchLevel(s8 change){
|
||||
currentLevel+=change;
|
||||
if(currentLevel > 4) currentLevel = 0; else if(currentLevel < 0) currentLevel = 4;
|
||||
if(currentLevel == 1) sf2d_set_clear_color(RGBA8(0x82, 0x6D, 0x6C, 0xFF));
|
||||
else if(currentLevel > 1) sf2d_set_clear_color(RGBA8(0x66, 0x66, 0x66, 0xFF));
|
||||
else sf2d_set_clear_color(RGBA8(0x00, 0x7F, 0x00, 0xFF));
|
||||
if(currentLevel == 1) sf2d_set_clear_color(0xFF6C6D82); //sf2d_set_clear_color(RGBA8(0x82, 0x6D, 0x6C, 0xFF));
|
||||
else if(currentLevel > 1) sf2d_set_clear_color(0xFF666666); //sf2d_set_clear_color(RGBA8(0x66, 0x66, 0x66, 0xFF));
|
||||
else sf2d_set_clear_color(0xFF007F00); //sf2d_set_clear_color(RGBA8(0x00, 0x7F, 0x00, 0xFF));
|
||||
}
|
||||
|
||||
bool playerIntersectsEntity(Entity* e){
|
||||
|
|
|
@ -734,15 +734,21 @@ void renderMenu(int menu,int xscr,int yscr){
|
|||
switch(menu){
|
||||
case MENU_TUTORIAL:
|
||||
sf2d_start_frame(GFX_TOP, GFX_LEFT);
|
||||
sf2d_draw_rectangle(0, 0, 400, 240, 0xFF0C0C0C); //You might think "real" black would be better, but it actually looks better that way
|
||||
|
||||
renderTutorialPage(true);
|
||||
sf2d_end_frame();
|
||||
sf2d_start_frame(GFX_BOTTOM, GFX_LEFT);
|
||||
sf2d_draw_rectangle(0, 0, 320, 240, 0xFF0C0C0C); //You might think "real" black would be better, but it actually looks better that way
|
||||
|
||||
renderTutorialPage(false);
|
||||
sf2d_end_frame();
|
||||
break;
|
||||
case MENU_SETTINGS_TP:
|
||||
offsetX = 0;offsetY = (currentSelection * 40) - 48;
|
||||
sf2d_start_frame(GFX_TOP, GFX_LEFT);
|
||||
sf2d_draw_rectangle(0, 0, 400, 240, 0xFF0C0C0C); //You might think "real" black would be better, but it actually looks better that way
|
||||
|
||||
drawText("Texture Packs",122,-16);
|
||||
for(i = 0; i < tpFileCount; ++i){
|
||||
int color = 0xFF923232;
|
||||
|
@ -789,6 +795,8 @@ void renderMenu(int menu,int xscr,int yscr){
|
|||
}
|
||||
sf2d_end_frame();
|
||||
sf2d_start_frame(GFX_BOTTOM, GFX_LEFT);
|
||||
sf2d_draw_rectangle(0, 0, 320, 240, 0xFF0C0C0C); //You might think "real" black would be better, but it actually looks better that way
|
||||
|
||||
drawText("Press to select", 58, 100);
|
||||
renderButtonIcon(k_accept.input & -k_accept.input, 128, 98, 1);
|
||||
drawText("Press to return", 58, 150);
|
||||
|
@ -797,6 +805,8 @@ void renderMenu(int menu,int xscr,int yscr){
|
|||
break;
|
||||
case MENU_LOADGAME:
|
||||
sf2d_start_frame(GFX_TOP, GFX_LEFT);
|
||||
sf2d_draw_rectangle(0, 0, 400, 240, 0xFF0C0C0C); //You might think "real" black would be better, but it actually looks better that way
|
||||
|
||||
if(!enteringName){ // World select
|
||||
offsetX = 0;offsetY = (currentSelection * 32) - 48;
|
||||
drawText("Select a file",122,-16);
|
||||
|
@ -839,6 +849,8 @@ void renderMenu(int menu,int xscr,int yscr){
|
|||
}
|
||||
sf2d_end_frame();
|
||||
sf2d_start_frame(GFX_BOTTOM, GFX_LEFT);
|
||||
sf2d_draw_rectangle(0, 0, 320, 240, 0xFF0C0C0C); //You might think "real" black would be better, but it actually looks better that way
|
||||
|
||||
if(!enteringName){ // World select
|
||||
if(!areYouSure){
|
||||
drawTextColor("Load World",100,12,0xFF3FFFFF);
|
||||
|
@ -880,11 +892,12 @@ void renderMenu(int menu,int xscr,int yscr){
|
|||
drawText("Press to return", 58, 210);
|
||||
renderButtonIcon(k_decline.input & -k_decline.input, 128, 208, 1);
|
||||
}
|
||||
|
||||
sf2d_end_frame();
|
||||
break;
|
||||
case MENU_SETTINGS_REBIND:
|
||||
sf2d_start_frame(GFX_TOP, GFX_LEFT);
|
||||
sf2d_draw_rectangle(0, 0, 400, 240, 0xFF0C0C0C); //You might think "real" black would be better, but it actually looks better that way
|
||||
|
||||
drawTextColor("Rebind Buttons",116,12,0xFF00AFAF);
|
||||
drawText("Button",16,32);
|
||||
drawText("Game",140,32);
|
||||
|
@ -951,6 +964,8 @@ void renderMenu(int menu,int xscr,int yscr){
|
|||
}
|
||||
sf2d_end_frame();
|
||||
sf2d_start_frame(GFX_BOTTOM, GFX_LEFT);
|
||||
sf2d_draw_rectangle(0, 0, 320, 240, 0xFF0C0C0C); //You might think "real" black would be better, but it actually looks better that way
|
||||
|
||||
if(!selBut){
|
||||
drawText("Press to select", 58, 80);
|
||||
renderButtonIcon(k_accept.input & -k_accept.input, 128, 78, 1);
|
||||
|
@ -1111,8 +1126,11 @@ void renderMenu(int menu,int xscr,int yscr){
|
|||
offsetX = 0;offsetY = 0;
|
||||
sf2d_end_frame();
|
||||
break;
|
||||
|
||||
case MENU_ABOUT:
|
||||
sf2d_start_frame(GFX_TOP, GFX_LEFT);
|
||||
sf2d_draw_rectangle(0, 0, 400, 240, 0xFF0C0C0C); //You might think "real" black would be better, but it actually looks better that way
|
||||
|
||||
drawText("About Minicraft",110,12);
|
||||
drawSizedText("Minicraft was made by Markus Persson for the",24,36,1.0);
|
||||
drawSizedText("22'nd ludum dare competition in december 2011.",16,48,1.0);
|
||||
|
@ -1125,6 +1143,8 @@ void renderMenu(int menu,int xscr,int yscr){
|
|||
drawSizedTextColor("TY Notch for creating a fun game to remake!",28,180,1.0,0xFF00FF00);
|
||||
sf2d_end_frame();
|
||||
sf2d_start_frame(GFX_BOTTOM, GFX_LEFT);
|
||||
sf2d_draw_rectangle(0, 0, 320, 240, 0xFF0C0C0C); //You might think "real" black would be better, but it actually looks better that way
|
||||
|
||||
drawTextColor("Special Thanks to:",52,12,0xFF7F7FFF);
|
||||
drawTextColor("Smea",136,60,0xFF2020FF);
|
||||
drawSizedTextColor("for ctrulib",116,80,1.0,0xFF2020FF);
|
||||
|
@ -1136,6 +1156,8 @@ void renderMenu(int menu,int xscr,int yscr){
|
|||
break;
|
||||
case MENU_SETTINGS:
|
||||
sf2d_start_frame(GFX_TOP, GFX_LEFT);
|
||||
sf2d_draw_rectangle(0, 0, 400, 240, 0xFF0C0C0C); //You might think "real" black would be better, but it actually looks better that way
|
||||
|
||||
drawText("Settings",(400-(8*12))/2,30);
|
||||
for(i = 4; i >= 0; --i){
|
||||
char* msg = setOptions[i];
|
||||
|
@ -1158,6 +1180,8 @@ void renderMenu(int menu,int xscr,int yscr){
|
|||
}
|
||||
sf2d_end_frame();
|
||||
sf2d_start_frame(GFX_BOTTOM, GFX_LEFT);
|
||||
sf2d_draw_rectangle(0, 0, 320, 240, 0xFF0C0C0C); //You might think "real" black would be better, but it actually looks better that way
|
||||
|
||||
switch(currentSelection){
|
||||
case 0:
|
||||
drawTextColor("Change the controls",(320 - (19 * 12))/2,24,0xFF7FFFFF);
|
||||
|
@ -1184,6 +1208,8 @@ void renderMenu(int menu,int xscr,int yscr){
|
|||
case MENU_TITLE:
|
||||
/* Top Screen */
|
||||
sf2d_start_frame(GFX_TOP, GFX_LEFT);
|
||||
sf2d_draw_rectangle(0, 0, 400, 240, 0xFF0C0C0C); //You might think "real" black would be better, but it actually looks better that way
|
||||
|
||||
renderTitle(76,16);
|
||||
|
||||
for(i = 4; i >= 0; --i){
|
||||
|
@ -1198,6 +1224,8 @@ void renderMenu(int menu,int xscr,int yscr){
|
|||
|
||||
/* Bottom Screen */
|
||||
sf2d_start_frame(GFX_BOTTOM, GFX_LEFT);
|
||||
sf2d_draw_rectangle(0, 0, 320, 240, 0xFF0C0C0C); //You might think "real" black would be better, but it actually looks better that way
|
||||
|
||||
int startX = 0, startY = 0;// relative coordinates ftw
|
||||
switch(currentSelection){
|
||||
case 0: // "Start Game"
|
||||
|
|
|
@ -483,10 +483,10 @@ void bakeLight(sf2d_texture* texture, int x, int y, int r) {
|
|||
if (dist <= r * r) {
|
||||
if (dist >= (r - (r / 5)) * (r - (r / 5))) {
|
||||
if ((xd % 2 == 0 && yd % 2 != 0) || (xd % 2 != 0 && yd % 2 == 0)) { // rand() % 4 != 0
|
||||
sf2d_set_pixel(texture, xx, yy, RGBA8(0, 0, 0, 255)); // set transparent pixel
|
||||
sf2d_set_pixel(texture, xx, yy, 0xFF000000); //RGBA8(0, 0, 0, 255)); // set transparent pixel
|
||||
}
|
||||
} else {
|
||||
sf2d_set_pixel(texture, xx, yy, RGBA8(0, 0, 0, 255)); // set transparent pixel
|
||||
sf2d_set_pixel(texture, xx, yy, 0xFF000000); //RGBA8(0, 0, 0, 255)); // set transparent pixel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ void setupGame(bool loadUpWorld) {
|
|||
|
||||
// Reset entity manager.
|
||||
memset(&eManager, 0, sizeof(eManager));
|
||||
sf2d_set_clear_color(RGBA8(0x82, 0x6D, 0x6C, 0xFF));
|
||||
sf2d_set_clear_color(0xFF6C6D82); //sf2d_set_clear_color(RGBA8(0x82, 0x6D, 0x6C, 0xFF));
|
||||
|
||||
if (!loadUpWorld) {
|
||||
initNewMap();
|
||||
|
@ -255,7 +255,7 @@ int main() {
|
|||
|
||||
offsetX = xscr;
|
||||
offsetY = yscr;
|
||||
sf2d_draw_rectangle(0, 0, 400, 240, RGBA8(12, 12, 12, 255)); //You might think "real" black would be better, but it actually looks better that way
|
||||
sf2d_draw_rectangle(0, 0, 400, 240, 0xFF0C0C0C); //RGBA8(12, 12, 12, 255)); //You might think "real" black would be better, but it actually looks better that way
|
||||
renderLightsToStencil();
|
||||
|
||||
renderBackground(xscr, yscr);
|
||||
|
|
Loading…
Add table
Reference in a new issue