找回密码
 注册
查看: 11197|回复: 25

发布连连看2.3测试版

[复制链接]
发表于 2006-1-10 22:54:52 | 显示全部楼层 |阅读模式
http://www.linuxfans.org./nuke/modules.php?name=Site_Downloads&op=geninfo&did=4089

简短描述:
V2.2的bug列表:
1. 对于64位的机器,无法正确读取主题文件。[Fixed,2005年12月30日]
2. F4继续一个上次保存的处于暂停状态的游戏进度时,定时器没有停止.[Fixed,2005年12月31日]
3. 播放较长的声音时,导致游戏反应停滞。[Fixed,2006-1月2日]
4. 最小化到托盘时应该先自动暂停游戏。[Fixed,2006-1月9日]
5. 托盘图标不应该强制使用,而应该作为可选项。[Working]
6. Makefile中加入添加快速启动菜单项的操作。
7. 使用gtk_about_dialog代替现在的关于对话框。[需要gtk 2.6才支持此方法,故放弃。]
8. 添加水晶主题。



安装步骤:
./configure --prefix=/usr
make
make install
将快捷方式llk_linux.desktop拷贝到自己喜欢的地方。


测试环境:
MagicLinux 2.0RC1
发表于 2006-1-18 18:10:45 | 显示全部楼层
不知道现在是不是用alsa了?
回复

使用道具 举报

发表于 2006-4-5 20:14:07 | 显示全部楼层
楼主能否到 http://www.gnome-cn.org/software/ 发布一下? gnome-cn 已经正常工作了。:)
回复

使用道具 举报

 楼主| 发表于 2006-4-5 20:23:15 | 显示全部楼层
2.3beta1,gnome-cn上面有
回复

使用道具 举报

发表于 2006-4-6 12:35:29 | 显示全部楼层
有没有图片可以看看.
回复

使用道具 举报

发表于 2006-4-21 13:25:56 | 显示全部楼层
ubuntu/dapper   amd64已经打包好了。
http://linuxfans.org/nuke/module ... wn&did=4283
回复

使用道具 举报

 楼主| 发表于 2006-4-22 00:04:21 | 显示全部楼层
Thanks
回复

使用道具 举报

发表于 2006-7-28 23:10:36 | 显示全部楼层

报告小bug

一个是安装的时候,pak文件没有正确安装,需要进到pak文件的 子目录里在make install?
回复

使用道具 举报

 楼主| 发表于 2006-7-29 15:29:04 | 显示全部楼层
不需要,你是装在那个目录下?
如果是/usr,那么你手动吧pak拷贝到
/usr/share/llk_linux/
即可
回复

使用道具 举报

发表于 2006-8-2 15:34:03 | 显示全部楼层
另外,发现一个bug,不知道是不是我的FC5的问题,存到10个记录以后,每次game_over都会退出程序,报告错误:段错误。
trace 之后,发现失败在最后保存结果的函数里,如果只是我自己的问题,我会关掉这个功能,只有我自己玩而已。
如果大家也碰到了同样的问题,我可以做个patch!
另外:能不能用SDL重写连连看阿!
回复

使用道具 举报

 楼主| 发表于 2006-8-2 18:06:55 | 显示全部楼层
多谢你的bug报告,我会检查程序的。
如果你有空,帮忙修复bug,感激不尽:)
SDL我没有这个打算,你可以自己做
回复

使用道具 举报

发表于 2006-8-3 07:30:22 | 显示全部楼层
改过了,我把分数记录的函数改动了,放弃了使用链表的做法,改用数组。在我的系统上避免了段错误。代码也没有原来那么整齐

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
回复

使用道具 举报

发表于 2006-8-6 18:05:22 | 显示全部楼层
SDL 代码:
稍微修改一下,在这个版本的连连看应该也能用

[code:1]
void Board::loadSound() {
   if ( SOUND_OpenAudio ( 22050, 1, 1024 ) == -1 ) {
      no_sound = true;
      return;
   }
   no_sound = false;

   QString sound_file[NUM_SOUND] = {
      QString ( LLK_INSTALL_DIR ) + "/wav/cancel.wav",
      QString ( LLK_INSTALL_DIR ) + "/wav/click.wav",
      QString ( LLK_INSTALL_DIR ) + "/wav/gameover.wav",
      QString ( LLK_INSTALL_DIR ) + "/wav/hint.wav",
      QString ( LLK_INSTALL_DIR ) + "/wav/link.wav",
      QString ( LLK_INSTALL_DIR ) + "/wav/nolink.wav",
      QString ( LLK_INSTALL_DIR ) + "/wav/shuffle.wav",
      QString ( LLK_INSTALL_DIR ) + "/wav/win.wav",
      QString ( LLK_INSTALL_DIR ) + "/wav/award.wav",
      QString ( LLK_INSTALL_DIR ) + "/wav/bomb.wav"
   };

   for ( int i = 0; i < NUM_SOUND; i++ ) {
      m_snd[i] = SOUND_LoadWAV ( sound_file[i].ascii() );
   }
}

void Board::freeSound() {
   if ( no_sound ) {
      return;
   }
   for ( int i = 0; i < NUM_SOUND; i++ ) {
      SOUND_FreeWAV ( m_snd[i] );
   }
   SOUND_CloseAudio ();
}

void Board::playSound ( int num ) {
   if ( no_sound || m_snd[num] == NULL ) {
      return;
   }
   SOUND_PlayWAV ( m_snd[num] );
}
[/code:1]

[code:1]
//
// Copyright (c) 2005, 2006 Wei Mingzhi <[email protected]>
// All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
// 02110-1301, USA
//

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include "SDL.h"

static int audio_len = 0;
static unsigned char *audio_pos = NULL;
static SDL_AudioSpec audio_spec;
static bool g_fSDLInit = false;
bool g_fAudioOpened = false;

// The audio function callback takes the following parameters:
// stream:  A pointer to the audio buffer to be filled
// len:     The length (in bytes) of the audio buffer
static void SOUND_FillAudio(void *, unsigned char *stream, int len)
{
   // Only play if we have data left
   if (audio_len == 0)
      return;
   // Mix as much data as possible
   len = (len > audio_len) ? audio_len : len;
   SDL_MixAudio(stream, audio_pos, len, SDL_MIX_MAXVOLUME);
   audio_pos += len;
   audio_len -= len;
}

int SOUND_OpenAudio(int freq, int channels, int samples)
{
   if (g_fAudioOpened) {
      return 0;
   }

   // Set the audio format
   audio_spec.freq = freq;
   audio_spec.format = AUDIO_S16;
   audio_spec.channels = channels; // 1 = mono, 2 = stereo
   audio_spec.samples = samples;
   audio_spec.callback = SOUND_FillAudio;
   audio_spec.userdata = NULL;

   // Initialize audio
   if (!SDL_WasInit(SDL_INIT_AUDIO)) {
      if (SDL_Init(SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE) == -1) {
         fprintf(stderr, "FATAL ERROR: Could not initialize SDL: %s.\n", SDL_GetError());
         return -1;
      }
      g_fSDLInit = true;
   }

   // Open the audio device, forcing the desired format
   if (SDL_OpenAudio(&audio_spec, NULL) < 0) {
      fprintf(stderr, "WARNING: Couldn't open audio: %s\n", SDL_GetError());
      return -1;
   } else {
      g_fAudioOpened = true;
      return 0;
   }
}

int SOUND_CloseAudio()
{
   if (g_fAudioOpened) {
      SDL_CloseAudio();
      if (g_fSDLInit) {
         SDL_Quit();
         g_fSDLInit = false;
      }
   }
   return 0;
}

void *SOUND_LoadWAV(const char *filename)
{
   SDL_AudioCVT *wavecvt;
   SDL_AudioSpec wavespec, *loaded;
   unsigned char *buf;
   unsigned int len;

   if (!g_fAudioOpened) {
      return NULL;
   }

   wavecvt = (SDL_AudioCVT *)malloc(sizeof(SDL_AudioCVT));
   if (wavecvt == NULL) {
      return NULL;
   }

   loaded = SDL_LoadWAV_RW(SDL_RWFromFile(filename, "rb"), 1, &wavespec, &buf, &len);
   if (loaded == NULL) {
      free(wavecvt);
      return NULL;
   }

   // Build the audio converter and create conversion buffers
   if (SDL_BuildAudioCVT(wavecvt, wavespec.format, wavespec.channels, wavespec.freq,
      audio_spec.format, audio_spec.channels, audio_spec.freq) < 0) {
      SDL_FreeWAV(buf);
      free(wavecvt);
      return NULL;
   }
   int samplesize = ((wavespec.format & 0xFF) / 8) * wavespec.channels;
   wavecvt->len = len & ~(samplesize - 1);
   wavecvt->buf = (unsigned char *)malloc(wavecvt->len * wavecvt->len_mult);
   if (wavecvt->buf == NULL) {
      SDL_FreeWAV(buf);
      free(wavecvt);
      return NULL;
   }
   memcpy(wavecvt->buf, buf, len);
   SDL_FreeWAV(buf);

   // Run the audio converter
   if (SDL_ConvertAudio(wavecvt) < 0) {
      free(wavecvt->buf);
      free(wavecvt);
      return NULL;
   }

   return wavecvt;
}

void SOUND_FreeWAV(void *audio)
{
   if (audio == NULL) {
      return;
   }
   SDL_FreeWAV(((SDL_AudioCVT *)audio)->buf);
   free(audio);
}

void SOUND_PlayWAV(void *audio)
{
   if (audio == NULL) {
      audio_pos = NULL;
      audio_len = -1;
   } else {
      audio_pos = ((SDL_AudioCVT *)audio)->buf;
      audio_len = ((SDL_AudioCVT *)audio)->len * ((SDL_AudioCVT *)audio)->len_mult;
   }
   SDL_PauseAudio(0);
}
[/code:1]
回复

使用道具 举报

发表于 2006-8-6 18:06:12 | 显示全部楼层
好像没有人关心这个板块了?
我修改了main.c的文件,或者说是整理了一下。
把一些地方的重复调用换成了函数。另外独立了game_play_sound函数出来,为了能够应用SDL做了准备。
音乐文件的话,采用了时下最火的ogg格式。
回复

使用道具 举报

发表于 2006-8-6 20:56:59 | 显示全部楼层
谢谢楼上的代码,我采用了ogg的格式应该是类似
LoadMSU这样的函数。
vidieo的话,我会考虑要不要作,原作的重画已经不错了。而且不需要SDL这样的库来支持。
背景音乐的话,我做成可以选择的。不想装SDL库还可以用音效。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2025-2-5 23:59 , Processed in 0.038931 second(s), 16 queries .

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表